viem 2.17.11 → 2.18.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +20 -2
- package/_cjs/account-abstraction/accounts/createWebAuthnCredential.js +6 -0
- package/_cjs/account-abstraction/accounts/createWebAuthnCredential.js.map +1 -0
- package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +688 -0
- package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -0
- package/_cjs/account-abstraction/accounts/implementations/toSoladySmartAccount.js +704 -0
- package/_cjs/account-abstraction/accounts/implementations/toSoladySmartAccount.js.map +1 -0
- package/_cjs/account-abstraction/accounts/toSmartAccount.js +93 -0
- package/_cjs/account-abstraction/accounts/toSmartAccount.js.map +1 -0
- package/_cjs/account-abstraction/accounts/toWebAuthnAccount.js +24 -0
- package/_cjs/account-abstraction/accounts/toWebAuthnAccount.js.map +1 -0
- package/_cjs/account-abstraction/accounts/types.js +3 -0
- package/_cjs/account-abstraction/accounts/types.js.map +1 -0
- package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js +37 -0
- package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/_cjs/account-abstraction/actions/bundler/getSupportedEntryPoints.js +7 -0
- package/_cjs/account-abstraction/actions/bundler/getSupportedEntryPoints.js.map +1 -0
- package/_cjs/account-abstraction/actions/bundler/getUserOperation.js +22 -0
- package/_cjs/account-abstraction/actions/bundler/getUserOperation.js.map +1 -0
- package/_cjs/account-abstraction/actions/bundler/getUserOperationReceipt.js +15 -0
- package/_cjs/account-abstraction/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js +239 -0
- package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -0
- package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js +36 -0
- package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -0
- package/_cjs/account-abstraction/actions/bundler/waitForUserOperationReceipt.js +48 -0
- package/_cjs/account-abstraction/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterData.js +34 -0
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -0
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterStubData.js +34 -0
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterStubData.js.map +1 -0
- package/_cjs/account-abstraction/clients/createBundlerClient.js +18 -0
- package/_cjs/account-abstraction/clients/createBundlerClient.js.map +1 -0
- package/_cjs/account-abstraction/clients/createPaymasterClient.js +17 -0
- package/_cjs/account-abstraction/clients/createPaymasterClient.js.map +1 -0
- package/_cjs/account-abstraction/clients/decorators/bundler.js +24 -0
- package/_cjs/account-abstraction/clients/decorators/bundler.js.map +1 -0
- package/_cjs/account-abstraction/clients/decorators/paymaster.js +12 -0
- package/_cjs/account-abstraction/clients/decorators/paymaster.js.map +1 -0
- package/_cjs/account-abstraction/constants/abis.js +1318 -0
- package/_cjs/account-abstraction/constants/abis.js.map +1 -0
- package/_cjs/account-abstraction/constants/address.js +6 -0
- package/_cjs/account-abstraction/constants/address.js.map +1 -0
- package/_cjs/account-abstraction/errors/bundler.js +813 -0
- package/_cjs/account-abstraction/errors/bundler.js.map +1 -0
- package/_cjs/account-abstraction/errors/userOperation.js +91 -0
- package/_cjs/account-abstraction/errors/userOperation.js.map +1 -0
- package/_cjs/account-abstraction/index.js +90 -0
- package/_cjs/account-abstraction/index.js.map +1 -0
- package/_cjs/account-abstraction/types/account.js +3 -0
- package/_cjs/account-abstraction/types/account.js.map +1 -0
- package/_cjs/account-abstraction/types/entryPointVersion.js +3 -0
- package/_cjs/account-abstraction/types/entryPointVersion.js.map +1 -0
- package/_cjs/account-abstraction/types/rpc.js +3 -0
- package/_cjs/account-abstraction/types/rpc.js.map +1 -0
- package/_cjs/account-abstraction/types/userOperation.js +3 -0
- package/_cjs/account-abstraction/types/userOperation.js.map +1 -0
- package/_cjs/account-abstraction/utils/errors/getBundlerError.js +186 -0
- package/_cjs/account-abstraction/utils/errors/getBundlerError.js.map +1 -0
- package/_cjs/account-abstraction/utils/errors/getUserOperationError.js +87 -0
- package/_cjs/account-abstraction/utils/errors/getUserOperationError.js.map +1 -0
- package/_cjs/account-abstraction/utils/formatters/userOperation.js +24 -0
- package/_cjs/account-abstraction/utils/formatters/userOperation.js.map +1 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationGas.js +18 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationGas.js.map +1 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationReceipt.js +18 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationReceipt.js.map +1 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js +43 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -0
- package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js +88 -0
- package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -0
- package/_cjs/account-abstraction/utils/userOperation/toPackedUserOperation.js +44 -0
- package/_cjs/account-abstraction/utils/userOperation/toPackedUserOperation.js.map +1 -0
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/privateKeyToAccount.js +4 -0
- package/_cjs/accounts/privateKeyToAccount.js.map +1 -1
- package/_cjs/accounts/toAccount.js +1 -0
- package/_cjs/accounts/toAccount.js.map +1 -1
- package/_cjs/accounts/utils/parseAccount.js.map +1 -1
- package/_cjs/accounts/utils/sign.js +8 -2
- package/_cjs/accounts/utils/sign.js.map +1 -1
- package/_cjs/accounts/utils/signMessage.js +1 -3
- package/_cjs/accounts/utils/signMessage.js.map +1 -1
- package/_cjs/accounts/utils/signTypedData.js +2 -3
- package/_cjs/accounts/utils/signTypedData.js.map +1 -1
- package/_cjs/actions/public/getLogs.js +2 -1
- package/_cjs/actions/public/getLogs.js.map +1 -1
- package/_cjs/actions/wallet/sendTransaction.js +35 -22
- package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/_cjs/actions/wallet/signMessage.js +1 -1
- package/_cjs/actions/wallet/signMessage.js.map +1 -1
- package/_cjs/actions/wallet/signTransaction.js +1 -2
- package/_cjs/actions/wallet/signTransaction.js.map +1 -1
- package/_cjs/actions/wallet/signTypedData.js +1 -1
- package/_cjs/actions/wallet/signTypedData.js.map +1 -1
- package/_cjs/chains/definitions/bobaSepolia.js +1 -0
- package/_cjs/chains/definitions/bobaSepolia.js.map +1 -1
- package/_cjs/chains/definitions/cronoszkEVMTestnet.js +24 -0
- package/_cjs/chains/definitions/cronoszkEVMTestnet.js.map +1 -0
- package/_cjs/chains/index.js +8 -6
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/constants/abis.js +0 -3
- package/_cjs/constants/abis.js.map +1 -1
- package/_cjs/constants/address.js +3 -1
- package/_cjs/constants/address.js.map +1 -1
- package/_cjs/errors/account.js +17 -2
- package/_cjs/errors/account.js.map +1 -1
- package/_cjs/errors/contract.js +1 -1
- package/_cjs/errors/contract.js.map +1 -1
- package/_cjs/errors/rpc.js +6 -6
- package/_cjs/errors/rpc.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/index.js +5 -3
- package/_cjs/index.js.map +1 -1
- package/_cjs/types/eip1193.js.map +1 -1
- package/_cjs/utils/abi/parseEventLogs.js +70 -2
- package/_cjs/utils/abi/parseEventLogs.js.map +1 -1
- package/_cjs/utils/buildRequest.js +4 -2
- package/_cjs/utils/buildRequest.js.map +1 -1
- package/_cjs/utils/errors/getNodeError.js +1 -2
- package/_cjs/utils/errors/getNodeError.js.map +1 -1
- package/_cjs/utils/index.js +3 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/signature/serializeErc6492Signature.js +6 -2
- package/_cjs/utils/signature/serializeErc6492Signature.js.map +1 -1
- package/_cjs/utils/signature/serializeSignature.js +6 -2
- package/_cjs/utils/signature/serializeSignature.js.map +1 -1
- package/_cjs/utils/signature/verifyHash.js +10 -0
- package/_cjs/utils/signature/verifyHash.js.map +1 -0
- package/_esm/account-abstraction/accounts/createWebAuthnCredential.js +3 -0
- package/_esm/account-abstraction/accounts/createWebAuthnCredential.js.map +1 -0
- package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +709 -0
- package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -0
- package/_esm/account-abstraction/accounts/implementations/toSoladySmartAccount.js +718 -0
- package/_esm/account-abstraction/accounts/implementations/toSoladySmartAccount.js.map +1 -0
- package/_esm/account-abstraction/accounts/toSmartAccount.js +96 -0
- package/_esm/account-abstraction/accounts/toSmartAccount.js.map +1 -0
- package/_esm/account-abstraction/accounts/toWebAuthnAccount.js +26 -0
- package/_esm/account-abstraction/accounts/toWebAuthnAccount.js.map +1 -0
- package/_esm/account-abstraction/accounts/types.js +2 -0
- package/_esm/account-abstraction/accounts/types.js.map +1 -0
- package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js +61 -0
- package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/_esm/account-abstraction/actions/bundler/getSupportedEntryPoints.js +25 -0
- package/_esm/account-abstraction/actions/bundler/getSupportedEntryPoints.js.map +1 -0
- package/_esm/account-abstraction/actions/bundler/getUserOperation.js +42 -0
- package/_esm/account-abstraction/actions/bundler/getUserOperation.js.map +1 -0
- package/_esm/account-abstraction/actions/bundler/getUserOperationReceipt.js +35 -0
- package/_esm/account-abstraction/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js +323 -0
- package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -0
- package/_esm/account-abstraction/actions/bundler/sendUserOperation.js +60 -0
- package/_esm/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -0
- package/_esm/account-abstraction/actions/bundler/waitForUserOperationReceipt.js +68 -0
- package/_esm/account-abstraction/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/_esm/account-abstraction/actions/paymaster/getPaymasterData.js +56 -0
- package/_esm/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -0
- package/_esm/account-abstraction/actions/paymaster/getPaymasterStubData.js +56 -0
- package/_esm/account-abstraction/actions/paymaster/getPaymasterStubData.js.map +1 -0
- package/_esm/account-abstraction/clients/createBundlerClient.js +15 -0
- package/_esm/account-abstraction/clients/createBundlerClient.js.map +1 -0
- package/_esm/account-abstraction/clients/createPaymasterClient.js +14 -0
- package/_esm/account-abstraction/clients/createPaymasterClient.js.map +1 -0
- package/_esm/account-abstraction/clients/decorators/bundler.js +21 -0
- package/_esm/account-abstraction/clients/decorators/bundler.js.map +1 -0
- package/_esm/account-abstraction/clients/decorators/paymaster.js +9 -0
- package/_esm/account-abstraction/clients/decorators/paymaster.js.map +1 -0
- package/_esm/account-abstraction/constants/abis.js +1315 -0
- package/_esm/account-abstraction/constants/abis.js.map +1 -0
- package/_esm/account-abstraction/constants/address.js +3 -0
- package/_esm/account-abstraction/constants/address.js.map +1 -0
- package/_esm/account-abstraction/errors/bundler.js +774 -0
- package/_esm/account-abstraction/errors/bundler.js.map +1 -0
- package/_esm/account-abstraction/errors/userOperation.js +84 -0
- package/_esm/account-abstraction/errors/userOperation.js.map +1 -0
- package/_esm/account-abstraction/index.js +31 -0
- package/_esm/account-abstraction/index.js.map +1 -0
- package/_esm/account-abstraction/types/account.js +2 -0
- package/_esm/account-abstraction/types/account.js.map +1 -0
- package/_esm/account-abstraction/types/entryPointVersion.js +2 -0
- package/_esm/account-abstraction/types/entryPointVersion.js.map +1 -0
- package/_esm/account-abstraction/types/rpc.js +2 -0
- package/_esm/account-abstraction/types/rpc.js.map +1 -0
- package/_esm/account-abstraction/types/userOperation.js +2 -0
- package/_esm/account-abstraction/types/userOperation.js.map +1 -0
- package/_esm/account-abstraction/utils/errors/getBundlerError.js +183 -0
- package/_esm/account-abstraction/utils/errors/getBundlerError.js.map +1 -0
- package/_esm/account-abstraction/utils/errors/getUserOperationError.js +85 -0
- package/_esm/account-abstraction/utils/errors/getUserOperationError.js.map +1 -0
- package/_esm/account-abstraction/utils/formatters/userOperation.js +21 -0
- package/_esm/account-abstraction/utils/formatters/userOperation.js.map +1 -0
- package/_esm/account-abstraction/utils/formatters/userOperationGas.js +15 -0
- package/_esm/account-abstraction/utils/formatters/userOperationGas.js.map +1 -0
- package/_esm/account-abstraction/utils/formatters/userOperationReceipt.js +15 -0
- package/_esm/account-abstraction/utils/formatters/userOperationReceipt.js.map +1 -0
- package/_esm/account-abstraction/utils/formatters/userOperationRequest.js +40 -0
- package/_esm/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -0
- package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js +85 -0
- package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -0
- package/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js +41 -0
- package/_esm/account-abstraction/utils/userOperation/toPackedUserOperation.js.map +1 -0
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/privateKeyToAccount.js +4 -0
- package/_esm/accounts/privateKeyToAccount.js.map +1 -1
- package/_esm/accounts/toAccount.js +2 -0
- package/_esm/accounts/toAccount.js.map +1 -1
- package/_esm/accounts/utils/parseAccount.js.map +1 -1
- package/_esm/accounts/utils/sign.js +9 -3
- package/_esm/accounts/utils/sign.js.map +1 -1
- package/_esm/accounts/utils/signMessage.js +1 -3
- package/_esm/accounts/utils/signMessage.js.map +1 -1
- package/_esm/accounts/utils/signTypedData.js +2 -3
- package/_esm/accounts/utils/signTypedData.js.map +1 -1
- package/_esm/actions/public/getLogs.js +2 -1
- package/_esm/actions/public/getLogs.js.map +1 -1
- package/_esm/actions/wallet/sendTransaction.js +37 -24
- package/_esm/actions/wallet/sendTransaction.js.map +1 -1
- package/_esm/actions/wallet/signMessage.js +1 -1
- package/_esm/actions/wallet/signMessage.js.map +1 -1
- package/_esm/actions/wallet/signTransaction.js +1 -2
- package/_esm/actions/wallet/signTransaction.js.map +1 -1
- package/_esm/actions/wallet/signTypedData.js +1 -1
- package/_esm/actions/wallet/signTypedData.js.map +1 -1
- package/_esm/chains/definitions/bobaSepolia.js +1 -0
- package/_esm/chains/definitions/bobaSepolia.js.map +1 -1
- package/_esm/chains/definitions/cronoszkEVMTestnet.js +21 -0
- package/_esm/chains/definitions/cronoszkEVMTestnet.js.map +1 -0
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/constants/abis.js +0 -3
- package/_esm/constants/abis.js.map +1 -1
- package/_esm/constants/address.js +2 -0
- package/_esm/constants/address.js.map +1 -1
- package/_esm/errors/account.js +15 -1
- package/_esm/errors/account.js.map +1 -1
- package/_esm/errors/contract.js +1 -1
- package/_esm/errors/contract.js.map +1 -1
- package/_esm/errors/rpc.js +6 -6
- package/_esm/errors/rpc.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/index.js +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/types/eip1193.js.map +1 -1
- package/_esm/utils/abi/parseEventLogs.js +72 -2
- package/_esm/utils/abi/parseEventLogs.js.map +1 -1
- package/_esm/utils/buildRequest.js +4 -2
- package/_esm/utils/buildRequest.js.map +1 -1
- package/_esm/utils/errors/getNodeError.js +1 -2
- package/_esm/utils/errors/getNodeError.js.map +1 -1
- package/_esm/utils/index.js +1 -0
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/signature/serializeErc6492Signature.js +6 -2
- package/_esm/utils/signature/serializeErc6492Signature.js.map +1 -1
- package/_esm/utils/signature/serializeSignature.js +6 -2
- package/_esm/utils/signature/serializeSignature.js.map +1 -1
- package/_esm/utils/signature/verifyHash.js +19 -0
- package/_esm/utils/signature/verifyHash.js.map +1 -0
- package/_types/account-abstraction/accounts/createWebAuthnCredential.d.ts +2 -0
- package/_types/account-abstraction/accounts/createWebAuthnCredential.d.ts.map +1 -0
- package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts +648 -0
- package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts.map +1 -0
- package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts +464 -0
- package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts.map +1 -0
- package/_types/account-abstraction/accounts/toSmartAccount.d.ts +14 -0
- package/_types/account-abstraction/accounts/toSmartAccount.d.ts.map +1 -0
- package/_types/account-abstraction/accounts/toWebAuthnAccount.d.ts +32 -0
- package/_types/account-abstraction/accounts/toWebAuthnAccount.d.ts.map +1 -0
- package/_types/account-abstraction/accounts/types.d.ts +174 -0
- package/_types/account-abstraction/accounts/types.d.ts.map +1 -0
- package/_types/account-abstraction/actions/bundler/estimateUserOperationGas.d.ts +62 -0
- package/_types/account-abstraction/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
- package/_types/account-abstraction/actions/bundler/getSupportedEntryPoints.d.ts +30 -0
- package/_types/account-abstraction/actions/bundler/getSupportedEntryPoints.d.ts.map +1 -0
- package/_types/account-abstraction/actions/bundler/getUserOperation.d.ts +57 -0
- package/_types/account-abstraction/actions/bundler/getUserOperation.d.ts.map +1 -0
- package/_types/account-abstraction/actions/bundler/getUserOperationReceipt.d.ts +39 -0
- package/_types/account-abstraction/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
- package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts +106 -0
- package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts.map +1 -0
- package/_types/account-abstraction/actions/bundler/sendUserOperation.d.ts +60 -0
- package/_types/account-abstraction/actions/bundler/sendUserOperation.d.ts.map +1 -0
- package/_types/account-abstraction/actions/bundler/waitForUserOperationReceipt.d.ts +52 -0
- package/_types/account-abstraction/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
- package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts +49 -0
- package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts.map +1 -0
- package/_types/account-abstraction/actions/paymaster/getPaymasterStubData.d.ts +55 -0
- package/_types/account-abstraction/actions/paymaster/getPaymasterStubData.d.ts.map +1 -0
- package/_types/account-abstraction/clients/createBundlerClient.d.ts +66 -0
- package/_types/account-abstraction/clients/createBundlerClient.d.ts.map +1 -0
- package/_types/account-abstraction/clients/createPaymasterClient.d.ts +27 -0
- package/_types/account-abstraction/clients/createPaymasterClient.d.ts.map +1 -0
- package/_types/account-abstraction/clients/decorators/bundler.d.ts +206 -0
- package/_types/account-abstraction/clients/decorators/bundler.d.ts.map +1 -0
- package/_types/account-abstraction/clients/decorators/paymaster.d.ts +60 -0
- package/_types/account-abstraction/clients/decorators/paymaster.d.ts.map +1 -0
- package/_types/account-abstraction/constants/abis.d.ts +1468 -0
- package/_types/account-abstraction/constants/abis.d.ts.map +1 -0
- package/_types/account-abstraction/constants/address.d.ts +3 -0
- package/_types/account-abstraction/constants/address.d.ts.map +1 -0
- package/_types/account-abstraction/errors/bundler.d.ts +391 -0
- package/_types/account-abstraction/errors/bundler.d.ts.map +1 -0
- package/_types/account-abstraction/errors/userOperation.d.ts +41 -0
- package/_types/account-abstraction/errors/userOperation.d.ts.map +1 -0
- package/_types/account-abstraction/index.d.ts +34 -0
- package/_types/account-abstraction/index.d.ts.map +1 -0
- package/_types/account-abstraction/types/account.d.ts +11 -0
- package/_types/account-abstraction/types/account.d.ts.map +1 -0
- package/_types/account-abstraction/types/entryPointVersion.d.ts +9 -0
- package/_types/account-abstraction/types/entryPointVersion.d.ts.map +1 -0
- package/_types/account-abstraction/types/rpc.d.ts +9 -0
- package/_types/account-abstraction/types/rpc.d.ts.map +1 -0
- package/_types/account-abstraction/types/userOperation.d.ts +157 -0
- package/_types/account-abstraction/types/userOperation.d.ts.map +1 -0
- package/_types/account-abstraction/utils/errors/getBundlerError.d.ts +8 -0
- package/_types/account-abstraction/utils/errors/getBundlerError.d.ts.map +1 -0
- package/_types/account-abstraction/utils/errors/getUserOperationError.d.ts +15 -0
- package/_types/account-abstraction/utils/errors/getUserOperationError.d.ts.map +1 -0
- package/_types/account-abstraction/utils/formatters/userOperation.d.ts +6 -0
- package/_types/account-abstraction/utils/formatters/userOperation.d.ts.map +1 -0
- package/_types/account-abstraction/utils/formatters/userOperationGas.d.ts +6 -0
- package/_types/account-abstraction/utils/formatters/userOperationGas.d.ts.map +1 -0
- package/_types/account-abstraction/utils/formatters/userOperationReceipt.d.ts +6 -0
- package/_types/account-abstraction/utils/formatters/userOperationReceipt.d.ts.map +1 -0
- package/_types/account-abstraction/utils/formatters/userOperationRequest.d.ts +7 -0
- package/_types/account-abstraction/utils/formatters/userOperationRequest.d.ts.map +1 -0
- package/_types/account-abstraction/utils/userOperation/getUserOperationHash.d.ts +13 -0
- package/_types/account-abstraction/utils/userOperation/getUserOperationHash.d.ts.map +1 -0
- package/_types/account-abstraction/utils/userOperation/toPackedUserOperation.d.ts +3 -0
- package/_types/account-abstraction/utils/userOperation/toPackedUserOperation.d.ts.map +1 -0
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/privateKeyToAccount.d.ts +2 -1
- package/_types/accounts/privateKeyToAccount.d.ts.map +1 -1
- package/_types/accounts/toAccount.d.ts.map +1 -1
- package/_types/accounts/types.d.ts +14 -7
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/accounts/utils/parseAccount.d.ts +1 -1
- package/_types/accounts/utils/parseAccount.d.ts.map +1 -1
- package/_types/accounts/utils/sign.d.ts +9 -6
- package/_types/accounts/utils/sign.d.ts.map +1 -1
- package/_types/accounts/utils/signMessage.d.ts +1 -2
- package/_types/accounts/utils/signMessage.d.ts.map +1 -1
- package/_types/accounts/utils/signTypedData.d.ts +1 -2
- package/_types/accounts/utils/signTypedData.d.ts.map +1 -1
- package/_types/actions/public/getLogs.d.ts.map +1 -1
- package/_types/actions/wallet/sendTransaction.d.ts +2 -1
- package/_types/actions/wallet/sendTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/signMessage.d.ts.map +1 -1
- package/_types/actions/wallet/signTransaction.d.ts.map +1 -1
- package/_types/chains/definitions/bobaSepolia.d.ts +1 -1
- package/_types/chains/definitions/bobaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/cronoszkEVMTestnet.d.ts +35 -0
- package/_types/chains/definitions/cronoszkEVMTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/lisk.d.ts +2 -2
- package/_types/chains/definitions/playfiAlbireo.d.ts +2 -2
- package/_types/chains/definitions/zkSync.d.ts +2 -2
- package/_types/chains/definitions/zkSyncInMemoryNode.d.ts +2 -2
- package/_types/chains/definitions/zkSyncLocalNode.d.ts +2 -2
- package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts +2 -2
- package/_types/chains/definitions/zkSyncTestnet.d.ts +2 -2
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +1 -1
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/constants/abis.d.ts +0 -3
- package/_types/constants/abis.d.ts.map +1 -1
- package/_types/constants/address.d.ts +2 -0
- package/_types/constants/address.d.ts.map +1 -1
- package/_types/errors/account.d.ts +11 -0
- package/_types/errors/account.d.ts.map +1 -1
- package/_types/errors/rpc.d.ts +9 -3
- package/_types/errors/rpc.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/index.d.ts +5 -3
- package/_types/index.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +239 -2
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/types/multicall.d.ts +1 -1
- package/_types/types/multicall.d.ts.map +1 -1
- package/_types/utils/abi/parseEventLogs.d.ts +9 -3
- package/_types/utils/abi/parseEventLogs.d.ts.map +1 -1
- package/_types/utils/buildRequest.d.ts.map +1 -1
- package/_types/utils/errors/getNodeError.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +1 -1
- package/_types/utils/index.d.ts +1 -0
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/signature/hashTypedData.d.ts +2 -2
- package/_types/utils/signature/hashTypedData.d.ts.map +1 -1
- package/_types/utils/signature/serializeErc6492Signature.d.ts +7 -4
- package/_types/utils/signature/serializeErc6492Signature.d.ts.map +1 -1
- package/_types/utils/signature/serializeSignature.d.ts +8 -2
- package/_types/utils/signature/serializeSignature.d.ts.map +1 -1
- package/_types/utils/signature/verifyHash.d.ts +30 -0
- package/_types/utils/signature/verifyHash.d.ts.map +1 -0
- package/_types/zksync/chainConfig.d.ts +2 -2
- package/_types/zksync/formatters.d.ts +2 -2
- package/account-abstraction/accounts/createWebAuthnCredential.ts +7 -0
- package/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.ts +817 -0
- package/account-abstraction/accounts/implementations/toSoladySmartAccount.ts +794 -0
- package/account-abstraction/accounts/toSmartAccount.ts +126 -0
- package/account-abstraction/accounts/toWebAuthnAccount.ts +56 -0
- package/account-abstraction/accounts/types.ts +208 -0
- package/account-abstraction/actions/bundler/estimateUserOperationGas.ts +170 -0
- package/account-abstraction/actions/bundler/getSupportedEntryPoints.ts +33 -0
- package/account-abstraction/actions/bundler/getUserOperation.ts +85 -0
- package/account-abstraction/actions/bundler/getUserOperationReceipt.ts +64 -0
- package/account-abstraction/actions/bundler/prepareUserOperation.ts +637 -0
- package/account-abstraction/actions/bundler/sendUserOperation.ts +149 -0
- package/account-abstraction/actions/bundler/waitForUserOperationReceipt.ts +139 -0
- package/account-abstraction/actions/paymaster/getPaymasterData.ts +135 -0
- package/account-abstraction/actions/paymaster/getPaymasterStubData.ts +138 -0
- package/account-abstraction/clients/createBundlerClient.ts +155 -0
- package/account-abstraction/clients/createPaymasterClient.ts +78 -0
- package/account-abstraction/clients/decorators/bundler.ts +296 -0
- package/account-abstraction/clients/decorators/paymaster.ts +81 -0
- package/account-abstraction/constants/abis.ts +1404 -0
- package/account-abstraction/constants/address.ts +4 -0
- package/account-abstraction/errors/bundler.ts +781 -0
- package/account-abstraction/errors/userOperation.ts +111 -0
- package/account-abstraction/index.ts +228 -0
- package/account-abstraction/package.json +6 -0
- package/account-abstraction/types/account.ts +21 -0
- package/account-abstraction/types/entryPointVersion.ts +24 -0
- package/account-abstraction/types/rpc.ts +29 -0
- package/account-abstraction/types/userOperation.ts +262 -0
- package/account-abstraction/utils/errors/getBundlerError.ts +309 -0
- package/account-abstraction/utils/errors/getUserOperationError.ts +153 -0
- package/account-abstraction/utils/formatters/userOperation.ts +31 -0
- package/account-abstraction/utils/formatters/userOperationGas.ts +26 -0
- package/account-abstraction/utils/formatters/userOperationReceipt.ts +24 -0
- package/account-abstraction/utils/formatters/userOperationRequest.ts +53 -0
- package/account-abstraction/utils/userOperation/getUserOperationHash.ts +138 -0
- package/account-abstraction/utils/userOperation/toPackedUserOperation.ts +64 -0
- package/accounts/index.ts +1 -0
- package/accounts/privateKeyToAccount.ts +5 -0
- package/accounts/toAccount.ts +3 -0
- package/accounts/types.ts +34 -12
- package/accounts/utils/parseAccount.ts +6 -3
- package/accounts/utils/sign.ts +24 -8
- package/accounts/utils/signMessage.ts +1 -7
- package/accounts/utils/signTypedData.ts +2 -7
- package/actions/public/getLogs.ts +2 -1
- package/actions/wallet/sendTransaction.ts +48 -27
- package/actions/wallet/signMessage.ts +2 -1
- package/actions/wallet/signTransaction.ts +1 -2
- package/actions/wallet/signTypedData.ts +1 -1
- package/chains/definitions/bobaSepolia.ts +1 -0
- package/chains/definitions/cronoszkEVMTestnet.ts +21 -0
- package/chains/index.ts +1 -0
- package/clients/decorators/public.ts +1 -1
- package/constants/abis.ts +0 -3
- package/constants/address.ts +4 -0
- package/errors/account.ts +22 -1
- package/errors/contract.ts +1 -1
- package/errors/rpc.ts +6 -6
- package/errors/version.ts +1 -1
- package/index.ts +20 -3
- package/package.json +7 -1
- package/types/eip1193.ts +314 -2
- package/types/multicall.ts +1 -1
- package/utils/abi/parseEventLogs.ts +103 -14
- package/utils/buildRequest.ts +4 -2
- package/utils/errors/getNodeError.ts +1 -2
- package/utils/index.ts +6 -0
- package/utils/signature/hashTypedData.ts +6 -6
- package/utils/signature/serializeErc6492Signature.ts +17 -8
- package/utils/signature/serializeSignature.ts +24 -4
- package/utils/signature/verifyHash.ts +54 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"waitForUserOperationReceipt.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/bundler/waitForUserOperationReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAEvD,OAAO,EAAE,KAAK,gBAAgB,EAAW,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,KAAK,aAAa,EAAQ,MAAM,wBAAwB,CAAA;AAEjE,OAAO,EAEL,KAAK,2CAA2C,EACjD,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAMxE,MAAM,MAAM,qCAAqC,GAAG;IAClD,sCAAsC;IACtC,IAAI,EAAE,IAAI,CAAA;IACV;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,qCAAqC,GAC/C,QAAQ,CAAC,oBAAoB,CAAC,CAAA;AAEhC,MAAM,MAAM,oCAAoC,GAC5C,2CAA2C,GAC3C,aAAa,GACb,gBAAgB,GAChB,SAAS,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,EACzB,UAAU,EAAE,qCAAqC,GAChD,OAAO,CAAC,qCAAqC,CAAC,CAmEhD"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import type { Address } from 'abitype';
|
2
|
+
import type { Client } from '../../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../../clients/transports/createTransport.js';
|
4
|
+
import type { ErrorType } from '../../../errors/utils.js';
|
5
|
+
import type { Hex } from '../../../types/misc.js';
|
6
|
+
import type { OneOf, PartialBy, Prettify } from '../../../types/utils.js';
|
7
|
+
import type { UserOperation } from '../../types/userOperation.js';
|
8
|
+
import { type FormatUserOperationRequestErrorType } from '../../utils/formatters/userOperationRequest.js';
|
9
|
+
export type GetPaymasterDataParameters = OneOf<PartialBy<Pick<UserOperation<'0.6'>, 'callData' | 'callGasLimit' | 'initCode' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'sender' | 'preVerificationGas' | 'verificationGasLimit'>, 'callGasLimit' | 'initCode' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'preVerificationGas' | 'verificationGasLimit'> | PartialBy<Pick<UserOperation<'0.7'>, 'callData' | 'callGasLimit' | 'factory' | 'factoryData' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'sender' | 'preVerificationGas' | 'verificationGasLimit'>, 'callGasLimit' | 'factory' | 'factoryData' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'preVerificationGas' | 'verificationGasLimit'>> & {
|
10
|
+
context?: unknown | undefined;
|
11
|
+
chainId: number;
|
12
|
+
entryPointAddress: Address;
|
13
|
+
};
|
14
|
+
export type GetPaymasterDataReturnType = Prettify<OneOf<{
|
15
|
+
paymasterAndData: Hex;
|
16
|
+
} | {
|
17
|
+
paymaster: Address;
|
18
|
+
paymasterData: Hex;
|
19
|
+
paymasterVerificationGasLimit: bigint;
|
20
|
+
paymasterPostOpGasLimit: bigint;
|
21
|
+
}>>;
|
22
|
+
export type GetPaymasterDataErrorType = FormatUserOperationRequestErrorType | ErrorType;
|
23
|
+
/**
|
24
|
+
* Retrieves paymaster-related User Operation properties to be used for sending the User Operation.
|
25
|
+
*
|
26
|
+
* - Docs: https://viem.sh/account-abstraction/actions/paymaster/getPaymasterData
|
27
|
+
*
|
28
|
+
* @param client - Client to use
|
29
|
+
* @param parameters - {@link GetPaymasterDataParameters}
|
30
|
+
* @returns Paymaster-related User Operation properties. {@link GetPaymasterDataReturnType}
|
31
|
+
*
|
32
|
+
* @example
|
33
|
+
* import { http } from 'viem'
|
34
|
+
* import { createPaymasterClient, getPaymasterData } from 'viem/account-abstraction'
|
35
|
+
*
|
36
|
+
* const paymasterClient = createPaymasterClient({
|
37
|
+
* transport: http('https://...'),
|
38
|
+
* })
|
39
|
+
*
|
40
|
+
* const userOperation = { ... }
|
41
|
+
*
|
42
|
+
* const values = await getPaymasterData(paymasterClient, {
|
43
|
+
* chainId: 1,
|
44
|
+
* entryPointAddress: '0x...',
|
45
|
+
* ...userOperation,
|
46
|
+
* })
|
47
|
+
*/
|
48
|
+
export declare function getPaymasterData(client: Client<Transport>, parameters: GetPaymasterDataParameters): Promise<GetPaymasterDataReturnType>;
|
49
|
+
//# sourceMappingURL=getPaymasterData.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getPaymasterData.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/paymaster/getPaymasterData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wB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;;;;;;;;GAwBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,EACzB,UAAU,EAAE,0BAA0B,GACrC,OAAO,CAAC,0BAA0B,CAAC,CA2BrC"}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import type { Address } from 'abitype';
|
2
|
+
import type { Client } from '../../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../../clients/transports/createTransport.js';
|
4
|
+
import type { ErrorType } from '../../../errors/utils.js';
|
5
|
+
import type { Hex } from '../../../types/misc.js';
|
6
|
+
import type { OneOf, PartialBy, Prettify } from '../../../types/utils.js';
|
7
|
+
import type { UserOperation } from '../../types/userOperation.js';
|
8
|
+
import { type FormatUserOperationRequestErrorType } from '../../utils/formatters/userOperationRequest.js';
|
9
|
+
export type GetPaymasterStubDataParameters = OneOf<PartialBy<Pick<UserOperation<'0.6'>, 'callData' | 'callGasLimit' | 'initCode' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'sender' | 'preVerificationGas' | 'verificationGasLimit'>, 'callGasLimit' | 'initCode' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'preVerificationGas' | 'verificationGasLimit'> | PartialBy<Pick<UserOperation<'0.7'>, 'callData' | 'callGasLimit' | 'factory' | 'factoryData' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'nonce' | 'sender' | 'preVerificationGas' | 'verificationGasLimit'>, 'callGasLimit' | 'factory' | 'factoryData' | 'maxFeePerGas' | 'maxPriorityFeePerGas' | 'preVerificationGas' | 'verificationGasLimit'>> & {
|
10
|
+
context?: unknown | undefined;
|
11
|
+
chainId: number;
|
12
|
+
entryPointAddress: Address;
|
13
|
+
};
|
14
|
+
export type GetPaymasterStubDataReturnType = Prettify<OneOf<{
|
15
|
+
paymasterAndData: Hex;
|
16
|
+
} | {
|
17
|
+
paymaster: Address;
|
18
|
+
paymasterData: Hex;
|
19
|
+
paymasterVerificationGasLimit: bigint;
|
20
|
+
paymasterPostOpGasLimit: bigint;
|
21
|
+
}> & {
|
22
|
+
sponsor?: {
|
23
|
+
name: string;
|
24
|
+
icon?: string | undefined;
|
25
|
+
} | undefined;
|
26
|
+
isFinal?: boolean | undefined;
|
27
|
+
}>;
|
28
|
+
export type GetPaymasterStubDataErrorType = FormatUserOperationRequestErrorType | ErrorType;
|
29
|
+
/**
|
30
|
+
* Retrieves paymaster-related User Operation properties to be used for gas estimation.
|
31
|
+
*
|
32
|
+
* - Docs: https://viem.sh/account-abstraction/actions/paymaster/getPaymasterStubData
|
33
|
+
*
|
34
|
+
* @param client - Client to use
|
35
|
+
* @param parameters - {@link GetPaymasterStubDataParameters}
|
36
|
+
* @returns Paymaster-related User Operation properties. {@link GetPaymasterStubDataReturnType}
|
37
|
+
*
|
38
|
+
* @example
|
39
|
+
* import { http } from 'viem'
|
40
|
+
* import { createPaymasterClient, getPaymasterStubData } from 'viem/account-abstraction'
|
41
|
+
*
|
42
|
+
* const paymasterClient = createPaymasterClient({
|
43
|
+
* transport: http('https://...'),
|
44
|
+
* })
|
45
|
+
*
|
46
|
+
* const userOperation = { ... }
|
47
|
+
*
|
48
|
+
* const values = await getPaymasterStubData(paymasterClient, {
|
49
|
+
* chainId: 1,
|
50
|
+
* entryPointAddress: '0x...',
|
51
|
+
* ...userOperation,
|
52
|
+
* })
|
53
|
+
*/
|
54
|
+
export declare function getPaymasterStubData(client: Client<Transport>, parameters: GetPaymasterStubDataParameters): Promise<GetPaymasterStubDataReturnType>;
|
55
|
+
//# sourceMappingURL=getPaymasterStubData.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getPaymasterStubData.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/actions/paymaster/getPaymasterStubData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAA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ACrC,uBAAuB,EAAE,MAAM,CAAA;CAChC,CACJ,GAAG;IACF,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAAG,SAAS,CAAA;IACjE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B,CACF,CAAA;AAED,MAAM,MAAM,6BAA6B,GACrC,mCAAmC,GACnC,SAAS,CAAA;AAEb;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,EACzB,UAAU,EAAE,8BAA8B,GACzC,OAAO,CAAC,8BAA8B,CAAC,CA2BzC"}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import type { EstimateFeesPerGasReturnType } from '../../actions/public/estimateFeesPerGas.js';
|
2
|
+
import { type Client, type ClientConfig, type CreateClientErrorType } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { ErrorType } from '../../errors/utils.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { RpcSchema } from '../../types/eip1193.js';
|
7
|
+
import type { BundlerRpcSchema } from '../../types/eip1193.js';
|
8
|
+
import type { Prettify } from '../../types/utils.js';
|
9
|
+
import type { SmartAccount } from '../accounts/types.js';
|
10
|
+
import type { UserOperationRequest } from '../types/userOperation.js';
|
11
|
+
import { type BundlerActions } from './decorators/bundler.js';
|
12
|
+
import type { PaymasterActions } from './decorators/paymaster.js';
|
13
|
+
export type BundlerClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined, client extends Client | undefined = Client | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Pick<ClientConfig<transport, chain, account, rpcSchema>, 'account' | 'cacheTime' | 'chain' | 'key' | 'name' | 'pollingInterval' | 'rpcSchema' | 'transport'>> & {
|
14
|
+
/** Client that points to an Execution RPC URL. */
|
15
|
+
client?: client | Client | undefined;
|
16
|
+
/** Paymaster configuration. */
|
17
|
+
paymaster?: true | {
|
18
|
+
/** Retrieves paymaster-related User Operation properties to be used for sending the User Operation. */
|
19
|
+
getPaymasterData?: PaymasterActions['getPaymasterData'] | undefined;
|
20
|
+
/** Retrieves paymaster-related User Operation properties to be used for gas estimation. */
|
21
|
+
getPaymasterStubData?: PaymasterActions['getPaymasterStubData'] | undefined;
|
22
|
+
} | undefined;
|
23
|
+
/** Paymaster context to pass to `getPaymasterData` and `getPaymasterStubData` calls. */
|
24
|
+
paymasterContext?: unknown;
|
25
|
+
/** User Operation configuration. */
|
26
|
+
userOperation?: {
|
27
|
+
/** Prepares fee properties for the User Operation request. */
|
28
|
+
estimateFeesPerGas?: ((parameters: {
|
29
|
+
account: account | SmartAccount;
|
30
|
+
bundlerClient: Client;
|
31
|
+
userOperation: UserOperationRequest;
|
32
|
+
}) => Promise<EstimateFeesPerGasReturnType<'eip1559'>>) | undefined;
|
33
|
+
} | undefined;
|
34
|
+
};
|
35
|
+
export type BundlerClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined, client extends Client | undefined = Client | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Client<transport, chain extends Chain ? chain : client extends Client<any, infer chain> ? chain : undefined, account, rpcSchema extends RpcSchema ? [...BundlerRpcSchema, ...rpcSchema] : BundlerRpcSchema, BundlerActions<account>>> & {
|
36
|
+
client: client;
|
37
|
+
paymaster: BundlerClientConfig['paymaster'] | undefined;
|
38
|
+
paymasterContext: BundlerClientConfig['paymasterContext'] | undefined;
|
39
|
+
userOperation: BundlerClientConfig['userOperation'] | undefined;
|
40
|
+
};
|
41
|
+
export type CreateBundlerClientErrorType = CreateClientErrorType | ErrorType;
|
42
|
+
/**
|
43
|
+
* Creates a Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
|
44
|
+
*
|
45
|
+
* - Docs: https://viem.sh/account-abstraction/clients/bundler
|
46
|
+
*
|
47
|
+
* @param config - {@link BundlerClientConfig}
|
48
|
+
* @returns A Bundler Client. {@link BundlerClient}
|
49
|
+
*
|
50
|
+
* @example
|
51
|
+
* import { createPublicClient, http } from 'viem'
|
52
|
+
* import { createBundlerClient } from 'viem/account-abstraction'
|
53
|
+
* import { mainnet } from 'viem/chains'
|
54
|
+
*
|
55
|
+
* const client = createPublicClient({
|
56
|
+
* chain: mainnet,
|
57
|
+
* transport: http(),
|
58
|
+
* })
|
59
|
+
*
|
60
|
+
* const bundlerClient = createBundlerClient({
|
61
|
+
* client,
|
62
|
+
* transport: http('https://public.pimlico.io/v2/1/rpc'),
|
63
|
+
* })
|
64
|
+
*/
|
65
|
+
export declare function createBundlerClient<transport extends Transport, chain extends Chain | undefined = undefined, account extends SmartAccount | undefined = undefined, client extends Client | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined>(parameters: BundlerClientConfig<transport, chain, account, client, rpcSchema>): BundlerClient<transport, chain, account, client, rpcSchema>;
|
66
|
+
//# sourceMappingURL=createBundlerClient.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createBundlerClient.d.ts","sourceRoot":"","sources":["../../../account-abstraction/clients/createBundlerClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AAC9F,OAAO,EACL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAE3B,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wB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H,wBAAgB,mBAAmB,CACjC,SAAS,SAAS,SAAS,EAC3B,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,SAAS,EAC3C,OAAO,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,EACpD,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAC7C,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,EAEnD,UAAU,EAAE,mBAAmB,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,GAC5E,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { type Client, type ClientConfig, type CreateClientErrorType } from '../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
+
import type { ErrorType } from '../../errors/utils.js';
|
4
|
+
import type { PaymasterRpcSchema, RpcSchema } from '../../types/eip1193.js';
|
5
|
+
import type { Prettify } from '../../types/utils.js';
|
6
|
+
import { type PaymasterActions } from './decorators/paymaster.js';
|
7
|
+
export type PaymasterClientConfig<transport extends Transport = Transport, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Pick<ClientConfig<transport, undefined, undefined, rpcSchema>, 'cacheTime' | 'key' | 'name' | 'pollingInterval' | 'rpcSchema' | 'transport'>>;
|
8
|
+
export type PaymasterClient<transport extends Transport = Transport, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Client<transport, undefined, undefined, rpcSchema extends RpcSchema ? [...PaymasterRpcSchema, ...rpcSchema] : PaymasterRpcSchema, PaymasterActions>>;
|
9
|
+
export type CreatePaymasterClientErrorType = CreateClientErrorType | ErrorType;
|
10
|
+
/**
|
11
|
+
* Creates a Paymaster Client.
|
12
|
+
*
|
13
|
+
* - Docs: https://viem.sh/account-abstraction/clients/paymaster
|
14
|
+
*
|
15
|
+
* @param config - {@link PaymasterClientConfig}
|
16
|
+
* @returns A Paymaster Client. {@link PaymasterClient}
|
17
|
+
*
|
18
|
+
* @example
|
19
|
+
* import { http } from 'viem'
|
20
|
+
* import { createPaymasterClient } from 'viem/account-abstraction'
|
21
|
+
*
|
22
|
+
* const paymasterClient = createPaymasterClient({
|
23
|
+
* transport: http('https://...'),
|
24
|
+
* })
|
25
|
+
*/
|
26
|
+
export declare function createPaymasterClient<transport extends Transport, rpcSchema extends RpcSchema | undefined = undefined>(parameters: PaymasterClientConfig<transport, rpcSchema>): PaymasterClient<transport, rpcSchema>;
|
27
|
+
//# sourceMappingURL=createPaymasterClient.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createPaymasterClient.d.ts","sourceRoot":"","sources":["../../../account-abstraction/clients/createPaymasterClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAE3B,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,2BAA2B,CAAA;AAElC,MAAM,MAAM,qBAAqB,CAC/B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,IACjD,QAAQ,CACV,IAAI,CACF,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EACxD,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,iBAAiB,GAAG,WAAW,GAAG,WAAW,CAC7E,CACF,CAAA;AAED,MAAM,MAAM,eAAe,CACzB,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,IACjD,QAAQ,CACV,MAAM,CACJ,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,SAAS,SAAS,GACvB,CAAC,GAAG,kBAAkB,EAAE,GAAG,SAAS,CAAC,GACrC,kBAAkB,EACtB,gBAAgB,CACjB,CACF,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG,qBAAqB,GAAG,SAAS,CAAA;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,SAAS,SAAS,EAC3B,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,EAEnD,UAAU,EAAE,qBAAqB,CAAC,SAAS,EAAE,SAAS,CAAC,GACtD,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA"}
|
@@ -0,0 +1,206 @@
|
|
1
|
+
import { type GetChainIdReturnType } from '../../../actions/public/getChainId.js';
|
2
|
+
import type { Client } from '../../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../../clients/transports/createTransport.js';
|
4
|
+
import type { Chain } from '../../../types/chain.js';
|
5
|
+
import type { SmartAccount } from '../../accounts/types.js';
|
6
|
+
import { type EstimateUserOperationGasParameters, type EstimateUserOperationGasReturnType } from '../../actions/bundler/estimateUserOperationGas.js';
|
7
|
+
import { type GetSupportedEntryPointsReturnType } from '../../actions/bundler/getSupportedEntryPoints.js';
|
8
|
+
import { type GetUserOperationParameters, type GetUserOperationReturnType } from '../../actions/bundler/getUserOperation.js';
|
9
|
+
import { type GetUserOperationReceiptParameters, type GetUserOperationReceiptReturnType } from '../../actions/bundler/getUserOperationReceipt.js';
|
10
|
+
import { type PrepareUserOperationParameters, type PrepareUserOperationRequest, type PrepareUserOperationReturnType } from '../../actions/bundler/prepareUserOperation.js';
|
11
|
+
import { type SendUserOperationParameters, type SendUserOperationReturnType } from '../../actions/bundler/sendUserOperation.js';
|
12
|
+
import { type WaitForUserOperationReceiptParameters, type WaitForUserOperationReceiptReturnType } from '../../actions/bundler/waitForUserOperationReceipt.js';
|
13
|
+
export type BundlerActions<account extends SmartAccount | undefined = SmartAccount | undefined> = {
|
14
|
+
/**
|
15
|
+
* Returns an estimate of gas values necessary to execute the User Operation.
|
16
|
+
*
|
17
|
+
* - Docs: https://viem.sh/actions/bundler/estimateUserOperationGas
|
18
|
+
*
|
19
|
+
* @param client - Client to use
|
20
|
+
* @param parameters - {@link EstimateUserOperationGasParameters}
|
21
|
+
* @returns The gas estimate (in wei). {@link EstimateUserOperationGasReturnType}
|
22
|
+
*
|
23
|
+
* @example
|
24
|
+
* import { createBundlerClient, http, parseEther } from 'viem'
|
25
|
+
* import { mainnet } from 'viem/chains'
|
26
|
+
* import { toSmartAccount } from 'viem/accounts'
|
27
|
+
*
|
28
|
+
* const account = await toSmartAccount({ ... })
|
29
|
+
*
|
30
|
+
* const bundlerClient = createBundlerClient({
|
31
|
+
* chain: mainnet,
|
32
|
+
* transport: http(),
|
33
|
+
* })
|
34
|
+
*
|
35
|
+
* const values = await bundlerClient.estimateUserOperationGas({
|
36
|
+
* account,
|
37
|
+
* calls: [{ to: '0x...', value: parseEther('1') }],
|
38
|
+
* })
|
39
|
+
*/
|
40
|
+
estimateUserOperationGas: <const calls extends readonly unknown[], accountOverride extends SmartAccount | undefined = undefined>(parameters: EstimateUserOperationGasParameters<account, accountOverride, calls>) => Promise<EstimateUserOperationGasReturnType<account, accountOverride>>;
|
41
|
+
/**
|
42
|
+
* Returns the chain ID associated with the bundler.
|
43
|
+
*
|
44
|
+
* - Docs: https://viem.sh/docs/actions/public/getChainId
|
45
|
+
* - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)
|
46
|
+
*
|
47
|
+
* @returns The current chain ID. {@link GetChainIdReturnType}
|
48
|
+
*
|
49
|
+
* @example
|
50
|
+
* import { http } from 'viem'
|
51
|
+
* import { createBundlerClient, mainnet } from 'viem/chains'
|
52
|
+
*
|
53
|
+
* const client = createPublicClient({
|
54
|
+
* chain: mainnet,
|
55
|
+
* transport: http(),
|
56
|
+
* })
|
57
|
+
* const chainId = await client.getChainId()
|
58
|
+
* // 1
|
59
|
+
*/
|
60
|
+
getChainId: () => Promise<GetChainIdReturnType>;
|
61
|
+
/**
|
62
|
+
* Returns the EntryPoints that the bundler supports.
|
63
|
+
*
|
64
|
+
* - Docs: https://viem.sh/actions/bundler/getSupportedEntryPoints
|
65
|
+
*
|
66
|
+
* @param client - Client to use
|
67
|
+
* @param parameters - {@link GetSupportedEntryPointsParameters}
|
68
|
+
* @returns Supported Entry Points. {@link GetSupportedEntryPointsReturnType}
|
69
|
+
*
|
70
|
+
* @example
|
71
|
+
* import { createBundlerClient, http, parseEther } from 'viem'
|
72
|
+
* import { mainnet } from 'viem/chains'
|
73
|
+
*
|
74
|
+
* const bundlerClient = createBundlerClient({
|
75
|
+
* chain: mainnet,
|
76
|
+
* transport: http(),
|
77
|
+
* })
|
78
|
+
*
|
79
|
+
* const addresses = await bundlerClient.getSupportedEntryPoints()
|
80
|
+
*/
|
81
|
+
getSupportedEntryPoints: () => Promise<GetSupportedEntryPointsReturnType>;
|
82
|
+
/**
|
83
|
+
* Returns the information about a User Operation given a hash.
|
84
|
+
*
|
85
|
+
* - Docs: https://viem.sh/docs/actions/bundler/getUserOperation
|
86
|
+
*
|
87
|
+
* @param client - Client to use
|
88
|
+
* @param parameters - {@link GetUserOperationParameters}
|
89
|
+
* @returns The receipt. {@link GetUserOperationReturnType}
|
90
|
+
*
|
91
|
+
* @example
|
92
|
+
* import { createBundlerClient, http } from 'viem'
|
93
|
+
* import { mainnet } from 'viem/chains'
|
94
|
+
*
|
95
|
+
* const client = createBundlerClient({
|
96
|
+
* chain: mainnet,
|
97
|
+
* transport: http(),
|
98
|
+
* })
|
99
|
+
*
|
100
|
+
* const receipt = await client.getUserOperation({
|
101
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
102
|
+
* })
|
103
|
+
*/
|
104
|
+
getUserOperation: (parameters: GetUserOperationParameters) => Promise<GetUserOperationReturnType>;
|
105
|
+
/**
|
106
|
+
* Returns the User Operation Receipt given a User Operation hash.
|
107
|
+
*
|
108
|
+
* - Docs: https://viem.sh/docs/actions/bundler/getUserOperationReceipt
|
109
|
+
*
|
110
|
+
* @param client - Client to use
|
111
|
+
* @param parameters - {@link GetUserOperationReceiptParameters}
|
112
|
+
* @returns The receipt. {@link GetUserOperationReceiptReturnType}
|
113
|
+
*
|
114
|
+
* @example
|
115
|
+
* import { createBundlerClient, http } from 'viem'
|
116
|
+
* import { mainnet } from 'viem/chains'
|
117
|
+
*
|
118
|
+
* const client = createBundlerClient({
|
119
|
+
* chain: mainnet,
|
120
|
+
* transport: http(),
|
121
|
+
* })
|
122
|
+
*
|
123
|
+
* const receipt = await client.getUserOperationReceipt({
|
124
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
125
|
+
* })
|
126
|
+
*/
|
127
|
+
getUserOperationReceipt: (parameters: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType>;
|
128
|
+
/**
|
129
|
+
* Prepares a User Operation and fills in missing properties.
|
130
|
+
*
|
131
|
+
* - Docs: https://viem.sh/actions/bundler/prepareUserOperation
|
132
|
+
*
|
133
|
+
* @param args - {@link PrepareUserOperationParameters}
|
134
|
+
* @returns The User Operation. {@link PrepareUserOperationReturnType}
|
135
|
+
*
|
136
|
+
* @example
|
137
|
+
* import { createBundlerClient, http } from 'viem'
|
138
|
+
* import { mainnet } from 'viem/chains'
|
139
|
+
* import { toSmartAccount } from 'viem/accounts'
|
140
|
+
*
|
141
|
+
* const account = await toSmartAccount({ ... })
|
142
|
+
*
|
143
|
+
* const client = createBundlerClient({
|
144
|
+
* chain: mainnet,
|
145
|
+
* transport: http(),
|
146
|
+
* })
|
147
|
+
*
|
148
|
+
* const request = await client.prepareUserOperation({
|
149
|
+
* account,
|
150
|
+
* calls: [{ to: '0x...', value: parseEther('1') }],
|
151
|
+
* })
|
152
|
+
*/
|
153
|
+
prepareUserOperation: <const calls extends readonly unknown[], const request extends PrepareUserOperationRequest<account, accountOverride, calls>, accountOverride extends SmartAccount | undefined = undefined>(parameters: PrepareUserOperationParameters<account, accountOverride, calls, request>) => Promise<PrepareUserOperationReturnType<account, accountOverride, calls, request>>;
|
154
|
+
/**
|
155
|
+
* Broadcasts a User Operation to the Bundler.
|
156
|
+
*
|
157
|
+
* - Docs: https://viem.sh/actions/bundler/sendUserOperation
|
158
|
+
*
|
159
|
+
* @param client - Client to use
|
160
|
+
* @param parameters - {@link SendUserOperationParameters}
|
161
|
+
* @returns The User Operation hash. {@link SendUserOperationReturnType}
|
162
|
+
*
|
163
|
+
* @example
|
164
|
+
* import { createBundlerClient, http, parseEther } from 'viem'
|
165
|
+
* import { mainnet } from 'viem/chains'
|
166
|
+
* import { toSmartAccount } from 'viem/accounts'
|
167
|
+
*
|
168
|
+
* const account = toSmartAccount({ ... })
|
169
|
+
*
|
170
|
+
* const bundlerClient = createBundlerClient({
|
171
|
+
* chain: mainnet,
|
172
|
+
* transport: http(),
|
173
|
+
* })
|
174
|
+
*
|
175
|
+
* const values = await bundlerClient.sendUserOperation({
|
176
|
+
* account,
|
177
|
+
* calls: [{ to: '0x...', value: parseEther('1') }],
|
178
|
+
* })
|
179
|
+
*/
|
180
|
+
sendUserOperation: <const calls extends readonly unknown[], accountOverride extends SmartAccount | undefined = undefined>(parameters: SendUserOperationParameters<account, accountOverride, calls>) => Promise<SendUserOperationReturnType>;
|
181
|
+
/**
|
182
|
+
* Waits for the User Operation to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the User Operation receipt.
|
183
|
+
*
|
184
|
+
* - Docs: https://viem.sh/docs/actions/bundler/waitForUserOperationReceipt
|
185
|
+
*
|
186
|
+
* @param client - Client to use
|
187
|
+
* @param parameters - {@link WaitForUserOperationReceiptParameters}
|
188
|
+
* @returns The receipt. {@link WaitForUserOperationReceiptReturnType}
|
189
|
+
*
|
190
|
+
* @example
|
191
|
+
* import { createBundlerClient, http } from 'viem'
|
192
|
+
* import { mainnet } from 'viem/chains'
|
193
|
+
*
|
194
|
+
* const client = createBundlerClient({
|
195
|
+
* chain: mainnet,
|
196
|
+
* transport: http(),
|
197
|
+
* })
|
198
|
+
*
|
199
|
+
* const receipt = await client.waitForUserOperationReceipt({
|
200
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
201
|
+
* })
|
202
|
+
*/
|
203
|
+
waitForUserOperationReceipt: (parameters: WaitForUserOperationReceiptParameters) => Promise<WaitForUserOperationReceiptReturnType>;
|
204
|
+
};
|
205
|
+
export declare function bundlerActions<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined>(client: Client<transport, chain, account>): BundlerActions<account>;
|
206
|
+
//# sourceMappingURL=bundler.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/clients/decorators/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EAExC,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACL,KAAK,iCAAiC,EAEvC,MAAM,kDAAkD,CAAA;AACzD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,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,oBAAoB,EAAE,CACpB,KAAK,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,EACtC,KAAK,CAAC,OAAO,SAAS,2BAA2B,CAC/C,OAAO,EACP,eAAe,EACf,KAAK,CACN,EACD,eAAe,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,EAE5D,UAAU,EAAE,8BAA8B,CACxC,OAAO,EACP,eAAe,EACf,KAAK,EACL,OAAO,CACR,KACE,OAAO,CACV,8BAA8B,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,CAAC,CACzE,CAAA;IACD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,iBAAiB,EAAE,CACjB,KAAK,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,EACtC,eAAe,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,EAE5D,UAAU,EAAE,2BAA2B,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,CAAC,KACrE,OAAO,CAAC,2BAA2B,CAAC,CAAA;IACzC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,2BAA2B,EAAE,CAC3B,UAAU,EAAE,qCAAqC,KAC9C,OAAO,CAAC,qCAAqC,CAAC,CAAA;CACpD,CAAA;AAED,wBAAgB,cAAc,CAC5B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,EACnE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,CAepE"}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import type { Client } from '../../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../../clients/transports/createTransport.js';
|
3
|
+
import { type GetPaymasterDataParameters, type GetPaymasterDataReturnType } from '../../actions/paymaster/getPaymasterData.js';
|
4
|
+
import { type GetPaymasterStubDataParameters, type GetPaymasterStubDataReturnType } from '../../actions/paymaster/getPaymasterStubData.js';
|
5
|
+
export type PaymasterActions = {
|
6
|
+
/**
|
7
|
+
* Retrieves paymaster-related User Operation properties to be used for sending the User Operation.
|
8
|
+
*
|
9
|
+
* - Docs: https://viem.sh/account-abstraction/actions/paymaster/getPaymasterData
|
10
|
+
*
|
11
|
+
* @param client - Client to use
|
12
|
+
* @param parameters - {@link GetPaymasterDataParameters}
|
13
|
+
* @returns Paymaster-related User Operation properties. {@link GetPaymasterDataReturnType}
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* import { http } from 'viem'
|
17
|
+
* import { createPaymasterClient } from 'viem/account-abstraction'
|
18
|
+
*
|
19
|
+
* const paymasterClient = createPaymasterClient({
|
20
|
+
* transport: http('https://...'),
|
21
|
+
* })
|
22
|
+
*
|
23
|
+
* const userOperation = { ... }
|
24
|
+
*
|
25
|
+
* const values = await paymasterClient.getPaymasterData({
|
26
|
+
* chainId: 1,
|
27
|
+
* entryPointAddress: '0x...',
|
28
|
+
* ...userOperation,
|
29
|
+
* })
|
30
|
+
*/
|
31
|
+
getPaymasterData: (parameters: GetPaymasterDataParameters) => Promise<GetPaymasterDataReturnType>;
|
32
|
+
/**
|
33
|
+
* Retrieves paymaster-related User Operation properties to be used for gas estimation.
|
34
|
+
*
|
35
|
+
* - Docs: https://viem.sh/account-abstraction/actions/paymaster/getPaymasterStubData
|
36
|
+
*
|
37
|
+
* @param client - Client to use
|
38
|
+
* @param parameters - {@link GetPaymasterStubDataParameters}
|
39
|
+
* @returns Paymaster-related User Operation properties. {@link GetPaymasterStubDataReturnType}
|
40
|
+
*
|
41
|
+
* @example
|
42
|
+
* import { http } from 'viem'
|
43
|
+
* import { createPaymasterClient } from 'viem/account-abstraction'
|
44
|
+
*
|
45
|
+
* const paymasterClient = createPaymasterClient({
|
46
|
+
* transport: http('https://...'),
|
47
|
+
* })
|
48
|
+
*
|
49
|
+
* const userOperation = { ... }
|
50
|
+
*
|
51
|
+
* const values = await paymasterClient.getPaymasterStubData({
|
52
|
+
* chainId: 1,
|
53
|
+
* entryPointAddress: '0x...',
|
54
|
+
* ...userOperation,
|
55
|
+
* })
|
56
|
+
*/
|
57
|
+
getPaymasterStubData: (parameters: GetPaymasterStubDataParameters) => Promise<GetPaymasterStubDataReturnType>;
|
58
|
+
};
|
59
|
+
export declare function paymasterActions<transport extends Transport = Transport>(client: Client<transport>): PaymasterActions;
|
60
|
+
//# sourceMappingURL=paymaster.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"paymaster.d.ts","sourceRoot":"","sources":["../../../../account-abstraction/clients/decorators/paymaster.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAC/E,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAEhC,MAAM,6CAA6C,CAAA;AACpD,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEpC,MAAM,iDAAiD,CAAA;AAExD,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,gBAAgB,EAAE,CAChB,UAAU,EAAE,0BAA0B,KACnC,OAAO,CAAC,0BAA0B,CAAC,CAAA;IACxC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,oBAAoB,EAAE,CACpB,UAAU,EAAE,8BAA8B,KACvC,OAAO,CAAC,8BAA8B,CAAC,CAAA;CAC7C,CAAA;AAED,wBAAgB,gBAAgB,CAAC,SAAS,SAAS,SAAS,GAAG,SAAS,EACtE,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,GACxB,gBAAgB,CAMlB"}
|