scio-labs / use-inkathon

Typesafe React hooks and utility functions that simplify the process of working with Substrate-based networks and ink! smart contracts.
https://inkathon.xyz
GNU General Public License v3.0
49 stars 15 forks source link

Ability to use custom `SubstrateChain` objects #71

Open wottpal opened 1 month ago

niklasp commented 2 weeks ago

what exactly does this issue include?

I have the usecase 1 to include e.g. Polkadot relay as well as adding some data to the SubstrateChain as seen in example below e.g. tokenSymbol

interface SubstrateChainExtended extends SubstrateChain {
  tokenSymbol: string
  tokenDecimals?: number
}

export const polkadotRelay: SubstrateChainExtended = {
  network: "Polkadot",
  name: "Polkadot Relay Chain",
  rpcUrls: ["wss://rpc.polkadot.io"],
  ss58Prefix: 0,
  testnet: false,
  tokenSymbol: "DOT",
  tokenDecimals: 10,
  explorerUrls: { [SubstrateExplorer.Subscan]: "https://polkadot.subscan.io" },
}

export const kusamaRelay: SubstrateChainExtended = {
  network: "Kusama",
  name: "Kusama Relay Chain",
  rpcUrls: ["wss://kusama-rpc.polkadot.io"],
  ss58Prefix: 2,
  testnet: false,
  tokenSymbol: "KSM",
  tokenDecimals: 12,
  explorerUrls: { [SubstrateExplorer.Subscan]: "https://kusama.subscan.io" },
}