viem 2.52.2 → 2.54.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 +79 -0
- package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js +2 -0
- package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/actions/index.js +3 -2
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/token/approve.js +62 -0
- package/_cjs/actions/token/approve.js.map +1 -0
- package/_cjs/actions/token/approveSync.js +25 -0
- package/_cjs/actions/token/approveSync.js.map +1 -0
- package/_cjs/actions/token/getAllowance.js +32 -0
- package/_cjs/actions/token/getAllowance.js.map +1 -0
- package/_cjs/actions/token/getBalance.js +41 -0
- package/_cjs/actions/token/getBalance.js.map +1 -0
- package/_cjs/actions/token/getMetadata.js +40 -0
- package/_cjs/actions/token/getMetadata.js.map +1 -0
- package/_cjs/actions/token/getTotalSupply.js +32 -0
- package/_cjs/actions/token/getTotalSupply.js.map +1 -0
- package/_cjs/actions/token/index.js +20 -0
- package/_cjs/actions/token/index.js.map +1 -0
- package/_cjs/actions/token/internal.js +125 -0
- package/_cjs/actions/token/internal.js.map +1 -0
- package/_cjs/actions/token/transfer.js +70 -0
- package/_cjs/actions/token/transfer.js.map +1 -0
- package/_cjs/actions/token/transferSync.js +25 -0
- package/_cjs/actions/token/transferSync.js.map +1 -0
- package/_cjs/chains/definitions/battlechain.js +31 -0
- package/_cjs/chains/definitions/battlechain.js.map +1 -0
- package/_cjs/chains/definitions/marooTestnet.js +30 -0
- package/_cjs/chains/definitions/marooTestnet.js.map +1 -0
- package/_cjs/chains/definitions/monad.js +5 -5
- package/_cjs/chains/definitions/monad.js.map +1 -1
- package/_cjs/chains/definitions/whitechainSepolia.js +31 -0
- package/_cjs/chains/definitions/whitechainSepolia.js.map +1 -0
- package/_cjs/chains/index.js +20 -14
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/createClient.js +39 -1
- package/_cjs/clients/createClient.js.map +1 -1
- package/_cjs/clients/createPublicClient.js.map +1 -1
- package/_cjs/clients/createWalletClient.js.map +1 -1
- package/_cjs/clients/decorators/public.js +11 -0
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/clients/decorators/wallet.js +8 -0
- package/_cjs/clients/decorators/wallet.js.map +1 -1
- package/_cjs/clients/transports/http.js +2 -1
- package/_cjs/clients/transports/http.js.map +1 -1
- package/_cjs/errors/encoding.js +9 -1
- package/_cjs/errors/encoding.js.map +1 -1
- package/_cjs/errors/request.js +24 -1
- package/_cjs/errors/request.js.map +1 -1
- package/_cjs/errors/transaction.js +9 -1
- package/_cjs/errors/transaction.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js +9 -6
- package/_cjs/index.js.map +1 -1
- package/_cjs/tempo/Abis.js +1866 -1866
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Client.js +27 -0
- package/_cjs/tempo/Client.js.map +1 -0
- package/_cjs/tempo/Decorator.js +234 -215
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/Scopes.js +39 -0
- package/_cjs/tempo/Scopes.js.map +1 -0
- package/_cjs/tempo/Selectors.js +226 -0
- package/_cjs/tempo/Selectors.js.map +1 -0
- package/_cjs/tempo/actions/token.js +210 -112
- package/_cjs/tempo/actions/token.js.map +1 -1
- package/_cjs/tempo/index.js +13 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/tempo/internal/utils.js +108 -0
- package/_cjs/tempo/internal/utils.js.map +1 -1
- package/_cjs/tokens/defineToken.js +21 -0
- package/_cjs/tokens/defineToken.js.map +1 -0
- package/_cjs/tokens/definitions/alphausd.js +14 -0
- package/_cjs/tokens/definitions/alphausd.js.map +1 -0
- package/_cjs/tokens/definitions/betausd.js +14 -0
- package/_cjs/tokens/definitions/betausd.js.map +1 -0
- package/_cjs/tokens/definitions/brla.js +14 -0
- package/_cjs/tokens/definitions/brla.js.map +1 -0
- package/_cjs/tokens/definitions/cbbtc.js +14 -0
- package/_cjs/tokens/definitions/cbbtc.js.map +1 -0
- package/_cjs/tokens/definitions/chfau.js +14 -0
- package/_cjs/tokens/definitions/chfau.js.map +1 -0
- package/_cjs/tokens/definitions/cusd.js +14 -0
- package/_cjs/tokens/definitions/cusd.js.map +1 -0
- package/_cjs/tokens/definitions/dlusd.js +14 -0
- package/_cjs/tokens/definitions/dlusd.js.map +1 -0
- package/_cjs/tokens/definitions/eurau.js +14 -0
- package/_cjs/tokens/definitions/eurau.js.map +1 -0
- package/_cjs/tokens/definitions/eurce.js +15 -0
- package/_cjs/tokens/definitions/eurce.js.map +1 -0
- package/_cjs/tokens/definitions/frxusd.js +14 -0
- package/_cjs/tokens/definitions/frxusd.js.map +1 -0
- package/_cjs/tokens/definitions/gbpa.js +14 -0
- package/_cjs/tokens/definitions/gbpa.js.map +1 -0
- package/_cjs/tokens/definitions/gusd.js +14 -0
- package/_cjs/tokens/definitions/gusd.js.map +1 -0
- package/_cjs/tokens/definitions/iusd.js +14 -0
- package/_cjs/tokens/definitions/iusd.js.map +1 -0
- package/_cjs/tokens/definitions/pathusd.js +15 -0
- package/_cjs/tokens/definitions/pathusd.js.map +1 -0
- package/_cjs/tokens/definitions/reusd.js +14 -0
- package/_cjs/tokens/definitions/reusd.js.map +1 -0
- package/_cjs/tokens/definitions/rusd.js +14 -0
- package/_cjs/tokens/definitions/rusd.js.map +1 -0
- package/_cjs/tokens/definitions/sbc.js +14 -0
- package/_cjs/tokens/definitions/sbc.js.map +1 -0
- package/_cjs/tokens/definitions/siusd.js +14 -0
- package/_cjs/tokens/definitions/siusd.js.map +1 -0
- package/_cjs/tokens/definitions/stcusd.js +14 -0
- package/_cjs/tokens/definitions/stcusd.js.map +1 -0
- package/_cjs/tokens/definitions/susde.js +14 -0
- package/_cjs/tokens/definitions/susde.js.map +1 -0
- package/_cjs/tokens/definitions/syrupusdc.js +14 -0
- package/_cjs/tokens/definitions/syrupusdc.js.map +1 -0
- package/_cjs/tokens/definitions/thetausd.js +14 -0
- package/_cjs/tokens/definitions/thetausd.js.map +1 -0
- package/_cjs/tokens/definitions/usd1.js +14 -0
- package/_cjs/tokens/definitions/usd1.js.map +1 -0
- package/_cjs/tokens/definitions/usdb.js +14 -0
- package/_cjs/tokens/definitions/usdb.js.map +1 -0
- package/_cjs/tokens/definitions/usdc.js +41 -0
- package/_cjs/tokens/definitions/usdc.js.map +1 -0
- package/_cjs/tokens/definitions/usdce.js +15 -0
- package/_cjs/tokens/definitions/usdce.js.map +1 -0
- package/_cjs/tokens/definitions/usde.js +14 -0
- package/_cjs/tokens/definitions/usde.js.map +1 -0
- package/_cjs/tokens/definitions/usdt0.js +14 -0
- package/_cjs/tokens/definitions/usdt0.js.map +1 -0
- package/_cjs/tokens/definitions/wsrusd.js +14 -0
- package/_cjs/tokens/definitions/wsrusd.js.map +1 -0
- package/_cjs/tokens/index.js +64 -0
- package/_cjs/tokens/index.js.map +1 -0
- package/_cjs/utils/encoding/fromRlp.js +7 -4
- package/_cjs/utils/encoding/fromRlp.js.map +1 -1
- package/_cjs/utils/rpc/http.js +58 -3
- package/_cjs/utils/rpc/http.js.map +1 -1
- package/_cjs/utils/transaction/parseTransaction.js +4 -1
- package/_cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js +2 -0
- package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/actions/index.js +1 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/token/approve.js +123 -0
- package/_esm/actions/token/approve.js.map +1 -0
- package/_esm/actions/token/approveSync.js +50 -0
- package/_esm/actions/token/approveSync.js.map +1 -0
- package/_esm/actions/token/getAllowance.js +62 -0
- package/_esm/actions/token/getAllowance.js.map +1 -0
- package/_esm/actions/token/getBalance.js +70 -0
- package/_esm/actions/token/getBalance.js.map +1 -0
- package/_esm/actions/token/getMetadata.js +60 -0
- package/_esm/actions/token/getMetadata.js.map +1 -0
- package/_esm/actions/token/getTotalSupply.js +60 -0
- package/_esm/actions/token/getTotalSupply.js.map +1 -0
- package/_esm/actions/token/index.js +10 -0
- package/_esm/actions/token/index.js.map +1 -0
- package/_esm/actions/token/internal.js +188 -0
- package/_esm/actions/token/internal.js.map +1 -0
- package/_esm/actions/token/transfer.js +147 -0
- package/_esm/actions/token/transfer.js.map +1 -0
- package/_esm/actions/token/transferSync.js +54 -0
- package/_esm/actions/token/transferSync.js.map +1 -0
- package/_esm/chains/definitions/battlechain.js +28 -0
- package/_esm/chains/definitions/battlechain.js.map +1 -0
- package/_esm/chains/definitions/marooTestnet.js +27 -0
- package/_esm/chains/definitions/marooTestnet.js.map +1 -0
- package/_esm/chains/definitions/monad.js +5 -5
- package/_esm/chains/definitions/monad.js.map +1 -1
- package/_esm/chains/definitions/whitechainSepolia.js +28 -0
- package/_esm/chains/definitions/whitechainSepolia.js.map +1 -0
- package/_esm/chains/index.js +3 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/createClient.js +53 -1
- package/_esm/clients/createClient.js.map +1 -1
- package/_esm/clients/createPublicClient.js.map +1 -1
- package/_esm/clients/createWalletClient.js.map +1 -1
- package/_esm/clients/decorators/public.js +17 -0
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/clients/decorators/wallet.js +8 -0
- package/_esm/clients/decorators/wallet.js.map +1 -1
- package/_esm/clients/transports/http.js +2 -1
- package/_esm/clients/transports/http.js.map +1 -1
- package/_esm/errors/encoding.js +7 -0
- package/_esm/errors/encoding.js.map +1 -1
- package/_esm/errors/request.js +22 -0
- package/_esm/errors/request.js.map +1 -1
- package/_esm/errors/transaction.js +7 -0
- package/_esm/errors/transaction.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js +3 -3
- package/_esm/index.js.map +1 -1
- package/_esm/tempo/Abis.js +1865 -1865
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Client.js +66 -0
- package/_esm/tempo/Client.js.map +1 -0
- package/_esm/tempo/Decorator.js +234 -218
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/Scopes.js +49 -0
- package/_esm/tempo/Scopes.js.map +1 -0
- package/_esm/tempo/Selectors.js +224 -0
- package/_esm/tempo/Selectors.js.map +1 -0
- package/_esm/tempo/actions/token.js +335 -186
- package/_esm/tempo/actions/token.js.map +1 -1
- package/_esm/tempo/actions/wallet.js +1 -1
- package/_esm/tempo/index.js +9 -0
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/tempo/internal/utils.js +154 -0
- package/_esm/tempo/internal/utils.js.map +1 -1
- package/_esm/tokens/defineToken.js +57 -0
- package/_esm/tokens/defineToken.js.map +1 -0
- package/_esm/tokens/definitions/alphausd.js +12 -0
- package/_esm/tokens/definitions/alphausd.js.map +1 -0
- package/_esm/tokens/definitions/betausd.js +12 -0
- package/_esm/tokens/definitions/betausd.js.map +1 -0
- package/_esm/tokens/definitions/brla.js +12 -0
- package/_esm/tokens/definitions/brla.js.map +1 -0
- package/_esm/tokens/definitions/cbbtc.js +12 -0
- package/_esm/tokens/definitions/cbbtc.js.map +1 -0
- package/_esm/tokens/definitions/chfau.js +12 -0
- package/_esm/tokens/definitions/chfau.js.map +1 -0
- package/_esm/tokens/definitions/cusd.js +12 -0
- package/_esm/tokens/definitions/cusd.js.map +1 -0
- package/_esm/tokens/definitions/dlusd.js +12 -0
- package/_esm/tokens/definitions/dlusd.js.map +1 -0
- package/_esm/tokens/definitions/eurau.js +12 -0
- package/_esm/tokens/definitions/eurau.js.map +1 -0
- package/_esm/tokens/definitions/eurce.js +13 -0
- package/_esm/tokens/definitions/eurce.js.map +1 -0
- package/_esm/tokens/definitions/frxusd.js +12 -0
- package/_esm/tokens/definitions/frxusd.js.map +1 -0
- package/_esm/tokens/definitions/gbpa.js +12 -0
- package/_esm/tokens/definitions/gbpa.js.map +1 -0
- package/_esm/tokens/definitions/gusd.js +12 -0
- package/_esm/tokens/definitions/gusd.js.map +1 -0
- package/_esm/tokens/definitions/iusd.js +12 -0
- package/_esm/tokens/definitions/iusd.js.map +1 -0
- package/_esm/tokens/definitions/pathusd.js +13 -0
- package/_esm/tokens/definitions/pathusd.js.map +1 -0
- package/_esm/tokens/definitions/reusd.js +12 -0
- package/_esm/tokens/definitions/reusd.js.map +1 -0
- package/_esm/tokens/definitions/rusd.js +12 -0
- package/_esm/tokens/definitions/rusd.js.map +1 -0
- package/_esm/tokens/definitions/sbc.js +12 -0
- package/_esm/tokens/definitions/sbc.js.map +1 -0
- package/_esm/tokens/definitions/siusd.js +12 -0
- package/_esm/tokens/definitions/siusd.js.map +1 -0
- package/_esm/tokens/definitions/stcusd.js +12 -0
- package/_esm/tokens/definitions/stcusd.js.map +1 -0
- package/_esm/tokens/definitions/susde.js +12 -0
- package/_esm/tokens/definitions/susde.js.map +1 -0
- package/_esm/tokens/definitions/syrupusdc.js +12 -0
- package/_esm/tokens/definitions/syrupusdc.js.map +1 -0
- package/_esm/tokens/definitions/thetausd.js +12 -0
- package/_esm/tokens/definitions/thetausd.js.map +1 -0
- package/_esm/tokens/definitions/usd1.js +12 -0
- package/_esm/tokens/definitions/usd1.js.map +1 -0
- package/_esm/tokens/definitions/usdb.js +12 -0
- package/_esm/tokens/definitions/usdb.js.map +1 -0
- package/_esm/tokens/definitions/usdc.js +67 -0
- package/_esm/tokens/definitions/usdc.js.map +1 -0
- package/_esm/tokens/definitions/usdce.js +13 -0
- package/_esm/tokens/definitions/usdce.js.map +1 -0
- package/_esm/tokens/definitions/usde.js +12 -0
- package/_esm/tokens/definitions/usde.js.map +1 -0
- package/_esm/tokens/definitions/usdt0.js +12 -0
- package/_esm/tokens/definitions/usdt0.js.map +1 -0
- package/_esm/tokens/definitions/wsrusd.js +12 -0
- package/_esm/tokens/definitions/wsrusd.js.map +1 -0
- package/_esm/tokens/index.js +32 -0
- package/_esm/tokens/index.js.map +1 -0
- package/_esm/utils/encoding/fromRlp.js +8 -5
- package/_esm/utils/encoding/fromRlp.js.map +1 -1
- package/_esm/utils/rpc/http.js +59 -4
- package/_esm/utils/rpc/http.js.map +1 -1
- package/_esm/utils/transaction/parseTransaction.js +5 -2
- package/_esm/utils/transaction/parseTransaction.js.map +1 -1
- package/_types/account-abstraction/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/actions/index.d.ts +1 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/token/approve.d.ts +253 -0
- package/_types/actions/token/approve.d.ts.map +1 -0
- package/_types/actions/token/approveSync.d.ts +57 -0
- package/_types/actions/token/approveSync.d.ts.map +1 -0
- package/_types/actions/token/getAllowance.d.ts +77 -0
- package/_types/actions/token/getAllowance.d.ts.map +1 -0
- package/_types/actions/token/getBalance.d.ts +69 -0
- package/_types/actions/token/getBalance.d.ts.map +1 -0
- package/_types/actions/token/getMetadata.d.ts +43 -0
- package/_types/actions/token/getMetadata.d.ts.map +1 -0
- package/_types/actions/token/getTotalSupply.d.ts +63 -0
- package/_types/actions/token/getTotalSupply.d.ts.map +1 -0
- package/_types/actions/token/index.d.ts +9 -0
- package/_types/actions/token/index.d.ts.map +1 -0
- package/_types/actions/token/internal.d.ts +168 -0
- package/_types/actions/token/internal.d.ts.map +1 -0
- package/_types/actions/token/transfer.d.ts +288 -0
- package/_types/actions/token/transfer.d.ts.map +1 -0
- package/_types/actions/token/transferSync.d.ts +61 -0
- package/_types/actions/token/transferSync.d.ts.map +1 -0
- package/_types/chains/definitions/battlechain.d.ts +447 -0
- package/_types/chains/definitions/battlechain.d.ts.map +1 -0
- package/_types/chains/definitions/marooTestnet.d.ts +49 -0
- package/_types/chains/definitions/marooTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/monad.d.ts +5 -5
- package/_types/chains/definitions/whitechainSepolia.d.ts +46 -0
- package/_types/chains/definitions/whitechainSepolia.d.ts.map +1 -0
- package/_types/chains/index.d.ts +3 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/createClient.d.ts +24 -6
- package/_types/clients/createClient.d.ts.map +1 -1
- package/_types/clients/createPublicClient.d.ts +4 -3
- package/_types/clients/createPublicClient.d.ts.map +1 -1
- package/_types/clients/createWalletClient.d.ts +4 -3
- package/_types/clients/createWalletClient.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +128 -3
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/clients/decorators/wallet.d.ts +208 -3
- package/_types/clients/decorators/wallet.d.ts.map +1 -1
- package/_types/clients/transports/http.d.ts +2 -0
- package/_types/clients/transports/http.d.ts.map +1 -1
- package/_types/errors/encoding.d.ts +8 -0
- package/_types/errors/encoding.d.ts.map +1 -1
- package/_types/errors/request.d.ts +11 -0
- package/_types/errors/request.d.ts.map +1 -1
- package/_types/errors/transaction.d.ts +8 -0
- package/_types/errors/transaction.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +4 -3
- package/_types/index.d.ts.map +1 -1
- package/_types/tempo/Abis.d.ts +5816 -5816
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Client.d.ts +98 -0
- package/_types/tempo/Client.d.ts.map +1 -0
- package/_types/tempo/Decorator.d.ts +88 -5
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/Scopes.d.ts +48 -0
- package/_types/tempo/Scopes.d.ts.map +1 -0
- package/_types/tempo/Selectors.d.ts +223 -0
- package/_types/tempo/Selectors.d.ts.map +1 -0
- package/_types/tempo/actions/token.d.ts +223 -151
- package/_types/tempo/actions/token.d.ts.map +1 -1
- package/_types/tempo/actions/wallet.d.ts +3 -3
- package/_types/tempo/index.d.ts +9 -0
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/tempo/internal/types.d.ts +17 -0
- package/_types/tempo/internal/types.d.ts.map +1 -1
- package/_types/tempo/internal/utils.d.ts +73 -0
- package/_types/tempo/internal/utils.d.ts.map +1 -1
- package/_types/tokens/defineToken.d.ts +112 -0
- package/_types/tokens/defineToken.d.ts.map +1 -0
- package/_types/tokens/definitions/alphausd.d.ts +11 -0
- package/_types/tokens/definitions/alphausd.d.ts.map +1 -0
- package/_types/tokens/definitions/betausd.d.ts +11 -0
- package/_types/tokens/definitions/betausd.d.ts.map +1 -0
- package/_types/tokens/definitions/brla.d.ts +11 -0
- package/_types/tokens/definitions/brla.d.ts.map +1 -0
- package/_types/tokens/definitions/cbbtc.d.ts +11 -0
- package/_types/tokens/definitions/cbbtc.d.ts.map +1 -0
- package/_types/tokens/definitions/chfau.d.ts +11 -0
- package/_types/tokens/definitions/chfau.d.ts.map +1 -0
- package/_types/tokens/definitions/cusd.d.ts +11 -0
- package/_types/tokens/definitions/cusd.d.ts.map +1 -0
- package/_types/tokens/definitions/dlusd.d.ts +11 -0
- package/_types/tokens/definitions/dlusd.d.ts.map +1 -0
- package/_types/tokens/definitions/eurau.d.ts +11 -0
- package/_types/tokens/definitions/eurau.d.ts.map +1 -0
- package/_types/tokens/definitions/eurce.d.ts +12 -0
- package/_types/tokens/definitions/eurce.d.ts.map +1 -0
- package/_types/tokens/definitions/frxusd.d.ts +11 -0
- package/_types/tokens/definitions/frxusd.d.ts.map +1 -0
- package/_types/tokens/definitions/gbpa.d.ts +11 -0
- package/_types/tokens/definitions/gbpa.d.ts.map +1 -0
- package/_types/tokens/definitions/gusd.d.ts +11 -0
- package/_types/tokens/definitions/gusd.d.ts.map +1 -0
- package/_types/tokens/definitions/iusd.d.ts +11 -0
- package/_types/tokens/definitions/iusd.d.ts.map +1 -0
- package/_types/tokens/definitions/pathusd.d.ts +12 -0
- package/_types/tokens/definitions/pathusd.d.ts.map +1 -0
- package/_types/tokens/definitions/reusd.d.ts +11 -0
- package/_types/tokens/definitions/reusd.d.ts.map +1 -0
- package/_types/tokens/definitions/rusd.d.ts +11 -0
- package/_types/tokens/definitions/rusd.d.ts.map +1 -0
- package/_types/tokens/definitions/sbc.d.ts +11 -0
- package/_types/tokens/definitions/sbc.d.ts.map +1 -0
- package/_types/tokens/definitions/siusd.d.ts +11 -0
- package/_types/tokens/definitions/siusd.d.ts.map +1 -0
- package/_types/tokens/definitions/stcusd.d.ts +11 -0
- package/_types/tokens/definitions/stcusd.d.ts.map +1 -0
- package/_types/tokens/definitions/susde.d.ts +11 -0
- package/_types/tokens/definitions/susde.d.ts.map +1 -0
- package/_types/tokens/definitions/syrupusdc.d.ts +11 -0
- package/_types/tokens/definitions/syrupusdc.d.ts.map +1 -0
- package/_types/tokens/definitions/thetausd.d.ts +11 -0
- package/_types/tokens/definitions/thetausd.d.ts.map +1 -0
- package/_types/tokens/definitions/usd1.d.ts +11 -0
- package/_types/tokens/definitions/usd1.d.ts.map +1 -0
- package/_types/tokens/definitions/usdb.d.ts +11 -0
- package/_types/tokens/definitions/usdb.d.ts.map +1 -0
- package/_types/tokens/definitions/usdc.d.ts +67 -0
- package/_types/tokens/definitions/usdc.d.ts.map +1 -0
- package/_types/tokens/definitions/usdce.d.ts +12 -0
- package/_types/tokens/definitions/usdce.d.ts.map +1 -0
- package/_types/tokens/definitions/usde.d.ts +11 -0
- package/_types/tokens/definitions/usde.d.ts.map +1 -0
- package/_types/tokens/definitions/usdt0.d.ts +11 -0
- package/_types/tokens/definitions/usdt0.d.ts.map +1 -0
- package/_types/tokens/definitions/wsrusd.d.ts +11 -0
- package/_types/tokens/definitions/wsrusd.d.ts.map +1 -0
- package/_types/tokens/index.d.ts +31 -0
- package/_types/tokens/index.d.ts.map +1 -0
- package/_types/utils/encoding/fromRlp.d.ts +2 -2
- package/_types/utils/encoding/fromRlp.d.ts.map +1 -1
- package/_types/utils/rpc/http.d.ts +6 -2
- package/_types/utils/rpc/http.d.ts.map +1 -1
- package/_types/utils/transaction/parseTransaction.d.ts +2 -2
- package/_types/utils/transaction/parseTransaction.d.ts.map +1 -1
- package/account-abstraction/actions/bundler/estimateUserOperationGas.ts +2 -0
- package/actions/index.ts +1 -0
- package/actions/token/approve.ts +202 -0
- package/actions/token/approveSync.ts +95 -0
- package/actions/token/getAllowance.ts +105 -0
- package/actions/token/getBalance.ts +115 -0
- package/actions/token/getMetadata.ts +98 -0
- package/actions/token/getTotalSupply.ts +97 -0
- package/actions/token/index.ts +9 -0
- package/actions/token/internal.ts +367 -0
- package/actions/token/transfer.ts +230 -0
- package/actions/token/transferSync.ts +99 -0
- package/chains/definitions/battlechain.ts +28 -0
- package/chains/definitions/marooTestnet.ts +27 -0
- package/chains/definitions/monad.ts +5 -5
- package/chains/definitions/whitechainSepolia.ts +28 -0
- package/chains/index.ts +3 -0
- package/clients/createClient.ts +90 -8
- package/clients/createPublicClient.ts +22 -4
- package/clients/createWalletClient.ts +22 -4
- package/clients/decorators/public.ts +166 -4
- package/clients/decorators/wallet.ts +242 -3
- package/clients/transports/http.ts +4 -0
- package/errors/encoding.ts +11 -0
- package/errors/request.ts +17 -0
- package/errors/transaction.ts +11 -0
- package/errors/version.ts +1 -1
- package/index.ts +7 -0
- package/package.json +6 -1
- package/tempo/Abis.ts +1869 -1869
- package/tempo/Client.ts +174 -0
- package/tempo/Decorator.ts +398 -337
- package/tempo/Scopes.ts +124 -0
- package/tempo/Selectors.ts +260 -0
- package/tempo/actions/token.ts +519 -296
- package/tempo/actions/wallet.ts +3 -3
- package/tempo/index.ts +34 -0
- package/tempo/internal/types.ts +19 -0
- package/tempo/internal/utils.ts +204 -0
- package/tokens/defineToken.ts +142 -0
- package/tokens/definitions/alphausd.ts +13 -0
- package/tokens/definitions/betausd.ts +13 -0
- package/tokens/definitions/brla.ts +13 -0
- package/tokens/definitions/cbbtc.ts +13 -0
- package/tokens/definitions/chfau.ts +13 -0
- package/tokens/definitions/cusd.ts +13 -0
- package/tokens/definitions/dlusd.ts +13 -0
- package/tokens/definitions/eurau.ts +13 -0
- package/tokens/definitions/eurce.ts +14 -0
- package/tokens/definitions/frxusd.ts +13 -0
- package/tokens/definitions/gbpa.ts +13 -0
- package/tokens/definitions/gusd.ts +13 -0
- package/tokens/definitions/iusd.ts +13 -0
- package/tokens/definitions/pathusd.ts +14 -0
- package/tokens/definitions/reusd.ts +13 -0
- package/tokens/definitions/rusd.ts +13 -0
- package/tokens/definitions/sbc.ts +13 -0
- package/tokens/definitions/siusd.ts +13 -0
- package/tokens/definitions/stcusd.ts +13 -0
- package/tokens/definitions/susde.ts +13 -0
- package/tokens/definitions/syrupusdc.ts +13 -0
- package/tokens/definitions/thetausd.ts +13 -0
- package/tokens/definitions/usd1.ts +13 -0
- package/tokens/definitions/usdb.ts +13 -0
- package/tokens/definitions/usdc.ts +67 -0
- package/tokens/definitions/usdce.ts +14 -0
- package/tokens/definitions/usde.ts +13 -0
- package/tokens/definitions/usdt0.ts +13 -0
- package/tokens/definitions/wsrusd.ts +13 -0
- package/tokens/index.ts +31 -0
- package/tokens/package.json +6 -0
- package/utils/encoding/fromRlp.ts +22 -3
- package/utils/rpc/http.ts +70 -2
- package/utils/transaction/parseTransaction.ts +7 -2
package/tempo/Client.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { Address } from 'abitype'
|
|
2
|
+
import type { TokenId } from 'ox/tempo'
|
|
3
|
+
|
|
4
|
+
import type { JsonRpcAccount } from '../accounts/types.js'
|
|
5
|
+
import {
|
|
6
|
+
type Client as Client_,
|
|
7
|
+
type ClientConfig as ClientConfig_,
|
|
8
|
+
createClient as createClient_,
|
|
9
|
+
} from '../clients/createClient.js'
|
|
10
|
+
import {
|
|
11
|
+
type PublicActions,
|
|
12
|
+
publicActions,
|
|
13
|
+
} from '../clients/decorators/public.js'
|
|
14
|
+
import {
|
|
15
|
+
type WalletActions,
|
|
16
|
+
walletActions,
|
|
17
|
+
} from '../clients/decorators/wallet.js'
|
|
18
|
+
import type { Transport } from '../clients/transports/createTransport.js'
|
|
19
|
+
import { http } from '../clients/transports/http.js'
|
|
20
|
+
import type { ErrorType } from '../errors/utils.js'
|
|
21
|
+
import type { Account } from '../types/account.js'
|
|
22
|
+
import type { Chain } from '../types/chain.js'
|
|
23
|
+
import type { RpcSchema } from '../types/eip1193.js'
|
|
24
|
+
import type { Prettify } from '../types/utils.js'
|
|
25
|
+
import { tempo, tempoTestnet } from './Chain.js'
|
|
26
|
+
import { type Decorator, decorator as tempoActions } from './Decorator.js'
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Configuration for a Tempo {@link Client}.
|
|
30
|
+
*
|
|
31
|
+
* Extends Viem's {@link ClientConfig} with Tempo-specific defaults: `chain`
|
|
32
|
+
* and `transport` become optional, and a `testnet` flag is added to select
|
|
33
|
+
* the Tempo testnet chain.
|
|
34
|
+
*/
|
|
35
|
+
export type ClientConfig<
|
|
36
|
+
transport extends Transport = Transport,
|
|
37
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
38
|
+
accountOrAddress extends Account | Address | undefined =
|
|
39
|
+
| Account
|
|
40
|
+
| Address
|
|
41
|
+
| undefined,
|
|
42
|
+
rpcSchema extends RpcSchema | undefined = undefined,
|
|
43
|
+
> = Prettify<
|
|
44
|
+
Omit<
|
|
45
|
+
ClientConfig_<transport, chain, accountOrAddress, rpcSchema>,
|
|
46
|
+
'chain' | 'transport'
|
|
47
|
+
> & {
|
|
48
|
+
/**
|
|
49
|
+
* Chain for the Client.
|
|
50
|
+
*
|
|
51
|
+
* @default tempo (or `tempoTestnet` when `testnet` is truthy)
|
|
52
|
+
*/
|
|
53
|
+
chain?: chain | Chain | undefined
|
|
54
|
+
/**
|
|
55
|
+
* Default fee token for the Client. Extended onto the chain so it applies
|
|
56
|
+
* to every transaction sent with the Client.
|
|
57
|
+
*/
|
|
58
|
+
feeToken?: TokenId.TokenIdOrAddress | undefined
|
|
59
|
+
/**
|
|
60
|
+
* Whether to use the Tempo testnet chain.
|
|
61
|
+
*
|
|
62
|
+
* Ignored when `chain` is provided.
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
testnet?: boolean | undefined
|
|
67
|
+
/**
|
|
68
|
+
* The RPC transport.
|
|
69
|
+
*
|
|
70
|
+
* @default http()
|
|
71
|
+
*/
|
|
72
|
+
transport?: transport | Transport | undefined
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A Tempo {@link Client}: Viem's base Client decorated with
|
|
78
|
+
* `publicActions`, `walletActions`, and `tempoActions`.
|
|
79
|
+
*/
|
|
80
|
+
export type Client<
|
|
81
|
+
transport extends Transport = Transport,
|
|
82
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
83
|
+
account extends Account | undefined = Account | undefined,
|
|
84
|
+
rpcSchema extends RpcSchema | undefined = undefined,
|
|
85
|
+
> = Prettify<
|
|
86
|
+
Client_<
|
|
87
|
+
transport,
|
|
88
|
+
chain,
|
|
89
|
+
account,
|
|
90
|
+
rpcSchema,
|
|
91
|
+
Omit<
|
|
92
|
+
PublicActions<transport, chain, account> & WalletActions<chain, account>,
|
|
93
|
+
'token'
|
|
94
|
+
> &
|
|
95
|
+
Decorator<chain, account>
|
|
96
|
+
>
|
|
97
|
+
>
|
|
98
|
+
|
|
99
|
+
export type CreateClientErrorType = ErrorType
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Creates a Tempo {@link Client}: an extension of Viem's `createClient`
|
|
103
|
+
* decorated with `publicActions`, `walletActions`, and `tempoActions`.
|
|
104
|
+
*
|
|
105
|
+
* Defaults to the `tempo` mainnet chain and `http` transport, so a minimal
|
|
106
|
+
* client can be created with `createClient()`. Pass `testnet` to use the
|
|
107
|
+
* Tempo testnet, or `chain` to override the chain entirely. Pass `feeToken`
|
|
108
|
+
* to set a default fee token for every transaction.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* import { createClient } from 'viem/tempo'
|
|
113
|
+
*
|
|
114
|
+
* // Minimal client (tempo mainnet, http transport).
|
|
115
|
+
* const client = createClient()
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* import { Account, createClient, http } from 'viem/tempo'
|
|
121
|
+
*
|
|
122
|
+
* // Testnet client with an account and custom transport.
|
|
123
|
+
* const client = createClient({
|
|
124
|
+
* account: Account.fromSecp256k1('0x...'),
|
|
125
|
+
* testnet: true,
|
|
126
|
+
* transport: http('https://rpc.example.com'),
|
|
127
|
+
* })
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* import { createClient } from 'viem/tempo'
|
|
133
|
+
*
|
|
134
|
+
* // Client with a default fee token.
|
|
135
|
+
* const client = createClient({
|
|
136
|
+
* feeToken: '0x20c0000000000000000000000000000000000001',
|
|
137
|
+
* })
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @param parameters - Parameters.
|
|
141
|
+
* @returns The Tempo Client.
|
|
142
|
+
*/
|
|
143
|
+
export function createClient<
|
|
144
|
+
transport extends Transport = Transport,
|
|
145
|
+
chain extends Chain | undefined = typeof tempo,
|
|
146
|
+
accountOrAddress extends Account | Address | undefined = undefined,
|
|
147
|
+
rpcSchema extends RpcSchema | undefined = undefined,
|
|
148
|
+
>(
|
|
149
|
+
parameters: ClientConfig<transport, chain, accountOrAddress, rpcSchema> = {},
|
|
150
|
+
): Client<
|
|
151
|
+
transport,
|
|
152
|
+
chain,
|
|
153
|
+
accountOrAddress extends Address
|
|
154
|
+
? Prettify<JsonRpcAccount<accountOrAddress>>
|
|
155
|
+
: accountOrAddress,
|
|
156
|
+
rpcSchema
|
|
157
|
+
> {
|
|
158
|
+
const { chain, feeToken, testnet, transport, ...rest } = parameters
|
|
159
|
+
const baseChain = chain ?? (testnet ? tempoTestnet : tempo)
|
|
160
|
+
const resolvedChain =
|
|
161
|
+
feeToken && typeof (baseChain as { extend?: unknown }).extend === 'function'
|
|
162
|
+
? (baseChain as { extend: (e: { feeToken: unknown }) => Chain }).extend({
|
|
163
|
+
feeToken,
|
|
164
|
+
})
|
|
165
|
+
: baseChain
|
|
166
|
+
return createClient_({
|
|
167
|
+
...rest,
|
|
168
|
+
chain: resolvedChain,
|
|
169
|
+
transport: transport ?? http(),
|
|
170
|
+
} as ClientConfig_)
|
|
171
|
+
.extend(publicActions)
|
|
172
|
+
.extend(walletActions)
|
|
173
|
+
.extend(tempoActions()) as never
|
|
174
|
+
}
|