# Viewing Keys

The encrypted nature of the secret smart contracts that power [SecretTokens](broken://pages/-MaeM1BAfj4LZ5IUZ8mB) and SecretSwap means that the balances on your wallet are not visible by default, even to you. In order to see these balances, you need to create the corresponding viewing keys.

In the SecretSwap app, you can select a SecretToken from the drop-down and the app will check your wallet for a viewing key. If one is found, the app will show your balance, otherwise it will show a button showing "View Balance".

![](/files/F0I8oAwLA18lrvQFZ2Hu)

Clicking this button triggers the creation of a viewing key for that SecretToken for your wallet. [Keplr](https://keplr.app/) will prompt you to approve this creation and submit the transaction.&#x20;

![](/files/jS8YFkJjN6rCOAHfO3QW)

This transaction needs a small amount of `SCRT` for network fees. &#x20;

![](/files/VolaktUiZeEcslM1fwvD)

Once this transaction is completed, the SecretSwap app will show your balance for that SecretToken, even if zero. Each SecretToken you wish to hold in your wallet will need a viewing key created. These keys can be copied and then imported into Keplr if you switch your wallet to a different browser.

### Adding Viewing Keys directly from Keplr

Viewing Keys can also be added directly from your Keplr wallet. In order to do this, you'll first need the contract address of the token you're going to be adding. A list of contract addresses can be found [here](broken://pages/-MaeGkiHk0llLH4jrY0O) or on [secretanalytics.xyz](http://secretanalytics.xyz/secretswap). Once you have the contract address for the token you'd like to add, open your Keplr wallet and click the button consisting of three lines in the top left corner. This will open the menu and reveal the following options:

![Select the 'Add Token' option from this menu](/files/quGG5Z5nqHq0JtKd52Nj)

Clicking the 'Add Token' option from the menu will open the following dialogue box:<br>

![Click 'Submit' when populated](https://files.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-MaeBBtp7oGfe-K-vG2b%2F-Mb7n620XBobaoWu5K23%2F-Mb7qCu7yraPumzx-vDz%2FScreenshot%20from%202021-06-01%2013-30-45.png?alt=media\&token=1d79260a-c70a-4dea-84d3-efd5bb392113)

Paste the contract address in the 'Contract Address' field and Keplr wallet will auto-populate the remainder of the details. In this example, we're adding the viewing key for sWBTC. Click the 'Submit' button and you'll once again be asked to authorize gas usage.<br>

![Click 'Approve' to finalize](https://files.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-MaeBBtp7oGfe-K-vG2b%2F-Mb7n620XBobaoWu5K23%2F-Mb7qxxUOmTdAzEwKipj%2FScreenshot%20from%202021-06-01%2013-30-54.png?alt=media\&token=543bbf85-5aa4-4583-a5d5-053d05fedb02)

Once you approve the gas usage, the Viewing Key will be added to your wallet and the balance of your added asset should now be showing on SecretSwap or showing as '0' if you have none of this asset. It's that simple!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.secretswap.net/the-protocol/viewing-keys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
