viem 2.53.1 → 2.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- 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/index.js +18 -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/Client.js +3 -1
- package/_cjs/tempo/Client.js.map +1 -1
- package/_cjs/tempo/Decorator.js +234 -215
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/actions/token.js +210 -112
- package/_cjs/tempo/actions/token.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/cirbtc.js +16 -0
- package/_cjs/tokens/definitions/cirbtc.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/eurc.js +24 -0
- package/_cjs/tokens/definitions/eurc.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 +59 -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/usyc.js +18 -0
- package/_cjs/tokens/definitions/usyc.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 +72 -0
- package/_cjs/tokens/index.js.map +1 -0
- package/_cjs/tokens/sets.js +102 -0
- package/_cjs/tokens/sets.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/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/index.js +2 -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/Client.js +3 -1
- package/_esm/tempo/Client.js.map +1 -1
- package/_esm/tempo/Decorator.js +234 -218
- package/_esm/tempo/Decorator.js.map +1 -1
- 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/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/cirbtc.js +21 -0
- package/_esm/tokens/definitions/cirbtc.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/eurc.js +29 -0
- package/_esm/tokens/definitions/eurc.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 +85 -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/usyc.js +23 -0
- package/_esm/tokens/definitions/usyc.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 +36 -0
- package/_esm/tokens/index.js.map +1 -0
- package/_esm/tokens/sets.js +104 -0
- package/_esm/tokens/sets.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/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/index.d.ts +2 -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/Client.d.ts +1 -1
- package/_types/tempo/Client.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +88 -5
- package/_types/tempo/Decorator.d.ts.map +1 -1
- 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/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/cirbtc.d.ts +21 -0
- package/_types/tokens/definitions/cirbtc.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/eurc.d.ts +29 -0
- package/_types/tokens/definitions/eurc.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 +85 -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/usyc.d.ts +23 -0
- package/_types/tokens/definitions/usyc.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 +35 -0
- package/_types/tokens/index.d.ts.map +1 -0
- package/_types/tokens/sets.d.ts +607 -0
- package/_types/tokens/sets.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/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/index.ts +2 -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/Client.ts +7 -3
- package/tempo/Decorator.ts +398 -337
- package/tempo/actions/token.ts +519 -296
- package/tempo/actions/wallet.ts +3 -3
- 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/cirbtc.ts +21 -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/eurc.ts +29 -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 +85 -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/usyc.ts +23 -0
- package/tokens/definitions/wsrusd.ts +13 -0
- package/tokens/index.ts +35 -0
- package/tokens/package.json +6 -0
- package/tokens/sets.ts +109 -0
- package/utils/encoding/fromRlp.ts +22 -3
- package/utils/rpc/http.ts +70 -2
- package/utils/transaction/parseTransaction.ts +7 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const reusd = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c000000000000000000000383a23bacb546ab9', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'Re Protocol reUSD',
|
|
12
|
+
symbol: 'reUSD',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const rusd = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c0000000000000000000007f7ba549dd0251b9', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'Reservoir Stablecoin',
|
|
12
|
+
symbol: 'rUSD',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const sbc = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c000000000000000000000ae247a1130450f09', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'Stable Coin',
|
|
12
|
+
symbol: 'SBC',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const siusd = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c000000000000000000000048c8f36df1c9a4a', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'siUSD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'InfiniFi Staked USD',
|
|
12
|
+
symbol: 'siUSD',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const stcusd = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c0000000000000000000008ee4fcff88888888', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'stcUSD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'Staked Cap USD',
|
|
12
|
+
symbol: 'stcUSD',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const susde = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c000000000000000000000bd95bfb69fbe6ce3', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'sUSDe',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'Staked USDe',
|
|
12
|
+
symbol: 'sUSDe',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const syrupusdc = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c0000000000000000000008191667423f70e67', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'syrupUSDC',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'Syrup USDC',
|
|
12
|
+
symbol: 'syrupUSDC',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const thetausd = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
42431: '0x20c0000000000000000000000000000000000003', // tempoModerato
|
|
8
|
+
},
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'ThetaUSD',
|
|
12
|
+
symbol: 'thetaUSD',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const usd1 = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c000000000000000000000111111111e910f0f', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'USD1',
|
|
12
|
+
symbol: 'USD1',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const usdb = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c0000000000000000000003158081efd85bfc2', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'USDBridge',
|
|
12
|
+
symbol: 'USDB',
|
|
13
|
+
})
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { defineToken } from '../defineToken.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [USDC](https://www.circle.com/usdc) token, with canonical contract addresses
|
|
5
|
+
* across supported chains.
|
|
6
|
+
*
|
|
7
|
+
* Pass to a Client's `tokens` array, call with a chain id to produce a
|
|
8
|
+
* [token config](/docs/chains/tokens), or read the metadata and `addresses`
|
|
9
|
+
* map directly.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { createPublicClient, http } from 'viem'
|
|
14
|
+
* import { mainnet } from 'viem/chains'
|
|
15
|
+
* import { usdc } from 'viem/tokens'
|
|
16
|
+
*
|
|
17
|
+
* const client = createPublicClient({
|
|
18
|
+
* chain: mainnet,
|
|
19
|
+
* tokens: [usdc],
|
|
20
|
+
* transport: http(),
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { usdc } from 'viem/tokens'
|
|
27
|
+
*
|
|
28
|
+
* usdc.addresses[1]
|
|
29
|
+
* // '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const usdc = /*#__PURE__*/ defineToken({
|
|
33
|
+
addresses: {
|
|
34
|
+
1: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // mainnet
|
|
35
|
+
10: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', // optimism
|
|
36
|
+
25: '0x3D7F2C478aAfdB65542BCB44bCeeC05849999d2D', // cronos
|
|
37
|
+
50: '0xfA2958CB79b0491CC627c1557F441eF849Ca8eb1', // xdc
|
|
38
|
+
51: '0xb5AB69F7bBada22B28e79C8FFAECe55eF1c771D4', // xdcTestnet
|
|
39
|
+
130: '0x078D782b760474a361dDA0AF3839290b0EF57AD6', // unichain
|
|
40
|
+
137: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359', // polygon
|
|
41
|
+
143: '0x754704Bc059F8C67012fEd69BC8A327a5aafb603', // monad
|
|
42
|
+
146: '0x29219dd400f2Bf60E5a23d13Be72B486D4038894', // sonic
|
|
43
|
+
300: '0xAe045DE5638162fa134807Cb558E15A3F5A7F853', // zksyncSepoliaTestnet
|
|
44
|
+
324: '0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4', // zksync
|
|
45
|
+
338: '0xEb33dc5fac03833e132593659e1dE7256aB59794', // cronosTestnet
|
|
46
|
+
480: '0x79A02482A880bCE3F13e09Da970dC34db4CD24d1', // worldchain
|
|
47
|
+
998: '0x2B3370eE501B4a559b57D449569354196457D8Ab', // hyperliquidEvmTestnet
|
|
48
|
+
999: '0xb88339CB7199b77E23DB6E890353E22632Ba630f', // hyperEvm
|
|
49
|
+
1301: '0x31d0220469e10c4E71834a79b1f276d740d3768F', // unichainSepolia
|
|
50
|
+
1328: '0x4fCF1784B31630811181f670Aea7A7bEF803eaED', // seiTestnet
|
|
51
|
+
1329: '0xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392', // sei
|
|
52
|
+
1439: '0x0C382e685bbeeFE5d3d9C29e29E341fEE8E84C5d', // injectiveTestnet
|
|
53
|
+
1776: '0xa00C59fF5a080D2b954d0c75e46E22a0c371235a', // injective
|
|
54
|
+
2818: '0xCfb1186F4e93D60E60a8bDd997427D1F33bc372B', // morph
|
|
55
|
+
4801: '0x66145f38cBAC35Ca6F1Dfb4914dF98F1614aeA88', // worldchainSepolia
|
|
56
|
+
8453: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // base
|
|
57
|
+
10143: '0x534b2f3A21130d7a60830c2Df862319e593943A3', // monadTestnet
|
|
58
|
+
42161: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', // arbitrum
|
|
59
|
+
42220: '0xcebA9300f2b948710d2653dD7B07f33A8B32118C', // celo
|
|
60
|
+
43113: '0x5425890298aed601595a70AB815c96711a31Bc65', // avalancheFuji
|
|
61
|
+
43114: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', // avalanche
|
|
62
|
+
57054: '0xA4879Fed32Ecbef99399e5cbC247E533421C4eC6', // sonicBlazeTestnet
|
|
63
|
+
57073: '0x2D270e6886d130D724215A266106e6832161EAEd', // ink
|
|
64
|
+
59141: '0xFEce4462D57bD51A6A552365A011b95f0E16d9B7', // lineaSepolia
|
|
65
|
+
59144: '0x176211869cA2b568f2A7D4EE941E073a821EE1ff', // linea
|
|
66
|
+
64165: '0x0BA304580ee7c9a980CF72e55f5Ed2E9fd30Bc51', // sonicTestnet
|
|
67
|
+
80002: '0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582', // polygonAmoy
|
|
68
|
+
81224: '0xd996633a415985DBd7D6D12f4A4343E31f5037cf', // codex
|
|
69
|
+
84532: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', // baseSepolia
|
|
70
|
+
98866: '0x222365EF19F7947e5484218551B56bb3965Aa7aF', // plumeMainnet
|
|
71
|
+
98867: '0xcB5f30e335672893c7eb944B374c196392C19D18', // plumeSepolia
|
|
72
|
+
421614: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d', // arbitrumSepolia
|
|
73
|
+
763373: '0xFabab97dCE620294D2B0b0e46C68964e326300Ac', // inkSepolia
|
|
74
|
+
812242: '0x6d7f141b6819C2c9CC2f818e6ad549E7Ca090F8f', // codexTestnet
|
|
75
|
+
5042002: '0x3600000000000000000000000000000000000000', // arcTestnet
|
|
76
|
+
11142220: '0x01C5C0122039549AD1493B8220cABEdD739BC44E', // celoSepolia
|
|
77
|
+
11155111: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // sepolia
|
|
78
|
+
11155420: '0x5fd84259d66Cd46123540766Be93DFE6D43130D7', // optimismSepolia
|
|
79
|
+
},
|
|
80
|
+
currency: 'USD',
|
|
81
|
+
decimals: 6,
|
|
82
|
+
name: 'USD Coin',
|
|
83
|
+
popular: true,
|
|
84
|
+
symbol: 'USDC',
|
|
85
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const usdce = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c000000000000000000000b9537d11c60e8b50', // tempo
|
|
8
|
+
42431: '0x20c0000000000000000000009e8d7eb59b783726', // tempoModerato
|
|
9
|
+
},
|
|
10
|
+
currency: 'USD',
|
|
11
|
+
decimals: 6,
|
|
12
|
+
name: 'Bridged USDC (Stargate)',
|
|
13
|
+
symbol: 'USDC.e',
|
|
14
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const usde = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c0000000000000000000002f52d5cc21a3207b', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'USDe',
|
|
12
|
+
symbol: 'USDe',
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const usdt0 = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c00000000000000000000014f22ca97301eb73', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'USD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'USDT0',
|
|
12
|
+
symbol: 'USDT0',
|
|
13
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineToken } from '../defineToken.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [USYC](https://developers.circle.com/tokenized/usyc/overview) token, with
|
|
5
|
+
* canonical contract addresses across supported EVM chains.
|
|
6
|
+
*
|
|
7
|
+
* Pass to a Client's `tokens` array, call with a chain id to produce a
|
|
8
|
+
* [token config](/docs/chains/tokens), or read the metadata and `addresses`
|
|
9
|
+
* map directly.
|
|
10
|
+
*/
|
|
11
|
+
export const usyc = /*#__PURE__*/ defineToken({
|
|
12
|
+
addresses: {
|
|
13
|
+
1: '0x136471a34f6ef19fE571EFFC1CA711fdb8E49f2b', // mainnet
|
|
14
|
+
56: '0x8D0fA28f221eB5735BC71d3a0Da67EE5bC821311', // bsc
|
|
15
|
+
97: '0x109656Aba6F175c634c63C9874f29CeAAAB8E606', // bscTestnet
|
|
16
|
+
5042002: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C', // arcTestnet
|
|
17
|
+
11155111: '0x38D3A3f8717F4DB1CcB4Ad7D8C755919440848A3', // sepolia
|
|
18
|
+
},
|
|
19
|
+
currency: 'USD',
|
|
20
|
+
decimals: 6,
|
|
21
|
+
name: 'US Yield Coin',
|
|
22
|
+
symbol: 'USYC',
|
|
23
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import { defineToken } from '../defineToken.js'
|
|
4
|
+
|
|
5
|
+
export const wsrusd = /*#__PURE__*/ defineToken({
|
|
6
|
+
addresses: {
|
|
7
|
+
4217: '0x20c000000000000000000000aeed2ec36a54d0e5', // tempo
|
|
8
|
+
},
|
|
9
|
+
currency: 'wsrUSD',
|
|
10
|
+
decimals: 6,
|
|
11
|
+
name: 'Wrapped Savings rUSD',
|
|
12
|
+
symbol: 'wsrUSD',
|
|
13
|
+
})
|
package/tokens/index.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
2
|
+
export { defineToken, type Token, type Tokens } from './defineToken.js'
|
|
3
|
+
export { alphausd } from './definitions/alphausd.js'
|
|
4
|
+
export { betausd } from './definitions/betausd.js'
|
|
5
|
+
export { brla } from './definitions/brla.js'
|
|
6
|
+
export { cbbtc } from './definitions/cbbtc.js'
|
|
7
|
+
export { chfau } from './definitions/chfau.js'
|
|
8
|
+
export { cirbtc } from './definitions/cirbtc.js'
|
|
9
|
+
export { cusd } from './definitions/cusd.js'
|
|
10
|
+
export { dlusd } from './definitions/dlusd.js'
|
|
11
|
+
export { eurau } from './definitions/eurau.js'
|
|
12
|
+
export { eurc } from './definitions/eurc.js'
|
|
13
|
+
export { eurce } from './definitions/eurce.js'
|
|
14
|
+
export { frxusd } from './definitions/frxusd.js'
|
|
15
|
+
export { gbpa } from './definitions/gbpa.js'
|
|
16
|
+
export { gusd } from './definitions/gusd.js'
|
|
17
|
+
export { iusd } from './definitions/iusd.js'
|
|
18
|
+
export { pathusd } from './definitions/pathusd.js'
|
|
19
|
+
export { reusd } from './definitions/reusd.js'
|
|
20
|
+
export { rusd } from './definitions/rusd.js'
|
|
21
|
+
export { sbc } from './definitions/sbc.js'
|
|
22
|
+
export { siusd } from './definitions/siusd.js'
|
|
23
|
+
export { stcusd } from './definitions/stcusd.js'
|
|
24
|
+
export { susde } from './definitions/susde.js'
|
|
25
|
+
export { syrupusdc } from './definitions/syrupusdc.js'
|
|
26
|
+
export { thetausd } from './definitions/thetausd.js'
|
|
27
|
+
export { usd1 } from './definitions/usd1.js'
|
|
28
|
+
export { usdb } from './definitions/usdb.js'
|
|
29
|
+
export { usdc } from './definitions/usdc.js'
|
|
30
|
+
export { usdce } from './definitions/usdce.js'
|
|
31
|
+
export { usde } from './definitions/usde.js'
|
|
32
|
+
export { usdt0 } from './definitions/usdt0.js'
|
|
33
|
+
export { usyc } from './definitions/usyc.js'
|
|
34
|
+
export { wsrusd } from './definitions/wsrusd.js'
|
|
35
|
+
export { tokens } from './sets.js'
|
package/tokens/sets.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Generated with `pnpm gen:tokenlist`. Do not modify manually.
|
|
2
|
+
|
|
3
|
+
import type { Tokens } from './defineToken.js'
|
|
4
|
+
import { alphausd } from './definitions/alphausd.js'
|
|
5
|
+
import { betausd } from './definitions/betausd.js'
|
|
6
|
+
import { brla } from './definitions/brla.js'
|
|
7
|
+
import { cbbtc } from './definitions/cbbtc.js'
|
|
8
|
+
import { chfau } from './definitions/chfau.js'
|
|
9
|
+
import { cirbtc } from './definitions/cirbtc.js'
|
|
10
|
+
import { cusd } from './definitions/cusd.js'
|
|
11
|
+
import { dlusd } from './definitions/dlusd.js'
|
|
12
|
+
import { eurau } from './definitions/eurau.js'
|
|
13
|
+
import { eurc } from './definitions/eurc.js'
|
|
14
|
+
import { eurce } from './definitions/eurce.js'
|
|
15
|
+
import { frxusd } from './definitions/frxusd.js'
|
|
16
|
+
import { gbpa } from './definitions/gbpa.js'
|
|
17
|
+
import { gusd } from './definitions/gusd.js'
|
|
18
|
+
import { iusd } from './definitions/iusd.js'
|
|
19
|
+
import { pathusd } from './definitions/pathusd.js'
|
|
20
|
+
import { reusd } from './definitions/reusd.js'
|
|
21
|
+
import { rusd } from './definitions/rusd.js'
|
|
22
|
+
import { sbc } from './definitions/sbc.js'
|
|
23
|
+
import { siusd } from './definitions/siusd.js'
|
|
24
|
+
import { stcusd } from './definitions/stcusd.js'
|
|
25
|
+
import { susde } from './definitions/susde.js'
|
|
26
|
+
import { syrupusdc } from './definitions/syrupusdc.js'
|
|
27
|
+
import { thetausd } from './definitions/thetausd.js'
|
|
28
|
+
import { usd1 } from './definitions/usd1.js'
|
|
29
|
+
import { usdb } from './definitions/usdb.js'
|
|
30
|
+
import { usdc } from './definitions/usdc.js'
|
|
31
|
+
import { usdce } from './definitions/usdce.js'
|
|
32
|
+
import { usde } from './definitions/usde.js'
|
|
33
|
+
import { usdt0 } from './definitions/usdt0.js'
|
|
34
|
+
import { usyc } from './definitions/usyc.js'
|
|
35
|
+
import { wsrusd } from './definitions/wsrusd.js'
|
|
36
|
+
|
|
37
|
+
/** Every token definition. */
|
|
38
|
+
const all = [
|
|
39
|
+
alphausd,
|
|
40
|
+
betausd,
|
|
41
|
+
brla,
|
|
42
|
+
cbbtc,
|
|
43
|
+
chfau,
|
|
44
|
+
cirbtc,
|
|
45
|
+
cusd,
|
|
46
|
+
dlusd,
|
|
47
|
+
eurau,
|
|
48
|
+
eurc,
|
|
49
|
+
eurce,
|
|
50
|
+
frxusd,
|
|
51
|
+
gbpa,
|
|
52
|
+
gusd,
|
|
53
|
+
iusd,
|
|
54
|
+
pathusd,
|
|
55
|
+
reusd,
|
|
56
|
+
rusd,
|
|
57
|
+
sbc,
|
|
58
|
+
siusd,
|
|
59
|
+
stcusd,
|
|
60
|
+
susde,
|
|
61
|
+
syrupusdc,
|
|
62
|
+
thetausd,
|
|
63
|
+
usd1,
|
|
64
|
+
usdb,
|
|
65
|
+
usdc,
|
|
66
|
+
usdce,
|
|
67
|
+
usde,
|
|
68
|
+
usdt0,
|
|
69
|
+
usyc,
|
|
70
|
+
wsrusd,
|
|
71
|
+
] as const satisfies Tokens
|
|
72
|
+
|
|
73
|
+
/** Tokens flagged as popular. */
|
|
74
|
+
const popular = [usdc] as const satisfies Tokens
|
|
75
|
+
|
|
76
|
+
/** All tokens available on Tempo chains. */
|
|
77
|
+
const tempo = [
|
|
78
|
+
alphausd,
|
|
79
|
+
betausd,
|
|
80
|
+
brla,
|
|
81
|
+
cbbtc,
|
|
82
|
+
chfau,
|
|
83
|
+
cusd,
|
|
84
|
+
dlusd,
|
|
85
|
+
eurau,
|
|
86
|
+
eurce,
|
|
87
|
+
frxusd,
|
|
88
|
+
gbpa,
|
|
89
|
+
gusd,
|
|
90
|
+
iusd,
|
|
91
|
+
pathusd,
|
|
92
|
+
reusd,
|
|
93
|
+
rusd,
|
|
94
|
+
sbc,
|
|
95
|
+
siusd,
|
|
96
|
+
stcusd,
|
|
97
|
+
susde,
|
|
98
|
+
syrupusdc,
|
|
99
|
+
thetausd,
|
|
100
|
+
usd1,
|
|
101
|
+
usdb,
|
|
102
|
+
usdce,
|
|
103
|
+
usde,
|
|
104
|
+
usdt0,
|
|
105
|
+
wsrusd,
|
|
106
|
+
] as const satisfies Tokens
|
|
107
|
+
|
|
108
|
+
/** Curated token sets that can be passed to a Client's `tokens` property. */
|
|
109
|
+
export const tokens = { all, popular, tempo }
|
|
@@ -2,6 +2,8 @@ import { BaseError, type BaseErrorType } from '../../errors/base.js'
|
|
|
2
2
|
import {
|
|
3
3
|
InvalidHexValueError,
|
|
4
4
|
type InvalidHexValueErrorType,
|
|
5
|
+
RlpDepthLimitExceededError,
|
|
6
|
+
type RlpDepthLimitExceededErrorType,
|
|
5
7
|
} from '../../errors/encoding.js'
|
|
6
8
|
import type { ErrorType } from '../../errors/utils.js'
|
|
7
9
|
import type { ByteArray, Hex } from '../../types/misc.js'
|
|
@@ -17,6 +19,8 @@ import type { RecursiveArray } from './toRlp.js'
|
|
|
17
19
|
|
|
18
20
|
type To = 'hex' | 'bytes'
|
|
19
21
|
|
|
22
|
+
const rlpDepthLimit = 1_024
|
|
23
|
+
|
|
20
24
|
export type FromRlpReturnType<to extends To> =
|
|
21
25
|
| (to extends 'bytes' ? RecursiveArray<ByteArray> : never)
|
|
22
26
|
| (to extends 'hex' ? RecursiveArray<Hex> : never)
|
|
@@ -26,6 +30,7 @@ export type FromRlpErrorType =
|
|
|
26
30
|
| FromRlpCursorErrorType
|
|
27
31
|
| HexToBytesErrorType
|
|
28
32
|
| InvalidHexValueErrorType
|
|
33
|
+
| RlpDepthLimitExceededErrorType
|
|
29
34
|
| ErrorType
|
|
30
35
|
|
|
31
36
|
export function fromRlp<to extends To = 'hex'>(
|
|
@@ -58,7 +63,11 @@ type FromRlpCursorErrorType =
|
|
|
58
63
|
function fromRlpCursor<to extends To = 'hex'>(
|
|
59
64
|
cursor: Cursor,
|
|
60
65
|
to: to | To | undefined = 'hex',
|
|
66
|
+
recursiveDepth = 0,
|
|
61
67
|
): FromRlpReturnType<to> {
|
|
68
|
+
if (recursiveDepth >= rlpDepthLimit)
|
|
69
|
+
throw new RlpDepthLimitExceededError({ limit: rlpDepthLimit })
|
|
70
|
+
|
|
62
71
|
if (cursor.bytes.length === 0)
|
|
63
72
|
return (
|
|
64
73
|
to === 'hex' ? bytesToHex(cursor.bytes) : cursor.bytes
|
|
@@ -76,7 +85,12 @@ function fromRlpCursor<to extends To = 'hex'>(
|
|
|
76
85
|
|
|
77
86
|
// list
|
|
78
87
|
const length = readLength(cursor, prefix, 0xc0)
|
|
79
|
-
return readList(
|
|
88
|
+
return readList(
|
|
89
|
+
cursor,
|
|
90
|
+
length,
|
|
91
|
+
to,
|
|
92
|
+
recursiveDepth + 1,
|
|
93
|
+
) as {} as FromRlpReturnType<to>
|
|
80
94
|
}
|
|
81
95
|
|
|
82
96
|
type ReadLengthErrorType = BaseErrorType | ErrorType
|
|
@@ -93,10 +107,15 @@ function readLength(cursor: Cursor, prefix: number, offset: number) {
|
|
|
93
107
|
|
|
94
108
|
type ReadListErrorType = ErrorType
|
|
95
109
|
|
|
96
|
-
function readList<to extends To>(
|
|
110
|
+
function readList<to extends To>(
|
|
111
|
+
cursor: Cursor,
|
|
112
|
+
length: number,
|
|
113
|
+
to: to | To,
|
|
114
|
+
recursiveDepth: number,
|
|
115
|
+
) {
|
|
97
116
|
const position = cursor.position
|
|
98
117
|
const value: FromRlpReturnType<to>[] = []
|
|
99
118
|
while (cursor.position - position < length)
|
|
100
|
-
value.push(fromRlpCursor(cursor, to))
|
|
119
|
+
value.push(fromRlpCursor(cursor, to, recursiveDepth))
|
|
101
120
|
return value
|
|
102
121
|
}
|
package/utils/rpc/http.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HttpRequestError,
|
|
3
3
|
type HttpRequestErrorType as HttpRequestErrorType_,
|
|
4
|
+
ResponseBodyTooLargeError,
|
|
5
|
+
type ResponseBodyTooLargeErrorType,
|
|
4
6
|
TimeoutError,
|
|
5
7
|
type TimeoutErrorType,
|
|
6
8
|
} from '../../errors/request.js'
|
|
@@ -25,6 +27,8 @@ export type HttpRpcClientOptions = {
|
|
|
25
27
|
| undefined
|
|
26
28
|
/** Request configuration to pass to `fetch`. */
|
|
27
29
|
fetchOptions?: Omit<RequestInit, 'body'> | undefined
|
|
30
|
+
/** Maximum response body size in bytes. Set to `false` to disable. @default 10_485_760 */
|
|
31
|
+
maxResponseBodySize?: number | false | undefined
|
|
28
32
|
/** A callback to handle the request. */
|
|
29
33
|
onRequest?:
|
|
30
34
|
| ((
|
|
@@ -49,6 +53,8 @@ export type HttpRequestParameters<
|
|
|
49
53
|
fetchFn?: HttpRpcClientOptions['fetchFn'] | undefined
|
|
50
54
|
/** Request configuration to pass to `fetch`. */
|
|
51
55
|
fetchOptions?: HttpRpcClientOptions['fetchOptions'] | undefined
|
|
56
|
+
/** Maximum response body size in bytes. Set to `false` to disable. */
|
|
57
|
+
maxResponseBodySize?: HttpRpcClientOptions['maxResponseBodySize'] | undefined
|
|
52
58
|
/** A callback to handle the response. */
|
|
53
59
|
onRequest?:
|
|
54
60
|
| ((
|
|
@@ -70,10 +76,13 @@ export type HttpRequestReturnType<
|
|
|
70
76
|
|
|
71
77
|
export type HttpRequestErrorType =
|
|
72
78
|
| HttpRequestErrorType_
|
|
79
|
+
| ResponseBodyTooLargeErrorType
|
|
73
80
|
| TimeoutErrorType
|
|
74
81
|
| WithTimeoutErrorType
|
|
75
82
|
| ErrorType
|
|
76
83
|
|
|
84
|
+
const defaultMaxResponseBodySize = 10_485_760
|
|
85
|
+
|
|
77
86
|
export type HttpRpcClient = {
|
|
78
87
|
request<body extends RpcRequest | RpcRequest[]>(
|
|
79
88
|
params: HttpRequestParameters<body>,
|
|
@@ -91,6 +100,8 @@ export function getHttpRpcClient(
|
|
|
91
100
|
const {
|
|
92
101
|
body,
|
|
93
102
|
fetchFn = options.fetchFn ?? fetch,
|
|
103
|
+
maxResponseBodySize = options.maxResponseBodySize ??
|
|
104
|
+
defaultMaxResponseBodySize,
|
|
94
105
|
onRequest = options.onRequest,
|
|
95
106
|
onResponse = options.onResponse,
|
|
96
107
|
timeout = options.timeout ?? 10_000,
|
|
@@ -144,12 +155,15 @@ export function getHttpRpcClient(
|
|
|
144
155
|
if (onResponse) await onResponse(response)
|
|
145
156
|
|
|
146
157
|
let data: any
|
|
158
|
+
const responseBody = await readResponseBody(response, {
|
|
159
|
+
maxResponseBodySize,
|
|
160
|
+
})
|
|
147
161
|
if (
|
|
148
162
|
response.headers.get('Content-Type')?.startsWith('application/json')
|
|
149
163
|
)
|
|
150
|
-
data =
|
|
164
|
+
data = JSON.parse(responseBody)
|
|
151
165
|
else {
|
|
152
|
-
data =
|
|
166
|
+
data = responseBody
|
|
153
167
|
try {
|
|
154
168
|
data = JSON.parse(data || '{}')
|
|
155
169
|
} catch (err) {
|
|
@@ -181,6 +195,7 @@ export function getHttpRpcClient(
|
|
|
181
195
|
if (signal_?.aborted) throw getAbortError(signal_)
|
|
182
196
|
if (isAbortError(err)) throw err
|
|
183
197
|
if (err instanceof HttpRequestError) throw err
|
|
198
|
+
if (err instanceof ResponseBodyTooLargeError) throw err
|
|
184
199
|
if (err instanceof TimeoutError) throw err
|
|
185
200
|
throw new HttpRequestError({
|
|
186
201
|
body,
|
|
@@ -192,6 +207,59 @@ export function getHttpRpcClient(
|
|
|
192
207
|
}
|
|
193
208
|
}
|
|
194
209
|
|
|
210
|
+
async function readResponseBody(
|
|
211
|
+
response: Response,
|
|
212
|
+
{ maxResponseBodySize }: { maxResponseBodySize: number | false },
|
|
213
|
+
): Promise<string> {
|
|
214
|
+
if (maxResponseBodySize === false) return response.text()
|
|
215
|
+
|
|
216
|
+
const contentLength = response.headers.get('Content-Length')
|
|
217
|
+
if (contentLength) {
|
|
218
|
+
const size = Number(contentLength)
|
|
219
|
+
if (size > maxResponseBodySize)
|
|
220
|
+
throw new ResponseBodyTooLargeError({
|
|
221
|
+
maxSize: maxResponseBodySize,
|
|
222
|
+
size,
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (!response.body) {
|
|
227
|
+
const body = await response.text()
|
|
228
|
+
const size = new TextEncoder().encode(body).length
|
|
229
|
+
if (size > maxResponseBodySize)
|
|
230
|
+
throw new ResponseBodyTooLargeError({
|
|
231
|
+
maxSize: maxResponseBodySize,
|
|
232
|
+
size,
|
|
233
|
+
})
|
|
234
|
+
return body
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const reader = response.body.getReader()
|
|
238
|
+
const decoder = new TextDecoder()
|
|
239
|
+
let body = ''
|
|
240
|
+
let size = 0
|
|
241
|
+
|
|
242
|
+
try {
|
|
243
|
+
while (true) {
|
|
244
|
+
const { done, value } = await reader.read()
|
|
245
|
+
if (done) break
|
|
246
|
+
size += value.byteLength
|
|
247
|
+
if (size > maxResponseBodySize) {
|
|
248
|
+
await reader.cancel()
|
|
249
|
+
throw new ResponseBodyTooLargeError({
|
|
250
|
+
maxSize: maxResponseBodySize,
|
|
251
|
+
size,
|
|
252
|
+
})
|
|
253
|
+
}
|
|
254
|
+
body += decoder.decode(value, { stream: true })
|
|
255
|
+
}
|
|
256
|
+
body += decoder.decode()
|
|
257
|
+
return body
|
|
258
|
+
} finally {
|
|
259
|
+
reader.releaseLock()
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
195
263
|
/** @internal */
|
|
196
264
|
export function parseUrl(url_: string) {
|
|
197
265
|
try {
|