From 5a763f345c864aa1abab119f27836f6f9a7cfe1a Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Sun, 26 Nov 2023 09:36:41 -0500 Subject: [PATCH 1/6] docs config --- docs/.vitepress/config.mts | 14 +++++++ docs/docs/hooks/L1/useSimulateDepositETH.md | 46 +++++++++++++++++++++ example/app/page.tsx | 11 ++--- src/hooks/useOpConfig.ts | 2 +- 4 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 docs/docs/hooks/L1/useSimulateDepositETH.md diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index f1ab78e..cf40ecf 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -24,6 +24,20 @@ export default defineConfig({ { text: 'Examples', link: '/docs/examples' }, ], }, + { + text: 'Hooks', + items: [ + { + text: 'L1', + items: [ + { + text: 'useSimulateDepositETH', + link: '/docs/hooks/L1/useSimulateDepositETH', + }, + ], + }, + ], + }, ], socialLinks: [ diff --git a/docs/docs/hooks/L1/useSimulateDepositETH.md b/docs/docs/hooks/L1/useSimulateDepositETH.md new file mode 100644 index 0000000..b001d31 --- /dev/null +++ b/docs/docs/hooks/L1/useSimulateDepositETH.md @@ -0,0 +1,46 @@ +# useSimulateDepositETH + +Simulates a deposit of ETH to L2. + +```ts [example.ts] +import { useSimulateDepositETH } from 'op-wagmi' + +function App() { + const result = useSimulateDepositETH({ + args: { + to: '0x968Bb4fF2482ff56Af1255019d5b955510A1159e', + amount: 1n, + }, + l2ChainId: 8453, + }) +} +``` + +## Return Value + +Returns wagmi's [useSimulateContract return type](https://beta.wagmi.sh/react/api/hooks/useSimulateContract#return-type). + +## Parameters + +### args + +- #### to + - **Type:** `Address` + - The address to deposit the tokens to. + +- #### amount + - **Type:** `bigint` + - The amount of ETH to deposit. + +- #### gasLimit (optional) + - **Type:** `number` + - The minimum gas limit to use for the deposit transaction. + +- #### data (optional) + - **Type:** `Hex` + - Data to include in the transaction. + +### l2ChainId + +- **Type:** `number` +- The chain ID of the chain you want to deposit to. diff --git a/example/app/page.tsx b/example/app/page.tsx index 9a41db4..e3bd9d3 100644 --- a/example/app/page.tsx +++ b/example/app/page.tsx @@ -6,17 +6,12 @@ import { DepositContainer } from '@/components/DepositContainer' import { FinalizeContainer } from '@/components/FinalizeContainer' import { ProveContainer } from '@/components/ProveContainer' import { WithdrawContainer } from '@/components/WithdrawContainer' -import { useEffect, useState } from 'react' +import { useState } from 'react' export default function Home() { - const [isClient, setIsClient] = useState(false) const [action, setAction] = useState<'deposit' | 'withdraw' | 'prove' | 'finalize'>('deposit') - useEffect(() => { - setIsClient(true) - }, []) - - return (isClient && ( + return (
🔴🔵 Superchain Bridge 🔵🔴 @@ -28,5 +23,5 @@ export default function Home() { {action === 'finalize' && }
- )) + ) } diff --git a/src/hooks/useOpConfig.ts b/src/hooks/useOpConfig.ts index b37c251..fc12ab0 100644 --- a/src/hooks/useOpConfig.ts +++ b/src/hooks/useOpConfig.ts @@ -22,7 +22,7 @@ const chains = { 8453: base, 84531: baseGoerli, 420: optimismGoerli, 10: optimis export function useOpConfig( parameters: UseConfigParameters = {}, ): UseConfigReturnType { - const config: UseConfigReturnType = { l2chains: chains, ...(parameters.config ?? useConfig(parameters)) } + const config: UseConfigReturnType = { l2chains: chains, ...useConfig(parameters) } // TODO: Return a better error here if (!config) throw new Error('No Wagmi Context provider found') From d936b7a4c1158b39d1140b93a571b610acbeec73 Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:48:30 -0500 Subject: [PATCH 2/6] docs --- docs/.vitepress/config.mts | 57 +- docs/docs/configuration.md | 92 +++ docs/docs/examples.md | 0 docs/docs/hooks/L1/useSimulateDepositERC20.md | 63 ++ docs/docs/hooks/L1/useSimulateDepositETH.md | 35 +- ...seSimulateFinalizeWithdrawalTransaction.md | 36 ++ .../useSimulateProveWithdrawalTransaction.md | 36 ++ docs/docs/hooks/L1/useWriteDepositERC20.md | 126 ++++ docs/docs/hooks/L1/useWriteDepositETH.md | 104 +++ .../useWriteFinalizeWithdrawalTransaction.md | 75 +++ .../L1/useWriteProveWithdrawalTransaction.md | 74 +++ .../docs/hooks/L2/useSimulateWithdrawERC20.md | 57 ++ docs/docs/hooks/L2/useSimulateWithdrawETH.md | 51 ++ docs/docs/hooks/L2/useWriteWithdrawERC20.md | 115 ++++ docs/docs/hooks/L2/useWriteWithdrawETH.md | 104 +++ docs/docs/introduction/quickstart.md | 1 - docs/index.md | 61 +- docs/reference/modules.md | 606 +++++++++++------- example/app/page.tsx | 11 +- src/hooks/useOpConfig.ts | 5 +- typedoc.json | 2 +- 21 files changed, 1445 insertions(+), 266 deletions(-) create mode 100644 docs/docs/configuration.md delete mode 100644 docs/docs/examples.md create mode 100644 docs/docs/hooks/L1/useSimulateDepositERC20.md create mode 100644 docs/docs/hooks/L1/useSimulateFinalizeWithdrawalTransaction.md create mode 100644 docs/docs/hooks/L1/useSimulateProveWithdrawalTransaction.md create mode 100644 docs/docs/hooks/L1/useWriteDepositERC20.md create mode 100644 docs/docs/hooks/L1/useWriteDepositETH.md create mode 100644 docs/docs/hooks/L1/useWriteFinalizeWithdrawalTransaction.md create mode 100644 docs/docs/hooks/L1/useWriteProveWithdrawalTransaction.md create mode 100644 docs/docs/hooks/L2/useSimulateWithdrawERC20.md create mode 100644 docs/docs/hooks/L2/useSimulateWithdrawETH.md create mode 100644 docs/docs/hooks/L2/useWriteWithdrawERC20.md create mode 100644 docs/docs/hooks/L2/useWriteWithdrawETH.md delete mode 100644 docs/docs/introduction/quickstart.md diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index cf40ecf..eca777e 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -21,7 +21,7 @@ export default defineConfig({ text: 'Introduction', items: [ { text: 'Getting started', link: '/' }, - { text: 'Examples', link: '/docs/examples' }, + { text: 'Configuration', link: '/docs/configuration' }, ], }, { @@ -34,10 +34,65 @@ export default defineConfig({ text: 'useSimulateDepositETH', link: '/docs/hooks/L1/useSimulateDepositETH', }, + { + text: 'useWriteDepositETH', + link: '/docs/hooks/L1/useWriteDepositETH', + }, + { + text: 'useSimulateDepositERC20', + link: '/docs/hooks/L1/useSimulateDepositERC20', + }, + { + text: 'useWriteDepositERC20', + link: '/docs/hooks/L1/useWriteDepositERC20', + }, + { + text: 'useSimulateProveWithdrawalTransaction', + link: '/docs/hooks/L1/useSimulateProveWithdrawalTransaction', + }, + { + text: 'useWriteProveWithdrawalTransaction', + link: '/docs/hooks/L1/useWriteProveWithdrawalTransaction', + }, + { + text: 'useSimulateFinalizeWithdrawalTransaction', + link: '/docs/hooks/L1/useSimulateFinalizeWithdrawalTransaction', + }, + { + text: 'useWriteFinalizeWithdrawalTransaction', + link: '/docs/hooks/L1/useWriteFinalizeWithdrawalTransaction', + }, + ], + }, + { + text: 'L2', + items: [ + { + text: 'useSimulateWithdrawETH', + link: '/docs/hooks/L2/useSimulateWithdrawETH', + }, + { + text: 'useWriteWithdrawETH', + link: '/docs/hooks/L2/useWriteWithdrawETH', + }, + { + text: 'useSimulateWithdrawERC20', + link: '/docs/hooks/L2/useSimulateWithdrawERC20', + }, + { + text: 'useWriteWithdrawERC20', + link: '/docs/hooks/L2/useWriteWithdrawERC20', + }, ], }, ], }, + { + text: 'Glossary', + items: [ + { text: 'Types', link: '/reference/modules' }, + ], + }, ], socialLinks: [ diff --git a/docs/docs/configuration.md b/docs/docs/configuration.md new file mode 100644 index 0000000..8446cf7 --- /dev/null +++ b/docs/docs/configuration.md @@ -0,0 +1,92 @@ +## Configuration + +OP Wagmi currently ships with support for Base, Base Goerli, Optimism, Optimism Goerli, Zora, and Zora Goerli. If you'd like to interact with other OP Stack chains, you can extend Wagmi's config to include a list of additional `l2Chains`. You'll also need to add the corresponding chain objects to your Wagmi config so OP Wagmi has access to RPC URLs etc. + +::: code-group + +```ts [l2Chains.ts] +export const customL2Chains = { + 1230123: { + // Your L2 chain's ID + chainId: 1230123, + // The corresponding L1 chain ID + l1ChainId: 1, + // L1 OP Stack contract addresses for your chain + l1Addresses: { + portal: { + address: '0x...', + chainId: 1, + }, + l2OutputOracle: { + address: '0x...', + chainId: 1, + }, + l1StandardBridge: { + address: '0x...', + chainId: 1, + }, + l1CrossDomainMessenger: { + address: '0x...', + chainId: 1, + }, + l1Erc721Bridge: { + address: '0x...', + chainId: 1, + }, + }, + // L2 OP Stack contract addresses for your chain + l2Addresses: { + l2L1MessagePasserAddress: { + address: '0x4200000000000000000000000000000000000016', + chainId: 1230123, + }, + l2StandardBridge: { + address: '0x4200000000000000000000000000000000000010', + chainId: 1230123, + }, + }, + }, +} +``` + +```tsx [app.tsx] +import { useWriteDepositETH } from 'op-wagmi' +import { useConfig } from 'wagmi' +import { customL2Chains } from './l2Chains' + +const { writeDepositETH } = useWriteDepositETH() +const config = useConfig() + +return ( + +) +``` + +```ts [config.ts] +import { createConfig, http } from 'wagmi' +import { mainnet, sepolia } from 'wagmi/chains' +import { customChain } from './chains' + +export const config = createConfig({ + chains: [mainnet, sepolia, customChain], + transports: { + [mainnet.id]: http(), + [sepolia.id]: http(), + [customChain.id]: http(), + }, +}) +``` + +::: diff --git a/docs/docs/examples.md b/docs/docs/examples.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/docs/hooks/L1/useSimulateDepositERC20.md b/docs/docs/hooks/L1/useSimulateDepositERC20.md new file mode 100644 index 0000000..7a60abe --- /dev/null +++ b/docs/docs/hooks/L1/useSimulateDepositERC20.md @@ -0,0 +1,63 @@ +# useSimulateDepositERC20 + +Simulates a deposit of an ERC20 to L2. + +```tsx [example.tsx] +import { useSimulateDepositERC20 } from 'op-wagmi' + +function App() { + const result = useSimulateDepositERC20({ + args: { + l1Token: '0xbe9895146f7af43049ca1c1ae358b0541ea49704', + l2Token: '0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22', + to: '0x968Bb4fF2482ff56Af1255019d5b955510A1159e', + amount: 1n, + }, + l2ChainId: 8453, + }) +} +``` + +## Parameters + +### args + +- #### l1Token + `Address` + + The contract address of the token on L1. + +- #### l2Token + `Address` + + The contract address of the token on L2. + +- #### to + `Address` + + The address to deposit the tokens to. + +- #### amount + `bigint` + + The amount to deposit. + +- #### minGasLimit (optional) + `number` + + The minimum gas limit to use for the deposit transaction. + +- #### extraData (optional) + `Hex` + + Extra data to include in the transaction. + +### l2ChainId + +`number` + +The chain ID of the chain you want to deposit to. + +## Return Value + +Returns wagmi's [useSimulateContract return type](https://beta.wagmi.sh/react/api/hooks/useSimulateContract#return-type). diff --git a/docs/docs/hooks/L1/useSimulateDepositETH.md b/docs/docs/hooks/L1/useSimulateDepositETH.md index b001d31..c72a88e 100644 --- a/docs/docs/hooks/L1/useSimulateDepositETH.md +++ b/docs/docs/hooks/L1/useSimulateDepositETH.md @@ -2,7 +2,7 @@ Simulates a deposit of ETH to L2. -```ts [example.ts] +```tsx [example.tsx] import { useSimulateDepositETH } from 'op-wagmi' function App() { @@ -16,31 +16,36 @@ function App() { } ``` -## Return Value - -Returns wagmi's [useSimulateContract return type](https://beta.wagmi.sh/react/api/hooks/useSimulateContract#return-type). - ## Parameters ### args - #### to - - **Type:** `Address` - - The address to deposit the tokens to. + `Address` + + The address to deposit the ETH to. - #### amount - - **Type:** `bigint` - - The amount of ETH to deposit. + `bigint` + + The amount of ETH to deposit. - #### gasLimit (optional) - - **Type:** `number` - - The minimum gas limit to use for the deposit transaction. + `number` + + The minimum gas limit to use for the deposit transaction. - #### data (optional) - - **Type:** `Hex` - - Data to include in the transaction. + `Hex` + + Data to include in the transaction. ### l2ChainId -- **Type:** `number` -- The chain ID of the chain you want to deposit to. +`number` + +The chain ID of the chain you want to deposit to. + +## Return Value + +Returns wagmi's [useSimulateContract return type](https://beta.wagmi.sh/react/api/hooks/useSimulateContract#return-type). diff --git a/docs/docs/hooks/L1/useSimulateFinalizeWithdrawalTransaction.md b/docs/docs/hooks/L1/useSimulateFinalizeWithdrawalTransaction.md new file mode 100644 index 0000000..d89b2a8 --- /dev/null +++ b/docs/docs/hooks/L1/useSimulateFinalizeWithdrawalTransaction.md @@ -0,0 +1,36 @@ +# useSimulateFinalizeWithdrawalTransaction + +Simulates finalizing a withdrawal transaction. + +```tsx [example.tsx] +import { useSimulateFinalizeWithdrawalTransaction } from 'op-wagmi' + +function App() { + const result = useSimulateFinalizeWithdrawalTransaction({ + args: { + withdrawalTxHash: + '0x18e70002441d72a82eebcf02786da417074c18cf54ca0eba49886773448151e8', + }, + l2ChainId: 8453, + }) +} +``` + +## Parameters + +### args + +- #### withdrawalTxHash + `Hash` + + The L2 transaction hash of the withdrawal initiation. + +### l2ChainId + +`number` + +The chain ID of the chain you want to withdraw from. + +## Return Value + +Returns wagmi's [useSimulateContract return type](https://beta.wagmi.sh/react/api/hooks/useSimulateContract#return-type). diff --git a/docs/docs/hooks/L1/useSimulateProveWithdrawalTransaction.md b/docs/docs/hooks/L1/useSimulateProveWithdrawalTransaction.md new file mode 100644 index 0000000..7e09bef --- /dev/null +++ b/docs/docs/hooks/L1/useSimulateProveWithdrawalTransaction.md @@ -0,0 +1,36 @@ +# useSimulateProveWithdrawalTransaction + +Simulates proving a withdrawal transaction. + +```tsx [example.tsx] +import { useSimulateProveWithdrawalTransaction } from 'op-wagmi' + +function App() { + const result = useSimulateProveWithdrawalTransaction({ + args: { + withdrawalTxHash: + '0x18e70002441d72a82eebcf02786da417074c18cf54ca0eba49886773448151e8', + }, + l2ChainId: 8453, + }) +} +``` + +## Parameters + +### args + +- #### withdrawalTxHash + `Hash` + + The L2 transaction hash of the withdrawal initiation. + +### l2ChainId + +`number` + +The chain ID of the chain you want to withdraw from. + +## Return Value + +Returns wagmi's [useSimulateContract return type](https://beta.wagmi.sh/react/api/hooks/useSimulateContract#return-type). diff --git a/docs/docs/hooks/L1/useWriteDepositERC20.md b/docs/docs/hooks/L1/useWriteDepositERC20.md new file mode 100644 index 0000000..a45a3de --- /dev/null +++ b/docs/docs/hooks/L1/useWriteDepositERC20.md @@ -0,0 +1,126 @@ +# useWriteDepositERC20 + +Action for executing a deposit of an ERC20 to L2. + +```tsx [example.tsx] +import { useWriteDepositERC20 } from 'op-wagmi' + +const { writeDepositERC20 } = useWriteDepositERC20() + +return ( + +) +``` + +## Parameters + +### Config + +`Config | undefined` + +Config to use instead of retrieving from the from nearest WagmiProvider. + +## Return Value + +### writeDepositERC20 + +`(variables: WriteDepositERC20Parameters) => void` + +The mutation function you can call with variables to trigger the deposit. + +- #### variables + - ##### args + + - ###### l1Token + `Address` + + The contract address of the token on L1. + + - ###### l2Token + `Address` + + The contract address of the token on L2. + + - ###### to + `Address` + + The address to deposit the tokens to. + + - ###### amount + `bigint` + + The amount to deposit. + + - ###### minGasLimit (optional) + `number` + + The minimum gas limit to use for the deposit transaction. + + - ###### extraData (optional) + `Hex` + + Extra data to include in the transaction. + + - ##### l2ChainId + `number` + + The chain ID of the chain you want to deposit to. + +### writeDepositERC20Async + +`(variables: WriteDepositERC20Parameters) => Promise` + +Similar to writeDepositERC20 but returns a promise which can be awaited. + +- #### variables + - ##### args + + - ###### l1Token + `Address` + + The contract address of the token on L1. + + - ###### l2Token + `Address` + + The contract address of the token on L2. + + - ###### to + `Address` + + The address to deposit the tokens to. + + - ###### amount + `bigint` + + The amount to deposit. + + - ###### minGasLimit (optional) + `number` + + The minimum gas limit to use for the deposit transaction. + + - ###### extraData (optional) + `Hex` + + Extra data to include in the transaction. + + - ##### l2ChainId + `number` + + The chain ID of the chain you want to deposit to. + +### The rest of wagmi's [useWriteContract return type](https://beta.wagmi.sh/react/api/hooks/useWrtieContract#return-type) (except `writeContract` and `writeContractAsync`). diff --git a/docs/docs/hooks/L1/useWriteDepositETH.md b/docs/docs/hooks/L1/useWriteDepositETH.md new file mode 100644 index 0000000..b1c4c22 --- /dev/null +++ b/docs/docs/hooks/L1/useWriteDepositETH.md @@ -0,0 +1,104 @@ +# useWriteDepositETH + +Action for executing a deposit of ETH to L2. + +```tsx [example.tsx] +import { useWriteDepositETH } from 'op-wagmi' + +const { writeDepositETH } = useWriteDepositETH() + +return ( + +) +``` + +## Parameters + +### Config + +`Config | undefined` + +Config to use instead of retrieving from the from nearest WagmiProvider. + +## Return Value + +### writeDepositETH + +`(variables: WriteDepositETHParameters) => void` + +The mutation function you can call with variables to trigger the ETH deposit. + +- #### variables + - ##### args + + - ###### to + `Address` + + The address to deposit the ETH to. + + - ###### amount + `bigint` + + The amount of ETH to deposit. + + - ###### gasLimit (optional) + `number` + + The minimum gas limit to use for the deposit transaction. + + - ###### data (optional) + `Hex` + + Data to include in the transaction. + + - ##### l2ChainId + `number` + + The chain ID of the chain you want to deposit to. + +### writeDepositETHAsync + +`(variables: WriteDepositETHParameters) => Promise` + +Similar to writeDepositETH but returns a promise which can be awaited. + +- #### variables + - ##### args + + - ###### to + `Address` + + The address to deposit the ETH to. + + - ###### amount + `bigint` + + The amount of ETH to deposit. + + - ###### gasLimit (optional) + `number` + + The minimum gas limit to use for the deposit transaction. + + - ###### data (optional) + `Hex` + + Data to include in the transaction. + + - ##### l2ChainId + `number` + + The chain ID of the chain you want to deposit to. + +### The rest of wagmi's [useWriteContract return type](https://beta.wagmi.sh/react/api/hooks/useWrtieContract#return-type) (except `writeContract` and `writeContractAsync`). diff --git a/docs/docs/hooks/L1/useWriteFinalizeWithdrawalTransaction.md b/docs/docs/hooks/L1/useWriteFinalizeWithdrawalTransaction.md new file mode 100644 index 0000000..acd7ad2 --- /dev/null +++ b/docs/docs/hooks/L1/useWriteFinalizeWithdrawalTransaction.md @@ -0,0 +1,75 @@ +# useWriteFinalizeWithdrawalTransaction + +Action for finalizing a withdrawal transaction. + +```tsx [example.tsx] +import { useWriteFinalizeWithdrawalTransaction } from 'op-wagmi' + +const { writeFinalizeWithdrawalTransaction } = + useWriteFinalizeWithdrawalTransaction() + +return ( + +) +``` + +## Parameters + +### Config + +`Config | undefined` + +Config to use instead of retrieving from the from nearest WagmiProvider. + +## Return Value + +### writeFinalizeWithdrawalTransaction + +`(variables: WriteFinalizeWithdrawalTransactionParameters) => void` + +The mutation function you can call with variables to trigger finalizing the provided withdrawal. + +- #### variables + - ##### args + + - ###### withdrawalTxHash + `Hash` + + The L2 transaction hash of the withdrawal initiation. + + - ##### l2ChainId + `number` + + The chain ID of the chain you are withdrawing from. + +### writeFinalizeWithdrawalTransactionAsync + +`(variables: WriteFinalizeWithdrawalTransactionParameters) => Promise` + +Similar to writeFinalizeWithdrawalTransaction but returns a promise which can be awaited. + +- #### variables + - ##### args + + - ###### withdrawalTxHash + `Hash` + + The L2 transaction hash of the withdrawal initiation. + + - ##### l2ChainId + `number` + + The chain ID of the chain you are withdrawing from. + +### The rest of wagmi's [useWriteContract return type](https://beta.wagmi.sh/react/api/hooks/useWrtieContract#return-type) (except `writeContract` and `writeContractAsync`). diff --git a/docs/docs/hooks/L1/useWriteProveWithdrawalTransaction.md b/docs/docs/hooks/L1/useWriteProveWithdrawalTransaction.md new file mode 100644 index 0000000..181f8c0 --- /dev/null +++ b/docs/docs/hooks/L1/useWriteProveWithdrawalTransaction.md @@ -0,0 +1,74 @@ +# useWriteProveWithdrawalTransaction + +Action for proving a withdrawal transaction. + +```tsx [example.tsx] +import { useWriteProveWithdrawalTransaction } from 'op-wagmi' + +const { writeProveWithdrawalTransaction } = useWriteProveWithdrawalTransaction() + +return ( + +) +``` + +## Parameters + +### Config + +`Config | undefined` + +Config to use instead of retrieving from the from nearest WagmiProvider. + +## Return Value + +### writeProveWithdrawalTransaction + +`(variables: WriteProveWithdrawalTransactionParameters) => void` + +The mutation function you can call with variables to trigger proving the provided withdrawal. + +- #### variables + - ##### args + + - ###### withdrawalTxHash + `Hash` + + The L2 transaction hash of the withdrawal initiation. + + - ##### l2ChainId + `number` + + The chain ID of the chain you are withdrawing from. + +### writeProveWithdrawalTransactionAsync + +`(variables: WriteProveWithdrawalTransactionParameters) => Promise` + +Similar to writeProveWithdrawalTransaction but returns a promise which can be awaited. + +- #### variables + - ##### args + + - ###### withdrawalTxHash + `Hash` + + The L2 transaction hash of the withdrawal initiation. + + - ##### l2ChainId + `number` + + The chain ID of the chain you are withdrawing from. + +### The rest of wagmi's [useWriteContract return type](https://beta.wagmi.sh/react/api/hooks/useWrtieContract#return-type) (except `writeContract` and `writeContractAsync`). diff --git a/docs/docs/hooks/L2/useSimulateWithdrawERC20.md b/docs/docs/hooks/L2/useSimulateWithdrawERC20.md new file mode 100644 index 0000000..3a1730f --- /dev/null +++ b/docs/docs/hooks/L2/useSimulateWithdrawERC20.md @@ -0,0 +1,57 @@ +# useSimulateWithdrawERC20 + +Simulates initiating a withdrawal of an ERC20 to L1. + +```tsx [example.tsx] +import { useSimulateWithdrawERC20 } from 'op-wagmi' + +function App() { + const result = useSimulateWithdrawERC20({ + args: { + l2Token: '0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22', + to: '0x968Bb4fF2482ff56Af1255019d5b955510A1159e', + amount: 1n, + }, + chainId: 8453, + }) +} +``` + +## Parameters + +### args + +- #### l2Token + `Address` + + The contract address of the token on L2. + +- #### to + `Address` + + The address to withdraw the tokens to. + +- #### amount + `bigint` + + The amount to withdraw. + +- #### minGasLimit (optional) + `number` + + Minimum gas limit to use for the transaction. + +- #### extraData (optional) + `Hex` + + Extra data to include in the transaction. + +### chainId + +`number` + +The chain ID of the chain you want to withdraw from. + +## Return Value + +Returns wagmi's [useSimulateContract return type](https://beta.wagmi.sh/react/api/hooks/useSimulateContract#return-type). diff --git a/docs/docs/hooks/L2/useSimulateWithdrawETH.md b/docs/docs/hooks/L2/useSimulateWithdrawETH.md new file mode 100644 index 0000000..7608d68 --- /dev/null +++ b/docs/docs/hooks/L2/useSimulateWithdrawETH.md @@ -0,0 +1,51 @@ +# useSimulateWithdrawETH + +Simulates initiating a withdrawal of ETH to L1. + +```tsx [example.tsx] +import { useSimulateWithdrawETH } from 'op-wagmi' + +function App() { + const result = useSimulateWithdrawETH({ + args: { + to: '0x968Bb4fF2482ff56Af1255019d5b955510A1159e', + amount: 1n, + }, + chainId: 8453, + }) +} +``` + +## Parameters + +### args + +- #### to + `Address` + + The address to withdraw the ETH to. + +- #### amount + `bigint` + + The amount of ETH to withdraw. + +- #### minGasLimit (optional) + `number` + + Minimum gas limit to use for the transaction. + +- #### extraData (optional) + `Hex` + + Extra data to include in the transaction. + +### chainId + +`number` + +The chain ID of the chain you want to withdraw from. + +## Return Value + +Returns wagmi's [useSimulateContract return type](https://beta.wagmi.sh/react/api/hooks/useSimulateContract#return-type). diff --git a/docs/docs/hooks/L2/useWriteWithdrawERC20.md b/docs/docs/hooks/L2/useWriteWithdrawERC20.md new file mode 100644 index 0000000..0061460 --- /dev/null +++ b/docs/docs/hooks/L2/useWriteWithdrawERC20.md @@ -0,0 +1,115 @@ +# useWriteWithdrawERC20 + +Action for initiating a withdrawal of an ERC20 to L1. + +```tsx [example.tsx] +import { useWriteWithdrawERC20 } from 'op-wagmi' + +const { writeWithdrawERC20 } = useWriteWithdrawERC20() + +return ( + +) +``` + +## Parameters + +### Config + +`Config | undefined` + +Config to use instead of retrieving from the from nearest WagmiProvider. + +## Return Value + +### writeWithdrawERC20 + +`(variables: WriteWithdrawERC20Parameters) => void` + +The mutation function you can call with variables to trigger initiating the ERC20 withdrawal. + +- #### variables + - ##### args + + - ###### l2Token + `Address` + + The contract address of the token on L2. + + - ###### to + `Address` + + The address to withdraw the tokens to. + + - ###### amount + `bigint` + + The amount to withdraw. + + - ###### minGasLimit (optional) + `number` + + Minimum gas limit to use for the transaction. + + - ###### extraData (optional) + `Hex` + + Extra data to include in the transaction. + + - ##### chainId + `number` + + The chain ID of the chain you want to withdraw from. + +### writeWithdrawERC20Async + +`(variables: WriteWithdrawERC20Parameters) => Promise` + +Similar to writeWithdrawERC20 but returns a promise which can be awaited. + +- #### variables + - ##### args + + - ###### l2Token + `Address` + + The contract address of the token on L2. + + - ###### to + `Address` + + The address to withdraw the tokens to. + + - ###### amount + `bigint` + + The amount to withdraw. + + - ###### minGasLimit (optional) + `number` + + Minimum gas limit to use for the transaction. + + - ###### extraData (optional) + `Hex` + + Extra data to include in the transaction. + + - ##### chainId + `number` + + The chain ID of the chain you want to withdraw from. + +### The rest of wagmi's [useWriteContract return type](https://beta.wagmi.sh/react/api/hooks/useWrtieContract#return-type) (except `writeContract` and `writeContractAsync`). diff --git a/docs/docs/hooks/L2/useWriteWithdrawETH.md b/docs/docs/hooks/L2/useWriteWithdrawETH.md new file mode 100644 index 0000000..f892a94 --- /dev/null +++ b/docs/docs/hooks/L2/useWriteWithdrawETH.md @@ -0,0 +1,104 @@ +# useWriteWithdrawETH + +Action for initiating a withdrawal of ETH to L1. + +```tsx [example.tsx] +import { useWriteWithdrawETH } from 'op-wagmi' + +const { writeWithdrawETH } = useWriteWithdrawETH() + +return ( + +) +``` + +## Parameters + +### Config + +`Config | undefined` + +Config to use instead of retrieving from the from nearest WagmiProvider. + +## Return Value + +### writeWithdrawETH + +`(variables: WriteWithdrawETHParameters) => void` + +The mutation function you can call with variables to trigger initiating the ETH withdrawal. + +- #### variables + - ##### args + + - ###### to + `Address` + + The address to withdraw the ETH to. + + - ###### amount + `bigint` + + The amount of ETH to withdraw. + + - ###### minGasLimit (optional) + `number` + + Minimum gas limit to use for the transaction. + + - ###### extraData (optional) + `Hex` + + Extra data to include in the transaction. + + - ##### chainId + `number` + + The chain ID of the chain you want to withdraw from. + +### writeWithdrawETHAsync + +`(variables: WriteWithdrawETHParameters) => Promise` + +Similar to writeWithdrawETH but returns a promise which can be awaited. + +- #### variables + - ##### args + + - ###### to + `Address` + + The address to withdraw the ETH to. + + - ###### amount + `bigint` + + The amount of ETH to withdraw. + + - ###### minGasLimit (optional) + `number` + + Minimum gas limit to use for the transaction. + + - ###### extraData (optional) + `Hex` + + Extra data to include in the transaction. + + - ##### chainId + `number` + + The chain ID of the chain you want to withdraw from. + +### The rest of wagmi's [useWriteContract return type](https://beta.wagmi.sh/react/api/hooks/useWrtieContract#return-type) (except `writeContract` and `writeContractAsync`). diff --git a/docs/docs/introduction/quickstart.md b/docs/docs/introduction/quickstart.md deleted file mode 100644 index f3fd7af..0000000 --- a/docs/docs/introduction/quickstart.md +++ /dev/null @@ -1 +0,0 @@ -This is a quickstart page diff --git a/docs/index.md b/docs/index.md index f92ef5f..fd374be 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1 +1,60 @@ -# OP Wagmi +# Getting Started + +## Overview + +op-wagmi is a library of [Wagmi](https://beta.wagmi.sh/) v2-style hooks for interacting with [OP Stack](https://stack.optimism.io/) L2 chains such as [Optimism](https://community.optimism.io/docs/useful-tools/networks/) and [Base](https://docs.base.org/). + +::: warning +op-wagmi is currently in alpha. The docs are not complete. The code is tested but is not yet recommended for production use. +::: + +## Features + +- Simplifies cross L1 & L2 interactions +- TypeScript ready +- Test suite running against [forked](https://ethereum.org/en/glossary/#fork) Ethereum network + +## Installation + +::: code-group + +```bash [npm] +npm i op-wagmi +``` + +```bash [pnpm] +pnpm i op-wagmi +``` + +```bash [bun] +bun i op-wagmi +``` + +::: + +## Example + +After configuring your app to use Wagmi, simply import op-wagmi hooks to start interacting with OP Stack chains. + +```tsx +import { useWriteDepositETH } from 'op-wagmi' + +const { writeDepositETH } = useWriteDepositETH() + +return ( + +) +``` + +Check out the [example Superchain Bridge](https://github.com/base-org/op-wagmi/tree/master/example) for more. diff --git a/docs/reference/modules.md b/docs/reference/modules.md index 29451ef..21d256b 100644 --- a/docs/reference/modules.md +++ b/docs/reference/modules.md @@ -7,23 +7,21 @@ ### Type Aliases - [UseSimulateDepositERC20Parameters](/reference/modules.md#usesimulatedepositerc20parameters) -- [UseSimulateDepositERC20ReturnType](/reference/modules.md#usesimulatedepositerc20returntype) - [UseSimulateDepositETHParameters](/reference/modules.md#usesimulatedepositethparameters) -- [UseSimulateDepositETHReturnType](/reference/modules.md#usesimulatedepositethreturntype) +- [UseSimulateFinalizeWithdrawalTransactionParameters](/reference/modules.md#usesimulatefinalizewithdrawaltransactionparameters) +- [UseSimulateProveWithdrawalTransactionParameters](/reference/modules.md#usesimulateprovewithdrawaltransactionparameters) - [UseSimulateWithdrawERC20Parameters](/reference/modules.md#usesimulatewithdrawerc20parameters) -- [UseSimulateWithdrawERC20ReturnType](/reference/modules.md#usesimulatewithdrawerc20returntype) - [UseSimulateWithdrawETHParameters](/reference/modules.md#usesimulatewithdrawethparameters) -- [UseSimulateWithdrawETHReturnType](/reference/modules.md#usesimulatewithdrawethreturntype) - [UseWriteDepositERC20Parameters](/reference/modules.md#usewritedepositerc20parameters) -- [UseWriteDepositERC20ReturnType](/reference/modules.md#usewritedepositerc20returntype) - [UseWriteDepositETHParameters](/reference/modules.md#usewritedepositethparameters) -- [UseWriteDepositETHReturnType](/reference/modules.md#usewritedepositethreturntype) +- [UseWriteFinalizeWithdrawalTransactionParameters](/reference/modules.md#usewritefinalizewithdrawaltransactionparameters) +- [UseWriteProveWithdrawalTransactionParameters](/reference/modules.md#usewriteprovewithdrawaltransactionparameters) - [UseWriteWithdrawERC20Parameters](/reference/modules.md#usewritewithdrawerc20parameters) -- [UseWriteWithdrawERC20ReturnType](/reference/modules.md#usewritewithdrawerc20returntype) - [UseWriteWithdrawETHParameters](/reference/modules.md#usewritewithdrawethparameters) -- [UseWriteWithdrawETHReturnType](/reference/modules.md#usewritewithdrawethreturntype) - [WriteDepositERC20Parameters](/reference/modules.md#writedepositerc20parameters) - [WriteDepositETHParameters](/reference/modules.md#writedepositethparameters) +- [WriteFinalizeWithdrawalTransactionParameters](/reference/modules.md#writefinalizewithdrawaltransactionparameters) +- [WriteProveWithdrawalTransactionParameters](/reference/modules.md#writeprovewithdrawaltransactionparameters) - [WriteWithdrawERC20Parameters](/reference/modules.md#writewithdrawerc20parameters) - [WriteWithdrawETHParameters](/reference/modules.md#writewithdrawethparameters) @@ -31,10 +29,14 @@ - [useSimulateDepositERC20](/reference/modules.md#usesimulatedepositerc20) - [useSimulateDepositETH](/reference/modules.md#usesimulatedepositeth) +- [useSimulateFinalizeWithdrawalTransaction](/reference/modules.md#usesimulatefinalizewithdrawaltransaction) +- [useSimulateProveWithdrawalTransaction](/reference/modules.md#usesimulateprovewithdrawaltransaction) - [useSimulateWithdrawERC20](/reference/modules.md#usesimulatewithdrawerc20) - [useSimulateWithdrawETH](/reference/modules.md#usesimulatewithdraweth) - [useWriteDepositERC20](/reference/modules.md#usewritedepositerc20) - [useWriteDepositETH](/reference/modules.md#usewritedepositeth) +- [useWriteFinalizeWithdrawalTransaction](/reference/modules.md#usewritefinalizewithdrawaltransaction) +- [useWriteProveWithdrawalTransaction](/reference/modules.md#usewriteprovewithdrawaltransaction) - [useWriteWithdrawERC20](/reference/modules.md#usewritewithdrawerc20) - [useWriteWithdrawETH](/reference/modules.md#usewritewithdraweth) @@ -42,558 +44,676 @@ ### UseSimulateDepositERC20Parameters -Ƭ **UseSimulateDepositERC20Parameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & `SimulateDepositERC20Parameters` +Ƭ **UseSimulateDepositERC20Parameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateDepositERC20Parameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `config` | extends `Config` = `ResolvedRegister`[`"config"`] | -| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | #### Defined in -[hooks/L1/useSimulateDepositERC20.ts:15](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useSimulateDepositERC20.ts#L15) +[hooks/L1/useSimulateDepositERC20.ts:14](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateDepositERC20.ts#L14) ---- +___ -### UseSimulateDepositERC20ReturnType +### UseSimulateDepositETHParameters -Ƭ **UseSimulateDepositERC20ReturnType**\<`config`, `chainId`\>: `UseSimulateOPActionBaseReturnType`\ +Ƭ **UseSimulateDepositETHParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateDepositETHParameters`, ``"args"``\>[``"args"``], ``"gasLimit"``\> & \{ `gasLimit?`: `number` } } & \{ `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `config` | extends `Config` = `ResolvedRegister`[`"config"`] | -| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | #### Defined in -[hooks/L1/useSimulateDepositERC20.ts:22](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useSimulateDepositERC20.ts#L22) +[hooks/L1/useSimulateDepositETH.ts:14](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateDepositETH.ts#L14) ---- +___ -### UseSimulateDepositETHParameters +### UseSimulateFinalizeWithdrawalTransactionParameters -Ƭ **UseSimulateDepositETHParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & `SimulateDepositETHParameters` +Ƭ **UseSimulateFinalizeWithdrawalTransactionParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `config` | extends `Config` = `ResolvedRegister`[`"config"`] | -| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | #### Defined in -[hooks/L1/useSimulateDepositETH.ts:15](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useSimulateDepositETH.ts#L15) +[hooks/L1/useSimulateFinalizeWithdrawalTransaction.ts:17](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateFinalizeWithdrawalTransaction.ts#L17) ---- +___ -### UseSimulateDepositETHReturnType +### UseSimulateProveWithdrawalTransactionParameters -Ƭ **UseSimulateDepositETHReturnType**\<`config`, `chainId`\>: `UseSimulateOPActionBaseReturnType`\ +Ƭ **UseSimulateProveWithdrawalTransactionParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `config` | extends `Config` = `ResolvedRegister`[`"config"`] | -| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | #### Defined in -[hooks/L1/useSimulateDepositETH.ts:22](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useSimulateDepositETH.ts#L22) +[hooks/L1/useSimulateProveWithdrawalTransaction.ts:23](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateProveWithdrawalTransaction.ts#L23) ---- +___ ### UseSimulateWithdrawERC20Parameters -Ƭ **UseSimulateWithdrawERC20Parameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & `SimulateWithdrawERC20Parameters` +Ƭ **UseSimulateWithdrawERC20Parameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateWithdrawERC20Parameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `config` | extends `Config` = `ResolvedRegister`[`"config"`] | -| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | #### Defined in -[hooks/L2/useSimulateWithdrawERC20.ts:15](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useSimulateWithdrawERC20.ts#L15) +[hooks/L2/useSimulateWithdrawERC20.ts:15](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useSimulateWithdrawERC20.ts#L15) ---- +___ -### UseSimulateWithdrawERC20ReturnType +### UseSimulateWithdrawETHParameters -Ƭ **UseSimulateWithdrawERC20ReturnType**\<`config`, `chainId`\>: `UseSimulateOPActionBaseReturnType`\ +Ƭ **UseSimulateWithdrawETHParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateWithdrawETHParameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `config` | extends `Config` = `ResolvedRegister`[`"config"`] | -| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | #### Defined in -[hooks/L2/useSimulateWithdrawERC20.ts:22](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useSimulateWithdrawERC20.ts#L22) +[hooks/L2/useSimulateWithdrawETH.ts:16](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useSimulateWithdrawETH.ts#L16) ---- +___ -### UseSimulateWithdrawETHParameters +### UseWriteDepositERC20Parameters -Ƭ **UseSimulateWithdrawETHParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & `SimulateWithdrawETHParameters` +Ƭ **UseWriteDepositERC20Parameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<`config`, `context`\> #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `config` | extends `Config` = `ResolvedRegister`[`"config"`] | -| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in -[hooks/L2/useSimulateWithdrawETH.ts:15](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useSimulateWithdrawETH.ts#L15) +[hooks/L1/useWriteDepositERC20.ts:23](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositERC20.ts#L23) ---- +___ -### UseSimulateWithdrawETHReturnType +### UseWriteDepositETHParameters -Ƭ **UseSimulateWithdrawETHReturnType**\<`config`, `chainId`\>: `UseSimulateOPActionBaseReturnType`\ +Ƭ **UseWriteDepositETHParameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<`config`, `context`\> #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------------------------------------- | -| `config` | extends `Config` = `ResolvedRegister`[`"config"`] | -| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in -[hooks/L2/useSimulateWithdrawETH.ts:22](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useSimulateWithdrawETH.ts#L22) +[hooks/L1/useWriteDepositETH.ts:27](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositETH.ts#L27) ---- +___ -### UseWriteDepositERC20Parameters +### UseWriteFinalizeWithdrawalTransactionParameters -Ƭ **UseWriteDepositERC20Parameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<[`WriteDepositERC20Parameters`](/reference/modules.md#writedepositerc20parameters), `config`, `context`\> +Ƭ **UseWriteFinalizeWithdrawalTransactionParameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<`config`, `context`\> #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in -[hooks/L1/useWriteDepositERC20.ts:14](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useWriteDepositERC20.ts#L14) +[hooks/L1/useWriteFinalizeWithdrawalTransaction.ts:30](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteFinalizeWithdrawalTransaction.ts#L30) ---- +___ -### UseWriteDepositERC20ReturnType +### UseWriteProveWithdrawalTransactionParameters -Ƭ **UseWriteDepositERC20ReturnType**\<`config`, `context`\>: `Omit`\<`UseWriteOPActionBaseReturnType`\<[`WriteDepositERC20Parameters`](/reference/modules.md#writedepositerc20parameters), `config`, `context`\>, `"write"` \| `"writeAsync"`\> & \{ `writeDepositERC20`: `UseWriteOPActionBaseReturnType`\<[`WriteDepositERC20Parameters`](/reference/modules.md#writedepositerc20parameters), `config`, `context`\>[`"write"`] ; `writeDepositERC20Async`: `UseWriteOPActionBaseReturnType`\<[`WriteDepositERC20Parameters`](/reference/modules.md#writedepositerc20parameters), `config`, `context`\>[`"writeAsync"`] } +Ƭ **UseWriteProveWithdrawalTransactionParameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<`config`, `context`\> #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in -[hooks/L1/useWriteDepositERC20.ts:17](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useWriteDepositERC20.ts#L17) +[hooks/L1/useWriteProveWithdrawalTransaction.ts:33](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteProveWithdrawalTransaction.ts#L33) ---- +___ -### UseWriteDepositETHParameters +### UseWriteWithdrawERC20Parameters -Ƭ **UseWriteDepositETHParameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<[`WriteDepositETHParameters`](/reference/modules.md#writedepositethparameters), `config`, `context`\> +Ƭ **UseWriteWithdrawERC20Parameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<`config`, `context`\> #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in -[hooks/L1/useWriteDepositETH.ts:14](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useWriteDepositETH.ts#L14) +[hooks/L2/useWriteWithdrawERC20.ts:23](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawERC20.ts#L23) ---- +___ -### UseWriteDepositETHReturnType +### UseWriteWithdrawETHParameters -Ƭ **UseWriteDepositETHReturnType**\<`config`, `context`\>: `Omit`\<`UseWriteOPActionBaseReturnType`\<[`WriteDepositETHParameters`](/reference/modules.md#writedepositethparameters), `config`, `context`\>, `"write"` \| `"writeAsync"`\> & \{ `writeDepositETH`: `UseWriteOPActionBaseReturnType`\<[`WriteDepositETHParameters`](/reference/modules.md#writedepositethparameters), `config`, `context`\>[`"write"`] ; `writeDepositETHAsync`: `UseWriteOPActionBaseReturnType`\<[`WriteDepositETHParameters`](/reference/modules.md#writedepositethparameters), `config`, `context`\>[`"writeAsync"`] } +Ƭ **UseWriteWithdrawETHParameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<`config`, `context`\> #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in -[hooks/L1/useWriteDepositETH.ts:17](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useWriteDepositETH.ts#L17) +[hooks/L2/useWriteWithdrawETH.ts:24](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawETH.ts#L24) ---- +___ -### UseWriteWithdrawERC20Parameters +### WriteDepositERC20Parameters -Ƭ **UseWriteWithdrawERC20Parameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<[`WriteWithdrawERC20Parameters`](/reference/modules.md#writewithdrawerc20parameters), `config`, `context`\> +Ƭ **WriteDepositERC20Parameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteDepositERC20ActionParameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | #### Defined in -[hooks/L2/useWriteWithdrawERC20.ts:14](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useWriteWithdrawERC20.ts#L14) +[hooks/L1/useWriteDepositERC20.ts:14](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositERC20.ts#L14) ---- +___ -### UseWriteWithdrawERC20ReturnType +### WriteDepositETHParameters -Ƭ **UseWriteWithdrawERC20ReturnType**\<`config`, `context`\>: `Omit`\<`UseWriteOPActionBaseReturnType`\<[`WriteWithdrawERC20Parameters`](/reference/modules.md#writewithdrawerc20parameters), `config`, `context`\>, `"write"` \| `"writeAsync"`\> & \{ `writeWithdrawERC20`: `UseWriteOPActionBaseReturnType`\<[`WriteWithdrawERC20Parameters`](/reference/modules.md#writewithdrawerc20parameters), `config`, `context`\>[`"write"`] ; `writeWithdrawERC20Async`: `UseWriteOPActionBaseReturnType`\<[`WriteWithdrawERC20Parameters`](/reference/modules.md#writewithdrawerc20parameters), `config`, `context`\>[`"writeAsync"`] } +Ƭ **WriteDepositETHParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteDepositETHActionParameters`, ``"args"``\>[``"args"``], ``"gasLimit"``\> & \{ `gasLimit?`: `number` } } & \{ `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | #### Defined in -[hooks/L2/useWriteWithdrawERC20.ts:21](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useWriteWithdrawERC20.ts#L21) +[hooks/L1/useWriteDepositETH.ts:18](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositETH.ts#L18) ---- +___ -### UseWriteWithdrawETHParameters +### WriteFinalizeWithdrawalTransactionParameters -Ƭ **UseWriteWithdrawETHParameters**\<`config`, `context`\>: `UseWriteOPActionBaseParameters`\<[`WriteWithdrawETHParameters`](/reference/modules.md#writewithdrawethparameters), `config`, `context`\> +Ƭ **WriteFinalizeWithdrawalTransactionParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | #### Defined in -[hooks/L2/useWriteWithdrawETH.ts:14](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useWriteWithdrawETH.ts#L14) +[hooks/L1/useWriteFinalizeWithdrawalTransaction.ts:20](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteFinalizeWithdrawalTransaction.ts#L20) ---- +___ -### UseWriteWithdrawETHReturnType +### WriteProveWithdrawalTransactionParameters -Ƭ **UseWriteWithdrawETHReturnType**\<`config`, `context`\>: `Omit`\<`UseWriteOPActionBaseReturnType`\<[`WriteWithdrawETHParameters`](/reference/modules.md#writewithdrawethparameters), `config`, `context`\>, `"write"` \| `"writeAsync"`\> & \{ `writeWithdrawETH`: `UseWriteOPActionBaseReturnType`\<[`WriteWithdrawETHParameters`](/reference/modules.md#writewithdrawethparameters), `config`, `context`\>[`"write"`] ; `writeWithdrawETHAsync`: `UseWriteOPActionBaseReturnType`\<[`WriteWithdrawETHParameters`](/reference/modules.md#writewithdrawethparameters), `config`, `context`\>[`"writeAsync"`] } +Ƭ **WriteProveWithdrawalTransactionParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | #### Defined in -[hooks/L2/useWriteWithdrawETH.ts:21](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useWriteWithdrawETH.ts#L21) +[hooks/L1/useWriteProveWithdrawalTransaction.ts:23](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteProveWithdrawalTransaction.ts#L23) ---- +___ -### WriteDepositERC20Parameters +### WriteWithdrawERC20Parameters + +Ƭ **WriteWithdrawERC20Parameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteWithdrawERC20ActionParameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } + +#### Type parameters -Ƭ **WriteDepositERC20Parameters**: `Omit`\<`WriteDepositERC20ActionParameters`, `"account"`\> & \{ `chainId?`: `number` } +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | #### Defined in -[hooks/L1/useWriteDepositERC20.ts:12](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useWriteDepositERC20.ts#L12) +[hooks/L2/useWriteWithdrawERC20.ts:14](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawERC20.ts#L14) ---- +___ -### WriteDepositETHParameters +### WriteWithdrawETHParameters + +Ƭ **WriteWithdrawETHParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteWithdrawETHActionParameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } -Ƭ **WriteDepositETHParameters**: `Omit`\<`WriteDepositETHActionParameters`, `"account"`\> & \{ `chainId?`: `number` } +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | #### Defined in -[hooks/L1/useWriteDepositETH.ts:12](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useWriteDepositETH.ts#L12) +[hooks/L2/useWriteWithdrawETH.ts:15](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawETH.ts#L15) + +## Functions ---- +### useSimulateDepositERC20 -### WriteWithdrawERC20Parameters +▸ **useSimulateDepositERC20**\<`config`, `chainId`\>(`parameters`): `UseSimulateDepositERC20ReturnType`\<`config`, `chainId`\> -Ƭ **WriteWithdrawERC20Parameters**: `Omit`\<`WriteWithdrawERC20ActionParameters`, `"account"`\> & \{ `chainId?`: `number` } +Simulates a deposit of ERC20 tokens to L2 + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `undefined` \| `number` = `undefined` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `parameters` | [`UseSimulateDepositERC20Parameters`](/reference/modules.md#usesimulatedepositerc20parameters)\<`config`, `chainId`\> | [UseSimulateDepositERC20Parameters](/reference/modules.md#usesimulatedepositerc20parameters) | + +#### Returns + +`UseSimulateDepositERC20ReturnType`\<`config`, `chainId`\> + +wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). UseSimulateDepositERC20ReturnType #### Defined in -[hooks/L2/useWriteWithdrawERC20.ts:12](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useWriteWithdrawERC20.ts#L12) +[hooks/L1/useSimulateDepositERC20.ts:33](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateDepositERC20.ts#L33) ---- +___ -### WriteWithdrawETHParameters +### useSimulateDepositETH + +▸ **useSimulateDepositETH**\<`config`, `chainId`\>(`parameters`): `UseSimulateDepositETHReturnType`\<`config`, `chainId`\> + +Simulates a deposit of ETH to L2 + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `undefined` \| `number` = `undefined` | -Ƭ **WriteWithdrawETHParameters**: `Omit`\<`WriteWithdrawETHActionParameters`, `"account"`\> & \{ `chainId?`: `number` } +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `parameters` | [`UseSimulateDepositETHParameters`](/reference/modules.md#usesimulatedepositethparameters)\<`config`, `chainId`\> | [UseSimulateDepositETHParameters](/reference/modules.md#usesimulatedepositethparameters) | + +#### Returns + +`UseSimulateDepositETHReturnType`\<`config`, `chainId`\> + +wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). UseSimulateDepositETHReturnType #### Defined in -[hooks/L2/useWriteWithdrawETH.ts:12](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useWriteWithdrawETH.ts#L12) +[hooks/L1/useSimulateDepositETH.ts:33](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateDepositETH.ts#L33) -## Functions +___ -### useSimulateDepositERC20 +### useSimulateFinalizeWithdrawalTransaction -▸ **useSimulateDepositERC20**\<`config`, `chainId`\>(`parameters`): [`UseSimulateDepositERC20ReturnType`](/reference/modules.md#usesimulatedepositerc20returntype)\<`config`, `chainId`\> +▸ **useSimulateFinalizeWithdrawalTransaction**\<`config`, `chainId`\>(`parameters`): `UseSimulateFinalizeWithdrawalTransactionReturnType`\<`config`, `chainId`\> -Simulates a deposit of ERC20 tokens to L2 +Simulates finalizing a withdrawal transaction. #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `config` | extends `Config` = `Config` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :----------- | :-------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | -| `parameters` | [`UseSimulateDepositERC20Parameters`](/reference/modules.md#usesimulatedepositerc20parameters)\<`config`, `chainId`\> | [UseSimulateDepositERC20Parameters](/reference/modules.md#usesimulatedepositerc20parameters) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `parameters` | [`UseSimulateFinalizeWithdrawalTransactionParameters`](/reference/modules.md#usesimulatefinalizewithdrawaltransactionparameters)\<`config`, `chainId`\> | [UseSimulateFinalizeWithdrawalTransactionParameters](/reference/modules.md#usesimulatefinalizewithdrawaltransactionparameters) | #### Returns -[`UseSimulateDepositERC20ReturnType`](/reference/modules.md#usesimulatedepositerc20returntype)\<`config`, `chainId`\> +`UseSimulateFinalizeWithdrawalTransactionReturnType`\<`config`, `chainId`\> -wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). [UseSimulateDepositERC20ReturnType](/reference/modules.md#usesimulatedepositerc20returntype) +wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). UseSimulateFinalizeWithdrawalTransactionReturnType #### Defined in -[hooks/L1/useSimulateDepositERC20.ts:32](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useSimulateDepositERC20.ts#L32) +[hooks/L1/useSimulateFinalizeWithdrawalTransaction.ts:39](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateFinalizeWithdrawalTransaction.ts#L39) ---- +___ -### useSimulateDepositETH +### useSimulateProveWithdrawalTransaction -▸ **useSimulateDepositETH**\<`config`, `chainId`\>(`parameters`): [`UseSimulateDepositETHReturnType`](/reference/modules.md#usesimulatedepositethreturntype)\<`config`, `chainId`\> +▸ **useSimulateProveWithdrawalTransaction**\<`config`, `chainId`\>(`parameters`): `UseSimulateProveWithdrawalTransactionReturnType`\<`config`, `chainId`\> -Simulates a deposit of ETH to L2 +Simulates proving a withdrawal transaction. #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `config` | extends `Config` = `Config` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :----------- | :---------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------- | -| `parameters` | [`UseSimulateDepositETHParameters`](/reference/modules.md#usesimulatedepositethparameters)\<`config`, `chainId`\> | [UseSimulateDepositETHParameters](/reference/modules.md#usesimulatedepositethparameters) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `parameters` | [`UseSimulateProveWithdrawalTransactionParameters`](/reference/modules.md#usesimulateprovewithdrawaltransactionparameters)\<`config`, `chainId`\> | [UseSimulateProveWithdrawalTransactionParameters](/reference/modules.md#usesimulateprovewithdrawaltransactionparameters) | #### Returns -[`UseSimulateDepositETHReturnType`](/reference/modules.md#usesimulatedepositethreturntype)\<`config`, `chainId`\> +`UseSimulateProveWithdrawalTransactionReturnType`\<`config`, `chainId`\> -wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). [UseSimulateDepositETHReturnType](/reference/modules.md#usesimulatedepositethreturntype) +wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). UseSimulateProveWithdrawalTransactionReturnType #### Defined in -[hooks/L1/useSimulateDepositETH.ts:32](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useSimulateDepositETH.ts#L32) +[hooks/L1/useSimulateProveWithdrawalTransaction.ts:45](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateProveWithdrawalTransaction.ts#L45) ---- +___ ### useSimulateWithdrawERC20 -▸ **useSimulateWithdrawERC20**\<`config`, `chainId`\>(`parameters`): [`UseSimulateWithdrawERC20ReturnType`](/reference/modules.md#usesimulatewithdrawerc20returntype)\<`config`, `chainId`\> +▸ **useSimulateWithdrawERC20**\<`config`, `chainId`\>(`parameters`): `UseSimulateWithdrawERC20ReturnType`\<`config`, `chainId`\> Simulates a withdrawal of ERC20 tokens to an L1 address. #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `config` | extends `Config` = `Config` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :----------- | :---------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `parameters` | [`UseSimulateWithdrawERC20Parameters`](/reference/modules.md#usesimulatewithdrawerc20parameters)\<`config`, `chainId`\> | [UseSimulateWithdrawERC20Parameters](/reference/modules.md#usesimulatewithdrawerc20parameters) | #### Returns -[`UseSimulateWithdrawERC20ReturnType`](/reference/modules.md#usesimulatewithdrawerc20returntype)\<`config`, `chainId`\> +`UseSimulateWithdrawERC20ReturnType`\<`config`, `chainId`\> -wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). [UseSimulateWithdrawERC20ReturnType](/reference/modules.md#usesimulatewithdrawerc20returntype) +wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). UseSimulateWithdrawERC20ReturnType #### Defined in -[hooks/L2/useSimulateWithdrawERC20.ts:32](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useSimulateWithdrawERC20.ts#L32) +[hooks/L2/useSimulateWithdrawERC20.ts:34](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useSimulateWithdrawERC20.ts#L34) ---- +___ ### useSimulateWithdrawETH -▸ **useSimulateWithdrawETH**\<`config`, `chainId`\>(`parameters`): [`UseSimulateWithdrawETHReturnType`](/reference/modules.md#usesimulatewithdrawethreturntype)\<`config`, `chainId`\> +▸ **useSimulateWithdrawETH**\<`config`, `chainId`\>(`parameters`): `UseSimulateWithdrawETHReturnType`\<`config`, `chainId`\> Simulates a withdrawal of ETH to an L1 address. #### Type parameters -| Name | Type | -| :-------- | :-------------------------------------------- | -| `config` | extends `Config` = `Config` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :----------- | :------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------- | +| Name | Type | Description | +| :------ | :------ | :------ | | `parameters` | [`UseSimulateWithdrawETHParameters`](/reference/modules.md#usesimulatewithdrawethparameters)\<`config`, `chainId`\> | [UseSimulateWithdrawETHParameters](/reference/modules.md#usesimulatewithdrawethparameters) | #### Returns -[`UseSimulateWithdrawETHReturnType`](/reference/modules.md#usesimulatewithdrawethreturntype)\<`config`, `chainId`\> +`UseSimulateWithdrawETHReturnType`\<`config`, `chainId`\> -wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). [UseSimulateWithdrawETHReturnType](/reference/modules.md#usesimulatewithdrawethreturntype) +wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/useSimulateContract#return-type). UseSimulateWithdrawETHReturnType #### Defined in -[hooks/L2/useSimulateWithdrawETH.ts:32](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useSimulateWithdrawETH.ts#L32) +[hooks/L2/useSimulateWithdrawETH.ts:35](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useSimulateWithdrawETH.ts#L35) ---- +___ ### useWriteDepositERC20 -▸ **useWriteDepositERC20**\<`config`, `context`\>(`parameters?`): [`UseWriteDepositERC20ReturnType`](/reference/modules.md#usewritedepositerc20returntype)\<`config`, `context`\> +▸ **useWriteDepositERC20**\<`config`, `context`\>(`args?`): `UseWriteDepositERC20ReturnType`\<`config`, `context`\> Deposits ERC20 tokens to L2 using the standard bridge #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | Description | -| :----------- | :-------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | -| `parameters` | [`UseWriteDepositERC20Parameters`](/reference/modules.md#usewritedepositerc20parameters)\<`config`, `context`\> | [UseWriteDepositERC20Parameters](/reference/modules.md#usewritedepositerc20parameters) | +| Name | Type | +| :------ | :------ | +| `args` | [`UseWriteDepositERC20Parameters`](/reference/modules.md#usewritedepositerc20parameters)\<`config`, `context`\> | #### Returns -[`UseWriteDepositERC20ReturnType`](/reference/modules.md#usewritedepositerc20returntype)\<`config`, `context`\> +`UseWriteDepositERC20ReturnType`\<`config`, `context`\> -wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). [UseWriteDepositERC20ReturnType](/reference/modules.md#usewritedepositerc20returntype) +wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). UseWriteDepositERC20ReturnType #### Defined in -[hooks/L1/useWriteDepositERC20.ts:40](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useWriteDepositERC20.ts#L40) +[hooks/L1/useWriteDepositERC20.ts:42](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositERC20.ts#L42) ---- +___ ### useWriteDepositETH -▸ **useWriteDepositETH**\<`config`, `context`\>(`parameters?`): [`UseWriteDepositETHReturnType`](/reference/modules.md#usewritedepositethreturntype)\<`config`, `context`\> +▸ **useWriteDepositETH**\<`config`, `context`\>(`args?`): `UseWriteDepositETHReturnType`\<`config`, `context`\> + +Deposits ETH to L2 using the OptimismPortal contract + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `args` | [`UseWriteDepositETHParameters`](/reference/modules.md#usewritedepositethparameters)\<`config`, `context`\> | + +#### Returns + +`UseWriteDepositETHReturnType`\<`config`, `context`\> + +wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). UseWriteDepositETHReturnType + +#### Defined in + +[hooks/L1/useWriteDepositETH.ts:83](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositETH.ts#L83) + +___ + +### useWriteFinalizeWithdrawalTransaction + +▸ **useWriteFinalizeWithdrawalTransaction**\<`config`, `context`\>(`args?`): `UseWriteFinalizeWithdrawalTransactionReturnType`\<`config`, `context`\> + +Deposits ETH to L2 using the OptimismPortal contract + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `args` | [`UseWriteFinalizeWithdrawalTransactionParameters`](/reference/modules.md#usewritefinalizewithdrawaltransactionparameters)\<`config`, `context`\> | + +#### Returns + +`UseWriteFinalizeWithdrawalTransactionReturnType`\<`config`, `context`\> + +wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). UseWriteFinalizeWithdrawalTransactionReturnType + +#### Defined in + +[hooks/L1/useWriteFinalizeWithdrawalTransaction.ts:87](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteFinalizeWithdrawalTransaction.ts#L87) + +___ + +### useWriteProveWithdrawalTransaction + +▸ **useWriteProveWithdrawalTransaction**\<`config`, `context`\>(`args?`): `UseWriteProveWithdrawalTransactionReturnType`\<`config`, `context`\> Deposits ETH to L2 using the OptimismPortal contract #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | Description | -| :----------- | :---------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | -| `parameters` | [`UseWriteDepositETHParameters`](/reference/modules.md#usewritedepositethparameters)\<`config`, `context`\> | [UseWriteDepositETHParameters](/reference/modules.md#usewritedepositethparameters) | +| Name | Type | +| :------ | :------ | +| `args` | [`UseWriteProveWithdrawalTransactionParameters`](/reference/modules.md#usewriteprovewithdrawaltransactionparameters)\<`config`, `context`\> | #### Returns -[`UseWriteDepositETHReturnType`](/reference/modules.md#usewritedepositethreturntype)\<`config`, `context`\> +`UseWriteProveWithdrawalTransactionReturnType`\<`config`, `context`\> -wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). [UseWriteDepositETHReturnType](/reference/modules.md#usewritedepositethreturntype) +wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). UseWriteProveWithdrawalTransactionReturnType #### Defined in -[hooks/L1/useWriteDepositETH.ts:40](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L1/useWriteDepositETH.ts#L40) +[hooks/L1/useWriteProveWithdrawalTransaction.ts:104](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteProveWithdrawalTransaction.ts#L104) ---- +___ ### useWriteWithdrawERC20 -▸ **useWriteWithdrawERC20**\<`config`, `context`\>(`parameters?`): [`UseWriteWithdrawERC20ReturnType`](/reference/modules.md#usewritewithdrawerc20returntype)\<`config`, `context`\> +▸ **useWriteWithdrawERC20**\<`config`, `context`\>(`args?`): `UseWriteWithdrawERC20ReturnType`\<`config`, `context`\> Withdraws ERC20 tokens to an L1 address. #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | Description | -| :----------- | :---------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------- | -| `parameters` | [`UseWriteWithdrawERC20Parameters`](/reference/modules.md#usewritewithdrawerc20parameters)\<`config`, `context`\> | [UseWriteWithdrawERC20Parameters](/reference/modules.md#usewritewithdrawerc20parameters) | +| Name | Type | +| :------ | :------ | +| `args` | [`UseWriteWithdrawERC20Parameters`](/reference/modules.md#usewritewithdrawerc20parameters)\<`config`, `context`\> | #### Returns -[`UseWriteWithdrawERC20ReturnType`](/reference/modules.md#usewritewithdrawerc20returntype)\<`config`, `context`\> +`UseWriteWithdrawERC20ReturnType`\<`config`, `context`\> -wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). [UseWriteWithdrawERC20ReturnType](/reference/modules.md#usewritewithdrawerc20returntype) +wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). UseWriteWithdrawERC20ReturnType #### Defined in -[hooks/L2/useWriteWithdrawERC20.ts:44](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useWriteWithdrawERC20.ts#L44) +[hooks/L2/useWriteWithdrawERC20.ts:42](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawERC20.ts#L42) ---- +___ ### useWriteWithdrawETH -▸ **useWriteWithdrawETH**\<`config`, `context`\>(`parameters?`): [`UseWriteWithdrawETHReturnType`](/reference/modules.md#usewritewithdrawethreturntype)\<`config`, `context`\> +▸ **useWriteWithdrawETH**\<`config`, `context`\>(`args?`): `UseWriteWithdrawETHReturnType`\<`config`, `context`\> Withdraws ETH to an L1 address. #### Type parameters -| Name | Type | -| :-------- | :-------------------------- | -| `config` | extends `Config` = `Config` | -| `context` | `unknown` | +| Name | Type | +| :------ | :------ | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | Description | -| :----------- | :------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------- | -| `parameters` | [`UseWriteWithdrawETHParameters`](/reference/modules.md#usewritewithdrawethparameters)\<`config`, `context`\> | [UseWriteWithdrawETHParameters](/reference/modules.md#usewritewithdrawethparameters) | +| Name | Type | +| :------ | :------ | +| `args` | [`UseWriteWithdrawETHParameters`](/reference/modules.md#usewritewithdrawethparameters)\<`config`, `context`\> | #### Returns -[`UseWriteWithdrawETHReturnType`](/reference/modules.md#usewritewithdrawethreturntype)\<`config`, `context`\> +`UseWriteWithdrawETHReturnType`\<`config`, `context`\> -wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). [UseWriteWithdrawETHReturnType](/reference/modules.md#usewritewithdrawethreturntype) +wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useWrtieContract#return-type). UseWriteWithdrawETHReturnType #### Defined in -[hooks/L2/useWriteWithdrawETH.ts:44](https://github.com/base-org/op-wagmi/blob/main/src/hooks/L2/useWriteWithdrawETH.ts#L44) +[hooks/L2/useWriteWithdrawETH.ts:43](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawETH.ts#L43) diff --git a/example/app/page.tsx b/example/app/page.tsx index e3bd9d3..9063b72 100644 --- a/example/app/page.tsx +++ b/example/app/page.tsx @@ -6,12 +6,17 @@ import { DepositContainer } from '@/components/DepositContainer' import { FinalizeContainer } from '@/components/FinalizeContainer' import { ProveContainer } from '@/components/ProveContainer' import { WithdrawContainer } from '@/components/WithdrawContainer' -import { useState } from 'react' +import { useEffect, useState } from 'react' export default function Home() { const [action, setAction] = useState<'deposit' | 'withdraw' | 'prove' | 'finalize'>('deposit') + const [isClient, setIsClient] = useState(false) - return ( + useEffect(() => { + setIsClient(true) + }, []) + + return (isClient && (
🔴🔵 Superchain Bridge 🔵🔴 @@ -23,5 +28,5 @@ export default function Home() { {action === 'finalize' && }
- ) + )) } diff --git a/src/hooks/useOpConfig.ts b/src/hooks/useOpConfig.ts index fc12ab0..5d8aead 100644 --- a/src/hooks/useOpConfig.ts +++ b/src/hooks/useOpConfig.ts @@ -22,7 +22,10 @@ const chains = { 8453: base, 84531: baseGoerli, 420: optimismGoerli, 10: optimis export function useOpConfig( parameters: UseConfigParameters = {}, ): UseConfigReturnType { - const config: UseConfigReturnType = { l2chains: chains, ...useConfig(parameters) } + const config: UseConfigReturnType = { + ...useConfig(parameters), + l2chains: { ...chains, ...(parameters?.config as OpConfig)?.l2chains }, + } // TODO: Return a better error here if (!config) throw new Error('No Wagmi Context provider found') diff --git a/typedoc.json b/typedoc.json index 5e5909e..7903f82 100644 --- a/typedoc.json +++ b/typedoc.json @@ -5,6 +5,6 @@ "./src/index.ts" ], "plugin": ["typedoc-plugin-markdown"], - "gitRevision": "main", + "gitRevision": "master", "publicPath": "/reference/" } From 52e4aeadefc800cce10702acf7e8e4bc22e803f3 Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:50:38 -0500 Subject: [PATCH 3/6] format --- docs/reference/modules.md | 356 +++++++++++++++++++------------------- 1 file changed, 178 insertions(+), 178 deletions(-) diff --git a/docs/reference/modules.md b/docs/reference/modules.md index 21d256b..80a9e62 100644 --- a/docs/reference/modules.md +++ b/docs/reference/modules.md @@ -44,105 +44,105 @@ ### UseSimulateDepositERC20Parameters -Ƭ **UseSimulateDepositERC20Parameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateDepositERC20Parameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `l2ChainId`: `number` } +Ƭ **UseSimulateDepositERC20Parameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateDepositERC20Parameters`, `"args"`\>[`"args"`], `"minGasLimit"`\> & \{ `minGasLimit?`: `number` } } & \{ `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | +| Name | Type | +| :-------- | :-------------------------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | #### Defined in [hooks/L1/useSimulateDepositERC20.ts:14](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateDepositERC20.ts#L14) -___ +--- ### UseSimulateDepositETHParameters -Ƭ **UseSimulateDepositETHParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateDepositETHParameters`, ``"args"``\>[``"args"``], ``"gasLimit"``\> & \{ `gasLimit?`: `number` } } & \{ `l2ChainId`: `number` } +Ƭ **UseSimulateDepositETHParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateDepositETHParameters`, `"args"`\>[`"args"`], `"gasLimit"`\> & \{ `gasLimit?`: `number` } } & \{ `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | +| Name | Type | +| :-------- | :-------------------------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | #### Defined in [hooks/L1/useSimulateDepositETH.ts:14](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateDepositETH.ts#L14) -___ +--- ### UseSimulateFinalizeWithdrawalTransactionParameters -Ƭ **UseSimulateFinalizeWithdrawalTransactionParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } +Ƭ **UseSimulateFinalizeWithdrawalTransactionParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | +| Name | Type | +| :-------- | :-------------------------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | #### Defined in [hooks/L1/useSimulateFinalizeWithdrawalTransaction.ts:17](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateFinalizeWithdrawalTransaction.ts#L17) -___ +--- ### UseSimulateProveWithdrawalTransactionParameters -Ƭ **UseSimulateProveWithdrawalTransactionParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } +Ƭ **UseSimulateProveWithdrawalTransactionParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | +| Name | Type | +| :-------- | :-------------------------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | #### Defined in [hooks/L1/useSimulateProveWithdrawalTransaction.ts:23](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateProveWithdrawalTransaction.ts#L23) -___ +--- ### UseSimulateWithdrawERC20Parameters -Ƭ **UseSimulateWithdrawERC20Parameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateWithdrawERC20Parameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } +Ƭ **UseSimulateWithdrawERC20Parameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateWithdrawERC20Parameters`, `"args"`\>[`"args"`], `"minGasLimit"`\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | +| Name | Type | +| :-------- | :-------------------------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | #### Defined in [hooks/L2/useSimulateWithdrawERC20.ts:15](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useSimulateWithdrawERC20.ts#L15) -___ +--- ### UseSimulateWithdrawETHParameters -Ƭ **UseSimulateWithdrawETHParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateWithdrawETHParameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } +Ƭ **UseSimulateWithdrawETHParameters**\<`config`, `chainId`\>: `UseSimulateOPActionBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`SimulateWithdrawETHParameters`, `"args"`\>[`"args"`], `"minGasLimit"`\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] \| `undefined` = `undefined` | +| Name | Type | +| :-------- | :-------------------------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] \| `undefined` = `undefined` | #### Defined in [hooks/L2/useSimulateWithdrawETH.ts:16](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useSimulateWithdrawETH.ts#L16) -___ +--- ### UseWriteDepositERC20Parameters @@ -150,16 +150,16 @@ ___ #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in [hooks/L1/useWriteDepositERC20.ts:23](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositERC20.ts#L23) -___ +--- ### UseWriteDepositETHParameters @@ -167,16 +167,16 @@ ___ #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in [hooks/L1/useWriteDepositETH.ts:27](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositETH.ts#L27) -___ +--- ### UseWriteFinalizeWithdrawalTransactionParameters @@ -184,16 +184,16 @@ ___ #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in [hooks/L1/useWriteFinalizeWithdrawalTransaction.ts:30](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteFinalizeWithdrawalTransaction.ts#L30) -___ +--- ### UseWriteProveWithdrawalTransactionParameters @@ -201,16 +201,16 @@ ___ #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in [hooks/L1/useWriteProveWithdrawalTransaction.ts:33](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteProveWithdrawalTransaction.ts#L33) -___ +--- ### UseWriteWithdrawERC20Parameters @@ -218,16 +218,16 @@ ___ #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in [hooks/L2/useWriteWithdrawERC20.ts:23](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawERC20.ts#L23) -___ +--- ### UseWriteWithdrawETHParameters @@ -235,112 +235,112 @@ ___ #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Defined in [hooks/L2/useWriteWithdrawETH.ts:24](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawETH.ts#L24) -___ +--- ### WriteDepositERC20Parameters -Ƭ **WriteDepositERC20Parameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteDepositERC20ActionParameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `l2ChainId`: `number` } +Ƭ **WriteDepositERC20Parameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteDepositERC20ActionParameters`, `"args"`\>[`"args"`], `"minGasLimit"`\> & \{ `minGasLimit?`: `number` } } & \{ `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | +| Name | Type | +| :-------- | :-------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] = `number` | #### Defined in [hooks/L1/useWriteDepositERC20.ts:14](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositERC20.ts#L14) -___ +--- ### WriteDepositETHParameters -Ƭ **WriteDepositETHParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteDepositETHActionParameters`, ``"args"``\>[``"args"``], ``"gasLimit"``\> & \{ `gasLimit?`: `number` } } & \{ `l2ChainId`: `number` } +Ƭ **WriteDepositETHParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteDepositETHActionParameters`, `"args"`\>[`"args"`], `"gasLimit"`\> & \{ `gasLimit?`: `number` } } & \{ `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | +| Name | Type | +| :-------- | :-------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] = `number` | #### Defined in [hooks/L1/useWriteDepositETH.ts:18](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositETH.ts#L18) -___ +--- ### WriteFinalizeWithdrawalTransactionParameters -Ƭ **WriteFinalizeWithdrawalTransactionParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } +Ƭ **WriteFinalizeWithdrawalTransactionParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | +| Name | Type | +| :-------- | :-------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] = `number` | #### Defined in [hooks/L1/useWriteFinalizeWithdrawalTransaction.ts:20](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteFinalizeWithdrawalTransaction.ts#L20) -___ +--- ### WriteProveWithdrawalTransactionParameters -Ƭ **WriteProveWithdrawalTransactionParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } +Ƭ **WriteProveWithdrawalTransactionParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: \{ `withdrawalTxHash`: `Hash` } ; `l2ChainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | +| Name | Type | +| :-------- | :-------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] = `number` | #### Defined in [hooks/L1/useWriteProveWithdrawalTransaction.ts:23](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteProveWithdrawalTransaction.ts#L23) -___ +--- ### WriteWithdrawERC20Parameters -Ƭ **WriteWithdrawERC20Parameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteWithdrawERC20ActionParameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } +Ƭ **WriteWithdrawERC20Parameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteWithdrawERC20ActionParameters`, `"args"`\>[`"args"`], `"minGasLimit"`\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | +| Name | Type | +| :-------- | :-------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] = `number` | #### Defined in [hooks/L2/useWriteWithdrawERC20.ts:14](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawERC20.ts#L14) -___ +--- ### WriteWithdrawETHParameters -Ƭ **WriteWithdrawETHParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteWithdrawETHActionParameters`, ``"args"``\>[``"args"``], ``"minGasLimit"``\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } +Ƭ **WriteWithdrawETHParameters**\<`config`, `chainId`\>: `WriteOPContractBaseParameters`\ & \{ `args`: `Omit`\<`Pick`\<`WriteWithdrawETHActionParameters`, `"args"`\>[`"args"`], `"minGasLimit"`\> & \{ `minGasLimit?`: `number` } } & \{ `chainId`: `number` } #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `chainId` | extends `config`[``"chains"``][`number`][``"id"``] = `number` | +| Name | Type | +| :-------- | :-------------------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `chainId` | extends `config`[`"chains"`][`number`][`"id"`] = `number` | #### Defined in @@ -356,15 +356,15 @@ Simulates a deposit of ERC20 tokens to L2 #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | +| Name | Type | +| :-------- | :-------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :----------- | :-------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | | `parameters` | [`UseSimulateDepositERC20Parameters`](/reference/modules.md#usesimulatedepositerc20parameters)\<`config`, `chainId`\> | [UseSimulateDepositERC20Parameters](/reference/modules.md#usesimulatedepositerc20parameters) | #### Returns @@ -377,7 +377,7 @@ wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/u [hooks/L1/useSimulateDepositERC20.ts:33](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateDepositERC20.ts#L33) -___ +--- ### useSimulateDepositETH @@ -387,15 +387,15 @@ Simulates a deposit of ETH to L2 #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | +| Name | Type | +| :-------- | :-------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :----------- | :---------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------- | | `parameters` | [`UseSimulateDepositETHParameters`](/reference/modules.md#usesimulatedepositethparameters)\<`config`, `chainId`\> | [UseSimulateDepositETHParameters](/reference/modules.md#usesimulatedepositethparameters) | #### Returns @@ -408,7 +408,7 @@ wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/u [hooks/L1/useSimulateDepositETH.ts:33](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateDepositETH.ts#L33) -___ +--- ### useSimulateFinalizeWithdrawalTransaction @@ -418,15 +418,15 @@ Simulates finalizing a withdrawal transaction. #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | +| Name | Type | +| :-------- | :-------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------- | | `parameters` | [`UseSimulateFinalizeWithdrawalTransactionParameters`](/reference/modules.md#usesimulatefinalizewithdrawaltransactionparameters)\<`config`, `chainId`\> | [UseSimulateFinalizeWithdrawalTransactionParameters](/reference/modules.md#usesimulatefinalizewithdrawaltransactionparameters) | #### Returns @@ -439,7 +439,7 @@ wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/u [hooks/L1/useSimulateFinalizeWithdrawalTransaction.ts:39](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateFinalizeWithdrawalTransaction.ts#L39) -___ +--- ### useSimulateProveWithdrawalTransaction @@ -449,15 +449,15 @@ Simulates proving a withdrawal transaction. #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | +| Name | Type | +| :-------- | :-------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------- | | `parameters` | [`UseSimulateProveWithdrawalTransactionParameters`](/reference/modules.md#usesimulateprovewithdrawaltransactionparameters)\<`config`, `chainId`\> | [UseSimulateProveWithdrawalTransactionParameters](/reference/modules.md#usesimulateprovewithdrawaltransactionparameters) | #### Returns @@ -470,7 +470,7 @@ wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/u [hooks/L1/useSimulateProveWithdrawalTransaction.ts:45](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useSimulateProveWithdrawalTransaction.ts#L45) -___ +--- ### useSimulateWithdrawERC20 @@ -480,15 +480,15 @@ Simulates a withdrawal of ERC20 tokens to an L1 address. #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | +| Name | Type | +| :-------- | :-------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :----------- | :---------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------- | | `parameters` | [`UseSimulateWithdrawERC20Parameters`](/reference/modules.md#usesimulatewithdrawerc20parameters)\<`config`, `chainId`\> | [UseSimulateWithdrawERC20Parameters](/reference/modules.md#usesimulatewithdrawerc20parameters) | #### Returns @@ -501,7 +501,7 @@ wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/u [hooks/L2/useSimulateWithdrawERC20.ts:34](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useSimulateWithdrawERC20.ts#L34) -___ +--- ### useSimulateWithdrawETH @@ -511,15 +511,15 @@ Simulates a withdrawal of ETH to an L1 address. #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | +| Name | Type | +| :-------- | :-------------------------------------------- | +| `config` | extends `Config` = `OpConfig` | | `chainId` | extends `undefined` \| `number` = `undefined` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Type | Description | +| :----------- | :------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------- | | `parameters` | [`UseSimulateWithdrawETHParameters`](/reference/modules.md#usesimulatewithdrawethparameters)\<`config`, `chainId`\> | [UseSimulateWithdrawETHParameters](/reference/modules.md#usesimulatewithdrawethparameters) | #### Returns @@ -532,7 +532,7 @@ wagmi [useSimulateContract return type](https://alpha.wagmi.sh/react/api/hooks/u [hooks/L2/useSimulateWithdrawETH.ts:35](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useSimulateWithdrawETH.ts#L35) -___ +--- ### useWriteDepositERC20 @@ -542,15 +542,15 @@ Deposits ERC20 tokens to L2 using the standard bridge #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----- | :-------------------------------------------------------------------------------------------------------------- | | `args` | [`UseWriteDepositERC20Parameters`](/reference/modules.md#usewritedepositerc20parameters)\<`config`, `context`\> | #### Returns @@ -563,7 +563,7 @@ wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useW [hooks/L1/useWriteDepositERC20.ts:42](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositERC20.ts#L42) -___ +--- ### useWriteDepositETH @@ -573,15 +573,15 @@ Deposits ETH to L2 using the OptimismPortal contract #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----- | :---------------------------------------------------------------------------------------------------------- | | `args` | [`UseWriteDepositETHParameters`](/reference/modules.md#usewritedepositethparameters)\<`config`, `context`\> | #### Returns @@ -594,7 +594,7 @@ wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useW [hooks/L1/useWriteDepositETH.ts:83](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteDepositETH.ts#L83) -___ +--- ### useWriteFinalizeWithdrawalTransaction @@ -604,15 +604,15 @@ Deposits ETH to L2 using the OptimismPortal contract #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------ | | `args` | [`UseWriteFinalizeWithdrawalTransactionParameters`](/reference/modules.md#usewritefinalizewithdrawaltransactionparameters)\<`config`, `context`\> | #### Returns @@ -625,7 +625,7 @@ wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useW [hooks/L1/useWriteFinalizeWithdrawalTransaction.ts:87](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteFinalizeWithdrawalTransaction.ts#L87) -___ +--- ### useWriteProveWithdrawalTransaction @@ -635,15 +635,15 @@ Deposits ETH to L2 using the OptimismPortal contract #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----- | :------------------------------------------------------------------------------------------------------------------------------------------ | | `args` | [`UseWriteProveWithdrawalTransactionParameters`](/reference/modules.md#usewriteprovewithdrawaltransactionparameters)\<`config`, `context`\> | #### Returns @@ -656,7 +656,7 @@ wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useW [hooks/L1/useWriteProveWithdrawalTransaction.ts:104](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L1/useWriteProveWithdrawalTransaction.ts#L104) -___ +--- ### useWriteWithdrawERC20 @@ -666,15 +666,15 @@ Withdraws ERC20 tokens to an L1 address. #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----- | :---------------------------------------------------------------------------------------------------------------- | | `args` | [`UseWriteWithdrawERC20Parameters`](/reference/modules.md#usewritewithdrawerc20parameters)\<`config`, `context`\> | #### Returns @@ -687,7 +687,7 @@ wagmi [useWriteContract return type](https://alpha.wagmi.sh/react/api/hooks/useW [hooks/L2/useWriteWithdrawERC20.ts:42](https://github.com/base-org/op-wagmi/blob/master/src/hooks/L2/useWriteWithdrawERC20.ts#L42) -___ +--- ### useWriteWithdrawETH @@ -697,15 +697,15 @@ Withdraws ETH to an L1 address. #### Type parameters -| Name | Type | -| :------ | :------ | -| `config` | extends `Config` = `OpConfig` | -| `context` | `unknown` | +| Name | Type | +| :-------- | :---------------------------- | +| `config` | extends `Config` = `OpConfig` | +| `context` | `unknown` | #### Parameters -| Name | Type | -| :------ | :------ | +| Name | Type | +| :----- | :------------------------------------------------------------------------------------------------------------ | | `args` | [`UseWriteWithdrawETHParameters`](/reference/modules.md#usewritewithdrawethparameters)\<`config`, `context`\> | #### Returns From 7e601a3c5065eb05ad2d6abb76dbc21174ecbc8a Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Mon, 27 Nov 2023 18:10:42 -0500 Subject: [PATCH 4/6] readmes --- README.md | 14 ++++++++------ example/README.md | 22 ++++++++++++++++++++++ example/components/AssetTypeToggle.tsx | 2 +- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 30fec52..2dd3b5c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ -# OP Wagmi +
-Wagmi hooks for OP Stack Chains +

+ OP Wagmi +

+ +

+ Wagmi hooks for OP Stack Chains +

@@ -29,10 +35,6 @@ Wagmi hooks for OP Stack Chains - TypeScript ready - Test suite running against [forked](https://ethereum.org/en/glossary/#fork) Ethereum network -## Overview - -## Community - ## Contributing If you're interested in contributing, please read the [contributing docs](CONTRIBUTING.md) **before submitting a pull request**. diff --git a/example/README.md b/example/README.md index e69de29..92b92c8 100644 --- a/example/README.md +++ b/example/README.md @@ -0,0 +1,22 @@ +
+ +

+ 🔴🔵 Superchain Bridge 🔵🔴 +

+ +This is a basic Superchain Bridge example app, here to showcase OP Wagmi's features. To start the development server, run + +```bash +pnpm dev:example +``` + +from the root of the repository. + +In this example app, you can: + +- Deposit ETH / ERC20s +- Initiate ETH / ERC20 withdrawals +- Prove withdrawals +- Finalize withdrawals + +to / from Base Goerli / Optimism Goerli. diff --git a/example/components/AssetTypeToggle.tsx b/example/components/AssetTypeToggle.tsx index 6f10469..2db0252 100644 --- a/example/components/AssetTypeToggle.tsx +++ b/example/components/AssetTypeToggle.tsx @@ -22,7 +22,7 @@ export function AssetTypeToggle({ selectedAssetType, setSelectedAssetType }: Ass }`} onClick={() => setSelectedAssetType('erc20')} > - ERC-20 + ERC20 ) From d9d3df6c5c96baa413df0b2048c32d018edd41f5 Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Mon, 27 Nov 2023 18:17:04 -0500 Subject: [PATCH 5/6] update package jsons --- example/package.json | 2 +- package.json | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/example/package.json b/example/package.json index 87ab350..9a73f86 100644 --- a/example/package.json +++ b/example/package.json @@ -1,5 +1,5 @@ { - "name": "example", + "name": "@op-wagmi/example", "version": "0.1.1", "private": true, "scripts": { diff --git a/package.json b/package.json index 7df73e7..d4b94f6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,9 @@ { "name": "op-wagmi", + "repository": { + "type": "git", + "url": "https://github.com/base-org/op-wagmi.git" + }, "version": "0.0.2", "type": "module", "main": "./dist/cjs/index.js", From 1b9503443f7709870a872fabb6275f387c701d14 Mon Sep 17 00:00:00 2001 From: Lukas Rosario <36800180+lukasrosario@users.noreply.github.com> Date: Mon, 27 Nov 2023 18:18:34 -0500 Subject: [PATCH 6/6] changeset --- .changeset/honest-shirts-serve.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/honest-shirts-serve.md diff --git a/.changeset/honest-shirts-serve.md b/.changeset/honest-shirts-serve.md new file mode 100644 index 0000000..ece4a22 --- /dev/null +++ b/.changeset/honest-shirts-serve.md @@ -0,0 +1,7 @@ +--- +"@op-wagmi/docs": minor +"op-wagmi": minor +"@op-wagmi/example": patch +--- + +Add docs