Opstack Kit Chains
Support your OP-Stack network with "opstack-kit"
Installation
bash
npm i opstack-kit-chains
bash
pnpm i opstack-kit-chains
bash
bun i opstack-kit-chains
bash
yarn add opstack-kit-chains
How to
Opstack Kit Chains Quickly customize your network that uses Op Stack chains.
You can add "opstack-kit-chains" a network at this.
ts
// main.ts
import { sepolia, optimismSepolia } from 'opstack-kit-chains'
...
...
...
const config = getDefaultConfig({
appName: 'My RainbowKit App',
projectId: import.meta.env.VITE_SOME_KEY,
chains: [sepolia, optimismSepolia],
ssr: true,
});
---------------------------------------------------------
// config.ts
import { createConfig, http } from 'wagmi'
import { sepolia, optimismSepolia } from 'opstack-kit-chains'
export const config = createConfig({
chains: [sepolia, optimismSepolia],
transports: {
[sepolia.id]: http(),
[optimismSepolia.id]: http(),
},
})
tsx
import { useWriteDepositETH } from 'opstack-kit'
const { writeDepositETH } = useWriteDepositETH()
return (
<button
onClick={() =>
// It should be on the correct L1 network with l2ChainId to start the transaction.
writeDepositETH({
args: {
to: '0x215db47f1B2ae03ec45024Cf62ce82879b137469', // your addres
amount: 1n, // amount ETH (n = wei)
// Others call args (If that doesn't work, you can try adding the required args, e.g. gasLimit: 21000n,)
// gasLimit: 2100n,
// data: '0x',
},
l2ChainId: 11155420, // Your OP Stack chains by main/config.ts with "opstack-kit-chains"
})}
>
Deposit ETH
</button>
)
Check out the Support your OP-Stack network with "opstack-kit" for more.
Support networks
L1
L1 - Testnet |
---|
sepolia |
L1 - Mainnet |
---|
mainnet |
L2
L2 - Testnet |
---|
optimismSepolia, baseSepolia, zoraSepolia, fraxtalTestnet, modeTestnet |
L2 - Mainnet |
---|
optimism, base, zora, fraxtal, mode, redstone |