viem 3.0.0-next.10 → 3.0.0-next.13
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/dist/chains/definitions/arc.d.ts +15 -1
- package/dist/chains/definitions/arc.d.ts.map +1 -1
- package/dist/chains/definitions/arc.js +19 -1
- package/dist/chains/definitions/arc.js.map +1 -1
- package/dist/chains/definitions/berachainBepolia.d.ts +1 -1
- package/dist/chains/definitions/berachainBepolia.js +1 -1
- package/dist/chains/definitions/blockdag.d.ts +18 -0
- package/dist/chains/definitions/blockdag.d.ts.map +1 -0
- package/dist/chains/definitions/blockdag.js +18 -0
- package/dist/chains/definitions/blockdag.js.map +1 -0
- package/dist/chains/definitions/candyChain.d.ts +27 -0
- package/dist/chains/definitions/candyChain.d.ts.map +1 -0
- package/dist/chains/definitions/candyChain.js +26 -0
- package/dist/chains/definitions/candyChain.js.map +1 -0
- package/dist/chains/definitions/creditCoin3Devnet.d.ts +6 -0
- package/dist/chains/definitions/creditCoin3Devnet.d.ts.map +1 -1
- package/dist/chains/definitions/creditCoin3Devnet.js +6 -0
- package/dist/chains/definitions/creditCoin3Devnet.js.map +1 -1
- package/dist/chains/definitions/creditCoin3Mainnet.d.ts +5 -1
- package/dist/chains/definitions/creditCoin3Mainnet.d.ts.map +1 -1
- package/dist/chains/definitions/creditCoin3Mainnet.js +4 -0
- package/dist/chains/definitions/creditCoin3Mainnet.js.map +1 -1
- package/dist/chains/definitions/creditCoin3Testnet.d.ts +5 -1
- package/dist/chains/definitions/creditCoin3Testnet.d.ts.map +1 -1
- package/dist/chains/definitions/creditCoin3Testnet.js +4 -0
- package/dist/chains/definitions/creditCoin3Testnet.js.map +1 -1
- package/dist/chains/definitions/crymad.d.ts +25 -0
- package/dist/chains/definitions/crymad.d.ts.map +1 -0
- package/dist/chains/definitions/crymad.js +23 -0
- package/dist/chains/definitions/crymad.js.map +1 -0
- package/dist/chains/definitions/crymadL2.d.ts +26 -0
- package/dist/chains/definitions/crymadL2.d.ts.map +1 -0
- package/dist/chains/definitions/crymadL2.js +24 -0
- package/dist/chains/definitions/crymadL2.js.map +1 -0
- package/dist/chains/definitions/eCanna.d.ts +18 -0
- package/dist/chains/definitions/eCanna.d.ts.map +1 -0
- package/dist/chains/definitions/eCanna.js +18 -0
- package/dist/chains/definitions/eCanna.js.map +1 -0
- package/dist/chains/definitions/eCannaTestnet.d.ts +19 -0
- package/dist/chains/definitions/eCannaTestnet.d.ts.map +1 -0
- package/dist/chains/definitions/eCannaTestnet.js +19 -0
- package/dist/chains/definitions/eCannaTestnet.js.map +1 -0
- package/dist/chains/definitions/hausTestnet.d.ts +20 -0
- package/dist/chains/definitions/hausTestnet.d.ts.map +1 -0
- package/dist/chains/definitions/hausTestnet.js +18 -0
- package/dist/chains/definitions/hausTestnet.js.map +1 -0
- package/dist/chains/definitions/hyveChain.d.ts +26 -0
- package/dist/chains/definitions/hyveChain.d.ts.map +1 -0
- package/dist/chains/definitions/hyveChain.js +22 -0
- package/dist/chains/definitions/hyveChain.js.map +1 -0
- package/dist/chains/definitions/kortana.d.ts +18 -0
- package/dist/chains/definitions/kortana.d.ts.map +1 -0
- package/dist/chains/definitions/kortana.js +16 -0
- package/dist/chains/definitions/kortana.js.map +1 -0
- package/dist/chains/definitions/morphTachyon.d.ts +18 -0
- package/dist/chains/definitions/morphTachyon.d.ts.map +1 -0
- package/dist/chains/definitions/morphTachyon.js +16 -0
- package/dist/chains/definitions/morphTachyon.js.map +1 -0
- package/dist/chains/definitions/morphTachyonTestnet.d.ts +19 -0
- package/dist/chains/definitions/morphTachyonTestnet.d.ts.map +1 -0
- package/dist/chains/definitions/morphTachyonTestnet.js +17 -0
- package/dist/chains/definitions/morphTachyonTestnet.js.map +1 -0
- package/dist/chains/definitions/rabbitChainTestnet.d.ts +19 -0
- package/dist/chains/definitions/rabbitChainTestnet.d.ts.map +1 -0
- package/dist/chains/definitions/rabbitChainTestnet.js +19 -0
- package/dist/chains/definitions/rabbitChainTestnet.js.map +1 -0
- package/dist/chains/definitions/robinhood.d.ts +2 -1
- package/dist/chains/definitions/robinhood.d.ts.map +1 -1
- package/dist/chains/definitions/robinhood.js +6 -2
- package/dist/chains/definitions/robinhood.js.map +1 -1
- package/dist/chains/definitions/tempo.d.ts +11 -3
- package/dist/chains/definitions/tempo.d.ts.map +1 -1
- package/dist/chains/definitions/tempo.js +10 -0
- package/dist/chains/definitions/tempo.js.map +1 -1
- package/dist/chains/definitions/tempoModerato.d.ts +11 -3
- package/dist/chains/definitions/tempoModerato.d.ts.map +1 -1
- package/dist/chains/definitions/tempoModerato.js +10 -0
- package/dist/chains/definitions/tempoModerato.js.map +1 -1
- package/dist/chains/definitions/whitechainSepolia.d.ts +54 -2
- package/dist/chains/definitions/whitechainSepolia.d.ts.map +1 -1
- package/dist/chains/definitions/whitechainSepolia.js +27 -3
- package/dist/chains/definitions/whitechainSepolia.js.map +1 -1
- package/dist/chains/definitions/xgrTestnet.d.ts +19 -0
- package/dist/chains/definitions/xgrTestnet.d.ts.map +1 -0
- package/dist/chains/definitions/xgrTestnet.js +19 -0
- package/dist/chains/definitions/xgrTestnet.js.map +1 -0
- package/dist/chains/definitions/ynxTestnet.d.ts +19 -0
- package/dist/chains/definitions/ynxTestnet.d.ts.map +1 -0
- package/dist/chains/definitions/ynxTestnet.js +17 -0
- package/dist/chains/definitions/ynxTestnet.js.map +1 -0
- package/dist/chains/definitions/zagros.d.ts +26 -0
- package/dist/chains/definitions/zagros.d.ts.map +1 -0
- package/dist/chains/definitions/zagros.js +26 -0
- package/dist/chains/definitions/zagros.js.map +1 -0
- package/dist/chains/index.d.ts +16 -0
- package/dist/chains/index.d.ts.map +1 -1
- package/dist/chains/index.js +15 -0
- package/dist/chains/index.js.map +1 -1
- package/dist/core/actions/address/getStorageValues.d.ts +30 -0
- package/dist/core/actions/address/getStorageValues.d.ts.map +1 -0
- package/dist/core/actions/address/getStorageValues.js +29 -0
- package/dist/core/actions/address/getStorageValues.js.map +1 -0
- package/dist/core/actions/address/index.d.ts +1 -0
- package/dist/core/actions/address/index.d.ts.map +1 -1
- package/dist/core/actions/address/index.js +1 -0
- package/dist/core/actions/address/index.js.map +1 -1
- package/dist/core/actions/block/simulate.d.ts +2 -0
- package/dist/core/actions/block/simulate.d.ts.map +1 -1
- package/dist/core/actions/block/simulate.js +3 -0
- package/dist/core/actions/block/simulate.js.map +1 -1
- package/dist/core/actions/multicall.d.ts.map +1 -1
- package/dist/core/actions/multicall.js +7 -1
- package/dist/core/actions/multicall.js.map +1 -1
- package/dist/core/actions/siwe/verify.d.ts.map +1 -1
- package/dist/core/actions/siwe/verify.js +2 -1
- package/dist/core/actions/siwe/verify.js.map +1 -1
- package/dist/core/actions/transaction/Errors.d.ts +1 -0
- package/dist/core/actions/transaction/Errors.d.ts.map +1 -1
- package/dist/core/actions/transaction/Errors.js +1 -0
- package/dist/core/actions/transaction/Errors.js.map +1 -1
- package/dist/core/actions/transaction/fill.d.ts +10 -1
- package/dist/core/actions/transaction/fill.d.ts.map +1 -1
- package/dist/core/actions/transaction/fill.js +71 -38
- package/dist/core/actions/transaction/fill.js.map +1 -1
- package/dist/core/actions/transaction/prepare.d.ts.map +1 -1
- package/dist/core/actions/transaction/prepare.js +4 -1
- package/dist/core/actions/transaction/prepare.js.map +1 -1
- package/dist/core/actions/transaction/sign.d.ts.map +1 -1
- package/dist/core/actions/transaction/sign.js +3 -1
- package/dist/core/actions/transaction/sign.js.map +1 -1
- package/dist/core/actions/wallet/sendCalls.d.ts.map +1 -1
- package/dist/core/actions/wallet/sendCalls.js +1 -0
- package/dist/core/actions/wallet/sendCalls.js.map +1 -1
- package/dist/core/internal/transport.js +1 -1
- package/dist/core/internal/transport.js.map +1 -1
- package/dist/erc4337/actions/userOperation/get.d.ts.map +1 -1
- package/dist/erc4337/actions/userOperation/get.js +3 -1
- package/dist/erc4337/actions/userOperation/get.js.map +1 -1
- package/dist/erc4337/actions/userOperation/waitForReceipt.js +1 -1
- package/dist/erc4337/actions/userOperation/waitForReceipt.js.map +1 -1
- package/dist/internal/inference.d.ts +24 -0
- package/dist/internal/inference.d.ts.map +1 -1
- package/dist/node/transports/ipc.d.ts.map +1 -1
- package/dist/node/transports/ipc.js +20 -2
- package/dist/node/transports/ipc.js.map +1 -1
- package/dist/op-stack/actions/l1/getGame.js +1 -1
- package/dist/op-stack/actions/l1/getGame.js.map +1 -1
- package/dist/op-stack/actions/l1/getGames.js +1 -1
- package/dist/op-stack/actions/l1/getGames.js.map +1 -1
- package/dist/op-stack/actions/l1/getTimeToNextGame.js +1 -1
- package/dist/op-stack/actions/l1/getTimeToNextGame.js.map +1 -1
- package/dist/op-stack/actions/l1/getTimeToNextL2Output.js +1 -1
- package/dist/op-stack/actions/l1/getTimeToNextL2Output.js.map +1 -1
- package/dist/tempo/Abis.d.ts +36662 -5677
- package/dist/tempo/Abis.d.ts.map +1 -1
- package/dist/tempo/Abis.js +5626 -1536
- package/dist/tempo/Abis.js.map +1 -1
- package/dist/tempo/Account.d.ts +86 -29
- package/dist/tempo/Account.d.ts.map +1 -1
- package/dist/tempo/Account.js +204 -70
- package/dist/tempo/Account.js.map +1 -1
- package/dist/tempo/Addresses.d.ts +16 -1
- package/dist/tempo/Addresses.d.ts.map +1 -1
- package/dist/tempo/Addresses.js +41 -1
- package/dist/tempo/Addresses.js.map +1 -1
- package/dist/tempo/Capabilities.d.ts +7 -13
- package/dist/tempo/Capabilities.d.ts.map +1 -1
- package/dist/tempo/Client.d.ts.map +1 -1
- package/dist/tempo/Client.js +1 -1
- package/dist/tempo/Client.js.map +1 -1
- package/dist/tempo/Decorator.d.ts +226 -7
- package/dist/tempo/Decorator.d.ts.map +1 -1
- package/dist/tempo/Decorator.js +27 -5
- package/dist/tempo/Decorator.js.map +1 -1
- package/dist/tempo/ExecutionError.d.ts +81 -0
- package/dist/tempo/ExecutionError.d.ts.map +1 -0
- package/dist/tempo/ExecutionError.js +309 -0
- package/dist/tempo/ExecutionError.js.map +1 -0
- package/dist/tempo/Relay.d.ts +303 -0
- package/dist/tempo/Relay.d.ts.map +1 -0
- package/dist/tempo/Relay.js +170 -0
- package/dist/tempo/Relay.js.map +1 -0
- package/dist/tempo/Selectors.d.ts +219 -66
- package/dist/tempo/Selectors.d.ts.map +1 -1
- package/dist/tempo/Selectors.js +220 -67
- package/dist/tempo/Selectors.js.map +1 -1
- package/dist/tempo/Store.d.ts +62 -0
- package/dist/tempo/Store.d.ts.map +1 -0
- package/dist/tempo/Store.js +107 -0
- package/dist/tempo/Store.js.map +1 -0
- package/dist/tempo/Transport.d.ts +48 -2
- package/dist/tempo/Transport.d.ts.map +1 -1
- package/dist/tempo/Transport.js +116 -34
- package/dist/tempo/Transport.js.map +1 -1
- package/dist/tempo/Zone.d.ts +51 -0
- package/dist/tempo/Zone.d.ts.map +1 -0
- package/dist/tempo/Zone.js +40 -0
- package/dist/tempo/Zone.js.map +1 -0
- package/dist/tempo/actions/accessKey/authorizeSync.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/authorizeSync.js +2 -0
- package/dist/tempo/actions/accessKey/authorizeSync.js.map +1 -1
- package/dist/tempo/actions/accessKey/burnWitnessSync.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/burnWitnessSync.js +2 -0
- package/dist/tempo/actions/accessKey/burnWitnessSync.js.map +1 -1
- package/dist/tempo/actions/accessKey/index.d.ts +1 -0
- package/dist/tempo/actions/accessKey/index.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/index.js +1 -0
- package/dist/tempo/actions/accessKey/index.js.map +1 -1
- package/dist/tempo/actions/accessKey/prepareAuthorization.d.ts +76 -0
- package/dist/tempo/actions/accessKey/prepareAuthorization.d.ts.map +1 -0
- package/dist/tempo/actions/accessKey/prepareAuthorization.js +62 -0
- package/dist/tempo/actions/accessKey/prepareAuthorization.js.map +1 -0
- package/dist/tempo/actions/accessKey/revokeSync.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/revokeSync.js +2 -0
- package/dist/tempo/actions/accessKey/revokeSync.js.map +1 -1
- package/dist/tempo/actions/accessKey/signAuthorization.d.ts +43 -38
- package/dist/tempo/actions/accessKey/signAuthorization.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/signAuthorization.js +102 -44
- package/dist/tempo/actions/accessKey/signAuthorization.js.map +1 -1
- package/dist/tempo/actions/accessKey/updateLimitSync.d.ts.map +1 -1
- package/dist/tempo/actions/accessKey/updateLimitSync.js +2 -0
- package/dist/tempo/actions/accessKey/updateLimitSync.js.map +1 -1
- package/dist/tempo/actions/amm/burnSync.d.ts.map +1 -1
- package/dist/tempo/actions/amm/burnSync.js +2 -0
- package/dist/tempo/actions/amm/burnSync.js.map +1 -1
- package/dist/tempo/actions/amm/mintSync.d.ts.map +1 -1
- package/dist/tempo/actions/amm/mintSync.js +2 -0
- package/dist/tempo/actions/amm/mintSync.js.map +1 -1
- package/dist/tempo/actions/amm/rebalanceSwapSync.d.ts.map +1 -1
- package/dist/tempo/actions/amm/rebalanceSwapSync.js +2 -0
- package/dist/tempo/actions/amm/rebalanceSwapSync.js.map +1 -1
- package/dist/tempo/actions/channel/closeSync.d.ts.map +1 -1
- package/dist/tempo/actions/channel/closeSync.js +2 -0
- package/dist/tempo/actions/channel/closeSync.js.map +1 -1
- package/dist/tempo/actions/channel/openSync.d.ts.map +1 -1
- package/dist/tempo/actions/channel/openSync.js +2 -0
- package/dist/tempo/actions/channel/openSync.js.map +1 -1
- package/dist/tempo/actions/channel/requestCloseSync.d.ts.map +1 -1
- package/dist/tempo/actions/channel/requestCloseSync.js +2 -0
- package/dist/tempo/actions/channel/requestCloseSync.js.map +1 -1
- package/dist/tempo/actions/channel/settleSync.d.ts.map +1 -1
- package/dist/tempo/actions/channel/settleSync.js +2 -0
- package/dist/tempo/actions/channel/settleSync.js.map +1 -1
- package/dist/tempo/actions/channel/topUpSync.d.ts.map +1 -1
- package/dist/tempo/actions/channel/topUpSync.js +2 -0
- package/dist/tempo/actions/channel/topUpSync.js.map +1 -1
- package/dist/tempo/actions/channel/withdrawSync.d.ts.map +1 -1
- package/dist/tempo/actions/channel/withdrawSync.js +2 -0
- package/dist/tempo/actions/channel/withdrawSync.js.map +1 -1
- package/dist/tempo/actions/dex/cancelStaleSync.d.ts.map +1 -1
- package/dist/tempo/actions/dex/cancelStaleSync.js +2 -0
- package/dist/tempo/actions/dex/cancelStaleSync.js.map +1 -1
- package/dist/tempo/actions/dex/cancelSync.d.ts.map +1 -1
- package/dist/tempo/actions/dex/cancelSync.js +2 -0
- package/dist/tempo/actions/dex/cancelSync.js.map +1 -1
- package/dist/tempo/actions/dex/createPairSync.d.ts.map +1 -1
- package/dist/tempo/actions/dex/createPairSync.js +2 -0
- package/dist/tempo/actions/dex/createPairSync.js.map +1 -1
- package/dist/tempo/actions/dex/placeFlipSync.d.ts.map +1 -1
- package/dist/tempo/actions/dex/placeFlipSync.js +2 -0
- package/dist/tempo/actions/dex/placeFlipSync.js.map +1 -1
- package/dist/tempo/actions/dex/placeSync.d.ts.map +1 -1
- package/dist/tempo/actions/dex/placeSync.js +2 -0
- package/dist/tempo/actions/dex/placeSync.js.map +1 -1
- package/dist/tempo/actions/dex/withdrawSync.d.ts.map +1 -1
- package/dist/tempo/actions/dex/withdrawSync.js +2 -0
- package/dist/tempo/actions/dex/withdrawSync.js.map +1 -1
- package/dist/tempo/actions/earn/deployment.d.ts +36 -21
- package/dist/tempo/actions/earn/deployment.d.ts.map +1 -1
- package/dist/tempo/actions/earn/deployment.js +96 -32
- package/dist/tempo/actions/earn/deployment.js.map +1 -1
- package/dist/tempo/actions/earn.d.ts +21 -21
- package/dist/tempo/actions/earn.d.ts.map +1 -1
- package/dist/tempo/actions/earn.js +24 -9
- package/dist/tempo/actions/earn.js.map +1 -1
- package/dist/tempo/actions/fee/setUserTokenSync.d.ts.map +1 -1
- package/dist/tempo/actions/fee/setUserTokenSync.js +2 -0
- package/dist/tempo/actions/fee/setUserTokenSync.js.map +1 -1
- package/dist/tempo/actions/fee/setValidatorTokenSync.d.ts.map +1 -1
- package/dist/tempo/actions/fee/setValidatorTokenSync.js +2 -0
- package/dist/tempo/actions/fee/setValidatorTokenSync.js.map +1 -1
- package/dist/tempo/actions/index.d.ts +3 -0
- package/dist/tempo/actions/index.d.ts.map +1 -1
- package/dist/tempo/actions/index.js +3 -0
- package/dist/tempo/actions/index.js.map +1 -1
- package/dist/tempo/actions/multisig/getConfig.d.ts +34 -0
- package/dist/tempo/actions/multisig/getConfig.d.ts.map +1 -0
- package/dist/tempo/actions/multisig/getConfig.js +27 -0
- package/dist/tempo/actions/multisig/getConfig.js.map +1 -0
- package/dist/tempo/actions/multisig/getConfigCommitment.d.ts +72 -0
- package/dist/tempo/actions/multisig/getConfigCommitment.d.ts.map +1 -0
- package/dist/tempo/actions/multisig/getConfigCommitment.js +55 -0
- package/dist/tempo/actions/multisig/getConfigCommitment.js.map +1 -0
- package/dist/tempo/actions/multisig/getOperation.d.ts +23 -0
- package/dist/tempo/actions/multisig/getOperation.d.ts.map +1 -0
- package/dist/tempo/actions/multisig/getOperation.js +18 -0
- package/dist/tempo/actions/multisig/getOperation.js.map +1 -0
- package/dist/tempo/actions/multisig/index.d.ts +6 -0
- package/dist/tempo/actions/multisig/index.d.ts.map +1 -0
- package/dist/tempo/actions/multisig/index.js +6 -0
- package/dist/tempo/actions/multisig/index.js.map +1 -0
- package/dist/tempo/actions/multisig/updateConfig.d.ts +193 -0
- package/dist/tempo/actions/multisig/updateConfig.d.ts.map +1 -0
- package/dist/tempo/actions/multisig/updateConfig.js +170 -0
- package/dist/tempo/actions/multisig/updateConfig.js.map +1 -0
- package/dist/tempo/actions/multisig/updateConfigSync.d.ts +50 -0
- package/dist/tempo/actions/multisig/updateConfigSync.d.ts.map +1 -0
- package/dist/tempo/actions/multisig/updateConfigSync.js +55 -0
- package/dist/tempo/actions/multisig/updateConfigSync.js.map +1 -0
- package/dist/tempo/actions/policy/createSync.d.ts.map +1 -1
- package/dist/tempo/actions/policy/createSync.js +2 -0
- package/dist/tempo/actions/policy/createSync.js.map +1 -1
- package/dist/tempo/actions/policy/modifyBlacklistSync.d.ts.map +1 -1
- package/dist/tempo/actions/policy/modifyBlacklistSync.js +2 -0
- package/dist/tempo/actions/policy/modifyBlacklistSync.js.map +1 -1
- package/dist/tempo/actions/policy/modifyWhitelistSync.d.ts.map +1 -1
- package/dist/tempo/actions/policy/modifyWhitelistSync.js +2 -0
- package/dist/tempo/actions/policy/modifyWhitelistSync.js.map +1 -1
- package/dist/tempo/actions/policy/setAdminSync.d.ts.map +1 -1
- package/dist/tempo/actions/policy/setAdminSync.js +2 -0
- package/dist/tempo/actions/policy/setAdminSync.js.map +1 -1
- package/dist/tempo/actions/propAmm.d.ts +1025 -0
- package/dist/tempo/actions/propAmm.d.ts.map +1 -0
- package/dist/tempo/actions/propAmm.js +541 -0
- package/dist/tempo/actions/propAmm.js.map +1 -0
- package/dist/tempo/actions/receivePolicy/burnSync.d.ts.map +1 -1
- package/dist/tempo/actions/receivePolicy/burnSync.js +2 -0
- package/dist/tempo/actions/receivePolicy/burnSync.js.map +1 -1
- package/dist/tempo/actions/receivePolicy/claimSync.d.ts.map +1 -1
- package/dist/tempo/actions/receivePolicy/claimSync.js +2 -0
- package/dist/tempo/actions/receivePolicy/claimSync.js.map +1 -1
- package/dist/tempo/actions/receivePolicy/setSync.d.ts.map +1 -1
- package/dist/tempo/actions/receivePolicy/setSync.js +2 -0
- package/dist/tempo/actions/receivePolicy/setSync.js.map +1 -1
- package/dist/tempo/actions/token/approveSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/approveSync.js +2 -0
- package/dist/tempo/actions/token/approveSync.js.map +1 -1
- package/dist/tempo/actions/token/burn.d.ts +38 -9
- package/dist/tempo/actions/token/burn.d.ts.map +1 -1
- package/dist/tempo/actions/token/burn.js +12 -5
- package/dist/tempo/actions/token/burn.js.map +1 -1
- package/dist/tempo/actions/token/burnBlockedSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/burnBlockedSync.js +2 -0
- package/dist/tempo/actions/token/burnBlockedSync.js.map +1 -1
- package/dist/tempo/actions/token/burnSync.d.ts +2 -0
- package/dist/tempo/actions/token/burnSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/burnSync.js +2 -0
- package/dist/tempo/actions/token/burnSync.js.map +1 -1
- package/dist/tempo/actions/token/changeTransferPolicySync.d.ts.map +1 -1
- package/dist/tempo/actions/token/changeTransferPolicySync.js +2 -0
- package/dist/tempo/actions/token/changeTransferPolicySync.js.map +1 -1
- package/dist/tempo/actions/token/createSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/createSync.js +2 -0
- package/dist/tempo/actions/token/createSync.js.map +1 -1
- package/dist/tempo/actions/token/grantRolesSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/grantRolesSync.js +2 -0
- package/dist/tempo/actions/token/grantRolesSync.js.map +1 -1
- package/dist/tempo/actions/token/mintSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/mintSync.js +2 -0
- package/dist/tempo/actions/token/mintSync.js.map +1 -1
- package/dist/tempo/actions/token/pauseSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/pauseSync.js +2 -0
- package/dist/tempo/actions/token/pauseSync.js.map +1 -1
- package/dist/tempo/actions/token/prepareUpdateQuoteTokenSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/prepareUpdateQuoteTokenSync.js +2 -0
- package/dist/tempo/actions/token/prepareUpdateQuoteTokenSync.js.map +1 -1
- package/dist/tempo/actions/token/renounceRolesSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/renounceRolesSync.js +2 -0
- package/dist/tempo/actions/token/renounceRolesSync.js.map +1 -1
- package/dist/tempo/actions/token/revokeRolesSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/revokeRolesSync.js +2 -0
- package/dist/tempo/actions/token/revokeRolesSync.js.map +1 -1
- package/dist/tempo/actions/token/setRoleAdminSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/setRoleAdminSync.js +2 -0
- package/dist/tempo/actions/token/setRoleAdminSync.js.map +1 -1
- package/dist/tempo/actions/token/setSupplyCapSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/setSupplyCapSync.js +2 -0
- package/dist/tempo/actions/token/setSupplyCapSync.js.map +1 -1
- package/dist/tempo/actions/token/transferSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/transferSync.js +2 -0
- package/dist/tempo/actions/token/transferSync.js.map +1 -1
- package/dist/tempo/actions/token/unpauseSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/unpauseSync.js +2 -0
- package/dist/tempo/actions/token/unpauseSync.js.map +1 -1
- package/dist/tempo/actions/token/updateQuoteTokenSync.d.ts.map +1 -1
- package/dist/tempo/actions/token/updateQuoteTokenSync.js +2 -0
- package/dist/tempo/actions/token/updateQuoteTokenSync.js.map +1 -1
- package/dist/tempo/actions/virtualAddress/registerMasterSync.d.ts.map +1 -1
- package/dist/tempo/actions/virtualAddress/registerMasterSync.js +2 -0
- package/dist/tempo/actions/virtualAddress/registerMasterSync.js.map +1 -1
- package/dist/tempo/actions/zone/deposit.d.ts +56 -13
- package/dist/tempo/actions/zone/deposit.d.ts.map +1 -1
- package/dist/tempo/actions/zone/deposit.js +8 -10
- package/dist/tempo/actions/zone/deposit.js.map +1 -1
- package/dist/tempo/actions/zone/depositSync.d.ts.map +1 -1
- package/dist/tempo/actions/zone/depositSync.js +2 -0
- package/dist/tempo/actions/zone/depositSync.js.map +1 -1
- package/dist/tempo/actions/zone/encryptedDeposit.d.ts +15 -15
- package/dist/tempo/actions/zone/encryptedDeposit.d.ts.map +1 -1
- package/dist/tempo/actions/zone/encryptedDeposit.js +12 -12
- package/dist/tempo/actions/zone/encryptedDeposit.js.map +1 -1
- package/dist/tempo/actions/zone/getEncryptionKey.d.ts +3 -4
- package/dist/tempo/actions/zone/getEncryptionKey.d.ts.map +1 -1
- package/dist/tempo/actions/zone/getEncryptionKey.js +18 -7
- package/dist/tempo/actions/zone/getEncryptionKey.js.map +1 -1
- package/dist/tempo/actions/zone/getPortalInfo.d.ts +61 -0
- package/dist/tempo/actions/zone/getPortalInfo.d.ts.map +1 -0
- package/dist/tempo/actions/zone/getPortalInfo.js +63 -0
- package/dist/tempo/actions/zone/getPortalInfo.js.map +1 -0
- package/dist/tempo/actions/zone/getWithdrawalFee.d.ts.map +1 -1
- package/dist/tempo/actions/zone/getWithdrawalFee.js +1 -1
- package/dist/tempo/actions/zone/getWithdrawalFee.js.map +1 -1
- package/dist/tempo/actions/zone/index.d.ts +1 -0
- package/dist/tempo/actions/zone/index.d.ts.map +1 -1
- package/dist/tempo/actions/zone/index.js +1 -0
- package/dist/tempo/actions/zone/index.js.map +1 -1
- package/dist/tempo/actions/zone/requestVerifiableWithdrawal.d.ts +8 -8
- package/dist/tempo/actions/zone/requestVerifiableWithdrawal.d.ts.map +1 -1
- package/dist/tempo/actions/zone/requestVerifiableWithdrawal.js +1 -1
- package/dist/tempo/actions/zone/requestVerifiableWithdrawal.js.map +1 -1
- package/dist/tempo/actions/zone/requestWithdrawal.d.ts +8 -8
- package/dist/tempo/actions/zone/requestWithdrawal.d.ts.map +1 -1
- package/dist/tempo/actions/zone/requestWithdrawal.js +1 -1
- package/dist/tempo/actions/zone/requestWithdrawal.js.map +1 -1
- package/dist/tempo/actions/zone/requestWithdrawalSync.d.ts.map +1 -1
- package/dist/tempo/actions/zone/requestWithdrawalSync.js +2 -0
- package/dist/tempo/actions/zone/requestWithdrawalSync.js.map +1 -1
- package/dist/tempo/actions/zone/signAuthorizationToken.d.ts +3 -3
- package/dist/tempo/actions/zone/signAuthorizationToken.d.ts.map +1 -1
- package/dist/tempo/actions/zone/signAuthorizationToken.js +5 -5
- package/dist/tempo/actions/zone/signAuthorizationToken.js.map +1 -1
- package/dist/tempo/actions/zone/types.d.ts +1 -1
- package/dist/tempo/actions/zone/types.d.ts.map +1 -1
- package/dist/tempo/chainConfig.d.ts +33 -17
- package/dist/tempo/chainConfig.d.ts.map +1 -1
- package/dist/tempo/chainConfig.js +188 -72
- package/dist/tempo/chainConfig.js.map +1 -1
- package/dist/tempo/index.d.ts +11 -5
- package/dist/tempo/index.d.ts.map +1 -1
- package/dist/tempo/index.js +9 -3
- package/dist/tempo/index.js.map +1 -1
- package/dist/tempo/internal/relay/cache.d.ts +9 -0
- package/dist/tempo/internal/relay/cache.d.ts.map +1 -0
- package/dist/tempo/internal/relay/cache.js +72 -0
- package/dist/tempo/internal/relay/cache.js.map +1 -0
- package/dist/tempo/internal/relay/deadline.d.ts +4 -0
- package/dist/tempo/internal/relay/deadline.d.ts.map +1 -0
- package/dist/tempo/internal/relay/deadline.js +34 -0
- package/dist/tempo/internal/relay/deadline.js.map +1 -0
- package/dist/tempo/internal/relay/error.d.ts +47 -0
- package/dist/tempo/internal/relay/error.d.ts.map +1 -0
- package/dist/tempo/internal/relay/error.js +101 -0
- package/dist/tempo/internal/relay/error.js.map +1 -0
- package/dist/tempo/internal/relay/feePayer.d.ts +70 -0
- package/dist/tempo/internal/relay/feePayer.d.ts.map +1 -0
- package/dist/tempo/internal/relay/feePayer.js +442 -0
- package/dist/tempo/internal/relay/feePayer.js.map +1 -0
- package/dist/tempo/internal/relay/feeToken.d.ts +38 -0
- package/dist/tempo/internal/relay/feeToken.d.ts.map +1 -0
- package/dist/tempo/internal/relay/feeToken.js +143 -0
- package/dist/tempo/internal/relay/feeToken.js.map +1 -0
- package/dist/tempo/internal/relay/multisig.d.ts +4 -0
- package/dist/tempo/internal/relay/multisig.d.ts.map +1 -0
- package/dist/tempo/internal/relay/multisig.js +1039 -0
- package/dist/tempo/internal/relay/multisig.js.map +1 -0
- package/dist/tempo/internal/relay/plugin.d.ts +5 -0
- package/dist/tempo/internal/relay/plugin.d.ts.map +1 -0
- package/dist/tempo/internal/relay/plugin.js +10 -0
- package/dist/tempo/internal/relay/plugin.js.map +1 -0
- package/dist/tempo/internal/relay/preflight.d.ts +17 -0
- package/dist/tempo/internal/relay/preflight.d.ts.map +1 -0
- package/dist/tempo/internal/relay/preflight.js +53 -0
- package/dist/tempo/internal/relay/preflight.js.map +1 -0
- package/dist/tempo/internal/relay/request.d.ts +16 -0
- package/dist/tempo/internal/relay/request.d.ts.map +1 -0
- package/dist/tempo/internal/relay/request.js +327 -0
- package/dist/tempo/internal/relay/request.js.map +1 -0
- package/dist/tempo/internal/relay/simulate.d.ts +62 -0
- package/dist/tempo/internal/relay/simulate.d.ts.map +1 -0
- package/dist/tempo/internal/relay/simulate.js +284 -0
- package/dist/tempo/internal/relay/simulate.js.map +1 -0
- package/dist/tempo/internal/relay/utils.d.ts +346 -0
- package/dist/tempo/internal/relay/utils.d.ts.map +1 -0
- package/dist/tempo/internal/relay/utils.js +185 -0
- package/dist/tempo/internal/relay/utils.js.map +1 -0
- package/dist/tempo/internal/relay/virtualAddress.d.ts +9 -0
- package/dist/tempo/internal/relay/virtualAddress.d.ts.map +1 -0
- package/dist/tempo/internal/relay/virtualAddress.js +73 -0
- package/dist/tempo/internal/relay/virtualAddress.js.map +1 -0
- package/dist/tempo/internal/relay.d.ts +4 -0
- package/dist/tempo/internal/relay.d.ts.map +1 -0
- package/dist/tempo/internal/relay.js +132 -0
- package/dist/tempo/internal/relay.js.map +1 -0
- package/dist/tempo/internal/types.d.ts +2 -2
- package/dist/tempo/internal/types.d.ts.map +1 -1
- package/dist/tempo/internal/utils.d.ts +1 -0
- package/dist/tempo/internal/utils.d.ts.map +1 -1
- package/dist/tempo/internal/utils.js +2 -1
- package/dist/tempo/internal/utils.js.map +1 -1
- package/dist/tempo/multisig/Config.d.ts +43 -0
- package/dist/tempo/multisig/Config.d.ts.map +1 -0
- package/dist/tempo/multisig/Config.js +92 -0
- package/dist/tempo/multisig/Config.js.map +1 -0
- package/dist/tempo/multisig/Operation.d.ts +34 -0
- package/dist/tempo/multisig/Operation.d.ts.map +1 -0
- package/dist/tempo/multisig/Operation.js +179 -0
- package/dist/tempo/multisig/Operation.js.map +1 -0
- package/dist/tempo/multisig/Signature.d.ts +4 -0
- package/dist/tempo/multisig/Signature.d.ts.map +1 -0
- package/dist/tempo/multisig/Signature.js +9 -0
- package/dist/tempo/multisig/Signature.js.map +1 -0
- package/dist/tempo/zones/Abis.d.ts +2 -2
- package/dist/tempo/zones/Abis.d.ts.map +1 -1
- package/dist/tempo/zones/Abis.js +2 -2
- package/dist/tempo/zones/Abis.js.map +1 -1
- package/dist/tempo/zones/transport.d.ts +1 -33
- package/dist/tempo/zones/transport.d.ts.map +1 -1
- package/dist/tempo/zones/transport.js +1 -49
- package/dist/tempo/zones/transport.js.map +1 -1
- package/dist/tokens/definitions/cirbtc.d.ts +1 -0
- package/dist/tokens/definitions/cirbtc.d.ts.map +1 -1
- package/dist/tokens/definitions/cirbtc.js +1 -0
- package/dist/tokens/definitions/cirbtc.js.map +1 -1
- package/dist/tokens/definitions/eurc.d.ts +2 -0
- package/dist/tokens/definitions/eurc.d.ts.map +1 -1
- package/dist/tokens/definitions/eurc.js +2 -0
- package/dist/tokens/definitions/eurc.js.map +1 -1
- package/dist/tokens/definitions/ousd.d.ts +26 -0
- package/dist/tokens/definitions/ousd.d.ts.map +1 -0
- package/dist/tokens/definitions/ousd.js +26 -0
- package/dist/tokens/definitions/ousd.js.map +1 -0
- package/dist/tokens/definitions/usdc.d.ts +2 -0
- package/dist/tokens/definitions/usdc.d.ts.map +1 -1
- package/dist/tokens/definitions/usdc.js +2 -0
- package/dist/tokens/definitions/usdc.js.map +1 -1
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +2 -0
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/sets.d.ts +40 -0
- package/dist/tokens/sets.d.ts.map +1 -1
- package/dist/tokens/sets.js +4 -1
- package/dist/tokens/sets.js.map +1 -1
- package/dist/utils/Siwe.d.ts +7 -0
- package/dist/utils/Siwe.d.ts.map +1 -1
- package/dist/utils/Siwe.js +28 -0
- package/dist/utils/Siwe.js.map +1 -1
- package/dist/utils/TxEnvelope.d.ts.map +1 -1
- package/dist/utils/TxEnvelope.js +2 -1
- package/dist/utils/TxEnvelope.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/chains/definitions/arc.ts +19 -1
- package/src/chains/definitions/berachainBepolia.ts +1 -1
- package/src/chains/definitions/blockdag.ts +18 -0
- package/src/chains/definitions/candyChain.ts +26 -0
- package/src/chains/definitions/creditCoin3Devnet.ts +6 -0
- package/src/chains/definitions/creditCoin3Mainnet.ts +4 -0
- package/src/chains/definitions/creditCoin3Testnet.ts +4 -0
- package/src/chains/definitions/crymad.ts +23 -0
- package/src/chains/definitions/crymadL2.ts +24 -0
- package/src/chains/definitions/eCanna.ts +18 -0
- package/src/chains/definitions/eCannaTestnet.ts +19 -0
- package/src/chains/definitions/hausTestnet.ts +18 -0
- package/src/chains/definitions/hyveChain.ts +22 -0
- package/src/chains/definitions/kortana.ts +16 -0
- package/src/chains/definitions/morphTachyon.ts +16 -0
- package/src/chains/definitions/morphTachyonTestnet.ts +17 -0
- package/src/chains/definitions/rabbitChainTestnet.ts +19 -0
- package/src/chains/definitions/robinhood.ts +6 -2
- package/src/chains/definitions/tempo.ts +10 -0
- package/src/chains/definitions/tempoModerato.ts +10 -0
- package/src/chains/definitions/whitechainSepolia.ts +28 -3
- package/src/chains/definitions/xgrTestnet.ts +19 -0
- package/src/chains/definitions/ynxTestnet.ts +17 -0
- package/src/chains/definitions/zagros.ts +26 -0
- package/src/chains/index.ts +17 -0
- package/src/core/actions/address/getStorageValues.ts +55 -0
- package/src/core/actions/address/index.ts +1 -0
- package/src/core/actions/block/simulate.ts +6 -0
- package/src/core/actions/multicall.ts +8 -1
- package/src/core/actions/siwe/verify.ts +3 -1
- package/src/core/actions/transaction/Errors.ts +1 -0
- package/src/core/actions/transaction/fill.ts +83 -41
- package/src/core/actions/transaction/prepare.ts +6 -1
- package/src/core/actions/transaction/sign.ts +4 -1
- package/src/core/actions/wallet/sendCalls.ts +1 -0
- package/src/core/internal/transport.ts +1 -1
- package/src/erc4337/actions/userOperation/get.ts +3 -1
- package/src/erc4337/actions/userOperation/waitForReceipt.ts +1 -1
- package/src/internal/inference.ts +24 -0
- package/src/node/transports/ipc.ts +17 -2
- package/src/op-stack/actions/l1/getGame.ts +1 -1
- package/src/op-stack/actions/l1/getGames.ts +1 -1
- package/src/op-stack/actions/l1/getTimeToNextGame.ts +1 -1
- package/src/op-stack/actions/l1/getTimeToNextL2Output.ts +1 -1
- package/src/tempo/Abis.ts +5619 -1513
- package/src/tempo/Account.ts +387 -82
- package/src/tempo/Addresses.ts +46 -17
- package/src/tempo/Capabilities.ts +7 -15
- package/src/tempo/Client.ts +1 -1
- package/src/tempo/Decorator.ts +304 -22
- package/src/tempo/ExecutionError.ts +428 -0
- package/src/tempo/Relay.ts +430 -0
- package/src/tempo/Selectors.ts +248 -78
- package/src/tempo/Store.ts +170 -0
- package/src/tempo/Transport.ts +202 -5
- package/src/tempo/Zone.ts +72 -0
- package/src/tempo/actions/accessKey/authorizeSync.ts +4 -0
- package/src/tempo/actions/accessKey/burnWitnessSync.ts +4 -0
- package/src/tempo/actions/accessKey/index.ts +2 -0
- package/src/tempo/actions/accessKey/prepareAuthorization.ts +132 -0
- package/src/tempo/actions/accessKey/revokeSync.ts +4 -0
- package/src/tempo/actions/accessKey/signAuthorization.ts +222 -53
- package/src/tempo/actions/accessKey/updateLimitSync.ts +4 -0
- package/src/tempo/actions/amm/burnSync.ts +4 -0
- package/src/tempo/actions/amm/mintSync.ts +4 -0
- package/src/tempo/actions/amm/rebalanceSwapSync.ts +4 -0
- package/src/tempo/actions/channel/closeSync.ts +4 -0
- package/src/tempo/actions/channel/openSync.ts +4 -0
- package/src/tempo/actions/channel/requestCloseSync.ts +4 -0
- package/src/tempo/actions/channel/settleSync.ts +4 -0
- package/src/tempo/actions/channel/topUpSync.ts +4 -0
- package/src/tempo/actions/channel/withdrawSync.ts +4 -0
- package/src/tempo/actions/dex/cancelStaleSync.ts +4 -0
- package/src/tempo/actions/dex/cancelSync.ts +4 -0
- package/src/tempo/actions/dex/createPairSync.ts +4 -0
- package/src/tempo/actions/dex/placeFlipSync.ts +4 -0
- package/src/tempo/actions/dex/placeSync.ts +4 -0
- package/src/tempo/actions/dex/withdrawSync.ts +4 -0
- package/src/tempo/actions/earn/deployment.ts +108 -42
- package/src/tempo/actions/earn.ts +35 -15
- package/src/tempo/actions/fee/setUserTokenSync.ts +4 -0
- package/src/tempo/actions/fee/setValidatorTokenSync.ts +4 -0
- package/src/tempo/actions/index.ts +4 -0
- package/src/tempo/actions/multisig/getConfig.ts +46 -0
- package/src/tempo/actions/multisig/getConfigCommitment.ts +79 -0
- package/src/tempo/actions/multisig/getOperation.ts +37 -0
- package/src/tempo/actions/multisig/index.ts +5 -0
- package/src/tempo/actions/multisig/updateConfig.ts +210 -0
- package/src/tempo/actions/multisig/updateConfigSync.ts +80 -0
- package/src/tempo/actions/policy/createSync.ts +4 -0
- package/src/tempo/actions/policy/modifyBlacklistSync.ts +4 -0
- package/src/tempo/actions/policy/modifyWhitelistSync.ts +4 -0
- package/src/tempo/actions/policy/setAdminSync.ts +4 -0
- package/src/tempo/actions/propAmm.ts +985 -0
- package/src/tempo/actions/receivePolicy/burnSync.ts +4 -0
- package/src/tempo/actions/receivePolicy/claimSync.ts +4 -0
- package/src/tempo/actions/receivePolicy/setSync.ts +5 -1
- package/src/tempo/actions/token/approveSync.ts +5 -1
- package/src/tempo/actions/token/burn.ts +21 -9
- package/src/tempo/actions/token/burnBlockedSync.ts +5 -1
- package/src/tempo/actions/token/burnSync.ts +7 -1
- package/src/tempo/actions/token/changeTransferPolicySync.ts +4 -0
- package/src/tempo/actions/token/createSync.ts +4 -0
- package/src/tempo/actions/token/grantRolesSync.ts +4 -0
- package/src/tempo/actions/token/mintSync.ts +5 -1
- package/src/tempo/actions/token/pauseSync.ts +4 -0
- package/src/tempo/actions/token/prepareUpdateQuoteTokenSync.ts +4 -0
- package/src/tempo/actions/token/renounceRolesSync.ts +4 -0
- package/src/tempo/actions/token/revokeRolesSync.ts +4 -0
- package/src/tempo/actions/token/setRoleAdminSync.ts +4 -0
- package/src/tempo/actions/token/setSupplyCapSync.ts +4 -0
- package/src/tempo/actions/token/transferSync.ts +5 -1
- package/src/tempo/actions/token/unpauseSync.ts +4 -0
- package/src/tempo/actions/token/updateQuoteTokenSync.ts +4 -0
- package/src/tempo/actions/virtualAddress/registerMasterSync.ts +4 -0
- package/src/tempo/actions/zone/deposit.ts +13 -24
- package/src/tempo/actions/zone/depositSync.ts +4 -0
- package/src/tempo/actions/zone/encryptedDeposit.ts +18 -26
- package/src/tempo/actions/zone/getEncryptionKey.ts +20 -8
- package/src/tempo/actions/zone/getPortalInfo.ts +126 -0
- package/src/tempo/actions/zone/getWithdrawalFee.ts +1 -1
- package/src/tempo/actions/zone/index.ts +2 -0
- package/src/tempo/actions/zone/requestVerifiableWithdrawal.ts +1 -1
- package/src/tempo/actions/zone/requestWithdrawal.ts +1 -1
- package/src/tempo/actions/zone/requestWithdrawalSync.ts +4 -0
- package/src/tempo/actions/zone/signAuthorizationToken.ts +7 -7
- package/src/tempo/actions/zone/types.ts +1 -1
- package/src/tempo/chainConfig.ts +287 -86
- package/src/tempo/index.ts +15 -4
- package/src/tempo/internal/relay/cache.ts +82 -0
- package/src/tempo/internal/relay/deadline.ts +45 -0
- package/src/tempo/internal/relay/error.ts +129 -0
- package/src/tempo/internal/relay/feePayer.ts +693 -0
- package/src/tempo/internal/relay/feeToken.ts +190 -0
- package/src/tempo/internal/relay/multisig.ts +1357 -0
- package/src/tempo/internal/relay/plugin.ts +13 -0
- package/src/tempo/internal/relay/preflight.ts +83 -0
- package/src/tempo/internal/relay/request.ts +401 -0
- package/src/tempo/internal/relay/simulate.ts +394 -0
- package/src/tempo/internal/relay/utils.ts +213 -0
- package/src/tempo/internal/relay/virtualAddress.ts +95 -0
- package/src/tempo/internal/relay.ts +149 -0
- package/src/tempo/internal/types.ts +2 -1
- package/src/tempo/internal/utils.ts +2 -0
- package/src/tempo/multisig/Config.ts +139 -0
- package/src/tempo/multisig/Operation.ts +213 -0
- package/src/tempo/multisig/Signature.ts +11 -0
- package/src/tempo/zones/Abis.ts +2 -2
- package/src/tempo/zones/transport.ts +1 -66
- package/src/tokens/definitions/cirbtc.ts +1 -0
- package/src/tokens/definitions/eurc.ts +2 -0
- package/src/tokens/definitions/ousd.ts +26 -0
- package/src/tokens/definitions/usdc.ts +2 -0
- package/src/tokens/index.ts +2 -0
- package/src/tokens/sets.ts +4 -1
- package/src/utils/Siwe.ts +36 -0
- package/src/utils/TxEnvelope.ts +3 -1
- package/src/version.ts +1 -1
- package/dist/tempo/Storage.d.ts +0 -43
- package/dist/tempo/Storage.d.ts.map +0 -1
- package/dist/tempo/Storage.js +0 -96
- package/dist/tempo/Storage.js.map +0 -1
- package/src/tempo/Storage.ts +0 -119
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import type { Address } from 'abitype'
|
|
2
|
+
import { AbiEvent, AbiFunction, Hex, Log as Log_ } from 'ox'
|
|
3
|
+
import * as TransactionRequest from 'ox/TransactionRequest'
|
|
4
|
+
import type { Client } from '../../../core/Client.js'
|
|
5
|
+
import type { Call } from 'ox/tempo/TxEnvelopeTempo'
|
|
6
|
+
import type { Log } from 'ox/Log'
|
|
7
|
+
import { format as formatUnits } from 'ox/Value'
|
|
8
|
+
import * as Abis from '../../Abis.js'
|
|
9
|
+
import * as Actions from '../../actions/index.js'
|
|
10
|
+
import type * as Capabilities from '../../Capabilities.js'
|
|
11
|
+
import type * as Relay from '../../Relay.js'
|
|
12
|
+
import type * as Store from './cache.js'
|
|
13
|
+
import { formatError, isExecutionError } from './error.js'
|
|
14
|
+
import { resolveTokenMetadata } from './feeToken.js'
|
|
15
|
+
import * as Utils from './utils.js'
|
|
16
|
+
import { extractCalls } from './virtualAddress.js'
|
|
17
|
+
|
|
18
|
+
const zeroAddress = '0x0000000000000000000000000000000000000000'
|
|
19
|
+
|
|
20
|
+
export function create(options: Relay.simulate.Options): Relay.Plugin {
|
|
21
|
+
return {
|
|
22
|
+
async handleRequest(context, next) {
|
|
23
|
+
if (context.request.method !== 'eth_fillTransaction') return next()
|
|
24
|
+
try {
|
|
25
|
+
await next()
|
|
26
|
+
} catch (error) {
|
|
27
|
+
const parameters = context.request.params![0] as Record<string, unknown>
|
|
28
|
+
if (
|
|
29
|
+
isExecutionError(error) &&
|
|
30
|
+
(parameters.capabilities as Record<string, unknown> | undefined)
|
|
31
|
+
?.errors === true
|
|
32
|
+
)
|
|
33
|
+
return formatError(
|
|
34
|
+
error,
|
|
35
|
+
parameters,
|
|
36
|
+
context.client,
|
|
37
|
+
context.getStore(options.store),
|
|
38
|
+
)
|
|
39
|
+
throw error
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
async afterFill(result, context) {
|
|
43
|
+
const parameters = context.request.params![0] as Record<string, unknown>
|
|
44
|
+
const store = context.getStore(options.store)
|
|
45
|
+
const signal = context.options.signal
|
|
46
|
+
const transaction = Utils.normalizeTempoTransaction(result.tx)
|
|
47
|
+
const feeToken = transaction.feeToken as Address | undefined
|
|
48
|
+
const simulation =
|
|
49
|
+
(parameters.capabilities as Record<string, unknown> | undefined)
|
|
50
|
+
?.balanceDiffs !== false
|
|
51
|
+
? await simulateAndParseDiffs(context.client, {
|
|
52
|
+
account: parameters.from as Address | undefined,
|
|
53
|
+
calls: extractCalls(transaction),
|
|
54
|
+
feeToken,
|
|
55
|
+
gas: transaction.gas,
|
|
56
|
+
maxFeePerGas: transaction.maxFeePerGas,
|
|
57
|
+
store,
|
|
58
|
+
signal,
|
|
59
|
+
})
|
|
60
|
+
: await computeFee(context.client, {
|
|
61
|
+
feeToken,
|
|
62
|
+
gas: transaction.gas,
|
|
63
|
+
maxFeePerGas: transaction.maxFeePerGas,
|
|
64
|
+
store,
|
|
65
|
+
signal,
|
|
66
|
+
}).then((fee) => ({ balanceDiffs: undefined, fee }))
|
|
67
|
+
return {
|
|
68
|
+
capabilities: {
|
|
69
|
+
balanceDiffs: simulation.balanceDiffs,
|
|
70
|
+
fee: simulation.fee,
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export async function simulateAndParseDiffs(
|
|
78
|
+
client: Client,
|
|
79
|
+
options: simulateAndParseDiffs.Options,
|
|
80
|
+
) {
|
|
81
|
+
const { account, calls, feeToken, gas, store, maxFeePerGas, signal } = options
|
|
82
|
+
signal?.throwIfAborted()
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
// Including the fee token as a read target asks the node to return its metadata too.
|
|
86
|
+
const probe =
|
|
87
|
+
feeToken &&
|
|
88
|
+
!calls.some((call) => call.to?.toLowerCase() === feeToken.toLowerCase())
|
|
89
|
+
? [
|
|
90
|
+
Actions.token.getBalance.call(client, {
|
|
91
|
+
account: account ?? zeroAddress,
|
|
92
|
+
token: feeToken,
|
|
93
|
+
}),
|
|
94
|
+
]
|
|
95
|
+
: []
|
|
96
|
+
const simulation = (await client.request({
|
|
97
|
+
method: 'tempo_simulateV1',
|
|
98
|
+
params: [
|
|
99
|
+
{
|
|
100
|
+
blockStateCalls: [
|
|
101
|
+
{
|
|
102
|
+
calls: [...calls, ...probe].map((call) =>
|
|
103
|
+
TransactionRequest.toRpc({
|
|
104
|
+
...call,
|
|
105
|
+
...('abi' in call
|
|
106
|
+
? {
|
|
107
|
+
to: call.address,
|
|
108
|
+
data: AbiFunction.encodeData(
|
|
109
|
+
AbiFunction.fromAbi(call.abi, call.functionName),
|
|
110
|
+
call.args,
|
|
111
|
+
),
|
|
112
|
+
}
|
|
113
|
+
: {}),
|
|
114
|
+
from: account === zeroAddress ? undefined : account,
|
|
115
|
+
}),
|
|
116
|
+
),
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
traceTransfers: true,
|
|
120
|
+
},
|
|
121
|
+
'latest',
|
|
122
|
+
],
|
|
123
|
+
})) as {
|
|
124
|
+
blocks: readonly {
|
|
125
|
+
calls?:
|
|
126
|
+
| readonly { logs?: readonly Log_.Rpc[] | undefined }[]
|
|
127
|
+
| undefined
|
|
128
|
+
}[]
|
|
129
|
+
tokenMetadata?:
|
|
130
|
+
| Record<string, { name: string; symbol: string; currency: string }>
|
|
131
|
+
| undefined
|
|
132
|
+
}
|
|
133
|
+
const tokenMetadata = simulation.tokenMetadata ?? {}
|
|
134
|
+
signal?.throwIfAborted()
|
|
135
|
+
const logs = (simulation.blocks[0]?.calls ?? [])
|
|
136
|
+
.slice(0, calls.length)
|
|
137
|
+
.flatMap((result) => result.logs?.map((log) => Log_.fromRpc(log)) ?? [])
|
|
138
|
+
|
|
139
|
+
// Build per-token balance diffs relative to the sender.
|
|
140
|
+
const balanceDiffs = account
|
|
141
|
+
? await buildBalanceDiffs(client, {
|
|
142
|
+
account,
|
|
143
|
+
store,
|
|
144
|
+
signal,
|
|
145
|
+
logs,
|
|
146
|
+
tokenMetadata: tokenMetadata as never,
|
|
147
|
+
})
|
|
148
|
+
: {}
|
|
149
|
+
|
|
150
|
+
// Compute fee breakdown.
|
|
151
|
+
const fee = await computeFee(client, {
|
|
152
|
+
feeToken,
|
|
153
|
+
gas,
|
|
154
|
+
store,
|
|
155
|
+
signal,
|
|
156
|
+
maxFeePerGas,
|
|
157
|
+
tokenMetadata: tokenMetadata as never,
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
return { balanceDiffs, fee, tokenMetadata }
|
|
161
|
+
} catch {
|
|
162
|
+
signal?.throwIfAborted()
|
|
163
|
+
// Simulation failures should not block the fill response —
|
|
164
|
+
// return empty diffs with fee computed from transaction fields.
|
|
165
|
+
const fee = await computeFee(client, {
|
|
166
|
+
feeToken,
|
|
167
|
+
gas,
|
|
168
|
+
store,
|
|
169
|
+
maxFeePerGas,
|
|
170
|
+
signal,
|
|
171
|
+
})
|
|
172
|
+
return { balanceDiffs: undefined, fee, tokenMetadata: undefined }
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare namespace simulateAndParseDiffs {
|
|
177
|
+
type Options = {
|
|
178
|
+
account?: Address | undefined
|
|
179
|
+
calls: readonly Call[]
|
|
180
|
+
feeToken?: Address | undefined
|
|
181
|
+
gas?: bigint | undefined
|
|
182
|
+
store?: Store.Store | undefined
|
|
183
|
+
signal?: AbortSignal | undefined
|
|
184
|
+
maxFeePerGas?: bigint | undefined
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Builds a complete preview within the metadata lookup budget. @internal */
|
|
189
|
+
export async function buildBalanceDiffs(
|
|
190
|
+
client: Client,
|
|
191
|
+
options: buildBalanceDiffs.Options,
|
|
192
|
+
) {
|
|
193
|
+
const { account, store, logs, tokenMetadata, signal } = options
|
|
194
|
+
signal?.throwIfAborted()
|
|
195
|
+
const accountLower = account.toLowerCase()
|
|
196
|
+
|
|
197
|
+
const transferLogs = AbiEvent.extractLogs(
|
|
198
|
+
[AbiEvent.fromAbi(Abis.tip20, 'Transfer')],
|
|
199
|
+
logs,
|
|
200
|
+
{ eventName: 'Transfer' },
|
|
201
|
+
)
|
|
202
|
+
const approvalLogs = AbiEvent.extractLogs(
|
|
203
|
+
[AbiEvent.fromAbi(Abis.tip20, 'Approval')],
|
|
204
|
+
logs,
|
|
205
|
+
{ eventName: 'Approval' },
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
// Track net movement per token: incoming vs outgoing.
|
|
209
|
+
const tokenMap = new Map<
|
|
210
|
+
string,
|
|
211
|
+
{
|
|
212
|
+
incoming: bigint
|
|
213
|
+
outgoing: bigint
|
|
214
|
+
approved: bigint
|
|
215
|
+
recipients: Set<Address>
|
|
216
|
+
token: Address
|
|
217
|
+
}
|
|
218
|
+
>()
|
|
219
|
+
|
|
220
|
+
for (const log of transferLogs) {
|
|
221
|
+
const token = log.address.toLowerCase()
|
|
222
|
+
const fromLower = log.args.from.toLowerCase()
|
|
223
|
+
const toLower = log.args.to.toLowerCase()
|
|
224
|
+
|
|
225
|
+
const entry = tokenMap.get(token) ?? {
|
|
226
|
+
incoming: 0n,
|
|
227
|
+
outgoing: 0n,
|
|
228
|
+
approved: 0n,
|
|
229
|
+
recipients: new Set<Address>(),
|
|
230
|
+
token: log.address,
|
|
231
|
+
}
|
|
232
|
+
if (fromLower === accountLower) {
|
|
233
|
+
entry.outgoing += log.args.amount
|
|
234
|
+
entry.recipients.add(log.args.to)
|
|
235
|
+
}
|
|
236
|
+
if (toLower === accountLower) entry.incoming += log.args.amount
|
|
237
|
+
tokenMap.set(token, entry)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Approvals replace allowances; retain the last event for each token and spender.
|
|
241
|
+
const approvals = new Map<string, (typeof approvalLogs)[number]>()
|
|
242
|
+
for (const log of approvalLogs) {
|
|
243
|
+
if (log.args.owner.toLowerCase() !== accountLower) continue
|
|
244
|
+
approvals.set(
|
|
245
|
+
`${log.address.toLowerCase()}:${log.args.spender.toLowerCase()}`,
|
|
246
|
+
log,
|
|
247
|
+
)
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Transfers do not identify allowance consumption, so retain final approval exposure.
|
|
251
|
+
for (const log of approvals.values()) {
|
|
252
|
+
if (log.args.amount === 0n) continue
|
|
253
|
+
const token = log.address.toLowerCase()
|
|
254
|
+
|
|
255
|
+
const entry = tokenMap.get(token) ?? {
|
|
256
|
+
incoming: 0n,
|
|
257
|
+
outgoing: 0n,
|
|
258
|
+
approved: 0n,
|
|
259
|
+
recipients: new Set<Address>(),
|
|
260
|
+
token: log.address,
|
|
261
|
+
}
|
|
262
|
+
entry.approved += log.args.amount
|
|
263
|
+
entry.recipients.add(log.args.spender)
|
|
264
|
+
tokenMap.set(token, entry)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Collect unique tokens that need decimals.
|
|
268
|
+
const entries = [...tokenMap.values()].filter((e) => {
|
|
269
|
+
const net =
|
|
270
|
+
e.outgoing > e.incoming
|
|
271
|
+
? e.outgoing - e.incoming
|
|
272
|
+
: e.incoming - e.outgoing
|
|
273
|
+
return net > 0n || e.approved > 0n
|
|
274
|
+
})
|
|
275
|
+
if (entries.length === 0) return {}
|
|
276
|
+
// Omit an unavailable preview rather than returning a partial set of movements.
|
|
277
|
+
if (entries.length > 100) return undefined
|
|
278
|
+
|
|
279
|
+
// Bound metadata work for a single fill independently of the RPC batch limit.
|
|
280
|
+
const metadataMap = new Map<
|
|
281
|
+
string,
|
|
282
|
+
{ decimals: number; symbol: string; name: string }
|
|
283
|
+
>()
|
|
284
|
+
let index = 0
|
|
285
|
+
await Promise.all(
|
|
286
|
+
Array.from({ length: Math.min(10, entries.length) }, async () => {
|
|
287
|
+
while (index < entries.length) {
|
|
288
|
+
const entry = entries[index++]!
|
|
289
|
+
try {
|
|
290
|
+
const metadata = await resolveTokenMetadata(client, {
|
|
291
|
+
token: entry.token,
|
|
292
|
+
tokenMetadata,
|
|
293
|
+
store,
|
|
294
|
+
})
|
|
295
|
+
metadataMap.set(entry.token.toLowerCase(), metadata)
|
|
296
|
+
} catch {
|
|
297
|
+
signal?.throwIfAborted()
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}),
|
|
301
|
+
)
|
|
302
|
+
signal?.throwIfAborted()
|
|
303
|
+
if (metadataMap.size !== entries.length) return undefined
|
|
304
|
+
|
|
305
|
+
// Build the diff array for this account.
|
|
306
|
+
const diffs: Capabilities.BalanceDiff[] = []
|
|
307
|
+
for (const entry of entries) {
|
|
308
|
+
const incoming =
|
|
309
|
+
entry.incoming > entry.outgoing ? entry.incoming - entry.outgoing : 0n
|
|
310
|
+
const outgoing =
|
|
311
|
+
(entry.outgoing > entry.incoming ? entry.outgoing - entry.incoming : 0n) +
|
|
312
|
+
entry.approved
|
|
313
|
+
const meta = metadataMap.get(entry.token.toLowerCase())!
|
|
314
|
+
const decimals = meta.decimals
|
|
315
|
+
const metadata = {
|
|
316
|
+
address: entry.token,
|
|
317
|
+
decimals,
|
|
318
|
+
name: meta.name,
|
|
319
|
+
symbol: meta.symbol,
|
|
320
|
+
}
|
|
321
|
+
if (incoming > 0n)
|
|
322
|
+
diffs.push({
|
|
323
|
+
...metadata,
|
|
324
|
+
direction: 'incoming',
|
|
325
|
+
formatted: formatUnits(incoming, decimals),
|
|
326
|
+
recipients: [],
|
|
327
|
+
value: Hex.fromNumber(incoming),
|
|
328
|
+
})
|
|
329
|
+
if (outgoing > 0n)
|
|
330
|
+
diffs.push({
|
|
331
|
+
...metadata,
|
|
332
|
+
direction: 'outgoing',
|
|
333
|
+
formatted: formatUnits(outgoing, decimals),
|
|
334
|
+
recipients: [...entry.recipients],
|
|
335
|
+
value: Hex.fromNumber(outgoing),
|
|
336
|
+
})
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return { [account]: diffs }
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export declare namespace buildBalanceDiffs {
|
|
343
|
+
type Options = {
|
|
344
|
+
account: Address
|
|
345
|
+
store?: Store.Store | undefined
|
|
346
|
+
signal?: AbortSignal | undefined
|
|
347
|
+
logs: readonly Log<boolean>[]
|
|
348
|
+
tokenMetadata: Record<
|
|
349
|
+
Address,
|
|
350
|
+
{ name: string; symbol: string; currency: string }
|
|
351
|
+
>
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// biome-ignore lint/correctness/noUnusedVariables: declaration merge
|
|
356
|
+
async function computeFee(client: Client, options: computeFee.Options) {
|
|
357
|
+
const { feeToken, gas, store, maxFeePerGas, tokenMetadata, signal } = options
|
|
358
|
+
signal?.throwIfAborted()
|
|
359
|
+
if (!feeToken || !gas || !maxFeePerGas) return undefined
|
|
360
|
+
|
|
361
|
+
try {
|
|
362
|
+
const metadata = await resolveTokenMetadata(client, {
|
|
363
|
+
token: feeToken,
|
|
364
|
+
tokenMetadata,
|
|
365
|
+
store,
|
|
366
|
+
})
|
|
367
|
+
signal?.throwIfAborted()
|
|
368
|
+
const raw = gas * maxFeePerGas
|
|
369
|
+
const scale = 10n ** BigInt(Math.max(0, 18 - metadata.decimals))
|
|
370
|
+
const amount = (raw + scale - 1n) / scale
|
|
371
|
+
return {
|
|
372
|
+
amount: Hex.fromNumber(amount) as `0x${string}`,
|
|
373
|
+
decimals: metadata.decimals,
|
|
374
|
+
formatted: formatUnits(amount, metadata.decimals),
|
|
375
|
+
symbol: metadata.symbol,
|
|
376
|
+
}
|
|
377
|
+
} catch {
|
|
378
|
+
signal?.throwIfAborted()
|
|
379
|
+
return undefined
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
declare namespace computeFee {
|
|
384
|
+
type Options = {
|
|
385
|
+
feeToken?: Address | undefined
|
|
386
|
+
gas?: bigint | undefined
|
|
387
|
+
store?: Store.Store | undefined
|
|
388
|
+
signal?: AbortSignal | undefined
|
|
389
|
+
maxFeePerGas?: bigint | undefined
|
|
390
|
+
tokenMetadata?:
|
|
391
|
+
| Record<Address, { name: string; symbol: string; currency: string }>
|
|
392
|
+
| undefined
|
|
393
|
+
}
|
|
394
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { Address, Hex, RpcResponse } from 'ox'
|
|
2
|
+
import {
|
|
3
|
+
Transaction as core_Transaction,
|
|
4
|
+
KeyAuthorization,
|
|
5
|
+
TxEnvelopeTempo,
|
|
6
|
+
} from 'ox/tempo'
|
|
7
|
+
import type { Client } from '../../../core/Client.js'
|
|
8
|
+
import { UnknownRpcError } from '../../../core/RpcError.js'
|
|
9
|
+
|
|
10
|
+
export function resolveChainId(value: unknown) {
|
|
11
|
+
if (typeof value === 'number') return value
|
|
12
|
+
if (typeof value === 'bigint') return Number(value)
|
|
13
|
+
if (typeof value === 'string') {
|
|
14
|
+
if (!/^(?:0x[0-9a-f]+|[0-9]+)$/i.test(value)) return undefined
|
|
15
|
+
const n = Number(value)
|
|
16
|
+
if (Number.isFinite(n)) return n
|
|
17
|
+
}
|
|
18
|
+
return undefined
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function formatFillTransactionRequest(
|
|
22
|
+
client: Client,
|
|
23
|
+
value: Record<string, unknown>,
|
|
24
|
+
) {
|
|
25
|
+
if (value.type === '0x76') return { ...value }
|
|
26
|
+
const format = client.chain?.codecs?.transactionRequest?.toRpc
|
|
27
|
+
if (!format) return value
|
|
28
|
+
return {
|
|
29
|
+
...(format({ ...value } as never) as Record<string, unknown>),
|
|
30
|
+
// Keep the selected token until the request leaves the plugin pipeline.
|
|
31
|
+
...(value.feeToken !== undefined ? { feeToken: value.feeToken } : {}),
|
|
32
|
+
} as Record<string, unknown>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function normalizeFillTransactionRequest(
|
|
36
|
+
tx: Record<string, unknown>,
|
|
37
|
+
): Record<string, unknown> & { calls: unknown[] } {
|
|
38
|
+
const { to, data, value, ...rest } = tx
|
|
39
|
+
const keyAuthorization = normalizeKeyAuthorization(tx.keyAuthorization)
|
|
40
|
+
const withKeyAuthorization = keyAuthorization ? { keyAuthorization } : {}
|
|
41
|
+
if (Array.isArray(tx.calls))
|
|
42
|
+
return {
|
|
43
|
+
...tx,
|
|
44
|
+
...withKeyAuthorization,
|
|
45
|
+
calls: tx.calls.map((call) => {
|
|
46
|
+
if (!call || typeof call !== 'object' || Array.isArray(call))
|
|
47
|
+
throw new RpcResponse.InvalidParamsError({
|
|
48
|
+
message: 'Expected a transaction call object.',
|
|
49
|
+
})
|
|
50
|
+
assertCallTarget(call.to)
|
|
51
|
+
return { ...call, value: normalizeFillValue(call.value) }
|
|
52
|
+
}),
|
|
53
|
+
}
|
|
54
|
+
assertCallTarget(to)
|
|
55
|
+
const call = {
|
|
56
|
+
...(typeof to !== 'undefined' ? { to } : {}),
|
|
57
|
+
...(typeof data !== 'undefined' ? { data } : {}),
|
|
58
|
+
...(typeof value !== 'undefined'
|
|
59
|
+
? { value: normalizeFillValue(value) }
|
|
60
|
+
: {}),
|
|
61
|
+
}
|
|
62
|
+
return { ...rest, ...withKeyAuthorization, calls: [call] }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Forwards `keyAuthorization` to the chain in RPC shape. Pass-through
|
|
67
|
+
* when already RPC; convert via `KeyAuthorization.toRpc` when internal.
|
|
68
|
+
*/
|
|
69
|
+
function normalizeKeyAuthorization(value: unknown) {
|
|
70
|
+
if (!value || typeof value !== 'object') return undefined
|
|
71
|
+
const ka = value as Record<string, unknown>
|
|
72
|
+
const signature = ka.signature as Record<string, unknown> | undefined
|
|
73
|
+
if (!signature || typeof signature !== 'object') return undefined
|
|
74
|
+
const isInternal =
|
|
75
|
+
typeof signature.signature === 'object' && signature.signature !== null
|
|
76
|
+
return isInternal ? KeyAuthorization.toRpc(value as never) : value
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function assertCallTarget(to: unknown) {
|
|
80
|
+
if (to === undefined || to === null) return
|
|
81
|
+
if (typeof to !== 'string' || !Address.validate(to, { strict: false }))
|
|
82
|
+
throw new RpcResponse.InvalidParamsError({
|
|
83
|
+
message: 'Invalid transaction call target.',
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function normalizeFillValue(value: unknown) {
|
|
88
|
+
if (typeof value !== 'string' || !value.startsWith('0x')) return value
|
|
89
|
+
if (!/^0x[\da-f]*$/i.test(value))
|
|
90
|
+
throw new RpcResponse.InvalidParamsError({
|
|
91
|
+
message: 'Invalid transaction value.',
|
|
92
|
+
})
|
|
93
|
+
return BigInt(value === '0x' ? '0x0' : value)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Returns whether a raw transaction uses a Tempo sender or fee-payer wire prefix. */
|
|
97
|
+
export function isSerializedTempoTransaction(
|
|
98
|
+
value: unknown,
|
|
99
|
+
): value is `0x76${string}` | `0x78${string}` {
|
|
100
|
+
if (typeof value !== 'string') return false
|
|
101
|
+
// `0x78` is Tempo's fee-payer handoff magic, not a separate EIP-2718 type.
|
|
102
|
+
return (
|
|
103
|
+
value.startsWith(TxEnvelopeTempo.serializedType) ||
|
|
104
|
+
value.startsWith(TxEnvelopeTempo.feePayerMagic)
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function normalizeTempoTransaction(
|
|
109
|
+
value: Record<string, unknown> | undefined,
|
|
110
|
+
) {
|
|
111
|
+
if (!value) throw new Error('Expected `tx` in eth_fillTransaction response.')
|
|
112
|
+
return core_Transaction.fromRpc({
|
|
113
|
+
type: '0x76',
|
|
114
|
+
...value,
|
|
115
|
+
} as core_Transaction.Rpc)!
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Preserves the nonce domain when serializing filled Tempo transactions. */
|
|
119
|
+
export function formatTempoTransaction(
|
|
120
|
+
transaction: core_Transaction.Transaction,
|
|
121
|
+
) {
|
|
122
|
+
return {
|
|
123
|
+
...core_Transaction.toRpc(transaction),
|
|
124
|
+
...('nonceKey' in transaction && transaction.nonceKey !== undefined
|
|
125
|
+
? { nonceKey: Hex.fromNumber(transaction.nonceKey) }
|
|
126
|
+
: {}),
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Preserves upstream RPC errors and the relay's expired-transaction contract. */
|
|
131
|
+
export function toRpcError(error: unknown): RpcResponse.BaseError {
|
|
132
|
+
let current: unknown = error
|
|
133
|
+
let deepest: { code: number; message: string; data?: unknown } | undefined
|
|
134
|
+
const seen = new Set<unknown>()
|
|
135
|
+
while (current && typeof current === 'object' && !seen.has(current)) {
|
|
136
|
+
seen.add(current)
|
|
137
|
+
const candidate = current as Record<string, unknown>
|
|
138
|
+
if (
|
|
139
|
+
!(current instanceof UnknownRpcError) &&
|
|
140
|
+
typeof candidate.code === 'number' &&
|
|
141
|
+
typeof candidate.message === 'string'
|
|
142
|
+
)
|
|
143
|
+
deepest =
|
|
144
|
+
current instanceof RpcResponse.BaseError
|
|
145
|
+
? current
|
|
146
|
+
: {
|
|
147
|
+
code: candidate.code,
|
|
148
|
+
message: candidate.message,
|
|
149
|
+
data: candidate.data,
|
|
150
|
+
}
|
|
151
|
+
// The RPC parser wraps unrecognized codes in an InternalError with the original error as data.
|
|
152
|
+
const data = candidate.data
|
|
153
|
+
current =
|
|
154
|
+
current instanceof RpcResponse.InternalError &&
|
|
155
|
+
data &&
|
|
156
|
+
typeof data === 'object' &&
|
|
157
|
+
'code' in data &&
|
|
158
|
+
typeof data.code === 'number' &&
|
|
159
|
+
'message' in data &&
|
|
160
|
+
data.message === candidate.message
|
|
161
|
+
? data
|
|
162
|
+
: candidate.cause
|
|
163
|
+
}
|
|
164
|
+
if (!deepest)
|
|
165
|
+
return new RpcResponse.InternalError({
|
|
166
|
+
message: 'Internal error',
|
|
167
|
+
data: { code: 'internal_error' },
|
|
168
|
+
})
|
|
169
|
+
if (
|
|
170
|
+
deepest.code === -32603 &&
|
|
171
|
+
/^Revm error: transaction expired(?:\.|: .+)?$/.test(deepest.message)
|
|
172
|
+
)
|
|
173
|
+
return new RpcResponse.TransactionRejectedError({
|
|
174
|
+
message: 'Transaction expired.',
|
|
175
|
+
data: { code: 'transaction_expired' },
|
|
176
|
+
})
|
|
177
|
+
return deepest instanceof RpcResponse.BaseError
|
|
178
|
+
? deepest
|
|
179
|
+
: new RpcResponse.BaseError(deepest)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Preserves envelope inputs omitted by the node, including calls and chain ID. Filled fields take precedence; legacy calls are normalized separately. */
|
|
183
|
+
export function mergeCallsFromRequest(
|
|
184
|
+
resultTx: Record<string, unknown>,
|
|
185
|
+
request: Record<string, unknown>,
|
|
186
|
+
): Record<string, unknown> {
|
|
187
|
+
const merged: Record<string, unknown> = { ...request, ...resultTx }
|
|
188
|
+
const resultCalls = resultTx.calls
|
|
189
|
+
if (Array.isArray(resultCalls) && resultCalls.length > 0) return merged
|
|
190
|
+
|
|
191
|
+
const reqCalls = request.calls
|
|
192
|
+
if (Array.isArray(reqCalls)) {
|
|
193
|
+
merged.calls = reqCalls
|
|
194
|
+
return merged
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const { to, data, value } = request
|
|
198
|
+
if (
|
|
199
|
+
typeof to === 'undefined' &&
|
|
200
|
+
typeof data === 'undefined' &&
|
|
201
|
+
typeof value === 'undefined'
|
|
202
|
+
)
|
|
203
|
+
return merged
|
|
204
|
+
|
|
205
|
+
merged.calls = [
|
|
206
|
+
{
|
|
207
|
+
...(typeof to !== 'undefined' ? { to } : {}),
|
|
208
|
+
...(typeof data !== 'undefined' ? { data } : {}),
|
|
209
|
+
...(typeof value !== 'undefined' ? { value } : {}),
|
|
210
|
+
},
|
|
211
|
+
]
|
|
212
|
+
return merged
|
|
213
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { Address } from 'abitype'
|
|
2
|
+
import { type Hex, RpcResponse } from 'ox'
|
|
3
|
+
import * as VirtualAddress from 'ox/tempo/VirtualAddress'
|
|
4
|
+
import type { Client } from '../../../core/Client.js'
|
|
5
|
+
import type { Call } from 'ox/tempo/TxEnvelopeTempo'
|
|
6
|
+
import * as AbiFunction from 'ox/AbiFunction'
|
|
7
|
+
import { validate as isAddress } from 'ox/Address'
|
|
8
|
+
import * as Abis from '../../Abis.js'
|
|
9
|
+
import * as Preflight from './preflight.js'
|
|
10
|
+
|
|
11
|
+
export async function resolveVirtualAddresses(
|
|
12
|
+
client: Client,
|
|
13
|
+
options: { calls: readonly Call[] },
|
|
14
|
+
): Promise<Record<Address, Address | null> | undefined> {
|
|
15
|
+
const targets = getVirtualAddressTargets(options.calls)
|
|
16
|
+
if (targets.length === 0) return undefined
|
|
17
|
+
|
|
18
|
+
const result = await Preflight.read(client, { targets })
|
|
19
|
+
return result.virtualAddresses
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getVirtualAddressTargets(
|
|
23
|
+
calls: readonly Call[],
|
|
24
|
+
): readonly Address[] {
|
|
25
|
+
const targets = new Set<Address>()
|
|
26
|
+
for (const call of calls) {
|
|
27
|
+
for (const address of [call.to, decodeTransferRecipient(call.data)]) {
|
|
28
|
+
if (!address || !isAddress(address) || !VirtualAddress.isVirtual(address))
|
|
29
|
+
continue
|
|
30
|
+
targets.add(address.toLowerCase() as Address)
|
|
31
|
+
if (targets.size > 100)
|
|
32
|
+
throw new RpcResponse.InvalidParamsError({
|
|
33
|
+
message: 'Virtual-address targets exceed the limit of 100 addresses.',
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return [...targets]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function decodeTransferRecipient(data?: string): Address | undefined {
|
|
42
|
+
if (!data) return undefined
|
|
43
|
+
|
|
44
|
+
const selector = data.slice(0, 10).toLowerCase()
|
|
45
|
+
if (!transferSelectors.has(selector)) return undefined
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const fn = AbiFunction.fromAbi(Abis.tip20, data as Hex.Hex)
|
|
49
|
+
const args = AbiFunction.decodeData(fn, data as Hex.Hex)
|
|
50
|
+
const functionName = fn.name
|
|
51
|
+
|
|
52
|
+
if (
|
|
53
|
+
(functionName === 'transfer' || functionName === 'transferWithMemo') &&
|
|
54
|
+
typeof args[0] === 'string' &&
|
|
55
|
+
isAddress(args[0], { strict: false })
|
|
56
|
+
)
|
|
57
|
+
return args[0]
|
|
58
|
+
|
|
59
|
+
if (
|
|
60
|
+
(functionName === 'transferFrom' ||
|
|
61
|
+
functionName === 'transferFromWithMemo') &&
|
|
62
|
+
typeof args[1] === 'string'
|
|
63
|
+
)
|
|
64
|
+
return args[1]
|
|
65
|
+
} catch {}
|
|
66
|
+
|
|
67
|
+
return undefined
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const transferSelectors = new Set([
|
|
71
|
+
'0xa9059cbb',
|
|
72
|
+
'0x95777d59',
|
|
73
|
+
'0x23b872dd',
|
|
74
|
+
'0x929c2539',
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
export function extractCalls(
|
|
78
|
+
transaction: Record<string, unknown>,
|
|
79
|
+
): readonly Call[] {
|
|
80
|
+
const calls = transaction.calls as readonly Call[] | undefined
|
|
81
|
+
if (calls && calls.length > 0)
|
|
82
|
+
return calls.map((c) => ({
|
|
83
|
+
...(c.to ? { to: c.to } : {}),
|
|
84
|
+
...(c.data ? { data: c.data } : {}),
|
|
85
|
+
...(c.value ? { value: c.value } : {}),
|
|
86
|
+
})) as readonly Call[]
|
|
87
|
+
|
|
88
|
+
return [
|
|
89
|
+
{
|
|
90
|
+
...(transaction.to ? { to: transaction.to as Address } : {}),
|
|
91
|
+
...(transaction.data ? { data: transaction.data as `0x${string}` } : {}),
|
|
92
|
+
...(transaction.value ? { value: transaction.value as bigint } : {}),
|
|
93
|
+
},
|
|
94
|
+
] as readonly Call[]
|
|
95
|
+
}
|