- having an
offlineSigner
for the provider - having either an
experimentalSuggestChain
or similar method to suggest chains to your wallet - a function
chainRegistryChainTo<YourWallet>
to convertchain-registry
data format to your wallet's data format
- make PR to
cosmos-kit/packages/<your-wallet>
- name the package
@cosmos-kit/<your-wallet>
For reference, see the keplr cosmos-kit package for integrating wallet.
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.
- add your images and wallet info to a registry
- the design may require a round image right now, but we can update that if it becomes an issue
- implement a class that extends the
MainWalletBase
abstract class - load the registry data as defaults to the wallet class
- if you have them, add your wallet's preferred endpoints and then use them (do NOT use other wallet's endpoints, please bring your own, or let cosmos-kit use chain-registry as the default)
This is the class for which a chain is specified for the wallet
- implement a class that extends the
ChainWalletBase
abstract class - set
address
,username
, andofflineSigner
in theupdate()
method - convert the chain info from
chain-registry
format using yourchainRegistryChainTo<YourWallet>
function and suggest your chain info to your wallet
This is your client. It probably lives on window
, e.g., window.keplr
. However, it is best if we abstract that for interoperability:
- don't use
window
directly, write a asyncget<YourWallet>FromExtension
method to return your client - make sure to protect your call to
window
with a returnif (typeof window === 'undefined')
so applications can leverage server side rendering w/o issues.
This is how we can read your wallet into the provider.
- export a
wallets
object from the root
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>
.
- optoinally, make PR to
chain-registry/packages/<your-wallet>
- name the package
@chain-registry/<your-wallet>
For reference, see the keplr chain-registry package for integrating your wallet data structure