API Reference
A list of Leap Connect Wallet methods
Enable connection:
The window.leap.enable(chainIds) method redirects to the extension login page if it is locked. If the user hasn't permitted the webpage, it will ask the user to enable the webpage to access Leap.
window.leap.enable(chainId: string | Array<string>)
// you can pass a list of chainIds to get approval for multiple chains in one request
window.leap.enable(['chainId1', 'chainId2'])Note: In a case where multiple wallets are imported, users can select the wallet/wallets that are supposed to be enabled.
Get Key:
If the webpage has permission and Leap wallet is unlocked, this function will return the address and public key in the following format:
interface Key {
name: string;
algo: string;
pubKey: Uint8Array;
address: Uint8Array;
bech32Address: string;
isNanoLedger: boolean;
}
window.leap.getKey(chainId: string): Promise<Key>Sign Amino:
Like signAmino method of CosmJS OfflineDirectSigner, however, Leap's signAmino function takes the chain-id as a required parameter. Signs Amino-encoded StdSignDoc.
Sign Direct / Protobuf:
Like signDirect method of CosmJS OfflineDirectSigner, however, Leap's signDirect function takes the chain-id as a required parameter. Signs Proto-encoded StdSignDoc.
Request Signature for Arbitrary Message:
Delegate Transaction broadcasting:
Webpages can use this function to delegate the broadcasting of the transaction to LCD endpoints configured in the leap wallet. If the broadcast is successful, this method will return the transaction hash. Otherwise, it will throw an error.
CosmJS example
Leap’s API is similar to Keplr's to keep the integration of leap for the dApp as easy as possible.
Method to add a CW20 token
Method to check wallet connection
Disconnect from Dapp
Get Supported Chains
Last updated