Comment on page
Add Leap to a Secret dapp
This is how you can add Connect to Leap on SCRT dapps
Adding Connect to Leap on your dapp should be fairly straightforward. You can either refer to the methods we have added below or use the docs made by the SCRT core team here : https://github.com/scrtlabs/secret.js#leap-cosmos-wallet
The webpage can request the user permission to add a SNIP-20 token to Leap's token list. Will throw an error if the user rejects the request.
If a SNIP-20 with the same contract address already exists, nothing will happen.
async suggestToken(chainId: string, contractAddress: string): Promise<void>
Returns the viewing key of a SNIP-20 token registered in Leap.
If the SNIP-20 of the contract address doesn't exist, it will throw an error.
async getSecret20ViewingKey( chainId: string, contractAddress: string ): Promise<string>;
Updates the viewing key of a SNIP-20 token.
If the SNIP-20 of the contract address exist, nothing will happen.
async updateViewingKey( chainId: string, contractAddress: string , viewingKey: string): Promise<void>;
We hope this information helps you integrate Leap into your SCRT Dapp. If you have any questions or need further assistance, please don't hesitate to reach out to us at [email protected]