permissionless 0.0.3 → 0.0.4
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 +8 -0
- package/_cjs/actions/bundler.js +3 -3
- package/_cjs/actions/bundler.js.map +1 -1
- package/_cjs/actions/index.js +1 -1
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/pimlico.js.map +1 -1
- package/_cjs/clients/bundler.js.map +1 -1
- package/_cjs/clients/pimlico.js.map +1 -1
- package/_cjs/index.js +1 -0
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/index.js +38 -0
- package/_cjs/utils/index.js.map +1 -0
- package/_esm/actions/bundler.js +2 -2
- package/_esm/actions/bundler.js.map +1 -1
- package/_esm/actions/index.js +1 -1
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/pimlico.js +3 -6
- package/_esm/actions/pimlico.js.map +1 -1
- package/_esm/clients/bundler.js +2 -3
- package/_esm/clients/bundler.js.map +1 -1
- package/_esm/clients/pimlico.js +3 -5
- package/_esm/clients/pimlico.js.map +1 -1
- package/_esm/index.js +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/utils/index.js +56 -0
- package/_esm/utils/index.js.map +1 -0
- package/_types/actions/bundler.d.ts +3 -3
- package/_types/actions/bundler.d.ts.map +1 -1
- package/_types/actions/index.d.ts +1 -1
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/pimlico.d.ts +6 -12
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/clients/bundler.d.ts +2 -3
- package/_types/clients/bundler.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +3 -5
- package/_types/clients/pimlico.d.ts.map +1 -1
- package/_types/index.d.ts +1 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/utils/index.d.ts +31 -0
- package/_types/utils/index.d.ts.map +1 -0
- package/actions/bundler.ts +3 -3
- package/actions/index.ts +2 -1
- package/actions/pimlico.ts +6 -12
- package/clients/bundler.ts +2 -3
- package/clients/pimlico.ts +3 -5
- package/index.ts +1 -0
- package/package.json +6 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/index.ts +70 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Address, Hash } from "viem";
|
|
2
|
+
import type { UserOperation } from "../types";
|
|
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 };
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAO,MAAM,MAAM,CAAA;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAmC7C,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,QAAA,MAAM,oBAAoB,2CAA4C,0BAA0B,KAAG,IAOlG,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
package/actions/bundler.ts
CHANGED
|
@@ -204,7 +204,7 @@ export const supportedEntryPoints = async (client: BundlerClient): Promise<Addre
|
|
|
204
204
|
*
|
|
205
205
|
*/
|
|
206
206
|
export const chainId = async (client: BundlerClient) => {
|
|
207
|
-
return
|
|
207
|
+
return Number(
|
|
208
208
|
await client.request({
|
|
209
209
|
method: "eth_chainId",
|
|
210
210
|
params: []
|
|
@@ -435,7 +435,7 @@ export type BundlerActions = {
|
|
|
435
435
|
* const chainId = await bundlerClient.chainId()
|
|
436
436
|
* // Return 5n for Goerli
|
|
437
437
|
*/
|
|
438
|
-
chainId: () => Promise<
|
|
438
|
+
chainId: () => Promise<number>
|
|
439
439
|
/**
|
|
440
440
|
*
|
|
441
441
|
* Returns the user operation from userOpHash
|
|
@@ -495,4 +495,4 @@ const bundlerActions = (client: Client): BundlerActions => ({
|
|
|
495
495
|
getUserOperationReceipt(client as BundlerClient, args)
|
|
496
496
|
})
|
|
497
497
|
|
|
498
|
-
export
|
|
498
|
+
export { bundlerActions }
|
package/actions/index.ts
CHANGED
package/actions/pimlico.ts
CHANGED
|
@@ -44,8 +44,7 @@ export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus
|
|
|
44
44
|
/**
|
|
45
45
|
* Returns the live gas prices that you can use to send a user operation.
|
|
46
46
|
*
|
|
47
|
-
* - Docs:
|
|
48
|
-
* - Example: [TODO://add link]
|
|
47
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
|
|
49
48
|
*
|
|
50
49
|
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
51
50
|
* @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas
|
|
@@ -90,8 +89,7 @@ export const getUserOperationGasPrice = async (
|
|
|
90
89
|
/**
|
|
91
90
|
* Returns the status of the userOperation that is pending in the mempool.
|
|
92
91
|
*
|
|
93
|
-
* - Docs:
|
|
94
|
-
* - Example: [TODO://add link]
|
|
92
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
|
|
95
93
|
*
|
|
96
94
|
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
97
95
|
* @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
|
|
@@ -124,8 +122,7 @@ export type PimlicoBundlerActions = {
|
|
|
124
122
|
/**
|
|
125
123
|
* Returns the live gas prices that you can use to send a user operation.
|
|
126
124
|
*
|
|
127
|
-
* - Docs:
|
|
128
|
-
* - Example: [TODO://add link]
|
|
125
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
|
|
129
126
|
*
|
|
130
127
|
* @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas {@link GetUserOperationGasPriceReturnType}
|
|
131
128
|
*
|
|
@@ -145,8 +142,7 @@ export type PimlicoBundlerActions = {
|
|
|
145
142
|
/**
|
|
146
143
|
* Returns the status of the userOperation that is pending in the mempool.
|
|
147
144
|
*
|
|
148
|
-
* - Docs:
|
|
149
|
-
* - Example: [TODO://add link]
|
|
145
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
|
|
150
146
|
*
|
|
151
147
|
* @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
|
|
152
148
|
* @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
|
|
@@ -174,8 +170,7 @@ export const pimlicoBundlerActions = (client: Client): PimlicoBundlerActions =>
|
|
|
174
170
|
/**
|
|
175
171
|
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
176
172
|
*
|
|
177
|
-
* - Docs:
|
|
178
|
-
* - Example: [TODO://add link]
|
|
173
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
179
174
|
*
|
|
180
175
|
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
181
176
|
* @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
@@ -218,8 +213,7 @@ export type PimlicoPaymasterClientActions = {
|
|
|
218
213
|
/**
|
|
219
214
|
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
220
215
|
*
|
|
221
|
-
* -
|
|
222
|
-
* - Example: [TODO://add link]
|
|
216
|
+
* https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
223
217
|
*
|
|
224
218
|
* @param args {@link SponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
225
219
|
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
package/clients/bundler.ts
CHANGED
|
@@ -8,10 +8,9 @@ export type BundlerClient = Client<Transport, Chain | undefined, Account | undef
|
|
|
8
8
|
/**
|
|
9
9
|
* Creates a EIP-4337 compliant Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
10
10
|
*
|
|
11
|
-
* - Docs:
|
|
12
|
-
* - Example: [TODO://add link]
|
|
11
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/bundlerClient
|
|
13
12
|
*
|
|
14
|
-
* A Bundler Client is an interface to "erc 4337" [JSON-RPC API](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace) methods such as sending user operation, estimating gas for a user operation, get user operation receipt, etc through
|
|
13
|
+
* A Bundler Client is an interface to "erc 4337" [JSON-RPC API](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace) methods such as sending user operation, estimating gas for a user operation, get user operation receipt, etc through Bundler Actions.
|
|
15
14
|
*
|
|
16
15
|
* @param config - {@link PublicClientConfig}
|
|
17
16
|
* @returns A Bundler Client. {@link BundlerClient}
|
package/clients/pimlico.ts
CHANGED
|
@@ -29,8 +29,7 @@ export type PimlicoPaymasterClient = Client<
|
|
|
29
29
|
/**
|
|
30
30
|
* Creates a pimlico specific Bundler Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
31
31
|
*
|
|
32
|
-
* - Docs:
|
|
33
|
-
* - Example: [TODO://add link]
|
|
32
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/pimlicoBundlerClient
|
|
34
33
|
*
|
|
35
34
|
* A Pimlico Client is an interface to "pimlico endpoints" [JSON-RPC API](https://docs.pimlico.io/reference/bundler/endpoints) methods such as getting current blockchain gas prices, getting user operation status, etc through [Pimlico Bundler Actions](TODO://Add bundler action documentation link).
|
|
36
35
|
*
|
|
@@ -62,10 +61,9 @@ export const createPimlicoBundlerClient = <transport extends Transport, chain ex
|
|
|
62
61
|
/**
|
|
63
62
|
* Creates a pimlico 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).
|
|
64
63
|
*
|
|
65
|
-
* - Docs:
|
|
66
|
-
* - Example: [TODO://add link]
|
|
64
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/pimlicoPaymasterClient
|
|
67
65
|
*
|
|
68
|
-
* A Pimlico Paymaster Client is an interface to "pimlico paymaster endpoints" [JSON-RPC API](https://docs.pimlico.io/reference/verifying-paymaster/endpoints) methods such as sponsoring user operation, etc through
|
|
66
|
+
* A Pimlico Paymaster Client is an interface to "pimlico paymaster endpoints" [JSON-RPC API](https://docs.pimlico.io/reference/verifying-paymaster/endpoints) methods such as sponsoring user operation, etc through Pimlico Paymaster Actions.
|
|
69
67
|
*
|
|
70
68
|
* @param config - {@link PublicClientConfig}
|
|
71
69
|
* @returns A Pimlico Paymaster Client. {@link PimlicoPaymasterClient}
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "permissionless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"author": "Pimlico",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"types": "./_types/clients/pimlico.d.ts",
|
|
43
43
|
"import": "./_esm/clients/pimlico.js",
|
|
44
44
|
"default": "./_cjs/clients/pimlico.js"
|
|
45
|
+
},
|
|
46
|
+
"./utils": {
|
|
47
|
+
"types": "./_types/utils/index.d.ts",
|
|
48
|
+
"import": "./_esm/utils/index.js",
|
|
49
|
+
"default": "./_cjs/utils/index.js"
|
|
45
50
|
}
|
|
46
51
|
},
|
|
47
52
|
"peerDependencies": {
|