Suggest chain : Add Leap to a non-native chain

Warning: This is an experimental feature supported on both the Leap extension and the mobile apps

Leap's 'suggest chain' feature allows front-ends to request adding new Cosmos-SDK based blockchains that isn't natively integrated to Leap extension or the Leap mobile app If the same chain is already added to Leap, nothing will happen. If the user rejects the request, an error will be thrown.

This allows all Cosmos-SDK blockchains to have permissionless, instant wallet and transaction signing support for front-ends.

interface ChainInfo {
    readonly rpc: string;
    readonly rest: string;
    readonly chainId: string;
    readonly chainName: string;
    /**
    * This indicates the type of coin that can be used for stake.
    * You can get actual currency information from Currencies.
    */
    readonly stakeCurrency: Currency;
    readonly walletUrlForStaking?: string;
    readonly bip44: {
        coinType: number;
    };
    readonly alternativeBIP44s?: BIP44[];
    readonly bech32Config: Bech32Config;
    
    readonly currencies: AppCurrency[];
    /**
    * This indicates which coin or token can be used for fee to send transaction.
    * You can get actual currency information from Currencies.
    */
    readonly feeCurrencies: FeeCurrency[];
    
    /**
    * Indicate the features supported by this chain. Ex) cosmwasm, secretwasm ...
    */
    readonly features?: string[];
    theme: {
          primaryColor: '#fff',
          gradient:
            'linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 100%)',
        },
    image: string
}
experimentalSuggestChain(chainInfo: SuggestingChainInfo): Promise<void>

Usage examples and recommendations

Example

await window.leap.experimentalSuggestChain({
  chainId: "canto_7700-1",
  chainName: "canto",
  rest: "https://api.canto.nodestake.top",
  rpc: "https://rpc.canto.nodestake.top",
  bip44: {
    coinType: 60,
  },
  bech32Config: {
    bech32PrefixAccAddr: "canto",
    bech32PrefixAccPub: "canto" + "pub",
    bech32PrefixValAddr: "canto" + "valoper",
    bech32PrefixValPub: "canto" + "valoperpub",
    bech32PrefixConsAddr: "canto" + "valcons",
    bech32PrefixConsPub: "canto" + "valconspub",
  },
  currencies: [
    {
      coinDenom: "canto",
      coinMinimalDenom: "acanto",
      coinDecimals: 18,
      coinGeckoId: "canto",
    },
  ],
  feeCurrencies: [
    {
      coinDenom: "canto",
      coinMinimalDenom: "acanto",
      coinDecimals: 18,
      coinGeckoId: "canto",
      gasPriceStep: {
        low: 0.01,
        average: 0.025,
        high: 0.04,
      },
    },
  ],
  stakeCurrency: {
    coinDenom: "canto",
    coinMinimalDenom: "acanto",
    coinDecimals: 18,
    coinGeckoId: "cosmos",
  },
  image:
    "https://raw.githubusercontent.com/leapwallet/assets/2289486990e1eaf9395270fffd1c41ba344ef602/images/logo.svg",
  theme: {
    primaryColor: "#fff",
    gradient:
      "linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 100%)",
  },
});

Last updated