@web3-onboard/wagmi
Version:
Module to configure, connect and return web3-onboard wallets as wagmi wallets and wagmi-config to be used with wagmi-core methods
11 lines (10 loc) • 460 B
JavaScript
import { chainIdToViemImport } from '@web3-onboard/common';
import { fromHex, http } from 'viem';
export const createWalletId = (walletLabel) => walletLabel.replace(/\s/g, '') + 'Id';
export async function createWagmiChains(chains, transports) {
return (await Promise.all(chains.map(async (w3OChain) => {
const { id } = w3OChain;
transports[fromHex(id, 'number')] = http();
return (await chainIdToViemImport(w3OChain));
})));
}