viem 2.42.1 → 2.43.0
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 +70 -0
- package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +2 -2
- package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
- package/_cjs/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js +23 -6
- package/_cjs/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js.map +1 -1
- package/_cjs/actions/public/verifyHash.js +5 -3
- package/_cjs/actions/public/verifyHash.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js +6 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/chains/definitions/birdlayer.js.map +1 -1
- package/_cjs/chains/definitions/bob.js.map +1 -1
- package/_cjs/chains/definitions/bobSepolia.js.map +1 -1
- package/_cjs/chains/definitions/crab.js.map +1 -1
- package/_cjs/chains/definitions/creatorTestnet.js.map +1 -1
- package/_cjs/chains/definitions/datahavenTestnet.js +29 -0
- package/_cjs/chains/definitions/datahavenTestnet.js.map +1 -0
- package/_cjs/chains/definitions/dodochainTestnet.js.map +1 -1
- package/_cjs/chains/definitions/funkiSepolia.js.map +1 -1
- package/_cjs/chains/definitions/garnet.js.map +1 -1
- package/_cjs/chains/definitions/koi.js.map +1 -1
- package/_cjs/chains/definitions/omni.js.map +1 -1
- package/_cjs/chains/definitions/pyrope.js.map +1 -1
- package/_cjs/chains/definitions/redstone.js.map +1 -1
- package/_cjs/chains/definitions/skale/skaleBase.js +23 -0
- package/_cjs/chains/definitions/skale/skaleBase.js.map +1 -0
- package/_cjs/chains/definitions/skale/skaleBaseSepoliaTestnet.js +25 -0
- package/_cjs/chains/definitions/skale/skaleBaseSepoliaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/somnia.js +23 -0
- package/_cjs/chains/definitions/somnia.js.map +1 -0
- package/_cjs/chains/definitions/tempoDevnet.js +22 -0
- package/_cjs/chains/definitions/tempoDevnet.js.map +1 -0
- package/_cjs/chains/definitions/tempoLocalnet.js +19 -0
- package/_cjs/chains/definitions/tempoLocalnet.js.map +1 -0
- package/_cjs/chains/definitions/tempoTestnet.js +28 -0
- package/_cjs/chains/definitions/tempoTestnet.js.map +1 -0
- package/_cjs/chains/index.js +26 -12
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/node.js +1 -1
- package/_cjs/errors/node.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js +4 -3
- package/_cjs/index.js.map +1 -1
- package/_cjs/op-stack/index.js.map +1 -1
- package/_cjs/tempo/Abis.js +1707 -0
- package/_cjs/tempo/Abis.js.map +1 -0
- package/_cjs/tempo/Account.js +252 -0
- package/_cjs/tempo/Account.js.map +1 -0
- package/_cjs/tempo/Addresses.js +12 -0
- package/_cjs/tempo/Addresses.js.map +1 -0
- package/_cjs/tempo/Decorator.js +135 -0
- package/_cjs/tempo/Decorator.js.map +1 -0
- package/_cjs/tempo/Formatters.js +99 -0
- package/_cjs/tempo/Formatters.js.map +1 -0
- package/_cjs/tempo/P256.js +6 -0
- package/_cjs/tempo/P256.js.map +1 -0
- package/_cjs/tempo/Secp256k1.js +6 -0
- package/_cjs/tempo/Secp256k1.js.map +1 -0
- package/_cjs/tempo/TokenIds.js +5 -0
- package/_cjs/tempo/TokenIds.js.map +1 -0
- package/_cjs/tempo/Transaction.js +174 -0
- package/_cjs/tempo/Transaction.js.map +1 -0
- package/_cjs/tempo/Transport.js +118 -0
- package/_cjs/tempo/Transport.js.map +1 -0
- package/_cjs/tempo/WebAuthnP256.js +58 -0
- package/_cjs/tempo/WebAuthnP256.js.map +1 -0
- package/_cjs/tempo/WebCryptoP256.js +6 -0
- package/_cjs/tempo/WebCryptoP256.js.map +1 -0
- package/_cjs/tempo/actions/amm.js +358 -0
- package/_cjs/tempo/actions/amm.js.map +1 -0
- package/_cjs/tempo/actions/dex.js +521 -0
- package/_cjs/tempo/actions/dex.js.map +1 -0
- package/_cjs/tempo/actions/faucet.js +28 -0
- package/_cjs/tempo/actions/faucet.js.map +1 -0
- package/_cjs/tempo/actions/fee.js +108 -0
- package/_cjs/tempo/actions/fee.js.map +1 -0
- package/_cjs/tempo/actions/index.js +12 -0
- package/_cjs/tempo/actions/index.js.map +1 -0
- package/_cjs/tempo/actions/nonce.js +78 -0
- package/_cjs/tempo/actions/nonce.js.map +1 -0
- package/_cjs/tempo/actions/policy.js +346 -0
- package/_cjs/tempo/actions/policy.js.map +1 -0
- package/_cjs/tempo/actions/reward.js +214 -0
- package/_cjs/tempo/actions/reward.js.map +1 -0
- package/_cjs/tempo/actions/token.js +1176 -0
- package/_cjs/tempo/actions/token.js.map +1 -0
- package/_cjs/tempo/chainConfig.js +84 -0
- package/_cjs/tempo/chainConfig.js.map +1 -0
- package/_cjs/tempo/index.js +22 -0
- package/_cjs/tempo/index.js.map +1 -0
- package/_cjs/tempo/internal/nonceKeyStore.js +43 -0
- package/_cjs/tempo/internal/nonceKeyStore.js.map +1 -0
- package/_cjs/tempo/internal/types.js +3 -0
- package/_cjs/tempo/internal/types.js.map +1 -0
- package/_cjs/tempo/internal/utils.js +32 -0
- package/_cjs/tempo/internal/utils.js.map +1 -0
- package/_cjs/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/decodeEventLog.js.map +1 -1
- package/_cjs/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_cjs/utils/chain/defineChain.js +15 -1
- package/_cjs/utils/chain/defineChain.js.map +1 -1
- package/_cjs/utils/formatters/transaction.js +1 -2
- package/_cjs/utils/formatters/transaction.js.map +1 -1
- package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +2 -2
- package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
- package/_esm/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js +25 -8
- package/_esm/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js.map +1 -1
- package/_esm/actions/public/verifyHash.js +5 -3
- package/_esm/actions/public/verifyHash.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +6 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/chains/definitions/birdlayer.js +1 -1
- package/_esm/chains/definitions/birdlayer.js.map +1 -1
- package/_esm/chains/definitions/bob.js +1 -1
- package/_esm/chains/definitions/bob.js.map +1 -1
- package/_esm/chains/definitions/bobSepolia.js +1 -1
- package/_esm/chains/definitions/bobSepolia.js.map +1 -1
- package/_esm/chains/definitions/crab.js +1 -1
- package/_esm/chains/definitions/crab.js.map +1 -1
- package/_esm/chains/definitions/creatorTestnet.js +1 -1
- package/_esm/chains/definitions/creatorTestnet.js.map +1 -1
- package/_esm/chains/definitions/datahavenTestnet.js +26 -0
- package/_esm/chains/definitions/datahavenTestnet.js.map +1 -0
- package/_esm/chains/definitions/dodochainTestnet.js +1 -1
- package/_esm/chains/definitions/dodochainTestnet.js.map +1 -1
- package/_esm/chains/definitions/funkiSepolia.js +1 -1
- package/_esm/chains/definitions/funkiSepolia.js.map +1 -1
- package/_esm/chains/definitions/garnet.js +1 -1
- package/_esm/chains/definitions/garnet.js.map +1 -1
- package/_esm/chains/definitions/koi.js +1 -1
- package/_esm/chains/definitions/koi.js.map +1 -1
- package/_esm/chains/definitions/omni.js +1 -1
- package/_esm/chains/definitions/omni.js.map +1 -1
- package/_esm/chains/definitions/pyrope.js +1 -1
- package/_esm/chains/definitions/pyrope.js.map +1 -1
- package/_esm/chains/definitions/redstone.js +1 -1
- package/_esm/chains/definitions/redstone.js.map +1 -1
- package/_esm/chains/definitions/skale/skaleBase.js +20 -0
- package/_esm/chains/definitions/skale/skaleBase.js.map +1 -0
- package/_esm/chains/definitions/skale/skaleBaseSepoliaTestnet.js +22 -0
- package/_esm/chains/definitions/skale/skaleBaseSepoliaTestnet.js.map +1 -0
- package/_esm/chains/definitions/somnia.js +20 -0
- package/_esm/chains/definitions/somnia.js.map +1 -0
- package/_esm/chains/definitions/tempoDevnet.js +19 -0
- package/_esm/chains/definitions/tempoDevnet.js.map +1 -0
- package/_esm/chains/definitions/tempoLocalnet.js +16 -0
- package/_esm/chains/definitions/tempoLocalnet.js.map +1 -0
- package/_esm/chains/definitions/tempoTestnet.js +25 -0
- package/_esm/chains/definitions/tempoTestnet.js.map +1 -0
- package/_esm/chains/index.js +7 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/node.js +1 -1
- package/_esm/errors/node.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/op-stack/index.js +0 -1
- package/_esm/op-stack/index.js.map +1 -1
- package/_esm/tempo/Abis.js +1705 -0
- package/_esm/tempo/Abis.js.map +1 -0
- package/_esm/tempo/Account.js +368 -0
- package/_esm/tempo/Account.js.map +1 -0
- package/_esm/tempo/Addresses.js +9 -0
- package/_esm/tempo/Addresses.js.map +1 -0
- package/_esm/tempo/Decorator.js +135 -0
- package/_esm/tempo/Decorator.js.map +1 -0
- package/_esm/tempo/Formatters.js +110 -0
- package/_esm/tempo/Formatters.js.map +1 -0
- package/_esm/tempo/P256.js +3 -0
- package/_esm/tempo/P256.js.map +1 -0
- package/_esm/tempo/Secp256k1.js +3 -0
- package/_esm/tempo/Secp256k1.js.map +1 -0
- package/_esm/tempo/TokenIds.js +2 -0
- package/_esm/tempo/TokenIds.js.map +1 -0
- package/_esm/tempo/Transaction.js +187 -0
- package/_esm/tempo/Transaction.js.map +1 -0
- package/_esm/tempo/Transport.js +139 -0
- package/_esm/tempo/Transport.js.map +1 -0
- package/_esm/tempo/WebAuthnP256.js +97 -0
- package/_esm/tempo/WebAuthnP256.js.map +1 -0
- package/_esm/tempo/WebCryptoP256.js +3 -0
- package/_esm/tempo/WebCryptoP256.js.map +1 -0
- package/_esm/tempo/actions/amm.js +818 -0
- package/_esm/tempo/actions/amm.js.map +1 -0
- package/_esm/tempo/actions/dex.js +1417 -0
- package/_esm/tempo/actions/dex.js.map +1 -0
- package/_esm/tempo/actions/faucet.js +73 -0
- package/_esm/tempo/actions/faucet.js.map +1 -0
- package/_esm/tempo/actions/fee.js +241 -0
- package/_esm/tempo/actions/fee.js.map +1 -0
- package/_esm/tempo/actions/index.js +10 -0
- package/_esm/tempo/actions/index.js.map +1 -0
- package/_esm/tempo/actions/nonce.js +229 -0
- package/_esm/tempo/actions/nonce.js.map +1 -0
- package/_esm/tempo/actions/policy.js +878 -0
- package/_esm/tempo/actions/policy.js.map +1 -0
- package/_esm/tempo/actions/reward.js +654 -0
- package/_esm/tempo/actions/reward.js.map +1 -0
- package/_esm/tempo/actions/token.js +2943 -0
- package/_esm/tempo/actions/token.js.map +1 -0
- package/_esm/tempo/chainConfig.js +91 -0
- package/_esm/tempo/chainConfig.js.map +1 -0
- package/_esm/tempo/index.js +17 -0
- package/_esm/tempo/index.js.map +1 -0
- package/_esm/tempo/internal/nonceKeyStore.js +41 -0
- package/_esm/tempo/internal/nonceKeyStore.js.map +1 -0
- package/_esm/tempo/internal/types.js +2 -0
- package/_esm/tempo/internal/types.js.map +1 -0
- package/_esm/tempo/internal/utils.js +34 -0
- package/_esm/tempo/internal/utils.js.map +1 -0
- package/_esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/decodeEventLog.js.map +1 -1
- package/_esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_esm/utils/chain/defineChain.js +14 -1
- package/_esm/utils/chain/defineChain.js.map +1 -1
- package/_esm/utils/formatters/transaction.js +1 -2
- package/_esm/utils/formatters/transaction.js.map +1 -1
- package/_types/account-abstraction/accounts/implementations/toSimple7702SmartAccount.d.ts +20 -284
- package/_types/account-abstraction/accounts/implementations/toSimple7702SmartAccount.d.ts.map +1 -1
- package/_types/actions/getContract.d.ts +4 -4
- package/_types/actions/getContract.d.ts.map +1 -1
- package/_types/actions/public/simulateContract.d.ts +2 -2
- package/_types/actions/public/simulateContract.d.ts.map +1 -1
- package/_types/actions/public/verifyHash.d.ts +2 -0
- package/_types/actions/public/verifyHash.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/chains/definitions/0g.d.ts +2 -0
- package/_types/chains/definitions/0g.d.ts.map +1 -1
- package/_types/chains/definitions/0gGalileoTestnet.d.ts +2 -0
- package/_types/chains/definitions/0gGalileoTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/0gMainnet.d.ts +2 -0
- package/_types/chains/definitions/0gMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/0gTestnet.d.ts +2 -0
- package/_types/chains/definitions/0gTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/5ireChain.d.ts +2 -0
- package/_types/chains/definitions/5ireChain.d.ts.map +1 -1
- package/_types/chains/definitions/abey.d.ts +2 -0
- package/_types/chains/definitions/abey.d.ts.map +1 -1
- package/_types/chains/definitions/abstract.d.ts +2 -0
- package/_types/chains/definitions/abstract.d.ts.map +1 -1
- package/_types/chains/definitions/abstractTestnet.d.ts +2 -0
- package/_types/chains/definitions/abstractTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/acala.d.ts +2 -0
- package/_types/chains/definitions/acala.d.ts.map +1 -1
- package/_types/chains/definitions/acria.d.ts +2 -0
- package/_types/chains/definitions/acria.d.ts.map +1 -1
- package/_types/chains/definitions/adf.d.ts +2 -0
- package/_types/chains/definitions/adf.d.ts.map +1 -1
- package/_types/chains/definitions/agungTestnet.d.ts +2 -0
- package/_types/chains/definitions/agungTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/aioz.d.ts +2 -0
- package/_types/chains/definitions/aioz.d.ts.map +1 -1
- package/_types/chains/definitions/alephZero.d.ts +2 -0
- package/_types/chains/definitions/alephZero.d.ts.map +1 -1
- package/_types/chains/definitions/alephZeroTestnet.d.ts +2 -0
- package/_types/chains/definitions/alephZeroTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/alienX.d.ts +2 -0
- package/_types/chains/definitions/alienX.d.ts.map +1 -1
- package/_types/chains/definitions/alienXHalTestnet.d.ts +2 -0
- package/_types/chains/definitions/alienXHalTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8.d.ts +2 -0
- package/_types/chains/definitions/ancient8.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8Sepolia.d.ts +2 -0
- package/_types/chains/definitions/ancient8Sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/anvil.d.ts +2 -0
- package/_types/chains/definitions/anvil.d.ts.map +1 -1
- package/_types/chains/definitions/apeChain.d.ts +2 -0
- package/_types/chains/definitions/apeChain.d.ts.map +1 -1
- package/_types/chains/definitions/apexTestnet.d.ts +2 -0
- package/_types/chains/definitions/apexTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/arbitrum.d.ts +2 -0
- package/_types/chains/definitions/arbitrum.d.ts.map +1 -1
- package/_types/chains/definitions/arbitrumGoerli.d.ts +2 -0
- package/_types/chains/definitions/arbitrumGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/arbitrumNova.d.ts +2 -0
- package/_types/chains/definitions/arbitrumNova.d.ts.map +1 -1
- package/_types/chains/definitions/arbitrumSepolia.d.ts +2 -0
- package/_types/chains/definitions/arbitrumSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/arcTestnet.d.ts +2 -0
- package/_types/chains/definitions/arcTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/arenaz.d.ts +2 -0
- package/_types/chains/definitions/arenaz.d.ts.map +1 -1
- package/_types/chains/definitions/areonNetwork.d.ts +2 -0
- package/_types/chains/definitions/areonNetwork.d.ts.map +1 -1
- package/_types/chains/definitions/areonNetworkTestnet.d.ts +2 -0
- package/_types/chains/definitions/areonNetworkTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/areum.d.ts +2 -0
- package/_types/chains/definitions/areum.d.ts.map +1 -1
- package/_types/chains/definitions/artelaTestnet.d.ts +2 -0
- package/_types/chains/definitions/artelaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/arthera.d.ts +2 -0
- package/_types/chains/definitions/arthera.d.ts.map +1 -1
- package/_types/chains/definitions/artheraTestnet.d.ts +2 -0
- package/_types/chains/definitions/artheraTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/assetChain.d.ts +2 -0
- package/_types/chains/definitions/assetChain.d.ts.map +1 -1
- package/_types/chains/definitions/assetChainTestnet.d.ts +2 -0
- package/_types/chains/definitions/assetChainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/astar.d.ts +2 -0
- package/_types/chains/definitions/astar.d.ts.map +1 -1
- package/_types/chains/definitions/astarZkEVM.d.ts +2 -0
- package/_types/chains/definitions/astarZkEVM.d.ts.map +1 -1
- package/_types/chains/definitions/astarZkyoto.d.ts +2 -0
- package/_types/chains/definitions/astarZkyoto.d.ts.map +1 -1
- package/_types/chains/definitions/atletaOlympia.d.ts +2 -0
- package/_types/chains/definitions/atletaOlympia.d.ts.map +1 -1
- package/_types/chains/definitions/aurora.d.ts +2 -0
- package/_types/chains/definitions/aurora.d.ts.map +1 -1
- package/_types/chains/definitions/auroraTestnet.d.ts +2 -0
- package/_types/chains/definitions/auroraTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/auroria.d.ts +2 -0
- package/_types/chains/definitions/auroria.d.ts.map +1 -1
- package/_types/chains/definitions/autheoTestnet.d.ts +2 -0
- package/_types/chains/definitions/autheoTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/avalanche.d.ts +2 -0
- package/_types/chains/definitions/avalanche.d.ts.map +1 -1
- package/_types/chains/definitions/avalancheFuji.d.ts +2 -0
- package/_types/chains/definitions/avalancheFuji.d.ts.map +1 -1
- package/_types/chains/definitions/b3.d.ts +2 -0
- package/_types/chains/definitions/b3.d.ts.map +1 -1
- package/_types/chains/definitions/b3Sepolia.d.ts +2 -0
- package/_types/chains/definitions/b3Sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/bahamut.d.ts +2 -0
- package/_types/chains/definitions/bahamut.d.ts.map +1 -1
- package/_types/chains/definitions/base.d.ts +4 -0
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/baseGoerli.d.ts +2 -0
- package/_types/chains/definitions/baseGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/baseSepolia.d.ts +4 -0
- package/_types/chains/definitions/baseSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/basecampTestnet.d.ts +2 -0
- package/_types/chains/definitions/basecampTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/beam.d.ts +2 -0
- package/_types/chains/definitions/beam.d.ts.map +1 -1
- package/_types/chains/definitions/beamTestnet.d.ts +2 -0
- package/_types/chains/definitions/beamTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bearNetworkChainMainnet.d.ts +2 -0
- package/_types/chains/definitions/bearNetworkChainMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/bearNetworkChainTestnet.d.ts +2 -0
- package/_types/chains/definitions/bearNetworkChainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/berachain.d.ts +2 -0
- package/_types/chains/definitions/berachain.d.ts.map +1 -1
- package/_types/chains/definitions/berachainBepolia.d.ts +2 -0
- package/_types/chains/definitions/berachainBepolia.d.ts.map +1 -1
- package/_types/chains/definitions/berachainTestnet.d.ts +2 -0
- package/_types/chains/definitions/berachainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/berachainTestnetbArtio.d.ts +2 -0
- package/_types/chains/definitions/berachainTestnetbArtio.d.ts.map +1 -1
- package/_types/chains/definitions/bevmMainnet.d.ts +2 -0
- package/_types/chains/definitions/bevmMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/bifrost.d.ts +2 -0
- package/_types/chains/definitions/bifrost.d.ts.map +1 -1
- package/_types/chains/definitions/birdlayer.d.ts +2 -0
- package/_types/chains/definitions/birdlayer.d.ts.map +1 -1
- package/_types/chains/definitions/bitTorrent.d.ts +2 -0
- package/_types/chains/definitions/bitTorrent.d.ts.map +1 -1
- package/_types/chains/definitions/bitTorrentTestnet.d.ts +2 -0
- package/_types/chains/definitions/bitTorrentTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bitgert.d.ts +2 -0
- package/_types/chains/definitions/bitgert.d.ts.map +1 -1
- package/_types/chains/definitions/bitkub.d.ts +2 -0
- package/_types/chains/definitions/bitkub.d.ts.map +1 -1
- package/_types/chains/definitions/bitkubTestnet.d.ts +2 -0
- package/_types/chains/definitions/bitkubTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bitlayer.d.ts +2 -0
- package/_types/chains/definitions/bitlayer.d.ts.map +1 -1
- package/_types/chains/definitions/bitlayerTestnet.d.ts +2 -0
- package/_types/chains/definitions/bitlayerTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bitrock.d.ts +2 -0
- package/_types/chains/definitions/bitrock.d.ts.map +1 -1
- package/_types/chains/definitions/blast.d.ts +2 -0
- package/_types/chains/definitions/blast.d.ts.map +1 -1
- package/_types/chains/definitions/blastSepolia.d.ts +2 -0
- package/_types/chains/definitions/blastSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/bob.d.ts +2 -0
- package/_types/chains/definitions/bob.d.ts.map +1 -1
- package/_types/chains/definitions/bobSepolia.d.ts +2 -0
- package/_types/chains/definitions/bobSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/boba.d.ts +2 -0
- package/_types/chains/definitions/boba.d.ts.map +1 -1
- package/_types/chains/definitions/bobaSepolia.d.ts +2 -0
- package/_types/chains/definitions/bobaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/boolBetaMainnet.d.ts +2 -0
- package/_types/chains/definitions/boolBetaMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/botanix.d.ts +2 -0
- package/_types/chains/definitions/botanix.d.ts.map +1 -1
- package/_types/chains/definitions/botanixTestnet.d.ts +2 -0
- package/_types/chains/definitions/botanixTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bounceBit.d.ts +2 -0
- package/_types/chains/definitions/bounceBit.d.ts.map +1 -1
- package/_types/chains/definitions/bounceBitTestnet.d.ts +2 -0
- package/_types/chains/definitions/bounceBitTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bronos.d.ts +2 -0
- package/_types/chains/definitions/bronos.d.ts.map +1 -1
- package/_types/chains/definitions/bronosTestnet.d.ts +2 -0
- package/_types/chains/definitions/bronosTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bsc.d.ts +2 -0
- package/_types/chains/definitions/bsc.d.ts.map +1 -1
- package/_types/chains/definitions/bscGreenfield.d.ts +2 -0
- package/_types/chains/definitions/bscGreenfield.d.ts.map +1 -1
- package/_types/chains/definitions/bscTestnet.d.ts +2 -0
- package/_types/chains/definitions/bscTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bsquared.d.ts +2 -0
- package/_types/chains/definitions/bsquared.d.ts.map +1 -1
- package/_types/chains/definitions/bsquaredTestnet.d.ts +2 -0
- package/_types/chains/definitions/bsquaredTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/btr.d.ts +2 -0
- package/_types/chains/definitions/btr.d.ts.map +1 -1
- package/_types/chains/definitions/btrTestnet.d.ts +2 -0
- package/_types/chains/definitions/btrTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/bxn.d.ts +2 -0
- package/_types/chains/definitions/bxn.d.ts.map +1 -1
- package/_types/chains/definitions/bxnTestnet.d.ts +2 -0
- package/_types/chains/definitions/bxnTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/cannon.d.ts +2 -0
- package/_types/chains/definitions/cannon.d.ts.map +1 -1
- package/_types/chains/definitions/canto.d.ts +2 -0
- package/_types/chains/definitions/canto.d.ts.map +1 -1
- package/_types/chains/definitions/celo.d.ts +2 -0
- package/_types/chains/definitions/celo.d.ts.map +1 -1
- package/_types/chains/definitions/celoAlfajores.d.ts +2 -0
- package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
- package/_types/chains/definitions/celoSepolia.d.ts +2 -0
- package/_types/chains/definitions/celoSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/chang.d.ts +2 -0
- package/_types/chains/definitions/chang.d.ts.map +1 -1
- package/_types/chains/definitions/chiliz.d.ts +2 -0
- package/_types/chains/definitions/chiliz.d.ts.map +1 -1
- package/_types/chains/definitions/chips.d.ts +2 -0
- package/_types/chains/definitions/chips.d.ts.map +1 -1
- package/_types/chains/definitions/citreaTestnet.d.ts +2 -0
- package/_types/chains/definitions/citreaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/classic.d.ts +2 -0
- package/_types/chains/definitions/classic.d.ts.map +1 -1
- package/_types/chains/definitions/coinbit.d.ts +2 -0
- package/_types/chains/definitions/coinbit.d.ts.map +1 -1
- package/_types/chains/definitions/coinex.d.ts +2 -0
- package/_types/chains/definitions/coinex.d.ts.map +1 -1
- package/_types/chains/definitions/confluxESpace.d.ts +2 -0
- package/_types/chains/definitions/confluxESpace.d.ts.map +1 -1
- package/_types/chains/definitions/confluxESpaceTestnet.d.ts +2 -0
- package/_types/chains/definitions/confluxESpaceTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/coreDao.d.ts +2 -0
- package/_types/chains/definitions/coreDao.d.ts.map +1 -1
- package/_types/chains/definitions/coreTestnet1.d.ts +2 -0
- package/_types/chains/definitions/coreTestnet1.d.ts.map +1 -1
- package/_types/chains/definitions/coreTestnet2.d.ts +2 -0
- package/_types/chains/definitions/coreTestnet2.d.ts.map +1 -1
- package/_types/chains/definitions/corn.d.ts +2 -0
- package/_types/chains/definitions/corn.d.ts.map +1 -1
- package/_types/chains/definitions/cornTestnet.d.ts +2 -0
- package/_types/chains/definitions/cornTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/crab.d.ts +2 -0
- package/_types/chains/definitions/crab.d.ts.map +1 -1
- package/_types/chains/definitions/creatorTestnet.d.ts +2 -0
- package/_types/chains/definitions/creatorTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/creditCoin3Devnet.d.ts +2 -0
- package/_types/chains/definitions/creditCoin3Devnet.d.ts.map +1 -1
- package/_types/chains/definitions/creditCoin3Mainnet.d.ts +2 -0
- package/_types/chains/definitions/creditCoin3Mainnet.d.ts.map +1 -1
- package/_types/chains/definitions/creditCoin3Testnet.d.ts +2 -0
- package/_types/chains/definitions/creditCoin3Testnet.d.ts.map +1 -1
- package/_types/chains/definitions/cronos.d.ts +2 -0
- package/_types/chains/definitions/cronos.d.ts.map +1 -1
- package/_types/chains/definitions/cronosTestnet.d.ts +2 -0
- package/_types/chains/definitions/cronosTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/cronoszkEVM.d.ts +2 -0
- package/_types/chains/definitions/cronoszkEVM.d.ts.map +1 -1
- package/_types/chains/definitions/cronoszkEVMTestnet.d.ts +2 -0
- package/_types/chains/definitions/cronoszkEVMTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/crossbell.d.ts +2 -0
- package/_types/chains/definitions/crossbell.d.ts.map +1 -1
- package/_types/chains/definitions/crossfi.d.ts +2 -0
- package/_types/chains/definitions/crossfi.d.ts.map +1 -1
- package/_types/chains/definitions/curtis.d.ts +2 -0
- package/_types/chains/definitions/curtis.d.ts.map +1 -1
- package/_types/chains/definitions/cyber.d.ts +2 -0
- package/_types/chains/definitions/cyber.d.ts.map +1 -1
- package/_types/chains/definitions/cyberTestnet.d.ts +2 -0
- package/_types/chains/definitions/cyberTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/dailyNetwork.d.ts +2 -0
- package/_types/chains/definitions/dailyNetwork.d.ts.map +1 -1
- package/_types/chains/definitions/dailyNetworkTestnet.d.ts +2 -0
- package/_types/chains/definitions/dailyNetworkTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/darwinia.d.ts +2 -0
- package/_types/chains/definitions/darwinia.d.ts.map +1 -1
- package/_types/chains/definitions/datahavenTestnet.d.ts +42 -0
- package/_types/chains/definitions/datahavenTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/dbkchain.d.ts +2 -0
- package/_types/chains/definitions/dbkchain.d.ts.map +1 -1
- package/_types/chains/definitions/dchain.d.ts +2 -0
- package/_types/chains/definitions/dchain.d.ts.map +1 -1
- package/_types/chains/definitions/dchainTestnet.d.ts +2 -0
- package/_types/chains/definitions/dchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/defichainEvm.d.ts +2 -0
- package/_types/chains/definitions/defichainEvm.d.ts.map +1 -1
- package/_types/chains/definitions/defichainEvmTestnet.d.ts +2 -0
- package/_types/chains/definitions/defichainEvmTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/degen.d.ts +2 -0
- package/_types/chains/definitions/degen.d.ts.map +1 -1
- package/_types/chains/definitions/dfk.d.ts +2 -0
- package/_types/chains/definitions/dfk.d.ts.map +1 -1
- package/_types/chains/definitions/diode.d.ts +2 -0
- package/_types/chains/definitions/diode.d.ts.map +1 -1
- package/_types/chains/definitions/disChain.d.ts +2 -0
- package/_types/chains/definitions/disChain.d.ts.map +1 -1
- package/_types/chains/definitions/dodochainTestnet.d.ts +2 -0
- package/_types/chains/definitions/dodochainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/dogechain.d.ts +2 -0
- package/_types/chains/definitions/dogechain.d.ts.map +1 -1
- package/_types/chains/definitions/domaTestnet.d.ts +2 -0
- package/_types/chains/definitions/domaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/donatuz.d.ts +2 -0
- package/_types/chains/definitions/donatuz.d.ts.map +1 -1
- package/_types/chains/definitions/dosChain.d.ts +2 -0
- package/_types/chains/definitions/dosChain.d.ts.map +1 -1
- package/_types/chains/definitions/dosChainTestnet.d.ts +2 -0
- package/_types/chains/definitions/dosChainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/dreyerxMainnet.d.ts +2 -0
- package/_types/chains/definitions/dreyerxMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/dreyerxTestnet.d.ts +2 -0
- package/_types/chains/definitions/dreyerxTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/dustboyIoT.d.ts +2 -0
- package/_types/chains/definitions/dustboyIoT.d.ts.map +1 -1
- package/_types/chains/definitions/dymension.d.ts +2 -0
- package/_types/chains/definitions/dymension.d.ts.map +1 -1
- package/_types/chains/definitions/edexa.d.ts +2 -0
- package/_types/chains/definitions/edexa.d.ts.map +1 -1
- package/_types/chains/definitions/edexaTestnet.d.ts +2 -0
- package/_types/chains/definitions/edexaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/edgeless.d.ts +2 -0
- package/_types/chains/definitions/edgeless.d.ts.map +1 -1
- package/_types/chains/definitions/edgelessTestnet.d.ts +2 -0
- package/_types/chains/definitions/edgelessTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/edgeware.d.ts +2 -0
- package/_types/chains/definitions/edgeware.d.ts.map +1 -1
- package/_types/chains/definitions/edgewareTestnet.d.ts +2 -0
- package/_types/chains/definitions/edgewareTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/eduChain.d.ts +2 -0
- package/_types/chains/definitions/eduChain.d.ts.map +1 -1
- package/_types/chains/definitions/eduChainTestnet.d.ts +2 -0
- package/_types/chains/definitions/eduChainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ekta.d.ts +2 -0
- package/_types/chains/definitions/ekta.d.ts.map +1 -1
- package/_types/chains/definitions/ektaTestnet.d.ts +2 -0
- package/_types/chains/definitions/ektaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/elastos.d.ts +2 -0
- package/_types/chains/definitions/elastos.d.ts.map +1 -1
- package/_types/chains/definitions/elastosTestnet.d.ts +2 -0
- package/_types/chains/definitions/elastosTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/electroneum.d.ts +2 -0
- package/_types/chains/definitions/electroneum.d.ts.map +1 -1
- package/_types/chains/definitions/electroneumTestnet.d.ts +2 -0
- package/_types/chains/definitions/electroneumTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/elysiumTestnet.d.ts +2 -0
- package/_types/chains/definitions/elysiumTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/energy.d.ts +2 -0
- package/_types/chains/definitions/energy.d.ts.map +1 -1
- package/_types/chains/definitions/eni.d.ts +2 -0
- package/_types/chains/definitions/eni.d.ts.map +1 -1
- package/_types/chains/definitions/eniTestnet.d.ts +2 -0
- package/_types/chains/definitions/eniTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/enuls.d.ts +2 -0
- package/_types/chains/definitions/enuls.d.ts.map +1 -1
- package/_types/chains/definitions/eon.d.ts +2 -0
- package/_types/chains/definitions/eon.d.ts.map +1 -1
- package/_types/chains/definitions/eos.d.ts +2 -0
- package/_types/chains/definitions/eos.d.ts.map +1 -1
- package/_types/chains/definitions/eosTestnet.d.ts +2 -0
- package/_types/chains/definitions/eosTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/eteria.d.ts +2 -0
- package/_types/chains/definitions/eteria.d.ts.map +1 -1
- package/_types/chains/definitions/etherlink.d.ts +2 -0
- package/_types/chains/definitions/etherlink.d.ts.map +1 -1
- package/_types/chains/definitions/etherlinkShadownetTestnet.d.ts +2 -0
- package/_types/chains/definitions/etherlinkShadownetTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/etherlinkTestnet.d.ts +2 -0
- package/_types/chains/definitions/etherlinkTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ethernity.d.ts +2 -0
- package/_types/chains/definitions/ethernity.d.ts.map +1 -1
- package/_types/chains/definitions/etp.d.ts +2 -0
- package/_types/chains/definitions/etp.d.ts.map +1 -1
- package/_types/chains/definitions/evmos.d.ts +2 -0
- package/_types/chains/definitions/evmos.d.ts.map +1 -1
- package/_types/chains/definitions/evmosTestnet.d.ts +2 -0
- package/_types/chains/definitions/evmosTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/exSat.d.ts +2 -0
- package/_types/chains/definitions/exSat.d.ts.map +1 -1
- package/_types/chains/definitions/exSatTestnet.d.ts +2 -0
- package/_types/chains/definitions/exSatTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/excelonMainnet.d.ts +2 -0
- package/_types/chains/definitions/excelonMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/expanse.d.ts +2 -0
- package/_types/chains/definitions/expanse.d.ts.map +1 -1
- package/_types/chains/definitions/fantom.d.ts +2 -0
- package/_types/chains/definitions/fantom.d.ts.map +1 -1
- package/_types/chains/definitions/fantomSonicTestnet.d.ts +2 -0
- package/_types/chains/definitions/fantomSonicTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/fantomTestnet.d.ts +2 -0
- package/_types/chains/definitions/fantomTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/fibo.d.ts +2 -0
- package/_types/chains/definitions/fibo.d.ts.map +1 -1
- package/_types/chains/definitions/filecoin.d.ts +2 -0
- package/_types/chains/definitions/filecoin.d.ts.map +1 -1
- package/_types/chains/definitions/filecoinCalibration.d.ts +2 -0
- package/_types/chains/definitions/filecoinCalibration.d.ts.map +1 -1
- package/_types/chains/definitions/filecoinHyperspace.d.ts +2 -0
- package/_types/chains/definitions/filecoinHyperspace.d.ts.map +1 -1
- package/_types/chains/definitions/flame.d.ts +2 -0
- package/_types/chains/definitions/flame.d.ts.map +1 -1
- package/_types/chains/definitions/flare.d.ts +2 -0
- package/_types/chains/definitions/flare.d.ts.map +1 -1
- package/_types/chains/definitions/flareTestnet.d.ts +2 -0
- package/_types/chains/definitions/flareTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/flowMainnet.d.ts +2 -0
- package/_types/chains/definitions/flowMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/flowPreviewnet.d.ts +2 -0
- package/_types/chains/definitions/flowPreviewnet.d.ts.map +1 -1
- package/_types/chains/definitions/flowTestnet.d.ts +2 -0
- package/_types/chains/definitions/flowTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/fluence.d.ts +2 -0
- package/_types/chains/definitions/fluence.d.ts.map +1 -1
- package/_types/chains/definitions/fluenceStage.d.ts +2 -0
- package/_types/chains/definitions/fluenceStage.d.ts.map +1 -1
- package/_types/chains/definitions/fluenceTestnet.d.ts +2 -0
- package/_types/chains/definitions/fluenceTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/fluentTestnet.d.ts +2 -0
- package/_types/chains/definitions/fluentTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/form.d.ts +2 -0
- package/_types/chains/definitions/form.d.ts.map +1 -1
- package/_types/chains/definitions/formTestnet.d.ts +2 -0
- package/_types/chains/definitions/formTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/forma.d.ts +2 -0
- package/_types/chains/definitions/forma.d.ts.map +1 -1
- package/_types/chains/definitions/forta.d.ts +2 -0
- package/_types/chains/definitions/forta.d.ts.map +1 -1
- package/_types/chains/definitions/foundry.d.ts +2 -0
- package/_types/chains/definitions/foundry.d.ts.map +1 -1
- package/_types/chains/definitions/fraxtal.d.ts +2 -0
- package/_types/chains/definitions/fraxtal.d.ts.map +1 -1
- package/_types/chains/definitions/fraxtalTestnet.d.ts +2 -0
- package/_types/chains/definitions/fraxtalTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/funkiMainnet.d.ts +2 -0
- package/_types/chains/definitions/funkiMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/funkiSepolia.d.ts +2 -0
- package/_types/chains/definitions/funkiSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/fuse.d.ts +2 -0
- package/_types/chains/definitions/fuse.d.ts.map +1 -1
- package/_types/chains/definitions/fuseSparknet.d.ts +2 -0
- package/_types/chains/definitions/fuseSparknet.d.ts.map +1 -1
- package/_types/chains/definitions/fusion.d.ts +2 -0
- package/_types/chains/definitions/fusion.d.ts.map +1 -1
- package/_types/chains/definitions/fusionTestnet.d.ts +2 -0
- package/_types/chains/definitions/fusionTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/garnet.d.ts +2 -0
- package/_types/chains/definitions/garnet.d.ts.map +1 -1
- package/_types/chains/definitions/gatechain.d.ts +2 -0
- package/_types/chains/definitions/gatechain.d.ts.map +1 -1
- package/_types/chains/definitions/geist.d.ts +2 -0
- package/_types/chains/definitions/geist.d.ts.map +1 -1
- package/_types/chains/definitions/genesys.d.ts +2 -0
- package/_types/chains/definitions/genesys.d.ts.map +1 -1
- package/_types/chains/definitions/giwaSepolia.d.ts +4 -0
- package/_types/chains/definitions/giwaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/glideL1Protocol.d.ts +2 -0
- package/_types/chains/definitions/glideL1Protocol.d.ts.map +1 -1
- package/_types/chains/definitions/glideL2Protocol.d.ts +2 -0
- package/_types/chains/definitions/glideL2Protocol.d.ts.map +1 -1
- package/_types/chains/definitions/gnosis.d.ts +2 -0
- package/_types/chains/definitions/gnosis.d.ts.map +1 -1
- package/_types/chains/definitions/gnosisChiado.d.ts +2 -0
- package/_types/chains/definitions/gnosisChiado.d.ts.map +1 -1
- package/_types/chains/definitions/goChain.d.ts +2 -0
- package/_types/chains/definitions/goChain.d.ts.map +1 -1
- package/_types/chains/definitions/goat.d.ts +2 -0
- package/_types/chains/definitions/goat.d.ts.map +1 -1
- package/_types/chains/definitions/gobi.d.ts +2 -0
- package/_types/chains/definitions/gobi.d.ts.map +1 -1
- package/_types/chains/definitions/godwoken.d.ts +2 -0
- package/_types/chains/definitions/godwoken.d.ts.map +1 -1
- package/_types/chains/definitions/goerli.d.ts +2 -0
- package/_types/chains/definitions/goerli.d.ts.map +1 -1
- package/_types/chains/definitions/graphite.d.ts +2 -0
- package/_types/chains/definitions/graphite.d.ts.map +1 -1
- package/_types/chains/definitions/graphiteTestnet.d.ts +2 -0
- package/_types/chains/definitions/graphiteTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/gravity.d.ts +2 -0
- package/_types/chains/definitions/gravity.d.ts.map +1 -1
- package/_types/chains/definitions/gunz.d.ts +2 -0
- package/_types/chains/definitions/gunz.d.ts.map +1 -1
- package/_types/chains/definitions/guruNetwork.d.ts +2 -0
- package/_types/chains/definitions/guruNetwork.d.ts.map +1 -1
- package/_types/chains/definitions/guruTestnet.d.ts +2 -0
- package/_types/chains/definitions/guruTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ham.d.ts +2 -0
- package/_types/chains/definitions/ham.d.ts.map +1 -1
- package/_types/chains/definitions/happychainTestnet.d.ts +2 -0
- package/_types/chains/definitions/happychainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/haqqMainnet.d.ts +2 -0
- package/_types/chains/definitions/haqqMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/haqqTestedge2.d.ts +2 -0
- package/_types/chains/definitions/haqqTestedge2.d.ts.map +1 -1
- package/_types/chains/definitions/hardhat.d.ts +2 -0
- package/_types/chains/definitions/hardhat.d.ts.map +1 -1
- package/_types/chains/definitions/harmonyOne.d.ts +2 -0
- package/_types/chains/definitions/harmonyOne.d.ts.map +1 -1
- package/_types/chains/definitions/hashKeyChain.d.ts +2 -0
- package/_types/chains/definitions/hashKeyChain.d.ts.map +1 -1
- package/_types/chains/definitions/hashkeyChainTestnet.d.ts +2 -0
- package/_types/chains/definitions/hashkeyChainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/haustTestnet.d.ts +2 -0
- package/_types/chains/definitions/haustTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/hedera.d.ts +2 -0
- package/_types/chains/definitions/hedera.d.ts.map +1 -1
- package/_types/chains/definitions/hederaPreviewnet.d.ts +2 -0
- package/_types/chains/definitions/hederaPreviewnet.d.ts.map +1 -1
- package/_types/chains/definitions/hederaTestnet.d.ts +2 -0
- package/_types/chains/definitions/hederaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/hela.d.ts +2 -0
- package/_types/chains/definitions/hela.d.ts.map +1 -1
- package/_types/chains/definitions/heliosTestnet.d.ts +2 -0
- package/_types/chains/definitions/heliosTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/hemi.d.ts +2 -0
- package/_types/chains/definitions/hemi.d.ts.map +1 -1
- package/_types/chains/definitions/hemiSepolia.d.ts +2 -0
- package/_types/chains/definitions/hemiSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/henesys.d.ts +2 -0
- package/_types/chains/definitions/henesys.d.ts.map +1 -1
- package/_types/chains/definitions/holesky.d.ts +2 -0
- package/_types/chains/definitions/holesky.d.ts.map +1 -1
- package/_types/chains/definitions/hoodi.d.ts +2 -0
- package/_types/chains/definitions/hoodi.d.ts.map +1 -1
- package/_types/chains/definitions/hpb.d.ts +2 -0
- package/_types/chains/definitions/hpb.d.ts.map +1 -1
- package/_types/chains/definitions/huddle01Mainnet.d.ts +2 -0
- package/_types/chains/definitions/huddle01Mainnet.d.ts.map +1 -1
- package/_types/chains/definitions/huddle01Testnet.d.ts +2 -0
- package/_types/chains/definitions/huddle01Testnet.d.ts.map +1 -1
- package/_types/chains/definitions/humanity.d.ts +2 -0
- package/_types/chains/definitions/humanity.d.ts.map +1 -1
- package/_types/chains/definitions/humanityTestnet.d.ts +2 -0
- package/_types/chains/definitions/humanityTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/humanode.d.ts +2 -0
- package/_types/chains/definitions/humanode.d.ts.map +1 -1
- package/_types/chains/definitions/humanodeTestnet5.d.ts +2 -0
- package/_types/chains/definitions/humanodeTestnet5.d.ts.map +1 -1
- package/_types/chains/definitions/hychain.d.ts +2 -0
- package/_types/chains/definitions/hychain.d.ts.map +1 -1
- package/_types/chains/definitions/hychainTestnet.d.ts +2 -0
- package/_types/chains/definitions/hychainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/hyperEvm.d.ts +2 -0
- package/_types/chains/definitions/hyperEvm.d.ts.map +1 -1
- package/_types/chains/definitions/hyperliquidEvmTestnet.d.ts +2 -0
- package/_types/chains/definitions/hyperliquidEvmTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/iSunCoin.d.ts +2 -0
- package/_types/chains/definitions/iSunCoin.d.ts.map +1 -1
- package/_types/chains/definitions/icbNetwork.d.ts +2 -0
- package/_types/chains/definitions/icbNetwork.d.ts.map +1 -1
- package/_types/chains/definitions/idchain.d.ts +2 -0
- package/_types/chains/definitions/idchain.d.ts.map +1 -1
- package/_types/chains/definitions/immutableZkEvm.d.ts +2 -0
- package/_types/chains/definitions/immutableZkEvm.d.ts.map +1 -1
- package/_types/chains/definitions/immutableZkEvmTestnet.d.ts +2 -0
- package/_types/chains/definitions/immutableZkEvmTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/inEVM.d.ts +2 -0
- package/_types/chains/definitions/inEVM.d.ts.map +1 -1
- package/_types/chains/definitions/initVerse.d.ts +2 -0
- package/_types/chains/definitions/initVerse.d.ts.map +1 -1
- package/_types/chains/definitions/initVerseGenesis.d.ts +2 -0
- package/_types/chains/definitions/initVerseGenesis.d.ts.map +1 -1
- package/_types/chains/definitions/injective.d.ts +2 -0
- package/_types/chains/definitions/injective.d.ts.map +1 -1
- package/_types/chains/definitions/injectiveTestnet.d.ts +2 -0
- package/_types/chains/definitions/injectiveTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ink.d.ts +2 -0
- package/_types/chains/definitions/ink.d.ts.map +1 -1
- package/_types/chains/definitions/inkSepolia.d.ts +2 -0
- package/_types/chains/definitions/inkSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/iota.d.ts +2 -0
- package/_types/chains/definitions/iota.d.ts.map +1 -1
- package/_types/chains/definitions/iotaTestnet.d.ts +2 -0
- package/_types/chains/definitions/iotaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/iotex.d.ts +2 -0
- package/_types/chains/definitions/iotex.d.ts.map +1 -1
- package/_types/chains/definitions/iotexTestnet.d.ts +2 -0
- package/_types/chains/definitions/iotexTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/jasmyChain.d.ts +2 -0
- package/_types/chains/definitions/jasmyChain.d.ts.map +1 -1
- package/_types/chains/definitions/jasmyChainTestnet.d.ts +2 -0
- package/_types/chains/definitions/jasmyChainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/jbc.d.ts +2 -0
- package/_types/chains/definitions/jbc.d.ts.map +1 -1
- package/_types/chains/definitions/jbcTestnet.d.ts +2 -0
- package/_types/chains/definitions/jbcTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/jocMainnet.d.ts +2 -0
- package/_types/chains/definitions/jocMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/jocTestnet.d.ts +2 -0
- package/_types/chains/definitions/jocTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/jovay.d.ts +2 -0
- package/_types/chains/definitions/jovay.d.ts.map +1 -1
- package/_types/chains/definitions/jovaySepolia.d.ts +2 -0
- package/_types/chains/definitions/jovaySepolia.d.ts.map +1 -1
- package/_types/chains/definitions/juneo.d.ts +2 -0
- package/_types/chains/definitions/juneo.d.ts.map +1 -1
- package/_types/chains/definitions/juneoBCH1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoBCH1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoDAI1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoDAI1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoDOGE1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoDOGE1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoEUR1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoEUR1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoGLD1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoGLD1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoLINK1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoLINK1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoLTC1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoLTC1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoSGD1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoSGD1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoSocotraTestnet.d.ts +2 -0
- package/_types/chains/definitions/juneoSocotraTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/juneoUSD1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoUSD1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneoUSDT1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneoUSDT1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/juneomBTC1Chain.d.ts +2 -0
- package/_types/chains/definitions/juneomBTC1Chain.d.ts.map +1 -1
- package/_types/chains/definitions/kaia.d.ts +2 -0
- package/_types/chains/definitions/kaia.d.ts.map +1 -1
- package/_types/chains/definitions/kairos.d.ts +2 -0
- package/_types/chains/definitions/kairos.d.ts.map +1 -1
- package/_types/chains/definitions/kakarotSepolia.d.ts +2 -0
- package/_types/chains/definitions/kakarotSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/kakarotStarknetSepolia.d.ts +2 -0
- package/_types/chains/definitions/kakarotStarknetSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/kardiaChain.d.ts +2 -0
- package/_types/chains/definitions/kardiaChain.d.ts.map +1 -1
- package/_types/chains/definitions/karura.d.ts +2 -0
- package/_types/chains/definitions/karura.d.ts.map +1 -1
- package/_types/chains/definitions/katana.d.ts +2 -0
- package/_types/chains/definitions/katana.d.ts.map +1 -1
- package/_types/chains/definitions/kava.d.ts +2 -0
- package/_types/chains/definitions/kava.d.ts.map +1 -1
- package/_types/chains/definitions/kavaTestnet.d.ts +2 -0
- package/_types/chains/definitions/kavaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/kcc.d.ts +2 -0
- package/_types/chains/definitions/kcc.d.ts.map +1 -1
- package/_types/chains/definitions/kiiTestnet.d.ts +2 -0
- package/_types/chains/definitions/kiiTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/kinto.d.ts +2 -0
- package/_types/chains/definitions/kinto.d.ts.map +1 -1
- package/_types/chains/definitions/klaytn.d.ts +2 -0
- package/_types/chains/definitions/klaytn.d.ts.map +1 -1
- package/_types/chains/definitions/klaytnBaobab.d.ts +2 -0
- package/_types/chains/definitions/klaytnBaobab.d.ts.map +1 -1
- package/_types/chains/definitions/koi.d.ts +2 -0
- package/_types/chains/definitions/koi.d.ts.map +1 -1
- package/_types/chains/definitions/kroma.d.ts +2 -0
- package/_types/chains/definitions/kroma.d.ts.map +1 -1
- package/_types/chains/definitions/kromaSepolia.d.ts +2 -0
- package/_types/chains/definitions/kromaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/l3x.d.ts +2 -0
- package/_types/chains/definitions/l3x.d.ts.map +1 -1
- package/_types/chains/definitions/l3xTestnet.d.ts +2 -0
- package/_types/chains/definitions/l3xTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/lavita.d.ts +2 -0
- package/_types/chains/definitions/lavita.d.ts.map +1 -1
- package/_types/chains/definitions/lens.d.ts +2 -0
- package/_types/chains/definitions/lens.d.ts.map +1 -1
- package/_types/chains/definitions/lensTestnet.d.ts +2 -0
- package/_types/chains/definitions/lensTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/lestnet.d.ts +2 -0
- package/_types/chains/definitions/lestnet.d.ts.map +1 -1
- package/_types/chains/definitions/lightlinkPegasus.d.ts +2 -0
- package/_types/chains/definitions/lightlinkPegasus.d.ts.map +1 -1
- package/_types/chains/definitions/lightlinkPhoenix.d.ts +2 -0
- package/_types/chains/definitions/lightlinkPhoenix.d.ts.map +1 -1
- package/_types/chains/definitions/linea.d.ts +2 -0
- package/_types/chains/definitions/linea.d.ts.map +1 -1
- package/_types/chains/definitions/lineaGoerli.d.ts +2 -0
- package/_types/chains/definitions/lineaGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/lineaSepolia.d.ts +2 -0
- package/_types/chains/definitions/lineaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/lineaTestnet.d.ts +2 -0
- package/_types/chains/definitions/lineaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/lisk.d.ts +2 -0
- package/_types/chains/definitions/lisk.d.ts.map +1 -1
- package/_types/chains/definitions/liskSepolia.d.ts +2 -0
- package/_types/chains/definitions/liskSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/loadAlphanet.d.ts +2 -0
- package/_types/chains/definitions/loadAlphanet.d.ts.map +1 -1
- package/_types/chains/definitions/localhost.d.ts +2 -0
- package/_types/chains/definitions/localhost.d.ts.map +1 -1
- package/_types/chains/definitions/loop.d.ts +2 -0
- package/_types/chains/definitions/loop.d.ts.map +1 -1
- package/_types/chains/definitions/lukso.d.ts +2 -0
- package/_types/chains/definitions/lukso.d.ts.map +1 -1
- package/_types/chains/definitions/luksoTestnet.d.ts +2 -0
- package/_types/chains/definitions/luksoTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/lumiaMainnet.d.ts +2 -0
- package/_types/chains/definitions/lumiaMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/lumiaTestnet.d.ts +2 -0
- package/_types/chains/definitions/lumiaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/lumoz.d.ts +2 -0
- package/_types/chains/definitions/lumoz.d.ts.map +1 -1
- package/_types/chains/definitions/lumozTestnet.d.ts +2 -0
- package/_types/chains/definitions/lumozTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/lycan.d.ts +2 -0
- package/_types/chains/definitions/lycan.d.ts.map +1 -1
- package/_types/chains/definitions/lyra.d.ts +2 -0
- package/_types/chains/definitions/lyra.d.ts.map +1 -1
- package/_types/chains/definitions/mainnet.d.ts +2 -0
- package/_types/chains/definitions/mainnet.d.ts.map +1 -1
- package/_types/chains/definitions/mandala.d.ts +2 -0
- package/_types/chains/definitions/mandala.d.ts.map +1 -1
- package/_types/chains/definitions/manta.d.ts +2 -0
- package/_types/chains/definitions/manta.d.ts.map +1 -1
- package/_types/chains/definitions/mantaSepoliaTestnet.d.ts +2 -0
- package/_types/chains/definitions/mantaSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mantaTestnet.d.ts +2 -0
- package/_types/chains/definitions/mantaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mantle.d.ts +2 -0
- package/_types/chains/definitions/mantle.d.ts.map +1 -1
- package/_types/chains/definitions/mantleSepoliaTestnet.d.ts +2 -0
- package/_types/chains/definitions/mantleSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mantleTestnet.d.ts +2 -0
- package/_types/chains/definitions/mantleTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mantraDuKongEVMTestnet.d.ts +2 -0
- package/_types/chains/definitions/mantraDuKongEVMTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mantraEVM.d.ts +2 -0
- package/_types/chains/definitions/mantraEVM.d.ts.map +1 -1
- package/_types/chains/definitions/mapProtocol.d.ts +2 -0
- package/_types/chains/definitions/mapProtocol.d.ts.map +1 -1
- package/_types/chains/definitions/matchain.d.ts +2 -0
- package/_types/chains/definitions/matchain.d.ts.map +1 -1
- package/_types/chains/definitions/matchainTestnet.d.ts +2 -0
- package/_types/chains/definitions/matchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mchVerse.d.ts +2 -0
- package/_types/chains/definitions/mchVerse.d.ts.map +1 -1
- package/_types/chains/definitions/megaethTestnet.d.ts +2 -0
- package/_types/chains/definitions/megaethTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mekong.d.ts +2 -0
- package/_types/chains/definitions/mekong.d.ts.map +1 -1
- package/_types/chains/definitions/meld.d.ts +2 -0
- package/_types/chains/definitions/meld.d.ts.map +1 -1
- package/_types/chains/definitions/memecore.d.ts +2 -0
- package/_types/chains/definitions/memecore.d.ts.map +1 -1
- package/_types/chains/definitions/memecoreFormicariumTestnet.d.ts +2 -0
- package/_types/chains/definitions/memecoreFormicariumTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/merlin.d.ts +2 -0
- package/_types/chains/definitions/merlin.d.ts.map +1 -1
- package/_types/chains/definitions/merlinErigonTestnet.d.ts +2 -0
- package/_types/chains/definitions/merlinErigonTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/metachain.d.ts +2 -0
- package/_types/chains/definitions/metachain.d.ts.map +1 -1
- package/_types/chains/definitions/metachainIstanbul.d.ts +2 -0
- package/_types/chains/definitions/metachainIstanbul.d.ts.map +1 -1
- package/_types/chains/definitions/metadium.d.ts +2 -0
- package/_types/chains/definitions/metadium.d.ts.map +1 -1
- package/_types/chains/definitions/metalL2.d.ts +2 -0
- package/_types/chains/definitions/metalL2.d.ts.map +1 -1
- package/_types/chains/definitions/meter.d.ts +2 -0
- package/_types/chains/definitions/meter.d.ts.map +1 -1
- package/_types/chains/definitions/meterTestnet.d.ts +2 -0
- package/_types/chains/definitions/meterTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/metis.d.ts +2 -0
- package/_types/chains/definitions/metis.d.ts.map +1 -1
- package/_types/chains/definitions/metisGoerli.d.ts +2 -0
- package/_types/chains/definitions/metisGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/metisSepolia.d.ts +2 -0
- package/_types/chains/definitions/metisSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/mev.d.ts +2 -0
- package/_types/chains/definitions/mev.d.ts.map +1 -1
- package/_types/chains/definitions/mevTestnet.d.ts +2 -0
- package/_types/chains/definitions/mevTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mint.d.ts +2 -0
- package/_types/chains/definitions/mint.d.ts.map +1 -1
- package/_types/chains/definitions/mintSepoliaTestnet.d.ts +2 -0
- package/_types/chains/definitions/mintSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mitosisTestnet.d.ts +2 -0
- package/_types/chains/definitions/mitosisTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/mode.d.ts +2 -0
- package/_types/chains/definitions/mode.d.ts.map +1 -1
- package/_types/chains/definitions/modeTestnet.d.ts +2 -0
- package/_types/chains/definitions/modeTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/monad.d.ts +2 -0
- package/_types/chains/definitions/monad.d.ts.map +1 -1
- package/_types/chains/definitions/monadTestnet.d.ts +2 -0
- package/_types/chains/definitions/monadTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/moonbaseAlpha.d.ts +2 -0
- package/_types/chains/definitions/moonbaseAlpha.d.ts.map +1 -1
- package/_types/chains/definitions/moonbeam.d.ts +2 -0
- package/_types/chains/definitions/moonbeam.d.ts.map +1 -1
- package/_types/chains/definitions/moonbeamDev.d.ts +2 -0
- package/_types/chains/definitions/moonbeamDev.d.ts.map +1 -1
- package/_types/chains/definitions/moonriver.d.ts +2 -0
- package/_types/chains/definitions/moonriver.d.ts.map +1 -1
- package/_types/chains/definitions/morph.d.ts +2 -0
- package/_types/chains/definitions/morph.d.ts.map +1 -1
- package/_types/chains/definitions/morphHolesky.d.ts +2 -0
- package/_types/chains/definitions/morphHolesky.d.ts.map +1 -1
- package/_types/chains/definitions/morphSepolia.d.ts +2 -0
- package/_types/chains/definitions/morphSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/nahmii.d.ts +2 -0
- package/_types/chains/definitions/nahmii.d.ts.map +1 -1
- package/_types/chains/definitions/nautilus.d.ts +2 -0
- package/_types/chains/definitions/nautilus.d.ts.map +1 -1
- package/_types/chains/definitions/near.d.ts +2 -0
- package/_types/chains/definitions/near.d.ts.map +1 -1
- package/_types/chains/definitions/nearTestnet.d.ts +2 -0
- package/_types/chains/definitions/nearTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/neonDevnet.d.ts +2 -0
- package/_types/chains/definitions/neonDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/neonMainnet.d.ts +2 -0
- package/_types/chains/definitions/neonMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/neoxMainnet.d.ts +2 -0
- package/_types/chains/definitions/neoxMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/neoxT4.d.ts +2 -0
- package/_types/chains/definitions/neoxT4.d.ts.map +1 -1
- package/_types/chains/definitions/newton.d.ts +2 -0
- package/_types/chains/definitions/newton.d.ts.map +1 -1
- package/_types/chains/definitions/nexi.d.ts +2 -0
- package/_types/chains/definitions/nexi.d.ts.map +1 -1
- package/_types/chains/definitions/nexilix.d.ts +2 -0
- package/_types/chains/definitions/nexilix.d.ts.map +1 -1
- package/_types/chains/definitions/nibiru.d.ts +2 -0
- package/_types/chains/definitions/nibiru.d.ts.map +1 -1
- package/_types/chains/definitions/nitrographTestnet.d.ts +2 -0
- package/_types/chains/definitions/nitrographTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/nomina.d.ts +2 -0
- package/_types/chains/definitions/nomina.d.ts.map +1 -1
- package/_types/chains/definitions/oasisTestnet.d.ts +2 -0
- package/_types/chains/definitions/oasisTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/oasys.d.ts +2 -0
- package/_types/chains/definitions/oasys.d.ts.map +1 -1
- package/_types/chains/definitions/odysseyTestnet.d.ts +2 -0
- package/_types/chains/definitions/odysseyTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/okc.d.ts +2 -0
- package/_types/chains/definitions/okc.d.ts.map +1 -1
- package/_types/chains/definitions/omax.d.ts +2 -0
- package/_types/chains/definitions/omax.d.ts.map +1 -1
- package/_types/chains/definitions/omni.d.ts +2 -0
- package/_types/chains/definitions/omni.d.ts.map +1 -1
- package/_types/chains/definitions/omniOmega.d.ts +2 -0
- package/_types/chains/definitions/omniOmega.d.ts.map +1 -1
- package/_types/chains/definitions/oneWorld.d.ts +2 -0
- package/_types/chains/definitions/oneWorld.d.ts.map +1 -1
- package/_types/chains/definitions/oortmainnetDev.d.ts +2 -0
- package/_types/chains/definitions/oortmainnetDev.d.ts.map +1 -1
- package/_types/chains/definitions/opBNB.d.ts +2 -0
- package/_types/chains/definitions/opBNB.d.ts.map +1 -1
- package/_types/chains/definitions/opBNBTestnet.d.ts +2 -0
- package/_types/chains/definitions/opBNBTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/openledger.d.ts +2 -0
- package/_types/chains/definitions/openledger.d.ts.map +1 -1
- package/_types/chains/definitions/optimism.d.ts +2 -0
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/optimismGoerli.d.ts +2 -0
- package/_types/chains/definitions/optimismGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/optimismSepolia.d.ts +2 -0
- package/_types/chains/definitions/optimismSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/optopia.d.ts +2 -0
- package/_types/chains/definitions/optopia.d.ts.map +1 -1
- package/_types/chains/definitions/optopiaTestnet.d.ts +2 -0
- package/_types/chains/definitions/optopiaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/orderly.d.ts +2 -0
- package/_types/chains/definitions/orderly.d.ts.map +1 -1
- package/_types/chains/definitions/orderlySepolia.d.ts +2 -0
- package/_types/chains/definitions/orderlySepolia.d.ts.map +1 -1
- package/_types/chains/definitions/otimDevnet.d.ts +2 -0
- package/_types/chains/definitions/otimDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/palm.d.ts +2 -0
- package/_types/chains/definitions/palm.d.ts.map +1 -1
- package/_types/chains/definitions/palmTestnet.d.ts +2 -0
- package/_types/chains/definitions/palmTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/peaq.d.ts +2 -0
- package/_types/chains/definitions/peaq.d.ts.map +1 -1
- package/_types/chains/definitions/pgn.d.ts +2 -0
- package/_types/chains/definitions/pgn.d.ts.map +1 -1
- package/_types/chains/definitions/pgnTestnet.d.ts +2 -0
- package/_types/chains/definitions/pgnTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/phoenix.d.ts +2 -0
- package/_types/chains/definitions/phoenix.d.ts.map +1 -1
- package/_types/chains/definitions/planq.d.ts +2 -0
- package/_types/chains/definitions/planq.d.ts.map +1 -1
- package/_types/chains/definitions/plasma.d.ts +2 -0
- package/_types/chains/definitions/plasma.d.ts.map +1 -1
- package/_types/chains/definitions/plasmaDevnet.d.ts +2 -0
- package/_types/chains/definitions/plasmaDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/plasmaTestnet.d.ts +2 -0
- package/_types/chains/definitions/plasmaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/playfiAlbireo.d.ts +2 -0
- package/_types/chains/definitions/playfiAlbireo.d.ts.map +1 -1
- package/_types/chains/definitions/plinga.d.ts +2 -0
- package/_types/chains/definitions/plinga.d.ts.map +1 -1
- package/_types/chains/definitions/plume.d.ts +2 -0
- package/_types/chains/definitions/plume.d.ts.map +1 -1
- package/_types/chains/definitions/plumeDevnet.d.ts +2 -0
- package/_types/chains/definitions/plumeDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/plumeMainnet.d.ts +2 -0
- package/_types/chains/definitions/plumeMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/plumeSepolia.d.ts +2 -0
- package/_types/chains/definitions/plumeSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/plumeTestnet.d.ts +2 -0
- package/_types/chains/definitions/plumeTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/polterTestnet.d.ts +2 -0
- package/_types/chains/definitions/polterTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/polygon.d.ts +2 -0
- package/_types/chains/definitions/polygon.d.ts.map +1 -1
- package/_types/chains/definitions/polygonAmoy.d.ts +2 -0
- package/_types/chains/definitions/polygonAmoy.d.ts.map +1 -1
- package/_types/chains/definitions/polygonMumbai.d.ts +2 -0
- package/_types/chains/definitions/polygonMumbai.d.ts.map +1 -1
- package/_types/chains/definitions/polygonZkEvm.d.ts +2 -0
- package/_types/chains/definitions/polygonZkEvm.d.ts.map +1 -1
- package/_types/chains/definitions/polygonZkEvmCardona.d.ts +2 -0
- package/_types/chains/definitions/polygonZkEvmCardona.d.ts.map +1 -1
- package/_types/chains/definitions/polygonZkEvmTestnet.d.ts +2 -0
- package/_types/chains/definitions/polygonZkEvmTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/polynomial.d.ts +2 -0
- package/_types/chains/definitions/polynomial.d.ts.map +1 -1
- package/_types/chains/definitions/polynomialSepolia.d.ts +2 -0
- package/_types/chains/definitions/polynomialSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/potos.d.ts +2 -0
- package/_types/chains/definitions/potos.d.ts.map +1 -1
- package/_types/chains/definitions/potosTestnet.d.ts +2 -0
- package/_types/chains/definitions/potosTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/premiumBlock.d.ts +2 -0
- package/_types/chains/definitions/premiumBlock.d.ts.map +1 -1
- package/_types/chains/definitions/pulsechain.d.ts +2 -0
- package/_types/chains/definitions/pulsechain.d.ts.map +1 -1
- package/_types/chains/definitions/pulsechainV4.d.ts +2 -0
- package/_types/chains/definitions/pulsechainV4.d.ts.map +1 -1
- package/_types/chains/definitions/pumpfiTestnet.d.ts +2 -0
- package/_types/chains/definitions/pumpfiTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/pyrope.d.ts +2 -0
- package/_types/chains/definitions/pyrope.d.ts.map +1 -1
- package/_types/chains/definitions/qMainnet.d.ts +2 -0
- package/_types/chains/definitions/qMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/qTestnet.d.ts +2 -0
- package/_types/chains/definitions/qTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ql1.d.ts +2 -0
- package/_types/chains/definitions/ql1.d.ts.map +1 -1
- package/_types/chains/definitions/quai.d.ts +2 -0
- package/_types/chains/definitions/quai.d.ts.map +1 -1
- package/_types/chains/definitions/quaiTestnet.d.ts +2 -0
- package/_types/chains/definitions/quaiTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/reactiveTestnet.d.ts +2 -0
- package/_types/chains/definitions/reactiveTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/real.d.ts +2 -0
- package/_types/chains/definitions/real.d.ts.map +1 -1
- package/_types/chains/definitions/redbellyMainnet.d.ts +2 -0
- package/_types/chains/definitions/redbellyMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/redbellyTestnet.d.ts +2 -0
- package/_types/chains/definitions/redbellyTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/reddio.d.ts +2 -0
- package/_types/chains/definitions/reddio.d.ts.map +1 -1
- package/_types/chains/definitions/reddioSepolia.d.ts +2 -0
- package/_types/chains/definitions/reddioSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/redstone.d.ts +2 -0
- package/_types/chains/definitions/redstone.d.ts.map +1 -1
- package/_types/chains/definitions/rei.d.ts +2 -0
- package/_types/chains/definitions/rei.d.ts.map +1 -1
- package/_types/chains/definitions/reyaNetwork.d.ts +2 -0
- package/_types/chains/definitions/reyaNetwork.d.ts.map +1 -1
- package/_types/chains/definitions/riseTestnet.d.ts +2 -0
- package/_types/chains/definitions/riseTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/rivalz.d.ts +2 -0
- package/_types/chains/definitions/rivalz.d.ts.map +1 -1
- package/_types/chains/definitions/rollux.d.ts +2 -0
- package/_types/chains/definitions/rollux.d.ts.map +1 -1
- package/_types/chains/definitions/rolluxTestnet.d.ts +2 -0
- package/_types/chains/definitions/rolluxTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ronin.d.ts +2 -0
- package/_types/chains/definitions/ronin.d.ts.map +1 -1
- package/_types/chains/definitions/root.d.ts +2 -0
- package/_types/chains/definitions/root.d.ts.map +1 -1
- package/_types/chains/definitions/rootPorcini.d.ts +2 -0
- package/_types/chains/definitions/rootPorcini.d.ts.map +1 -1
- package/_types/chains/definitions/rootstock.d.ts +2 -0
- package/_types/chains/definitions/rootstock.d.ts.map +1 -1
- package/_types/chains/definitions/rootstockTestnet.d.ts +2 -0
- package/_types/chains/definitions/rootstockTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/rss3.d.ts +2 -0
- package/_types/chains/definitions/rss3.d.ts.map +1 -1
- package/_types/chains/definitions/rss3Sepolia.d.ts +2 -0
- package/_types/chains/definitions/rss3Sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/saakuru.d.ts +2 -0
- package/_types/chains/definitions/saakuru.d.ts.map +1 -1
- package/_types/chains/definitions/saga.d.ts +2 -0
- package/_types/chains/definitions/saga.d.ts.map +1 -1
- package/_types/chains/definitions/saigon.d.ts +2 -0
- package/_types/chains/definitions/saigon.d.ts.map +1 -1
- package/_types/chains/definitions/sanko.d.ts +2 -0
- package/_types/chains/definitions/sanko.d.ts.map +1 -1
- package/_types/chains/definitions/sapphire.d.ts +2 -0
- package/_types/chains/definitions/sapphire.d.ts.map +1 -1
- package/_types/chains/definitions/sapphireTestnet.d.ts +2 -0
- package/_types/chains/definitions/sapphireTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/satoshivm.d.ts +2 -0
- package/_types/chains/definitions/satoshivm.d.ts.map +1 -1
- package/_types/chains/definitions/satoshivmTestnet.d.ts +2 -0
- package/_types/chains/definitions/satoshivmTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/scroll.d.ts +2 -0
- package/_types/chains/definitions/scroll.d.ts.map +1 -1
- package/_types/chains/definitions/scrollSepolia.d.ts +2 -0
- package/_types/chains/definitions/scrollSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/sei.d.ts +2 -0
- package/_types/chains/definitions/sei.d.ts.map +1 -1
- package/_types/chains/definitions/seiDevnet.d.ts +2 -0
- package/_types/chains/definitions/seiDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/seiTestnet.d.ts +2 -0
- package/_types/chains/definitions/seiTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/seismicDevnet.d.ts +2 -0
- package/_types/chains/definitions/seismicDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/sepolia.d.ts +2 -0
- package/_types/chains/definitions/sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/shape.d.ts +2 -0
- package/_types/chains/definitions/shape.d.ts.map +1 -1
- package/_types/chains/definitions/shapeSepolia.d.ts +2 -0
- package/_types/chains/definitions/shapeSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/shardeum.d.ts +2 -0
- package/_types/chains/definitions/shardeum.d.ts.map +1 -1
- package/_types/chains/definitions/shardeumSphinx.d.ts +2 -0
- package/_types/chains/definitions/shardeumSphinx.d.ts.map +1 -1
- package/_types/chains/definitions/shibarium.d.ts +2 -0
- package/_types/chains/definitions/shibarium.d.ts.map +1 -1
- package/_types/chains/definitions/shibariumTestnet.d.ts +2 -0
- package/_types/chains/definitions/shibariumTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/shiden.d.ts +2 -0
- package/_types/chains/definitions/shiden.d.ts.map +1 -1
- package/_types/chains/definitions/shimmer.d.ts +2 -0
- package/_types/chains/definitions/shimmer.d.ts.map +1 -1
- package/_types/chains/definitions/shimmerTestnet.d.ts +2 -0
- package/_types/chains/definitions/shimmerTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/sidra.d.ts +2 -0
- package/_types/chains/definitions/sidra.d.ts.map +1 -1
- package/_types/chains/definitions/silentdata.d.ts +2 -0
- package/_types/chains/definitions/silentdata.d.ts.map +1 -1
- package/_types/chains/definitions/silicon.d.ts +2 -0
- package/_types/chains/definitions/silicon.d.ts.map +1 -1
- package/_types/chains/definitions/siliconSepolia.d.ts +2 -0
- package/_types/chains/definitions/siliconSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/sixProtocol.d.ts +2 -0
- package/_types/chains/definitions/sixProtocol.d.ts.map +1 -1
- package/_types/chains/definitions/skale/brawl.d.ts +2 -0
- package/_types/chains/definitions/skale/brawl.d.ts.map +1 -1
- package/_types/chains/definitions/skale/calypso.d.ts +2 -0
- package/_types/chains/definitions/skale/calypso.d.ts.map +1 -1
- package/_types/chains/definitions/skale/calypsoTestnet.d.ts +2 -0
- package/_types/chains/definitions/skale/calypsoTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/skale/cryptoBlades.d.ts +2 -0
- package/_types/chains/definitions/skale/cryptoBlades.d.ts.map +1 -1
- package/_types/chains/definitions/skale/cryptoColosseum.d.ts +2 -0
- package/_types/chains/definitions/skale/cryptoColosseum.d.ts.map +1 -1
- package/_types/chains/definitions/skale/europa.d.ts +2 -0
- package/_types/chains/definitions/skale/europa.d.ts.map +1 -1
- package/_types/chains/definitions/skale/europaTestnet.d.ts +2 -0
- package/_types/chains/definitions/skale/europaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/skale/exorde.d.ts +2 -0
- package/_types/chains/definitions/skale/exorde.d.ts.map +1 -1
- package/_types/chains/definitions/skale/humanProtocol.d.ts +2 -0
- package/_types/chains/definitions/skale/humanProtocol.d.ts.map +1 -1
- package/_types/chains/definitions/skale/nebula.d.ts +2 -0
- package/_types/chains/definitions/skale/nebula.d.ts.map +1 -1
- package/_types/chains/definitions/skale/nebulaTestnet.d.ts +2 -0
- package/_types/chains/definitions/skale/nebulaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/skale/razor.d.ts +2 -0
- package/_types/chains/definitions/skale/razor.d.ts.map +1 -1
- package/_types/chains/definitions/skale/skaleBase.d.ts +49 -0
- package/_types/chains/definitions/skale/skaleBase.d.ts.map +1 -0
- package/_types/chains/definitions/skale/skaleBaseSepoliaTestnet.d.ts +49 -0
- package/_types/chains/definitions/skale/skaleBaseSepoliaTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/skale/titan.d.ts +2 -0
- package/_types/chains/definitions/skale/titan.d.ts.map +1 -1
- package/_types/chains/definitions/skale/titanTestnet.d.ts +2 -0
- package/_types/chains/definitions/skale/titanTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/sketchpad.d.ts +2 -0
- package/_types/chains/definitions/sketchpad.d.ts.map +1 -1
- package/_types/chains/definitions/snax.d.ts +2 -0
- package/_types/chains/definitions/snax.d.ts.map +1 -1
- package/_types/chains/definitions/snaxTestnet.d.ts +2 -0
- package/_types/chains/definitions/snaxTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/somnia.d.ts +49 -0
- package/_types/chains/definitions/somnia.d.ts.map +1 -0
- package/_types/chains/definitions/somniaTestnet.d.ts +2 -0
- package/_types/chains/definitions/somniaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/soneium.d.ts +2 -0
- package/_types/chains/definitions/soneium.d.ts.map +1 -1
- package/_types/chains/definitions/soneiumMinato.d.ts +2 -0
- package/_types/chains/definitions/soneiumMinato.d.ts.map +1 -1
- package/_types/chains/definitions/songbird.d.ts +2 -0
- package/_types/chains/definitions/songbird.d.ts.map +1 -1
- package/_types/chains/definitions/songbirdTestnet.d.ts +2 -0
- package/_types/chains/definitions/songbirdTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/sonic.d.ts +2 -0
- package/_types/chains/definitions/sonic.d.ts.map +1 -1
- package/_types/chains/definitions/sonicBlazeTestnet.d.ts +2 -0
- package/_types/chains/definitions/sonicBlazeTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/sonicTestnet.d.ts +2 -0
- package/_types/chains/definitions/sonicTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/sophon.d.ts +2 -0
- package/_types/chains/definitions/sophon.d.ts.map +1 -1
- package/_types/chains/definitions/sophonTestnet.d.ts +2 -0
- package/_types/chains/definitions/sophonTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/sova.d.ts +2 -0
- package/_types/chains/definitions/sova.d.ts.map +1 -1
- package/_types/chains/definitions/sovaSepolia.d.ts +2 -0
- package/_types/chains/definitions/sovaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/spicy.d.ts +2 -0
- package/_types/chains/definitions/spicy.d.ts.map +1 -1
- package/_types/chains/definitions/stableTestnet.d.ts +2 -0
- package/_types/chains/definitions/stableTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/statusNetworkSepolia.d.ts +2 -0
- package/_types/chains/definitions/statusNetworkSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/step.d.ts +2 -0
- package/_types/chains/definitions/step.d.ts.map +1 -1
- package/_types/chains/definitions/story.d.ts +2 -0
- package/_types/chains/definitions/story.d.ts.map +1 -1
- package/_types/chains/definitions/storyAeneid.d.ts +2 -0
- package/_types/chains/definitions/storyAeneid.d.ts.map +1 -1
- package/_types/chains/definitions/storyOdyssey.d.ts +2 -0
- package/_types/chains/definitions/storyOdyssey.d.ts.map +1 -1
- package/_types/chains/definitions/storyTestnet.d.ts +2 -0
- package/_types/chains/definitions/storyTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/stratis.d.ts +2 -0
- package/_types/chains/definitions/stratis.d.ts.map +1 -1
- package/_types/chains/definitions/superlumio.d.ts +2 -0
- package/_types/chains/definitions/superlumio.d.ts.map +1 -1
- package/_types/chains/definitions/superposition.d.ts +2 -0
- package/_types/chains/definitions/superposition.d.ts.map +1 -1
- package/_types/chains/definitions/superseed.d.ts +2 -0
- package/_types/chains/definitions/superseed.d.ts.map +1 -1
- package/_types/chains/definitions/superseedSepolia.d.ts +2 -0
- package/_types/chains/definitions/superseedSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/surgeTestnet.d.ts +2 -0
- package/_types/chains/definitions/surgeTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/swan.d.ts +2 -0
- package/_types/chains/definitions/swan.d.ts.map +1 -1
- package/_types/chains/definitions/swanProximaTestnet.d.ts +2 -0
- package/_types/chains/definitions/swanProximaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/swanSaturnTestnet.d.ts +2 -0
- package/_types/chains/definitions/swanSaturnTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/swellchain.d.ts +2 -0
- package/_types/chains/definitions/swellchain.d.ts.map +1 -1
- package/_types/chains/definitions/swellchainTestnet.d.ts +2 -0
- package/_types/chains/definitions/swellchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/swissdlt.d.ts +2 -0
- package/_types/chains/definitions/swissdlt.d.ts.map +1 -1
- package/_types/chains/definitions/syscoin.d.ts +2 -0
- package/_types/chains/definitions/syscoin.d.ts.map +1 -1
- package/_types/chains/definitions/syscoinTestnet.d.ts +2 -0
- package/_types/chains/definitions/syscoinTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/tac.d.ts +2 -0
- package/_types/chains/definitions/tac.d.ts.map +1 -1
- package/_types/chains/definitions/tacSPB.d.ts +2 -0
- package/_types/chains/definitions/tacSPB.d.ts.map +1 -1
- package/_types/chains/definitions/taiko.d.ts +2 -0
- package/_types/chains/definitions/taiko.d.ts.map +1 -1
- package/_types/chains/definitions/taikoHekla.d.ts +2 -0
- package/_types/chains/definitions/taikoHekla.d.ts.map +1 -1
- package/_types/chains/definitions/taikoHoodi.d.ts +2 -0
- package/_types/chains/definitions/taikoHoodi.d.ts.map +1 -1
- package/_types/chains/definitions/taikoJolnir.d.ts +2 -0
- package/_types/chains/definitions/taikoJolnir.d.ts.map +1 -1
- package/_types/chains/definitions/taikoKatla.d.ts +2 -0
- package/_types/chains/definitions/taikoKatla.d.ts.map +1 -1
- package/_types/chains/definitions/taikoTestnetSepolia.d.ts +2 -0
- package/_types/chains/definitions/taikoTestnetSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/taraxa.d.ts +2 -0
- package/_types/chains/definitions/taraxa.d.ts.map +1 -1
- package/_types/chains/definitions/taraxaTestnet.d.ts +2 -0
- package/_types/chains/definitions/taraxaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/teaSepolia.d.ts +2 -0
- package/_types/chains/definitions/teaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/telcoinTestnet.d.ts +2 -0
- package/_types/chains/definitions/telcoinTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/telos.d.ts +2 -0
- package/_types/chains/definitions/telos.d.ts.map +1 -1
- package/_types/chains/definitions/telosTestnet.d.ts +2 -0
- package/_types/chains/definitions/telosTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoDevnet.d.ts +908 -0
- package/_types/chains/definitions/tempoDevnet.d.ts.map +1 -0
- package/_types/chains/definitions/tempoLocalnet.d.ts +906 -0
- package/_types/chains/definitions/tempoLocalnet.d.ts.map +1 -0
- package/_types/chains/definitions/tempoTestnet.d.ts +908 -0
- package/_types/chains/definitions/tempoTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/tenet.d.ts +2 -0
- package/_types/chains/definitions/tenet.d.ts.map +1 -1
- package/_types/chains/definitions/ternoa.d.ts +2 -0
- package/_types/chains/definitions/ternoa.d.ts.map +1 -1
- package/_types/chains/definitions/thaiChain.d.ts +2 -0
- package/_types/chains/definitions/thaiChain.d.ts.map +1 -1
- package/_types/chains/definitions/that.d.ts +2 -0
- package/_types/chains/definitions/that.d.ts.map +1 -1
- package/_types/chains/definitions/theta.d.ts +2 -0
- package/_types/chains/definitions/theta.d.ts.map +1 -1
- package/_types/chains/definitions/thetaTestnet.d.ts +2 -0
- package/_types/chains/definitions/thetaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/thunderCore.d.ts +2 -0
- package/_types/chains/definitions/thunderCore.d.ts.map +1 -1
- package/_types/chains/definitions/thunderTestnet.d.ts +2 -0
- package/_types/chains/definitions/thunderTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/tiktrixTestnet.d.ts +2 -0
- package/_types/chains/definitions/tiktrixTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/tomb.d.ts +2 -0
- package/_types/chains/definitions/tomb.d.ts.map +1 -1
- package/_types/chains/definitions/treasure.d.ts +2 -0
- package/_types/chains/definitions/treasure.d.ts.map +1 -1
- package/_types/chains/definitions/treasureTopaz.d.ts +2 -0
- package/_types/chains/definitions/treasureTopaz.d.ts.map +1 -1
- package/_types/chains/definitions/tron.d.ts +2 -0
- package/_types/chains/definitions/tron.d.ts.map +1 -1
- package/_types/chains/definitions/tronNile.d.ts +2 -0
- package/_types/chains/definitions/tronNile.d.ts.map +1 -1
- package/_types/chains/definitions/tronShasta.d.ts +2 -0
- package/_types/chains/definitions/tronShasta.d.ts.map +1 -1
- package/_types/chains/definitions/ubiq.d.ts +2 -0
- package/_types/chains/definitions/ubiq.d.ts.map +1 -1
- package/_types/chains/definitions/ultra.d.ts +2 -0
- package/_types/chains/definitions/ultra.d.ts.map +1 -1
- package/_types/chains/definitions/ultraTestnet.d.ts +2 -0
- package/_types/chains/definitions/ultraTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ultron.d.ts +2 -0
- package/_types/chains/definitions/ultron.d.ts.map +1 -1
- package/_types/chains/definitions/ultronTestnet.d.ts +2 -0
- package/_types/chains/definitions/ultronTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/unichain.d.ts +2 -0
- package/_types/chains/definitions/unichain.d.ts.map +1 -1
- package/_types/chains/definitions/unichainSepolia.d.ts +2 -0
- package/_types/chains/definitions/unichainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/unique.d.ts +2 -0
- package/_types/chains/definitions/unique.d.ts.map +1 -1
- package/_types/chains/definitions/uniqueOpal.d.ts +2 -0
- package/_types/chains/definitions/uniqueOpal.d.ts.map +1 -1
- package/_types/chains/definitions/uniqueQuartz.d.ts +2 -0
- package/_types/chains/definitions/uniqueQuartz.d.ts.map +1 -1
- package/_types/chains/definitions/unreal.d.ts +2 -0
- package/_types/chains/definitions/unreal.d.ts.map +1 -1
- package/_types/chains/definitions/vana.d.ts +2 -0
- package/_types/chains/definitions/vana.d.ts.map +1 -1
- package/_types/chains/definitions/vanaMoksha.d.ts +2 -0
- package/_types/chains/definitions/vanaMoksha.d.ts.map +1 -1
- package/_types/chains/definitions/vanar.d.ts +2 -0
- package/_types/chains/definitions/vanar.d.ts.map +1 -1
- package/_types/chains/definitions/vechain.d.ts +2 -0
- package/_types/chains/definitions/vechain.d.ts.map +1 -1
- package/_types/chains/definitions/velas.d.ts +2 -0
- package/_types/chains/definitions/velas.d.ts.map +1 -1
- package/_types/chains/definitions/viction.d.ts +2 -0
- package/_types/chains/definitions/viction.d.ts.map +1 -1
- package/_types/chains/definitions/victionTestnet.d.ts +2 -0
- package/_types/chains/definitions/victionTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/vision.d.ts +2 -0
- package/_types/chains/definitions/vision.d.ts.map +1 -1
- package/_types/chains/definitions/visionTestnet.d.ts +2 -0
- package/_types/chains/definitions/visionTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/wanchain.d.ts +2 -0
- package/_types/chains/definitions/wanchain.d.ts.map +1 -1
- package/_types/chains/definitions/wanchainTestnet.d.ts +2 -0
- package/_types/chains/definitions/wanchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/weavevmAlphanet.d.ts +2 -0
- package/_types/chains/definitions/weavevmAlphanet.d.ts.map +1 -1
- package/_types/chains/definitions/wemix.d.ts +2 -0
- package/_types/chains/definitions/wemix.d.ts.map +1 -1
- package/_types/chains/definitions/wemixTestnet.d.ts +2 -0
- package/_types/chains/definitions/wemixTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/westendAssetHub.d.ts +2 -0
- package/_types/chains/definitions/westendAssetHub.d.ts.map +1 -1
- package/_types/chains/definitions/whitechain.d.ts +2 -0
- package/_types/chains/definitions/whitechain.d.ts.map +1 -1
- package/_types/chains/definitions/whitechainTestnet.d.ts +2 -0
- package/_types/chains/definitions/whitechainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/wmcTestnet.d.ts +2 -0
- package/_types/chains/definitions/wmcTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/worldLand.d.ts +2 -0
- package/_types/chains/definitions/worldLand.d.ts.map +1 -1
- package/_types/chains/definitions/worldchain.d.ts +2 -0
- package/_types/chains/definitions/worldchain.d.ts.map +1 -1
- package/_types/chains/definitions/worldchainSepolia.d.ts +2 -0
- package/_types/chains/definitions/worldchainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/xLayer.d.ts +2 -0
- package/_types/chains/definitions/xLayer.d.ts.map +1 -1
- package/_types/chains/definitions/xLayerTestnet.d.ts +2 -0
- package/_types/chains/definitions/xLayerTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/xai.d.ts +2 -0
- package/_types/chains/definitions/xai.d.ts.map +1 -1
- package/_types/chains/definitions/xaiTestnet.d.ts +2 -0
- package/_types/chains/definitions/xaiTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/xdc.d.ts +2 -0
- package/_types/chains/definitions/xdc.d.ts.map +1 -1
- package/_types/chains/definitions/xdcTestnet.d.ts +2 -0
- package/_types/chains/definitions/xdcTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/xoneMainnet.d.ts +2 -0
- package/_types/chains/definitions/xoneMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/xoneTestnet.d.ts +2 -0
- package/_types/chains/definitions/xoneTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/xphereMainnet.d.ts +2 -0
- package/_types/chains/definitions/xphereMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/xphereTestnet.d.ts +2 -0
- package/_types/chains/definitions/xphereTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/xrOne.d.ts +2 -0
- package/_types/chains/definitions/xrOne.d.ts.map +1 -1
- package/_types/chains/definitions/xrSepolia.d.ts +2 -0
- package/_types/chains/definitions/xrSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/xrplevm.d.ts +2 -0
- package/_types/chains/definitions/xrplevm.d.ts.map +1 -1
- package/_types/chains/definitions/xrplevmDevnet.d.ts +2 -0
- package/_types/chains/definitions/xrplevmDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/xrplevmTestnet.d.ts +2 -0
- package/_types/chains/definitions/xrplevmTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/yooldoVerse.d.ts +2 -0
- package/_types/chains/definitions/yooldoVerse.d.ts.map +1 -1
- package/_types/chains/definitions/yooldoVerseTestnet.d.ts +2 -0
- package/_types/chains/definitions/yooldoVerseTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zenchainTestnet.d.ts +2 -0
- package/_types/chains/definitions/zenchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zeniq.d.ts +2 -0
- package/_types/chains/definitions/zeniq.d.ts.map +1 -1
- package/_types/chains/definitions/zeroNetwork.d.ts +2 -0
- package/_types/chains/definitions/zeroNetwork.d.ts.map +1 -1
- package/_types/chains/definitions/zetachain.d.ts +2 -0
- package/_types/chains/definitions/zetachain.d.ts.map +1 -1
- package/_types/chains/definitions/zetachainAthensTestnet.d.ts +2 -0
- package/_types/chains/definitions/zetachainAthensTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zhejiang.d.ts +2 -0
- package/_types/chains/definitions/zhejiang.d.ts.map +1 -1
- package/_types/chains/definitions/zilliqa.d.ts +2 -0
- package/_types/chains/definitions/zilliqa.d.ts.map +1 -1
- package/_types/chains/definitions/zilliqaTestnet.d.ts +2 -0
- package/_types/chains/definitions/zilliqaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zircuit.d.ts +2 -0
- package/_types/chains/definitions/zircuit.d.ts.map +1 -1
- package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts +2 -0
- package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zircuitTestnet.d.ts +2 -0
- package/_types/chains/definitions/zircuitTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zkFair.d.ts +2 -0
- package/_types/chains/definitions/zkFair.d.ts.map +1 -1
- package/_types/chains/definitions/zkFairTestnet.d.ts +2 -0
- package/_types/chains/definitions/zkFairTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zkLinkNova.d.ts +2 -0
- package/_types/chains/definitions/zkLinkNova.d.ts.map +1 -1
- package/_types/chains/definitions/zkLinkNovaSepoliaTestnet.d.ts +2 -0
- package/_types/chains/definitions/zkLinkNovaSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zksync.d.ts +2 -0
- package/_types/chains/definitions/zksync.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts +2 -0
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts +2 -0
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts +2 -0
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalHyperchainL1.d.ts +2 -0
- package/_types/chains/definitions/zksyncLocalHyperchainL1.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalNode.d.ts +2 -0
- package/_types/chains/definitions/zksyncLocalNode.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts +2 -0
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zora.d.ts +2 -0
- package/_types/chains/definitions/zora.d.ts.map +1 -1
- package/_types/chains/definitions/zoraSepolia.d.ts +2 -0
- package/_types/chains/definitions/zoraSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zoraTestnet.d.ts +2 -0
- package/_types/chains/definitions/zoraTestnet.d.ts.map +1 -1
- package/_types/chains/index.d.ts +7 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/node.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/op-stack/index.d.ts.map +1 -1
- package/_types/tempo/Abis.d.ts +2698 -0
- package/_types/tempo/Abis.d.ts.map +1 -0
- package/_types/tempo/Account.d.ts +236 -0
- package/_types/tempo/Account.d.ts.map +1 -0
- package/_types/tempo/Addresses.d.ts +9 -0
- package/_types/tempo/Addresses.d.ts.map +1 -0
- package/_types/tempo/Decorator.d.ts +2758 -0
- package/_types/tempo/Decorator.d.ts.map +1 -0
- package/_types/tempo/Formatters.d.ts +5 -0
- package/_types/tempo/Formatters.d.ts.map +1 -0
- package/_types/tempo/P256.d.ts +2 -0
- package/_types/tempo/P256.d.ts.map +1 -0
- package/_types/tempo/Secp256k1.d.ts +2 -0
- package/_types/tempo/Secp256k1.d.ts.map +1 -0
- package/_types/tempo/TokenIds.d.ts +2 -0
- package/_types/tempo/TokenIds.d.ts.map +1 -0
- package/_types/tempo/Transaction.d.ts +82 -0
- package/_types/tempo/Transaction.d.ts.map +1 -0
- package/_types/tempo/Transport.d.ts +39 -0
- package/_types/tempo/Transport.d.ts.map +1 -0
- package/_types/tempo/WebAuthnP256.d.ts +82 -0
- package/_types/tempo/WebAuthnP256.d.ts.map +1 -0
- package/_types/tempo/WebCryptoP256.d.ts +2 -0
- package/_types/tempo/WebCryptoP256.d.ts.map +1 -0
- package/_types/tempo/actions/amm.d.ts +1998 -0
- package/_types/tempo/actions/amm.d.ts.map +1 -0
- package/_types/tempo/actions/dex.d.ts +3898 -0
- package/_types/tempo/actions/dex.d.ts.map +1 -0
- package/_types/tempo/actions/faucet.d.ts +75 -0
- package/_types/tempo/actions/faucet.d.ts.map +1 -0
- package/_types/tempo/actions/fee.d.ts +369 -0
- package/_types/tempo/actions/fee.d.ts.map +1 -0
- package/_types/tempo/actions/index.d.ts +9 -0
- package/_types/tempo/actions/index.d.ts.map +1 -0
- package/_types/tempo/actions/nonce.d.ts +263 -0
- package/_types/tempo/actions/nonce.d.ts.map +1 -0
- package/_types/tempo/actions/policy.d.ts +1670 -0
- package/_types/tempo/actions/policy.d.ts.map +1 -0
- package/_types/tempo/actions/reward.d.ts +2440 -0
- package/_types/tempo/actions/reward.d.ts.map +1 -0
- package/_types/tempo/actions/token.d.ts +16067 -0
- package/_types/tempo/actions/token.d.ts.map +1 -0
- package/_types/tempo/chainConfig.d.ts +432 -0
- package/_types/tempo/chainConfig.d.ts.map +1 -0
- package/_types/tempo/index.d.ts +52 -0
- package/_types/tempo/index.d.ts.map +1 -0
- package/_types/tempo/internal/nonceKeyStore.d.ts +26 -0
- package/_types/tempo/internal/nonceKeyStore.d.ts.map +1 -0
- package/_types/tempo/internal/types.d.ts +13 -0
- package/_types/tempo/internal/types.d.ts.map +1 -0
- package/_types/tempo/internal/utils.d.ts +17 -0
- package/_types/tempo/internal/utils.d.ts.map +1 -0
- package/_types/types/chain.d.ts +11 -5
- package/_types/types/chain.d.ts.map +1 -1
- package/_types/types/contract.d.ts +12 -11
- package/_types/types/contract.d.ts.map +1 -1
- package/_types/types/utils.d.ts +1 -0
- package/_types/types/utils.d.ts.map +1 -1
- package/_types/utils/abi/decodeAbiParameters.d.ts +2 -2
- package/_types/utils/abi/decodeAbiParameters.d.ts.map +1 -1
- package/_types/utils/abi/decodeEventLog.d.ts.map +1 -1
- package/_types/utils/abi/encodeAbiParameters.d.ts +2 -2
- package/_types/utils/abi/encodeAbiParameters.d.ts.map +1 -1
- package/_types/utils/chain/defineChain.d.ts +5 -1
- package/_types/utils/chain/defineChain.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts.map +1 -1
- package/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.ts +2 -2
- package/account-abstraction/accounts/implementations/toSimple7702SmartAccount.ts +72 -26
- package/actions/getContract.ts +4 -4
- package/actions/public/simulateContract.ts +4 -4
- package/actions/public/verifyHash.ts +9 -4
- package/actions/wallet/prepareTransactionRequest.ts +12 -7
- package/chains/definitions/birdlayer.ts +1 -1
- package/chains/definitions/bob.ts +1 -1
- package/chains/definitions/bobSepolia.ts +1 -1
- package/chains/definitions/crab.ts +1 -1
- package/chains/definitions/creatorTestnet.ts +1 -1
- package/chains/definitions/datahavenTestnet.ts +26 -0
- package/chains/definitions/dodochainTestnet.ts +1 -1
- package/chains/definitions/funkiSepolia.ts +1 -1
- package/chains/definitions/garnet.ts +1 -1
- package/chains/definitions/koi.ts +1 -1
- package/chains/definitions/omni.ts +1 -1
- package/chains/definitions/pyrope.ts +1 -1
- package/chains/definitions/redstone.ts +1 -1
- package/chains/definitions/skale/skaleBase.ts +20 -0
- package/chains/definitions/skale/skaleBaseSepoliaTestnet.ts +22 -0
- package/chains/definitions/somnia.ts +20 -0
- package/chains/definitions/tempoDevnet.ts +19 -0
- package/chains/definitions/tempoLocalnet.ts +16 -0
- package/chains/definitions/tempoTestnet.ts +25 -0
- package/chains/index.ts +7 -0
- package/errors/node.ts +1 -1
- package/errors/version.ts +1 -1
- package/index.ts +5 -1
- package/op-stack/index.ts +0 -1
- package/package.json +19 -3
- package/tempo/Abis.ts +1716 -0
- package/tempo/Account.ts +574 -0
- package/tempo/Addresses.ts +9 -0
- package/tempo/Decorator.ts +3150 -0
- package/tempo/Formatters.ts +159 -0
- package/tempo/P256.ts +2 -0
- package/tempo/Secp256k1.ts +2 -0
- package/tempo/TokenIds.ts +1 -0
- package/tempo/Transaction.ts +392 -0
- package/tempo/Transport.ts +202 -0
- package/tempo/WebAuthnP256.ts +146 -0
- package/tempo/WebCryptoP256.ts +2 -0
- package/tempo/actions/amm.ts +1221 -0
- package/tempo/actions/dex.ts +2150 -0
- package/tempo/actions/faucet.ts +119 -0
- package/tempo/actions/fee.ts +366 -0
- package/tempo/actions/index.ts +9 -0
- package/tempo/actions/nonce.ts +345 -0
- package/tempo/actions/package.json +6 -0
- package/tempo/actions/policy.ts +1329 -0
- package/tempo/actions/reward.ts +940 -0
- package/tempo/actions/token.ts +4456 -0
- package/tempo/chainConfig.ts +114 -0
- package/tempo/index.ts +59 -0
- package/tempo/internal/nonceKeyStore.ts +50 -0
- package/tempo/internal/types.ts +55 -0
- package/tempo/internal/utils.ts +57 -0
- package/tempo/package.json +6 -0
- package/types/chain.ts +18 -5
- package/types/contract.ts +42 -12
- package/types/utils.ts +2 -0
- package/utils/abi/decodeAbiParameters.ts +9 -3
- package/utils/abi/decodeEventLog.ts +4 -1
- package/utils/abi/encodeAbiParameters.ts +2 -1
- package/utils/chain/defineChain.ts +32 -2
- package/utils/formatters/transaction.ts +2 -3
|
@@ -0,0 +1,4456 @@
|
|
|
1
|
+
import type { Address } from 'abitype'
|
|
2
|
+
import * as Hex from 'ox/Hex'
|
|
3
|
+
import { TokenId, TokenRole } from 'ox/tempo'
|
|
4
|
+
import type { Account } from '../../accounts/types.js'
|
|
5
|
+
import { parseAccount } from '../../accounts/utils/parseAccount.js'
|
|
6
|
+
import { multicall } from '../../actions/public/multicall.js'
|
|
7
|
+
import type { ReadContractReturnType } from '../../actions/public/readContract.js'
|
|
8
|
+
import { readContract } from '../../actions/public/readContract.js'
|
|
9
|
+
import type {
|
|
10
|
+
WatchContractEventParameters,
|
|
11
|
+
WatchContractEventReturnType,
|
|
12
|
+
} from '../../actions/public/watchContractEvent.js'
|
|
13
|
+
import { watchContractEvent } from '../../actions/public/watchContractEvent.js'
|
|
14
|
+
import { sendTransaction } from '../../actions/wallet/sendTransaction.js'
|
|
15
|
+
import {
|
|
16
|
+
type SendTransactionSyncParameters,
|
|
17
|
+
sendTransactionSync,
|
|
18
|
+
} from '../../actions/wallet/sendTransactionSync.js'
|
|
19
|
+
import type { WriteContractReturnType } from '../../actions/wallet/writeContract.js'
|
|
20
|
+
import { writeContract } from '../../actions/wallet/writeContract.js'
|
|
21
|
+
import { writeContractSync } from '../../actions/wallet/writeContractSync.js'
|
|
22
|
+
import type { Client } from '../../clients/createClient.js'
|
|
23
|
+
import type { Transport } from '../../clients/transports/createTransport.js'
|
|
24
|
+
import type { BaseErrorType } from '../../errors/base.js'
|
|
25
|
+
import type { Chain } from '../../types/chain.js'
|
|
26
|
+
import type { ExtractAbiItem, GetEventArgs } from '../../types/contract.js'
|
|
27
|
+
import type { Log, Log as viem_Log } from '../../types/log.js'
|
|
28
|
+
import type { Compute, OneOf, UnionOmit } from '../../types/utils.js'
|
|
29
|
+
import { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js'
|
|
30
|
+
import { parseEventLogs } from '../../utils/abi/parseEventLogs.js'
|
|
31
|
+
import * as Abis from '../Abis.js'
|
|
32
|
+
import * as Addresses from '../Addresses.js'
|
|
33
|
+
import type {
|
|
34
|
+
GetAccountParameter,
|
|
35
|
+
ReadParameters,
|
|
36
|
+
WriteParameters,
|
|
37
|
+
} from '../internal/types.js'
|
|
38
|
+
import { defineCall } from '../internal/utils.js'
|
|
39
|
+
import type { TransactionReceipt } from '../Transaction.js'
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Approves a spender to transfer TIP20 tokens on behalf of the caller.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { createClient, http } from 'viem'
|
|
47
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
48
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
49
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
50
|
+
*
|
|
51
|
+
* const client = createClient({
|
|
52
|
+
* account: privateKeyToAccount('0x...'),
|
|
53
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
54
|
+
* transport: http(),
|
|
55
|
+
* })
|
|
56
|
+
*
|
|
57
|
+
* const result = await Actions.token.approve(client, {
|
|
58
|
+
* spender: '0x...',
|
|
59
|
+
* amount: 100n,
|
|
60
|
+
* })
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @param client - Client.
|
|
64
|
+
* @param parameters - Parameters.
|
|
65
|
+
* @returns The transaction hash.
|
|
66
|
+
*/
|
|
67
|
+
export async function approve<
|
|
68
|
+
chain extends Chain | undefined,
|
|
69
|
+
account extends Account | undefined,
|
|
70
|
+
>(
|
|
71
|
+
client: Client<Transport, chain, account>,
|
|
72
|
+
parameters: approve.Parameters<chain, account>,
|
|
73
|
+
): Promise<approve.ReturnValue> {
|
|
74
|
+
const { token, ...rest } = parameters
|
|
75
|
+
return approve.inner(writeContract, client, parameters, { ...rest, token })
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export namespace approve {
|
|
79
|
+
export type Parameters<
|
|
80
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
81
|
+
account extends Account | undefined = Account | undefined,
|
|
82
|
+
> = WriteParameters<chain, account> & Args
|
|
83
|
+
|
|
84
|
+
export type Args = {
|
|
85
|
+
/** Amount of tokens to approve. */
|
|
86
|
+
amount: bigint
|
|
87
|
+
/** Address of the spender. */
|
|
88
|
+
spender: Address
|
|
89
|
+
/** Address or ID of the TIP20 token. */
|
|
90
|
+
token: TokenId.TokenIdOrAddress
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type ReturnValue = WriteContractReturnType
|
|
94
|
+
|
|
95
|
+
// TODO: exhaustive error type
|
|
96
|
+
export type ErrorType = BaseErrorType
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
export async function inner<
|
|
100
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
101
|
+
chain extends Chain | undefined,
|
|
102
|
+
account extends Account | undefined,
|
|
103
|
+
>(
|
|
104
|
+
action: action,
|
|
105
|
+
client: Client<Transport, chain, account>,
|
|
106
|
+
parameters: approve.Parameters<chain, account>,
|
|
107
|
+
args: Args,
|
|
108
|
+
): Promise<ReturnType<action>> {
|
|
109
|
+
const call = approve.call(args)
|
|
110
|
+
return (await action(client, {
|
|
111
|
+
...parameters,
|
|
112
|
+
...call,
|
|
113
|
+
} as never)) as never
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Defines a call to the `approve` function.
|
|
118
|
+
*
|
|
119
|
+
* Can be passed as a parameter to:
|
|
120
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
121
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
122
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
127
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
128
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
129
|
+
*
|
|
130
|
+
* const client = createClient({
|
|
131
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
132
|
+
* transport: http(),
|
|
133
|
+
* }).extend(walletActions)
|
|
134
|
+
*
|
|
135
|
+
* const { result } = await client.sendCalls({
|
|
136
|
+
* calls: [
|
|
137
|
+
* actions.token.approve.call({
|
|
138
|
+
* spender: '0x20c0...beef',
|
|
139
|
+
* amount: 100n,
|
|
140
|
+
* token: '0x20c0...babe',
|
|
141
|
+
* }),
|
|
142
|
+
* ]
|
|
143
|
+
* })
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @param args - Arguments.
|
|
147
|
+
* @returns The call.
|
|
148
|
+
*/
|
|
149
|
+
export function call(args: Args) {
|
|
150
|
+
const { spender, amount, token } = args
|
|
151
|
+
return defineCall({
|
|
152
|
+
address: TokenId.toAddress(token),
|
|
153
|
+
abi: Abis.tip20,
|
|
154
|
+
functionName: 'approve',
|
|
155
|
+
args: [spender, amount],
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function extractEvent(logs: Log[]) {
|
|
160
|
+
const [log] = parseEventLogs({
|
|
161
|
+
abi: Abis.tip20,
|
|
162
|
+
logs,
|
|
163
|
+
eventName: 'Approval',
|
|
164
|
+
})
|
|
165
|
+
if (!log) throw new Error('`Approval` event not found.')
|
|
166
|
+
return log
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Approves a spender to transfer TIP20 tokens on behalf of the caller.
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* import { createClient, http } from 'viem'
|
|
176
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
177
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
178
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
179
|
+
*
|
|
180
|
+
* const client = createClient({
|
|
181
|
+
* account: privateKeyToAccount('0x...'),
|
|
182
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
183
|
+
* transport: http(),
|
|
184
|
+
* })
|
|
185
|
+
*
|
|
186
|
+
* const result = await Actions.token.approveSync(client, {
|
|
187
|
+
* spender: '0x...',
|
|
188
|
+
* amount: 100n,
|
|
189
|
+
* })
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* @param client - Client.
|
|
193
|
+
* @param parameters - Parameters.
|
|
194
|
+
* @returns The transaction receipt and event data.
|
|
195
|
+
*/
|
|
196
|
+
export async function approveSync<
|
|
197
|
+
chain extends Chain | undefined,
|
|
198
|
+
account extends Account | undefined,
|
|
199
|
+
>(
|
|
200
|
+
client: Client<Transport, chain, account>,
|
|
201
|
+
parameters: approveSync.Parameters<chain, account>,
|
|
202
|
+
): Promise<approveSync.ReturnValue> {
|
|
203
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
204
|
+
const receipt = await approve.inner(
|
|
205
|
+
writeContractSync,
|
|
206
|
+
client,
|
|
207
|
+
{ ...parameters, throwOnReceiptRevert } as never,
|
|
208
|
+
rest,
|
|
209
|
+
)
|
|
210
|
+
const { args } = approve.extractEvent(receipt.logs)
|
|
211
|
+
return {
|
|
212
|
+
...args,
|
|
213
|
+
receipt,
|
|
214
|
+
} as never
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export namespace approveSync {
|
|
218
|
+
export type Parameters<
|
|
219
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
220
|
+
account extends Account | undefined = Account | undefined,
|
|
221
|
+
> = approve.Parameters<chain, account>
|
|
222
|
+
|
|
223
|
+
export type Args = approve.Args
|
|
224
|
+
|
|
225
|
+
export type ReturnValue = Compute<
|
|
226
|
+
GetEventArgs<
|
|
227
|
+
typeof Abis.tip20,
|
|
228
|
+
'Approval',
|
|
229
|
+
{
|
|
230
|
+
IndexedOnly: false
|
|
231
|
+
Required: true
|
|
232
|
+
}
|
|
233
|
+
> & {
|
|
234
|
+
/** Transaction receipt. */
|
|
235
|
+
receipt: TransactionReceipt
|
|
236
|
+
}
|
|
237
|
+
>
|
|
238
|
+
|
|
239
|
+
// TODO: exhaustive error type
|
|
240
|
+
export type ErrorType = BaseErrorType
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Burns TIP20 tokens from a blocked address.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```ts
|
|
248
|
+
* import { createClient, http } from 'viem'
|
|
249
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
250
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
251
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
252
|
+
*
|
|
253
|
+
* const client = createClient({
|
|
254
|
+
* account: privateKeyToAccount('0x...'),
|
|
255
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
256
|
+
* transport: http(),
|
|
257
|
+
* })
|
|
258
|
+
*
|
|
259
|
+
* const result = await Actions.token.burnBlocked(client, {
|
|
260
|
+
* from: '0x...',
|
|
261
|
+
* amount: 100n,
|
|
262
|
+
* token: '0x...',
|
|
263
|
+
* })
|
|
264
|
+
* ```
|
|
265
|
+
*
|
|
266
|
+
* @param client - Client.
|
|
267
|
+
* @param parameters - Parameters.
|
|
268
|
+
* @returns The transaction hash.
|
|
269
|
+
*/
|
|
270
|
+
export async function burnBlocked<
|
|
271
|
+
chain extends Chain | undefined,
|
|
272
|
+
account extends Account | undefined,
|
|
273
|
+
>(
|
|
274
|
+
client: Client<Transport, chain, account>,
|
|
275
|
+
parameters: burnBlocked.Parameters<chain, account>,
|
|
276
|
+
): Promise<burnBlocked.ReturnValue> {
|
|
277
|
+
return burnBlocked.inner(writeContract, client, parameters)
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export namespace burnBlocked {
|
|
281
|
+
export type Parameters<
|
|
282
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
283
|
+
account extends Account | undefined = Account | undefined,
|
|
284
|
+
> = WriteParameters<chain, account> & Args
|
|
285
|
+
|
|
286
|
+
export type Args = {
|
|
287
|
+
/** Amount of tokens to burn. */
|
|
288
|
+
amount: bigint
|
|
289
|
+
/** Address to burn tokens from. */
|
|
290
|
+
from: Address
|
|
291
|
+
/** Address or ID of the TIP20 token. */
|
|
292
|
+
token: TokenId.TokenIdOrAddress
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export type ReturnValue = WriteContractReturnType
|
|
296
|
+
|
|
297
|
+
// TODO: exhaustive error type
|
|
298
|
+
export type ErrorType = BaseErrorType
|
|
299
|
+
|
|
300
|
+
/** @internal */
|
|
301
|
+
export async function inner<
|
|
302
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
303
|
+
chain extends Chain | undefined,
|
|
304
|
+
account extends Account | undefined,
|
|
305
|
+
>(
|
|
306
|
+
action: action,
|
|
307
|
+
client: Client<Transport, chain, account>,
|
|
308
|
+
parameters: burnBlocked.Parameters<chain, account>,
|
|
309
|
+
): Promise<ReturnType<action>> {
|
|
310
|
+
const { amount, from, token, ...rest } = parameters
|
|
311
|
+
const call = burnBlocked.call({ amount, from, token })
|
|
312
|
+
return (await action(client, {
|
|
313
|
+
...rest,
|
|
314
|
+
...call,
|
|
315
|
+
} as never)) as never
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Defines a call to the `burnBlocked` function.
|
|
320
|
+
*
|
|
321
|
+
* Can be passed as a parameter to:
|
|
322
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
323
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
324
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```ts
|
|
328
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
329
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
330
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
331
|
+
*
|
|
332
|
+
* const client = createClient({
|
|
333
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
334
|
+
* transport: http(),
|
|
335
|
+
* }).extend(walletActions)
|
|
336
|
+
*
|
|
337
|
+
* const { result } = await client.sendCalls({
|
|
338
|
+
* calls: [
|
|
339
|
+
* actions.token.burnBlocked.call({
|
|
340
|
+
* from: '0x20c0...beef',
|
|
341
|
+
* amount: 100n,
|
|
342
|
+
* token: '0x20c0...babe',
|
|
343
|
+
* }),
|
|
344
|
+
* ]
|
|
345
|
+
* })
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* @param args - Arguments.
|
|
349
|
+
* @returns The call.
|
|
350
|
+
*/
|
|
351
|
+
export function call(args: Args) {
|
|
352
|
+
const { from, amount, token } = args
|
|
353
|
+
return defineCall({
|
|
354
|
+
address: TokenId.toAddress(token),
|
|
355
|
+
abi: Abis.tip20,
|
|
356
|
+
functionName: 'burnBlocked',
|
|
357
|
+
args: [from, amount],
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Extracts the event from the logs.
|
|
363
|
+
*
|
|
364
|
+
* @param logs - Logs.
|
|
365
|
+
* @returns The event.
|
|
366
|
+
*/
|
|
367
|
+
export function extractEvent(logs: Log[]) {
|
|
368
|
+
const [log] = parseEventLogs({
|
|
369
|
+
abi: Abis.tip20,
|
|
370
|
+
logs,
|
|
371
|
+
eventName: 'BurnBlocked',
|
|
372
|
+
})
|
|
373
|
+
if (!log) throw new Error('`BurnBlocked` event not found.')
|
|
374
|
+
return log
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Burns TIP20 tokens from a blocked address.
|
|
380
|
+
*
|
|
381
|
+
* @example
|
|
382
|
+
* ```ts
|
|
383
|
+
* import { createClient, http } from 'viem'
|
|
384
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
385
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
386
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
387
|
+
*
|
|
388
|
+
* const client = createClient({
|
|
389
|
+
* account: privateKeyToAccount('0x...'),
|
|
390
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
391
|
+
* transport: http(),
|
|
392
|
+
* })
|
|
393
|
+
*
|
|
394
|
+
* const result = await Actions.token.burnBlockedSync(client, {
|
|
395
|
+
* from: '0x...',
|
|
396
|
+
* amount: 100n,
|
|
397
|
+
* token: '0x...',
|
|
398
|
+
* })
|
|
399
|
+
* ```
|
|
400
|
+
*
|
|
401
|
+
* @param client - Client.
|
|
402
|
+
* @param parameters - Parameters.
|
|
403
|
+
* @returns The transaction receipt and event data.
|
|
404
|
+
*/
|
|
405
|
+
export async function burnBlockedSync<
|
|
406
|
+
chain extends Chain | undefined,
|
|
407
|
+
account extends Account | undefined,
|
|
408
|
+
>(
|
|
409
|
+
client: Client<Transport, chain, account>,
|
|
410
|
+
parameters: burnBlockedSync.Parameters<chain, account>,
|
|
411
|
+
): Promise<burnBlockedSync.ReturnValue> {
|
|
412
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
413
|
+
const receipt = await burnBlocked.inner(writeContractSync, client, {
|
|
414
|
+
...rest,
|
|
415
|
+
throwOnReceiptRevert,
|
|
416
|
+
} as never)
|
|
417
|
+
const { args } = burnBlocked.extractEvent(receipt.logs)
|
|
418
|
+
return {
|
|
419
|
+
...args,
|
|
420
|
+
receipt,
|
|
421
|
+
} as never
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export namespace burnBlockedSync {
|
|
425
|
+
export type Parameters<
|
|
426
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
427
|
+
account extends Account | undefined = Account | undefined,
|
|
428
|
+
> = burnBlocked.Parameters<chain, account>
|
|
429
|
+
|
|
430
|
+
export type Args = burnBlocked.Args
|
|
431
|
+
|
|
432
|
+
export type ReturnValue = Compute<
|
|
433
|
+
GetEventArgs<
|
|
434
|
+
typeof Abis.tip20,
|
|
435
|
+
'BurnBlocked',
|
|
436
|
+
{
|
|
437
|
+
IndexedOnly: false
|
|
438
|
+
Required: true
|
|
439
|
+
}
|
|
440
|
+
> & {
|
|
441
|
+
/** Transaction receipt. */
|
|
442
|
+
receipt: TransactionReceipt
|
|
443
|
+
}
|
|
444
|
+
>
|
|
445
|
+
|
|
446
|
+
// TODO: exhaustive error type
|
|
447
|
+
export type ErrorType = BaseErrorType
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Burns TIP20 tokens from the caller's balance.
|
|
452
|
+
*
|
|
453
|
+
* @example
|
|
454
|
+
* ```ts
|
|
455
|
+
* import { createClient, http } from 'viem'
|
|
456
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
457
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
458
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
459
|
+
*
|
|
460
|
+
* const client = createClient({
|
|
461
|
+
* account: privateKeyToAccount('0x...'),
|
|
462
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
463
|
+
* transport: http(),
|
|
464
|
+
* })
|
|
465
|
+
*
|
|
466
|
+
* const result = await Actions.token.burn(client, {
|
|
467
|
+
* amount: 100n,
|
|
468
|
+
* token: '0x...',
|
|
469
|
+
* })
|
|
470
|
+
* ```
|
|
471
|
+
*
|
|
472
|
+
* @param client - Client.
|
|
473
|
+
* @param parameters - Parameters.
|
|
474
|
+
* @returns The transaction hash.
|
|
475
|
+
*/
|
|
476
|
+
export async function burn<
|
|
477
|
+
chain extends Chain | undefined,
|
|
478
|
+
account extends Account | undefined,
|
|
479
|
+
>(
|
|
480
|
+
client: Client<Transport, chain, account>,
|
|
481
|
+
parameters: burn.Parameters<chain, account>,
|
|
482
|
+
): Promise<burn.ReturnValue> {
|
|
483
|
+
return burn.inner(writeContract, client, parameters)
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export namespace burn {
|
|
487
|
+
export type Parameters<
|
|
488
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
489
|
+
account extends Account | undefined = Account | undefined,
|
|
490
|
+
> = WriteParameters<chain, account> & Args
|
|
491
|
+
|
|
492
|
+
export type Args = {
|
|
493
|
+
/** Amount of tokens to burn. */
|
|
494
|
+
amount: bigint
|
|
495
|
+
/** Memo to include in the transfer. */
|
|
496
|
+
memo?: Hex.Hex | undefined
|
|
497
|
+
/** Address or ID of the TIP20 token. */
|
|
498
|
+
token: TokenId.TokenIdOrAddress
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export type ReturnValue = WriteContractReturnType
|
|
502
|
+
|
|
503
|
+
// TODO: exhaustive error type
|
|
504
|
+
export type ErrorType = BaseErrorType
|
|
505
|
+
|
|
506
|
+
/** @internal */
|
|
507
|
+
export async function inner<
|
|
508
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
509
|
+
chain extends Chain | undefined,
|
|
510
|
+
account extends Account | undefined,
|
|
511
|
+
>(
|
|
512
|
+
action: action,
|
|
513
|
+
client: Client<Transport, chain, account>,
|
|
514
|
+
parameters: burn.Parameters<chain, account>,
|
|
515
|
+
): Promise<ReturnType<action>> {
|
|
516
|
+
const { amount, memo, token, ...rest } = parameters
|
|
517
|
+
const call = burn.call({ amount, memo, token })
|
|
518
|
+
return (await action(client, {
|
|
519
|
+
...rest,
|
|
520
|
+
...call,
|
|
521
|
+
} as never)) as never
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Defines a call to the `burn` or `burnWithMemo` function.
|
|
526
|
+
*
|
|
527
|
+
* Can be passed as a parameter to:
|
|
528
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
529
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
530
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
531
|
+
*
|
|
532
|
+
* @example
|
|
533
|
+
* ```ts
|
|
534
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
535
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
536
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
537
|
+
*
|
|
538
|
+
* const client = createClient({
|
|
539
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
540
|
+
* transport: http(),
|
|
541
|
+
* }).extend(walletActions)
|
|
542
|
+
*
|
|
543
|
+
* const { result } = await client.sendCalls({
|
|
544
|
+
* calls: [
|
|
545
|
+
* actions.token.burn.call({
|
|
546
|
+
* amount: 100n,
|
|
547
|
+
* token: '0x20c0...babe',
|
|
548
|
+
* }),
|
|
549
|
+
* ]
|
|
550
|
+
* })
|
|
551
|
+
* ```
|
|
552
|
+
*
|
|
553
|
+
* @param args - Arguments.
|
|
554
|
+
* @returns The call.
|
|
555
|
+
*/
|
|
556
|
+
export function call(args: Args) {
|
|
557
|
+
const { amount, memo, token } = args
|
|
558
|
+
const callArgs = memo
|
|
559
|
+
? ({
|
|
560
|
+
functionName: 'burnWithMemo',
|
|
561
|
+
args: [amount, Hex.padLeft(memo, 32)],
|
|
562
|
+
} as const)
|
|
563
|
+
: ({
|
|
564
|
+
functionName: 'burn',
|
|
565
|
+
args: [amount],
|
|
566
|
+
} as const)
|
|
567
|
+
return defineCall({
|
|
568
|
+
address: TokenId.toAddress(token),
|
|
569
|
+
abi: Abis.tip20,
|
|
570
|
+
...callArgs,
|
|
571
|
+
})
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Extracts the event from the logs.
|
|
576
|
+
*
|
|
577
|
+
* @param logs - Logs.
|
|
578
|
+
* @returns The event.
|
|
579
|
+
*/
|
|
580
|
+
export function extractEvent(logs: Log[]) {
|
|
581
|
+
const [log] = parseEventLogs({
|
|
582
|
+
abi: Abis.tip20,
|
|
583
|
+
logs,
|
|
584
|
+
eventName: 'Burn',
|
|
585
|
+
})
|
|
586
|
+
if (!log) throw new Error('`Burn` event not found.')
|
|
587
|
+
return log
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Burns TIP20 tokens from the caller's balance.
|
|
593
|
+
*
|
|
594
|
+
* @example
|
|
595
|
+
* ```ts
|
|
596
|
+
* import { createClient, http } from 'viem'
|
|
597
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
598
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
599
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
600
|
+
*
|
|
601
|
+
* const client = createClient({
|
|
602
|
+
* account: privateKeyToAccount('0x...'),
|
|
603
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
604
|
+
* transport: http(),
|
|
605
|
+
* })
|
|
606
|
+
*
|
|
607
|
+
* const result = await Actions.token.burnSync(client, {
|
|
608
|
+
* amount: 100n,
|
|
609
|
+
* token: '0x...',
|
|
610
|
+
* })
|
|
611
|
+
* ```
|
|
612
|
+
*
|
|
613
|
+
* @param client - Client.
|
|
614
|
+
* @param parameters - Parameters.
|
|
615
|
+
* @returns The transaction receipt and event data.
|
|
616
|
+
*/
|
|
617
|
+
export async function burnSync<
|
|
618
|
+
chain extends Chain | undefined,
|
|
619
|
+
account extends Account | undefined,
|
|
620
|
+
>(
|
|
621
|
+
client: Client<Transport, chain, account>,
|
|
622
|
+
parameters: burnSync.Parameters<chain, account>,
|
|
623
|
+
): Promise<burnSync.ReturnValue> {
|
|
624
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
625
|
+
const receipt = await burn.inner(writeContractSync, client, {
|
|
626
|
+
...rest,
|
|
627
|
+
throwOnReceiptRevert,
|
|
628
|
+
} as never)
|
|
629
|
+
const { args } = burn.extractEvent(receipt.logs)
|
|
630
|
+
return {
|
|
631
|
+
...args,
|
|
632
|
+
receipt,
|
|
633
|
+
} as never
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export namespace burnSync {
|
|
637
|
+
export type Parameters<
|
|
638
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
639
|
+
account extends Account | undefined = Account | undefined,
|
|
640
|
+
> = burn.Parameters<chain, account>
|
|
641
|
+
|
|
642
|
+
export type Args = burn.Args
|
|
643
|
+
|
|
644
|
+
export type ReturnValue = Compute<
|
|
645
|
+
GetEventArgs<
|
|
646
|
+
typeof Abis.tip20,
|
|
647
|
+
'Burn',
|
|
648
|
+
{
|
|
649
|
+
IndexedOnly: false
|
|
650
|
+
Required: true
|
|
651
|
+
}
|
|
652
|
+
> & {
|
|
653
|
+
receipt: TransactionReceipt
|
|
654
|
+
}
|
|
655
|
+
>
|
|
656
|
+
|
|
657
|
+
// TODO: exhaustive error type
|
|
658
|
+
export type ErrorType = BaseErrorType
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Changes the transfer policy ID for a TIP20 token.
|
|
663
|
+
*
|
|
664
|
+
* @example
|
|
665
|
+
* ```ts
|
|
666
|
+
* import { createClient, http } from 'viem'
|
|
667
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
668
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
669
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
670
|
+
*
|
|
671
|
+
* const client = createClient({
|
|
672
|
+
* account: privateKeyToAccount('0x...'),
|
|
673
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
674
|
+
* transport: http(),
|
|
675
|
+
* })
|
|
676
|
+
*
|
|
677
|
+
* const result = await Actions.token.changeTransferPolicy(client, {
|
|
678
|
+
* token: '0x...',
|
|
679
|
+
* policyId: 1n,
|
|
680
|
+
* })
|
|
681
|
+
* ```
|
|
682
|
+
*
|
|
683
|
+
* @param client - Client.
|
|
684
|
+
* @param parameters - Parameters.
|
|
685
|
+
* @returns The transaction hash.
|
|
686
|
+
*/
|
|
687
|
+
export async function changeTransferPolicy<
|
|
688
|
+
chain extends Chain | undefined,
|
|
689
|
+
account extends Account | undefined,
|
|
690
|
+
>(
|
|
691
|
+
client: Client<Transport, chain, account>,
|
|
692
|
+
parameters: changeTransferPolicy.Parameters<chain, account>,
|
|
693
|
+
): Promise<changeTransferPolicy.ReturnValue> {
|
|
694
|
+
return changeTransferPolicy.inner(writeContract, client, parameters)
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
export namespace changeTransferPolicy {
|
|
698
|
+
export type Parameters<
|
|
699
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
700
|
+
account extends Account | undefined = Account | undefined,
|
|
701
|
+
> = WriteParameters<chain, account> & Args
|
|
702
|
+
|
|
703
|
+
export type Args = {
|
|
704
|
+
/** New transfer policy ID. */
|
|
705
|
+
policyId: bigint
|
|
706
|
+
/** Address or ID of the TIP20 token. */
|
|
707
|
+
token: TokenId.TokenIdOrAddress
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
export type ReturnValue = WriteContractReturnType
|
|
711
|
+
|
|
712
|
+
// TODO: exhaustive error type
|
|
713
|
+
export type ErrorType = BaseErrorType
|
|
714
|
+
|
|
715
|
+
/** @internal */
|
|
716
|
+
export async function inner<
|
|
717
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
718
|
+
chain extends Chain | undefined,
|
|
719
|
+
account extends Account | undefined,
|
|
720
|
+
>(
|
|
721
|
+
action: action,
|
|
722
|
+
client: Client<Transport, chain, account>,
|
|
723
|
+
parameters: changeTransferPolicy.Parameters<chain, account>,
|
|
724
|
+
): Promise<ReturnType<action>> {
|
|
725
|
+
const { policyId, token, ...rest } = parameters
|
|
726
|
+
const call = changeTransferPolicy.call({ policyId, token })
|
|
727
|
+
return (await action(client, {
|
|
728
|
+
...rest,
|
|
729
|
+
...call,
|
|
730
|
+
} as never)) as never
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Defines a call to the `changeTransferPolicyId` function.
|
|
735
|
+
*
|
|
736
|
+
* Can be passed as a parameter to:
|
|
737
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
738
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
739
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
740
|
+
*
|
|
741
|
+
* @example
|
|
742
|
+
* ```ts
|
|
743
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
744
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
745
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
746
|
+
*
|
|
747
|
+
* const client = createClient({
|
|
748
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
749
|
+
* transport: http(),
|
|
750
|
+
* }).extend(walletActions)
|
|
751
|
+
*
|
|
752
|
+
* const { result } = await client.sendCalls({
|
|
753
|
+
* calls: [
|
|
754
|
+
* actions.token.changeTransferPolicy.call({
|
|
755
|
+
* token: '0x20c0...babe',
|
|
756
|
+
* policyId: 1n,
|
|
757
|
+
* }),
|
|
758
|
+
* ]
|
|
759
|
+
* })
|
|
760
|
+
* ```
|
|
761
|
+
*
|
|
762
|
+
* @param args - Arguments.
|
|
763
|
+
* @returns The call.
|
|
764
|
+
*/
|
|
765
|
+
export function call(args: Args) {
|
|
766
|
+
const { token, policyId } = args
|
|
767
|
+
return defineCall({
|
|
768
|
+
address: TokenId.toAddress(token),
|
|
769
|
+
abi: Abis.tip20,
|
|
770
|
+
functionName: 'changeTransferPolicyId',
|
|
771
|
+
args: [policyId],
|
|
772
|
+
})
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Extracts the event from the logs.
|
|
777
|
+
*
|
|
778
|
+
* @param logs - Logs.
|
|
779
|
+
* @returns The event.
|
|
780
|
+
*/
|
|
781
|
+
export function extractEvent(logs: Log[]) {
|
|
782
|
+
const [log] = parseEventLogs({
|
|
783
|
+
abi: Abis.tip20,
|
|
784
|
+
logs,
|
|
785
|
+
eventName: 'TransferPolicyUpdate',
|
|
786
|
+
})
|
|
787
|
+
if (!log) throw new Error('`TransferPolicyUpdate` event not found.')
|
|
788
|
+
return log
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Changes the transfer policy ID for a TIP20 token.
|
|
794
|
+
*
|
|
795
|
+
* @example
|
|
796
|
+
* ```ts
|
|
797
|
+
* import { createClient, http } from 'viem'
|
|
798
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
799
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
800
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
801
|
+
*
|
|
802
|
+
* const client = createClient({
|
|
803
|
+
* account: privateKeyToAccount('0x...'),
|
|
804
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
805
|
+
* transport: http(),
|
|
806
|
+
* })
|
|
807
|
+
*
|
|
808
|
+
* const result = await Actions.token.changeTransferPolicySync(client, {
|
|
809
|
+
* token: '0x...',
|
|
810
|
+
* policyId: 1n,
|
|
811
|
+
* })
|
|
812
|
+
* ```
|
|
813
|
+
*
|
|
814
|
+
* @param client - Client.
|
|
815
|
+
* @param parameters - Parameters.
|
|
816
|
+
* @returns The transaction receipt and event data.
|
|
817
|
+
*/
|
|
818
|
+
export async function changeTransferPolicySync<
|
|
819
|
+
chain extends Chain | undefined,
|
|
820
|
+
account extends Account | undefined,
|
|
821
|
+
>(
|
|
822
|
+
client: Client<Transport, chain, account>,
|
|
823
|
+
parameters: changeTransferPolicySync.Parameters<chain, account>,
|
|
824
|
+
): Promise<changeTransferPolicySync.ReturnValue> {
|
|
825
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
826
|
+
const receipt = await changeTransferPolicy.inner(writeContractSync, client, {
|
|
827
|
+
...rest,
|
|
828
|
+
throwOnReceiptRevert,
|
|
829
|
+
} as never)
|
|
830
|
+
const { args } = changeTransferPolicy.extractEvent(receipt.logs)
|
|
831
|
+
return {
|
|
832
|
+
...args,
|
|
833
|
+
receipt,
|
|
834
|
+
} as never
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
export namespace changeTransferPolicySync {
|
|
838
|
+
export type Parameters<
|
|
839
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
840
|
+
account extends Account | undefined = Account | undefined,
|
|
841
|
+
> = changeTransferPolicy.Parameters<chain, account>
|
|
842
|
+
|
|
843
|
+
export type Args = changeTransferPolicy.Args
|
|
844
|
+
|
|
845
|
+
export type ReturnValue = Compute<
|
|
846
|
+
GetEventArgs<
|
|
847
|
+
typeof Abis.tip20,
|
|
848
|
+
'TransferPolicyUpdate',
|
|
849
|
+
{
|
|
850
|
+
IndexedOnly: false
|
|
851
|
+
Required: true
|
|
852
|
+
}
|
|
853
|
+
> & {
|
|
854
|
+
receipt: TransactionReceipt
|
|
855
|
+
}
|
|
856
|
+
>
|
|
857
|
+
|
|
858
|
+
// TODO: exhaustive error type
|
|
859
|
+
export type ErrorType = BaseErrorType
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Creates a new TIP20 token.
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
* ```ts
|
|
867
|
+
* import { createClient, http } from 'viem'
|
|
868
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
869
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
870
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
871
|
+
*
|
|
872
|
+
* const client = createClient({
|
|
873
|
+
* account: privateKeyToAccount('0x...'),
|
|
874
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
875
|
+
* transport: http(),
|
|
876
|
+
* })
|
|
877
|
+
*
|
|
878
|
+
* const result = await Actions.token.create(client, {
|
|
879
|
+
* name: 'My Token',
|
|
880
|
+
* symbol: 'MTK',
|
|
881
|
+
* currency: 'USD',
|
|
882
|
+
* })
|
|
883
|
+
* ```
|
|
884
|
+
*
|
|
885
|
+
* @param client - Client.
|
|
886
|
+
* @param parameters - Parameters.
|
|
887
|
+
* @returns The transaction hash.
|
|
888
|
+
*/
|
|
889
|
+
export async function create<
|
|
890
|
+
chain extends Chain | undefined,
|
|
891
|
+
account extends Account | undefined,
|
|
892
|
+
>(
|
|
893
|
+
client: Client<Transport, chain, account>,
|
|
894
|
+
parameters: create.Parameters<chain, account>,
|
|
895
|
+
): Promise<create.ReturnValue> {
|
|
896
|
+
return create.inner(writeContract, client, parameters)
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
export namespace create {
|
|
900
|
+
export type Parameters<
|
|
901
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
902
|
+
account extends Account | undefined = Account | undefined,
|
|
903
|
+
> = WriteParameters<chain, account> &
|
|
904
|
+
Omit<Args, 'admin'> &
|
|
905
|
+
(account extends Account
|
|
906
|
+
? { admin?: Account | Address | undefined }
|
|
907
|
+
: { admin: Account | Address })
|
|
908
|
+
|
|
909
|
+
export type Args = {
|
|
910
|
+
/** Admin address. */
|
|
911
|
+
admin: Address
|
|
912
|
+
/** Currency (e.g. "USD"). */
|
|
913
|
+
currency: string
|
|
914
|
+
/** Token name. */
|
|
915
|
+
name: string
|
|
916
|
+
/** quote token. */
|
|
917
|
+
quoteToken?: TokenId.TokenIdOrAddress | undefined
|
|
918
|
+
/** Token symbol. */
|
|
919
|
+
symbol: string
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
export type ReturnValue = WriteContractReturnType
|
|
923
|
+
|
|
924
|
+
// TODO: exhaustive error type
|
|
925
|
+
export type ErrorType = BaseErrorType
|
|
926
|
+
|
|
927
|
+
/** @internal */
|
|
928
|
+
export async function inner<
|
|
929
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
930
|
+
chain extends Chain | undefined,
|
|
931
|
+
account extends Account | undefined,
|
|
932
|
+
>(
|
|
933
|
+
action: action,
|
|
934
|
+
client: Client<Transport, chain, account>,
|
|
935
|
+
parameters: any,
|
|
936
|
+
): Promise<ReturnType<action>> {
|
|
937
|
+
const {
|
|
938
|
+
account = client.account,
|
|
939
|
+
admin: admin_ = client.account,
|
|
940
|
+
chain = client.chain,
|
|
941
|
+
...rest
|
|
942
|
+
} = parameters
|
|
943
|
+
const admin = admin_ ? parseAccount(admin_) : undefined
|
|
944
|
+
if (!admin) throw new Error('admin is required.')
|
|
945
|
+
|
|
946
|
+
const call = create.call({ ...rest, admin: admin.address })
|
|
947
|
+
|
|
948
|
+
return (await action(
|
|
949
|
+
client as never,
|
|
950
|
+
{
|
|
951
|
+
...parameters,
|
|
952
|
+
account,
|
|
953
|
+
chain,
|
|
954
|
+
...call,
|
|
955
|
+
} as never,
|
|
956
|
+
)) as never
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* Defines a call to the `createToken` function.
|
|
961
|
+
*
|
|
962
|
+
* Can be passed as a parameter to:
|
|
963
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
964
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
965
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
966
|
+
*
|
|
967
|
+
* @example
|
|
968
|
+
* ```ts
|
|
969
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
970
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
971
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
972
|
+
*
|
|
973
|
+
* const client = createClient({
|
|
974
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
975
|
+
* transport: http(),
|
|
976
|
+
* }).extend(walletActions)
|
|
977
|
+
*
|
|
978
|
+
* const { result } = await client.sendCalls({
|
|
979
|
+
* calls: [
|
|
980
|
+
* actions.token.create.call({
|
|
981
|
+
* name: 'My Token',
|
|
982
|
+
* symbol: 'MTK',
|
|
983
|
+
* currency: 'USD',
|
|
984
|
+
* admin: '0xfeed...fede',
|
|
985
|
+
* }),
|
|
986
|
+
* ]
|
|
987
|
+
* })
|
|
988
|
+
* ```
|
|
989
|
+
*
|
|
990
|
+
* @param args - Arguments.
|
|
991
|
+
* @returns The call.
|
|
992
|
+
*/
|
|
993
|
+
export function call(args: Args) {
|
|
994
|
+
const {
|
|
995
|
+
name,
|
|
996
|
+
symbol,
|
|
997
|
+
currency,
|
|
998
|
+
quoteToken = Addresses.pathUsd,
|
|
999
|
+
admin,
|
|
1000
|
+
} = args
|
|
1001
|
+
return defineCall({
|
|
1002
|
+
address: Addresses.tip20Factory,
|
|
1003
|
+
abi: Abis.tip20Factory,
|
|
1004
|
+
args: [name, symbol, currency, TokenId.toAddress(quoteToken), admin],
|
|
1005
|
+
functionName: 'createToken',
|
|
1006
|
+
})
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Extracts the `TokenCreated` event from logs.
|
|
1011
|
+
*
|
|
1012
|
+
* @param logs - The logs.
|
|
1013
|
+
* @returns The `TokenCreated` event.
|
|
1014
|
+
*/
|
|
1015
|
+
export function extractEvent(logs: Log[]) {
|
|
1016
|
+
const [log] = parseEventLogs({
|
|
1017
|
+
abi: Abis.tip20Factory,
|
|
1018
|
+
logs,
|
|
1019
|
+
eventName: 'TokenCreated',
|
|
1020
|
+
strict: true,
|
|
1021
|
+
})
|
|
1022
|
+
if (!log) throw new Error('`TokenCreated` event not found.')
|
|
1023
|
+
return log
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Creates a new TIP20 token.
|
|
1029
|
+
*
|
|
1030
|
+
* @example
|
|
1031
|
+
* ```ts
|
|
1032
|
+
* import { createClient, http } from 'viem'
|
|
1033
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1034
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1035
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1036
|
+
*
|
|
1037
|
+
* const client = createClient({
|
|
1038
|
+
* account: privateKeyToAccount('0x...'),
|
|
1039
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1040
|
+
* transport: http(),
|
|
1041
|
+
* })
|
|
1042
|
+
*
|
|
1043
|
+
* const result = await Actions.token.createSync(client, {
|
|
1044
|
+
* name: 'My Token',
|
|
1045
|
+
* symbol: 'MTK',
|
|
1046
|
+
* currency: 'USD',
|
|
1047
|
+
* })
|
|
1048
|
+
* ```
|
|
1049
|
+
*
|
|
1050
|
+
* @param client - Client.
|
|
1051
|
+
* @param parameters - Parameters.
|
|
1052
|
+
* @returns The transaction receipt and event data.
|
|
1053
|
+
*/
|
|
1054
|
+
export async function createSync<
|
|
1055
|
+
chain extends Chain | undefined,
|
|
1056
|
+
account extends Account | undefined,
|
|
1057
|
+
>(
|
|
1058
|
+
client: Client<Transport, chain, account>,
|
|
1059
|
+
parameters: createSync.Parameters<chain, account>,
|
|
1060
|
+
): Promise<createSync.ReturnValue> {
|
|
1061
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
1062
|
+
const receipt = await create.inner(writeContractSync, client, {
|
|
1063
|
+
...rest,
|
|
1064
|
+
throwOnReceiptRevert,
|
|
1065
|
+
} as never)
|
|
1066
|
+
|
|
1067
|
+
const { args } = create.extractEvent(receipt.logs)
|
|
1068
|
+
|
|
1069
|
+
return {
|
|
1070
|
+
...args,
|
|
1071
|
+
receipt,
|
|
1072
|
+
} as never
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
export namespace createSync {
|
|
1076
|
+
export type Parameters<
|
|
1077
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
1078
|
+
account extends Account | undefined = Account | undefined,
|
|
1079
|
+
> = create.Parameters<chain, account>
|
|
1080
|
+
|
|
1081
|
+
export type Args = create.Args
|
|
1082
|
+
|
|
1083
|
+
export type ReturnValue = Compute<
|
|
1084
|
+
GetEventArgs<
|
|
1085
|
+
typeof Abis.tip20Factory,
|
|
1086
|
+
'TokenCreated',
|
|
1087
|
+
{ IndexedOnly: false; Required: true }
|
|
1088
|
+
> & {
|
|
1089
|
+
/** Transaction receipt. */
|
|
1090
|
+
receipt: TransactionReceipt
|
|
1091
|
+
}
|
|
1092
|
+
>
|
|
1093
|
+
|
|
1094
|
+
// TODO: exhaustive error type
|
|
1095
|
+
export type ErrorType = BaseErrorType
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* Gets TIP20 token allowance.
|
|
1100
|
+
*
|
|
1101
|
+
* @example
|
|
1102
|
+
* ```ts
|
|
1103
|
+
* import { createClient, http } from 'viem'
|
|
1104
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1105
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1106
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1107
|
+
*
|
|
1108
|
+
* const client = createClient({
|
|
1109
|
+
* account: privateKeyToAccount('0x...'),
|
|
1110
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1111
|
+
* transport: http(),
|
|
1112
|
+
* })
|
|
1113
|
+
*
|
|
1114
|
+
* const allowance = await Actions.token.getAllowance(client, {
|
|
1115
|
+
* spender: '0x...',
|
|
1116
|
+
* })
|
|
1117
|
+
* ```
|
|
1118
|
+
*
|
|
1119
|
+
* @param client - Client.
|
|
1120
|
+
* @param parameters - Parameters.
|
|
1121
|
+
* @returns The token allowance.
|
|
1122
|
+
*/
|
|
1123
|
+
export async function getAllowance<
|
|
1124
|
+
chain extends Chain | undefined,
|
|
1125
|
+
account extends Account | undefined,
|
|
1126
|
+
>(
|
|
1127
|
+
client: Client<Transport, chain, account>,
|
|
1128
|
+
parameters: getAllowance.Parameters<account>,
|
|
1129
|
+
): Promise<getAllowance.ReturnValue> {
|
|
1130
|
+
const { account = client.account } = parameters
|
|
1131
|
+
const address = account ? parseAccount(account).address : undefined
|
|
1132
|
+
if (!address) throw new Error('account is required.')
|
|
1133
|
+
return readContract(client, {
|
|
1134
|
+
...parameters,
|
|
1135
|
+
...getAllowance.call({ ...parameters, account: address }),
|
|
1136
|
+
})
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
export namespace getAllowance {
|
|
1140
|
+
export type Parameters<
|
|
1141
|
+
account extends Account | undefined = Account | undefined,
|
|
1142
|
+
> = ReadParameters & GetAccountParameter<account> & Omit<Args, 'account'> & {}
|
|
1143
|
+
|
|
1144
|
+
export type Args = {
|
|
1145
|
+
/** Account address. */
|
|
1146
|
+
account: Address
|
|
1147
|
+
/** Address of the spender. */
|
|
1148
|
+
spender: Address
|
|
1149
|
+
/** Address or ID of the TIP20 token. */
|
|
1150
|
+
token: TokenId.TokenIdOrAddress
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
export type ReturnValue = ReadContractReturnType<
|
|
1154
|
+
typeof Abis.tip20,
|
|
1155
|
+
'allowance',
|
|
1156
|
+
never
|
|
1157
|
+
>
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* Defines a call to the `allowance` function.
|
|
1161
|
+
*
|
|
1162
|
+
* @param args - Arguments.
|
|
1163
|
+
* @returns The call.
|
|
1164
|
+
*/
|
|
1165
|
+
export function call(args: Args) {
|
|
1166
|
+
const { account, spender, token } = args
|
|
1167
|
+
return defineCall({
|
|
1168
|
+
address: TokenId.toAddress(token),
|
|
1169
|
+
abi: Abis.tip20,
|
|
1170
|
+
functionName: 'allowance',
|
|
1171
|
+
args: [account, spender],
|
|
1172
|
+
})
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Gets TIP20 token balance for an address.
|
|
1178
|
+
*
|
|
1179
|
+
* @example
|
|
1180
|
+
* ```ts
|
|
1181
|
+
* import { createClient, http } from 'viem'
|
|
1182
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1183
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1184
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1185
|
+
*
|
|
1186
|
+
* const client = createClient({
|
|
1187
|
+
* account: privateKeyToAccount('0x...'),
|
|
1188
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1189
|
+
* transport: http(),
|
|
1190
|
+
* })
|
|
1191
|
+
*
|
|
1192
|
+
* const balance = await Actions.token.getBalance(client, {
|
|
1193
|
+
* token: '0x...',
|
|
1194
|
+
* })
|
|
1195
|
+
* ```
|
|
1196
|
+
*
|
|
1197
|
+
* @param client - Client.
|
|
1198
|
+
* @param parameters - Parameters.
|
|
1199
|
+
* @returns The token balance.
|
|
1200
|
+
*/
|
|
1201
|
+
export async function getBalance<
|
|
1202
|
+
chain extends Chain | undefined,
|
|
1203
|
+
account extends Account | undefined,
|
|
1204
|
+
>(
|
|
1205
|
+
client: Client<Transport, chain, account>,
|
|
1206
|
+
parameters: getBalance.Parameters<account>,
|
|
1207
|
+
): Promise<getBalance.ReturnValue> {
|
|
1208
|
+
const { account = client.account, ...rest } = parameters
|
|
1209
|
+
const address = account ? parseAccount(account).address : undefined
|
|
1210
|
+
if (!address) throw new Error('account is required.')
|
|
1211
|
+
return readContract(client, {
|
|
1212
|
+
...rest,
|
|
1213
|
+
...getBalance.call({ account: address, ...rest }),
|
|
1214
|
+
})
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export namespace getBalance {
|
|
1218
|
+
export type Parameters<
|
|
1219
|
+
account extends Account | undefined = Account | undefined,
|
|
1220
|
+
> = ReadParameters & GetAccountParameter<account> & Omit<Args, 'account'>
|
|
1221
|
+
|
|
1222
|
+
export type Args = {
|
|
1223
|
+
/** Account address. */
|
|
1224
|
+
account: Address
|
|
1225
|
+
/** Address or ID of the TIP20 token. */
|
|
1226
|
+
token: TokenId.TokenIdOrAddress
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
export type ReturnValue = ReadContractReturnType<
|
|
1230
|
+
typeof Abis.tip20,
|
|
1231
|
+
'balanceOf',
|
|
1232
|
+
never
|
|
1233
|
+
>
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* Defines a call to the `balanceOf` function.
|
|
1237
|
+
*
|
|
1238
|
+
* @param args - Arguments.
|
|
1239
|
+
* @returns The call.
|
|
1240
|
+
*/
|
|
1241
|
+
export function call(args: Args) {
|
|
1242
|
+
const { account, token } = args
|
|
1243
|
+
return defineCall({
|
|
1244
|
+
address: TokenId.toAddress(token),
|
|
1245
|
+
abi: Abis.tip20,
|
|
1246
|
+
functionName: 'balanceOf',
|
|
1247
|
+
args: [account],
|
|
1248
|
+
})
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Gets TIP20 token metadata including name, symbol, currency, decimals, and total supply.
|
|
1254
|
+
*
|
|
1255
|
+
* @example
|
|
1256
|
+
* ```ts
|
|
1257
|
+
* import { createClient, http } from 'viem'
|
|
1258
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1259
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1260
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1261
|
+
*
|
|
1262
|
+
* const client = createClient({
|
|
1263
|
+
* account: privateKeyToAccount('0x...'),
|
|
1264
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1265
|
+
* transport: http(),
|
|
1266
|
+
* })
|
|
1267
|
+
*
|
|
1268
|
+
* const metadata = await Actions.token.getMetadata(client, {
|
|
1269
|
+
* token: '0x...',
|
|
1270
|
+
* })
|
|
1271
|
+
* ```
|
|
1272
|
+
*
|
|
1273
|
+
* @param client - Client.
|
|
1274
|
+
* @param parameters - Parameters.
|
|
1275
|
+
* @returns The token metadata.
|
|
1276
|
+
*/
|
|
1277
|
+
export async function getMetadata<chain extends Chain | undefined>(
|
|
1278
|
+
client: Client<Transport, chain>,
|
|
1279
|
+
parameters: getMetadata.Parameters,
|
|
1280
|
+
): Promise<getMetadata.ReturnValue> {
|
|
1281
|
+
const { token, ...rest } = parameters
|
|
1282
|
+
const address = TokenId.toAddress(token)
|
|
1283
|
+
const abi = Abis.tip20
|
|
1284
|
+
|
|
1285
|
+
if (TokenId.from(token) === TokenId.fromAddress(Addresses.pathUsd))
|
|
1286
|
+
return multicall(client, {
|
|
1287
|
+
...rest,
|
|
1288
|
+
contracts: [
|
|
1289
|
+
{
|
|
1290
|
+
address,
|
|
1291
|
+
abi,
|
|
1292
|
+
functionName: 'currency',
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
address,
|
|
1296
|
+
abi,
|
|
1297
|
+
functionName: 'decimals',
|
|
1298
|
+
},
|
|
1299
|
+
{
|
|
1300
|
+
address,
|
|
1301
|
+
abi,
|
|
1302
|
+
functionName: 'name',
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
address,
|
|
1306
|
+
abi,
|
|
1307
|
+
functionName: 'symbol',
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
address,
|
|
1311
|
+
abi,
|
|
1312
|
+
functionName: 'totalSupply',
|
|
1313
|
+
},
|
|
1314
|
+
] as const,
|
|
1315
|
+
allowFailure: false,
|
|
1316
|
+
deployless: true,
|
|
1317
|
+
}).then(([currency, decimals, name, symbol, totalSupply]) => ({
|
|
1318
|
+
name,
|
|
1319
|
+
symbol,
|
|
1320
|
+
currency,
|
|
1321
|
+
decimals,
|
|
1322
|
+
totalSupply,
|
|
1323
|
+
}))
|
|
1324
|
+
|
|
1325
|
+
return multicall(client, {
|
|
1326
|
+
...rest,
|
|
1327
|
+
contracts: [
|
|
1328
|
+
{
|
|
1329
|
+
address,
|
|
1330
|
+
abi,
|
|
1331
|
+
functionName: 'currency',
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
address,
|
|
1335
|
+
abi,
|
|
1336
|
+
functionName: 'decimals',
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
address,
|
|
1340
|
+
abi,
|
|
1341
|
+
functionName: 'quoteToken',
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
address,
|
|
1345
|
+
abi,
|
|
1346
|
+
functionName: 'name',
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
address,
|
|
1350
|
+
abi,
|
|
1351
|
+
functionName: 'paused',
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
address,
|
|
1355
|
+
abi,
|
|
1356
|
+
functionName: 'supplyCap',
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
address,
|
|
1360
|
+
abi,
|
|
1361
|
+
functionName: 'symbol',
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
address,
|
|
1365
|
+
abi,
|
|
1366
|
+
functionName: 'totalSupply',
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
address,
|
|
1370
|
+
abi,
|
|
1371
|
+
functionName: 'transferPolicyId',
|
|
1372
|
+
},
|
|
1373
|
+
] as const,
|
|
1374
|
+
allowFailure: false,
|
|
1375
|
+
deployless: true,
|
|
1376
|
+
}).then(
|
|
1377
|
+
([
|
|
1378
|
+
currency,
|
|
1379
|
+
decimals,
|
|
1380
|
+
quoteToken,
|
|
1381
|
+
name,
|
|
1382
|
+
paused,
|
|
1383
|
+
supplyCap,
|
|
1384
|
+
symbol,
|
|
1385
|
+
totalSupply,
|
|
1386
|
+
transferPolicyId,
|
|
1387
|
+
]) => ({
|
|
1388
|
+
name,
|
|
1389
|
+
symbol,
|
|
1390
|
+
currency,
|
|
1391
|
+
decimals,
|
|
1392
|
+
quoteToken,
|
|
1393
|
+
totalSupply,
|
|
1394
|
+
paused,
|
|
1395
|
+
supplyCap,
|
|
1396
|
+
transferPolicyId,
|
|
1397
|
+
}),
|
|
1398
|
+
)
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
export declare namespace getMetadata {
|
|
1402
|
+
export type Parameters = {
|
|
1403
|
+
/** Address or ID of the TIP20 token. */
|
|
1404
|
+
token: TokenId.TokenIdOrAddress
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
export type ReturnValue = Compute<{
|
|
1408
|
+
/**
|
|
1409
|
+
* Currency (e.g. "USD").
|
|
1410
|
+
*/
|
|
1411
|
+
currency: string
|
|
1412
|
+
/**
|
|
1413
|
+
* Decimals of the token.
|
|
1414
|
+
*/
|
|
1415
|
+
decimals: number
|
|
1416
|
+
/**
|
|
1417
|
+
* Quote token.
|
|
1418
|
+
*
|
|
1419
|
+
* Returns `undefined` for the default quote token (`0x20c...0000`).
|
|
1420
|
+
*/
|
|
1421
|
+
quoteToken?: Address | undefined
|
|
1422
|
+
/**
|
|
1423
|
+
* Name of the token.
|
|
1424
|
+
*/
|
|
1425
|
+
name: string
|
|
1426
|
+
/**
|
|
1427
|
+
* Whether the token is paused.
|
|
1428
|
+
*
|
|
1429
|
+
* Returns `undefined` for the default quote token (`0x20c...0000`).
|
|
1430
|
+
*/
|
|
1431
|
+
paused?: boolean | undefined
|
|
1432
|
+
/**
|
|
1433
|
+
* Supply cap.
|
|
1434
|
+
*
|
|
1435
|
+
* Returns `undefined` for the default quote token (`0x20c...0000`).
|
|
1436
|
+
*/
|
|
1437
|
+
supplyCap?: bigint | undefined
|
|
1438
|
+
/**
|
|
1439
|
+
* Symbol of the token.
|
|
1440
|
+
*/
|
|
1441
|
+
symbol: string
|
|
1442
|
+
/**
|
|
1443
|
+
* Total supply of the token.
|
|
1444
|
+
*/
|
|
1445
|
+
totalSupply: bigint
|
|
1446
|
+
/**
|
|
1447
|
+
* Transfer policy ID.
|
|
1448
|
+
* 0="always-reject", 1="always-allow", >2=custom policy
|
|
1449
|
+
*
|
|
1450
|
+
* Returns `undefined` for the default quote token (`0x20c...0000`).
|
|
1451
|
+
*/
|
|
1452
|
+
transferPolicyId?: bigint | undefined
|
|
1453
|
+
}>
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* Gets the admin role for a specific role in a TIP20 token.
|
|
1458
|
+
*
|
|
1459
|
+
* @example
|
|
1460
|
+
* ```ts
|
|
1461
|
+
* import { createClient, http } from 'viem'
|
|
1462
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1463
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1464
|
+
*
|
|
1465
|
+
* const client = createClient({
|
|
1466
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1467
|
+
* transport: http(),
|
|
1468
|
+
* })
|
|
1469
|
+
*
|
|
1470
|
+
* const adminRole = await Actions.token.getRoleAdmin(client, {
|
|
1471
|
+
* role: 'issuer',
|
|
1472
|
+
* token: '0x...',
|
|
1473
|
+
* })
|
|
1474
|
+
* ```
|
|
1475
|
+
*
|
|
1476
|
+
* @param client - Client.
|
|
1477
|
+
* @param parameters - Parameters.
|
|
1478
|
+
* @returns The admin role hash.
|
|
1479
|
+
*/
|
|
1480
|
+
export async function getRoleAdmin<chain extends Chain | undefined>(
|
|
1481
|
+
client: Client<Transport, chain>,
|
|
1482
|
+
parameters: getRoleAdmin.Parameters,
|
|
1483
|
+
): Promise<getRoleAdmin.ReturnValue> {
|
|
1484
|
+
return readContract(client, {
|
|
1485
|
+
...parameters,
|
|
1486
|
+
...getRoleAdmin.call(parameters),
|
|
1487
|
+
})
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
export namespace getRoleAdmin {
|
|
1491
|
+
export type Parameters = ReadParameters & Args
|
|
1492
|
+
|
|
1493
|
+
export type Args = {
|
|
1494
|
+
/** Role to get admin for. */
|
|
1495
|
+
role: TokenRole.TokenRole
|
|
1496
|
+
/** Address or ID of the TIP20 token. */
|
|
1497
|
+
token: TokenId.TokenIdOrAddress
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
export type ReturnValue = ReadContractReturnType<
|
|
1501
|
+
typeof Abis.tip20,
|
|
1502
|
+
'getRoleAdmin',
|
|
1503
|
+
never
|
|
1504
|
+
>
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* Defines a call to the `getRoleAdmin` function.
|
|
1508
|
+
*
|
|
1509
|
+
* @param args - Arguments.
|
|
1510
|
+
* @returns The call.
|
|
1511
|
+
*/
|
|
1512
|
+
export function call(args: Args) {
|
|
1513
|
+
const { role, token } = args
|
|
1514
|
+
return defineCall({
|
|
1515
|
+
address: TokenId.toAddress(token),
|
|
1516
|
+
abi: Abis.tip20,
|
|
1517
|
+
functionName: 'getRoleAdmin',
|
|
1518
|
+
args: [TokenRole.serialize(role)],
|
|
1519
|
+
})
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
/**
|
|
1524
|
+
* Checks if an account has a specific role for a TIP20 token.
|
|
1525
|
+
*
|
|
1526
|
+
* @example
|
|
1527
|
+
* ```ts
|
|
1528
|
+
* import { createClient, http } from 'viem'
|
|
1529
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1530
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1531
|
+
*
|
|
1532
|
+
* const client = createClient({
|
|
1533
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1534
|
+
* transport: http(),
|
|
1535
|
+
* })
|
|
1536
|
+
*
|
|
1537
|
+
* const hasRole = await Actions.token.hasRole(client, {
|
|
1538
|
+
* account: '0x...',
|
|
1539
|
+
* role: 'issuer',
|
|
1540
|
+
* token: '0x...',
|
|
1541
|
+
* })
|
|
1542
|
+
* ```
|
|
1543
|
+
*
|
|
1544
|
+
* @param client - Client.
|
|
1545
|
+
* @param parameters - Parameters.
|
|
1546
|
+
* @returns Whether the account has the role.
|
|
1547
|
+
*/
|
|
1548
|
+
export async function hasRole<
|
|
1549
|
+
chain extends Chain | undefined,
|
|
1550
|
+
account extends Account | undefined,
|
|
1551
|
+
>(
|
|
1552
|
+
client: Client<Transport, chain, account>,
|
|
1553
|
+
parameters: hasRole.Parameters<account>,
|
|
1554
|
+
): Promise<hasRole.ReturnValue> {
|
|
1555
|
+
const { account = client.account } = parameters
|
|
1556
|
+
const address = account ? parseAccount(account).address : undefined
|
|
1557
|
+
if (!address) throw new Error('account is required.')
|
|
1558
|
+
return readContract(client, {
|
|
1559
|
+
...parameters,
|
|
1560
|
+
...hasRole.call({ ...parameters, account: address }),
|
|
1561
|
+
})
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
export namespace hasRole {
|
|
1565
|
+
export type Parameters<
|
|
1566
|
+
account extends Account | undefined = Account | undefined,
|
|
1567
|
+
> = ReadParameters & Omit<Args, 'account'> & GetAccountParameter<account>
|
|
1568
|
+
|
|
1569
|
+
export type Args = {
|
|
1570
|
+
/** Account address to check. */
|
|
1571
|
+
account: Address
|
|
1572
|
+
/** Role to check. */
|
|
1573
|
+
role: TokenRole.TokenRole
|
|
1574
|
+
/** Address or ID of the TIP20 token. */
|
|
1575
|
+
token: TokenId.TokenIdOrAddress
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
export type ReturnValue = ReadContractReturnType<
|
|
1579
|
+
typeof Abis.tip20,
|
|
1580
|
+
'hasRole',
|
|
1581
|
+
never
|
|
1582
|
+
>
|
|
1583
|
+
|
|
1584
|
+
/**
|
|
1585
|
+
* Defines a call to the `hasRole` function.
|
|
1586
|
+
*
|
|
1587
|
+
* @param args - Arguments.
|
|
1588
|
+
* @returns The call.
|
|
1589
|
+
*/
|
|
1590
|
+
export function call(args: Args) {
|
|
1591
|
+
const { account, role, token } = args
|
|
1592
|
+
return defineCall({
|
|
1593
|
+
address: TokenId.toAddress(token),
|
|
1594
|
+
abi: Abis.tip20,
|
|
1595
|
+
functionName: 'hasRole',
|
|
1596
|
+
args: [account, TokenRole.serialize(role)],
|
|
1597
|
+
})
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* Grants a role for a TIP20 token.
|
|
1603
|
+
*
|
|
1604
|
+
* @example
|
|
1605
|
+
* ```ts
|
|
1606
|
+
* import { createClient, http } from 'viem'
|
|
1607
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1608
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1609
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1610
|
+
*
|
|
1611
|
+
* const client = createClient({
|
|
1612
|
+
* account: privateKeyToAccount('0x...'),
|
|
1613
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1614
|
+
* transport: http(),
|
|
1615
|
+
* })
|
|
1616
|
+
*
|
|
1617
|
+
* const result = await Actions.token.grantRoles(client, {
|
|
1618
|
+
* token: '0x...',
|
|
1619
|
+
* to: '0x...',
|
|
1620
|
+
* roles: ['issuer'],
|
|
1621
|
+
* })
|
|
1622
|
+
* ```
|
|
1623
|
+
*
|
|
1624
|
+
* @param client - Client.
|
|
1625
|
+
* @param parameters - Parameters.
|
|
1626
|
+
* @returns The transaction hash.
|
|
1627
|
+
*/
|
|
1628
|
+
export async function grantRoles<
|
|
1629
|
+
chain extends Chain | undefined,
|
|
1630
|
+
account extends Account | undefined,
|
|
1631
|
+
>(
|
|
1632
|
+
client: Client<Transport, chain, account>,
|
|
1633
|
+
parameters: grantRoles.Parameters<chain, account>,
|
|
1634
|
+
): Promise<grantRoles.ReturnValue> {
|
|
1635
|
+
return grantRoles.inner(sendTransaction, client, parameters)
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
export namespace grantRoles {
|
|
1639
|
+
export type Parameters<
|
|
1640
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
1641
|
+
account extends Account | undefined = Account | undefined,
|
|
1642
|
+
> = WriteParameters<chain, account> &
|
|
1643
|
+
Omit<Args, 'role'> & {
|
|
1644
|
+
/** Role to grant. */
|
|
1645
|
+
roles: readonly TokenRole.TokenRole[]
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
export type Args = {
|
|
1649
|
+
/** Role to grant. */
|
|
1650
|
+
role: TokenRole.TokenRole
|
|
1651
|
+
/** Address or ID of the TIP20 token. */
|
|
1652
|
+
token: TokenId.TokenIdOrAddress
|
|
1653
|
+
/** Address to grant the role to. */
|
|
1654
|
+
to: Address
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
export type ReturnValue = WriteContractReturnType
|
|
1658
|
+
|
|
1659
|
+
// TODO: exhaustive error type
|
|
1660
|
+
export type ErrorType = BaseErrorType
|
|
1661
|
+
|
|
1662
|
+
/** @internal */
|
|
1663
|
+
export async function inner<
|
|
1664
|
+
action extends typeof sendTransaction | typeof sendTransactionSync,
|
|
1665
|
+
chain extends Chain | undefined,
|
|
1666
|
+
account extends Account | undefined,
|
|
1667
|
+
>(
|
|
1668
|
+
action: action,
|
|
1669
|
+
client: Client<Transport, chain, account>,
|
|
1670
|
+
parameters: grantRoles.Parameters<chain, account>,
|
|
1671
|
+
): Promise<ReturnType<action>> {
|
|
1672
|
+
return (await action(client, {
|
|
1673
|
+
...parameters,
|
|
1674
|
+
calls: parameters.roles.map((role) => {
|
|
1675
|
+
const call = grantRoles.call({ ...parameters, role })
|
|
1676
|
+
return {
|
|
1677
|
+
...call,
|
|
1678
|
+
data: encodeFunctionData(call),
|
|
1679
|
+
}
|
|
1680
|
+
}),
|
|
1681
|
+
} as never)) as never
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
/**
|
|
1685
|
+
* Defines a call to the `grantRole` function.
|
|
1686
|
+
*
|
|
1687
|
+
* Can be passed as a parameter to:
|
|
1688
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
1689
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
1690
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
1691
|
+
*
|
|
1692
|
+
* @example
|
|
1693
|
+
* ```ts
|
|
1694
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
1695
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1696
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1697
|
+
*
|
|
1698
|
+
* const client = createClient({
|
|
1699
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1700
|
+
* transport: http(),
|
|
1701
|
+
* }).extend(walletActions)
|
|
1702
|
+
*
|
|
1703
|
+
* const { result } = await client.sendCalls({
|
|
1704
|
+
* calls: [
|
|
1705
|
+
* actions.token.grantRoles.call({
|
|
1706
|
+
* token: '0x20c0...babe',
|
|
1707
|
+
* to: '0x20c0...beef',
|
|
1708
|
+
* role: 'issuer',
|
|
1709
|
+
* }),
|
|
1710
|
+
* ]
|
|
1711
|
+
* })
|
|
1712
|
+
* ```
|
|
1713
|
+
*
|
|
1714
|
+
* @param args - Arguments.
|
|
1715
|
+
* @returns The call.
|
|
1716
|
+
*/
|
|
1717
|
+
export function call(args: Args) {
|
|
1718
|
+
const { token, to, role } = args
|
|
1719
|
+
const roleHash = TokenRole.serialize(role)
|
|
1720
|
+
return defineCall({
|
|
1721
|
+
address: TokenId.toAddress(token),
|
|
1722
|
+
abi: Abis.tip20,
|
|
1723
|
+
functionName: 'grantRole',
|
|
1724
|
+
args: [roleHash, to],
|
|
1725
|
+
})
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
/**
|
|
1729
|
+
* Extracts the events from the logs.
|
|
1730
|
+
*
|
|
1731
|
+
* @param logs - Logs.
|
|
1732
|
+
* @returns The events.
|
|
1733
|
+
*/
|
|
1734
|
+
export function extractEvents(logs: Log[]) {
|
|
1735
|
+
const events = parseEventLogs({
|
|
1736
|
+
abi: Abis.tip20,
|
|
1737
|
+
logs,
|
|
1738
|
+
eventName: 'RoleMembershipUpdated',
|
|
1739
|
+
})
|
|
1740
|
+
if (events.length === 0)
|
|
1741
|
+
throw new Error('`RoleMembershipUpdated` events not found.')
|
|
1742
|
+
return events
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
/**
|
|
1747
|
+
* Grants a role for a TIP20 token.
|
|
1748
|
+
*
|
|
1749
|
+
* @example
|
|
1750
|
+
* ```ts
|
|
1751
|
+
* import { createClient, http } from 'viem'
|
|
1752
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1753
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1754
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1755
|
+
*
|
|
1756
|
+
* const client = createClient({
|
|
1757
|
+
* account: privateKeyToAccount('0x...'),
|
|
1758
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1759
|
+
* transport: http(),
|
|
1760
|
+
* })
|
|
1761
|
+
*
|
|
1762
|
+
* const result = await Actions.token.grantRolesSync(client, {
|
|
1763
|
+
* token: '0x...',
|
|
1764
|
+
* to: '0x...',
|
|
1765
|
+
* roles: ['issuer'],
|
|
1766
|
+
* })
|
|
1767
|
+
* ```
|
|
1768
|
+
*
|
|
1769
|
+
* @param client - Client.
|
|
1770
|
+
* @param parameters - Parameters.
|
|
1771
|
+
* @returns The transaction receipt and event data.
|
|
1772
|
+
*/
|
|
1773
|
+
export async function grantRolesSync<
|
|
1774
|
+
chain extends Chain | undefined,
|
|
1775
|
+
account extends Account | undefined,
|
|
1776
|
+
>(
|
|
1777
|
+
client: Client<Transport, chain, account>,
|
|
1778
|
+
parameters: grantRolesSync.Parameters<chain, account>,
|
|
1779
|
+
): Promise<grantRolesSync.ReturnValue> {
|
|
1780
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
1781
|
+
const receipt = await grantRoles.inner(sendTransactionSync, client, {
|
|
1782
|
+
...rest,
|
|
1783
|
+
throwOnReceiptRevert,
|
|
1784
|
+
} as never)
|
|
1785
|
+
const events = grantRoles.extractEvents(receipt.logs)
|
|
1786
|
+
const value = events.map((event) => event.args)
|
|
1787
|
+
return {
|
|
1788
|
+
receipt,
|
|
1789
|
+
value,
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
export namespace grantRolesSync {
|
|
1794
|
+
export type Parameters<
|
|
1795
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
1796
|
+
account extends Account | undefined = Account | undefined,
|
|
1797
|
+
> = grantRoles.Parameters<chain, account>
|
|
1798
|
+
|
|
1799
|
+
export type Args = grantRoles.Args
|
|
1800
|
+
|
|
1801
|
+
export type ReturnValue = {
|
|
1802
|
+
receipt: TransactionReceipt
|
|
1803
|
+
value: readonly GetEventArgs<
|
|
1804
|
+
typeof Abis.tip20,
|
|
1805
|
+
'RoleMembershipUpdated',
|
|
1806
|
+
{ IndexedOnly: false; Required: true }
|
|
1807
|
+
>[]
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
// TODO: exhaustive error type
|
|
1811
|
+
export type ErrorType = BaseErrorType
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
/**
|
|
1815
|
+
* Mints TIP20 tokens to an address.
|
|
1816
|
+
*
|
|
1817
|
+
* @example
|
|
1818
|
+
* ```ts
|
|
1819
|
+
* import { createClient, http } from 'viem'
|
|
1820
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1821
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1822
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1823
|
+
*
|
|
1824
|
+
* const client = createClient({
|
|
1825
|
+
* account: privateKeyToAccount('0x...'),
|
|
1826
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1827
|
+
* transport: http(),
|
|
1828
|
+
* })
|
|
1829
|
+
*
|
|
1830
|
+
* const result = await Actions.token.mint(client, {
|
|
1831
|
+
* to: '0x...',
|
|
1832
|
+
* amount: 100n,
|
|
1833
|
+
* token: '0x...',
|
|
1834
|
+
* })
|
|
1835
|
+
* ```
|
|
1836
|
+
*
|
|
1837
|
+
* @param client - Client.
|
|
1838
|
+
* @param parameters - Parameters.
|
|
1839
|
+
* @returns The transaction hash.
|
|
1840
|
+
*/
|
|
1841
|
+
export async function mint<
|
|
1842
|
+
chain extends Chain | undefined,
|
|
1843
|
+
account extends Account | undefined,
|
|
1844
|
+
>(
|
|
1845
|
+
client: Client<Transport, chain, account>,
|
|
1846
|
+
parameters: mint.Parameters<chain, account>,
|
|
1847
|
+
): Promise<mint.ReturnValue> {
|
|
1848
|
+
return mint.inner(writeContract, client, parameters)
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
export namespace mint {
|
|
1852
|
+
export type Parameters<
|
|
1853
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
1854
|
+
account extends Account | undefined = Account | undefined,
|
|
1855
|
+
> = WriteParameters<chain, account> & Args
|
|
1856
|
+
|
|
1857
|
+
export type Args = {
|
|
1858
|
+
/** Amount of tokens to mint. */
|
|
1859
|
+
amount: bigint
|
|
1860
|
+
/** Memo to include in the mint. */
|
|
1861
|
+
memo?: Hex.Hex | undefined
|
|
1862
|
+
/** Address to mint tokens to. */
|
|
1863
|
+
to: Address
|
|
1864
|
+
/** Address or ID of the TIP20 token. */
|
|
1865
|
+
token: TokenId.TokenIdOrAddress
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
export type ReturnValue = WriteContractReturnType
|
|
1869
|
+
|
|
1870
|
+
// TODO: exhaustive error type
|
|
1871
|
+
export type ErrorType = BaseErrorType
|
|
1872
|
+
|
|
1873
|
+
/** @internal */
|
|
1874
|
+
export async function inner<
|
|
1875
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
1876
|
+
chain extends Chain | undefined,
|
|
1877
|
+
account extends Account | undefined,
|
|
1878
|
+
>(
|
|
1879
|
+
action: action,
|
|
1880
|
+
client: Client<Transport, chain, account>,
|
|
1881
|
+
parameters: any,
|
|
1882
|
+
): Promise<ReturnType<action>> {
|
|
1883
|
+
const call = mint.call(parameters)
|
|
1884
|
+
return (await action(client, {
|
|
1885
|
+
...parameters,
|
|
1886
|
+
...call,
|
|
1887
|
+
} as never)) as never
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* Defines a call to the `mint` or `mintWithMemo` function.
|
|
1892
|
+
*
|
|
1893
|
+
* Can be passed as a parameter to:
|
|
1894
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
1895
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
1896
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
1897
|
+
*
|
|
1898
|
+
* @example
|
|
1899
|
+
* ```ts
|
|
1900
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
1901
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1902
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1903
|
+
*
|
|
1904
|
+
* const client = createClient({
|
|
1905
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1906
|
+
* transport: http(),
|
|
1907
|
+
* }).extend(walletActions)
|
|
1908
|
+
*
|
|
1909
|
+
* const { result } = await client.sendCalls({
|
|
1910
|
+
* calls: [
|
|
1911
|
+
* actions.token.mint.call({
|
|
1912
|
+
* to: '0x20c0...beef',
|
|
1913
|
+
* amount: 100n,
|
|
1914
|
+
* token: '0x20c0...babe',
|
|
1915
|
+
* }),
|
|
1916
|
+
* ]
|
|
1917
|
+
* })
|
|
1918
|
+
* ```
|
|
1919
|
+
*
|
|
1920
|
+
* @param args - Arguments.
|
|
1921
|
+
* @returns The call.
|
|
1922
|
+
*/
|
|
1923
|
+
export function call(args: Args) {
|
|
1924
|
+
const { to, amount, memo, token } = args
|
|
1925
|
+
const callArgs = memo
|
|
1926
|
+
? ({
|
|
1927
|
+
functionName: 'mintWithMemo',
|
|
1928
|
+
args: [to, amount, Hex.padLeft(memo, 32)],
|
|
1929
|
+
} as const)
|
|
1930
|
+
: ({
|
|
1931
|
+
functionName: 'mint',
|
|
1932
|
+
args: [to, amount],
|
|
1933
|
+
} as const)
|
|
1934
|
+
return defineCall({
|
|
1935
|
+
address: TokenId.toAddress(token),
|
|
1936
|
+
abi: Abis.tip20,
|
|
1937
|
+
...callArgs,
|
|
1938
|
+
})
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
/**
|
|
1942
|
+
* Extracts the event from the logs.
|
|
1943
|
+
*
|
|
1944
|
+
* @param logs - Logs.
|
|
1945
|
+
* @returns The event.
|
|
1946
|
+
*/
|
|
1947
|
+
export function extractEvent(logs: Log[]) {
|
|
1948
|
+
const [log] = parseEventLogs({
|
|
1949
|
+
abi: Abis.tip20,
|
|
1950
|
+
logs,
|
|
1951
|
+
eventName: 'Mint',
|
|
1952
|
+
})
|
|
1953
|
+
if (!log) throw new Error('`Mint` event not found.')
|
|
1954
|
+
return log
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
/**
|
|
1959
|
+
* Mints TIP20 tokens to an address.
|
|
1960
|
+
*
|
|
1961
|
+
* @example
|
|
1962
|
+
* ```ts
|
|
1963
|
+
* import { createClient, http } from 'viem'
|
|
1964
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
1965
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1966
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1967
|
+
*
|
|
1968
|
+
* const client = createClient({
|
|
1969
|
+
* account: privateKeyToAccount('0x...'),
|
|
1970
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1971
|
+
* transport: http(),
|
|
1972
|
+
* })
|
|
1973
|
+
*
|
|
1974
|
+
* const result = await Actions.token.mintSync(client, {
|
|
1975
|
+
* to: '0x...',
|
|
1976
|
+
* amount: 100n,
|
|
1977
|
+
* token: '0x...',
|
|
1978
|
+
* })
|
|
1979
|
+
* ```
|
|
1980
|
+
*
|
|
1981
|
+
* @param client - Client.
|
|
1982
|
+
* @param parameters - Parameters.
|
|
1983
|
+
* @returns The transaction receipt and event data.
|
|
1984
|
+
*/
|
|
1985
|
+
export async function mintSync<
|
|
1986
|
+
chain extends Chain | undefined,
|
|
1987
|
+
account extends Account | undefined,
|
|
1988
|
+
>(
|
|
1989
|
+
client: Client<Transport, chain, account>,
|
|
1990
|
+
parameters: mintSync.Parameters<chain, account>,
|
|
1991
|
+
): Promise<mintSync.ReturnValue> {
|
|
1992
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
1993
|
+
const receipt = await mint.inner(writeContractSync, client, {
|
|
1994
|
+
...rest,
|
|
1995
|
+
throwOnReceiptRevert,
|
|
1996
|
+
} as never)
|
|
1997
|
+
const { args } = mint.extractEvent(receipt.logs)
|
|
1998
|
+
return {
|
|
1999
|
+
...args,
|
|
2000
|
+
receipt,
|
|
2001
|
+
} as never
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
export namespace mintSync {
|
|
2005
|
+
export type Parameters<
|
|
2006
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2007
|
+
account extends Account | undefined = Account | undefined,
|
|
2008
|
+
> = mint.Parameters<chain, account>
|
|
2009
|
+
|
|
2010
|
+
export type Args = mint.Args
|
|
2011
|
+
|
|
2012
|
+
export type ReturnValue = Compute<
|
|
2013
|
+
GetEventArgs<
|
|
2014
|
+
typeof Abis.tip20,
|
|
2015
|
+
'Mint',
|
|
2016
|
+
{
|
|
2017
|
+
IndexedOnly: false
|
|
2018
|
+
Required: true
|
|
2019
|
+
}
|
|
2020
|
+
> & {
|
|
2021
|
+
receipt: TransactionReceipt
|
|
2022
|
+
}
|
|
2023
|
+
>
|
|
2024
|
+
|
|
2025
|
+
// TODO: exhaustive error type
|
|
2026
|
+
export type ErrorType = BaseErrorType
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* Pauses a TIP20 token.
|
|
2031
|
+
*
|
|
2032
|
+
* @example
|
|
2033
|
+
* ```ts
|
|
2034
|
+
* import { createClient, http } from 'viem'
|
|
2035
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2036
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2037
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2038
|
+
*
|
|
2039
|
+
* const client = createClient({
|
|
2040
|
+
* account: privateKeyToAccount('0x...'),
|
|
2041
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2042
|
+
* transport: http(),
|
|
2043
|
+
* })
|
|
2044
|
+
*
|
|
2045
|
+
* const result = await Actions.token.pause(client, {
|
|
2046
|
+
* token: '0x...',
|
|
2047
|
+
* })
|
|
2048
|
+
* ```
|
|
2049
|
+
*
|
|
2050
|
+
* @param client - Client.
|
|
2051
|
+
* @param parameters - Parameters.
|
|
2052
|
+
* @returns The transaction hash.
|
|
2053
|
+
*/
|
|
2054
|
+
export async function pause<
|
|
2055
|
+
chain extends Chain | undefined,
|
|
2056
|
+
account extends Account | undefined,
|
|
2057
|
+
>(
|
|
2058
|
+
client: Client<Transport, chain, account>,
|
|
2059
|
+
parameters: pause.Parameters<chain, account>,
|
|
2060
|
+
): Promise<pause.ReturnValue> {
|
|
2061
|
+
return pause.inner(writeContract, client, parameters)
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
export namespace pause {
|
|
2065
|
+
export type Parameters<
|
|
2066
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2067
|
+
account extends Account | undefined = Account | undefined,
|
|
2068
|
+
> = WriteParameters<chain, account> & Args
|
|
2069
|
+
|
|
2070
|
+
export type Args = {
|
|
2071
|
+
/** Address or ID of the TIP20 token. */
|
|
2072
|
+
token: TokenId.TokenIdOrAddress
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
export type ReturnValue = WriteContractReturnType
|
|
2076
|
+
|
|
2077
|
+
// TODO: exhaustive error type
|
|
2078
|
+
export type ErrorType = BaseErrorType
|
|
2079
|
+
|
|
2080
|
+
/** @internal */
|
|
2081
|
+
export async function inner<
|
|
2082
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
2083
|
+
chain extends Chain | undefined,
|
|
2084
|
+
account extends Account | undefined,
|
|
2085
|
+
>(
|
|
2086
|
+
action: action,
|
|
2087
|
+
client: Client<Transport, chain, account>,
|
|
2088
|
+
parameters: pause.Parameters<chain, account>,
|
|
2089
|
+
): Promise<ReturnType<action>> {
|
|
2090
|
+
const { token, ...rest } = parameters
|
|
2091
|
+
const call = pause.call({ token })
|
|
2092
|
+
return (await action(client, {
|
|
2093
|
+
...rest,
|
|
2094
|
+
...call,
|
|
2095
|
+
} as never)) as never
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
/**
|
|
2099
|
+
* Defines a call to the `pause` function.
|
|
2100
|
+
*
|
|
2101
|
+
* Can be passed as a parameter to:
|
|
2102
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
2103
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
2104
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
2105
|
+
*
|
|
2106
|
+
* @example
|
|
2107
|
+
* ```ts
|
|
2108
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
2109
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2110
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2111
|
+
*
|
|
2112
|
+
* const client = createClient({
|
|
2113
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2114
|
+
* transport: http(),
|
|
2115
|
+
* }).extend(walletActions)
|
|
2116
|
+
*
|
|
2117
|
+
* const { result } = await client.sendCalls({
|
|
2118
|
+
* calls: [
|
|
2119
|
+
* actions.token.pause.call({
|
|
2120
|
+
* token: '0x20c0...babe',
|
|
2121
|
+
* }),
|
|
2122
|
+
* ]
|
|
2123
|
+
* })
|
|
2124
|
+
* ```
|
|
2125
|
+
*
|
|
2126
|
+
* @param args - Arguments.
|
|
2127
|
+
* @returns The call.
|
|
2128
|
+
*/
|
|
2129
|
+
export function call(args: Args) {
|
|
2130
|
+
const { token } = args
|
|
2131
|
+
return defineCall({
|
|
2132
|
+
address: TokenId.toAddress(token),
|
|
2133
|
+
abi: Abis.tip20,
|
|
2134
|
+
functionName: 'pause',
|
|
2135
|
+
args: [],
|
|
2136
|
+
})
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
/**
|
|
2140
|
+
* Extracts the event from the logs.
|
|
2141
|
+
*
|
|
2142
|
+
* @param logs - Logs.
|
|
2143
|
+
* @returns The event.
|
|
2144
|
+
*/
|
|
2145
|
+
export function extractEvent(logs: Log[]) {
|
|
2146
|
+
const [log] = parseEventLogs({
|
|
2147
|
+
abi: Abis.tip20,
|
|
2148
|
+
logs,
|
|
2149
|
+
eventName: 'PauseStateUpdate',
|
|
2150
|
+
})
|
|
2151
|
+
if (!log) throw new Error('`PauseStateUpdate` event not found.')
|
|
2152
|
+
return log
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
/**
|
|
2157
|
+
* Pauses a TIP20 token.
|
|
2158
|
+
*
|
|
2159
|
+
* @example
|
|
2160
|
+
* ```ts
|
|
2161
|
+
* import { createClient, http } from 'viem'
|
|
2162
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2163
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2164
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2165
|
+
*
|
|
2166
|
+
* const client = createClient({
|
|
2167
|
+
* account: privateKeyToAccount('0x...'),
|
|
2168
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2169
|
+
* transport: http(),
|
|
2170
|
+
* })
|
|
2171
|
+
*
|
|
2172
|
+
* const result = await Actions.token.pauseSync(client, {
|
|
2173
|
+
* token: '0x...',
|
|
2174
|
+
* })
|
|
2175
|
+
* ```
|
|
2176
|
+
*
|
|
2177
|
+
* @param client - Client.
|
|
2178
|
+
* @param parameters - Parameters.
|
|
2179
|
+
* @returns The transaction receipt and event data.
|
|
2180
|
+
*/
|
|
2181
|
+
export async function pauseSync<
|
|
2182
|
+
chain extends Chain | undefined,
|
|
2183
|
+
account extends Account | undefined,
|
|
2184
|
+
>(
|
|
2185
|
+
client: Client<Transport, chain, account>,
|
|
2186
|
+
parameters: pauseSync.Parameters<chain, account>,
|
|
2187
|
+
): Promise<pauseSync.ReturnValue> {
|
|
2188
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
2189
|
+
const receipt = await pause.inner(writeContractSync, client, {
|
|
2190
|
+
...rest,
|
|
2191
|
+
throwOnReceiptRevert,
|
|
2192
|
+
} as never)
|
|
2193
|
+
const { args } = pause.extractEvent(receipt.logs)
|
|
2194
|
+
return {
|
|
2195
|
+
...args,
|
|
2196
|
+
receipt,
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
export namespace pauseSync {
|
|
2201
|
+
export type Parameters<
|
|
2202
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2203
|
+
account extends Account | undefined = Account | undefined,
|
|
2204
|
+
> = pause.Parameters<chain, account>
|
|
2205
|
+
|
|
2206
|
+
export type Args = pause.Args
|
|
2207
|
+
|
|
2208
|
+
export type ReturnValue = GetEventArgs<
|
|
2209
|
+
typeof Abis.tip20,
|
|
2210
|
+
'PauseStateUpdate',
|
|
2211
|
+
{ IndexedOnly: false; Required: true }
|
|
2212
|
+
> & {
|
|
2213
|
+
receipt: TransactionReceipt
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
// TODO: exhaustive error type
|
|
2217
|
+
export type ErrorType = BaseErrorType
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
/**
|
|
2221
|
+
* Renounces a role for a TIP20 token.
|
|
2222
|
+
*
|
|
2223
|
+
* @example
|
|
2224
|
+
* ```ts
|
|
2225
|
+
* import { createClient, http } from 'viem'
|
|
2226
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2227
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2228
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2229
|
+
*
|
|
2230
|
+
* const client = createClient({
|
|
2231
|
+
* account: privateKeyToAccount('0x...'),
|
|
2232
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2233
|
+
* transport: http(),
|
|
2234
|
+
* })
|
|
2235
|
+
*
|
|
2236
|
+
* const result = await Actions.token.renounceRoles(client, {
|
|
2237
|
+
* token: '0x...',
|
|
2238
|
+
* roles: ['issuer'],
|
|
2239
|
+
* })
|
|
2240
|
+
* ```
|
|
2241
|
+
*
|
|
2242
|
+
* @param client - Client.
|
|
2243
|
+
* @param parameters - Parameters.
|
|
2244
|
+
* @returns The transaction hash.
|
|
2245
|
+
*/
|
|
2246
|
+
export async function renounceRoles<
|
|
2247
|
+
chain extends Chain | undefined,
|
|
2248
|
+
account extends Account | undefined,
|
|
2249
|
+
>(
|
|
2250
|
+
client: Client<Transport, chain, account>,
|
|
2251
|
+
parameters: renounceRoles.Parameters<chain, account>,
|
|
2252
|
+
): Promise<renounceRoles.ReturnValue> {
|
|
2253
|
+
return renounceRoles.inner(sendTransaction, client, parameters)
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
export namespace renounceRoles {
|
|
2257
|
+
export type Parameters<
|
|
2258
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2259
|
+
account extends Account | undefined = Account | undefined,
|
|
2260
|
+
> = WriteParameters<chain, account> &
|
|
2261
|
+
Omit<Args, 'role'> & {
|
|
2262
|
+
/** Roles to renounce. */
|
|
2263
|
+
roles: readonly TokenRole.TokenRole[]
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
export type Args = {
|
|
2267
|
+
/** Role to renounce. */
|
|
2268
|
+
role: TokenRole.TokenRole
|
|
2269
|
+
/** Address or ID of the TIP20 token. */
|
|
2270
|
+
token: TokenId.TokenIdOrAddress
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
export type ReturnValue = WriteContractReturnType
|
|
2274
|
+
|
|
2275
|
+
// TODO: exhaustive error type
|
|
2276
|
+
export type ErrorType = BaseErrorType
|
|
2277
|
+
|
|
2278
|
+
/** @internal */
|
|
2279
|
+
export async function inner<
|
|
2280
|
+
action extends typeof sendTransaction | typeof sendTransactionSync,
|
|
2281
|
+
chain extends Chain | undefined,
|
|
2282
|
+
account extends Account | undefined,
|
|
2283
|
+
>(
|
|
2284
|
+
action: action,
|
|
2285
|
+
client: Client<Transport, chain, account>,
|
|
2286
|
+
parameters: renounceRoles.Parameters<chain, account>,
|
|
2287
|
+
): Promise<ReturnType<action>> {
|
|
2288
|
+
return (await action(client, {
|
|
2289
|
+
...parameters,
|
|
2290
|
+
calls: parameters.roles.map((role) => {
|
|
2291
|
+
const call = renounceRoles.call({ ...parameters, role })
|
|
2292
|
+
return {
|
|
2293
|
+
...call,
|
|
2294
|
+
data: encodeFunctionData(call),
|
|
2295
|
+
}
|
|
2296
|
+
}),
|
|
2297
|
+
} as never)) as never
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
/**
|
|
2301
|
+
* Defines a call to the `renounceRole` function.
|
|
2302
|
+
*
|
|
2303
|
+
* Can be passed as a parameter to:
|
|
2304
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
2305
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
2306
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
2307
|
+
*
|
|
2308
|
+
* @example
|
|
2309
|
+
* ```ts
|
|
2310
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
2311
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2312
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2313
|
+
*
|
|
2314
|
+
* const client = createClient({
|
|
2315
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2316
|
+
* transport: http(),
|
|
2317
|
+
* }).extend(walletActions)
|
|
2318
|
+
*
|
|
2319
|
+
* const { result } = await client.sendCalls({
|
|
2320
|
+
* calls: [
|
|
2321
|
+
* actions.token.renounceRoles.call({
|
|
2322
|
+
* token: '0x20c0...babe',
|
|
2323
|
+
* role: 'issuer',
|
|
2324
|
+
* }),
|
|
2325
|
+
* ]
|
|
2326
|
+
* })
|
|
2327
|
+
* ```
|
|
2328
|
+
*
|
|
2329
|
+
* @param args - Arguments.
|
|
2330
|
+
* @returns The call.
|
|
2331
|
+
*/
|
|
2332
|
+
export function call(args: Args) {
|
|
2333
|
+
const { token, role } = args
|
|
2334
|
+
const roleHash = TokenRole.serialize(role)
|
|
2335
|
+
return defineCall({
|
|
2336
|
+
address: TokenId.toAddress(token),
|
|
2337
|
+
abi: Abis.tip20,
|
|
2338
|
+
functionName: 'renounceRole',
|
|
2339
|
+
args: [roleHash],
|
|
2340
|
+
})
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
/**
|
|
2344
|
+
* Extracts the events from the logs.
|
|
2345
|
+
*
|
|
2346
|
+
* @param logs - Logs.
|
|
2347
|
+
* @returns The events.
|
|
2348
|
+
*/
|
|
2349
|
+
export function extractEvents(logs: Log[]) {
|
|
2350
|
+
const events = parseEventLogs({
|
|
2351
|
+
abi: Abis.tip20,
|
|
2352
|
+
logs,
|
|
2353
|
+
eventName: 'RoleMembershipUpdated',
|
|
2354
|
+
})
|
|
2355
|
+
if (events.length === 0)
|
|
2356
|
+
throw new Error('`RoleMembershipUpdated` events not found.')
|
|
2357
|
+
return events
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
/**
|
|
2362
|
+
* Renounces a role for a TIP20 token.
|
|
2363
|
+
*
|
|
2364
|
+
* @example
|
|
2365
|
+
* ```ts
|
|
2366
|
+
* import { createClient, http } from 'viem'
|
|
2367
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2368
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2369
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2370
|
+
*
|
|
2371
|
+
* const client = createClient({
|
|
2372
|
+
* account: privateKeyToAccount('0x...'),
|
|
2373
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2374
|
+
* transport: http(),
|
|
2375
|
+
* })
|
|
2376
|
+
*
|
|
2377
|
+
* const result = await Actions.token.renounceRolesSync(client, {
|
|
2378
|
+
* token: '0x...',
|
|
2379
|
+
* roles: ['issuer'],
|
|
2380
|
+
* })
|
|
2381
|
+
* ```
|
|
2382
|
+
*
|
|
2383
|
+
* @param client - Client.
|
|
2384
|
+
* @param parameters - Parameters.
|
|
2385
|
+
* @returns The transaction receipt and event data.
|
|
2386
|
+
*/
|
|
2387
|
+
export async function renounceRolesSync<
|
|
2388
|
+
chain extends Chain | undefined,
|
|
2389
|
+
account extends Account | undefined,
|
|
2390
|
+
>(
|
|
2391
|
+
client: Client<Transport, chain, account>,
|
|
2392
|
+
parameters: renounceRolesSync.Parameters<chain, account>,
|
|
2393
|
+
): Promise<renounceRolesSync.ReturnValue> {
|
|
2394
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
2395
|
+
const receipt = await renounceRoles.inner(sendTransactionSync, client, {
|
|
2396
|
+
...rest,
|
|
2397
|
+
throwOnReceiptRevert,
|
|
2398
|
+
} as never)
|
|
2399
|
+
const events = renounceRoles.extractEvents(receipt.logs)
|
|
2400
|
+
const value = events.map((event) => event.args)
|
|
2401
|
+
return {
|
|
2402
|
+
receipt,
|
|
2403
|
+
value,
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
|
|
2407
|
+
export namespace renounceRolesSync {
|
|
2408
|
+
export type Parameters<
|
|
2409
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2410
|
+
account extends Account | undefined = Account | undefined,
|
|
2411
|
+
> = renounceRoles.Parameters<chain, account>
|
|
2412
|
+
|
|
2413
|
+
export type Args = renounceRoles.Args
|
|
2414
|
+
|
|
2415
|
+
export type ReturnValue = {
|
|
2416
|
+
receipt: TransactionReceipt
|
|
2417
|
+
value: readonly GetEventArgs<
|
|
2418
|
+
typeof Abis.tip20,
|
|
2419
|
+
'RoleMembershipUpdated',
|
|
2420
|
+
{ IndexedOnly: false; Required: true }
|
|
2421
|
+
>[]
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
// TODO: exhaustive error type
|
|
2425
|
+
export type ErrorType = BaseErrorType
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
/**
|
|
2429
|
+
* Revokes a role for a TIP20 token.
|
|
2430
|
+
*
|
|
2431
|
+
* @example
|
|
2432
|
+
* ```ts
|
|
2433
|
+
* import { createClient, http } from 'viem'
|
|
2434
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2435
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2436
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2437
|
+
*
|
|
2438
|
+
* const client = createClient({
|
|
2439
|
+
* account: privateKeyToAccount('0x...'),
|
|
2440
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2441
|
+
* transport: http(),
|
|
2442
|
+
* })
|
|
2443
|
+
*
|
|
2444
|
+
* const result = await Actions.token.revokeRoles(client, {
|
|
2445
|
+
* token: '0x...',
|
|
2446
|
+
* from: '0x...',
|
|
2447
|
+
* roles: ['issuer'],
|
|
2448
|
+
* })
|
|
2449
|
+
* ```
|
|
2450
|
+
*
|
|
2451
|
+
* @param client - Client.
|
|
2452
|
+
* @param parameters - Parameters.
|
|
2453
|
+
* @returns The transaction hash.
|
|
2454
|
+
*/
|
|
2455
|
+
export async function revokeRoles<
|
|
2456
|
+
chain extends Chain | undefined,
|
|
2457
|
+
account extends Account | undefined,
|
|
2458
|
+
>(
|
|
2459
|
+
client: Client<Transport, chain, account>,
|
|
2460
|
+
parameters: revokeRoles.Parameters<chain, account>,
|
|
2461
|
+
): Promise<revokeRoles.ReturnValue> {
|
|
2462
|
+
return revokeRoles.inner(sendTransaction, client, parameters)
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
export namespace revokeRoles {
|
|
2466
|
+
export type Parameters<
|
|
2467
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2468
|
+
account extends Account | undefined = Account | undefined,
|
|
2469
|
+
> = SendTransactionSyncParameters<chain, account> &
|
|
2470
|
+
Omit<Args, 'role'> & {
|
|
2471
|
+
/** Role to revoke. */
|
|
2472
|
+
roles: readonly TokenRole.TokenRole[]
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
export type Args = {
|
|
2476
|
+
/** Address to revoke the role from. */
|
|
2477
|
+
from: Address
|
|
2478
|
+
/** Role to revoke. */
|
|
2479
|
+
role: TokenRole.TokenRole
|
|
2480
|
+
/** Address or ID of the TIP20 token. */
|
|
2481
|
+
token: TokenId.TokenIdOrAddress
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
export type ReturnValue = WriteContractReturnType
|
|
2485
|
+
|
|
2486
|
+
// TODO: exhaustive error type
|
|
2487
|
+
export type ErrorType = BaseErrorType
|
|
2488
|
+
|
|
2489
|
+
/** @internal */
|
|
2490
|
+
export async function inner<
|
|
2491
|
+
action extends typeof sendTransaction | typeof sendTransactionSync,
|
|
2492
|
+
chain extends Chain | undefined,
|
|
2493
|
+
account extends Account | undefined,
|
|
2494
|
+
>(
|
|
2495
|
+
action: action,
|
|
2496
|
+
client: Client<Transport, chain, account>,
|
|
2497
|
+
parameters: revokeRoles.Parameters<chain, account>,
|
|
2498
|
+
): Promise<ReturnType<action>> {
|
|
2499
|
+
return (await action(client, {
|
|
2500
|
+
...parameters,
|
|
2501
|
+
calls: parameters.roles.map((role) => {
|
|
2502
|
+
const call = revokeRoles.call({ ...parameters, role })
|
|
2503
|
+
return {
|
|
2504
|
+
...call,
|
|
2505
|
+
data: encodeFunctionData(call),
|
|
2506
|
+
}
|
|
2507
|
+
}),
|
|
2508
|
+
} as never)) as never
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
/**
|
|
2512
|
+
* Defines a call to the `revokeRole` function.
|
|
2513
|
+
*
|
|
2514
|
+
* Can be passed as a parameter to:
|
|
2515
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
2516
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
2517
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
2518
|
+
*
|
|
2519
|
+
* @example
|
|
2520
|
+
* ```ts
|
|
2521
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
2522
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2523
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2524
|
+
*
|
|
2525
|
+
* const client = createClient({
|
|
2526
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2527
|
+
* transport: http(),
|
|
2528
|
+
* }).extend(walletActions)
|
|
2529
|
+
*
|
|
2530
|
+
* const { result } = await client.sendCalls({
|
|
2531
|
+
* calls: [
|
|
2532
|
+
* actions.token.revokeRoles.call({
|
|
2533
|
+
* token: '0x20c0...babe',
|
|
2534
|
+
* from: '0x20c0...beef',
|
|
2535
|
+
* role: 'issuer',
|
|
2536
|
+
* }),
|
|
2537
|
+
* ]
|
|
2538
|
+
* })
|
|
2539
|
+
* ```
|
|
2540
|
+
*
|
|
2541
|
+
* @param args - Arguments.
|
|
2542
|
+
* @returns The call.
|
|
2543
|
+
*/
|
|
2544
|
+
export function call(args: Args) {
|
|
2545
|
+
const { token, from, role } = args
|
|
2546
|
+
const roleHash = TokenRole.serialize(role)
|
|
2547
|
+
return defineCall({
|
|
2548
|
+
address: TokenId.toAddress(token),
|
|
2549
|
+
abi: Abis.tip20,
|
|
2550
|
+
functionName: 'revokeRole',
|
|
2551
|
+
args: [roleHash, from],
|
|
2552
|
+
})
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* Extracts the events from the logs.
|
|
2557
|
+
*
|
|
2558
|
+
* @param logs - Logs.
|
|
2559
|
+
* @returns The events.
|
|
2560
|
+
*/
|
|
2561
|
+
export function extractEvents(logs: Log[]) {
|
|
2562
|
+
const events = parseEventLogs({
|
|
2563
|
+
abi: Abis.tip20,
|
|
2564
|
+
logs,
|
|
2565
|
+
eventName: 'RoleMembershipUpdated',
|
|
2566
|
+
})
|
|
2567
|
+
if (events.length === 0)
|
|
2568
|
+
throw new Error('`RoleMembershipUpdated` events not found.')
|
|
2569
|
+
return events
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
/**
|
|
2574
|
+
* Revokes a role for a TIP20 token.
|
|
2575
|
+
*
|
|
2576
|
+
* @example
|
|
2577
|
+
* ```ts
|
|
2578
|
+
* import { createClient, http } from 'viem'
|
|
2579
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2580
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2581
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2582
|
+
*
|
|
2583
|
+
* const client = createClient({
|
|
2584
|
+
* account: privateKeyToAccount('0x...'),
|
|
2585
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2586
|
+
* transport: http(),
|
|
2587
|
+
* })
|
|
2588
|
+
*
|
|
2589
|
+
* const result = await Actions.token.revokeRolesSync(client, {
|
|
2590
|
+
* token: '0x...',
|
|
2591
|
+
* from: '0x...',
|
|
2592
|
+
* roles: ['issuer'],
|
|
2593
|
+
* })
|
|
2594
|
+
* ```
|
|
2595
|
+
*
|
|
2596
|
+
* @param client - Client.
|
|
2597
|
+
* @param parameters - Parameters.
|
|
2598
|
+
* @returns The transaction receipt and event data.
|
|
2599
|
+
*/
|
|
2600
|
+
export async function revokeRolesSync<
|
|
2601
|
+
chain extends Chain | undefined,
|
|
2602
|
+
account extends Account | undefined,
|
|
2603
|
+
>(
|
|
2604
|
+
client: Client<Transport, chain, account>,
|
|
2605
|
+
parameters: revokeRolesSync.Parameters<chain, account>,
|
|
2606
|
+
): Promise<revokeRolesSync.ReturnValue> {
|
|
2607
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
2608
|
+
const receipt = await revokeRoles.inner(sendTransactionSync, client, {
|
|
2609
|
+
...rest,
|
|
2610
|
+
throwOnReceiptRevert,
|
|
2611
|
+
} as never)
|
|
2612
|
+
const events = revokeRoles.extractEvents(receipt.logs)
|
|
2613
|
+
const value = events.map((event) => event.args)
|
|
2614
|
+
return {
|
|
2615
|
+
receipt,
|
|
2616
|
+
value,
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
export namespace revokeRolesSync {
|
|
2621
|
+
export type Parameters<
|
|
2622
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2623
|
+
account extends Account | undefined = Account | undefined,
|
|
2624
|
+
> = revokeRoles.Parameters<chain, account>
|
|
2625
|
+
|
|
2626
|
+
export type Args = revokeRoles.Args
|
|
2627
|
+
|
|
2628
|
+
export type ReturnValue = {
|
|
2629
|
+
receipt: TransactionReceipt
|
|
2630
|
+
value: readonly GetEventArgs<
|
|
2631
|
+
typeof Abis.tip20,
|
|
2632
|
+
'RoleMembershipUpdated',
|
|
2633
|
+
{ IndexedOnly: false; Required: true }
|
|
2634
|
+
>[]
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
// TODO: exhaustive error type
|
|
2638
|
+
export type ErrorType = BaseErrorType
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
/**
|
|
2642
|
+
* Sets the supply cap for a TIP20 token.
|
|
2643
|
+
*
|
|
2644
|
+
* @example
|
|
2645
|
+
* ```ts
|
|
2646
|
+
* import { createClient, http } from 'viem'
|
|
2647
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2648
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2649
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2650
|
+
*
|
|
2651
|
+
* const client = createClient({
|
|
2652
|
+
* account: privateKeyToAccount('0x...'),
|
|
2653
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2654
|
+
* transport: http(),
|
|
2655
|
+
* })
|
|
2656
|
+
*
|
|
2657
|
+
* const result = await Actions.token.setSupplyCap(client, {
|
|
2658
|
+
* token: '0x...',
|
|
2659
|
+
* supplyCap: 1000000n,
|
|
2660
|
+
* })
|
|
2661
|
+
* ```
|
|
2662
|
+
*
|
|
2663
|
+
* @param client - Client.
|
|
2664
|
+
* @param parameters - Parameters.
|
|
2665
|
+
* @returns The transaction hash.
|
|
2666
|
+
*/
|
|
2667
|
+
export async function setSupplyCap<
|
|
2668
|
+
chain extends Chain | undefined,
|
|
2669
|
+
account extends Account | undefined,
|
|
2670
|
+
>(
|
|
2671
|
+
client: Client<Transport, chain, account>,
|
|
2672
|
+
parameters: setSupplyCap.Parameters<chain, account>,
|
|
2673
|
+
): Promise<setSupplyCap.ReturnValue> {
|
|
2674
|
+
return setSupplyCap.inner(writeContract, client, parameters)
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
export namespace setSupplyCap {
|
|
2678
|
+
export type Parameters<
|
|
2679
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2680
|
+
account extends Account | undefined = Account | undefined,
|
|
2681
|
+
> = WriteParameters<chain, account> & Args
|
|
2682
|
+
|
|
2683
|
+
export type Args = {
|
|
2684
|
+
/** New supply cap. */
|
|
2685
|
+
supplyCap: bigint
|
|
2686
|
+
/** Address or ID of the TIP20 token. */
|
|
2687
|
+
token: TokenId.TokenIdOrAddress
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
export type ReturnValue = WriteContractReturnType
|
|
2691
|
+
|
|
2692
|
+
// TODO: exhaustive error type
|
|
2693
|
+
export type ErrorType = BaseErrorType
|
|
2694
|
+
|
|
2695
|
+
/** @internal */
|
|
2696
|
+
export async function inner<
|
|
2697
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
2698
|
+
chain extends Chain | undefined,
|
|
2699
|
+
account extends Account | undefined,
|
|
2700
|
+
>(
|
|
2701
|
+
action: action,
|
|
2702
|
+
client: Client<Transport, chain, account>,
|
|
2703
|
+
parameters: setSupplyCap.Parameters<chain, account>,
|
|
2704
|
+
): Promise<ReturnType<action>> {
|
|
2705
|
+
const { supplyCap, token, ...rest } = parameters
|
|
2706
|
+
const call = setSupplyCap.call({ supplyCap, token })
|
|
2707
|
+
return (await action(client, {
|
|
2708
|
+
...rest,
|
|
2709
|
+
...call,
|
|
2710
|
+
} as never)) as never
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
/**
|
|
2714
|
+
* Defines a call to the `setSupplyCap` function.
|
|
2715
|
+
*
|
|
2716
|
+
* Can be passed as a parameter to:
|
|
2717
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
2718
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
2719
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
2720
|
+
*
|
|
2721
|
+
* @example
|
|
2722
|
+
* ```ts
|
|
2723
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
2724
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2725
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2726
|
+
*
|
|
2727
|
+
* const client = createClient({
|
|
2728
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2729
|
+
* transport: http(),
|
|
2730
|
+
* }).extend(walletActions)
|
|
2731
|
+
*
|
|
2732
|
+
* const { result } = await client.sendCalls({
|
|
2733
|
+
* calls: [
|
|
2734
|
+
* actions.token.setSupplyCap.call({
|
|
2735
|
+
* token: '0x20c0...babe',
|
|
2736
|
+
* supplyCap: 1000000n,
|
|
2737
|
+
* }),
|
|
2738
|
+
* ]
|
|
2739
|
+
* })
|
|
2740
|
+
* ```
|
|
2741
|
+
*
|
|
2742
|
+
* @param args - Arguments.
|
|
2743
|
+
* @returns The call.
|
|
2744
|
+
*/
|
|
2745
|
+
export function call(args: Args) {
|
|
2746
|
+
const { token, supplyCap } = args
|
|
2747
|
+
return defineCall({
|
|
2748
|
+
address: TokenId.toAddress(token),
|
|
2749
|
+
abi: Abis.tip20,
|
|
2750
|
+
functionName: 'setSupplyCap',
|
|
2751
|
+
args: [supplyCap],
|
|
2752
|
+
})
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
/**
|
|
2756
|
+
* Extracts the event from the logs.
|
|
2757
|
+
*
|
|
2758
|
+
* @param logs - Logs.
|
|
2759
|
+
* @returns The event.
|
|
2760
|
+
*/
|
|
2761
|
+
export function extractEvent(logs: Log[]) {
|
|
2762
|
+
const [log] = parseEventLogs({
|
|
2763
|
+
abi: Abis.tip20,
|
|
2764
|
+
logs,
|
|
2765
|
+
eventName: 'SupplyCapUpdate',
|
|
2766
|
+
})
|
|
2767
|
+
if (!log) throw new Error('`SupplyCapUpdate` event not found.')
|
|
2768
|
+
return log
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
/**
|
|
2773
|
+
* Sets the supply cap for a TIP20 token.
|
|
2774
|
+
*
|
|
2775
|
+
* @example
|
|
2776
|
+
* ```ts
|
|
2777
|
+
* import { createClient, http } from 'viem'
|
|
2778
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2779
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2780
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2781
|
+
*
|
|
2782
|
+
* const client = createClient({
|
|
2783
|
+
* account: privateKeyToAccount('0x...'),
|
|
2784
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2785
|
+
* transport: http(),
|
|
2786
|
+
* })
|
|
2787
|
+
*
|
|
2788
|
+
* const result = await Actions.token.setSupplyCapSync(client, {
|
|
2789
|
+
* token: '0x...',
|
|
2790
|
+
* supplyCap: 1000000n,
|
|
2791
|
+
* })
|
|
2792
|
+
* ```
|
|
2793
|
+
*
|
|
2794
|
+
* @param client - Client.
|
|
2795
|
+
* @param parameters - Parameters.
|
|
2796
|
+
* @returns The transaction receipt and event data.
|
|
2797
|
+
*/
|
|
2798
|
+
export async function setSupplyCapSync<
|
|
2799
|
+
chain extends Chain | undefined,
|
|
2800
|
+
account extends Account | undefined,
|
|
2801
|
+
>(
|
|
2802
|
+
client: Client<Transport, chain, account>,
|
|
2803
|
+
parameters: setSupplyCapSync.Parameters<chain, account>,
|
|
2804
|
+
): Promise<setSupplyCapSync.ReturnValue> {
|
|
2805
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
2806
|
+
const receipt = await setSupplyCap.inner(writeContractSync, client, {
|
|
2807
|
+
...rest,
|
|
2808
|
+
throwOnReceiptRevert,
|
|
2809
|
+
} as never)
|
|
2810
|
+
const { args } = setSupplyCap.extractEvent(receipt.logs)
|
|
2811
|
+
return {
|
|
2812
|
+
...args,
|
|
2813
|
+
receipt,
|
|
2814
|
+
} as never
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
export namespace setSupplyCapSync {
|
|
2818
|
+
export type Parameters<
|
|
2819
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2820
|
+
account extends Account | undefined = Account | undefined,
|
|
2821
|
+
> = setSupplyCap.Parameters<chain, account>
|
|
2822
|
+
|
|
2823
|
+
export type Args = setSupplyCap.Args
|
|
2824
|
+
|
|
2825
|
+
export type ReturnValue = GetEventArgs<
|
|
2826
|
+
typeof Abis.tip20,
|
|
2827
|
+
'SupplyCapUpdate',
|
|
2828
|
+
{ IndexedOnly: false; Required: true }
|
|
2829
|
+
> & {
|
|
2830
|
+
receipt: TransactionReceipt
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
// TODO: exhaustive error type
|
|
2834
|
+
export type ErrorType = BaseErrorType
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
/**
|
|
2838
|
+
* Sets the admin role for a specific role in a TIP20 token.
|
|
2839
|
+
*
|
|
2840
|
+
* @example
|
|
2841
|
+
* ```ts
|
|
2842
|
+
* import { createClient, http } from 'viem'
|
|
2843
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2844
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2845
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2846
|
+
*
|
|
2847
|
+
* const client = createClient({
|
|
2848
|
+
* account: privateKeyToAccount('0x...'),
|
|
2849
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2850
|
+
* transport: http(),
|
|
2851
|
+
* })
|
|
2852
|
+
*
|
|
2853
|
+
* const result = await Actions.token.setRoleAdmin(client, {
|
|
2854
|
+
* token: '0x...',
|
|
2855
|
+
* role: 'issuer',
|
|
2856
|
+
* adminRole: 'admin',
|
|
2857
|
+
* })
|
|
2858
|
+
* ```
|
|
2859
|
+
*
|
|
2860
|
+
* @param client - Client.
|
|
2861
|
+
* @param parameters - Parameters.
|
|
2862
|
+
* @returns The transaction hash.
|
|
2863
|
+
*/
|
|
2864
|
+
export async function setRoleAdmin<
|
|
2865
|
+
chain extends Chain | undefined,
|
|
2866
|
+
account extends Account | undefined,
|
|
2867
|
+
>(
|
|
2868
|
+
client: Client<Transport, chain, account>,
|
|
2869
|
+
parameters: setRoleAdmin.Parameters<chain, account>,
|
|
2870
|
+
): Promise<setRoleAdmin.ReturnValue> {
|
|
2871
|
+
return setRoleAdmin.inner(writeContract, client, parameters)
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
export namespace setRoleAdmin {
|
|
2875
|
+
export type Parameters<
|
|
2876
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
2877
|
+
account extends Account | undefined = Account | undefined,
|
|
2878
|
+
> = WriteParameters<chain, account> & Args
|
|
2879
|
+
|
|
2880
|
+
export type Args = {
|
|
2881
|
+
/** New admin role. */
|
|
2882
|
+
adminRole: TokenRole.TokenRole
|
|
2883
|
+
/** Role to set admin for. */
|
|
2884
|
+
role: TokenRole.TokenRole
|
|
2885
|
+
/** Address or ID of the TIP20 token. */
|
|
2886
|
+
token: TokenId.TokenIdOrAddress
|
|
2887
|
+
}
|
|
2888
|
+
|
|
2889
|
+
export type ReturnValue = WriteContractReturnType
|
|
2890
|
+
|
|
2891
|
+
// TODO: exhaustive error type
|
|
2892
|
+
export type ErrorType = BaseErrorType
|
|
2893
|
+
|
|
2894
|
+
/** @internal */
|
|
2895
|
+
export async function inner<
|
|
2896
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
2897
|
+
chain extends Chain | undefined,
|
|
2898
|
+
account extends Account | undefined,
|
|
2899
|
+
>(
|
|
2900
|
+
action: action,
|
|
2901
|
+
client: Client<Transport, chain, account>,
|
|
2902
|
+
parameters: setRoleAdmin.Parameters<chain, account>,
|
|
2903
|
+
): Promise<ReturnType<action>> {
|
|
2904
|
+
const { adminRole, role, token, ...rest } = parameters
|
|
2905
|
+
const call = setRoleAdmin.call({ adminRole, role, token })
|
|
2906
|
+
return (await action(client, {
|
|
2907
|
+
...rest,
|
|
2908
|
+
...call,
|
|
2909
|
+
} as never)) as never
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
/**
|
|
2913
|
+
* Defines a call to the `setRoleAdmin` function.
|
|
2914
|
+
*
|
|
2915
|
+
* Can be passed as a parameter to:
|
|
2916
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
2917
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
2918
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
2919
|
+
*
|
|
2920
|
+
* @example
|
|
2921
|
+
* ```ts
|
|
2922
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
2923
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2924
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2925
|
+
*
|
|
2926
|
+
* const client = createClient({
|
|
2927
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2928
|
+
* transport: http(),
|
|
2929
|
+
* }).extend(walletActions)
|
|
2930
|
+
*
|
|
2931
|
+
* const { result } = await client.sendCalls({
|
|
2932
|
+
* calls: [
|
|
2933
|
+
* actions.token.setRoleAdmin.call({
|
|
2934
|
+
* token: '0x20c0...babe',
|
|
2935
|
+
* role: 'issuer',
|
|
2936
|
+
* adminRole: 'admin',
|
|
2937
|
+
* }),
|
|
2938
|
+
* ]
|
|
2939
|
+
* })
|
|
2940
|
+
* ```
|
|
2941
|
+
*
|
|
2942
|
+
* @param args - Arguments.
|
|
2943
|
+
* @returns The call.
|
|
2944
|
+
*/
|
|
2945
|
+
export function call(args: Args) {
|
|
2946
|
+
const { token, role, adminRole } = args
|
|
2947
|
+
const roleHash = TokenRole.serialize(role)
|
|
2948
|
+
const adminRoleHash = TokenRole.serialize(adminRole)
|
|
2949
|
+
return defineCall({
|
|
2950
|
+
address: TokenId.toAddress(token),
|
|
2951
|
+
abi: Abis.tip20,
|
|
2952
|
+
functionName: 'setRoleAdmin',
|
|
2953
|
+
args: [roleHash, adminRoleHash],
|
|
2954
|
+
})
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
/**
|
|
2958
|
+
* Extracts the event from the logs.
|
|
2959
|
+
*
|
|
2960
|
+
* @param logs - Logs.
|
|
2961
|
+
* @returns The event.
|
|
2962
|
+
*/
|
|
2963
|
+
export function extractEvent(logs: Log[]) {
|
|
2964
|
+
const [log] = parseEventLogs({
|
|
2965
|
+
abi: Abis.tip20,
|
|
2966
|
+
logs,
|
|
2967
|
+
eventName: 'RoleAdminUpdated',
|
|
2968
|
+
})
|
|
2969
|
+
if (!log) throw new Error('`RoleAdminUpdated` event not found.')
|
|
2970
|
+
return log
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
/**
|
|
2975
|
+
* Sets the admin role for a specific role in a TIP20 token.
|
|
2976
|
+
*
|
|
2977
|
+
* @example
|
|
2978
|
+
* ```ts
|
|
2979
|
+
* import { createClient, http } from 'viem'
|
|
2980
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
2981
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
2982
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2983
|
+
*
|
|
2984
|
+
* const client = createClient({
|
|
2985
|
+
* account: privateKeyToAccount('0x...'),
|
|
2986
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
2987
|
+
* transport: http(),
|
|
2988
|
+
* })
|
|
2989
|
+
*
|
|
2990
|
+
* const result = await Actions.token.setRoleAdminSync(client, {
|
|
2991
|
+
* token: '0x...',
|
|
2992
|
+
* role: 'issuer',
|
|
2993
|
+
* adminRole: 'admin',
|
|
2994
|
+
* })
|
|
2995
|
+
* ```
|
|
2996
|
+
*
|
|
2997
|
+
* @param client - Client.
|
|
2998
|
+
* @param parameters - Parameters.
|
|
2999
|
+
* @returns The transaction receipt and event data.
|
|
3000
|
+
*/
|
|
3001
|
+
export async function setRoleAdminSync<
|
|
3002
|
+
chain extends Chain | undefined,
|
|
3003
|
+
account extends Account | undefined,
|
|
3004
|
+
>(
|
|
3005
|
+
client: Client<Transport, chain, account>,
|
|
3006
|
+
parameters: setRoleAdminSync.Parameters<chain, account>,
|
|
3007
|
+
): Promise<setRoleAdminSync.ReturnValue> {
|
|
3008
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
3009
|
+
const receipt = await setRoleAdmin.inner(writeContractSync, client, {
|
|
3010
|
+
...rest,
|
|
3011
|
+
throwOnReceiptRevert,
|
|
3012
|
+
} as never)
|
|
3013
|
+
const { args } = setRoleAdmin.extractEvent(receipt.logs)
|
|
3014
|
+
return {
|
|
3015
|
+
...args,
|
|
3016
|
+
receipt,
|
|
3017
|
+
} as never
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
export namespace setRoleAdminSync {
|
|
3021
|
+
export type Parameters<
|
|
3022
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3023
|
+
account extends Account | undefined = Account | undefined,
|
|
3024
|
+
> = setRoleAdmin.Parameters<chain, account>
|
|
3025
|
+
|
|
3026
|
+
export type Args = setRoleAdmin.Args
|
|
3027
|
+
|
|
3028
|
+
export type ReturnValue = GetEventArgs<
|
|
3029
|
+
typeof Abis.tip20,
|
|
3030
|
+
'RoleAdminUpdated',
|
|
3031
|
+
{ IndexedOnly: false; Required: true }
|
|
3032
|
+
> & {
|
|
3033
|
+
receipt: TransactionReceipt
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
// TODO: exhaustive error type
|
|
3037
|
+
export type ErrorType = BaseErrorType
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
/**
|
|
3041
|
+
* Transfers TIP20 tokens to another address.
|
|
3042
|
+
*
|
|
3043
|
+
* @example
|
|
3044
|
+
* ```ts
|
|
3045
|
+
* import { createClient, http } from 'viem'
|
|
3046
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3047
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3048
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3049
|
+
*
|
|
3050
|
+
* const client = createClient({
|
|
3051
|
+
* account: privateKeyToAccount('0x...'),
|
|
3052
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3053
|
+
* transport: http(),
|
|
3054
|
+
* })
|
|
3055
|
+
*
|
|
3056
|
+
* const result = await Actions.token.transfer(client, {
|
|
3057
|
+
* to: '0x...',
|
|
3058
|
+
* amount: 100n,
|
|
3059
|
+
* })
|
|
3060
|
+
* ```
|
|
3061
|
+
*
|
|
3062
|
+
* @param client - Client.
|
|
3063
|
+
* @param parameters - Parameters.
|
|
3064
|
+
* @returns The transaction hash.
|
|
3065
|
+
*/
|
|
3066
|
+
export async function transfer<
|
|
3067
|
+
chain extends Chain | undefined,
|
|
3068
|
+
account extends Account | undefined,
|
|
3069
|
+
>(
|
|
3070
|
+
client: Client<Transport, chain, account>,
|
|
3071
|
+
parameters: transfer.Parameters<chain, account>,
|
|
3072
|
+
): Promise<transfer.ReturnValue> {
|
|
3073
|
+
return transfer.inner(writeContract, client, parameters)
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
export namespace transfer {
|
|
3077
|
+
export type Parameters<
|
|
3078
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3079
|
+
account extends Account | undefined = Account | undefined,
|
|
3080
|
+
> = WriteParameters<chain, account> & Args
|
|
3081
|
+
|
|
3082
|
+
export type Args = {
|
|
3083
|
+
/** Amount of tokens to transfer. */
|
|
3084
|
+
amount: bigint
|
|
3085
|
+
/** Address to transfer tokens from. */
|
|
3086
|
+
from?: Address | undefined
|
|
3087
|
+
/** Memo to include in the transfer. */
|
|
3088
|
+
memo?: Hex.Hex | undefined
|
|
3089
|
+
/** Address or ID of the TIP20 token. */
|
|
3090
|
+
token: TokenId.TokenIdOrAddress
|
|
3091
|
+
/** Address to transfer tokens to. */
|
|
3092
|
+
to: Address
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
export type ReturnValue = WriteContractReturnType
|
|
3096
|
+
|
|
3097
|
+
// TODO: exhaustive error type
|
|
3098
|
+
export type ErrorType = BaseErrorType
|
|
3099
|
+
|
|
3100
|
+
/** @internal */
|
|
3101
|
+
export async function inner<
|
|
3102
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
3103
|
+
chain extends Chain | undefined,
|
|
3104
|
+
account extends Account | undefined,
|
|
3105
|
+
>(
|
|
3106
|
+
action: action,
|
|
3107
|
+
client: Client<Transport, chain, account>,
|
|
3108
|
+
parameters: transfer.Parameters<chain, account>,
|
|
3109
|
+
): Promise<ReturnType<action>> {
|
|
3110
|
+
const { amount, from, memo, token, to, ...rest } = parameters
|
|
3111
|
+
const call = transfer.call({ amount, from, memo, token, to })
|
|
3112
|
+
return (await action(client, {
|
|
3113
|
+
...rest,
|
|
3114
|
+
...call,
|
|
3115
|
+
} as never)) as never
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
/**
|
|
3119
|
+
* Defines a call to the `transfer`, `transferFrom`, `transferWithMemo`, or `transferFromWithMemo` function.
|
|
3120
|
+
*
|
|
3121
|
+
* Can be passed as a parameter to:
|
|
3122
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
3123
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
3124
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
3125
|
+
*
|
|
3126
|
+
* @example
|
|
3127
|
+
* ```ts
|
|
3128
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
3129
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3130
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3131
|
+
*
|
|
3132
|
+
* const client = createClient({
|
|
3133
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3134
|
+
* transport: http(),
|
|
3135
|
+
* }).extend(walletActions)
|
|
3136
|
+
*
|
|
3137
|
+
* const { result } = await client.sendCalls({
|
|
3138
|
+
* calls: [
|
|
3139
|
+
* actions.token.transfer.call({
|
|
3140
|
+
* to: '0x20c0...beef',
|
|
3141
|
+
* amount: 100n,
|
|
3142
|
+
* token: '0x20c0...babe',
|
|
3143
|
+
* }),
|
|
3144
|
+
* ]
|
|
3145
|
+
* })
|
|
3146
|
+
* ```
|
|
3147
|
+
*
|
|
3148
|
+
* @param args - Arguments.
|
|
3149
|
+
* @returns The call.
|
|
3150
|
+
*/
|
|
3151
|
+
export function call(args: Args) {
|
|
3152
|
+
const { amount, from, memo, token, to } = args
|
|
3153
|
+
const callArgs = (() => {
|
|
3154
|
+
if (memo && from)
|
|
3155
|
+
return {
|
|
3156
|
+
functionName: 'transferFromWithMemo',
|
|
3157
|
+
args: [from, to, amount, Hex.padLeft(memo, 32)],
|
|
3158
|
+
} as const
|
|
3159
|
+
if (memo)
|
|
3160
|
+
return {
|
|
3161
|
+
functionName: 'transferWithMemo',
|
|
3162
|
+
args: [to, amount, Hex.padLeft(memo, 32)],
|
|
3163
|
+
} as const
|
|
3164
|
+
if (from)
|
|
3165
|
+
return {
|
|
3166
|
+
functionName: 'transferFrom',
|
|
3167
|
+
args: [from, to, amount],
|
|
3168
|
+
} as const
|
|
3169
|
+
return {
|
|
3170
|
+
functionName: 'transfer',
|
|
3171
|
+
args: [to, amount],
|
|
3172
|
+
} as const
|
|
3173
|
+
})()
|
|
3174
|
+
return defineCall({
|
|
3175
|
+
address: TokenId.toAddress(token),
|
|
3176
|
+
abi: Abis.tip20,
|
|
3177
|
+
...callArgs,
|
|
3178
|
+
})
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
/**
|
|
3182
|
+
* Extracts the event from the logs.
|
|
3183
|
+
*
|
|
3184
|
+
* @param logs - Logs.
|
|
3185
|
+
* @returns The event.
|
|
3186
|
+
*/
|
|
3187
|
+
export function extractEvent(logs: Log[]) {
|
|
3188
|
+
const [log] = parseEventLogs({
|
|
3189
|
+
abi: Abis.tip20,
|
|
3190
|
+
logs,
|
|
3191
|
+
eventName: 'Transfer',
|
|
3192
|
+
})
|
|
3193
|
+
if (!log) throw new Error('`Transfer` event not found.')
|
|
3194
|
+
return log
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
|
|
3198
|
+
/**
|
|
3199
|
+
* Transfers TIP20 tokens to another address.
|
|
3200
|
+
*
|
|
3201
|
+
* @example
|
|
3202
|
+
* ```ts
|
|
3203
|
+
* import { createClient, http } from 'viem'
|
|
3204
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3205
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3206
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3207
|
+
*
|
|
3208
|
+
* const client = createClient({
|
|
3209
|
+
* account: privateKeyToAccount('0x...'),
|
|
3210
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3211
|
+
* transport: http(),
|
|
3212
|
+
* })
|
|
3213
|
+
*
|
|
3214
|
+
* const result = await Actions.token.transferSync(client, {
|
|
3215
|
+
* to: '0x...',
|
|
3216
|
+
* amount: 100n,
|
|
3217
|
+
* })
|
|
3218
|
+
* ```
|
|
3219
|
+
*
|
|
3220
|
+
* @param client - Client.
|
|
3221
|
+
* @param parameters - Parameters.
|
|
3222
|
+
* @returns The transaction receipt and event data.
|
|
3223
|
+
*/
|
|
3224
|
+
export async function transferSync<
|
|
3225
|
+
chain extends Chain | undefined,
|
|
3226
|
+
account extends Account | undefined,
|
|
3227
|
+
>(
|
|
3228
|
+
client: Client<Transport, chain, account>,
|
|
3229
|
+
parameters: transferSync.Parameters<chain, account>,
|
|
3230
|
+
): Promise<transferSync.ReturnValue> {
|
|
3231
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
3232
|
+
const receipt = await transfer.inner(writeContractSync, client, {
|
|
3233
|
+
...rest,
|
|
3234
|
+
throwOnReceiptRevert,
|
|
3235
|
+
} as never)
|
|
3236
|
+
const { args } = transfer.extractEvent(receipt.logs)
|
|
3237
|
+
return {
|
|
3238
|
+
...args,
|
|
3239
|
+
receipt,
|
|
3240
|
+
} as never
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
export namespace transferSync {
|
|
3244
|
+
export type Parameters<
|
|
3245
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3246
|
+
account extends Account | undefined = Account | undefined,
|
|
3247
|
+
> = transfer.Parameters<chain, account>
|
|
3248
|
+
|
|
3249
|
+
export type Args = transfer.Args
|
|
3250
|
+
|
|
3251
|
+
export type ReturnValue = GetEventArgs<
|
|
3252
|
+
typeof Abis.tip20,
|
|
3253
|
+
'Transfer',
|
|
3254
|
+
{ IndexedOnly: false; Required: true }
|
|
3255
|
+
> & {
|
|
3256
|
+
receipt: TransactionReceipt
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
// TODO: exhaustive error type
|
|
3260
|
+
export type ErrorType = BaseErrorType
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
/**
|
|
3264
|
+
* Unpauses a TIP20 token.
|
|
3265
|
+
*
|
|
3266
|
+
* @example
|
|
3267
|
+
* ```ts
|
|
3268
|
+
* import { createClient, http } from 'viem'
|
|
3269
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3270
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3271
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3272
|
+
*
|
|
3273
|
+
* const client = createClient({
|
|
3274
|
+
* account: privateKeyToAccount('0x...'),
|
|
3275
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3276
|
+
* transport: http(),
|
|
3277
|
+
* })
|
|
3278
|
+
*
|
|
3279
|
+
* const result = await Actions.token.unpause(client, {
|
|
3280
|
+
* token: '0x...',
|
|
3281
|
+
* })
|
|
3282
|
+
* ```
|
|
3283
|
+
*
|
|
3284
|
+
* @param client - Client.
|
|
3285
|
+
* @param parameters - Parameters.
|
|
3286
|
+
* @returns The transaction hash.
|
|
3287
|
+
*/
|
|
3288
|
+
export async function unpause<
|
|
3289
|
+
chain extends Chain | undefined,
|
|
3290
|
+
account extends Account | undefined,
|
|
3291
|
+
>(
|
|
3292
|
+
client: Client<Transport, chain, account>,
|
|
3293
|
+
parameters: unpause.Parameters<chain, account>,
|
|
3294
|
+
): Promise<unpause.ReturnValue> {
|
|
3295
|
+
return unpause.inner(writeContract, client, parameters)
|
|
3296
|
+
}
|
|
3297
|
+
|
|
3298
|
+
export namespace unpause {
|
|
3299
|
+
export type Parameters<
|
|
3300
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3301
|
+
account extends Account | undefined = Account | undefined,
|
|
3302
|
+
> = WriteParameters<chain, account> & Args
|
|
3303
|
+
|
|
3304
|
+
export type Args = {
|
|
3305
|
+
/** Address or ID of the TIP20 token. */
|
|
3306
|
+
token: TokenId.TokenIdOrAddress
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
export type ReturnValue = WriteContractReturnType
|
|
3310
|
+
|
|
3311
|
+
// TODO: exhaustive error type
|
|
3312
|
+
export type ErrorType = BaseErrorType
|
|
3313
|
+
|
|
3314
|
+
/** @internal */
|
|
3315
|
+
export async function inner<
|
|
3316
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
3317
|
+
chain extends Chain | undefined,
|
|
3318
|
+
account extends Account | undefined,
|
|
3319
|
+
>(
|
|
3320
|
+
action: action,
|
|
3321
|
+
client: Client<Transport, chain, account>,
|
|
3322
|
+
parameters: unpause.Parameters<chain, account>,
|
|
3323
|
+
): Promise<ReturnType<action>> {
|
|
3324
|
+
const { token, ...rest } = parameters
|
|
3325
|
+
const call = unpause.call({ token })
|
|
3326
|
+
return (await action(client, {
|
|
3327
|
+
...rest,
|
|
3328
|
+
...call,
|
|
3329
|
+
} as never)) as never
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
/**
|
|
3333
|
+
* Defines a call to the `unpause` function.
|
|
3334
|
+
*
|
|
3335
|
+
* Can be passed as a parameter to:
|
|
3336
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
3337
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
3338
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
3339
|
+
*
|
|
3340
|
+
* @example
|
|
3341
|
+
* ```ts
|
|
3342
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
3343
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3344
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3345
|
+
*
|
|
3346
|
+
* const client = createClient({
|
|
3347
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3348
|
+
* transport: http(),
|
|
3349
|
+
* }).extend(walletActions)
|
|
3350
|
+
*
|
|
3351
|
+
* const { result } = await client.sendCalls({
|
|
3352
|
+
* calls: [
|
|
3353
|
+
* actions.token.unpause.call({
|
|
3354
|
+
* token: '0x20c0...babe',
|
|
3355
|
+
* }),
|
|
3356
|
+
* ]
|
|
3357
|
+
* })
|
|
3358
|
+
* ```
|
|
3359
|
+
*
|
|
3360
|
+
* @param args - Arguments.
|
|
3361
|
+
* @returns The call.
|
|
3362
|
+
*/
|
|
3363
|
+
export function call(args: Args) {
|
|
3364
|
+
const { token } = args
|
|
3365
|
+
return defineCall({
|
|
3366
|
+
address: TokenId.toAddress(token),
|
|
3367
|
+
abi: Abis.tip20,
|
|
3368
|
+
functionName: 'unpause',
|
|
3369
|
+
args: [],
|
|
3370
|
+
})
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
/**
|
|
3374
|
+
* Extracts the event from the logs.
|
|
3375
|
+
*
|
|
3376
|
+
* @param logs - Logs.
|
|
3377
|
+
* @returns The event.
|
|
3378
|
+
*/
|
|
3379
|
+
export function extractEvent(logs: Log[]) {
|
|
3380
|
+
const [log] = parseEventLogs({
|
|
3381
|
+
abi: Abis.tip20,
|
|
3382
|
+
logs,
|
|
3383
|
+
eventName: 'PauseStateUpdate',
|
|
3384
|
+
})
|
|
3385
|
+
if (!log) throw new Error('`PauseStateUpdate` event not found.')
|
|
3386
|
+
return log
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
/**
|
|
3391
|
+
* Unpauses a TIP20 token.
|
|
3392
|
+
*
|
|
3393
|
+
* @example
|
|
3394
|
+
* ```ts
|
|
3395
|
+
* import { createClient, http } from 'viem'
|
|
3396
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3397
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3398
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3399
|
+
*
|
|
3400
|
+
* const client = createClient({
|
|
3401
|
+
* account: privateKeyToAccount('0x...'),
|
|
3402
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3403
|
+
* transport: http(),
|
|
3404
|
+
* })
|
|
3405
|
+
*
|
|
3406
|
+
* const result = await Actions.token.unpauseSync(client, {
|
|
3407
|
+
* token: '0x...',
|
|
3408
|
+
* })
|
|
3409
|
+
* ```
|
|
3410
|
+
*
|
|
3411
|
+
* @param client - Client.
|
|
3412
|
+
* @param parameters - Parameters.
|
|
3413
|
+
* @returns The transaction receipt and event data.
|
|
3414
|
+
*/
|
|
3415
|
+
export async function unpauseSync<
|
|
3416
|
+
chain extends Chain | undefined,
|
|
3417
|
+
account extends Account | undefined,
|
|
3418
|
+
>(
|
|
3419
|
+
client: Client<Transport, chain, account>,
|
|
3420
|
+
parameters: unpauseSync.Parameters<chain, account>,
|
|
3421
|
+
): Promise<unpauseSync.ReturnValue> {
|
|
3422
|
+
const { throwOnReceiptRevert = true, ...rest } = parameters
|
|
3423
|
+
const receipt = await unpause.inner(writeContractSync, client, {
|
|
3424
|
+
...rest,
|
|
3425
|
+
throwOnReceiptRevert,
|
|
3426
|
+
} as never)
|
|
3427
|
+
const { args } = unpause.extractEvent(receipt.logs)
|
|
3428
|
+
return {
|
|
3429
|
+
...args,
|
|
3430
|
+
receipt,
|
|
3431
|
+
} as never
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
export namespace unpauseSync {
|
|
3435
|
+
export type Parameters<
|
|
3436
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3437
|
+
account extends Account | undefined = Account | undefined,
|
|
3438
|
+
> = unpause.Parameters<chain, account>
|
|
3439
|
+
|
|
3440
|
+
export type Args = unpause.Args
|
|
3441
|
+
|
|
3442
|
+
export type ReturnValue = GetEventArgs<
|
|
3443
|
+
typeof Abis.tip20,
|
|
3444
|
+
'PauseStateUpdate',
|
|
3445
|
+
{ IndexedOnly: false; Required: true }
|
|
3446
|
+
> & {
|
|
3447
|
+
receipt: TransactionReceipt
|
|
3448
|
+
}
|
|
3449
|
+
|
|
3450
|
+
// TODO: exhaustive error type
|
|
3451
|
+
export type ErrorType = BaseErrorType
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3454
|
+
/**
|
|
3455
|
+
* Updates the quote token for a TIP20 token.
|
|
3456
|
+
*
|
|
3457
|
+
* @example
|
|
3458
|
+
* ```ts
|
|
3459
|
+
* import { createClient, http } from 'viem'
|
|
3460
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3461
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3462
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3463
|
+
*
|
|
3464
|
+
* const client = createClient({
|
|
3465
|
+
* account: privateKeyToAccount('0x...'),
|
|
3466
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3467
|
+
* transport: http(),
|
|
3468
|
+
* })
|
|
3469
|
+
*
|
|
3470
|
+
* const result = await Actions.token.prepareUpdateQuoteToken(client, {
|
|
3471
|
+
* token: '0x...',
|
|
3472
|
+
* quoteToken: '0x...',
|
|
3473
|
+
* })
|
|
3474
|
+
* ```
|
|
3475
|
+
*
|
|
3476
|
+
* @param client - Client.
|
|
3477
|
+
* @param parameters - Parameters.
|
|
3478
|
+
* @returns The transaction hash.
|
|
3479
|
+
*/
|
|
3480
|
+
export async function prepareUpdateQuoteToken<
|
|
3481
|
+
chain extends Chain | undefined,
|
|
3482
|
+
account extends Account | undefined,
|
|
3483
|
+
>(
|
|
3484
|
+
client: Client<Transport, chain, account>,
|
|
3485
|
+
parameters: prepareUpdateQuoteToken.Parameters<chain, account>,
|
|
3486
|
+
): Promise<prepareUpdateQuoteToken.ReturnValue> {
|
|
3487
|
+
return prepareUpdateQuoteToken.inner(writeContract, client, parameters)
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3490
|
+
export namespace prepareUpdateQuoteToken {
|
|
3491
|
+
export type Parameters<
|
|
3492
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3493
|
+
account extends Account | undefined = Account | undefined,
|
|
3494
|
+
> = WriteParameters<chain, account> & Args
|
|
3495
|
+
|
|
3496
|
+
export type Args = {
|
|
3497
|
+
/** New quote token address. */
|
|
3498
|
+
quoteToken: TokenId.TokenIdOrAddress
|
|
3499
|
+
/** Address or ID of the TIP20 token. */
|
|
3500
|
+
token: TokenId.TokenIdOrAddress
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
export type ReturnValue = WriteContractReturnType
|
|
3504
|
+
|
|
3505
|
+
// TODO: exhaustive error type
|
|
3506
|
+
export type ErrorType = BaseErrorType
|
|
3507
|
+
|
|
3508
|
+
/** @internal */
|
|
3509
|
+
export async function inner<
|
|
3510
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
3511
|
+
chain extends Chain | undefined,
|
|
3512
|
+
account extends Account | undefined,
|
|
3513
|
+
>(
|
|
3514
|
+
action: action,
|
|
3515
|
+
client: Client<Transport, chain, account>,
|
|
3516
|
+
parameters: prepareUpdateQuoteToken.Parameters<chain, account>,
|
|
3517
|
+
): Promise<ReturnType<action>> {
|
|
3518
|
+
const { quoteToken, token, ...rest } = parameters
|
|
3519
|
+
const call = prepareUpdateQuoteToken.call({ quoteToken, token })
|
|
3520
|
+
return (await action(client, {
|
|
3521
|
+
...rest,
|
|
3522
|
+
...call,
|
|
3523
|
+
} as never)) as never
|
|
3524
|
+
}
|
|
3525
|
+
|
|
3526
|
+
/**
|
|
3527
|
+
* Defines a call to the `prepareUpdateQuoteToken` function.
|
|
3528
|
+
*
|
|
3529
|
+
* Can be passed as a parameter to:
|
|
3530
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
3531
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
3532
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
3533
|
+
*
|
|
3534
|
+
* @example
|
|
3535
|
+
* ```ts
|
|
3536
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
3537
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3538
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3539
|
+
*
|
|
3540
|
+
* const client = createClient({
|
|
3541
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3542
|
+
* transport: http(),
|
|
3543
|
+
* }).extend(walletActions)
|
|
3544
|
+
*
|
|
3545
|
+
* const { result } = await client.sendCalls({
|
|
3546
|
+
* calls: [
|
|
3547
|
+
* actions.token.prepareUpdateQuoteToken.call({
|
|
3548
|
+
* token: '0x20c0...babe',
|
|
3549
|
+
* quoteToken: '0x20c0...cafe',
|
|
3550
|
+
* }),
|
|
3551
|
+
* ]
|
|
3552
|
+
* })
|
|
3553
|
+
* ```
|
|
3554
|
+
*
|
|
3555
|
+
* @param args - Arguments.
|
|
3556
|
+
* @returns The call.
|
|
3557
|
+
*/
|
|
3558
|
+
export function call(args: Args) {
|
|
3559
|
+
const { token, quoteToken } = args
|
|
3560
|
+
return defineCall({
|
|
3561
|
+
address: TokenId.toAddress(token),
|
|
3562
|
+
abi: Abis.tip20,
|
|
3563
|
+
functionName: 'setNextQuoteToken',
|
|
3564
|
+
args: [TokenId.toAddress(quoteToken)],
|
|
3565
|
+
})
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
/**
|
|
3569
|
+
* Extracts the event from the logs.
|
|
3570
|
+
*
|
|
3571
|
+
* @param logs - Logs.
|
|
3572
|
+
* @returns The event.
|
|
3573
|
+
*/
|
|
3574
|
+
export function extractEvent(logs: Log[]) {
|
|
3575
|
+
const [log] = parseEventLogs({
|
|
3576
|
+
abi: Abis.tip20,
|
|
3577
|
+
logs,
|
|
3578
|
+
eventName: 'NextQuoteTokenSet',
|
|
3579
|
+
})
|
|
3580
|
+
if (!log) throw new Error('`NextQuoteTokenSet` event not found.')
|
|
3581
|
+
return log
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
/**
|
|
3586
|
+
* Updates the quote token for a TIP20 token.
|
|
3587
|
+
*
|
|
3588
|
+
* @example
|
|
3589
|
+
* ```ts
|
|
3590
|
+
* import { createClient, http } from 'viem'
|
|
3591
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3592
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3593
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3594
|
+
*
|
|
3595
|
+
* const client = createClient({
|
|
3596
|
+
* account: privateKeyToAccount('0x...'),
|
|
3597
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3598
|
+
* transport: http(),
|
|
3599
|
+
* })
|
|
3600
|
+
*
|
|
3601
|
+
* const result = await Actions.token.prepareUpdateQuoteTokenSync(client, {
|
|
3602
|
+
* token: '0x...',
|
|
3603
|
+
* quoteToken: '0x...',
|
|
3604
|
+
* })
|
|
3605
|
+
* ```
|
|
3606
|
+
*
|
|
3607
|
+
* @param client - Client.
|
|
3608
|
+
* @param parameters - Parameters.
|
|
3609
|
+
* @returns The transaction receipt and event data.
|
|
3610
|
+
*/
|
|
3611
|
+
export async function prepareUpdateQuoteTokenSync<
|
|
3612
|
+
chain extends Chain | undefined,
|
|
3613
|
+
account extends Account | undefined,
|
|
3614
|
+
>(
|
|
3615
|
+
client: Client<Transport, chain, account>,
|
|
3616
|
+
parameters: prepareUpdateQuoteTokenSync.Parameters<chain, account>,
|
|
3617
|
+
): Promise<prepareUpdateQuoteTokenSync.ReturnValue> {
|
|
3618
|
+
const receipt = await prepareUpdateQuoteToken.inner(
|
|
3619
|
+
writeContractSync,
|
|
3620
|
+
client,
|
|
3621
|
+
parameters,
|
|
3622
|
+
)
|
|
3623
|
+
const { args } = prepareUpdateQuoteToken.extractEvent(receipt.logs)
|
|
3624
|
+
return {
|
|
3625
|
+
...args,
|
|
3626
|
+
receipt,
|
|
3627
|
+
} as never
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3630
|
+
export namespace prepareUpdateQuoteTokenSync {
|
|
3631
|
+
export type Parameters<
|
|
3632
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3633
|
+
account extends Account | undefined = Account | undefined,
|
|
3634
|
+
> = prepareUpdateQuoteToken.Parameters<chain, account>
|
|
3635
|
+
|
|
3636
|
+
export type Args = prepareUpdateQuoteToken.Args
|
|
3637
|
+
|
|
3638
|
+
export type ReturnValue = Compute<
|
|
3639
|
+
GetEventArgs<
|
|
3640
|
+
typeof Abis.tip20,
|
|
3641
|
+
'NextQuoteTokenSet',
|
|
3642
|
+
{
|
|
3643
|
+
IndexedOnly: false
|
|
3644
|
+
Required: true
|
|
3645
|
+
}
|
|
3646
|
+
> & {
|
|
3647
|
+
receipt: TransactionReceipt
|
|
3648
|
+
}
|
|
3649
|
+
>
|
|
3650
|
+
|
|
3651
|
+
// TODO: exhaustive error type
|
|
3652
|
+
export type ErrorType = BaseErrorType
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
/**
|
|
3656
|
+
* Updates the quote token for a TIP20 token.
|
|
3657
|
+
*
|
|
3658
|
+
* @example
|
|
3659
|
+
* ```ts
|
|
3660
|
+
* import { createClient, http } from 'viem'
|
|
3661
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3662
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3663
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3664
|
+
*
|
|
3665
|
+
* const client = createClient({
|
|
3666
|
+
* account: privateKeyToAccount('0x...'),
|
|
3667
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3668
|
+
* transport: http(),
|
|
3669
|
+
* })
|
|
3670
|
+
*
|
|
3671
|
+
* const result = await Actions.token.updateQuoteToken(client, {
|
|
3672
|
+
* token: '0x...',
|
|
3673
|
+
* })
|
|
3674
|
+
* ```
|
|
3675
|
+
*
|
|
3676
|
+
* @param client - Client.
|
|
3677
|
+
* @param parameters - Parameters.
|
|
3678
|
+
* @returns The transaction hash.
|
|
3679
|
+
*/
|
|
3680
|
+
export async function updateQuoteToken<
|
|
3681
|
+
chain extends Chain | undefined,
|
|
3682
|
+
account extends Account | undefined,
|
|
3683
|
+
>(
|
|
3684
|
+
client: Client<Transport, chain, account>,
|
|
3685
|
+
parameters: updateQuoteToken.Parameters<chain, account>,
|
|
3686
|
+
): Promise<updateQuoteToken.ReturnValue> {
|
|
3687
|
+
return updateQuoteToken.inner(writeContract, client, parameters)
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
export namespace updateQuoteToken {
|
|
3691
|
+
export type Parameters<
|
|
3692
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3693
|
+
account extends Account | undefined = Account | undefined,
|
|
3694
|
+
> = WriteParameters<chain, account> & Args
|
|
3695
|
+
|
|
3696
|
+
export type Args = {
|
|
3697
|
+
/** Address or ID of the TIP20 token. */
|
|
3698
|
+
token: TokenId.TokenIdOrAddress
|
|
3699
|
+
}
|
|
3700
|
+
|
|
3701
|
+
export type ReturnValue = WriteContractReturnType
|
|
3702
|
+
|
|
3703
|
+
// TODO: exhaustive error type
|
|
3704
|
+
export type ErrorType = BaseErrorType
|
|
3705
|
+
|
|
3706
|
+
/** @internal */
|
|
3707
|
+
export async function inner<
|
|
3708
|
+
action extends typeof writeContract | typeof writeContractSync,
|
|
3709
|
+
chain extends Chain | undefined,
|
|
3710
|
+
account extends Account | undefined,
|
|
3711
|
+
>(
|
|
3712
|
+
action: action,
|
|
3713
|
+
client: Client<Transport, chain, account>,
|
|
3714
|
+
parameters: updateQuoteToken.Parameters<chain, account>,
|
|
3715
|
+
): Promise<ReturnType<action>> {
|
|
3716
|
+
const { token, ...rest } = parameters
|
|
3717
|
+
const call = updateQuoteToken.call({ token })
|
|
3718
|
+
return (await action(client, {
|
|
3719
|
+
...rest,
|
|
3720
|
+
...call,
|
|
3721
|
+
} as never)) as never
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3724
|
+
/**
|
|
3725
|
+
* Defines a call to the `updateQuoteToken` function.
|
|
3726
|
+
*
|
|
3727
|
+
* Can be passed as a parameter to:
|
|
3728
|
+
* - [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas): estimate the gas cost of the call
|
|
3729
|
+
* - [`simulateContract`](https://viem.sh/docs/contract/simulateContract): simulate the call
|
|
3730
|
+
* - [`sendCalls`](https://viem.sh/docs/actions/wallet/sendCalls): send multiple calls
|
|
3731
|
+
*
|
|
3732
|
+
* @example
|
|
3733
|
+
* ```ts
|
|
3734
|
+
* import { createClient, http, walletActions } from 'viem'
|
|
3735
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3736
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3737
|
+
*
|
|
3738
|
+
* const client = createClient({
|
|
3739
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3740
|
+
* transport: http(),
|
|
3741
|
+
* }).extend(walletActions)
|
|
3742
|
+
*
|
|
3743
|
+
* const { result } = await client.sendCalls({
|
|
3744
|
+
* calls: [
|
|
3745
|
+
* actions.token.updateQuoteToken.call({
|
|
3746
|
+
* token: '0x20c0...babe',
|
|
3747
|
+
* }),
|
|
3748
|
+
* ]
|
|
3749
|
+
* })
|
|
3750
|
+
* ```
|
|
3751
|
+
*
|
|
3752
|
+
* @param args - Arguments.
|
|
3753
|
+
* @returns The call.
|
|
3754
|
+
*/
|
|
3755
|
+
export function call(args: Args) {
|
|
3756
|
+
const { token } = args
|
|
3757
|
+
return defineCall({
|
|
3758
|
+
address: TokenId.toAddress(token),
|
|
3759
|
+
abi: Abis.tip20,
|
|
3760
|
+
functionName: 'completeQuoteTokenUpdate',
|
|
3761
|
+
args: [],
|
|
3762
|
+
})
|
|
3763
|
+
}
|
|
3764
|
+
|
|
3765
|
+
/**
|
|
3766
|
+
* Extracts the event from the logs.
|
|
3767
|
+
*
|
|
3768
|
+
* @param logs - Logs.
|
|
3769
|
+
* @returns The event.
|
|
3770
|
+
*/
|
|
3771
|
+
export function extractEvent(logs: Log[]) {
|
|
3772
|
+
const [log] = parseEventLogs({
|
|
3773
|
+
abi: Abis.tip20,
|
|
3774
|
+
logs,
|
|
3775
|
+
eventName: 'QuoteTokenUpdate',
|
|
3776
|
+
})
|
|
3777
|
+
if (!log) throw new Error('`QuoteTokenUpdateCompleted` event not found.')
|
|
3778
|
+
return log
|
|
3779
|
+
}
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3782
|
+
/**
|
|
3783
|
+
* Updates the quote token for a TIP20 token.
|
|
3784
|
+
*
|
|
3785
|
+
* @example
|
|
3786
|
+
* ```ts
|
|
3787
|
+
* import { createClient, http } from 'viem'
|
|
3788
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3789
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3790
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
3791
|
+
*
|
|
3792
|
+
* const client = createClient({
|
|
3793
|
+
* account: privateKeyToAccount('0x...'),
|
|
3794
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3795
|
+
* transport: http(),
|
|
3796
|
+
* })
|
|
3797
|
+
*
|
|
3798
|
+
* const result = await Actions.token.updateQuoteTokenSync(client, {
|
|
3799
|
+
* token: '0x...',
|
|
3800
|
+
* })
|
|
3801
|
+
* ```
|
|
3802
|
+
*
|
|
3803
|
+
* @param client - Client.
|
|
3804
|
+
* @param parameters - Parameters.
|
|
3805
|
+
* @returns The transaction receipt and event data.
|
|
3806
|
+
*/
|
|
3807
|
+
export async function updateQuoteTokenSync<
|
|
3808
|
+
chain extends Chain | undefined,
|
|
3809
|
+
account extends Account | undefined,
|
|
3810
|
+
>(
|
|
3811
|
+
client: Client<Transport, chain, account>,
|
|
3812
|
+
parameters: updateQuoteTokenSync.Parameters<chain, account>,
|
|
3813
|
+
): Promise<updateQuoteTokenSync.ReturnValue> {
|
|
3814
|
+
const receipt = await updateQuoteToken.inner(
|
|
3815
|
+
writeContractSync,
|
|
3816
|
+
client,
|
|
3817
|
+
parameters,
|
|
3818
|
+
)
|
|
3819
|
+
const { args } = updateQuoteToken.extractEvent(receipt.logs)
|
|
3820
|
+
return {
|
|
3821
|
+
...args,
|
|
3822
|
+
receipt,
|
|
3823
|
+
} as never
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
export namespace updateQuoteTokenSync {
|
|
3827
|
+
export type Parameters<
|
|
3828
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
3829
|
+
account extends Account | undefined = Account | undefined,
|
|
3830
|
+
> = updateQuoteToken.Parameters<chain, account>
|
|
3831
|
+
|
|
3832
|
+
export type Args = updateQuoteToken.Args
|
|
3833
|
+
|
|
3834
|
+
export type ReturnValue = Compute<
|
|
3835
|
+
GetEventArgs<
|
|
3836
|
+
typeof Abis.tip20,
|
|
3837
|
+
'QuoteTokenUpdate',
|
|
3838
|
+
{
|
|
3839
|
+
IndexedOnly: false
|
|
3840
|
+
Required: true
|
|
3841
|
+
}
|
|
3842
|
+
> & {
|
|
3843
|
+
receipt: TransactionReceipt
|
|
3844
|
+
}
|
|
3845
|
+
>
|
|
3846
|
+
|
|
3847
|
+
// TODO: exhaustive error type
|
|
3848
|
+
export type ErrorType = BaseErrorType
|
|
3849
|
+
}
|
|
3850
|
+
|
|
3851
|
+
/**
|
|
3852
|
+
* Watches for TIP20 token approval events.
|
|
3853
|
+
*
|
|
3854
|
+
* @example
|
|
3855
|
+
* ```ts
|
|
3856
|
+
* import { createClient, http } from 'viem'
|
|
3857
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3858
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3859
|
+
*
|
|
3860
|
+
* const client = createClient({
|
|
3861
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3862
|
+
* transport: http(),
|
|
3863
|
+
* })
|
|
3864
|
+
*
|
|
3865
|
+
* const unwatch = actions.token.watchApprove(client, {
|
|
3866
|
+
* onApproval: (args, log) => {
|
|
3867
|
+
* console.log('Approval:', args)
|
|
3868
|
+
* },
|
|
3869
|
+
* })
|
|
3870
|
+
* ```
|
|
3871
|
+
*
|
|
3872
|
+
* @param client - Client.
|
|
3873
|
+
* @param parameters - Parameters.
|
|
3874
|
+
* @returns A function to unsubscribe from the event.
|
|
3875
|
+
*/
|
|
3876
|
+
export function watchApprove<
|
|
3877
|
+
chain extends Chain | undefined,
|
|
3878
|
+
account extends Account | undefined,
|
|
3879
|
+
>(
|
|
3880
|
+
client: Client<Transport, chain, account>,
|
|
3881
|
+
parameters: watchApprove.Parameters,
|
|
3882
|
+
) {
|
|
3883
|
+
const { onApproval, token, ...rest } = parameters
|
|
3884
|
+
return watchContractEvent(client, {
|
|
3885
|
+
...rest,
|
|
3886
|
+
address: TokenId.toAddress(token),
|
|
3887
|
+
abi: Abis.tip20,
|
|
3888
|
+
eventName: 'Approval',
|
|
3889
|
+
onLogs: (logs) => {
|
|
3890
|
+
for (const log of logs) onApproval(log.args, log)
|
|
3891
|
+
},
|
|
3892
|
+
strict: true,
|
|
3893
|
+
})
|
|
3894
|
+
}
|
|
3895
|
+
|
|
3896
|
+
export declare namespace watchApprove {
|
|
3897
|
+
export type Args = GetEventArgs<
|
|
3898
|
+
typeof Abis.tip20,
|
|
3899
|
+
'Approval',
|
|
3900
|
+
{ IndexedOnly: false; Required: true }
|
|
3901
|
+
>
|
|
3902
|
+
|
|
3903
|
+
export type Log = viem_Log<
|
|
3904
|
+
bigint,
|
|
3905
|
+
number,
|
|
3906
|
+
false,
|
|
3907
|
+
ExtractAbiItem<typeof Abis.tip20, 'Approval'>,
|
|
3908
|
+
true
|
|
3909
|
+
>
|
|
3910
|
+
|
|
3911
|
+
export type Parameters = UnionOmit<
|
|
3912
|
+
WatchContractEventParameters<typeof Abis.tip20, 'Approval', true>,
|
|
3913
|
+
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
3914
|
+
> & {
|
|
3915
|
+
/** Callback to invoke when tokens are approved. */
|
|
3916
|
+
onApproval: (args: Args, log: Log) => void
|
|
3917
|
+
/** Address or ID of the TIP20 token. */
|
|
3918
|
+
token: TokenId.TokenIdOrAddress
|
|
3919
|
+
}
|
|
3920
|
+
}
|
|
3921
|
+
|
|
3922
|
+
/**
|
|
3923
|
+
* Watches for TIP20 token burn events.
|
|
3924
|
+
*
|
|
3925
|
+
* @example
|
|
3926
|
+
* ```ts
|
|
3927
|
+
* import { createClient, http } from 'viem'
|
|
3928
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3929
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3930
|
+
*
|
|
3931
|
+
* const client = createClient({
|
|
3932
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
3933
|
+
* transport: http(),
|
|
3934
|
+
* })
|
|
3935
|
+
*
|
|
3936
|
+
* const unwatch = actions.token.watchBurn(client, {
|
|
3937
|
+
* onBurn: (args, log) => {
|
|
3938
|
+
* console.log('Burn:', args)
|
|
3939
|
+
* },
|
|
3940
|
+
* })
|
|
3941
|
+
* ```
|
|
3942
|
+
*
|
|
3943
|
+
* @param client - Client.
|
|
3944
|
+
* @param parameters - Parameters.
|
|
3945
|
+
* @returns A function to unsubscribe from the event.
|
|
3946
|
+
*/
|
|
3947
|
+
export function watchBurn<
|
|
3948
|
+
chain extends Chain | undefined,
|
|
3949
|
+
account extends Account | undefined,
|
|
3950
|
+
>(client: Client<Transport, chain, account>, parameters: watchBurn.Parameters) {
|
|
3951
|
+
const { onBurn, token, ...rest } = parameters
|
|
3952
|
+
return watchContractEvent(client, {
|
|
3953
|
+
...rest,
|
|
3954
|
+
address: TokenId.toAddress(token),
|
|
3955
|
+
abi: Abis.tip20,
|
|
3956
|
+
eventName: 'Burn',
|
|
3957
|
+
onLogs: (logs) => {
|
|
3958
|
+
for (const log of logs) onBurn(log.args, log)
|
|
3959
|
+
},
|
|
3960
|
+
strict: true,
|
|
3961
|
+
})
|
|
3962
|
+
}
|
|
3963
|
+
|
|
3964
|
+
export declare namespace watchBurn {
|
|
3965
|
+
export type Args = GetEventArgs<
|
|
3966
|
+
typeof Abis.tip20,
|
|
3967
|
+
'Burn',
|
|
3968
|
+
{ IndexedOnly: false; Required: true }
|
|
3969
|
+
>
|
|
3970
|
+
|
|
3971
|
+
export type Log = viem_Log<
|
|
3972
|
+
bigint,
|
|
3973
|
+
number,
|
|
3974
|
+
false,
|
|
3975
|
+
ExtractAbiItem<typeof Abis.tip20, 'Burn'>,
|
|
3976
|
+
true
|
|
3977
|
+
>
|
|
3978
|
+
|
|
3979
|
+
export type Parameters = UnionOmit<
|
|
3980
|
+
WatchContractEventParameters<typeof Abis.tip20, 'Burn', true>,
|
|
3981
|
+
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
3982
|
+
> & {
|
|
3983
|
+
/** Callback to invoke when tokens are burned. */
|
|
3984
|
+
onBurn: (args: Args, log: Log) => void
|
|
3985
|
+
/** Address or ID of the TIP20 token. */
|
|
3986
|
+
token: TokenId.TokenIdOrAddress
|
|
3987
|
+
}
|
|
3988
|
+
}
|
|
3989
|
+
|
|
3990
|
+
/**
|
|
3991
|
+
* Watches for new TIP20 tokens created.
|
|
3992
|
+
*
|
|
3993
|
+
* @example
|
|
3994
|
+
* ```ts
|
|
3995
|
+
* import { createClient, http } from 'viem'
|
|
3996
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
3997
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
3998
|
+
*
|
|
3999
|
+
* const client = createClient({
|
|
4000
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
4001
|
+
* transport: http(),
|
|
4002
|
+
* })
|
|
4003
|
+
*
|
|
4004
|
+
* const unwatch = actions.token.watchCreate(client, {
|
|
4005
|
+
* onTokenCreated: (args, log) => {
|
|
4006
|
+
* console.log('Token created:', args)
|
|
4007
|
+
* },
|
|
4008
|
+
* })
|
|
4009
|
+
* ```
|
|
4010
|
+
*
|
|
4011
|
+
* @param client - Client.
|
|
4012
|
+
* @param parameters - Parameters.
|
|
4013
|
+
* @returns A function to unsubscribe from the event.
|
|
4014
|
+
*/
|
|
4015
|
+
export function watchCreate<
|
|
4016
|
+
chain extends Chain | undefined,
|
|
4017
|
+
account extends Account | undefined,
|
|
4018
|
+
>(
|
|
4019
|
+
client: Client<Transport, chain, account>,
|
|
4020
|
+
parameters: watchCreate.Parameters,
|
|
4021
|
+
) {
|
|
4022
|
+
const { onTokenCreated, ...rest } = parameters
|
|
4023
|
+
return watchContractEvent(client, {
|
|
4024
|
+
...rest,
|
|
4025
|
+
address: Addresses.tip20Factory,
|
|
4026
|
+
abi: Abis.tip20Factory,
|
|
4027
|
+
eventName: 'TokenCreated',
|
|
4028
|
+
onLogs: (logs) => {
|
|
4029
|
+
for (const log of logs) onTokenCreated(log.args, log)
|
|
4030
|
+
},
|
|
4031
|
+
strict: true,
|
|
4032
|
+
})
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
export declare namespace watchCreate {
|
|
4036
|
+
export type Args = GetEventArgs<
|
|
4037
|
+
typeof Abis.tip20Factory,
|
|
4038
|
+
'TokenCreated',
|
|
4039
|
+
{ IndexedOnly: false; Required: true }
|
|
4040
|
+
>
|
|
4041
|
+
|
|
4042
|
+
export type Log = viem_Log<
|
|
4043
|
+
bigint,
|
|
4044
|
+
number,
|
|
4045
|
+
false,
|
|
4046
|
+
ExtractAbiItem<typeof Abis.tip20Factory, 'TokenCreated'>,
|
|
4047
|
+
true
|
|
4048
|
+
>
|
|
4049
|
+
|
|
4050
|
+
export type Parameters = UnionOmit<
|
|
4051
|
+
WatchContractEventParameters<
|
|
4052
|
+
typeof Abis.tip20Factory,
|
|
4053
|
+
'TokenCreated',
|
|
4054
|
+
true
|
|
4055
|
+
>,
|
|
4056
|
+
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
4057
|
+
> & {
|
|
4058
|
+
/** Callback to invoke when a new TIP20 token is created. */
|
|
4059
|
+
onTokenCreated: (args: Args, log: Log) => void
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
|
|
4063
|
+
/**
|
|
4064
|
+
* Watches for TIP20 token mint events.
|
|
4065
|
+
*
|
|
4066
|
+
* @example
|
|
4067
|
+
* ```ts
|
|
4068
|
+
* import { createClient, http } from 'viem'
|
|
4069
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
4070
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
4071
|
+
*
|
|
4072
|
+
* const client = createClient({
|
|
4073
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
4074
|
+
* transport: http(),
|
|
4075
|
+
* })
|
|
4076
|
+
*
|
|
4077
|
+
* const unwatch = actions.token.watchMint(client, {
|
|
4078
|
+
* onMint: (args, log) => {
|
|
4079
|
+
* console.log('Mint:', args)
|
|
4080
|
+
* },
|
|
4081
|
+
* })
|
|
4082
|
+
* ```
|
|
4083
|
+
*
|
|
4084
|
+
* @param client - Client.
|
|
4085
|
+
* @param parameters - Parameters.
|
|
4086
|
+
* @returns A function to unsubscribe from the event.
|
|
4087
|
+
*/
|
|
4088
|
+
export function watchMint<
|
|
4089
|
+
chain extends Chain | undefined,
|
|
4090
|
+
account extends Account | undefined,
|
|
4091
|
+
>(client: Client<Transport, chain, account>, parameters: watchMint.Parameters) {
|
|
4092
|
+
const { onMint, token, ...rest } = parameters
|
|
4093
|
+
return watchContractEvent(client, {
|
|
4094
|
+
...rest,
|
|
4095
|
+
address: TokenId.toAddress(token),
|
|
4096
|
+
abi: Abis.tip20,
|
|
4097
|
+
eventName: 'Mint',
|
|
4098
|
+
onLogs: (logs) => {
|
|
4099
|
+
for (const log of logs) onMint(log.args, log)
|
|
4100
|
+
},
|
|
4101
|
+
strict: true,
|
|
4102
|
+
})
|
|
4103
|
+
}
|
|
4104
|
+
|
|
4105
|
+
export declare namespace watchMint {
|
|
4106
|
+
export type Args = GetEventArgs<
|
|
4107
|
+
typeof Abis.tip20,
|
|
4108
|
+
'Mint',
|
|
4109
|
+
{ IndexedOnly: false; Required: true }
|
|
4110
|
+
>
|
|
4111
|
+
|
|
4112
|
+
export type Log = viem_Log<
|
|
4113
|
+
bigint,
|
|
4114
|
+
number,
|
|
4115
|
+
false,
|
|
4116
|
+
ExtractAbiItem<typeof Abis.tip20, 'Mint'>,
|
|
4117
|
+
true
|
|
4118
|
+
>
|
|
4119
|
+
|
|
4120
|
+
export type Parameters = UnionOmit<
|
|
4121
|
+
WatchContractEventParameters<typeof Abis.tip20, 'Mint', true>,
|
|
4122
|
+
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
4123
|
+
> & {
|
|
4124
|
+
/** Callback to invoke when tokens are minted. */
|
|
4125
|
+
onMint: (args: Args, log: Log) => void
|
|
4126
|
+
/** Address or ID of the TIP20 token. */
|
|
4127
|
+
token: TokenId.TokenIdOrAddress
|
|
4128
|
+
}
|
|
4129
|
+
|
|
4130
|
+
export type ReturnValue = WatchContractEventReturnType
|
|
4131
|
+
}
|
|
4132
|
+
|
|
4133
|
+
/**
|
|
4134
|
+
* Watches for TIP20 token role admin updates.
|
|
4135
|
+
*
|
|
4136
|
+
* @example
|
|
4137
|
+
* ```ts
|
|
4138
|
+
* import { createClient, http } from 'viem'
|
|
4139
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
4140
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
4141
|
+
*
|
|
4142
|
+
* const client = createClient({
|
|
4143
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
4144
|
+
* transport: http(),
|
|
4145
|
+
* })
|
|
4146
|
+
*
|
|
4147
|
+
* const unwatch = actions.token.watchAdminRole(client, {
|
|
4148
|
+
* onRoleAdminUpdated: (args, log) => {
|
|
4149
|
+
* console.log('Role admin updated:', args)
|
|
4150
|
+
* },
|
|
4151
|
+
* })
|
|
4152
|
+
* ```
|
|
4153
|
+
*
|
|
4154
|
+
* @param client - Client.
|
|
4155
|
+
* @param parameters - Parameters.
|
|
4156
|
+
* @returns A function to unsubscribe from the event.
|
|
4157
|
+
*/
|
|
4158
|
+
export function watchAdminRole<
|
|
4159
|
+
chain extends Chain | undefined,
|
|
4160
|
+
account extends Account | undefined,
|
|
4161
|
+
>(
|
|
4162
|
+
client: Client<Transport, chain, account>,
|
|
4163
|
+
parameters: watchAdminRole.Parameters,
|
|
4164
|
+
) {
|
|
4165
|
+
const { onRoleAdminUpdated, token, ...rest } = parameters
|
|
4166
|
+
return watchContractEvent(client, {
|
|
4167
|
+
...rest,
|
|
4168
|
+
address: TokenId.toAddress(token),
|
|
4169
|
+
abi: Abis.tip20,
|
|
4170
|
+
eventName: 'RoleAdminUpdated',
|
|
4171
|
+
onLogs: (logs) => {
|
|
4172
|
+
for (const log of logs) onRoleAdminUpdated(log.args, log)
|
|
4173
|
+
},
|
|
4174
|
+
strict: true,
|
|
4175
|
+
})
|
|
4176
|
+
}
|
|
4177
|
+
|
|
4178
|
+
export declare namespace watchAdminRole {
|
|
4179
|
+
export type Args = GetEventArgs<
|
|
4180
|
+
typeof Abis.tip20,
|
|
4181
|
+
'RoleAdminUpdated',
|
|
4182
|
+
{ IndexedOnly: false; Required: true }
|
|
4183
|
+
>
|
|
4184
|
+
|
|
4185
|
+
export type Log = viem_Log<
|
|
4186
|
+
bigint,
|
|
4187
|
+
number,
|
|
4188
|
+
false,
|
|
4189
|
+
ExtractAbiItem<typeof Abis.tip20, 'RoleAdminUpdated'>,
|
|
4190
|
+
true
|
|
4191
|
+
>
|
|
4192
|
+
|
|
4193
|
+
export type Parameters = UnionOmit<
|
|
4194
|
+
WatchContractEventParameters<typeof Abis.tip20, 'RoleAdminUpdated', true>,
|
|
4195
|
+
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
4196
|
+
> & {
|
|
4197
|
+
/** Callback to invoke when a role admin is updated. */
|
|
4198
|
+
onRoleAdminUpdated: (args: Args, log: Log) => void
|
|
4199
|
+
/** Address or ID of the TIP20 token. */
|
|
4200
|
+
token: TokenId.TokenIdOrAddress
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
/**
|
|
4205
|
+
* Watches for TIP20 token role membership updates.
|
|
4206
|
+
*
|
|
4207
|
+
* @example
|
|
4208
|
+
* ```ts
|
|
4209
|
+
* import { createClient, http } from 'viem'
|
|
4210
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
4211
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
4212
|
+
*
|
|
4213
|
+
* const client = createClient({
|
|
4214
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
4215
|
+
* transport: http(),
|
|
4216
|
+
* })
|
|
4217
|
+
*
|
|
4218
|
+
* const unwatch = actions.token.watchRole(client, {
|
|
4219
|
+
* onRoleUpdated: (args, log) => {
|
|
4220
|
+
* console.log('Role updated:', args)
|
|
4221
|
+
* },
|
|
4222
|
+
* })
|
|
4223
|
+
* ```
|
|
4224
|
+
*
|
|
4225
|
+
* @param client - Client.
|
|
4226
|
+
* @param parameters - Parameters.
|
|
4227
|
+
* @returns A function to unsubscribe from the event.
|
|
4228
|
+
*/
|
|
4229
|
+
export function watchRole<
|
|
4230
|
+
chain extends Chain | undefined,
|
|
4231
|
+
account extends Account | undefined,
|
|
4232
|
+
>(client: Client<Transport, chain, account>, parameters: watchRole.Parameters) {
|
|
4233
|
+
const { onRoleUpdated, token, ...rest } = parameters
|
|
4234
|
+
return watchContractEvent(client, {
|
|
4235
|
+
...rest,
|
|
4236
|
+
address: TokenId.toAddress(token),
|
|
4237
|
+
abi: Abis.tip20,
|
|
4238
|
+
eventName: 'RoleMembershipUpdated',
|
|
4239
|
+
onLogs: (logs) => {
|
|
4240
|
+
for (const log of logs) {
|
|
4241
|
+
const type = log.args.hasRole ? 'granted' : 'revoked'
|
|
4242
|
+
onRoleUpdated({ ...log.args, type }, log)
|
|
4243
|
+
}
|
|
4244
|
+
},
|
|
4245
|
+
strict: true,
|
|
4246
|
+
})
|
|
4247
|
+
}
|
|
4248
|
+
|
|
4249
|
+
export declare namespace watchRole {
|
|
4250
|
+
export type Args = GetEventArgs<
|
|
4251
|
+
typeof Abis.tip20,
|
|
4252
|
+
'RoleMembershipUpdated',
|
|
4253
|
+
{ IndexedOnly: false; Required: true }
|
|
4254
|
+
> & {
|
|
4255
|
+
/** Type of role update. */
|
|
4256
|
+
type: 'granted' | 'revoked'
|
|
4257
|
+
}
|
|
4258
|
+
|
|
4259
|
+
export type Log = viem_Log<
|
|
4260
|
+
bigint,
|
|
4261
|
+
number,
|
|
4262
|
+
false,
|
|
4263
|
+
ExtractAbiItem<typeof Abis.tip20, 'RoleMembershipUpdated'>,
|
|
4264
|
+
true
|
|
4265
|
+
>
|
|
4266
|
+
|
|
4267
|
+
export type Parameters = UnionOmit<
|
|
4268
|
+
WatchContractEventParameters<
|
|
4269
|
+
typeof Abis.tip20,
|
|
4270
|
+
'RoleMembershipUpdated',
|
|
4271
|
+
true
|
|
4272
|
+
>,
|
|
4273
|
+
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
4274
|
+
> & {
|
|
4275
|
+
/** Callback to invoke when a role membership is updated. */
|
|
4276
|
+
onRoleUpdated: (args: Args, log: Log) => void
|
|
4277
|
+
/** Address or ID of the TIP20 token. */
|
|
4278
|
+
token: TokenId.TokenIdOrAddress
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
|
|
4282
|
+
/**
|
|
4283
|
+
* Watches for TIP20 token transfer events.
|
|
4284
|
+
*
|
|
4285
|
+
* @example
|
|
4286
|
+
* ```ts
|
|
4287
|
+
* import { createClient, http } from 'viem'
|
|
4288
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
4289
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
4290
|
+
*
|
|
4291
|
+
* const client = createClient({
|
|
4292
|
+
* account: privateKeyToAccount('0x...'),
|
|
4293
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
4294
|
+
* transport: http(),
|
|
4295
|
+
* })
|
|
4296
|
+
*
|
|
4297
|
+
* const unwatch = actions.token.watchTransfer(client, {
|
|
4298
|
+
* onTransfer: (args, log) => {
|
|
4299
|
+
* console.log('Transfer:', args)
|
|
4300
|
+
* },
|
|
4301
|
+
* })
|
|
4302
|
+
* ```
|
|
4303
|
+
*
|
|
4304
|
+
* @param client - Client.
|
|
4305
|
+
* @param parameters - Parameters.
|
|
4306
|
+
* @returns A function to unsubscribe from the event.
|
|
4307
|
+
*/
|
|
4308
|
+
export function watchTransfer<
|
|
4309
|
+
chain extends Chain | undefined,
|
|
4310
|
+
account extends Account | undefined,
|
|
4311
|
+
>(
|
|
4312
|
+
client: Client<Transport, chain, account>,
|
|
4313
|
+
parameters: watchTransfer.Parameters,
|
|
4314
|
+
) {
|
|
4315
|
+
const { onTransfer, token, ...rest } = parameters
|
|
4316
|
+
return watchContractEvent(client, {
|
|
4317
|
+
...rest,
|
|
4318
|
+
address: TokenId.toAddress(token),
|
|
4319
|
+
abi: Abis.tip20,
|
|
4320
|
+
eventName: 'Transfer',
|
|
4321
|
+
onLogs: (logs) => {
|
|
4322
|
+
for (const log of logs) onTransfer(log.args, log)
|
|
4323
|
+
},
|
|
4324
|
+
strict: true,
|
|
4325
|
+
})
|
|
4326
|
+
}
|
|
4327
|
+
|
|
4328
|
+
export declare namespace watchTransfer {
|
|
4329
|
+
export type Args = GetEventArgs<
|
|
4330
|
+
typeof Abis.tip20,
|
|
4331
|
+
'Transfer',
|
|
4332
|
+
{ IndexedOnly: false; Required: true }
|
|
4333
|
+
>
|
|
4334
|
+
|
|
4335
|
+
export type Log = viem_Log<
|
|
4336
|
+
bigint,
|
|
4337
|
+
number,
|
|
4338
|
+
false,
|
|
4339
|
+
ExtractAbiItem<typeof Abis.tip20, 'Transfer'>,
|
|
4340
|
+
true
|
|
4341
|
+
>
|
|
4342
|
+
|
|
4343
|
+
export type Parameters = UnionOmit<
|
|
4344
|
+
WatchContractEventParameters<typeof Abis.tip20, 'Transfer', true>,
|
|
4345
|
+
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
4346
|
+
> & {
|
|
4347
|
+
/** Callback to invoke when tokens are transferred. */
|
|
4348
|
+
onTransfer: (args: Args, log: Log) => void
|
|
4349
|
+
/** Address or ID of the TIP20 token. */
|
|
4350
|
+
token: TokenId.TokenIdOrAddress
|
|
4351
|
+
}
|
|
4352
|
+
}
|
|
4353
|
+
|
|
4354
|
+
/**
|
|
4355
|
+
* Watches for TIP20 token quote token update events.
|
|
4356
|
+
*
|
|
4357
|
+
* @example
|
|
4358
|
+
* ```ts
|
|
4359
|
+
* import { createClient, http } from 'viem'
|
|
4360
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
4361
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
4362
|
+
*
|
|
4363
|
+
* const client = createClient({
|
|
4364
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
4365
|
+
* transport: http(),
|
|
4366
|
+
* })
|
|
4367
|
+
*
|
|
4368
|
+
* const unwatch = actions.token.watchUpdateQuoteToken(client, {
|
|
4369
|
+
* onUpdateQuoteToken: (args, log) => {
|
|
4370
|
+
* if (args.completed)
|
|
4371
|
+
* console.log('quote token update completed:', args.newQuoteToken)
|
|
4372
|
+
* else
|
|
4373
|
+
* console.log('quote token update proposed:', args.newQuoteToken)
|
|
4374
|
+
* },
|
|
4375
|
+
* })
|
|
4376
|
+
* ```
|
|
4377
|
+
*
|
|
4378
|
+
* @param client - Client.
|
|
4379
|
+
* @param parameters - Parameters.
|
|
4380
|
+
* @returns A function to unsubscribe from the event.
|
|
4381
|
+
*/
|
|
4382
|
+
export function watchUpdateQuoteToken<
|
|
4383
|
+
chain extends Chain | undefined,
|
|
4384
|
+
account extends Account | undefined,
|
|
4385
|
+
>(
|
|
4386
|
+
client: Client<Transport, chain, account>,
|
|
4387
|
+
parameters: watchUpdateQuoteToken.Parameters,
|
|
4388
|
+
) {
|
|
4389
|
+
const { onUpdateQuoteToken, token, ...rest } = parameters
|
|
4390
|
+
const address = TokenId.toAddress(token)
|
|
4391
|
+
|
|
4392
|
+
return watchContractEvent(client, {
|
|
4393
|
+
...rest,
|
|
4394
|
+
address,
|
|
4395
|
+
abi: Abis.tip20,
|
|
4396
|
+
onLogs: (
|
|
4397
|
+
logs: viem_Log<
|
|
4398
|
+
bigint,
|
|
4399
|
+
number,
|
|
4400
|
+
false,
|
|
4401
|
+
ExtractAbiItem<
|
|
4402
|
+
typeof Abis.tip20,
|
|
4403
|
+
'NextQuoteTokenSet' | 'QuoteTokenUpdate'
|
|
4404
|
+
>,
|
|
4405
|
+
true
|
|
4406
|
+
>[],
|
|
4407
|
+
) => {
|
|
4408
|
+
for (const log of logs) {
|
|
4409
|
+
if (
|
|
4410
|
+
log.eventName !== 'NextQuoteTokenSet' &&
|
|
4411
|
+
log.eventName !== 'QuoteTokenUpdate'
|
|
4412
|
+
)
|
|
4413
|
+
continue
|
|
4414
|
+
|
|
4415
|
+
onUpdateQuoteToken(
|
|
4416
|
+
{
|
|
4417
|
+
...log.args,
|
|
4418
|
+
completed: log.eventName === 'QuoteTokenUpdate',
|
|
4419
|
+
},
|
|
4420
|
+
log,
|
|
4421
|
+
)
|
|
4422
|
+
}
|
|
4423
|
+
},
|
|
4424
|
+
strict: true,
|
|
4425
|
+
} as never)
|
|
4426
|
+
}
|
|
4427
|
+
|
|
4428
|
+
export declare namespace watchUpdateQuoteToken {
|
|
4429
|
+
export type Args = OneOf<
|
|
4430
|
+
| GetEventArgs<
|
|
4431
|
+
typeof Abis.tip20,
|
|
4432
|
+
'NextQuoteTokenSet',
|
|
4433
|
+
{ IndexedOnly: false; Required: true }
|
|
4434
|
+
>
|
|
4435
|
+
| GetEventArgs<
|
|
4436
|
+
typeof Abis.tip20,
|
|
4437
|
+
'QuoteTokenUpdate',
|
|
4438
|
+
{ IndexedOnly: false; Required: true }
|
|
4439
|
+
>
|
|
4440
|
+
> & {
|
|
4441
|
+
/** Whether the update has been completed. */
|
|
4442
|
+
completed: boolean
|
|
4443
|
+
}
|
|
4444
|
+
|
|
4445
|
+
export type Log = viem_Log
|
|
4446
|
+
|
|
4447
|
+
export type Parameters = UnionOmit<
|
|
4448
|
+
WatchContractEventParameters<typeof Abis.tip20, any, true>,
|
|
4449
|
+
'abi' | 'address' | 'batch' | 'eventName' | 'onLogs' | 'strict'
|
|
4450
|
+
> & {
|
|
4451
|
+
/** Callback to invoke when a quote token update is proposed or completed. */
|
|
4452
|
+
onUpdateQuoteToken: (args: Args, log: Log) => void
|
|
4453
|
+
/** Address or ID of the TIP20 token. */
|
|
4454
|
+
token: TokenId.TokenIdOrAddress
|
|
4455
|
+
}
|
|
4456
|
+
}
|