viem 2.0.0-beta.9 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/README.md +9 -3
- package/_cjs/actions/ens/getEnsName.js +4 -2
- package/_cjs/actions/ens/getEnsName.js.map +1 -1
- package/_cjs/actions/index.js +16 -2
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/public/getFilterChanges.js +3 -2
- package/_cjs/actions/public/getFilterChanges.js.map +1 -1
- package/_cjs/actions/public/getFilterLogs.js +3 -2
- package/_cjs/actions/public/getFilterLogs.js.map +1 -1
- package/_cjs/actions/public/getLogs.js +3 -2
- package/_cjs/actions/public/getLogs.js.map +1 -1
- package/_cjs/actions/public/verifyTypedData.js +2 -1
- package/_cjs/actions/public/verifyTypedData.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/chains/celo/formatters.js +0 -10
- package/_cjs/chains/celo/formatters.js.map +1 -1
- package/_cjs/chains/definitions/arbitrumSepolia.js +4 -0
- package/_cjs/chains/definitions/arbitrumSepolia.js.map +1 -1
- package/_cjs/chains/definitions/astar.js +0 -1
- package/_cjs/chains/definitions/astar.js.map +1 -1
- package/_cjs/chains/definitions/astarZkatana.js +0 -6
- package/_cjs/chains/definitions/astarZkatana.js.map +1 -1
- package/_cjs/chains/definitions/base.js +5 -0
- package/_cjs/chains/definitions/base.js.map +1 -1
- package/_cjs/chains/definitions/baseGoerli.js +5 -0
- package/_cjs/chains/definitions/baseGoerli.js.map +1 -1
- package/_cjs/chains/definitions/baseSepolia.js +5 -3
- package/_cjs/chains/definitions/baseSepolia.js.map +1 -1
- package/_cjs/chains/definitions/bscTestnet.js +0 -1
- package/_cjs/chains/definitions/bscTestnet.js.map +1 -1
- package/_cjs/chains/definitions/confluxESpaceTestnet.js +0 -4
- package/_cjs/chains/definitions/confluxESpaceTestnet.js.map +1 -1
- package/_cjs/chains/definitions/fantomSonicTestnet.js +25 -0
- package/_cjs/chains/definitions/fantomSonicTestnet.js.map +1 -0
- package/_cjs/chains/definitions/kava.js +0 -1
- package/_cjs/chains/definitions/kava.js.map +1 -1
- package/_cjs/chains/definitions/kavaTestnet.js +0 -1
- package/_cjs/chains/definitions/kavaTestnet.js.map +1 -1
- package/_cjs/chains/definitions/klaytnBaobab.js +0 -1
- package/_cjs/chains/definitions/klaytnBaobab.js.map +1 -1
- package/_cjs/chains/definitions/lukso.js +0 -4
- package/_cjs/chains/definitions/lukso.js.map +1 -1
- package/_cjs/chains/definitions/manta.js +0 -1
- package/_cjs/chains/definitions/manta.js.map +1 -1
- package/_cjs/chains/definitions/mantaTestnet.js +0 -1
- package/_cjs/chains/definitions/mantaTestnet.js.map +1 -1
- package/_cjs/chains/definitions/neonMainnet.js +0 -3
- package/_cjs/chains/definitions/neonMainnet.js.map +1 -1
- package/_cjs/chains/definitions/optimism.js +5 -0
- package/_cjs/chains/definitions/optimism.js.map +1 -1
- package/_cjs/chains/definitions/optimismGoerli.js +5 -0
- package/_cjs/chains/definitions/optimismGoerli.js.map +1 -1
- package/_cjs/chains/definitions/optimismSepolia.js +5 -0
- package/_cjs/chains/definitions/optimismSepolia.js.map +1 -1
- package/_cjs/chains/definitions/pgn.js +12 -3
- package/_cjs/chains/definitions/pgn.js.map +1 -1
- package/_cjs/chains/definitions/pgnTestnet.js +7 -3
- package/_cjs/chains/definitions/pgnTestnet.js.map +1 -1
- package/_cjs/chains/definitions/rootstock.js +0 -1
- package/_cjs/chains/definitions/rootstock.js.map +1 -1
- package/_cjs/chains/definitions/sapphire.js +0 -4
- package/_cjs/chains/definitions/sapphire.js.map +1 -1
- package/_cjs/chains/definitions/sapphireTestnet.js +0 -4
- package/_cjs/chains/definitions/sapphireTestnet.js.map +1 -1
- package/_cjs/chains/definitions/shibarium.js +0 -3
- package/_cjs/chains/definitions/shibarium.js.map +1 -1
- package/_cjs/chains/definitions/shimmer.js +0 -3
- package/_cjs/chains/definitions/shimmer.js.map +1 -1
- package/_cjs/chains/definitions/shimmerTestnet.js +0 -3
- package/_cjs/chains/definitions/shimmerTestnet.js.map +1 -1
- package/_cjs/chains/definitions/taikoJolnir.js +2 -2
- package/_cjs/chains/definitions/taikoJolnir.js.map +1 -1
- package/_cjs/chains/definitions/tenet.js +0 -1
- package/_cjs/chains/definitions/tenet.js.map +1 -1
- package/_cjs/chains/definitions/zilliqa.js +23 -0
- package/_cjs/chains/definitions/zilliqa.js.map +1 -0
- package/_cjs/chains/definitions/zilliqaTestnet.js +23 -0
- package/_cjs/chains/definitions/zilliqaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/zkSyncSepoliaTestnet.js +31 -0
- package/_cjs/chains/definitions/zkSyncSepoliaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/zkSyncTestnet.js.map +1 -1
- package/_cjs/chains/definitions/zora.js +5 -0
- package/_cjs/chains/definitions/zora.js.map +1 -1
- package/_cjs/chains/definitions/zoraSepolia.js +5 -4
- package/_cjs/chains/definitions/zoraSepolia.js.map +1 -1
- package/_cjs/chains/index.js +12 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/chains/opStack/abis.js +366 -1
- package/_cjs/chains/opStack/abis.js.map +1 -1
- package/_cjs/chains/opStack/actions/buildDepositTransaction.js +1 -1
- package/_cjs/chains/opStack/actions/buildDepositTransaction.js.map +1 -1
- package/_cjs/chains/opStack/actions/buildInitiateWithdrawal.js +29 -0
- package/_cjs/chains/opStack/actions/buildInitiateWithdrawal.js.map +1 -0
- package/_cjs/chains/opStack/actions/buildProveWithdrawal.js +39 -0
- package/_cjs/chains/opStack/actions/buildProveWithdrawal.js.map +1 -0
- package/_cjs/chains/opStack/actions/depositTransaction.js +11 -6
- package/_cjs/chains/opStack/actions/depositTransaction.js.map +1 -1
- package/_cjs/chains/opStack/actions/estimateDepositTransactionGas.js +37 -0
- package/_cjs/chains/opStack/actions/estimateDepositTransactionGas.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateFinalizeWithdrawalGas.js +29 -0
- package/_cjs/chains/opStack/actions/estimateFinalizeWithdrawalGas.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateInitiateWithdrawalGas.js +24 -0
- package/_cjs/chains/opStack/actions/estimateInitiateWithdrawalGas.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateProveWithdrawalGas.js +29 -0
- package/_cjs/chains/opStack/actions/estimateProveWithdrawalGas.js.map +1 -0
- package/_cjs/chains/opStack/actions/finalizeWithdrawal.js +33 -0
- package/_cjs/chains/opStack/actions/finalizeWithdrawal.js.map +1 -0
- package/_cjs/chains/opStack/actions/getL2Output.js +30 -0
- package/_cjs/chains/opStack/actions/getL2Output.js.map +1 -0
- package/_cjs/chains/opStack/actions/getTimeToFinalize.js +46 -0
- package/_cjs/chains/opStack/actions/getTimeToFinalize.js.map +1 -0
- package/_cjs/chains/opStack/actions/getTimeToNextL2Output.js +63 -0
- package/_cjs/chains/opStack/actions/getTimeToNextL2Output.js.map +1 -0
- package/_cjs/chains/opStack/actions/getTimeToProve.js +13 -0
- package/_cjs/chains/opStack/actions/getTimeToProve.js.map +1 -0
- package/_cjs/chains/opStack/actions/getWithdrawalStatus.js +71 -0
- package/_cjs/chains/opStack/actions/getWithdrawalStatus.js.map +1 -0
- package/_cjs/chains/opStack/actions/initiateWithdrawal.js +28 -0
- package/_cjs/chains/opStack/actions/initiateWithdrawal.js.map +1 -0
- package/_cjs/chains/opStack/actions/proveWithdrawal.js +33 -0
- package/_cjs/chains/opStack/actions/proveWithdrawal.js.map +1 -0
- package/_cjs/chains/opStack/actions/waitForNextL2Output.js +32 -0
- package/_cjs/chains/opStack/actions/waitForNextL2Output.js.map +1 -0
- package/_cjs/chains/opStack/actions/waitToFinalize.js +11 -0
- package/_cjs/chains/opStack/actions/waitToFinalize.js.map +1 -0
- package/_cjs/chains/opStack/actions/waitToProve.js +21 -0
- package/_cjs/chains/opStack/actions/waitToProve.js.map +1 -0
- package/_cjs/chains/opStack/chains.js +5 -1
- package/_cjs/chains/opStack/chains.js.map +1 -1
- package/_cjs/chains/opStack/decorators/publicL1.js +35 -0
- package/_cjs/chains/opStack/decorators/publicL1.js.map +1 -0
- package/_cjs/chains/opStack/decorators/publicL2.js +5 -1
- package/_cjs/chains/opStack/decorators/publicL2.js.map +1 -1
- package/_cjs/chains/opStack/decorators/walletL1.js +4 -0
- package/_cjs/chains/opStack/decorators/walletL1.js.map +1 -1
- package/_cjs/chains/opStack/decorators/walletL2.js +13 -0
- package/_cjs/chains/opStack/decorators/walletL2.js.map +1 -0
- package/_cjs/chains/opStack/errors/withdrawal.js +17 -0
- package/_cjs/chains/opStack/errors/withdrawal.js.map +1 -0
- package/_cjs/chains/opStack/index.js +43 -15
- package/_cjs/chains/opStack/index.js.map +1 -1
- package/_cjs/chains/opStack/types/deposit.js +3 -0
- package/_cjs/chains/opStack/types/deposit.js.map +1 -0
- package/_cjs/chains/opStack/types/withdrawal.js +3 -0
- package/_cjs/chains/opStack/types/withdrawal.js.map +1 -0
- package/_cjs/chains/opStack/utils/extractWithdrawalMessageLogs.js +14 -0
- package/_cjs/chains/opStack/utils/extractWithdrawalMessageLogs.js.map +1 -0
- package/_cjs/chains/opStack/utils/getL2TransactionHash.js +2 -2
- package/_cjs/chains/opStack/utils/getL2TransactionHash.js.map +1 -1
- package/_cjs/chains/opStack/utils/getWithdrawalHashStorageSlot.js +11 -0
- package/_cjs/chains/opStack/utils/getWithdrawalHashStorageSlot.js.map +1 -0
- package/_cjs/chains/opStack/utils/getWithdrawals.js +10 -0
- package/_cjs/chains/opStack/utils/getWithdrawals.js.map +1 -0
- package/_cjs/chains/opStack/utils/{fromOpaqueData.js → opaqueDataToDepositData.js} +4 -4
- package/_cjs/chains/opStack/utils/opaqueDataToDepositData.js.map +1 -0
- package/_cjs/errors/abi.js +21 -1
- package/_cjs/errors/abi.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/index.js +10 -2
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/abi/getAbiItem.js +46 -3
- package/_cjs/utils/abi/getAbiItem.js.map +1 -1
- package/_cjs/utils/hash/ripemd160.js +16 -0
- package/_cjs/utils/hash/ripemd160.js.map +1 -0
- package/_cjs/utils/hash/sha256.js +16 -0
- package/_cjs/utils/hash/sha256.js.map +1 -0
- package/_cjs/utils/index.js +5 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/actions/ens/getEnsName.js +4 -2
- package/_esm/actions/ens/getEnsName.js.map +1 -1
- package/_esm/actions/index.js +7 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/public/getFilterChanges.js +3 -2
- package/_esm/actions/public/getFilterChanges.js.map +1 -1
- package/_esm/actions/public/getFilterLogs.js +3 -2
- package/_esm/actions/public/getFilterLogs.js.map +1 -1
- package/_esm/actions/public/getLogs.js +3 -2
- package/_esm/actions/public/getLogs.js.map +1 -1
- package/_esm/actions/public/verifyTypedData.js +2 -1
- package/_esm/actions/public/verifyTypedData.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/chains/celo/formatters.js +0 -10
- package/_esm/chains/celo/formatters.js.map +1 -1
- package/_esm/chains/definitions/arbitrumSepolia.js +4 -0
- package/_esm/chains/definitions/arbitrumSepolia.js.map +1 -1
- package/_esm/chains/definitions/astar.js +0 -1
- package/_esm/chains/definitions/astar.js.map +1 -1
- package/_esm/chains/definitions/astarZkatana.js +0 -6
- package/_esm/chains/definitions/astarZkatana.js.map +1 -1
- package/_esm/chains/definitions/base.js +5 -0
- package/_esm/chains/definitions/base.js.map +1 -1
- package/_esm/chains/definitions/baseGoerli.js +5 -0
- package/_esm/chains/definitions/baseGoerli.js.map +1 -1
- package/_esm/chains/definitions/baseSepolia.js +5 -3
- package/_esm/chains/definitions/baseSepolia.js.map +1 -1
- package/_esm/chains/definitions/bscTestnet.js +0 -1
- package/_esm/chains/definitions/bscTestnet.js.map +1 -1
- package/_esm/chains/definitions/confluxESpaceTestnet.js +0 -4
- package/_esm/chains/definitions/confluxESpaceTestnet.js.map +1 -1
- package/_esm/chains/definitions/fantomSonicTestnet.js +22 -0
- package/_esm/chains/definitions/fantomSonicTestnet.js.map +1 -0
- package/_esm/chains/definitions/kava.js +0 -1
- package/_esm/chains/definitions/kava.js.map +1 -1
- package/_esm/chains/definitions/kavaTestnet.js +0 -1
- package/_esm/chains/definitions/kavaTestnet.js.map +1 -1
- package/_esm/chains/definitions/klaytnBaobab.js +0 -1
- package/_esm/chains/definitions/klaytnBaobab.js.map +1 -1
- package/_esm/chains/definitions/lukso.js +0 -4
- package/_esm/chains/definitions/lukso.js.map +1 -1
- package/_esm/chains/definitions/manta.js +0 -1
- package/_esm/chains/definitions/manta.js.map +1 -1
- package/_esm/chains/definitions/mantaTestnet.js +0 -1
- package/_esm/chains/definitions/mantaTestnet.js.map +1 -1
- package/_esm/chains/definitions/neonMainnet.js +0 -3
- package/_esm/chains/definitions/neonMainnet.js.map +1 -1
- package/_esm/chains/definitions/optimism.js +5 -0
- package/_esm/chains/definitions/optimism.js.map +1 -1
- package/_esm/chains/definitions/optimismGoerli.js +5 -0
- package/_esm/chains/definitions/optimismGoerli.js.map +1 -1
- package/_esm/chains/definitions/optimismSepolia.js +5 -0
- package/_esm/chains/definitions/optimismSepolia.js.map +1 -1
- package/_esm/chains/definitions/pgn.js +12 -3
- package/_esm/chains/definitions/pgn.js.map +1 -1
- package/_esm/chains/definitions/pgnTestnet.js +7 -3
- package/_esm/chains/definitions/pgnTestnet.js.map +1 -1
- package/_esm/chains/definitions/rootstock.js +0 -1
- package/_esm/chains/definitions/rootstock.js.map +1 -1
- package/_esm/chains/definitions/sapphire.js +0 -4
- package/_esm/chains/definitions/sapphire.js.map +1 -1
- package/_esm/chains/definitions/sapphireTestnet.js +0 -4
- package/_esm/chains/definitions/sapphireTestnet.js.map +1 -1
- package/_esm/chains/definitions/shibarium.js +0 -3
- package/_esm/chains/definitions/shibarium.js.map +1 -1
- package/_esm/chains/definitions/shimmer.js +0 -3
- package/_esm/chains/definitions/shimmer.js.map +1 -1
- package/_esm/chains/definitions/shimmerTestnet.js +0 -3
- package/_esm/chains/definitions/shimmerTestnet.js.map +1 -1
- package/_esm/chains/definitions/taikoJolnir.js +2 -2
- package/_esm/chains/definitions/taikoJolnir.js.map +1 -1
- package/_esm/chains/definitions/tenet.js +0 -1
- package/_esm/chains/definitions/tenet.js.map +1 -1
- package/_esm/chains/definitions/zilliqa.js +20 -0
- package/_esm/chains/definitions/zilliqa.js.map +1 -0
- package/_esm/chains/definitions/zilliqaTestnet.js +20 -0
- package/_esm/chains/definitions/zilliqaTestnet.js.map +1 -0
- package/_esm/chains/definitions/zkSyncSepoliaTestnet.js +28 -0
- package/_esm/chains/definitions/zkSyncSepoliaTestnet.js.map +1 -0
- package/_esm/chains/definitions/zkSyncTestnet.js +1 -0
- package/_esm/chains/definitions/zkSyncTestnet.js.map +1 -1
- package/_esm/chains/definitions/zora.js +5 -0
- package/_esm/chains/definitions/zora.js.map +1 -1
- package/_esm/chains/definitions/zoraSepolia.js +5 -4
- package/_esm/chains/definitions/zoraSepolia.js.map +1 -1
- package/_esm/chains/index.js +4 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/chains/opStack/abis.js +365 -0
- package/_esm/chains/opStack/abis.js.map +1 -1
- package/_esm/chains/opStack/actions/buildDepositTransaction.js +2 -2
- package/_esm/chains/opStack/actions/buildDepositTransaction.js.map +1 -1
- package/_esm/chains/opStack/actions/buildInitiateWithdrawal.js +50 -0
- package/_esm/chains/opStack/actions/buildInitiateWithdrawal.js.map +1 -0
- package/_esm/chains/opStack/actions/buildProveWithdrawal.js +59 -0
- package/_esm/chains/opStack/actions/buildProveWithdrawal.js.map +1 -0
- package/_esm/chains/opStack/actions/depositTransaction.js +17 -14
- package/_esm/chains/opStack/actions/depositTransaction.js.map +1 -1
- package/_esm/chains/opStack/actions/estimateDepositTransactionGas.js +62 -0
- package/_esm/chains/opStack/actions/estimateDepositTransactionGas.js.map +1 -0
- package/_esm/chains/opStack/actions/estimateFinalizeWithdrawalGas.js +50 -0
- package/_esm/chains/opStack/actions/estimateFinalizeWithdrawalGas.js.map +1 -0
- package/_esm/chains/opStack/actions/estimateInitiateWithdrawalGas.js +48 -0
- package/_esm/chains/opStack/actions/estimateInitiateWithdrawalGas.js.map +1 -0
- package/_esm/chains/opStack/actions/estimateProveWithdrawalGas.js +53 -0
- package/_esm/chains/opStack/actions/estimateProveWithdrawalGas.js.map +1 -0
- package/_esm/chains/opStack/actions/finalizeWithdrawal.js +53 -0
- package/_esm/chains/opStack/actions/finalizeWithdrawal.js.map +1 -0
- package/_esm/chains/opStack/actions/getL2Output.js +50 -0
- package/_esm/chains/opStack/actions/getL2Output.js.map +1 -0
- package/_esm/chains/opStack/actions/getTimeToFinalize.js +77 -0
- package/_esm/chains/opStack/actions/getTimeToFinalize.js.map +1 -0
- package/_esm/chains/opStack/actions/getTimeToNextL2Output.js +91 -0
- package/_esm/chains/opStack/actions/getTimeToNextL2Output.js.map +1 -0
- package/_esm/chains/opStack/actions/getTimeToProve.js +39 -0
- package/_esm/chains/opStack/actions/getTimeToProve.js.map +1 -0
- package/_esm/chains/opStack/actions/getWithdrawalStatus.js +99 -0
- package/_esm/chains/opStack/actions/getWithdrawalStatus.js.map +1 -0
- package/_esm/chains/opStack/actions/initiateWithdrawal.js +76 -0
- package/_esm/chains/opStack/actions/initiateWithdrawal.js.map +1 -0
- package/_esm/chains/opStack/actions/proveWithdrawal.js +57 -0
- package/_esm/chains/opStack/actions/proveWithdrawal.js.map +1 -0
- package/_esm/chains/opStack/actions/waitForNextL2Output.js +58 -0
- package/_esm/chains/opStack/actions/waitForNextL2Output.js.map +1 -0
- package/_esm/chains/opStack/actions/waitToFinalize.js +41 -0
- package/_esm/chains/opStack/actions/waitToFinalize.js.map +1 -0
- package/_esm/chains/opStack/actions/waitToProve.js +47 -0
- package/_esm/chains/opStack/actions/waitToProve.js.map +1 -0
- package/_esm/chains/opStack/chains.js +2 -0
- package/_esm/chains/opStack/chains.js.map +1 -1
- package/_esm/chains/opStack/decorators/publicL1.js +31 -0
- package/_esm/chains/opStack/decorators/publicL1.js.map +1 -0
- package/_esm/chains/opStack/decorators/publicL2.js +5 -1
- package/_esm/chains/opStack/decorators/publicL2.js.map +1 -1
- package/_esm/chains/opStack/decorators/walletL1.js +4 -0
- package/_esm/chains/opStack/decorators/walletL1.js.map +1 -1
- package/_esm/chains/opStack/decorators/walletL2.js +9 -0
- package/_esm/chains/opStack/decorators/walletL2.js.map +1 -0
- package/_esm/chains/opStack/errors/withdrawal.js +13 -0
- package/_esm/chains/opStack/errors/withdrawal.js.map +1 -0
- package/_esm/chains/opStack/index.js +21 -3
- package/_esm/chains/opStack/index.js.map +1 -1
- package/_esm/chains/opStack/types/deposit.js +2 -0
- package/_esm/chains/opStack/types/deposit.js.map +1 -0
- package/_esm/chains/opStack/types/withdrawal.js +2 -0
- package/_esm/chains/opStack/types/withdrawal.js.map +1 -0
- package/_esm/chains/opStack/utils/extractWithdrawalMessageLogs.js +10 -0
- package/_esm/chains/opStack/utils/extractWithdrawalMessageLogs.js.map +1 -0
- package/_esm/chains/opStack/utils/getL2TransactionHash.js +2 -2
- package/_esm/chains/opStack/utils/getL2TransactionHash.js.map +1 -1
- package/_esm/chains/opStack/utils/getWithdrawalHashStorageSlot.js +7 -0
- package/_esm/chains/opStack/utils/getWithdrawalHashStorageSlot.js.map +1 -0
- package/_esm/chains/opStack/utils/getWithdrawals.js +6 -0
- package/_esm/chains/opStack/utils/getWithdrawals.js.map +1 -0
- package/_esm/chains/opStack/utils/{fromOpaqueData.js → opaqueDataToDepositData.js} +2 -2
- package/_esm/chains/opStack/utils/opaqueDataToDepositData.js.map +1 -0
- package/_esm/errors/abi.js +19 -0
- package/_esm/errors/abi.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/index.js +4 -0
- package/_esm/index.js.map +1 -1
- package/_esm/utils/abi/getAbiItem.js +46 -2
- package/_esm/utils/abi/getAbiItem.js.map +1 -1
- package/_esm/utils/hash/ripemd160.js +12 -0
- package/_esm/utils/hash/ripemd160.js.map +1 -0
- package/_esm/utils/hash/sha256.js +12 -0
- package/_esm/utils/hash/sha256.js.map +1 -0
- package/_esm/utils/index.js +2 -0
- package/_esm/utils/index.js.map +1 -1
- package/_types/actions/ens/getEnsName.d.ts.map +1 -1
- package/_types/actions/index.d.ts +7 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/_types/actions/public/verifyTypedData.d.ts +2 -4
- package/_types/actions/public/verifyTypedData.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +5 -5
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/chains/celo/chainConfig.d.ts +97 -120
- package/_types/chains/celo/chainConfig.d.ts.map +1 -1
- package/_types/chains/celo/formatters.d.ts +98 -121
- package/_types/chains/celo/formatters.d.ts.map +1 -1
- package/_types/chains/celo/index.d.ts +1 -1
- package/_types/chains/celo/index.d.ts.map +1 -1
- package/_types/chains/celo/types.d.ts +2 -14
- package/_types/chains/celo/types.d.ts.map +1 -1
- package/_types/chains/definitions/arbitrumSepolia.d.ts +4 -0
- package/_types/chains/definitions/arbitrumSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/astar.d.ts +0 -3
- package/_types/chains/definitions/astar.d.ts.map +1 -1
- package/_types/chains/definitions/astarZkatana.d.ts +0 -3
- package/_types/chains/definitions/astarZkatana.d.ts.map +1 -1
- package/_types/chains/definitions/base.d.ts +80 -75
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/baseGoerli.d.ts +80 -75
- package/_types/chains/definitions/baseGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/baseSepolia.d.ts +80 -78
- package/_types/chains/definitions/baseSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/bscTestnet.d.ts +0 -3
- package/_types/chains/definitions/bscTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/celo.d.ts +97 -120
- package/_types/chains/definitions/celo.d.ts.map +1 -1
- package/_types/chains/definitions/celoAlfajores.d.ts +97 -120
- package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
- package/_types/chains/definitions/celoCannoli.d.ts +97 -120
- package/_types/chains/definitions/celoCannoli.d.ts.map +1 -1
- package/_types/chains/definitions/confluxESpaceTestnet.d.ts +0 -4
- package/_types/chains/definitions/confluxESpaceTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/fantomSonicTestnet.d.ts +35 -0
- package/_types/chains/definitions/fantomSonicTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/kava.d.ts +0 -3
- package/_types/chains/definitions/kava.d.ts.map +1 -1
- package/_types/chains/definitions/kavaTestnet.d.ts +0 -3
- package/_types/chains/definitions/kavaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/klaytnBaobab.d.ts +0 -3
- package/_types/chains/definitions/klaytnBaobab.d.ts.map +1 -1
- package/_types/chains/definitions/lukso.d.ts +0 -4
- package/_types/chains/definitions/lukso.d.ts.map +1 -1
- package/_types/chains/definitions/manta.d.ts +0 -3
- package/_types/chains/definitions/manta.d.ts.map +1 -1
- package/_types/chains/definitions/mantaTestnet.d.ts +0 -3
- package/_types/chains/definitions/mantaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/neonMainnet.d.ts +0 -3
- package/_types/chains/definitions/neonMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/optimism.d.ts +80 -75
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/optimismGoerli.d.ts +80 -75
- package/_types/chains/definitions/optimismGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/optimismSepolia.d.ts +80 -75
- package/_types/chains/definitions/optimismSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/pgn.d.ts +85 -78
- package/_types/chains/definitions/pgn.d.ts.map +1 -1
- package/_types/chains/definitions/pgnTestnet.d.ts +80 -78
- package/_types/chains/definitions/pgnTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/rootstock.d.ts +0 -3
- package/_types/chains/definitions/rootstock.d.ts.map +1 -1
- package/_types/chains/definitions/sapphire.d.ts +0 -4
- package/_types/chains/definitions/sapphire.d.ts.map +1 -1
- package/_types/chains/definitions/sapphireTestnet.d.ts +0 -4
- package/_types/chains/definitions/sapphireTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/shibarium.d.ts +0 -3
- package/_types/chains/definitions/shibarium.d.ts.map +1 -1
- package/_types/chains/definitions/shimmer.d.ts +0 -3
- package/_types/chains/definitions/shimmer.d.ts.map +1 -1
- package/_types/chains/definitions/shimmerTestnet.d.ts +0 -3
- package/_types/chains/definitions/shimmerTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/taikoJolnir.d.ts +2 -2
- package/_types/chains/definitions/tenet.d.ts +0 -3
- package/_types/chains/definitions/tenet.d.ts.map +1 -1
- package/_types/chains/definitions/zilliqa.d.ts +35 -0
- package/_types/chains/definitions/zilliqa.d.ts.map +1 -0
- package/_types/chains/definitions/zilliqaTestnet.d.ts +35 -0
- package/_types/chains/definitions/zilliqaTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/zkSync.d.ts +9 -9
- package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts +529 -0
- package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/zkSyncTestnet.d.ts +10 -9
- package/_types/chains/definitions/zkSyncTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zora.d.ts +80 -75
- package/_types/chains/definitions/zora.d.ts.map +1 -1
- package/_types/chains/definitions/zoraSepolia.d.ts +80 -79
- package/_types/chains/definitions/zoraSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zoraTestnet.d.ts +75 -75
- package/_types/chains/index.d.ts +5 -1
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/chains/opStack/abis.d.ts +457 -0
- package/_types/chains/opStack/abis.d.ts.map +1 -1
- package/_types/chains/opStack/actions/buildDepositTransaction.d.ts +5 -3
- package/_types/chains/opStack/actions/buildDepositTransaction.d.ts.map +1 -1
- package/_types/chains/opStack/actions/buildInitiateWithdrawal.d.ts +50 -0
- package/_types/chains/opStack/actions/buildInitiateWithdrawal.d.ts.map +1 -0
- package/_types/chains/opStack/actions/buildProveWithdrawal.d.ts +48 -0
- package/_types/chains/opStack/actions/buildProveWithdrawal.d.ts.map +1 -0
- package/_types/chains/opStack/actions/depositTransaction.d.ts +18 -34
- package/_types/chains/opStack/actions/depositTransaction.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateDepositTransactionGas.d.ts +50 -0
- package/_types/chains/opStack/actions/estimateDepositTransactionGas.d.ts.map +1 -0
- package/_types/chains/opStack/actions/estimateFinalizeWithdrawalGas.d.ts +45 -0
- package/_types/chains/opStack/actions/estimateFinalizeWithdrawalGas.d.ts.map +1 -0
- package/_types/chains/opStack/actions/estimateInitiateWithdrawalGas.d.ts +51 -0
- package/_types/chains/opStack/actions/estimateInitiateWithdrawalGas.d.ts.map +1 -0
- package/_types/chains/opStack/actions/estimateProveWithdrawalGas.d.ts +63 -0
- package/_types/chains/opStack/actions/estimateProveWithdrawalGas.d.ts.map +1 -0
- package/_types/chains/opStack/actions/finalizeWithdrawal.d.ts +49 -0
- package/_types/chains/opStack/actions/finalizeWithdrawal.d.ts.map +1 -0
- package/_types/chains/opStack/actions/getL2Output.d.ts +44 -0
- package/_types/chains/opStack/actions/getL2Output.d.ts.map +1 -0
- package/_types/chains/opStack/actions/getTimeToFinalize.d.ts +57 -0
- package/_types/chains/opStack/actions/getTimeToFinalize.d.ts.map +1 -0
- package/_types/chains/opStack/actions/getTimeToNextL2Output.d.ts +61 -0
- package/_types/chains/opStack/actions/getTimeToNextL2Output.d.ts.map +1 -0
- package/_types/chains/opStack/actions/getTimeToProve.d.ts +50 -0
- package/_types/chains/opStack/actions/getTimeToProve.d.ts.map +1 -0
- package/_types/chains/opStack/actions/getWithdrawalStatus.d.ts +48 -0
- package/_types/chains/opStack/actions/getWithdrawalStatus.d.ts.map +1 -0
- package/_types/chains/opStack/actions/initiateWithdrawal.d.ts +77 -0
- package/_types/chains/opStack/actions/initiateWithdrawal.d.ts.map +1 -0
- package/_types/chains/opStack/actions/proveWithdrawal.d.ts +67 -0
- package/_types/chains/opStack/actions/proveWithdrawal.d.ts.map +1 -0
- package/_types/chains/opStack/actions/waitForNextL2Output.d.ts +55 -0
- package/_types/chains/opStack/actions/waitForNextL2Output.d.ts.map +1 -0
- package/_types/chains/opStack/actions/waitToFinalize.d.ts +45 -0
- package/_types/chains/opStack/actions/waitToFinalize.d.ts.map +1 -0
- package/_types/chains/opStack/actions/waitToProve.d.ts +55 -0
- package/_types/chains/opStack/actions/waitToProve.d.ts.map +1 -0
- package/_types/chains/opStack/chainConfig.d.ts +74 -74
- package/_types/chains/opStack/chains.d.ts +2 -0
- package/_types/chains/opStack/chains.d.ts.map +1 -1
- package/_types/chains/opStack/decorators/publicL1.d.ts +386 -0
- package/_types/chains/opStack/decorators/publicL1.d.ts.map +1 -0
- package/_types/chains/opStack/decorators/publicL2.d.ts +82 -26
- package/_types/chains/opStack/decorators/publicL2.d.ts.map +1 -1
- package/_types/chains/opStack/decorators/walletL1.d.ts +57 -2
- package/_types/chains/opStack/decorators/walletL1.d.ts.map +1 -1
- package/_types/chains/opStack/decorators/walletL2.d.ts +62 -0
- package/_types/chains/opStack/decorators/walletL2.d.ts.map +1 -0
- package/_types/chains/opStack/errors/withdrawal.d.ts +12 -0
- package/_types/chains/opStack/errors/withdrawal.d.ts.map +1 -0
- package/_types/chains/opStack/formatters.d.ts +74 -74
- package/_types/chains/opStack/index.d.ts +21 -3
- package/_types/chains/opStack/index.d.ts.map +1 -1
- package/_types/chains/opStack/types/deposit.d.ts +25 -0
- package/_types/chains/opStack/types/deposit.d.ts.map +1 -0
- package/_types/chains/opStack/types/withdrawal.d.ts +22 -0
- package/_types/chains/opStack/types/withdrawal.d.ts.map +1 -0
- package/_types/chains/opStack/utils/extractWithdrawalMessageLogs.d.ts +137 -0
- package/_types/chains/opStack/utils/extractWithdrawalMessageLogs.d.ts.map +1 -0
- package/_types/chains/opStack/utils/getWithdrawalHashStorageSlot.d.ts +11 -0
- package/_types/chains/opStack/utils/getWithdrawalHashStorageSlot.d.ts.map +1 -0
- package/_types/chains/opStack/utils/getWithdrawals.d.ts +12 -0
- package/_types/chains/opStack/utils/getWithdrawals.d.ts.map +1 -0
- package/_types/chains/opStack/utils/opaqueDataToDepositData.d.ts +15 -0
- package/_types/chains/opStack/utils/opaqueDataToDepositData.d.ts.map +1 -0
- package/_types/chains/zksync/chainConfig.d.ts +9 -9
- package/_types/chains/zksync/formatters.d.ts +9 -9
- package/_types/clients/decorators/public.d.ts +2 -2
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/clients/decorators/wallet.d.ts +2 -2
- package/_types/clients/decorators/wallet.d.ts.map +1 -1
- package/_types/errors/abi.d.ts +14 -1
- package/_types/errors/abi.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/index.d.ts +15 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/types/account.d.ts +1 -1
- package/_types/types/account.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +12 -0
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/utils/abi/getAbiItem.d.ts +2 -1
- package/_types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +1 -1
- package/_types/utils/hash/ripemd160.d.ts +11 -0
- package/_types/utils/hash/ripemd160.d.ts.map +1 -0
- package/_types/utils/hash/sha256.d.ts +11 -0
- package/_types/utils/hash/sha256.d.ts.map +1 -0
- package/_types/utils/index.d.ts +2 -0
- package/_types/utils/index.d.ts.map +1 -1
- package/actions/ens/getEnsName.ts +3 -2
- package/actions/index.ts +31 -0
- package/actions/public/getFilterChanges.ts +3 -5
- package/actions/public/getFilterLogs.ts +3 -3
- package/actions/public/getLogs.ts +3 -3
- package/actions/public/verifyTypedData.ts +13 -8
- package/actions/wallet/prepareTransactionRequest.ts +16 -9
- package/chains/celo/formatters.ts +0 -14
- package/chains/celo/index.ts +0 -4
- package/chains/celo/types.ts +0 -18
- package/chains/definitions/arbitrumSepolia.ts +4 -0
- package/chains/definitions/astar.ts +0 -1
- package/chains/definitions/astarZkatana.ts +0 -6
- package/chains/definitions/base.ts +5 -0
- package/chains/definitions/baseGoerli.ts +5 -0
- package/chains/definitions/baseSepolia.ts +5 -3
- package/chains/definitions/bscTestnet.ts +0 -1
- package/chains/definitions/confluxESpaceTestnet.ts +0 -4
- package/chains/definitions/fantomSonicTestnet.ts +22 -0
- package/chains/definitions/kava.ts +0 -1
- package/chains/definitions/kavaTestnet.ts +0 -1
- package/chains/definitions/klaytnBaobab.ts +0 -1
- package/chains/definitions/lukso.ts +0 -4
- package/chains/definitions/manta.ts +0 -1
- package/chains/definitions/mantaTestnet.ts +0 -1
- package/chains/definitions/neonMainnet.ts +0 -3
- package/chains/definitions/optimism.ts +5 -0
- package/chains/definitions/optimismGoerli.ts +5 -0
- package/chains/definitions/optimismSepolia.ts +5 -0
- package/chains/definitions/pgn.ts +13 -3
- package/chains/definitions/pgnTestnet.ts +8 -3
- package/chains/definitions/rootstock.ts +0 -1
- package/chains/definitions/sapphire.ts +0 -4
- package/chains/definitions/sapphireTestnet.ts +0 -4
- package/chains/definitions/shibarium.ts +0 -3
- package/chains/definitions/shimmer.ts +0 -3
- package/chains/definitions/shimmerTestnet.ts +0 -3
- package/chains/definitions/taikoJolnir.ts +2 -2
- package/chains/definitions/tenet.ts +0 -1
- package/chains/definitions/zilliqa.ts +20 -0
- package/chains/definitions/zilliqaTestnet.ts +20 -0
- package/chains/definitions/zkSyncSepoliaTestnet.ts +28 -0
- package/chains/definitions/zkSyncTestnet.ts +1 -0
- package/chains/definitions/zora.ts +5 -0
- package/chains/definitions/zoraSepolia.ts +5 -4
- package/chains/index.ts +9 -0
- package/chains/opStack/abis.ts +367 -0
- package/chains/opStack/actions/buildDepositTransaction.ts +11 -6
- package/chains/opStack/actions/buildInitiateWithdrawal.ts +118 -0
- package/chains/opStack/actions/buildProveWithdrawal.ts +149 -0
- package/chains/opStack/actions/depositTransaction.ts +50 -44
- package/chains/opStack/actions/estimateDepositTransactionGas.ts +138 -0
- package/chains/opStack/actions/estimateFinalizeWithdrawalGas.ts +118 -0
- package/chains/opStack/actions/estimateInitiateWithdrawalGas.ts +118 -0
- package/chains/opStack/actions/estimateProveWithdrawalGas.ts +139 -0
- package/chains/opStack/actions/finalizeWithdrawal.ts +130 -0
- package/chains/opStack/actions/getL2Output.ts +89 -0
- package/chains/opStack/actions/getTimeToFinalize.ts +122 -0
- package/chains/opStack/actions/getTimeToNextL2Output.ts +162 -0
- package/chains/opStack/actions/getTimeToProve.ts +79 -0
- package/chains/opStack/actions/getWithdrawalStatus.ts +152 -0
- package/chains/opStack/actions/initiateWithdrawal.ts +153 -0
- package/chains/opStack/actions/proveWithdrawal.ts +151 -0
- package/chains/opStack/actions/waitForNextL2Output.ts +111 -0
- package/chains/opStack/actions/waitToFinalize.ts +64 -0
- package/chains/opStack/actions/waitToProve.ts +99 -0
- package/chains/opStack/chains.ts +2 -0
- package/chains/opStack/decorators/publicL1.ts +514 -0
- package/chains/opStack/decorators/publicL2.ts +129 -37
- package/chains/opStack/decorators/walletL1.ts +71 -2
- package/chains/opStack/decorators/walletL2.ts +84 -0
- package/chains/opStack/errors/withdrawal.ts +15 -0
- package/chains/opStack/index.ts +112 -21
- package/chains/opStack/types/deposit.ts +28 -0
- package/chains/opStack/types/withdrawal.ts +23 -0
- package/chains/opStack/utils/extractWithdrawalMessageLogs.ts +36 -0
- package/chains/opStack/utils/getL2TransactionHash.ts +2 -2
- package/chains/opStack/utils/getWithdrawalHashStorageSlot.ts +29 -0
- package/chains/opStack/utils/getWithdrawals.ts +25 -0
- package/chains/opStack/utils/{fromOpaqueData.ts → opaqueDataToDepositData.ts} +9 -4
- package/clients/decorators/public.ts +2 -2
- package/clients/decorators/wallet.ts +2 -2
- package/errors/abi.ts +22 -1
- package/errors/version.ts +1 -1
- package/index.ts +40 -0
- package/package.json +1 -1
- package/types/account.ts +1 -1
- package/types/eip1193.ts +12 -0
- package/utils/abi/getAbiItem.ts +71 -2
- package/utils/hash/ripemd160.ts +31 -0
- package/utils/hash/sha256.ts +31 -0
- package/utils/index.ts +2 -0
- package/_cjs/chains/opStack/utils/fromOpaqueData.js.map +0 -1
- package/_esm/chains/opStack/utils/fromOpaqueData.js.map +0 -1
- package/_types/chains/opStack/utils/fromOpaqueData.d.ts +0 -15
- package/_types/chains/opStack/utils/fromOpaqueData.d.ts.map +0 -1
- package/chains/celo/package.json +0 -6
- package/chains/opStack/package.json +0 -6
- package/chains/zksync/package.json +0 -6
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.estimateFinalizeWithdrawalGas = void 0;
|
4
|
+
const estimateContractGas_js_1 = require("../../../actions/public/estimateContractGas.js");
|
5
|
+
const abis_js_1 = require("../abis.js");
|
6
|
+
async function estimateFinalizeWithdrawalGas(client, parameters) {
|
7
|
+
const { account, chain = client.chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce, targetChain, withdrawal, } = parameters;
|
8
|
+
const portalAddress = (() => {
|
9
|
+
if (parameters.portalAddress)
|
10
|
+
return parameters.portalAddress;
|
11
|
+
if (chain)
|
12
|
+
return targetChain.contracts.portal[chain.id].address;
|
13
|
+
return Object.values(targetChain.contracts.portal)[0].address;
|
14
|
+
})();
|
15
|
+
return (0, estimateContractGas_js_1.estimateContractGas)(client, {
|
16
|
+
account,
|
17
|
+
abi: abis_js_1.portalAbi,
|
18
|
+
address: portalAddress,
|
19
|
+
chain,
|
20
|
+
functionName: 'finalizeWithdrawalTransaction',
|
21
|
+
args: [withdrawal],
|
22
|
+
gas,
|
23
|
+
maxFeePerGas,
|
24
|
+
maxPriorityFeePerGas,
|
25
|
+
nonce,
|
26
|
+
});
|
27
|
+
}
|
28
|
+
exports.estimateFinalizeWithdrawalGas = estimateFinalizeWithdrawalGas;
|
29
|
+
//# sourceMappingURL=estimateFinalizeWithdrawalGas.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"estimateFinalizeWithdrawalGas.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/estimateFinalizeWithdrawalGas.ts"],"names":[],"mappings":";;;AACA,2FAIuD;AAYvD,wCAAsC;AA2D/B,KAAK,UAAU,6BAA6B,CAKjD,MAAyC,EACzC,UAIC;IAED,MAAM,EACJ,OAAO,EACP,KAAK,GAAG,MAAM,CAAC,KAAK,EACpB,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,WAAW,EACX,UAAU,GACX,GAAG,UAAU,CAAA;IAEd,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE;QAC1B,IAAI,UAAU,CAAC,aAAa;YAAE,OAAO,UAAU,CAAC,aAAa,CAAA;QAC7D,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACjE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAChE,CAAC,CAAC,EAAE,CAAA;IAEJ,OAAO,IAAA,4CAAmB,EAAC,MAAM,EAAE;QACjC,OAAO;QACP,GAAG,EAAE,mBAAS;QACd,OAAO,EAAE,aAAa;QACtB,KAAK;QACL,YAAY,EAAE,+BAA+B;QAC7C,IAAI,EAAE,CAAC,UAAU,CAAC;QAClB,GAAG;QACH,YAAY;QACZ,oBAAoB;QACpB,KAAK;KAC2B,CAAC,CAAA;AACrC,CAAC;AAzCD,sEAyCC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.estimateInitiateWithdrawalGas = void 0;
|
4
|
+
const estimateContractGas_js_1 = require("../../../actions/public/estimateContractGas.js");
|
5
|
+
const abis_js_1 = require("../abis.js");
|
6
|
+
const contracts_js_1 = require("../contracts.js");
|
7
|
+
async function estimateInitiateWithdrawalGas(client, parameters) {
|
8
|
+
const { account, chain = client.chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce, request: { data = '0x', gas: l1Gas, to, value }, } = parameters;
|
9
|
+
return (0, estimateContractGas_js_1.estimateContractGas)(client, {
|
10
|
+
account,
|
11
|
+
abi: abis_js_1.l2ToL1MessagePasserAbi,
|
12
|
+
address: contracts_js_1.contracts.l2ToL1MessagePasser.address,
|
13
|
+
chain,
|
14
|
+
functionName: 'initiateWithdrawal',
|
15
|
+
args: [to, l1Gas, data],
|
16
|
+
gas,
|
17
|
+
maxFeePerGas,
|
18
|
+
maxPriorityFeePerGas,
|
19
|
+
nonce,
|
20
|
+
value,
|
21
|
+
});
|
22
|
+
}
|
23
|
+
exports.estimateInitiateWithdrawalGas = estimateInitiateWithdrawalGas;
|
24
|
+
//# sourceMappingURL=estimateInitiateWithdrawalGas.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"estimateInitiateWithdrawalGas.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/estimateInitiateWithdrawalGas.ts"],"names":[],"mappings":";;;AACA,2FAIuD;AAYvD,wCAAmD;AACnD,kDAA2C;AAgEpC,KAAK,UAAU,6BAA6B,CAKjD,MAAyC,EACzC,UAIC;IAED,MAAM,EACJ,OAAO,EACP,KAAK,GAAG,MAAM,CAAC,KAAK,EACpB,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EAAE,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,GAChD,GAAG,UAAU,CAAA;IAEd,OAAO,IAAA,4CAAmB,EAAC,MAAM,EAAE;QACjC,OAAO;QACP,GAAG,EAAE,gCAAsB;QAC3B,OAAO,EAAE,wBAAS,CAAC,mBAAmB,CAAC,OAAO;QAC9C,KAAK;QACL,YAAY,EAAE,oBAAoB;QAClC,IAAI,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC;QACvB,GAAG;QACH,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,KAAK;KAC2B,CAAC,CAAA;AACrC,CAAC;AAnCD,sEAmCC"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.estimateProveWithdrawalGas = void 0;
|
4
|
+
const estimateContractGas_js_1 = require("../../../actions/public/estimateContractGas.js");
|
5
|
+
const abis_js_1 = require("../abis.js");
|
6
|
+
async function estimateProveWithdrawalGas(client, parameters) {
|
7
|
+
const { account, chain = client.chain, gas, l2OutputIndex, maxFeePerGas, maxPriorityFeePerGas, nonce, outputRootProof, targetChain, withdrawalProof, withdrawal, } = parameters;
|
8
|
+
const portalAddress = (() => {
|
9
|
+
if (parameters.portalAddress)
|
10
|
+
return parameters.portalAddress;
|
11
|
+
if (chain)
|
12
|
+
return targetChain.contracts.portal[chain.id].address;
|
13
|
+
return Object.values(targetChain.contracts.portal)[0].address;
|
14
|
+
})();
|
15
|
+
return (0, estimateContractGas_js_1.estimateContractGas)(client, {
|
16
|
+
account,
|
17
|
+
abi: abis_js_1.portalAbi,
|
18
|
+
address: portalAddress,
|
19
|
+
chain,
|
20
|
+
functionName: 'proveWithdrawalTransaction',
|
21
|
+
args: [withdrawal, l2OutputIndex, outputRootProof, withdrawalProof],
|
22
|
+
gas,
|
23
|
+
maxFeePerGas,
|
24
|
+
maxPriorityFeePerGas,
|
25
|
+
nonce,
|
26
|
+
});
|
27
|
+
}
|
28
|
+
exports.estimateProveWithdrawalGas = estimateProveWithdrawalGas;
|
29
|
+
//# sourceMappingURL=estimateProveWithdrawalGas.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"estimateProveWithdrawalGas.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/estimateProveWithdrawalGas.ts"],"names":[],"mappings":";;;AACA,2FAIuD;AAavD,wCAAsC;AA4E/B,KAAK,UAAU,0BAA0B,CAK9C,MAAyC,EACzC,UAIC;IAED,MAAM,EACJ,OAAO,EACP,KAAK,GAAG,MAAM,CAAC,KAAK,EACpB,GAAG,EACH,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,eAAe,EACf,WAAW,EACX,eAAe,EACf,UAAU,GACX,GAAG,UAAU,CAAA;IAEd,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE;QAC1B,IAAI,UAAU,CAAC,aAAa;YAAE,OAAO,UAAU,CAAC,aAAa,CAAA;QAC7D,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACjE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAChE,CAAC,CAAC,EAAE,CAAA;IAEJ,OAAO,IAAA,4CAAmB,EAAC,MAAM,EAAE;QACjC,OAAO;QACP,GAAG,EAAE,mBAAS;QACd,OAAO,EAAE,aAAa;QACtB,KAAK;QACL,YAAY,EAAE,4BAA4B;QAC1C,IAAI,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,CAAC;QACnE,GAAG;QACH,YAAY;QACZ,oBAAoB;QACpB,KAAK;KAC2B,CAAC,CAAA;AACrC,CAAC;AA5CD,gEA4CC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.finalizeWithdrawal = void 0;
|
4
|
+
const writeContract_js_1 = require("../../../actions/wallet/writeContract.js");
|
5
|
+
const abis_js_1 = require("../abis.js");
|
6
|
+
const estimateFinalizeWithdrawalGas_js_1 = require("./estimateFinalizeWithdrawalGas.js");
|
7
|
+
async function finalizeWithdrawal(client, parameters) {
|
8
|
+
const { account, chain = client.chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce, targetChain, withdrawal, } = parameters;
|
9
|
+
const portalAddress = (() => {
|
10
|
+
if (parameters.portalAddress)
|
11
|
+
return parameters.portalAddress;
|
12
|
+
if (chain)
|
13
|
+
return targetChain.contracts.portal[chain.id].address;
|
14
|
+
return Object.values(targetChain.contracts.portal)[0].address;
|
15
|
+
})();
|
16
|
+
const gas_ = typeof gas !== 'number' && gas !== null
|
17
|
+
? await (0, estimateFinalizeWithdrawalGas_js_1.estimateFinalizeWithdrawalGas)(client, parameters)
|
18
|
+
: undefined;
|
19
|
+
return (0, writeContract_js_1.writeContract)(client, {
|
20
|
+
account,
|
21
|
+
abi: abis_js_1.portalAbi,
|
22
|
+
address: portalAddress,
|
23
|
+
chain,
|
24
|
+
functionName: 'finalizeWithdrawalTransaction',
|
25
|
+
args: [withdrawal],
|
26
|
+
gas: gas_,
|
27
|
+
maxFeePerGas,
|
28
|
+
maxPriorityFeePerGas,
|
29
|
+
nonce,
|
30
|
+
});
|
31
|
+
}
|
32
|
+
exports.finalizeWithdrawal = finalizeWithdrawal;
|
33
|
+
//# sourceMappingURL=finalizeWithdrawal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"finalizeWithdrawal.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/finalizeWithdrawal.ts"],"names":[],"mappings":";;;AACA,+EAGiD;AAajD,wCAAsC;AAGtC,yFAI2C;AA4DpC,KAAK,UAAU,kBAAkB,CAKtC,MAAyC,EACzC,UAAuE;IAEvE,MAAM,EACJ,OAAO,EACP,KAAK,GAAG,MAAM,CAAC,KAAK,EACpB,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,WAAW,EACX,UAAU,GACX,GAAG,UAAU,CAAA;IAEd,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE;QAC1B,IAAI,UAAU,CAAC,aAAa;YAAE,OAAO,UAAU,CAAC,aAAa,CAAA;QAC7D,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACjE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAChE,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,IAAI,GACR,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QACrC,CAAC,CAAC,MAAM,IAAA,gEAA6B,EACjC,MAAM,EACN,UAAqD,CACtD;QACH,CAAC,CAAC,SAAS,CAAA;IAEf,OAAO,IAAA,gCAAa,EAAC,MAAM,EAAE;QAC3B,OAAO;QACP,GAAG,EAAE,mBAAS;QACd,OAAO,EAAE,aAAa;QACtB,KAAK;QACL,YAAY,EAAE,+BAA+B;QAC7C,IAAI,EAAE,CAAC,UAAU,CAAC;QAClB,GAAG,EAAE,IAAI;QACT,YAAY;QACZ,oBAAoB;QACpB,KAAK;KACN,CAAC,CAAA;AACJ,CAAC;AA7CD,gDA6CC"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getL2Output = void 0;
|
4
|
+
const readContract_js_1 = require("../../../actions/public/readContract.js");
|
5
|
+
const abis_js_1 = require("../abis.js");
|
6
|
+
async function getL2Output(client, parameters) {
|
7
|
+
const { chain = client.chain, l2BlockNumber, targetChain } = parameters;
|
8
|
+
const l2OutputOracleAddress = (() => {
|
9
|
+
if (parameters.l2OutputOracleAddress)
|
10
|
+
return parameters.l2OutputOracleAddress;
|
11
|
+
if (chain)
|
12
|
+
return targetChain.contracts.l2OutputOracle[chain.id].address;
|
13
|
+
return Object.values(targetChain.contracts.l2OutputOracle)[0].address;
|
14
|
+
})();
|
15
|
+
const outputIndex = await (0, readContract_js_1.readContract)(client, {
|
16
|
+
address: l2OutputOracleAddress,
|
17
|
+
abi: abis_js_1.l2OutputOracleAbi,
|
18
|
+
functionName: 'getL2OutputIndexAfter',
|
19
|
+
args: [l2BlockNumber],
|
20
|
+
});
|
21
|
+
const output = await (0, readContract_js_1.readContract)(client, {
|
22
|
+
address: l2OutputOracleAddress,
|
23
|
+
abi: abis_js_1.l2OutputOracleAbi,
|
24
|
+
functionName: 'getL2Output',
|
25
|
+
args: [outputIndex],
|
26
|
+
});
|
27
|
+
return { outputIndex, ...output };
|
28
|
+
}
|
29
|
+
exports.getL2Output = getL2Output;
|
30
|
+
//# sourceMappingURL=getL2Output.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getL2Output.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/getL2Output.ts"],"names":[],"mappings":";;;AAAA,6EAGgD;AAWhD,wCAA8C;AA2CvC,KAAK,UAAU,WAAW,CAK/B,MAAyC,EACzC,UAAuD;IAEvD,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,UAAU,CAAA;IAEvE,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE;QAClC,IAAI,UAAU,CAAC,qBAAqB;YAClC,OAAO,UAAU,CAAC,qBAAqB,CAAA;QACzC,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACzE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IACxE,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,WAAW,GAAG,MAAM,IAAA,8BAAY,EAAC,MAAM,EAAE;QAC7C,OAAO,EAAE,qBAAqB;QAC9B,GAAG,EAAE,2BAAiB;QACtB,YAAY,EAAE,uBAAuB;QACrC,IAAI,EAAE,CAAC,aAAa,CAAC;KACtB,CAAC,CAAA;IACF,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAY,EAAC,MAAM,EAAE;QACxC,OAAO,EAAE,qBAAqB;QAC9B,GAAG,EAAE,2BAAiB;QACtB,YAAY,EAAE,aAAa;QAC3B,IAAI,EAAE,CAAC,WAAW,CAAC;KACpB,CAAC,CAAA;IAEF,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAAA;AACnC,CAAC;AA/BD,kCA+BC"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getTimeToFinalize = void 0;
|
4
|
+
const multicall_js_1 = require("../../../actions/public/multicall.js");
|
5
|
+
const abis_js_1 = require("../abis.js");
|
6
|
+
const buffer = 10;
|
7
|
+
async function getTimeToFinalize(client, parameters) {
|
8
|
+
const { chain = client.chain, withdrawalHash, targetChain } = parameters;
|
9
|
+
const l2OutputOracleAddress = (() => {
|
10
|
+
if (parameters.l2OutputOracleAddress)
|
11
|
+
return parameters.l2OutputOracleAddress;
|
12
|
+
if (chain)
|
13
|
+
return targetChain.contracts.l2OutputOracle[chain.id].address;
|
14
|
+
return Object.values(targetChain.contracts.l2OutputOracle)[0].address;
|
15
|
+
})();
|
16
|
+
const portalAddress = (() => {
|
17
|
+
if (parameters.portalAddress)
|
18
|
+
return parameters.portalAddress;
|
19
|
+
if (chain)
|
20
|
+
return targetChain.contracts.portal[chain.id].address;
|
21
|
+
return Object.values(targetChain.contracts.portal)[0].address;
|
22
|
+
})();
|
23
|
+
const [[_outputRoot, proveTimestamp, _l2OutputIndex], period] = await (0, multicall_js_1.multicall)(client, {
|
24
|
+
allowFailure: false,
|
25
|
+
contracts: [
|
26
|
+
{
|
27
|
+
abi: abis_js_1.portalAbi,
|
28
|
+
address: portalAddress,
|
29
|
+
functionName: 'provenWithdrawals',
|
30
|
+
args: [withdrawalHash],
|
31
|
+
},
|
32
|
+
{
|
33
|
+
abi: abis_js_1.l2OutputOracleAbi,
|
34
|
+
address: l2OutputOracleAddress,
|
35
|
+
functionName: 'FINALIZATION_PERIOD_SECONDS',
|
36
|
+
},
|
37
|
+
],
|
38
|
+
});
|
39
|
+
const secondsSinceProven = Date.now() / 1000 - Number(proveTimestamp);
|
40
|
+
const secondsToFinalize = Number(period) - secondsSinceProven;
|
41
|
+
const seconds = Math.floor(secondsToFinalize < 0 ? 0 : secondsToFinalize + buffer);
|
42
|
+
const timestamp = Date.now() + seconds * 1000;
|
43
|
+
return { period: Number(period), seconds, timestamp };
|
44
|
+
}
|
45
|
+
exports.getTimeToFinalize = getTimeToFinalize;
|
46
|
+
//# sourceMappingURL=getTimeToFinalize.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTimeToFinalize.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/getTimeToFinalize.ts"],"names":[],"mappings":";;;AAAA,uEAG6C;AAW7C,wCAAyD;AAqBzD,MAAM,MAAM,GAAG,EAAE,CAAA;AAqCV,KAAK,UAAU,iBAAiB,CAKrC,MAAyC,EACzC,UAA6D;IAE7D,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,UAAU,CAAA;IAExE,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE;QAClC,IAAI,UAAU,CAAC,qBAAqB;YAClC,OAAO,UAAU,CAAC,qBAAqB,CAAA;QACzC,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACzE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IACxE,CAAC,CAAC,EAAE,CAAA;IACJ,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE;QAC1B,IAAI,UAAU,CAAC,aAAa;YAAE,OAAO,UAAU,CAAC,aAAa,CAAA;QAC7D,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACjE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAChE,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,GAC3D,MAAM,IAAA,wBAAS,EAAC,MAAM,EAAE;QACtB,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,mBAAS;gBACd,OAAO,EAAE,aAAa;gBACtB,YAAY,EAAE,mBAAmB;gBACjC,IAAI,EAAE,CAAC,cAAc,CAAC;aACvB;YACD;gBACE,GAAG,EAAE,2BAAiB;gBACtB,OAAO,EAAE,qBAAqB;gBAC9B,YAAY,EAAE,6BAA6B;aAC5C;SACF;KACF,CAAC,CAAA;IAEJ,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;IACrE,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,kBAAkB,CAAA;IAE7D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,GAAG,MAAM,CACvD,CAAA;IACD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,IAAI,CAAA;IAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAA;AACvD,CAAC;AAjDD,8CAiDC"}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getTimeToNextL2Output = void 0;
|
4
|
+
const multicall_js_1 = require("../../../actions/public/multicall.js");
|
5
|
+
const readContract_js_1 = require("../../../actions/public/readContract.js");
|
6
|
+
const abis_js_1 = require("../abis.js");
|
7
|
+
async function getTimeToNextL2Output(client, parameters) {
|
8
|
+
const { intervalBuffer = 1.1, chain = client.chain, l2BlockNumber, targetChain, } = parameters;
|
9
|
+
const l2OutputOracleAddress = (() => {
|
10
|
+
if (parameters.l2OutputOracleAddress)
|
11
|
+
return parameters.l2OutputOracleAddress;
|
12
|
+
if (chain)
|
13
|
+
return targetChain.contracts.l2OutputOracle[chain.id].address;
|
14
|
+
return Object.values(targetChain.contracts.l2OutputOracle)[0].address;
|
15
|
+
})();
|
16
|
+
const [latestOutputIndex, blockTime, blockInterval] = await (0, multicall_js_1.multicall)(client, {
|
17
|
+
allowFailure: false,
|
18
|
+
contracts: [
|
19
|
+
{
|
20
|
+
abi: abis_js_1.l2OutputOracleAbi,
|
21
|
+
address: l2OutputOracleAddress,
|
22
|
+
functionName: 'latestOutputIndex',
|
23
|
+
},
|
24
|
+
{
|
25
|
+
abi: abis_js_1.l2OutputOracleAbi,
|
26
|
+
address: l2OutputOracleAddress,
|
27
|
+
functionName: 'L2_BLOCK_TIME',
|
28
|
+
},
|
29
|
+
{
|
30
|
+
abi: abis_js_1.l2OutputOracleAbi,
|
31
|
+
address: l2OutputOracleAddress,
|
32
|
+
functionName: 'SUBMISSION_INTERVAL',
|
33
|
+
},
|
34
|
+
],
|
35
|
+
});
|
36
|
+
const latestOutput = await (0, readContract_js_1.readContract)(client, {
|
37
|
+
abi: abis_js_1.l2OutputOracleAbi,
|
38
|
+
address: l2OutputOracleAddress,
|
39
|
+
functionName: 'getL2Output',
|
40
|
+
args: [latestOutputIndex],
|
41
|
+
});
|
42
|
+
const latestOutputTimestamp = Number(latestOutput.timestamp) * 1000;
|
43
|
+
const interval = Number(blockInterval * blockTime);
|
44
|
+
const intervalWithBuffer = Math.ceil(interval * intervalBuffer);
|
45
|
+
const now = Date.now();
|
46
|
+
const seconds = (() => {
|
47
|
+
if (now < latestOutputTimestamp)
|
48
|
+
return 0;
|
49
|
+
if (latestOutput.l2BlockNumber > l2BlockNumber)
|
50
|
+
return 0;
|
51
|
+
const elapsedBlocks = Number(l2BlockNumber - latestOutput.l2BlockNumber);
|
52
|
+
const elapsed = Math.ceil((now - latestOutputTimestamp) / 1000);
|
53
|
+
const secondsToNextOutput = intervalWithBuffer - (elapsed % intervalWithBuffer);
|
54
|
+
return elapsedBlocks < blockInterval
|
55
|
+
? secondsToNextOutput
|
56
|
+
: Math.floor(elapsedBlocks / Number(blockInterval)) * intervalWithBuffer +
|
57
|
+
secondsToNextOutput;
|
58
|
+
})();
|
59
|
+
const timestamp = seconds > 0 ? now + seconds * 1000 : undefined;
|
60
|
+
return { interval, seconds, timestamp };
|
61
|
+
}
|
62
|
+
exports.getTimeToNextL2Output = getTimeToNextL2Output;
|
63
|
+
//# sourceMappingURL=getTimeToNextL2Output.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTimeToNextL2Output.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/getTimeToNextL2Output.ts"],"names":[],"mappings":";;;AAAA,uEAG6C;AAC7C,6EAGgD;AAUhD,wCAA8C;AA+DvC,KAAK,UAAU,qBAAqB,CAKzC,MAAyC,EACzC,UAAiE;IAEjE,MAAM,EACJ,cAAc,GAAG,GAAG,EACpB,KAAK,GAAG,MAAM,CAAC,KAAK,EACpB,aAAa,EACb,WAAW,GACZ,GAAG,UAAU,CAAA;IAEd,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE;QAClC,IAAI,UAAU,CAAC,qBAAqB;YAClC,OAAO,UAAU,CAAC,qBAAqB,CAAA;QACzC,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACzE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IACxE,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,CAAC,iBAAiB,EAAE,SAAS,EAAE,aAAa,CAAC,GAAG,MAAM,IAAA,wBAAS,EACnE,MAAM,EACN;QACE,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,2BAAiB;gBACtB,OAAO,EAAE,qBAAqB;gBAC9B,YAAY,EAAE,mBAAmB;aAClC;YACD;gBACE,GAAG,EAAE,2BAAiB;gBACtB,OAAO,EAAE,qBAAqB;gBAC9B,YAAY,EAAE,eAAe;aAC9B;YACD;gBACE,GAAG,EAAE,2BAAiB;gBACtB,OAAO,EAAE,qBAAqB;gBAC9B,YAAY,EAAE,qBAAqB;aACpC;SACF;KACF,CACF,CAAA;IACD,MAAM,YAAY,GAAG,MAAM,IAAA,8BAAY,EAAC,MAAM,EAAE;QAC9C,GAAG,EAAE,2BAAiB;QACtB,OAAO,EAAE,qBAAqB;QAC9B,YAAY,EAAE,aAAa;QAC3B,IAAI,EAAE,CAAC,iBAAiB,CAAC;KAC1B,CAAC,CAAA;IACF,MAAM,qBAAqB,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,CAAA;IAEnE,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,CAAA;IAClD,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,CAAA;IAE/D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAEtB,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE;QAGpB,IAAI,GAAG,GAAG,qBAAqB;YAAE,OAAO,CAAC,CAAA;QAIzC,IAAI,YAAY,CAAC,aAAa,GAAG,aAAa;YAAE,OAAO,CAAC,CAAA;QAExD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA;QAExE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,qBAAqB,CAAC,GAAG,IAAI,CAAC,CAAA;QAC/D,MAAM,mBAAmB,GACvB,kBAAkB,GAAG,CAAC,OAAO,GAAG,kBAAkB,CAAC,CAAA;QACrD,OAAO,aAAa,GAAG,aAAa;YAClC,CAAC,CAAC,mBAAmB;YACrB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,kBAAkB;gBACpE,mBAAmB,CAAA;IAC3B,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,SAAS,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;IAEhE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,CAAA;AACzC,CAAC;AAjFD,sDAiFC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getTimeToProve = void 0;
|
4
|
+
const getTimeToNextL2Output_js_1 = require("./getTimeToNextL2Output.js");
|
5
|
+
async function getTimeToProve(client, parameters) {
|
6
|
+
const { receipt } = parameters;
|
7
|
+
return (0, getTimeToNextL2Output_js_1.getTimeToNextL2Output)(client, {
|
8
|
+
...parameters,
|
9
|
+
l2BlockNumber: receipt.blockNumber,
|
10
|
+
});
|
11
|
+
}
|
12
|
+
exports.getTimeToProve = getTimeToProve;
|
13
|
+
//# sourceMappingURL=getTimeToProve.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTimeToProve.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/getTimeToProve.ts"],"names":[],"mappings":";;;AAWA,yEAKmC;AAgD5B,KAAK,UAAU,cAAc,CAKlC,MAAyC,EACzC,UAA0D;IAE1D,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAA;IAE9B,OAAO,IAAA,gDAAqB,EAAC,MAAM,EAAE;QACnC,GAAG,UAAU;QACb,aAAa,EAAE,OAAO,CAAC,WAAW;KACnC,CAAC,CAAA;AACJ,CAAC;AAdD,wCAcC"}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getWithdrawalStatus = void 0;
|
4
|
+
const readContract_js_1 = require("../../../actions/public/readContract.js");
|
5
|
+
const contract_js_1 = require("../../../errors/contract.js");
|
6
|
+
const abis_js_1 = require("../abis.js");
|
7
|
+
const withdrawal_js_1 = require("../errors/withdrawal.js");
|
8
|
+
const getWithdrawals_js_1 = require("../utils/getWithdrawals.js");
|
9
|
+
const getL2Output_js_1 = require("./getL2Output.js");
|
10
|
+
const getTimeToFinalize_js_1 = require("./getTimeToFinalize.js");
|
11
|
+
async function getWithdrawalStatus(client, parameters) {
|
12
|
+
const { chain = client.chain, receipt, targetChain } = parameters;
|
13
|
+
const portalAddress = (() => {
|
14
|
+
if (parameters.portalAddress)
|
15
|
+
return parameters.portalAddress;
|
16
|
+
if (chain)
|
17
|
+
return targetChain.contracts.portal[chain.id].address;
|
18
|
+
return Object.values(targetChain.contracts.portal)[0].address;
|
19
|
+
})();
|
20
|
+
const [withdrawal] = (0, getWithdrawals_js_1.getWithdrawals)(receipt);
|
21
|
+
if (!withdrawal)
|
22
|
+
throw new withdrawal_js_1.ReceiptContainsNoWithdrawalsError({
|
23
|
+
hash: receipt.transactionHash,
|
24
|
+
});
|
25
|
+
const [outputResult, proveResult, finalizedResult, timeToFinalizeResult] = await Promise.allSettled([
|
26
|
+
(0, getL2Output_js_1.getL2Output)(client, {
|
27
|
+
...parameters,
|
28
|
+
l2BlockNumber: receipt.blockNumber,
|
29
|
+
}),
|
30
|
+
(0, readContract_js_1.readContract)(client, {
|
31
|
+
abi: abis_js_1.portalAbi,
|
32
|
+
address: portalAddress,
|
33
|
+
functionName: 'provenWithdrawals',
|
34
|
+
args: [withdrawal.withdrawalHash],
|
35
|
+
}),
|
36
|
+
(0, readContract_js_1.readContract)(client, {
|
37
|
+
abi: abis_js_1.portalAbi,
|
38
|
+
address: portalAddress,
|
39
|
+
functionName: 'finalizedWithdrawals',
|
40
|
+
args: [withdrawal.withdrawalHash],
|
41
|
+
}),
|
42
|
+
(0, getTimeToFinalize_js_1.getTimeToFinalize)(client, {
|
43
|
+
...parameters,
|
44
|
+
withdrawalHash: withdrawal.withdrawalHash,
|
45
|
+
}),
|
46
|
+
]);
|
47
|
+
if (outputResult.status === 'rejected') {
|
48
|
+
const error = outputResult.reason;
|
49
|
+
if (error.cause instanceof contract_js_1.ContractFunctionRevertedError &&
|
50
|
+
error.cause.data?.args?.[0] ===
|
51
|
+
'L2OutputOracle: cannot get output for a block that has not been proposed')
|
52
|
+
return 'waiting-to-prove';
|
53
|
+
throw error;
|
54
|
+
}
|
55
|
+
if (proveResult.status === 'rejected')
|
56
|
+
throw proveResult.reason;
|
57
|
+
if (finalizedResult.status === 'rejected')
|
58
|
+
throw finalizedResult.reason;
|
59
|
+
if (timeToFinalizeResult.status === 'rejected')
|
60
|
+
throw timeToFinalizeResult.reason;
|
61
|
+
const [_, proveTimestamp] = proveResult.value;
|
62
|
+
if (!proveTimestamp)
|
63
|
+
return 'ready-to-prove';
|
64
|
+
const finalized = finalizedResult.value;
|
65
|
+
if (finalized)
|
66
|
+
return 'finalized';
|
67
|
+
const { seconds } = timeToFinalizeResult.value;
|
68
|
+
return seconds > 0 ? 'waiting-to-finalize' : 'ready-to-finalize';
|
69
|
+
}
|
70
|
+
exports.getWithdrawalStatus = getWithdrawalStatus;
|
71
|
+
//# sourceMappingURL=getWithdrawalStatus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getWithdrawalStatus.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/getWithdrawalStatus.ts"],"names":[],"mappings":";;;AAAA,6EAGgD;AAGhD,6DAA2E;AAS3E,wCAAsC;AACtC,2DAA2E;AAE3E,kEAGmC;AACnC,qDAAyE;AACzE,iEAG+B;AAqDxB,KAAK,UAAU,mBAAmB,CAKvC,MAAyC,EACzC,UAA+D;IAE/D,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,UAAU,CAAA;IAEjE,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE;QAC1B,IAAI,UAAU,CAAC,aAAa;YAAE,OAAO,UAAU,CAAC,aAAa,CAAA;QAC7D,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACjE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAChE,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,CAAC,UAAU,CAAC,GAAG,IAAA,kCAAc,EAAC,OAAO,CAAC,CAAA;IAE5C,IAAI,CAAC,UAAU;QACb,MAAM,IAAI,iDAAiC,CAAC;YAC1C,IAAI,EAAE,OAAO,CAAC,eAAe;SAC9B,CAAC,CAAA;IAEJ,MAAM,CAAC,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,CAAC,GACtE,MAAM,OAAO,CAAC,UAAU,CAAC;QACvB,IAAA,4BAAW,EAAC,MAAM,EAAE;YAClB,GAAG,UAAU;YACb,aAAa,EAAE,OAAO,CAAC,WAAW;SACnC,CAAC;QACF,IAAA,8BAAY,EAAC,MAAM,EAAE;YACnB,GAAG,EAAE,mBAAS;YACd,OAAO,EAAE,aAAa;YACtB,YAAY,EAAE,mBAAmB;YACjC,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC;SAClC,CAAC;QACF,IAAA,8BAAY,EAAC,MAAM,EAAE;YACnB,GAAG,EAAE,mBAAS;YACd,OAAO,EAAE,aAAa;YACtB,YAAY,EAAE,sBAAsB;YACpC,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC;SAClC,CAAC;QACF,IAAA,wCAAiB,EAAC,MAAM,EAAE;YACxB,GAAG,UAAU;YACb,cAAc,EAAE,UAAU,CAAC,cAAc;SAC1C,CAAC;KACH,CAAC,CAAA;IAIJ,IAAI,YAAY,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,YAAY,CAAC,MAA8B,CAAA;QACzD,IACE,KAAK,CAAC,KAAK,YAAY,2CAA6B;YACpD,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBACzB,0EAA0E;YAE5E,OAAO,kBAAkB,CAAA;QAC3B,MAAM,KAAK,CAAA;IACb,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,KAAK,UAAU;QAAE,MAAM,WAAW,CAAC,MAAM,CAAA;IAC/D,IAAI,eAAe,CAAC,MAAM,KAAK,UAAU;QAAE,MAAM,eAAe,CAAC,MAAM,CAAA;IACvE,IAAI,oBAAoB,CAAC,MAAM,KAAK,UAAU;QAC5C,MAAM,oBAAoB,CAAC,MAAM,CAAA;IAEnC,MAAM,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG,WAAW,CAAC,KAAK,CAAA;IAC7C,IAAI,CAAC,cAAc;QAAE,OAAO,gBAAgB,CAAA;IAE5C,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAA;IACvC,IAAI,SAAS;QAAE,OAAO,WAAW,CAAA;IAEjC,MAAM,EAAE,OAAO,EAAE,GAAG,oBAAoB,CAAC,KAAK,CAAA;IAC9C,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,CAAA;AAClE,CAAC;AAxED,kDAwEC"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.initiateWithdrawal = void 0;
|
4
|
+
const writeContract_js_1 = require("../../../actions/wallet/writeContract.js");
|
5
|
+
const abis_js_1 = require("../abis.js");
|
6
|
+
const contracts_js_1 = require("../contracts.js");
|
7
|
+
const estimateInitiateWithdrawalGas_js_1 = require("./estimateInitiateWithdrawalGas.js");
|
8
|
+
async function initiateWithdrawal(client, parameters) {
|
9
|
+
const { account, chain = client.chain, gas, maxFeePerGas, maxPriorityFeePerGas, nonce, request: { data = '0x', gas: l1Gas, to, value }, } = parameters;
|
10
|
+
const gas_ = typeof gas !== 'number' && gas !== null
|
11
|
+
? await (0, estimateInitiateWithdrawalGas_js_1.estimateInitiateWithdrawalGas)(client, parameters)
|
12
|
+
: undefined;
|
13
|
+
return (0, writeContract_js_1.writeContract)(client, {
|
14
|
+
account: account,
|
15
|
+
abi: abis_js_1.l2ToL1MessagePasserAbi,
|
16
|
+
address: contracts_js_1.contracts.l2ToL1MessagePasser.address,
|
17
|
+
chain,
|
18
|
+
functionName: 'initiateWithdrawal',
|
19
|
+
args: [to, l1Gas, data],
|
20
|
+
gas: gas_,
|
21
|
+
maxFeePerGas,
|
22
|
+
maxPriorityFeePerGas,
|
23
|
+
nonce,
|
24
|
+
value,
|
25
|
+
});
|
26
|
+
}
|
27
|
+
exports.initiateWithdrawal = initiateWithdrawal;
|
28
|
+
//# sourceMappingURL=initiateWithdrawal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"initiateWithdrawal.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/initiateWithdrawal.ts"],"names":[],"mappings":";;;AACA,+EAIiD;AAajD,wCAAmD;AACnD,kDAA2C;AAE3C,yFAI2C;AAwFpC,KAAK,UAAU,kBAAkB,CAKtC,MAAyC,EACzC,UAAuE;IAEvE,MAAM,EACJ,OAAO,EACP,KAAK,GAAG,MAAM,CAAC,KAAK,EACpB,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,OAAO,EAAE,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,GAChD,GAAG,UAAU,CAAA;IAEd,MAAM,IAAI,GACR,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QACrC,CAAC,CAAC,MAAM,IAAA,gEAA6B,EACjC,MAAM,EACN,UAAqD,CACtD;QACH,CAAC,CAAC,SAAS,CAAA;IAEf,OAAO,IAAA,gCAAa,EAAC,MAAM,EAAE;QAC3B,OAAO,EAAE,OAAQ;QACjB,GAAG,EAAE,gCAAsB;QAC3B,OAAO,EAAE,wBAAS,CAAC,mBAAmB,CAAC,OAAO;QAC9C,KAAK;QACL,YAAY,EAAE,oBAAoB;QAClC,IAAI,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC;QACvB,GAAG,EAAE,IAAI;QACT,YAAY;QACZ,oBAAoB;QACpB,KAAK;QACL,KAAK;KACmC,CAAC,CAAA;AAC7C,CAAC;AAvCD,gDAuCC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.proveWithdrawal = void 0;
|
4
|
+
const writeContract_js_1 = require("../../../actions/wallet/writeContract.js");
|
5
|
+
const abis_js_1 = require("../abis.js");
|
6
|
+
const estimateProveWithdrawalGas_js_1 = require("./estimateProveWithdrawalGas.js");
|
7
|
+
async function proveWithdrawal(client, parameters) {
|
8
|
+
const { account, chain = client.chain, gas, l2OutputIndex, maxFeePerGas, maxPriorityFeePerGas, nonce, outputRootProof, targetChain, withdrawalProof, withdrawal, } = parameters;
|
9
|
+
const portalAddress = (() => {
|
10
|
+
if (parameters.portalAddress)
|
11
|
+
return parameters.portalAddress;
|
12
|
+
if (chain)
|
13
|
+
return targetChain.contracts.portal[chain.id].address;
|
14
|
+
return Object.values(targetChain.contracts.portal)[0].address;
|
15
|
+
})();
|
16
|
+
const gas_ = typeof gas !== 'number' && gas !== null
|
17
|
+
? await (0, estimateProveWithdrawalGas_js_1.estimateProveWithdrawalGas)(client, parameters)
|
18
|
+
: undefined;
|
19
|
+
return (0, writeContract_js_1.writeContract)(client, {
|
20
|
+
account,
|
21
|
+
abi: abis_js_1.portalAbi,
|
22
|
+
address: portalAddress,
|
23
|
+
chain,
|
24
|
+
functionName: 'proveWithdrawalTransaction',
|
25
|
+
args: [withdrawal, l2OutputIndex, outputRootProof, withdrawalProof],
|
26
|
+
gas: gas_,
|
27
|
+
maxFeePerGas,
|
28
|
+
maxPriorityFeePerGas,
|
29
|
+
nonce,
|
30
|
+
});
|
31
|
+
}
|
32
|
+
exports.proveWithdrawal = proveWithdrawal;
|
33
|
+
//# sourceMappingURL=proveWithdrawal.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"proveWithdrawal.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/proveWithdrawal.ts"],"names":[],"mappings":";;;AACA,+EAGiD;AAajD,wCAAsC;AAEtC,mFAIwC;AA+EjC,KAAK,UAAU,eAAe,CAKnC,MAAyC,EACzC,UAAoE;IAEpE,MAAM,EACJ,OAAO,EACP,KAAK,GAAG,MAAM,CAAC,KAAK,EACpB,GAAG,EACH,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,eAAe,EACf,WAAW,EACX,eAAe,EACf,UAAU,GACX,GAAG,UAAU,CAAA;IAEd,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE;QAC1B,IAAI,UAAU,CAAC,aAAa;YAAE,OAAO,UAAU,CAAC,aAAa,CAAA;QAC7D,IAAI,KAAK;YAAE,OAAO,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAA;QACjE,OAAO,MAAM,CAAC,MAAM,CAAC,WAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAChE,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,IAAI,GACR,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QACrC,CAAC,CAAC,MAAM,IAAA,0DAA0B,EAC9B,MAAM,EACN,UAAkD,CACnD;QACH,CAAC,CAAC,SAAS,CAAA;IAEf,OAAO,IAAA,gCAAa,EAAC,MAAM,EAAE;QAC3B,OAAO;QACP,GAAG,EAAE,mBAAS;QACd,OAAO,EAAE,aAAa;QACtB,KAAK;QACL,YAAY,EAAE,4BAA4B;QAC1C,IAAI,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,CAAC;QACnE,GAAG,EAAE,IAAI;QACT,YAAY;QACZ,oBAAoB;QACpB,KAAK;KACN,CAAC,CAAA;AACJ,CAAC;AAhDD,0CAgDC"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.waitForNextL2Output = void 0;
|
4
|
+
const contract_js_1 = require("../../../errors/contract.js");
|
5
|
+
const poll_js_1 = require("../../../utils/poll.js");
|
6
|
+
const getL2Output_js_1 = require("./getL2Output.js");
|
7
|
+
const getTimeToNextL2Output_js_1 = require("./getTimeToNextL2Output.js");
|
8
|
+
async function waitForNextL2Output(client, parameters) {
|
9
|
+
const { pollingInterval = client.pollingInterval } = parameters;
|
10
|
+
const { seconds } = await (0, getTimeToNextL2Output_js_1.getTimeToNextL2Output)(client, parameters);
|
11
|
+
return new Promise((resolve, reject) => {
|
12
|
+
(0, poll_js_1.poll)(async ({ unpoll }) => {
|
13
|
+
try {
|
14
|
+
const output = await (0, getL2Output_js_1.getL2Output)(client, parameters);
|
15
|
+
unpoll();
|
16
|
+
resolve(output);
|
17
|
+
}
|
18
|
+
catch (e) {
|
19
|
+
const error = e;
|
20
|
+
if (!(error.cause instanceof contract_js_1.ContractFunctionRevertedError)) {
|
21
|
+
unpoll();
|
22
|
+
reject(e);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}, {
|
26
|
+
interval: pollingInterval,
|
27
|
+
initialWaitTime: async () => seconds * 1000,
|
28
|
+
});
|
29
|
+
});
|
30
|
+
}
|
31
|
+
exports.waitForNextL2Output = waitForNextL2Output;
|
32
|
+
//# sourceMappingURL=waitForNextL2Output.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"waitForNextL2Output.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/waitForNextL2Output.ts"],"names":[],"mappings":";;;AAEA,6DAA2E;AAQ3E,oDAA6C;AAE7C,qDAIyB;AACzB,yEAImC;AAwD5B,KAAK,UAAU,mBAAmB,CAKvC,MAAyC,EACzC,UAA+D;IAE/D,MAAM,EAAE,eAAe,GAAG,MAAM,CAAC,eAAe,EAAE,GAAG,UAAU,CAAA;IAE/D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,gDAAqB,EAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAEnE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAA,cAAI,EACF,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACnB,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAW,EAAC,MAAM,EAAE,UAAU,CAAC,CAAA;gBACpD,MAAM,EAAE,CAAA;gBACR,OAAO,CAAC,MAAM,CAAC,CAAA;YACjB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,KAAK,GAAG,CAAyB,CAAA;gBACvC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,YAAY,2CAA6B,CAAC,EAAE,CAAC;oBAC5D,MAAM,EAAE,CAAA;oBACR,MAAM,CAAC,CAAC,CAAC,CAAA;gBACX,CAAC;YACH,CAAC;QACH,CAAC,EACD;YACE,QAAQ,EAAE,eAAe;YACzB,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO,GAAG,IAAI;SAC5C,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAjCD,kDAiCC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.waitToFinalize = void 0;
|
4
|
+
const wait_js_1 = require("../../../utils/wait.js");
|
5
|
+
const getTimeToFinalize_js_1 = require("./getTimeToFinalize.js");
|
6
|
+
async function waitToFinalize(client, parameters) {
|
7
|
+
const { seconds } = await (0, getTimeToFinalize_js_1.getTimeToFinalize)(client, parameters);
|
8
|
+
await (0, wait_js_1.wait)(seconds * 1000);
|
9
|
+
}
|
10
|
+
exports.waitToFinalize = waitToFinalize;
|
11
|
+
//# sourceMappingURL=waitToFinalize.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"waitToFinalize.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/waitToFinalize.ts"],"names":[],"mappings":";;;AAKA,oDAA6C;AAC7C,iEAI+B;AA2CxB,KAAK,UAAU,cAAc,CAKlC,MAAyC,EACzC,UAA0D;IAE1D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,wCAAiB,EAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC/D,MAAM,IAAA,cAAI,EAAC,OAAO,GAAG,IAAI,CAAC,CAAA;AAC5B,CAAC;AAVD,wCAUC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.waitToProve = void 0;
|
4
|
+
const withdrawal_js_1 = require("../errors/withdrawal.js");
|
5
|
+
const getWithdrawals_js_1 = require("../utils/getWithdrawals.js");
|
6
|
+
const waitForNextL2Output_js_1 = require("./waitForNextL2Output.js");
|
7
|
+
async function waitToProve(client, parameters) {
|
8
|
+
const { receipt } = parameters;
|
9
|
+
const [withdrawal] = (0, getWithdrawals_js_1.getWithdrawals)(receipt);
|
10
|
+
if (!withdrawal)
|
11
|
+
throw new withdrawal_js_1.ReceiptContainsNoWithdrawalsError({
|
12
|
+
hash: receipt.transactionHash,
|
13
|
+
});
|
14
|
+
const output = await (0, waitForNextL2Output_js_1.waitForNextL2Output)(client, {
|
15
|
+
...parameters,
|
16
|
+
l2BlockNumber: receipt.blockNumber,
|
17
|
+
});
|
18
|
+
return { output, withdrawal };
|
19
|
+
}
|
20
|
+
exports.waitToProve = waitToProve;
|
21
|
+
//# sourceMappingURL=waitToProve.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"waitToProve.js","sourceRoot":"","sources":["../../../../chains/opStack/actions/waitToProve.ts"],"names":[],"mappings":";;;AAUA,2DAA2E;AAG3E,kEAGmC;AACnC,qEAIiC;AAsD1B,KAAK,UAAU,WAAW,CAK/B,MAAyC,EACzC,UAAuD;IAEvD,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAA;IAE9B,MAAM,CAAC,UAAU,CAAC,GAAG,IAAA,kCAAc,EAAC,OAAO,CAAC,CAAA;IAE5C,IAAI,CAAC,UAAU;QACb,MAAM,IAAI,iDAAiC,CAAC;YAC1C,IAAI,EAAE,OAAO,CAAC,eAAe;SAC9B,CAAC,CAAA;IAEJ,MAAM,MAAM,GAAG,MAAM,IAAA,4CAAmB,EAAC,MAAM,EAAE;QAC/C,GAAG,UAAU;QACb,aAAa,EAAE,OAAO,CAAC,WAAW;KACnC,CAAC,CAAA;IAEF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;AAC/B,CAAC;AAvBD,kCAuBC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.zoraTestnet = exports.zoraSepolia = exports.zora = exports.optimismSepolia = exports.optimismGoerli = exports.optimism = exports.baseSepolia = exports.baseGoerli = exports.base = void 0;
|
3
|
+
exports.zoraTestnet = exports.zoraSepolia = exports.zora = exports.pgnTestnet = exports.pgn = exports.optimismSepolia = exports.optimismGoerli = exports.optimism = exports.baseSepolia = exports.baseGoerli = exports.base = void 0;
|
4
4
|
var base_js_1 = require("../definitions/base.js");
|
5
5
|
Object.defineProperty(exports, "base", { enumerable: true, get: function () { return base_js_1.base; } });
|
6
6
|
var baseGoerli_js_1 = require("../definitions/baseGoerli.js");
|
@@ -13,6 +13,10 @@ var optimismGoerli_js_1 = require("../definitions/optimismGoerli.js");
|
|
13
13
|
Object.defineProperty(exports, "optimismGoerli", { enumerable: true, get: function () { return optimismGoerli_js_1.optimismGoerli; } });
|
14
14
|
var optimismSepolia_js_1 = require("../definitions/optimismSepolia.js");
|
15
15
|
Object.defineProperty(exports, "optimismSepolia", { enumerable: true, get: function () { return optimismSepolia_js_1.optimismSepolia; } });
|
16
|
+
var pgn_js_1 = require("../definitions/pgn.js");
|
17
|
+
Object.defineProperty(exports, "pgn", { enumerable: true, get: function () { return pgn_js_1.pgn; } });
|
18
|
+
var pgnTestnet_js_1 = require("../definitions/pgnTestnet.js");
|
19
|
+
Object.defineProperty(exports, "pgnTestnet", { enumerable: true, get: function () { return pgnTestnet_js_1.pgnTestnet; } });
|
16
20
|
var zora_js_1 = require("../definitions/zora.js");
|
17
21
|
Object.defineProperty(exports, "zora", { enumerable: true, get: function () { return zora_js_1.zora; } });
|
18
22
|
var zoraSepolia_js_1 = require("../definitions/zoraSepolia.js");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../../../chains/opStack/chains.ts"],"names":[],"mappings":";;;AAAA,kDAA6C;AAApC,+FAAA,IAAI,OAAA;AACb,8DAAyD;AAAhD,2GAAA,UAAU,OAAA;AACnB,gEAA2D;AAAlD,6GAAA,WAAW,OAAA;AACpB,0DAAqD;AAA5C,uGAAA,QAAQ,OAAA;AACjB,sEAAiE;AAAxD,mHAAA,cAAc,OAAA;AACvB,wEAAmE;AAA1D,qHAAA,eAAe,OAAA;AACxB,kDAA6C;AAApC,+FAAA,IAAI,OAAA;AACb,gEAA2D;AAAlD,6GAAA,WAAW,OAAA;AACpB,gEAA2D;AAAlD,6GAAA,WAAW,OAAA"}
|
1
|
+
{"version":3,"file":"chains.js","sourceRoot":"","sources":["../../../chains/opStack/chains.ts"],"names":[],"mappings":";;;AAAA,kDAA6C;AAApC,+FAAA,IAAI,OAAA;AACb,8DAAyD;AAAhD,2GAAA,UAAU,OAAA;AACnB,gEAA2D;AAAlD,6GAAA,WAAW,OAAA;AACpB,0DAAqD;AAA5C,uGAAA,QAAQ,OAAA;AACjB,sEAAiE;AAAxD,mHAAA,cAAc,OAAA;AACvB,wEAAmE;AAA1D,qHAAA,eAAe,OAAA;AACxB,gDAA2C;AAAlC,6FAAA,GAAG,OAAA;AACZ,8DAAyD;AAAhD,2GAAA,UAAU,OAAA;AACnB,kDAA6C;AAApC,+FAAA,IAAI,OAAA;AACb,gEAA2D;AAAlD,6GAAA,WAAW,OAAA;AACpB,gEAA2D;AAAlD,6GAAA,WAAW,OAAA"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.publicActionsL1 = void 0;
|
4
|
+
const buildInitiateWithdrawal_js_1 = require("../actions/buildInitiateWithdrawal.js");
|
5
|
+
const estimateDepositTransactionGas_js_1 = require("../actions/estimateDepositTransactionGas.js");
|
6
|
+
const estimateFinalizeWithdrawalGas_js_1 = require("../actions/estimateFinalizeWithdrawalGas.js");
|
7
|
+
const estimateProveWithdrawalGas_js_1 = require("../actions/estimateProveWithdrawalGas.js");
|
8
|
+
const getL2Output_js_1 = require("../actions/getL2Output.js");
|
9
|
+
const getTimeToFinalize_js_1 = require("../actions/getTimeToFinalize.js");
|
10
|
+
const getTimeToNextL2Output_js_1 = require("../actions/getTimeToNextL2Output.js");
|
11
|
+
const getTimeToProve_js_1 = require("../actions/getTimeToProve.js");
|
12
|
+
const getWithdrawalStatus_js_1 = require("../actions/getWithdrawalStatus.js");
|
13
|
+
const waitForNextL2Output_js_1 = require("../actions/waitForNextL2Output.js");
|
14
|
+
const waitToFinalize_js_1 = require("../actions/waitToFinalize.js");
|
15
|
+
const waitToProve_js_1 = require("../actions/waitToProve.js");
|
16
|
+
function publicActionsL1() {
|
17
|
+
return (client) => {
|
18
|
+
return {
|
19
|
+
buildInitiateWithdrawal: (args) => (0, buildInitiateWithdrawal_js_1.buildInitiateWithdrawal)(client, args),
|
20
|
+
estimateDepositTransactionGas: (args) => (0, estimateDepositTransactionGas_js_1.estimateDepositTransactionGas)(client, args),
|
21
|
+
estimateFinalizeWithdrawalGas: (args) => (0, estimateFinalizeWithdrawalGas_js_1.estimateFinalizeWithdrawalGas)(client, args),
|
22
|
+
estimateProveWithdrawalGas: (args) => (0, estimateProveWithdrawalGas_js_1.estimateProveWithdrawalGas)(client, args),
|
23
|
+
getL2Output: (args) => (0, getL2Output_js_1.getL2Output)(client, args),
|
24
|
+
getTimeToFinalize: (args) => (0, getTimeToFinalize_js_1.getTimeToFinalize)(client, args),
|
25
|
+
getTimeToNextL2Output: (args) => (0, getTimeToNextL2Output_js_1.getTimeToNextL2Output)(client, args),
|
26
|
+
getTimeToProve: (args) => (0, getTimeToProve_js_1.getTimeToProve)(client, args),
|
27
|
+
getWithdrawalStatus: (args) => (0, getWithdrawalStatus_js_1.getWithdrawalStatus)(client, args),
|
28
|
+
waitForNextL2Output: (args) => (0, waitForNextL2Output_js_1.waitForNextL2Output)(client, args),
|
29
|
+
waitToFinalize: (args) => (0, waitToFinalize_js_1.waitToFinalize)(client, args),
|
30
|
+
waitToProve: (args) => (0, waitToProve_js_1.waitToProve)(client, args),
|
31
|
+
};
|
32
|
+
};
|
33
|
+
}
|
34
|
+
exports.publicActionsL1 = publicActionsL1;
|
35
|
+
//# sourceMappingURL=publicL1.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"publicL1.js","sourceRoot":"","sources":["../../../../chains/opStack/decorators/publicL1.ts"],"names":[],"mappings":";;;AAKA,sFAI8C;AAC9C,kGAIoD;AACpD,kGAIoD;AACpD,4FAIiD;AACjD,8DAIkC;AAClC,0EAIwC;AACxC,kFAI4C;AAC5C,oEAIqC;AACrC,8EAI0C;AAC1C,8EAI0C;AAC1C,oEAIqC;AACrC,8DAIkC;AAualC,SAAgB,eAAe;IAC7B,OAAO,CAKL,MAA4C,EACT,EAAE;QACrC,OAAO;YACL,uBAAuB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,oDAAuB,EAAC,MAAM,EAAE,IAAI,CAAC;YACxE,6BAA6B,EAAE,CAAC,IAAI,EAAE,EAAE,CACtC,IAAA,gEAA6B,EAAC,MAAM,EAAE,IAAI,CAAC;YAC7C,6BAA6B,EAAE,CAAC,IAAI,EAAE,EAAE,CACtC,IAAA,gEAA6B,EAAC,MAAM,EAAE,IAAI,CAAC;YAC7C,0BAA0B,EAAE,CAAC,IAAI,EAAE,EAAE,CACnC,IAAA,0DAA0B,EAAC,MAAM,EAAE,IAAI,CAAC;YAC1C,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,4BAAW,EAAC,MAAM,EAAE,IAAI,CAAC;YAChD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,wCAAiB,EAAC,MAAM,EAAE,IAAI,CAAC;YAC5D,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,gDAAqB,EAAC,MAAM,EAAE,IAAI,CAAC;YACpE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,kCAAc,EAAC,MAAM,EAAE,IAAI,CAAC;YACtD,mBAAmB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,4CAAmB,EAAC,MAAM,EAAE,IAAI,CAAC;YAChE,mBAAmB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,4CAAmB,EAAC,MAAM,EAAE,IAAI,CAAC;YAChE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,kCAAc,EAAC,MAAM,EAAE,IAAI,CAAC;YACtD,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,4BAAW,EAAC,MAAM,EAAE,IAAI,CAAC;SACjD,CAAA;IACH,CAAC,CAAA;AACH,CAAC;AA1BD,0CA0BC"}
|