People are struggling to set viewing keys right now through keplr. This is a way to get around it.
- Get the contract address you want to set the viewing key.
a. Go to Button Swap | Secret network | btn.group
b. Click on the ‘View’ button next to balance and copy contract address from ‘Add Token’ pop up.
- Click ‘Submit’
- Copy the provided key then click ‘Reject’.
- Goto the Smart contract interface | Secret network | btn.group
- Fill the Smart contract interface page as such:
a. Change from Query to Handle
b. Paste token contract address from before
c. Input ‘set_viewing_key’ into ‘Function name’ field
d. Click on ‘+ PARAM’
e. In the ‘Key’ input, enter type ‘key’
f. In ‘Value’, paste the key you copied before.
- Click ‘Submit’ and confirm both pop ups. The first one is to estimate the gas required and the second is to submit the actual transaction.
- Once successful, go back to button swap page and click on the view button again.
- This time click on checkbox ‘(Advanced) Import my own viewing key’.
- Input the viewing key and press Submit again.
Done!
Extra info: Keplr stores your viewing key for each token. Things are most likely broken right now because keplr is submitting the transaction to set the viewing key, but then not receiving confirmation and storing the viewing key.