The name of the chain
The chainId (number)
The RPC URL for the chain - may also be an array of URLs
The block explorer URL for the chain - may also be an array of URLs
Optional
nativeCurrency: ChainNativeCurrencyThe native currency for the chain, ETH by default
Optional
contracts: { Optional
ensOptional
ensOptional
multicall3?: ChainContractimport { getCustomChain, createSmartAccountClient } from "@biconomy/account"
const customChain = getCustomChain(
"My Custom Chain",
123456, // id
"https://rpc.my-custom-chain.io", // Can also pass an array of URLs
"https://explorer.my-custom-chain.io" // Can also pass an array of URLs
)
const account = privateKeyToAccount(`0x${privateKey}`)
const walletClientWithCustomChain = createWalletClient({
account,
chain: customChain,
transport: http()
})
const smartAccountCustomChain = await createSmartAccountClient({
signer: walletClientWithCustomChain,
bundlerUrl,
customChain
})
const { wait } = await smartAccountCustomChain.sendTransaction({
to: recipient,
value: 1n
})
const { success, receipt } = await wait();
console.log(success);
getCustomChain
Utility method for creating a custom chain object