Skip to content

Latest commit

 

History

History
70 lines (45 loc) · 5.12 KB

INTEGRATING-WALLETS.md

File metadata and controls

70 lines (45 loc) · 5.12 KB

CosmosKit Wallet Integrations

Requirements

  • having an offlineSigner for the provider
  • having either an experimentalSuggestChain or similar method to suggest chains to your wallet
  • a function chainRegistryChainTo<YourWallet> to convert chain-registry data format to your wallet's data format

1 Make a PR to add your wallet adapter

For reference, see the keplr cosmos-kit package for integrating wallet.

📝 Main wallet class

This is the wallet class without any chain sepcified, and presents wallet information to the user, and has methods to connect to the wallet. It has access to each supported chain wallet object.

⚡️ Chain wallet class

This is the class for which a chain is specified for the wallet

💴 Wallet client

This is your client. It probably lives on window, e.g., window.keplr. However, it is best if we abstract that for interoperability:

🔌 Exporting the wallet

This is how we can read your wallet into the provider.

2 Convert to your wallet data

If you use the same data structure as Keplr, you can use the Keplr conversion function.

The interface should be as follows:

import { Chain, AssetList } from '@chain-registry/types';
export const chainRegistryChainToYourWallet = (
  chain: Chain,
  assets: AssetList[]
): YourWalletChainInfo;

You can inline the function in this repo, however, it could be useful to publish to the chain-registry for other wallet adapters. Optionally, you can publish this method to @chain-registry/<your-wallet>.

For reference, see the keplr chain-registry package for integrating your wallet data structure