permissionless 0.0.6 → 0.0.8
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 +13 -0
- package/_cjs/actions/bundler/chainId.js +11 -0
- package/_cjs/actions/bundler/chainId.js.map +1 -0
- package/_cjs/actions/bundler/estimateUserOperationGas.js +18 -0
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/_cjs/actions/bundler/getUserOperationByHash.js +30 -0
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -0
- package/_cjs/actions/bundler/getUserOperationReceipt.js +48 -0
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/_cjs/actions/bundler/sendUserOperation.js +13 -0
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -0
- package/_cjs/actions/bundler/supportedEntryPoints.js +11 -0
- package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -0
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js +46 -0
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/_cjs/actions/index.js +22 -12
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js +25 -0
- package/_cjs/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
- package/_cjs/actions/pimlico/getUserOperationStatus.js +11 -0
- package/_cjs/actions/pimlico/getUserOperationStatus.js.map +1 -0
- package/_cjs/actions/pimlico/sponsorUserOperation.js +18 -0
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -0
- package/_cjs/actions/pimlico.js +10 -52
- package/_cjs/actions/pimlico.js.map +1 -1
- package/_cjs/actions/public/getAccountNonce.js +35 -0
- package/_cjs/actions/public/getAccountNonce.js.map +1 -0
- package/_cjs/actions/{public.js → public/getSenderAddress.js} +2 -33
- package/_cjs/actions/public/getSenderAddress.js.map +1 -0
- package/_cjs/actions/stackup/accounts.js +12 -0
- package/_cjs/actions/stackup/accounts.js.map +1 -0
- package/_cjs/actions/stackup/sponsorUserOperation.js +18 -0
- package/_cjs/actions/stackup/sponsorUserOperation.js.map +1 -0
- package/_cjs/actions/stackup.js +10 -0
- package/_cjs/actions/stackup.js.map +1 -0
- package/_cjs/clients/bundler.js +2 -2
- package/_cjs/clients/bundler.js.map +1 -1
- package/_cjs/clients/decorators/bundler.js +21 -0
- package/_cjs/clients/decorators/bundler.js.map +1 -0
- package/_cjs/clients/decorators/pimlico.js +16 -0
- package/_cjs/clients/decorators/pimlico.js.map +1 -0
- package/_cjs/clients/decorators/stackup.js +11 -0
- package/_cjs/clients/decorators/stackup.js.map +1 -0
- package/_cjs/clients/pimlico.js +4 -4
- package/_cjs/clients/pimlico.js.map +1 -1
- package/_cjs/clients/stackup.js +18 -0
- package/_cjs/clients/stackup.js.map +1 -0
- package/_cjs/index.js +28 -4
- package/_cjs/index.js.map +1 -1
- package/_cjs/types/stackup.js +3 -0
- package/_cjs/types/stackup.js.map +1 -0
- package/_cjs/{actions/utils.js → utils/deepHexlify.js} +1 -1
- package/_cjs/utils/deepHexlify.js.map +1 -0
- package/_cjs/utils/getUserOperationHash.js +38 -0
- package/_cjs/utils/getUserOperationHash.js.map +1 -0
- package/_cjs/utils/index.js +2 -34
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/observe.js +39 -0
- package/_cjs/utils/observe.js.map +1 -0
- package/_esm/actions/bundler/chainId.js +29 -0
- package/_esm/actions/bundler/chainId.js.map +1 -0
- package/_esm/actions/bundler/estimateUserOperationGas.js +41 -0
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -0
- package/_esm/actions/bundler/getUserOperationByHash.js +48 -0
- package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -0
- package/_esm/actions/bundler/getUserOperationReceipt.js +66 -0
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -0
- package/_esm/actions/bundler/sendUserOperation.js +36 -0
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -0
- package/_esm/actions/bundler/supportedEntryPoints.js +29 -0
- package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -0
- package/_esm/actions/bundler/waitForUserOperationReceipt.js +63 -0
- package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -0
- package/_esm/actions/index.js +11 -3
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationGasPrice.js +42 -0
- package/_esm/actions/pimlico/getUserOperationGasPrice.js.map +1 -0
- package/_esm/actions/pimlico/getUserOperationStatus.js +29 -0
- package/_esm/actions/pimlico/getUserOperationStatus.js.map +1 -0
- package/_esm/actions/pimlico/sponsorUserOperation.js +39 -0
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -0
- package/_esm/actions/pimlico.js +5 -123
- package/_esm/actions/pimlico.js.map +1 -1
- package/_esm/actions/public/getAccountNonce.js +57 -0
- package/_esm/actions/public/getAccountNonce.js.map +1 -0
- package/_esm/actions/{public.js → public/getSenderAddress.js} +1 -57
- package/_esm/actions/public/getSenderAddress.js.map +1 -0
- package/_esm/actions/stackup/accounts.js +30 -0
- package/_esm/actions/stackup/accounts.js.map +1 -0
- package/_esm/actions/stackup/sponsorUserOperation.js +40 -0
- package/_esm/actions/stackup/sponsorUserOperation.js.map +1 -0
- package/_esm/actions/stackup.js +5 -0
- package/_esm/actions/stackup.js.map +1 -0
- package/_esm/clients/bundler.js +1 -1
- package/_esm/clients/bundler.js.map +1 -1
- package/_esm/clients/decorators/bundler.js +18 -0
- package/_esm/clients/decorators/bundler.js.map +1 -0
- package/_esm/clients/decorators/pimlico.js +20 -0
- package/_esm/clients/decorators/pimlico.js.map +1 -0
- package/_esm/clients/decorators/stackup.js +8 -0
- package/_esm/clients/decorators/stackup.js.map +1 -0
- package/_esm/clients/pimlico.js +2 -2
- package/_esm/clients/pimlico.js.map +1 -1
- package/_esm/clients/stackup.js +33 -0
- package/_esm/clients/stackup.js.map +1 -0
- package/_esm/index.js +17 -4
- package/_esm/index.js.map +1 -1
- package/_esm/types/stackup.js +2 -0
- package/_esm/types/stackup.js.map +1 -0
- package/_esm/{actions/utils.js → utils/deepHexlify.js} +1 -1
- package/_esm/utils/deepHexlify.js.map +1 -0
- package/_esm/utils/getUserOperationHash.js +55 -0
- package/_esm/utils/getUserOperationHash.js.map +1 -0
- package/_esm/utils/index.js +1 -54
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/observe.js +42 -0
- package/_esm/utils/observe.js.map +1 -0
- package/_types/actions/bundler/chainId.d.ts +25 -0
- package/_types/actions/bundler/chainId.d.ts.map +1 -0
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +42 -0
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -0
- package/_types/actions/bundler/getUserOperationByHash.d.ts +37 -0
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -0
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +62 -0
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -0
- package/_types/actions/bundler/sendUserOperation.d.ts +36 -0
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -0
- package/_types/actions/bundler/supportedEntryPoints.d.ts +26 -0
- package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -0
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +43 -0
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -0
- package/_types/actions/index.d.ts +19 -6
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +38 -0
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts.map +1 -0
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +31 -0
- package/_types/actions/pimlico/getUserOperationStatus.d.ts.map +1 -0
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +41 -0
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -0
- package/_types/actions/pimlico.d.ts +7 -177
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/actions/public/getAccountNonce.d.ts +34 -0
- package/_types/actions/public/getAccountNonce.d.ts.map +1 -0
- package/_types/actions/{public.d.ts → public/getSenderAddress.d.ts} +2 -35
- package/_types/actions/public/getSenderAddress.d.ts.map +1 -0
- package/_types/actions/stackup/accounts.d.ts +29 -0
- package/_types/actions/stackup/accounts.d.ts.map +1 -0
- package/_types/actions/stackup/sponsorUserOperation.d.ts +43 -0
- package/_types/actions/stackup/sponsorUserOperation.d.ts.map +1 -0
- package/_types/actions/stackup.d.ts +7 -0
- package/_types/actions/stackup.d.ts.map +1 -0
- package/_types/clients/bundler.d.ts +3 -3
- package/_types/clients/bundler.d.ts.map +1 -1
- package/_types/clients/decorators/bundler.d.ts +173 -0
- package/_types/clients/decorators/bundler.d.ts.map +1 -0
- package/_types/clients/decorators/pimlico.d.ts +78 -0
- package/_types/clients/decorators/pimlico.d.ts.map +1 -0
- package/_types/clients/decorators/stackup.d.ts +54 -0
- package/_types/clients/decorators/stackup.d.ts.map +1 -0
- package/_types/clients/pimlico.d.ts +3 -3
- package/_types/clients/pimlico.d.ts.map +1 -1
- package/_types/clients/stackup.d.ts +39 -0
- package/_types/clients/stackup.d.ts.map +1 -0
- package/_types/index.d.ts +28 -4
- package/_types/index.d.ts.map +1 -1
- package/_types/types/bundler.d.ts +1 -1
- package/_types/types/bundler.d.ts.map +1 -1
- package/_types/types/index.d.ts +1 -1
- package/_types/types/index.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +1 -1
- package/_types/types/pimlico.d.ts.map +1 -1
- package/_types/types/stackup.d.ts +35 -0
- package/_types/types/stackup.d.ts.map +1 -0
- package/_types/{actions/utils.d.ts → utils/deepHexlify.d.ts} +1 -1
- package/_types/utils/deepHexlify.d.ts.map +1 -0
- package/_types/utils/getUserOperationHash.d.ts +30 -0
- package/_types/utils/getUserOperationHash.d.ts.map +1 -0
- package/_types/utils/index.d.ts +2 -30
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/observe.d.ts +17 -0
- package/_types/utils/observe.d.ts.map +1 -0
- package/actions/bundler/chainId.ts +32 -0
- package/actions/bundler/estimateUserOperationGas.ts +62 -0
- package/actions/bundler/getUserOperationByHash.ts +69 -0
- package/actions/bundler/getUserOperationReceipt.ts +112 -0
- package/actions/bundler/sendUserOperation.ts +45 -0
- package/actions/bundler/supportedEntryPoints.ts +31 -0
- package/actions/bundler/waitForUserOperationReceipt.ts +80 -0
- package/actions/index.ts +30 -21
- package/actions/pimlico/getUserOperationGasPrice.ts +61 -0
- package/actions/pimlico/getUserOperationStatus.ts +41 -0
- package/actions/pimlico/sponsorUserOperation.ts +62 -0
- package/actions/pimlico.ts +34 -251
- package/actions/public/getAccountNonce.ts +63 -0
- package/actions/{public.ts → public/getSenderAddress.ts} +7 -68
- package/actions/stackup/accounts.ts +40 -0
- package/actions/stackup/sponsorUserOperation.ts +64 -0
- package/actions/stackup.ts +17 -0
- package/clients/bundler.ts +9 -4
- package/clients/decorators/bundler.ts +211 -0
- package/clients/decorators/pimlico.ts +107 -0
- package/clients/decorators/stackup.ts +65 -0
- package/clients/pimlico.ts +3 -4
- package/clients/stackup.ts +44 -0
- package/index.ts +70 -4
- package/package.json +11 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/bundler.ts +1 -1
- package/types/index.ts +1 -1
- package/types/pimlico.ts +1 -1
- package/types/stackup.ts +36 -0
- package/utils/getUserOperationHash.ts +68 -0
- package/utils/index.ts +2 -69
- package/utils/observe.ts +61 -0
- package/_cjs/actions/bundler.js +0 -118
- package/_cjs/actions/bundler.js.map +0 -1
- package/_cjs/actions/public.js.map +0 -1
- package/_cjs/actions/utils.js.map +0 -1
- package/_cjs/clients/index.js +0 -6
- package/_cjs/clients/index.js.map +0 -1
- package/_esm/actions/bundler.js +0 -251
- package/_esm/actions/bundler.js.map +0 -1
- package/_esm/actions/public.js.map +0 -1
- package/_esm/actions/utils.js.map +0 -1
- package/_esm/clients/index.js +0 -3
- package/_esm/clients/index.js.map +0 -1
- package/_types/actions/bundler.d.ts +0 -393
- package/_types/actions/bundler.d.ts.map +0 -1
- package/_types/actions/public.d.ts.map +0 -1
- package/_types/actions/utils.d.ts.map +0 -1
- package/_types/clients/index.d.ts +0 -3
- package/_types/clients/index.d.ts.map +0 -1
- package/actions/bundler.ts +0 -498
- package/clients/index.ts +0 -3
- /package/{actions/utils.ts → utils/deepHexlify.ts} +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { Address } from "abitype";
|
|
2
|
+
import type { Client, Hash } from "viem";
|
|
3
|
+
import { type EstimateUserOperationGasParameters, type EstimateUserOperationGasReturnType } from "../../actions/bundler/estimateUserOperationGas.js";
|
|
4
|
+
import { type GetUserOperationByHashParameters, type GetUserOperationByHashReturnType } from "../../actions/bundler/getUserOperationByHash.js";
|
|
5
|
+
import { type GetUserOperationReceiptParameters, type GetUserOperationReceiptReturnType } from "../../actions/bundler/getUserOperationReceipt.js";
|
|
6
|
+
import { type SendUserOperationParameters } from "../../actions/bundler/sendUserOperation.js";
|
|
7
|
+
import { type WaitForUserOperationReceiptParameters } from "../../actions/bundler/waitForUserOperationReceipt.js";
|
|
8
|
+
export type BundlerActions = {
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* Sends user operation to the bundler
|
|
12
|
+
*
|
|
13
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/sendUserOperation
|
|
14
|
+
*
|
|
15
|
+
* @param args {@link SendUserOperationParameters}.
|
|
16
|
+
* @returns UserOpHash that you can use to track user operation as {@link Hash}.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { createClient } from "viem"
|
|
20
|
+
* import { bundlerActions } from "permissionless"
|
|
21
|
+
*
|
|
22
|
+
* const bundlerClient = createClient({
|
|
23
|
+
* chain: goerli,
|
|
24
|
+
* transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
25
|
+
* }).extend(bundlerActions)
|
|
26
|
+
*
|
|
27
|
+
* const userOpHash = await bundlerClient.sendUserOperation({
|
|
28
|
+
* userOperation: signedUserOperation,
|
|
29
|
+
* entryPoint: entryPoint
|
|
30
|
+
* })
|
|
31
|
+
*
|
|
32
|
+
* // Return '0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34'
|
|
33
|
+
*/
|
|
34
|
+
sendUserOperation: (args: SendUserOperationParameters) => Promise<Hash>;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* Estimates preVerificationGas, verificationGasLimit and callGasLimit for user operation
|
|
38
|
+
*
|
|
39
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/estimateUserOperationGas
|
|
40
|
+
*
|
|
41
|
+
* @param args {@link EstimateUserOperationGasParameters}
|
|
42
|
+
* @returns preVerificationGas, verificationGasLimit and callGasLimit as {@link EstimateUserOperationGasReturnType}
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* import { createClient } from "viem"
|
|
46
|
+
* import { bundlerActions } from "permissionless"
|
|
47
|
+
*
|
|
48
|
+
* const bundlerClient = createClient({
|
|
49
|
+
* chain: goerli,
|
|
50
|
+
* transport: http(BUNDLER_URL)
|
|
51
|
+
* }).extend(bundlerActions)
|
|
52
|
+
*
|
|
53
|
+
* const gasParameters = await bundlerClient.estimateUserOperationGas({
|
|
54
|
+
* userOperation: signedUserOperation,
|
|
55
|
+
* entryPoint: entryPoint
|
|
56
|
+
* })
|
|
57
|
+
*
|
|
58
|
+
* // Return {preVerificationGas: 43492n, verificationGasLimit: 59436n, callGasLimit: 9000n}
|
|
59
|
+
*/
|
|
60
|
+
estimateUserOperationGas: (args: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* Returns the supported entrypoints by the bundler service
|
|
64
|
+
*
|
|
65
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/supportedEntryPoints
|
|
66
|
+
*
|
|
67
|
+
* @returns Supported entryPoints
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* import { createClient } from "viem"
|
|
71
|
+
* import { bundlerActions } from "permissionless"
|
|
72
|
+
*
|
|
73
|
+
* const bundlerClient = createClient({
|
|
74
|
+
* chain: goerli,
|
|
75
|
+
* transport: http(BUNDLER_URL)
|
|
76
|
+
* }).extend(bundlerActions)
|
|
77
|
+
*
|
|
78
|
+
* const supportedEntryPoints = await bundlerClient.supportedEntryPoints()
|
|
79
|
+
*
|
|
80
|
+
* // Return ['0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789']
|
|
81
|
+
*/
|
|
82
|
+
supportedEntryPoints: () => Promise<Address[]>;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* Returns the supported chain id by the bundler service
|
|
86
|
+
*
|
|
87
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/chainId
|
|
88
|
+
*
|
|
89
|
+
* @returns Supported chain id
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* import { createClient } from "viem"
|
|
93
|
+
* import { bundlerActions } from "permissionless"
|
|
94
|
+
*
|
|
95
|
+
* const bundlerClient = createClient({
|
|
96
|
+
* chain: goerli,
|
|
97
|
+
* transport: http(BUNDLER_URL)
|
|
98
|
+
* }).extend(bundlerActions)
|
|
99
|
+
*
|
|
100
|
+
* const chainId = await bundlerClient.chainId()
|
|
101
|
+
* // Return 5n for Goerli
|
|
102
|
+
*/
|
|
103
|
+
chainId: () => Promise<number>;
|
|
104
|
+
/**
|
|
105
|
+
*
|
|
106
|
+
* Returns the user operation from userOpHash
|
|
107
|
+
*
|
|
108
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationByHash
|
|
109
|
+
*
|
|
110
|
+
* @param args {@link GetUserOperationByHash} UserOpHash that was returned by {@link sendUserOperation}
|
|
111
|
+
* @returns userOperation along with entryPoint, transactionHash, blockHash, blockNumber if found or null
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* import { createClient } from "viem"
|
|
115
|
+
* import { bundlerActions } from "permissionless"
|
|
116
|
+
*
|
|
117
|
+
* const bundlerClient = createClient({
|
|
118
|
+
* chain: goerli,
|
|
119
|
+
* transport: http(BUNDLER_URL)
|
|
120
|
+
* }).extend(bundlerActions)
|
|
121
|
+
*
|
|
122
|
+
* await bundlerClient.getUserOperationByHash(userOpHash)
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
125
|
+
getUserOperationByHash: (args: GetUserOperationByHashParameters) => Promise<GetUserOperationByHashReturnType>;
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
* Returns the user operation receipt from userOpHash
|
|
129
|
+
*
|
|
130
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/getUserOperationReceipt
|
|
131
|
+
*
|
|
132
|
+
* @param args {@link GetUserOperationReceiptParameters} UserOpHash that was returned by {@link sendUserOperation}
|
|
133
|
+
* @returns user operation receipt {@link GetUserOperationReceiptReturnType} if found or null
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* import { createClient } from "viem"
|
|
137
|
+
* import { bundlerActions } from "permissionless"
|
|
138
|
+
*
|
|
139
|
+
* const bundlerClient = createClient({
|
|
140
|
+
* chain: goerli,
|
|
141
|
+
* transport: http(BUNDLER_URL)
|
|
142
|
+
* }).extend(bundlerActions)
|
|
143
|
+
*
|
|
144
|
+
* await bundlerClient.getUserOperationReceipt({hash: userOpHash})
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
getUserOperationReceipt: (args: GetUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType | null>;
|
|
148
|
+
/**
|
|
149
|
+
* 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
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/bundler-actions/waitForUserOperationReceipt
|
|
152
|
+
*
|
|
153
|
+
* @param client - Bundler Client to use
|
|
154
|
+
* @param parameters - {@link WaitForUserOperationReceiptParameters}
|
|
155
|
+
* @returns The transaction receipt. {@link GetUserOperationReceiptReturnType}
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* import { createBundlerClient, waitForUserOperationReceipt, http } from 'viem'
|
|
159
|
+
* import { mainnet } from 'viem/chains'
|
|
160
|
+
*
|
|
161
|
+
* const bundlerClient = createBundlerClient({
|
|
162
|
+
* chain: mainnet,
|
|
163
|
+
* transport: http(),
|
|
164
|
+
* })
|
|
165
|
+
* const userOperationReceipt = await bundlerClient.waitForUserOperationReceipt({
|
|
166
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
|
167
|
+
* })
|
|
168
|
+
*/
|
|
169
|
+
waitForUserOperationReceipt: (args: WaitForUserOperationReceiptParameters) => Promise<GetUserOperationReceiptReturnType>;
|
|
170
|
+
};
|
|
171
|
+
declare const bundlerActions: (client: Client) => BundlerActions;
|
|
172
|
+
export { bundlerActions };
|
|
173
|
+
//# sourceMappingURL=bundler.d.ts.map
|
|
@@ -0,0 +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,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,iCAAiC,EACtC,KAAK,iCAAiC,EAEzC,MAAM,kDAAkD,CAAA;AACzD,OAAO,EAAE,KAAK,2BAA2B,EAAqB,MAAM,4CAA4C,CAAA;AAEhH,OAAO,EACH,KAAK,qCAAqC,EAE7C,MAAM,sDAAsD,CAAA;AAG7D,MAAM,MAAM,cAAc,GAAG;IACzB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,iBAAiB,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACvE;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,wBAAwB,EAAE,CAAC,IAAI,EAAE,kCAAkC,KAAK,OAAO,CAAC,kCAAkC,CAAC,CAAA;IACnH;;;;;;;;;;;;;;;;;;;;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,CAAC,IAAI,EAAE,gCAAgC,KAAK,OAAO,CAAC,gCAAgC,CAAC,CAAA;IAC7G;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,EAAE,CACrB,IAAI,EAAE,iCAAiC,KACtC,OAAO,CAAC,iCAAiC,GAAG,IAAI,CAAC,CAAA;IAEtD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,2BAA2B,EAAE,CACzB,IAAI,EAAE,qCAAqC,KAC1C,OAAO,CAAC,iCAAiC,CAAC,CAAA;CAClD,CAAA;AAED,QAAA,MAAM,cAAc,WAAY,MAAM,KAAG,cAavC,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Client } from "viem";
|
|
2
|
+
import { type GetUserOperationGasPriceReturnType } from "../../actions/pimlico/getUserOperationGasPrice.js";
|
|
3
|
+
import { type GetUserOperationStatusParameters, type GetUserOperationStatusReturnType } from "../../actions/pimlico/getUserOperationStatus.js";
|
|
4
|
+
import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/pimlico/sponsorUserOperation.js";
|
|
5
|
+
export type PimlicoBundlerActions = {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the live gas prices that you can use to send a user operation.
|
|
8
|
+
*
|
|
9
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
|
|
10
|
+
*
|
|
11
|
+
* @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas {@link GetUserOperationGasPriceReturnType}
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* import { createClient } from "viem"
|
|
16
|
+
* import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
|
|
17
|
+
*
|
|
18
|
+
* const bundlerClient = createClient({
|
|
19
|
+
* chain: goerli,
|
|
20
|
+
* transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
21
|
+
* }).extend(pimlicoBundlerActions)
|
|
22
|
+
*
|
|
23
|
+
* await bundlerClient.getUserOperationGasPrice()
|
|
24
|
+
*/
|
|
25
|
+
getUserOperationGasPrice: () => Promise<GetUserOperationGasPriceReturnType>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the status of the userOperation that is pending in the mempool.
|
|
28
|
+
*
|
|
29
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
|
|
30
|
+
*
|
|
31
|
+
* @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
|
|
32
|
+
* @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* import { createClient } from "viem"
|
|
36
|
+
* import { pimlicoBundlerActions } from "permissionless/actions/pimlico"
|
|
37
|
+
*
|
|
38
|
+
* const bundlerClient = createClient({
|
|
39
|
+
* chain: goerli,
|
|
40
|
+
* transport: http("https://api.pimlico.io/v1/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
41
|
+
* }).extend(pimlicoBundlerActions)
|
|
42
|
+
*
|
|
43
|
+
* await bundlerClient.getUserOperationStatus({ hash: userOpHash })
|
|
44
|
+
*/
|
|
45
|
+
getUserOperationStatus: (args: GetUserOperationStatusParameters) => Promise<GetUserOperationStatusReturnType>;
|
|
46
|
+
};
|
|
47
|
+
export declare const pimlicoBundlerActions: (client: Client) => PimlicoBundlerActions;
|
|
48
|
+
export type PimlicoPaymasterClientActions = {
|
|
49
|
+
/**
|
|
50
|
+
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
51
|
+
*
|
|
52
|
+
* https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
53
|
+
*
|
|
54
|
+
* @param args {@link SponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
55
|
+
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* import { createClient } from "viem"
|
|
59
|
+
* import { sponsorUserOperation } from "permissionless/actions/pimlico"
|
|
60
|
+
*
|
|
61
|
+
* const bundlerClient = createClient({
|
|
62
|
+
* chain: goerli,
|
|
63
|
+
* transport: http("https://api.pimlico.io/v2/goerli/rpc?apikey=YOUR_API_KEY_HERE")
|
|
64
|
+
* }).extend(pimlicoPaymasterActions)
|
|
65
|
+
*
|
|
66
|
+
* await bundlerClient.sponsorUserOperation(bundlerClient, {
|
|
67
|
+
* userOperation: userOperationWithDummySignature,
|
|
68
|
+
* entryPoint: entryPoint
|
|
69
|
+
* }})
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
sponsorUserOperation: (args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
|
|
73
|
+
};
|
|
74
|
+
export declare const pimlicoPaymasterActions: (client: Client) => PimlicoPaymasterClientActions;
|
|
75
|
+
/**
|
|
76
|
+
* TODO: Add support for pimlicoActions after we support all the actions of v1 in v2 of the Pimlico API.
|
|
77
|
+
*/
|
|
78
|
+
//# sourceMappingURL=pimlico.d.ts.map
|
|
@@ -0,0 +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,kCAAkC,EAE1C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EACH,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EAExC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AAGtD,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;;;;;;;;;;;;;;;OAkBG;IACH,wBAAwB,EAAE,MAAM,OAAO,CAAC,kCAAkC,CAAC,CAAA;IAC3E;;;;;;;;;;;;;;;;;;OAkBG;IACH,sBAAsB,EAAE,CAAC,IAAI,EAAE,gCAAgC,KAAK,OAAO,CAAC,gCAAgC,CAAC,CAAA;CAChH,CAAA;AAED,eAAO,MAAM,qBAAqB,WAAY,MAAM,KAAG,qBAIrD,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAAC,IAAI,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAA;CAC1G,CAAA;AAED,eAAO,MAAM,uBAAuB,WAAY,MAAM,KAAG,6BAGvD,CAAA;AAEF;;GAEG"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Address, Client } from "viem";
|
|
2
|
+
import { type AccountsParameters } from "../../actions/stackup/accounts.js";
|
|
3
|
+
import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/stackup/sponsorUserOperation.js";
|
|
4
|
+
export type StackupPaymasterClientActions = {
|
|
5
|
+
/**
|
|
6
|
+
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
7
|
+
*
|
|
8
|
+
* https://docs.stackup.sh/docs/paymaster-api-rpc-methods#pm_sponsoruseroperation
|
|
9
|
+
*
|
|
10
|
+
* @param args {@link SponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
11
|
+
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { createClient } from "viem"
|
|
15
|
+
* import { stackupPaymasterActions } from "permissionless/actions/stackup"
|
|
16
|
+
*
|
|
17
|
+
* const bundlerClient = createClient({
|
|
18
|
+
* chain: goerli,
|
|
19
|
+
* transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE")
|
|
20
|
+
* }).extend(stackupPaymasterActions)
|
|
21
|
+
*
|
|
22
|
+
* await bundlerClient.sponsorUserOperation(bundlerClient, {
|
|
23
|
+
* userOperation: userOperationWithDummySignature,
|
|
24
|
+
* entryPoint: entryPoint
|
|
25
|
+
* }})
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
sponsorUserOperation: (args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
|
|
29
|
+
/**
|
|
30
|
+
* Returns all the Paymaster addresses associated with an EntryPoint that’s owned by this service.
|
|
31
|
+
*
|
|
32
|
+
* https://docs.stackup.sh/docs/paymaster-api-rpc-methods#pm_accounts
|
|
33
|
+
*
|
|
34
|
+
* @param args {@link AccountsParameters} entryPoint for which you want to get list of supported paymasters.
|
|
35
|
+
* @returns paymaster addresses
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* import { createClient } from "viem"
|
|
39
|
+
* import { stackupPaymasterActions } from "permissionless/actions/stackup"
|
|
40
|
+
*
|
|
41
|
+
* const bundlerClient = createClient({
|
|
42
|
+
* chain: goerli,
|
|
43
|
+
* transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE")
|
|
44
|
+
* }).extend(stackupPaymasterActions)
|
|
45
|
+
*
|
|
46
|
+
* await bundlerClient.accounts(bundlerClient, {
|
|
47
|
+
* entryPoint: entryPoint
|
|
48
|
+
* }})
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
accounts: (args: AccountsParameters) => Promise<Address[]>;
|
|
52
|
+
};
|
|
53
|
+
export declare const stackupPaymasterActions: (client: Client) => StackupPaymasterClientActions;
|
|
54
|
+
//# sourceMappingURL=stackup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../../clients/decorators/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC3C,OAAO,EAAE,KAAK,kBAAkB,EAAY,MAAM,mCAAmC,CAAA;AACrF,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEtC,MAAM,+CAA+C,CAAA;AAGtD,MAAM,MAAM,6BAA6B,GAAG;IACxC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,oBAAoB,EAAE,CAAC,IAAI,EAAE,8BAA8B,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAEvG;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;CAC7D,CAAA;AAED,eAAO,MAAM,uBAAuB,WAAY,MAAM,KAAG,6BAIvD,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Account, Chain, Client, PublicClientConfig, Transport } from "viem";
|
|
2
|
-
import type {
|
|
3
|
-
import { type
|
|
4
|
-
import type
|
|
2
|
+
import type { PimlicoBundlerRpcSchema, PimlicoPaymasterRpcSchema } from "../types/pimlico.js";
|
|
3
|
+
import { type BundlerActions } from "./decorators/bundler.js";
|
|
4
|
+
import { type PimlicoBundlerActions, type PimlicoPaymasterClientActions } from "./decorators/pimlico.js";
|
|
5
5
|
export type PimlicoBundlerClient = Client<Transport, Chain | undefined, Account | undefined, PimlicoBundlerRpcSchema, PimlicoBundlerActions & BundlerActions>;
|
|
6
6
|
export type PimlicoPaymasterClient = Client<Transport, Chain | undefined, Account | undefined, PimlicoPaymasterRpcSchema, PimlicoPaymasterClientActions>;
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../clients/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC7F,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAC7E,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAGrC,MAAM,yBAAyB,CAAA;AAEhC,MAAM,MAAM,oBAAoB,GAAG,MAAM,CACrC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,uBAAuB,EACvB,qBAAqB,GAAG,cAAc,CACzC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACvC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,yBAAyB,EACzB,6BAA6B,CAChC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;MAEpC,oBASF,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;MAEtC,sBASF,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Account, type Chain, type Client, type PublicClientConfig, type Transport } from "viem";
|
|
2
|
+
import type { StackupPaymasterRpcSchema } from "../types/stackup.js";
|
|
3
|
+
import { type BundlerActions } from "./decorators/bundler.js";
|
|
4
|
+
import { type StackupPaymasterClientActions } from "./decorators/stackup.js";
|
|
5
|
+
export type StackupPaymasterClient = Client<Transport, Chain | undefined, Account | undefined, StackupPaymasterRpcSchema, StackupPaymasterClientActions & BundlerActions>;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a Stackup specific Paymaster Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
8
|
+
*
|
|
9
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/stackupPaymasterClient
|
|
10
|
+
*
|
|
11
|
+
* A Stackup Paymaster Client is an interface to "stackup paymaster endpoints" [JSON-RPC API](https://docs.stackup.sh/docs/paymaster-api-rpc-methods) methods such as sponsoring user operation, etc through Stackup Paymaster Actions.
|
|
12
|
+
*
|
|
13
|
+
* @param config - {@link PublicClientConfig}
|
|
14
|
+
* @returns A Stackup Paymaster Client. {@link StackupPaymasterClient}
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* import { createPublicClient, http } from 'viem'
|
|
18
|
+
* import { mainnet } from 'viem/chains'
|
|
19
|
+
*
|
|
20
|
+
* const stackupPaymasterClient = createStackupPaymasterClient({
|
|
21
|
+
* chain: mainnet,
|
|
22
|
+
* transport: http("https://api.stackup.sh/v1/paymaster/YOUR_API_KEY_HERE"),
|
|
23
|
+
* })
|
|
24
|
+
*/
|
|
25
|
+
export declare const createStackupPaymasterClient: <transport extends Transport, chain extends Chain | undefined = undefined>(parameters: {
|
|
26
|
+
batch?: {
|
|
27
|
+
multicall?: boolean | {
|
|
28
|
+
batchSize?: number | undefined;
|
|
29
|
+
wait?: number | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
cacheTime?: number | undefined;
|
|
33
|
+
chain?: Chain | chain | undefined;
|
|
34
|
+
key?: string | undefined;
|
|
35
|
+
name?: string | undefined;
|
|
36
|
+
pollingInterval?: number | undefined;
|
|
37
|
+
transport: transport;
|
|
38
|
+
}) => StackupPaymasterClient;
|
|
39
|
+
//# sourceMappingURL=stackup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../clients/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAgB,MAAM,MAAM,CAAA;AACnH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAA;AAC7E,OAAO,EAAE,KAAK,6BAA6B,EAA2B,MAAM,yBAAyB,CAAA;AAErG,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACvC,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,yBAAyB,EACzB,6BAA6B,GAAG,cAAc,CACjD,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;MAEtC,sBASF,CAAA"}
|
package/_types/index.d.ts
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType } from "./actions/bundler/estimateUserOperationGas.js";
|
|
2
|
+
import type { GetUserOperationByHashParameters } from "./actions/bundler/getUserOperationByHash.js";
|
|
3
|
+
import type { GetUserOperationByHashReturnType } from "./actions/bundler/getUserOperationByHash.js";
|
|
4
|
+
import type { GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType } from "./actions/bundler/getUserOperationReceipt.js";
|
|
5
|
+
import type { SendUserOperationParameters } from "./actions/bundler/sendUserOperation.js";
|
|
6
|
+
import type { GetSenderAddressParams } from "./actions/public/getSenderAddress.js";
|
|
7
|
+
import { getSenderAddress } from "./actions/public/getSenderAddress.js";
|
|
8
|
+
import { chainId } from "./actions/bundler/chainId.js";
|
|
9
|
+
import { estimateUserOperationGas } from "./actions/bundler/estimateUserOperationGas.js";
|
|
10
|
+
import { getUserOperationByHash } from "./actions/bundler/getUserOperationByHash.js";
|
|
11
|
+
import { getUserOperationReceipt } from "./actions/bundler/getUserOperationReceipt.js";
|
|
12
|
+
import { sendUserOperation } from "./actions/bundler/sendUserOperation.js";
|
|
13
|
+
import { supportedEntryPoints } from "./actions/bundler/supportedEntryPoints.js";
|
|
14
|
+
import { waitForUserOperationReceipt } from "./actions/bundler/waitForUserOperationReceipt.js";
|
|
15
|
+
import { type WaitForUserOperationReceiptParameters, WaitForUserOperationReceiptTimeoutError } from "./actions/bundler/waitForUserOperationReceipt.js";
|
|
16
|
+
import type { GetAccountNonceParams } from "./actions/public/getAccountNonce.js";
|
|
17
|
+
import { getAccountNonce } from "./actions/public/getAccountNonce.js";
|
|
18
|
+
import { type BundlerClient, createBundlerClient } from "./clients/bundler.js";
|
|
19
|
+
import type { BundlerActions } from "./clients/decorators/bundler.js";
|
|
20
|
+
import { bundlerActions } from "./clients/decorators/bundler.js";
|
|
21
|
+
export type { SendUserOperationParameters, EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, GetSenderAddressParams, GetAccountNonceParams, BundlerClient, BundlerActions, WaitForUserOperationReceiptParameters };
|
|
22
|
+
export { sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt, getSenderAddress, getAccountNonce, waitForUserOperationReceipt, createBundlerClient, bundlerActions, WaitForUserOperationReceiptTimeoutError };
|
|
23
|
+
import type { UserOperation } from "./types/userOperation.js";
|
|
24
|
+
export { type UserOperation };
|
|
25
|
+
import type { GetUserOperationHashParams } from "./utils/getUserOperationHash.js";
|
|
26
|
+
import { getUserOperationHash } from "./utils/getUserOperationHash.js";
|
|
27
|
+
export { getUserOperationHash, type GetUserOperationHashParams };
|
|
28
|
+
export * from "./utils/index.js";
|
|
5
29
|
//# sourceMappingURL=index.d.ts.map
|
package/_types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,EACrC,MAAM,+CAA+C,CAAA;AACtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAA;AACnG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAA;AACnG,OAAO,KAAK,EACR,iCAAiC,EACjC,iCAAiC,EACpC,MAAM,8CAA8C,CAAA;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAA;AAEzF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAA;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAA;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAA;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAA;AAC9F,OAAO,EACH,KAAK,qCAAqC,EAC1C,uCAAuC,EAC1C,MAAM,kDAAkD,CAAA;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhE,YAAY,EACR,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,qCAAqC,EACxC,CAAA;AAED,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,EACd,uCAAuC,EAC1C,CAAA;AACD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,OAAO,EAAE,KAAK,aAAa,EAAE,CAAA;AAE7B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,CAAA;AAChE,cAAc,kBAAkB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address, Hash, Hex } from "viem";
|
|
2
2
|
import type { PartialBy } from "viem/types/utils";
|
|
3
|
-
import type { UserOperationWithBigIntAsHex } from "./userOperation";
|
|
3
|
+
import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
|
|
4
4
|
export type BundlerRpcSchema = [
|
|
5
5
|
{
|
|
6
6
|
Method: "eth_sendUserOperation";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../types/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../types/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEtE,MAAM,MAAM,gBAAgB,GAAG;IAC3B;QACI,MAAM,EAAE,uBAAuB,CAAA;QAC/B,UAAU,EAAE,CAAC,aAAa,EAAE,4BAA4B,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QAC9E,UAAU,EAAE,IAAI,CAAA;KACnB;IACD;QACI,MAAM,EAAE,8BAA8B,CAAA;QACtC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC5B,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CACjE;YACD,UAAU,EAAE,OAAO;SACtB,CAAA;QACD,UAAU,EAAE;YACR,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;IACD;QACI,MAAM,EAAE,0BAA0B,CAAA;QAClC,UAAU,EAAE,EAAE,CAAA;QACd,UAAU,EAAE,OAAO,EAAE,CAAA;KACxB;IACD;QACI,MAAM,EAAE,aAAa,CAAA;QACrB,UAAU,EAAE,EAAE,CAAA;QACd,UAAU,EAAE,GAAG,CAAA;KAClB;IACD;QACI,MAAM,EAAE,4BAA4B,CAAA;QACpC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACxB,UAAU,EAAE;YACR,aAAa,EAAE,4BAA4B,CAAA;YAC3C,UAAU,EAAE,OAAO,CAAA;YACnB,eAAe,EAAE,IAAI,CAAA;YACrB,SAAS,EAAE,IAAI,CAAA;YACf,WAAW,EAAE,GAAG,CAAA;SACnB,CAAA;KACJ;IACD;QACI,MAAM,EAAE,6BAA6B,CAAA;QACrC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACxB,UAAU,EAAE,mCAAmC,CAAA;KAClD;CACJ,CAAA;AAED,KAAK,mCAAmC,GAAG;IACvC,UAAU,EAAE,IAAI,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,GAAG,CAAA;IACV,aAAa,EAAE,GAAG,CAAA;IAClB,aAAa,EAAE,GAAG,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE;QACL,eAAe,EAAE,GAAG,CAAA;QACpB,gBAAgB,EAAE,GAAG,CAAA;QACrB,SAAS,EAAE,IAAI,CAAA;QACf,WAAW,EAAE,GAAG,CAAA;QAChB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,OAAO,GAAG,IAAI,CAAA;QAClB,iBAAiB,EAAE,GAAG,CAAA;QACtB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAA;QACrB,OAAO,EAAE,GAAG,CAAA;QACZ,eAAe,EAAE,OAAO,GAAG,IAAI,CAAA;QAC/B,SAAS,EAAE,GAAG,CAAA;QACd,iBAAiB,EAAE,GAAG,CAAA;KACzB,CAAA;IACD,IAAI,EAAE;QACF,IAAI,EAAE,GAAG,CAAA;QACT,WAAW,EAAE,GAAG,CAAA;QAChB,SAAS,EAAE,IAAI,CAAA;QACf,eAAe,EAAE,IAAI,CAAA;QACrB,QAAQ,EAAE,GAAG,CAAA;QACb,gBAAgB,EAAE,GAAG,CAAA;QACrB,OAAO,EAAE,OAAO,CAAA;QAChB,MAAM,EAAE,GAAG,EAAE,CAAA;KAChB,EAAE,CAAA;CACN,CAAA"}
|
package/_types/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address, Hash, Hex } from "viem";
|
|
2
2
|
import type { PartialBy } from "viem/types/utils";
|
|
3
|
-
import type { UserOperationWithBigIntAsHex } from "./userOperation";
|
|
3
|
+
import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
|
|
4
4
|
type PimlicoUserOperationGasPriceWithBigIntAsHex = {
|
|
5
5
|
slow: {
|
|
6
6
|
maxFeePerGas: Hex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../types/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../types/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEtE,KAAK,2CAA2C,GAAG;IAC/C,IAAI,EAAE;QACF,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;IACD,QAAQ,EAAE;QACN,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;IACD,IAAI,EAAE;QACF,YAAY,EAAE,GAAG,CAAA;QACjB,oBAAoB,EAAE,GAAG,CAAA;KAC5B,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,MAAM,EAAE,WAAW,GAAG,eAAe,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAA;IACrG,eAAe,EAAE,IAAI,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC;QACI,MAAM,EAAE,kCAAkC,CAAA;QAC1C,UAAU,EAAE,EAAE,CAAA;QACd,UAAU,EAAE,2CAA2C,CAAA;KAC1D;IACD;QACI,MAAM,EAAE,gCAAgC,CAAA;QACxC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QACxB,UAAU,EAAE,0BAA0B,CAAA;KACzC;CACJ,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC5B,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF;YACD,UAAU,EAAE,OAAO;SACtB,CAAA;QACD,UAAU,EAAE;YACR,gBAAgB,EAAE,GAAG,CAAA;YACrB,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;CACJ,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
import type { PartialBy } from "viem/types/utils";
|
|
3
|
+
import type { UserOperationWithBigIntAsHex } from "./userOperation.js";
|
|
4
|
+
interface StackupPaymasterContextType {
|
|
5
|
+
type: "erc20token" | "payg";
|
|
6
|
+
}
|
|
7
|
+
export type StackupPaymasterContext = (StackupPaymasterContextType & {
|
|
8
|
+
type: "erc20token";
|
|
9
|
+
token: string;
|
|
10
|
+
}) | (StackupPaymasterContextType & {
|
|
11
|
+
type: "payg";
|
|
12
|
+
});
|
|
13
|
+
export type StackupPaymasterRpcSchema = [
|
|
14
|
+
{
|
|
15
|
+
Method: "pm_sponsorUserOperation";
|
|
16
|
+
Parameters: [
|
|
17
|
+
userOperation: PartialBy<UserOperationWithBigIntAsHex, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterAndData">,
|
|
18
|
+
entryPoint: Address,
|
|
19
|
+
context: StackupPaymasterContext
|
|
20
|
+
];
|
|
21
|
+
ReturnType: {
|
|
22
|
+
paymasterAndData: Hex;
|
|
23
|
+
preVerificationGas: Hex;
|
|
24
|
+
verificationGasLimit: Hex;
|
|
25
|
+
callGasLimit: Hex;
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
Method: "pm_accounts";
|
|
30
|
+
Parameters: [entryPoint: Address];
|
|
31
|
+
ReturnType: Address[];
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=stackup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stackup.d.ts","sourceRoot":"","sources":["../../types/stackup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAA;AAEtE,UAAU,2BAA2B;IACjC,IAAI,EAAE,YAAY,GAAG,MAAM,CAAA;CAC9B;AAED,MAAM,MAAM,uBAAuB,GAC7B,CAAC,2BAA2B,GAAG;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GACrE,CAAC,2BAA2B,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAEtD,MAAM,MAAM,yBAAyB,GAAG;IACpC;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR,aAAa,EAAE,SAAS,CACpB,4BAA4B,EAC5B,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF;YACD,UAAU,EAAE,OAAO;YACnB,OAAO,EAAE,uBAAuB;SACnC,CAAA;QACD,UAAU,EAAE;YACR,gBAAgB,EAAE,GAAG,CAAA;YACrB,kBAAkB,EAAE,GAAG,CAAA;YACvB,oBAAoB,EAAE,GAAG,CAAA;YACzB,YAAY,EAAE,GAAG,CAAA;SACpB,CAAA;KACJ;IACD;QACI,MAAM,EAAE,aAAa,CAAA;QACrB,UAAU,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;QACjC,UAAU,EAAE,OAAO,EAAE,CAAA;KACxB;CACJ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepHexlify.d.ts","sourceRoot":"","sources":["../../utils/deepHexlify.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;;;CAG3B,CAAA;AAGV,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAqBzC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Address, Hash } from "viem";
|
|
2
|
+
import type { UserOperation } from "../types/userOperation.js";
|
|
3
|
+
export type GetUserOperationHashParams = {
|
|
4
|
+
userOperation: UserOperation;
|
|
5
|
+
entryPoint: Address;
|
|
6
|
+
chainId: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* Returns user operation hash that is a unique identifier of the user operation.
|
|
11
|
+
*
|
|
12
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/utils/getUserOperationHash
|
|
13
|
+
*
|
|
14
|
+
* @param args: userOperation, entryPoint, chainId as {@link GetUserOperationHashParams}
|
|
15
|
+
* @returns userOperationHash as {@link Hash}
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import { getUserOperationHash } from "permissionless/utils"
|
|
19
|
+
*
|
|
20
|
+
* const userOperationHash = getUserOperationHash({
|
|
21
|
+
* userOperation,
|
|
22
|
+
* entryPoint,
|
|
23
|
+
* chainId
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* // Returns "0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34"
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
export declare const getUserOperationHash: ({ userOperation, entryPoint, chainId }: GetUserOperationHashParams) => Hash;
|
|
30
|
+
//# sourceMappingURL=getUserOperationHash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserOperationHash.d.ts","sourceRoot":"","sources":["../../utils/getUserOperationHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAO,MAAM,MAAM,CAAA;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAmC9D,MAAM,MAAM,0BAA0B,GAAG;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,2CAA4C,0BAA0B,KAAG,IAOzG,CAAA"}
|
package/_types/utils/index.d.ts
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
export type GetUserOperationHashParams = {
|
|
4
|
-
userOperation: UserOperation;
|
|
5
|
-
entryPoint: Address;
|
|
6
|
-
chainId: number;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* Returns user operation hash that is a unique identifier of the user operation.
|
|
11
|
-
*
|
|
12
|
-
* - Docs: https://docs.pimlico.io/permissionless/reference/utils/getUserOperationHash
|
|
13
|
-
*
|
|
14
|
-
* @param args: userOperation, entryPoint, chainId as {@link GetUserOperationHashParams}
|
|
15
|
-
* @returns userOperationHash as {@link Hash}
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* import { getUserOperationHash } from "permissionless/utils"
|
|
19
|
-
*
|
|
20
|
-
* const userOperationHash = getUserOperationHash({
|
|
21
|
-
* userOperation,
|
|
22
|
-
* entryPoint,
|
|
23
|
-
* chainId
|
|
24
|
-
* })
|
|
25
|
-
*
|
|
26
|
-
* // Returns "0xe9fad2cd67f9ca1d0b7a6513b2a42066784c8df938518da2b51bb8cc9a89ea34"
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
declare const getUserOperationHash: ({ userOperation, entryPoint, chainId }: GetUserOperationHashParams) => Hash;
|
|
30
|
-
export { getUserOperationHash };
|
|
1
|
+
import { type GetUserOperationHashParams, getUserOperationHash } from "./getUserOperationHash.js";
|
|
2
|
+
export { getUserOperationHash, type GetUserOperationHashParams };
|
|
31
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAEjG,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MaybePromise } from "viem/types/utils";
|
|
2
|
+
type Callback = ((...args: any[]) => any) | undefined;
|
|
3
|
+
type Callbacks = Record<string, Callback>;
|
|
4
|
+
export declare const listenersCache: Map<string, {
|
|
5
|
+
id: number;
|
|
6
|
+
fns: Callbacks;
|
|
7
|
+
}[]>;
|
|
8
|
+
export declare const cleanupCache: Map<string, () => void>;
|
|
9
|
+
type EmitFunction<TCallbacks extends Callbacks> = (emit: TCallbacks) => MaybePromise<void | (() => void)>;
|
|
10
|
+
/**
|
|
11
|
+
* @description Sets up an observer for a given function. If another function
|
|
12
|
+
* is set up under the same observer id, the function will only be called once
|
|
13
|
+
* for both instances of the observer.
|
|
14
|
+
*/
|
|
15
|
+
export declare function observe<TCallbacks extends Callbacks>(observerId: string, callbacks: TCallbacks, fn: EmitFunction<TCallbacks>): () => void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=observe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../utils/observe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAGpD,KAAK,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,SAAS,CAAA;AACrD,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAEzC,eAAO,MAAM,cAAc;QAAuC,MAAM;SAAO,SAAS;IAAO,CAAA;AAC/F,eAAO,MAAM,YAAY,oBAAuC,IAAI,CAAG,CAAA;AAEvE,KAAK,YAAY,CAAC,UAAU,SAAS,SAAS,IAAI,CAAC,IAAI,EAAE,UAAU,KAAK,YAAY,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,CAAA;AAIzG;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,UAAU,SAAS,SAAS,EAChD,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,UAAU,EACrB,EAAE,EAAE,YAAY,CAAC,UAAU,CAAC,cAuC/B"}
|