permissionless 0.0.26 → 0.0.28
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 +12 -0
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js +16 -13
- package/_cjs/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +16 -13
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
- package/_cjs/accounts/signerToSafeSmartAccount.js +20 -17
- package/_cjs/accounts/signerToSafeSmartAccount.js.map +1 -1
- package/_cjs/accounts/signerToSimpleSmartAccount.js +15 -12
- package/_cjs/accounts/signerToSimpleSmartAccount.js.map +1 -1
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -1
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
- package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -1
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_cjs/actions/public/getAccountNonce.js +2 -1
- package/_cjs/actions/public/getAccountNonce.js.map +1 -1
- package/_cjs/actions/public/getSenderAddress.js +2 -1
- package/_cjs/actions/public/getSenderAddress.js.map +1 -1
- package/_cjs/actions/smartAccount/deployContract.js +4 -3
- package/_cjs/actions/smartAccount/deployContract.js.map +1 -1
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransactions.js.map +1 -1
- package/_cjs/actions/smartAccount/sendUserOperation.js +1 -2
- package/_cjs/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/_cjs/actions/smartAccount/signTypedData.js.map +1 -1
- package/_cjs/actions/smartAccount.js.map +1 -1
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/bundler.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_cjs/clients/decorators/smartAccount.js +30 -28
- package/_cjs/clients/decorators/smartAccount.js.map +1 -1
- package/_cjs/utils/deepHexlify.js.map +1 -1
- package/_cjs/utils/index.js +3 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/isSmartAccountDeployed.js +15 -0
- package/_cjs/utils/isSmartAccountDeployed.js.map +1 -0
- package/_cjs/utils/observe.js.map +1 -1
- package/_cjs/utils/signUserOperationHashWithECDSA.js.map +1 -1
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js +17 -14
- package/_esm/accounts/biconomy/signerToBiconomySmartAccount.js.map +1 -1
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +17 -14
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -1
- package/_esm/accounts/signerToSafeSmartAccount.js +21 -18
- package/_esm/accounts/signerToSafeSmartAccount.js.map +1 -1
- package/_esm/accounts/signerToSimpleSmartAccount.js +16 -13
- package/_esm/accounts/signerToSimpleSmartAccount.js.map +1 -1
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -1
- package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -1
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js +1 -1
- package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -1
- package/_esm/actions/public/getAccountNonce.js +2 -1
- package/_esm/actions/public/getAccountNonce.js.map +1 -1
- package/_esm/actions/public/getSenderAddress.js +2 -1
- package/_esm/actions/public/getSenderAddress.js.map +1 -1
- package/_esm/actions/smartAccount/deployContract.js +5 -5
- package/_esm/actions/smartAccount/deployContract.js.map +1 -1
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransaction.js +1 -1
- package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransactions.js +1 -1
- package/_esm/actions/smartAccount/sendTransactions.js.map +1 -1
- package/_esm/actions/smartAccount/sendUserOperation.js +1 -2
- package/_esm/actions/smartAccount/sendUserOperation.js.map +1 -1
- package/_esm/actions/smartAccount/signTypedData.js.map +1 -1
- package/_esm/actions/smartAccount.js.map +1 -1
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/bundler.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js +1 -1
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_esm/clients/decorators/smartAccount.js +30 -28
- package/_esm/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/utils/deepHexlify.js.map +1 -1
- package/_esm/utils/index.js +2 -1
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/isSmartAccountDeployed.js +11 -0
- package/_esm/utils/isSmartAccountDeployed.js.map +1 -0
- package/_esm/utils/observe.js.map +1 -1
- package/_esm/utils/signUserOperationHashWithECDSA.js.map +1 -1
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts +2 -1
- package/_types/accounts/biconomy/signerToBiconomySmartAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +2 -1
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -1
- package/_types/accounts/signerToSafeSmartAccount.d.ts +3 -2
- package/_types/accounts/signerToSafeSmartAccount.d.ts.map +1 -1
- package/_types/accounts/signerToSimpleSmartAccount.d.ts +2 -1
- package/_types/accounts/signerToSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/types.d.ts +3 -3
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +2 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationByHash.d.ts +3 -2
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +2 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/bundler/sendUserOperation.d.ts +2 -1
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +2 -1
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +2 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +2 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +2 -1
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +5 -4
- package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -1
- package/_types/actions/pimlico.d.ts +2 -2
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/actions/public/getAccountNonce.d.ts +2 -1
- package/_types/actions/public/getAccountNonce.d.ts.map +1 -1
- package/_types/actions/public/getSenderAddress.d.ts +2 -1
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -1
- package/_types/actions/smartAccount/deployContract.d.ts +4 -3
- package/_types/actions/smartAccount/deployContract.d.ts.map +1 -1
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts +2 -2
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransaction.d.ts +4 -3
- package/_types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransactions.d.ts +4 -4
- package/_types/actions/smartAccount/sendTransactions.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendUserOperation.d.ts +3 -4
- package/_types/actions/smartAccount/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/smartAccount/writeContract.d.ts +3 -3
- package/_types/actions/smartAccount/writeContract.d.ts.map +1 -1
- package/_types/actions/smartAccount.d.ts +2 -2
- package/_types/actions/smartAccount.d.ts.map +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +5 -3
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/bundler.d.ts +6 -5
- package/_types/clients/decorators/bundler.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +7 -6
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/clients/decorators/smartAccount.d.ts +8 -7
- package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
- package/_types/utils/index.d.ts +2 -1
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/isSmartAccountDeployed.d.ts +3 -0
- package/_types/utils/isSmartAccountDeployed.d.ts.map +1 -0
- package/accounts/biconomy/signerToBiconomySmartAccount.ts +25 -18
- package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +24 -13
- package/accounts/signerToSafeSmartAccount.ts +24 -18
- package/accounts/signerToSimpleSmartAccount.ts +25 -18
- package/accounts/types.ts +4 -3
- package/actions/bundler/estimateUserOperationGas.ts +3 -2
- package/actions/bundler/getUserOperationByHash.ts +4 -3
- package/actions/bundler/getUserOperationReceipt.ts +3 -2
- package/actions/bundler/sendUserOperation.ts +2 -1
- package/actions/bundler/waitForUserOperationReceipt.ts +3 -2
- package/actions/pimlico/getUserOperationGasPrice.ts +2 -1
- package/actions/pimlico/getUserOperationStatus.ts +3 -2
- package/actions/pimlico/sponsorUserOperation.ts +3 -2
- package/actions/pimlico/validateSponsorshipPolicies.ts +6 -5
- package/actions/pimlico.ts +2 -2
- package/actions/public/getAccountNonce.ts +4 -1
- package/actions/public/getSenderAddress.ts +4 -1
- package/actions/smartAccount/deployContract.ts +19 -15
- package/actions/smartAccount/prepareUserOperationRequest.ts +3 -2
- package/actions/smartAccount/sendTransaction.ts +6 -7
- package/actions/smartAccount/sendTransactions.ts +5 -5
- package/actions/smartAccount/sendUserOperation.ts +5 -12
- package/actions/smartAccount/writeContract.ts +3 -3
- package/actions/smartAccount.ts +0 -2
- package/clients/createSmartAccountClient.ts +10 -16
- package/clients/decorators/bundler.ts +12 -9
- package/clients/decorators/pimlico.ts +12 -9
- package/clients/decorators/smartAccount.ts +34 -25
- package/package.json +1 -1
- package/utils/index.ts +3 -1
- package/utils/isSmartAccountDeployed.ts +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSmartAccountClient.d.ts","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"createSmartAccountClient.d.ts","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EAEZ,MAAM,MAAM,CAAA;AAEb,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,wDAAwD,CAAA;AAC5G,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EACH,KAAK,mBAAmB,EAE3B,MAAM,8BAA8B,CAAA;AAErC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAC1B,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,IACnE,QAAQ,CACR,MAAM,CACF,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC,CACtC,CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,CAChC,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,IACnE,QAAQ,CACR,IAAI,CACA,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,EACvC,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,iBAAiB,GAAG,WAAW,CAC3E,GAAG;IACA,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,8BAA8B,CACrC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,wBAAwB,CACpC,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,SAAS,EAC5C,aAAa,SAAS,YAAY,GAAG,SAAS,GAAG,SAAS,EAE1D,UAAU,EAAE,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,GACxE,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAA"}
|
|
@@ -5,6 +5,7 @@ import { type GetUserOperationByHashParameters, type GetUserOperationByHashRetur
|
|
|
5
5
|
import { type GetUserOperationReceiptParameters, type GetUserOperationReceiptReturnType } from "../../actions/bundler/getUserOperationReceipt.js";
|
|
6
6
|
import { type SendUserOperationParameters } from "../../actions/bundler/sendUserOperation.js";
|
|
7
7
|
import { type WaitForUserOperationReceiptParameters } from "../../actions/bundler/waitForUserOperationReceipt.js";
|
|
8
|
+
import type { Prettify } from "../../types/index.js";
|
|
8
9
|
export type BundlerActions = {
|
|
9
10
|
/**
|
|
10
11
|
*
|
|
@@ -31,7 +32,7 @@ export type BundlerActions = {
|
|
|
31
32
|
*
|
|
32
33
|
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
33
34
|
*/
|
|
34
|
-
sendUserOperation: (args: SendUserOperationParameters) => Promise<Hash>;
|
|
35
|
+
sendUserOperation: (args: Prettify<SendUserOperationParameters>) => Promise<Hash>;
|
|
35
36
|
/**
|
|
36
37
|
*
|
|
37
38
|
* Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
|
|
@@ -57,7 +58,7 @@ export type BundlerActions = {
|
|
|
57
58
|
*
|
|
58
59
|
* // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
|
|
59
60
|
*/
|
|
60
|
-
estimateUserOperationGas: (args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType
|
|
61
|
+
estimateUserOperationGas: (args: Prettify<EstimateUserOperationGasParameters>) => Promise<Prettify<EstimateUserOperationGasReturnType>>;
|
|
61
62
|
/**
|
|
62
63
|
*
|
|
63
64
|
* Returns the supported entrypoints by the bundler service
|
|
@@ -122,7 +123,7 @@ export type BundlerActions = {
|
|
|
122
123
|
* await bundlerClient.getUserOperationByHash(userOpHash)
|
|
123
124
|
*
|
|
124
125
|
*/
|
|
125
|
-
getUserOperationByHash: (args: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
|
|
126
|
+
getUserOperationByHash: (args: Prettify<GetUserOperationByHashParameters>) => Promise<Prettify<GetUserOperationByHashReturnType> | null>;
|
|
126
127
|
/**
|
|
127
128
|
*
|
|
128
129
|
* Returns the user operation receipt from userOpHash
|
|
@@ -144,7 +145,7 @@ export type BundlerActions = {
|
|
|
144
145
|
* await bundlerClient.getUserOperationReceipt({hash: userOpHash})
|
|
145
146
|
*
|
|
146
147
|
*/
|
|
147
|
-
getUserOperationReceipt: (args: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType | null>;
|
|
148
|
+
getUserOperationReceipt: (args: Prettify<GetUserOperationReceiptParameters>) => Promise<Prettify<GetUserOperationReceiptReturnType> | null>;
|
|
148
149
|
/**
|
|
149
150
|
* Waits for the User Operation to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [User Operation Receipt](https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt).
|
|
150
151
|
*
|
|
@@ -166,7 +167,7 @@ export type BundlerActions = {
|
|
|
166
167
|
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
|
167
168
|
* })
|
|
168
169
|
*/
|
|
169
|
-
waitForUserOperationReceipt: (args: WaitForUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType
|
|
170
|
+
waitForUserOperationReceipt: (args: Prettify<WaitForUserOperationReceiptParameters>) => Promise<Prettify<GetUserOperationReceiptReturnType>>;
|
|
170
171
|
};
|
|
171
172
|
declare const bundlerActions: (client: Client) => BundlerActions;
|
|
172
173
|
export { bundlerActions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../clients/decorators/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,EACH,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EAC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;OAoBG;IACH,oBAAoB,EAAE,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC9C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAAsB,EAAE,CACpB,IAAI,EAAE,QAAQ,CAAC,gCAAgC,CAAC,KAC/C,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC/D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,EAAE,CACrB,IAAI,EAAE,QAAQ,CAAC,iCAAiC,CAAC,KAChD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,GAAG,IAAI,CAAC,CAAA;IAEhE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,2BAA2B,EAAE,CACzB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC,KACpD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,CAAA;CAC5D,CAAA;AAED,QAAA,MAAM,cAAc,WAAY,MAAM,KAAG,cAgBvC,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Client } from "viem";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ValidateSponsorshipPolicies, type ValidateSponsorshipPoliciesParameters } from "../../actions/pimlico.js";
|
|
3
3
|
import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice.js";
|
|
4
4
|
import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus.js";
|
|
5
5
|
import { type PimlicoSponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation.js";
|
|
6
|
+
import type { Prettify } from "../../types/index.js";
|
|
6
7
|
export type PimlicoBundlerActions = {
|
|
7
8
|
/**
|
|
8
9
|
* Returns the live gas prices that you can use to send a user operation.
|
|
@@ -23,7 +24,7 @@ export type PimlicoBundlerActions = {
|
|
|
23
24
|
*
|
|
24
25
|
* await bundlerClient.getUserOperationGasPrice()
|
|
25
26
|
*/
|
|
26
|
-
getUserOperationGasPrice: () => Promise<GetUserOperationGasPriceReturnType
|
|
27
|
+
getUserOperationGasPrice: () => Promise<Prettify<GetUserOperationGasPriceReturnType>>;
|
|
27
28
|
/**
|
|
28
29
|
* Returns the status of the userOperation that is pending in the mempool.
|
|
29
30
|
*
|
|
@@ -43,7 +44,7 @@ export type PimlicoBundlerActions = {
|
|
|
43
44
|
*
|
|
44
45
|
* await bundlerClient.getUserOperationStatus({ hash: userOpHash })
|
|
45
46
|
*/
|
|
46
|
-
getUserOperationStatus: (args: GetUserOperationStatusParameters) => Promise<GetUserOperationStatusReturnType
|
|
47
|
+
getUserOperationStatus: (args: Prettify<GetUserOperationStatusParameters>) => Promise<Prettify<GetUserOperationStatusReturnType>>;
|
|
47
48
|
};
|
|
48
49
|
export declare const pimlicoBundlerActions: (client: Client) => PimlicoBundlerActions;
|
|
49
50
|
export type PimlicoPaymasterClientActions = {
|
|
@@ -70,15 +71,15 @@ export type PimlicoPaymasterClientActions = {
|
|
|
70
71
|
* }})
|
|
71
72
|
*
|
|
72
73
|
*/
|
|
73
|
-
sponsorUserOperation: (args: PimlicoSponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType
|
|
74
|
-
validateSponsorshipPolicies: (args: ValidateSponsorshipPoliciesParameters) => Promise<
|
|
74
|
+
sponsorUserOperation: (args: Prettify<PimlicoSponsorUserOperationParameters>) => Promise<Prettify<SponsorUserOperationReturnType>>;
|
|
75
|
+
validateSponsorshipPolicies: (args: Prettify<ValidateSponsorshipPoliciesParameters>) => Promise<Prettify<ValidateSponsorshipPolicies>[]>;
|
|
75
76
|
};
|
|
76
77
|
/**
|
|
77
78
|
* Returns valid sponsorship policies for a userOperation from the list of ids passed
|
|
78
79
|
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/ValidateSponsorshipPolicies
|
|
79
80
|
*
|
|
80
81
|
* @param args {@link ValidateSponsorshipPoliciesParameters} UserOperation you want to sponsor & entryPoint.
|
|
81
|
-
* @returns valid sponsorship policies, see {@link
|
|
82
|
+
* @returns valid sponsorship policies, see {@link ValidateSponsorshipPolicies}
|
|
82
83
|
*
|
|
83
84
|
* @example
|
|
84
85
|
* import { createClient } from "viem"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,MAAM,CAAA;AACxC,OAAO,EACH,KAAK,
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,MAAM,CAAA;AACxC,OAAO,EACH,KAAK,2BAA2B,EAChC,KAAK,qCAAqC,EAE7C,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAMpD,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBAAwB,EAAE,MAAM,OAAO,CACnC,QAAQ,CAAC,kCAAkC,CAAC,CAC/C,CAAA;IACD;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAAsB,EAAE,CACpB,IAAI,EAAE,QAAQ,CAAC,gCAAgC,CAAC,KAC/C,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC,CAAA;CAC3D,CAAA;AAED,eAAO,MAAM,qBAAqB,WACtB,MAAM,KACf,qBAKD,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAClB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC,KACpD,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC,CAAA;IAEtD,2BAA2B,EAAE,CACzB,IAAI,EAAE,QAAQ,CAAC,qCAAqC,CAAC,KACpD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAA;CACxD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,uBAAuB,WACxB,MAAM,KACf,6BAMD,CAAA;AAEF;;GAEG"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { Abi, Chain, Client, ContractFunctionArgs, ContractFunctionName, DeployContractParameters, SendTransactionParameters, Transport, TypedData, WriteContractParameters } from "viem";
|
|
1
|
+
import type { Abi, Chain, Client, ContractFunctionArgs, ContractFunctionName, DeployContractParameters, Hash, SendTransactionParameters, Transport, TypedData, WriteContractParameters } from "viem";
|
|
2
2
|
import type { SmartAccount } from "../../accounts/types.js";
|
|
3
3
|
import { type SendTransactionsWithPaymasterParameters, sendTransactions } from "../../actions/smartAccount.js";
|
|
4
4
|
import { deployContract } from "../../actions/smartAccount/deployContract.js";
|
|
5
5
|
import { type PrepareUserOperationRequestReturnType, type SponsorUserOperationMiddleware, prepareUserOperationRequest } from "../../actions/smartAccount/prepareUserOperationRequest.js";
|
|
6
6
|
import { sendTransaction } from "../../actions/smartAccount/sendTransaction.js";
|
|
7
|
-
import {
|
|
7
|
+
import { sendUserOperation } from "../../actions/smartAccount/sendUserOperation.js";
|
|
8
8
|
import { signMessage } from "../../actions/smartAccount/signMessage.js";
|
|
9
9
|
import { signTypedData } from "../../actions/smartAccount/signTypedData.js";
|
|
10
10
|
import { writeContract } from "../../actions/smartAccount/writeContract.js";
|
|
11
|
+
import type { Prettify } from "../../types/index.js";
|
|
11
12
|
export type SmartAccountActions<TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined> = {
|
|
12
13
|
/**
|
|
13
14
|
* Creates, signs, and sends a new transaction to the network.
|
|
@@ -222,7 +223,7 @@ export type SmartAccountActions<TChain extends Chain | undefined = Chain | undef
|
|
|
222
223
|
* bytecode: '0x608060405260405161083e38038061083e833981016040819052610...',
|
|
223
224
|
* })
|
|
224
225
|
*/
|
|
225
|
-
deployContract: <const TAbi extends Abi | readonly unknown[], TChainOverride extends Chain | undefined = undefined>(args: DeployContractParameters<TAbi, TChain, TSmartAccount, TChainOverride
|
|
226
|
+
deployContract: <const TAbi extends Abi | readonly unknown[], TChainOverride extends Chain | undefined = undefined>(args: Prettify<DeployContractParameters<TAbi, TChain, TSmartAccount, TChainOverride>>) => ReturnType<typeof deployContract<TChain, TSmartAccount>>;
|
|
226
227
|
/**
|
|
227
228
|
* Executes a write function on a contract.
|
|
228
229
|
* This function also allows you to sponsor this transaction if sender is a smartAccount
|
|
@@ -272,8 +273,8 @@ export type SmartAccountActions<TChain extends Chain | undefined = Chain | undef
|
|
|
272
273
|
* const hash = await client.writeContract(request)
|
|
273
274
|
*/
|
|
274
275
|
writeContract: <const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "nonpayable" | "payable"> = ContractFunctionName<TAbi, "nonpayable" | "payable">, TArgs extends ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName> = ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName>, TChainOverride extends Chain | undefined = undefined>(args: WriteContractParameters<TAbi, TFunctionName, TArgs, TChain, TSmartAccount, TChainOverride>) => ReturnType<typeof writeContract<TChain, TSmartAccount, TAbi, TFunctionName, TArgs, TChainOverride>>;
|
|
275
|
-
prepareUserOperationRequest: <TTransport extends Transport>(args: Parameters<typeof prepareUserOperationRequest<TTransport, TChain, TSmartAccount>>[1]) => Promise<PrepareUserOperationRequestReturnType
|
|
276
|
-
sendUserOperation: <TTransport extends Transport>(args: Parameters<typeof sendUserOperation<TTransport, TChain, TSmartAccount>>[1]) => Promise<
|
|
276
|
+
prepareUserOperationRequest: <TTransport extends Transport>(args: Prettify<Parameters<typeof prepareUserOperationRequest<TTransport, TChain, TSmartAccount>>[1]>) => Promise<Prettify<PrepareUserOperationRequestReturnType>>;
|
|
277
|
+
sendUserOperation: <TTransport extends Transport>(args: Prettify<Parameters<typeof sendUserOperation<TTransport, TChain, TSmartAccount>>[1]>) => Promise<Hash>;
|
|
277
278
|
/**
|
|
278
279
|
* Creates, signs, and sends a new transaction to the network.
|
|
279
280
|
* This function also allows you to sponsor this transaction if sender is a smartAccount
|
|
@@ -323,7 +324,7 @@ export type SmartAccountActions<TChain extends Chain | undefined = Chain | undef
|
|
|
323
324
|
* value: 10000000000000000n
|
|
324
325
|
* }])
|
|
325
326
|
*/
|
|
326
|
-
sendTransactions: (args: SendTransactionsWithPaymasterParameters<TSmartAccount
|
|
327
|
+
sendTransactions: (args: Prettify<SendTransactionsWithPaymasterParameters<TSmartAccount>>) => ReturnType<typeof sendTransactions<TChain, TSmartAccount>>;
|
|
327
328
|
};
|
|
328
|
-
export declare
|
|
329
|
+
export declare function smartAccountActions({ sponsorUserOperation }: SponsorUserOperationMiddleware): <TTransport extends Transport, TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined>(client: Client<TTransport, TChain, TSmartAccount>) => SmartAccountActions<TChain, TSmartAccount>;
|
|
329
330
|
//# sourceMappingURL=smartAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartAccount.d.ts","sourceRoot":"","sources":["../../../clients/decorators/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,SAAS,EACT,SAAS,EACT,uBAAuB,EAC1B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EACH,KAAK,uCAAuC,EAC5C,gBAAgB,EACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAEH,cAAc,EACjB,MAAM,8CAA8C,CAAA;AACrD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,2BAA2B,EAC9B,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAEH,eAAe,EAClB,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAEH,
|
|
1
|
+
{"version":3,"file":"smartAccount.d.ts","sourceRoot":"","sources":["../../../clients/decorators/smartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,IAAI,EACJ,yBAAyB,EACzB,SAAS,EACT,SAAS,EACT,uBAAuB,EAC1B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EACH,KAAK,uCAAuC,EAC5C,gBAAgB,EACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAEH,cAAc,EACjB,MAAM,8CAA8C,CAAA;AACrD,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,8BAA8B,EACnC,2BAA2B,EAC9B,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAEH,eAAe,EAClB,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAEH,iBAAiB,EACpB,MAAM,iDAAiD,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE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P,KACA,OAAO,CAAC,QAAQ,CAAC,qCAAqC,CAAC,CAAC,CAAA;IAC7D,iBAAiB,EAAE,CAAC,UAAU,SAAS,SAAS,EAC5C,IAAI,EAAE,QAAQ,CACV,UAAU,CACN,OAAO,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAC9D,CAAC,CAAC,CAAC,CACP,KACA,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,gBAAgB,EAAE,CACd,IAAI,EAAE,QAAQ,CAAC,uCAAuC,CAAC,aAAa,CAAC,CAAC,KACrE,UAAU,CAAC,OAAO,gBAAgB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;CAClE,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAChC,oBAAoB,EACvB,EAAE,8BAA8B,oQA2ChC"}
|
package/_types/utils/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { deepHexlify, transactionReceiptStatus } from "./deepHexlify.js";
|
|
|
3
3
|
import { getAction } from "./getAction.js";
|
|
4
4
|
import { type GetRequiredPrefundReturnType, getRequiredPrefund } from "./getRequiredPrefund.js";
|
|
5
5
|
import { type GetUserOperationHashParams, getUserOperationHash } from "./getUserOperationHash.js";
|
|
6
|
+
import { isSmartAccountDeployed } from "./isSmartAccountDeployed";
|
|
6
7
|
import { AccountOrClientNotFoundError, type SignUserOperationHashWithECDSAParams, signUserOperationHashWithECDSA } from "./signUserOperationHashWithECDSA.js";
|
|
7
8
|
import { walletClientToCustomSigner } from "./walletClientToCustomSigner.js";
|
|
8
9
|
export declare function parseAccount(account: Address | Account): Account;
|
|
9
|
-
export { transactionReceiptStatus, deepHexlify, getAction, getUserOperationHash, getRequiredPrefund, walletClientToCustomSigner, type GetRequiredPrefundReturnType, type GetUserOperationHashParams, signUserOperationHashWithECDSA, type SignUserOperationHashWithECDSAParams, AccountOrClientNotFoundError };
|
|
10
|
+
export { transactionReceiptStatus, deepHexlify, getAction, getUserOperationHash, getRequiredPrefund, walletClientToCustomSigner, type GetRequiredPrefundReturnType, type GetUserOperationHashParams, signUserOperationHashWithECDSA, type SignUserOperationHashWithECDSAParams, AccountOrClientNotFoundError, isSmartAccountDeployed };
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EACH,KAAK,4BAA4B,EACjC,kBAAkB,EACrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACH,KAAK,0BAA0B,EAC/B,oBAAoB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACH,4BAA4B,EAC5B,KAAK,oCAAoC,EACzC,8BAA8B,EACjC,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAE5E,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAIhE;AAED,OAAO,EACH,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,8BAA8B,EAC9B,KAAK,oCAAoC,EACzC,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EACH,KAAK,4BAA4B,EACjC,kBAAkB,EACrB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACH,KAAK,0BAA0B,EAC/B,oBAAoB,EACvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EACH,4BAA4B,EAC5B,KAAK,oCAAoC,EACzC,8BAA8B,EACjC,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAE5E,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAIhE;AAED,OAAO,EACH,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,8BAA8B,EAC9B,KAAK,oCAAoC,EACzC,4BAA4B,EAC5B,sBAAsB,EACzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSmartAccountDeployed.d.ts","sourceRoot":"","sources":["../../utils/isSmartAccountDeployed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAG3C,eAAO,MAAM,sBAAsB,WACvB,MAAM,WACL,OAAO,KACjB,QAAQ,OAAO,CASjB,CAAA"}
|
|
@@ -17,14 +17,10 @@ import {
|
|
|
17
17
|
parseAbiParameters
|
|
18
18
|
} from "viem"
|
|
19
19
|
import { toAccount } from "viem/accounts"
|
|
20
|
-
import {
|
|
21
|
-
getBytecode,
|
|
22
|
-
getChainId,
|
|
23
|
-
signMessage,
|
|
24
|
-
signTypedData
|
|
25
|
-
} from "viem/actions"
|
|
20
|
+
import { getChainId, signMessage, signTypedData } from "viem/actions"
|
|
26
21
|
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
|
|
27
22
|
import { getUserOperationHash } from "../../utils/getUserOperationHash.js"
|
|
23
|
+
import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed.js"
|
|
28
24
|
import {
|
|
29
25
|
SignTransactionNotSupportedBySmartAccount,
|
|
30
26
|
type SmartAccount,
|
|
@@ -207,6 +203,7 @@ export async function signerToBiconomySmartAccount<
|
|
|
207
203
|
client: Client<TTransport, TChain, undefined>,
|
|
208
204
|
{
|
|
209
205
|
signer,
|
|
206
|
+
address,
|
|
210
207
|
entryPoint,
|
|
211
208
|
index = 0n,
|
|
212
209
|
factoryAddress = BICONOMY_ADDRESSES.FACTORY_ADDRESS,
|
|
@@ -216,6 +213,7 @@ export async function signerToBiconomySmartAccount<
|
|
|
216
213
|
}: {
|
|
217
214
|
signer: SmartAccountSigner<TSource, TAddress>
|
|
218
215
|
entryPoint: Address
|
|
216
|
+
address?: Address
|
|
219
217
|
index?: bigint
|
|
220
218
|
factoryAddress?: Address
|
|
221
219
|
accountLogicAddress?: Address
|
|
@@ -242,19 +240,25 @@ export async function signerToBiconomySmartAccount<
|
|
|
242
240
|
|
|
243
241
|
// Fetch account address and chain id
|
|
244
242
|
const [accountAddress, chainId] = await Promise.all([
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
243
|
+
address ??
|
|
244
|
+
getAccountAddress({
|
|
245
|
+
owner: viemSigner.address,
|
|
246
|
+
ecdsaModuleAddress,
|
|
247
|
+
factoryAddress,
|
|
248
|
+
accountLogicAddress,
|
|
249
|
+
fallbackHandlerAddress,
|
|
250
|
+
index
|
|
251
|
+
}),
|
|
253
252
|
getChainId(client)
|
|
254
253
|
])
|
|
255
254
|
|
|
256
255
|
if (!accountAddress) throw new Error("Account address not found")
|
|
257
256
|
|
|
257
|
+
let smartAccountDeployed = await isSmartAccountDeployed(
|
|
258
|
+
client,
|
|
259
|
+
accountAddress
|
|
260
|
+
)
|
|
261
|
+
|
|
258
262
|
// Build the EOA Signer
|
|
259
263
|
const account = toAccount({
|
|
260
264
|
address: accountAddress,
|
|
@@ -319,11 +323,14 @@ export async function signerToBiconomySmartAccount<
|
|
|
319
323
|
|
|
320
324
|
// Encode the init code
|
|
321
325
|
async getInitCode() {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
326
|
+
if (smartAccountDeployed) return "0x"
|
|
327
|
+
|
|
328
|
+
smartAccountDeployed = await isSmartAccountDeployed(
|
|
329
|
+
client,
|
|
330
|
+
accountAddress
|
|
331
|
+
)
|
|
325
332
|
|
|
326
|
-
if (
|
|
333
|
+
if (smartAccountDeployed) return "0x"
|
|
327
334
|
|
|
328
335
|
return generateInitCode()
|
|
329
336
|
},
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
} from "viem"
|
|
14
14
|
import { toAccount } from "viem/accounts"
|
|
15
15
|
import {
|
|
16
|
-
getBytecode,
|
|
17
16
|
getChainId,
|
|
18
17
|
readContract,
|
|
19
18
|
signMessage,
|
|
@@ -22,6 +21,7 @@ import {
|
|
|
22
21
|
import { getAccountNonce } from "../../actions/public/getAccountNonce.js"
|
|
23
22
|
import { getSenderAddress } from "../../actions/public/getSenderAddress.js"
|
|
24
23
|
import { getUserOperationHash } from "../../utils/getUserOperationHash.js"
|
|
24
|
+
import { isSmartAccountDeployed } from "../../utils/isSmartAccountDeployed.js"
|
|
25
25
|
import type { SmartAccount } from "../types.js"
|
|
26
26
|
import {
|
|
27
27
|
SignTransactionNotSupportedBySmartAccount,
|
|
@@ -219,6 +219,7 @@ export async function signerToEcdsaKernelSmartAccount<
|
|
|
219
219
|
client: Client<TTransport, TChain, undefined>,
|
|
220
220
|
{
|
|
221
221
|
signer,
|
|
222
|
+
address,
|
|
222
223
|
entryPoint,
|
|
223
224
|
index = 0n,
|
|
224
225
|
factoryAddress = KERNEL_ADDRESSES.FACTORY_ADDRESS,
|
|
@@ -228,6 +229,7 @@ export async function signerToEcdsaKernelSmartAccount<
|
|
|
228
229
|
}: {
|
|
229
230
|
signer: SmartAccountSigner<TSource, TAddress>
|
|
230
231
|
entryPoint: Address
|
|
232
|
+
address?: Address
|
|
231
233
|
index?: bigint
|
|
232
234
|
factoryAddress?: Address
|
|
233
235
|
accountLogicAddress?: Address
|
|
@@ -255,19 +257,25 @@ export async function signerToEcdsaKernelSmartAccount<
|
|
|
255
257
|
|
|
256
258
|
// Fetch account address and chain id
|
|
257
259
|
const [accountAddress, chainId] = await Promise.all([
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
260
|
+
address ??
|
|
261
|
+
getAccountAddress<TTransport, TChain>({
|
|
262
|
+
client,
|
|
263
|
+
entryPoint,
|
|
264
|
+
owner: viemSigner.address,
|
|
265
|
+
ecdsaValidatorAddress,
|
|
266
|
+
initCodeProvider: generateInitCode,
|
|
267
|
+
deployedAccountAddress
|
|
268
|
+
}),
|
|
266
269
|
getChainId(client)
|
|
267
270
|
])
|
|
268
271
|
|
|
269
272
|
if (!accountAddress) throw new Error("Account address not found")
|
|
270
273
|
|
|
274
|
+
let smartAccountDeployed = await isSmartAccountDeployed(
|
|
275
|
+
client,
|
|
276
|
+
accountAddress
|
|
277
|
+
)
|
|
278
|
+
|
|
271
279
|
// Build the EOA Signer
|
|
272
280
|
const account = toAccount({
|
|
273
281
|
address: accountAddress,
|
|
@@ -328,11 +336,14 @@ export async function signerToEcdsaKernelSmartAccount<
|
|
|
328
336
|
|
|
329
337
|
// Encode the init code
|
|
330
338
|
async getInitCode() {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
339
|
+
if (smartAccountDeployed) return "0x"
|
|
340
|
+
|
|
341
|
+
smartAccountDeployed = await isSmartAccountDeployed(
|
|
342
|
+
client,
|
|
343
|
+
accountAddress
|
|
344
|
+
)
|
|
334
345
|
|
|
335
|
-
if (
|
|
346
|
+
if (smartAccountDeployed) return "0x"
|
|
336
347
|
|
|
337
348
|
return generateInitCode()
|
|
338
349
|
},
|
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
} from "viem"
|
|
23
23
|
import { toAccount } from "viem/accounts"
|
|
24
24
|
import {
|
|
25
|
-
getBytecode,
|
|
26
25
|
getChainId,
|
|
27
26
|
readContract,
|
|
28
27
|
signMessage,
|
|
29
28
|
signTypedData
|
|
30
29
|
} from "viem/actions"
|
|
31
30
|
import { getAccountNonce } from "../actions/public/getAccountNonce.js"
|
|
31
|
+
import { isSmartAccountDeployed } from "../utils/isSmartAccountDeployed.js"
|
|
32
32
|
import {
|
|
33
33
|
SignTransactionNotSupportedBySmartAccount,
|
|
34
34
|
type SmartAccount,
|
|
@@ -502,6 +502,7 @@ export async function signerToSafeSmartAccount<
|
|
|
502
502
|
client: Client<TTransport, TChain>,
|
|
503
503
|
{
|
|
504
504
|
signer,
|
|
505
|
+
address,
|
|
505
506
|
safeVersion,
|
|
506
507
|
entryPoint,
|
|
507
508
|
addModuleLibAddress: _addModuleLibAddress,
|
|
@@ -516,9 +517,10 @@ export async function signerToSafeSmartAccount<
|
|
|
516
517
|
safeModules = [],
|
|
517
518
|
setupTransactions = []
|
|
518
519
|
}: {
|
|
519
|
-
safeVersion: SafeVersion
|
|
520
520
|
signer: SmartAccountSigner<TSource, TAddress>
|
|
521
|
+
safeVersion: SafeVersion
|
|
521
522
|
entryPoint: Address
|
|
523
|
+
address?: Address
|
|
522
524
|
addModuleLibAddress?: Address
|
|
523
525
|
safe4337ModuleAddress?: Address
|
|
524
526
|
safeProxyFactoryAddress?: Address
|
|
@@ -561,21 +563,25 @@ export async function signerToSafeSmartAccount<
|
|
|
561
563
|
multiSendCallOnlyAddress: _multiSendCallOnlyAddress
|
|
562
564
|
})
|
|
563
565
|
|
|
564
|
-
const accountAddress =
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
566
|
+
const accountAddress =
|
|
567
|
+
address ??
|
|
568
|
+
(await getAccountAddress<TTransport, TChain>({
|
|
569
|
+
client,
|
|
570
|
+
owner: viemSigner.address,
|
|
571
|
+
addModuleLibAddress,
|
|
572
|
+
safe4337ModuleAddress,
|
|
573
|
+
safeProxyFactoryAddress,
|
|
574
|
+
safeSingletonAddress,
|
|
575
|
+
multiSendAddress,
|
|
576
|
+
saltNonce,
|
|
577
|
+
setupTransactions,
|
|
578
|
+
safeModules
|
|
579
|
+
}))
|
|
576
580
|
|
|
577
581
|
if (!accountAddress) throw new Error("Account address not found")
|
|
578
582
|
|
|
583
|
+
let safeDeployed = await isSmartAccountDeployed(client, accountAddress)
|
|
584
|
+
|
|
579
585
|
const account = toAccount({
|
|
580
586
|
address: accountAddress,
|
|
581
587
|
async signMessage({ message }) {
|
|
@@ -695,11 +701,11 @@ export async function signerToSafeSmartAccount<
|
|
|
695
701
|
)
|
|
696
702
|
},
|
|
697
703
|
async getInitCode() {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
704
|
+
if (safeDeployed) return "0x"
|
|
705
|
+
|
|
706
|
+
safeDeployed = await isSmartAccountDeployed(client, accountAddress)
|
|
701
707
|
|
|
702
|
-
if (
|
|
708
|
+
if (safeDeployed) return "0x"
|
|
703
709
|
|
|
704
710
|
return getAccountInitCode({
|
|
705
711
|
owner: viemSigner.address,
|
|
@@ -11,15 +11,11 @@ import {
|
|
|
11
11
|
encodeFunctionData
|
|
12
12
|
} from "viem"
|
|
13
13
|
import { toAccount } from "viem/accounts"
|
|
14
|
-
import {
|
|
15
|
-
getBytecode,
|
|
16
|
-
getChainId,
|
|
17
|
-
signMessage,
|
|
18
|
-
signTypedData
|
|
19
|
-
} from "viem/actions"
|
|
14
|
+
import { getChainId, signMessage, signTypedData } from "viem/actions"
|
|
20
15
|
import { getAccountNonce } from "../actions/public/getAccountNonce.js"
|
|
21
16
|
import { getSenderAddress } from "../actions/public/getSenderAddress.js"
|
|
22
17
|
import { getUserOperationHash } from "../utils/getUserOperationHash.js"
|
|
18
|
+
import { isSmartAccountDeployed } from "../utils/isSmartAccountDeployed.js"
|
|
23
19
|
import {
|
|
24
20
|
SignTransactionNotSupportedBySmartAccount,
|
|
25
21
|
type SmartAccount,
|
|
@@ -113,12 +109,14 @@ export async function signerToSimpleSmartAccount<
|
|
|
113
109
|
signer,
|
|
114
110
|
factoryAddress,
|
|
115
111
|
entryPoint,
|
|
116
|
-
index = 0n
|
|
112
|
+
index = 0n,
|
|
113
|
+
address
|
|
117
114
|
}: {
|
|
118
115
|
signer: SmartAccountSigner<TSource, TAddress>
|
|
119
116
|
factoryAddress: Address
|
|
120
117
|
entryPoint: Address
|
|
121
118
|
index?: bigint
|
|
119
|
+
address?: Address
|
|
122
120
|
}
|
|
123
121
|
): Promise<SimpleSmartAccount<TTransport, TChain>> {
|
|
124
122
|
const viemSigner: LocalAccount = {
|
|
@@ -129,18 +127,24 @@ export async function signerToSimpleSmartAccount<
|
|
|
129
127
|
} as LocalAccount
|
|
130
128
|
|
|
131
129
|
const [accountAddress, chainId] = await Promise.all([
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
address ??
|
|
131
|
+
getAccountAddress<TTransport, TChain>({
|
|
132
|
+
client,
|
|
133
|
+
factoryAddress,
|
|
134
|
+
entryPoint,
|
|
135
|
+
owner: viemSigner.address,
|
|
136
|
+
index
|
|
137
|
+
}),
|
|
139
138
|
getChainId(client)
|
|
140
139
|
])
|
|
141
140
|
|
|
142
141
|
if (!accountAddress) throw new Error("Account address not found")
|
|
143
142
|
|
|
143
|
+
let smartAccountDeployed = await isSmartAccountDeployed(
|
|
144
|
+
client,
|
|
145
|
+
accountAddress
|
|
146
|
+
)
|
|
147
|
+
|
|
144
148
|
const account = toAccount({
|
|
145
149
|
address: accountAddress,
|
|
146
150
|
async signMessage({ message }) {
|
|
@@ -189,11 +193,14 @@ export async function signerToSimpleSmartAccount<
|
|
|
189
193
|
})
|
|
190
194
|
},
|
|
191
195
|
async getInitCode() {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
196
|
+
if (smartAccountDeployed) return "0x"
|
|
197
|
+
|
|
198
|
+
smartAccountDeployed = await isSmartAccountDeployed(
|
|
199
|
+
client,
|
|
200
|
+
accountAddress
|
|
201
|
+
)
|
|
195
202
|
|
|
196
|
-
if (
|
|
203
|
+
if (smartAccountDeployed) return "0x"
|
|
197
204
|
|
|
198
205
|
return getAccountInitCode(factoryAddress, viemSigner.address, index)
|
|
199
206
|
},
|
package/accounts/types.ts
CHANGED
|
@@ -28,7 +28,8 @@ export class SignTransactionNotSupportedBySmartAccount extends BaseError {
|
|
|
28
28
|
export type SmartAccount<
|
|
29
29
|
Name extends string = string,
|
|
30
30
|
transport extends Transport = Transport,
|
|
31
|
-
chain extends Chain | undefined = Chain | undefined
|
|
31
|
+
chain extends Chain | undefined = Chain | undefined,
|
|
32
|
+
TAbi extends Abi | readonly unknown[] = Abi
|
|
32
33
|
> = LocalAccount<Name> & {
|
|
33
34
|
client: Client<transport, chain>
|
|
34
35
|
entryPoint: Address
|
|
@@ -48,7 +49,7 @@ export type SmartAccount<
|
|
|
48
49
|
}[]
|
|
49
50
|
) => Promise<Hex>
|
|
50
51
|
getDummySignature(userOperation: UserOperation): Promise<Hex>
|
|
51
|
-
encodeDeployCallData:
|
|
52
|
+
encodeDeployCallData: ({
|
|
52
53
|
abi,
|
|
53
54
|
args,
|
|
54
55
|
bytecode
|
|
@@ -57,6 +58,6 @@ export type SmartAccount<
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
export type SmartAccountSigner<
|
|
60
|
-
TSource extends string,
|
|
61
|
+
TSource extends string = string,
|
|
61
62
|
TAddress extends Address = Address
|
|
62
63
|
> = Omit<LocalAccount<TSource, TAddress>, "signTransaction">
|
|
@@ -2,6 +2,7 @@ import type { Account, Address, Chain, Client, Transport } from "viem"
|
|
|
2
2
|
import type { PartialBy } from "viem/types/utils"
|
|
3
3
|
import type { BundlerClient } from "../../clients/createBundlerClient.js"
|
|
4
4
|
import type { BundlerRpcSchema } from "../../types/bundler.js"
|
|
5
|
+
import type { Prettify } from "../../types/index.js"
|
|
5
6
|
import type { UserOperation } from "../../types/userOperation.js"
|
|
6
7
|
import type { UserOperationWithBigIntAsHex } from "../../types/userOperation.js"
|
|
7
8
|
import { deepHexlify } from "../../utils/deepHexlify.js"
|
|
@@ -53,8 +54,8 @@ export const estimateUserOperationGas = async <
|
|
|
53
54
|
TAccount extends Account | undefined = Account | undefined
|
|
54
55
|
>(
|
|
55
56
|
client: Client<TTransport, TChain, TAccount, BundlerRpcSchema>,
|
|
56
|
-
args: EstimateUserOperationGasParameters
|
|
57
|
-
): Promise<EstimateUserOperationGasReturnType
|
|
57
|
+
args: Prettify<EstimateUserOperationGasParameters>
|
|
58
|
+
): Promise<Prettify<EstimateUserOperationGasReturnType>> => {
|
|
58
59
|
const { userOperation, entryPoint } = args
|
|
59
60
|
|
|
60
61
|
const response = await client.request({
|