permissionless 0.0.3 → 0.0.5
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 +14 -0
- package/_cjs/actions/bundler.js +3 -3
- package/_cjs/actions/bundler.js.map +1 -1
- package/_cjs/actions/index.js +4 -2
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/pimlico.js.map +1 -1
- package/_cjs/actions/public.js +67 -0
- package/_cjs/actions/public.js.map +1 -0
- 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 +3 -2
- 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/actions/public.js +88 -0
- package/_esm/actions/public.js.map +1 -0
- 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 +5 -3
- 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/actions/public.d.ts +41 -0
- package/_types/actions/public.d.ts.map +1 -0
- package/_types/clients/bundler.d.ts +6 -7
- package/_types/clients/bundler.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +11 -13
- 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 +10 -3
- package/actions/pimlico.ts +6 -12
- package/actions/public.ts +104 -0
- package/clients/bundler.ts +2 -3
- package/clients/pimlico.ts +3 -5
- package/index.ts +1 -0
- package/package.json +7 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/index.ts +70 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, SendUserOperationParameters } from "./bundler";
|
|
2
|
-
import bundlerActions,
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { bundlerActions, chainId, estimateUserOperationGas, getUserOperationByHash, getUserOperationReceipt, sendUserOperation, supportedEntryPoints } from "./bundler";
|
|
3
|
+
import type { GetSenderAddressParams } from "./public";
|
|
4
|
+
import { getSenderAddress } from "./public";
|
|
5
|
+
export type { SendUserOperationParameters, EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType, GetUserOperationByHashParameters, GetUserOperationByHashReturnType, GetUserOperationReceiptParameters, GetUserOperationReceiptReturnType, GetSenderAddressParams };
|
|
6
|
+
export { bundlerActions, sendUserOperation, estimateUserOperationGas, supportedEntryPoints, chainId, getUserOperationByHash, getUserOperationReceipt, getSenderAddress };
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,2BAA2B,EAC9B,MAAM,WAAW,CAAA;AAElB,OAAO,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,2BAA2B,EAC9B,MAAM,WAAW,CAAA;AAElB,OAAO,EACH,cAAc,EACd,OAAO,EACP,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,WAAW,CAAA;AAElB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE3C,YAAY,EACR,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,EACzB,CAAA;AAED,OAAO,EACH,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EACnB,CAAA"}
|
|
@@ -34,8 +34,7 @@ export type GetUserOperationStatusReturnType = PimlicoUserOperationStatus;
|
|
|
34
34
|
/**
|
|
35
35
|
* Returns the live gas prices that you can use to send a user operation.
|
|
36
36
|
*
|
|
37
|
-
* - Docs:
|
|
38
|
-
* - Example: [TODO://add link]
|
|
37
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
|
|
39
38
|
*
|
|
40
39
|
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
41
40
|
* @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas
|
|
@@ -57,8 +56,7 @@ export declare const getUserOperationGasPrice: (client: PimlicoBundlerClient) =>
|
|
|
57
56
|
/**
|
|
58
57
|
* Returns the status of the userOperation that is pending in the mempool.
|
|
59
58
|
*
|
|
60
|
-
* - Docs:
|
|
61
|
-
* - Example: [TODO://add link]
|
|
59
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
|
|
62
60
|
*
|
|
63
61
|
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
64
62
|
* @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
|
|
@@ -82,8 +80,7 @@ export type PimlicoBundlerActions = {
|
|
|
82
80
|
/**
|
|
83
81
|
* Returns the live gas prices that you can use to send a user operation.
|
|
84
82
|
*
|
|
85
|
-
* - Docs:
|
|
86
|
-
* - Example: [TODO://add link]
|
|
83
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationGasPrice
|
|
87
84
|
*
|
|
88
85
|
* @returns slow, standard & fast values for maxFeePerGas & maxPriorityFeePerGas {@link GetUserOperationGasPriceReturnType}
|
|
89
86
|
*
|
|
@@ -103,8 +100,7 @@ export type PimlicoBundlerActions = {
|
|
|
103
100
|
/**
|
|
104
101
|
* Returns the status of the userOperation that is pending in the mempool.
|
|
105
102
|
*
|
|
106
|
-
* - Docs:
|
|
107
|
-
* - Example: [TODO://add link]
|
|
103
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-bundler-actions/getUserOperationStatus
|
|
108
104
|
*
|
|
109
105
|
* @param hash {@link Hash} UserOpHash that you must have received from sendUserOperation.
|
|
110
106
|
* @returns status & transaction hash if included {@link GetUserOperationStatusReturnType}
|
|
@@ -126,8 +122,7 @@ export declare const pimlicoBundlerActions: (client: Client) => PimlicoBundlerAc
|
|
|
126
122
|
/**
|
|
127
123
|
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
128
124
|
*
|
|
129
|
-
* - Docs:
|
|
130
|
-
* - Example: [TODO://add link]
|
|
125
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
131
126
|
*
|
|
132
127
|
* @param client {@link PimlicoBundlerClient} that you created using viem's createClient whose transport url is pointing to the Pimlico's bundler.
|
|
133
128
|
* @param args {@link sponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
@@ -154,8 +149,7 @@ export type PimlicoPaymasterClientActions = {
|
|
|
154
149
|
/**
|
|
155
150
|
* Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
|
|
156
151
|
*
|
|
157
|
-
* -
|
|
158
|
-
* - Example: [TODO://add link]
|
|
152
|
+
* https://docs.pimlico.io/permissionless/reference/pimlico-paymaster-actions/sponsorUserOperation
|
|
159
153
|
*
|
|
160
154
|
* @param args {@link SponsorUserOperationParameters} UserOperation you want to sponsor & entryPoint.
|
|
161
155
|
* @returns paymasterAndData & updated gas parameters, see {@link SponsorUserOperationReturnType}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,wBAAwB,CAAA;AAGzF,MAAM,MAAM,8BAA8B,GAAG;IACzC,aAAa,EAAE,SAAS,CACpB,aAAa,EACb,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF,CAAA;IACD,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IACzC,gBAAgB,EAAE,GAAG,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC7C,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;IACD,QAAQ,EAAE;QACN,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;IACD,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CAAA;AAEzE
|
|
1
|
+
{"version":3,"file":"pimlico.d.ts","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,wBAAwB,CAAA;AAGzF,MAAM,MAAM,8BAA8B,GAAG;IACzC,aAAa,EAAE,SAAS,CACpB,aAAa,EACb,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,kBAAkB,CACtF,CAAA;IACD,UAAU,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IACzC,gBAAgB,EAAE,GAAG,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC7C,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;IACD,QAAQ,EAAE;QACN,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;IACD,IAAI,EAAE;QACF,YAAY,EAAE,MAAM,CAAA;QACpB,oBAAoB,EAAE,MAAM,CAAA;KAC/B,CAAA;CACJ,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,WACzB,oBAAoB,KAC7B,QAAQ,kCAAkC,CAoB5C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,WACvB,oBAAoB,YAClB,gCAAgC,KAC3C,QAAQ,gCAAgC,CAK1C,CAAA;AAED,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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB,WACrB,sBAAsB,QACxB,8BAA8B,KACrC,QAAQ,8BAA8B,CAYxC,CAAA;AAED,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,41 @@
|
|
|
1
|
+
import type { Address, Hex, PublicClient } from "viem";
|
|
2
|
+
import { BaseError } from "viem";
|
|
3
|
+
export type GetSenderAddressParams = {
|
|
4
|
+
initCode: Hex;
|
|
5
|
+
entryPoint: Address;
|
|
6
|
+
};
|
|
7
|
+
export declare class InvalidEntryPointError extends BaseError {
|
|
8
|
+
name: string;
|
|
9
|
+
constructor({ cause, entryPoint }?: {
|
|
10
|
+
cause?: BaseError;
|
|
11
|
+
entryPoint?: Address;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Returns the address of the account that will be deployed with the given init code.
|
|
16
|
+
*
|
|
17
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/public-actions/getSenderAddress
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* @param publicClient {@link PublicClient} that you created using viem's createPublicClient.
|
|
21
|
+
* @param args {@link GetSenderAddressParams}
|
|
22
|
+
* @returns Address
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* import { createPublicClient } from "viem"
|
|
26
|
+
* import { getSenderAddress } from "permissionless/actions"
|
|
27
|
+
*
|
|
28
|
+
* const publicClient = createPublicClient({
|
|
29
|
+
* chain: goerli,
|
|
30
|
+
* transport: http("https://goerli.infura.io/v3/your-infura-key")
|
|
31
|
+
* })
|
|
32
|
+
*
|
|
33
|
+
* const senderAddress = await getSenderAddress(publicClient, {
|
|
34
|
+
* initCode,
|
|
35
|
+
* entryPoint
|
|
36
|
+
* })
|
|
37
|
+
*
|
|
38
|
+
* // Return '0x7a88a206ba40b37a8c07a2b5688cf8b287318b63'
|
|
39
|
+
*/
|
|
40
|
+
export declare const getSenderAddress: (publicClient: PublicClient, { initCode, entryPoint }: GetSenderAddressParams) => Promise<Address>;
|
|
41
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../actions/public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EAGP,GAAG,EACH,YAAY,EACf,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAEhC,MAAM,MAAM,sBAAsB,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAA;AAE3E,qBAAa,sBAAuB,SAAQ,SAAS;IACxC,IAAI,SAA2B;gBAE5B,EAAE,KAAK,EAAE,UAAU,EAAE,GAAE;QAAE,KAAK,CAAC,EAAE,SAAS,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAO;CAUtF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB,iBACX,YAAY,4BACA,sBAAsB,KACjD,QAAQ,OAAO,CAgDjB,CAAA"}
|
|
@@ -5,10 +5,9 @@ export type BundlerClient = Client<Transport, Chain | undefined, Account | undef
|
|
|
5
5
|
/**
|
|
6
6
|
* 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).
|
|
7
7
|
*
|
|
8
|
-
* - Docs:
|
|
9
|
-
* - Example: [TODO://add link]
|
|
8
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/bundlerClient
|
|
10
9
|
*
|
|
11
|
-
* 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
|
|
10
|
+
* 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.
|
|
12
11
|
*
|
|
13
12
|
* @param config - {@link PublicClientConfig}
|
|
14
13
|
* @returns A Bundler Client. {@link BundlerClient}
|
|
@@ -23,10 +22,6 @@ export type BundlerClient = Client<Transport, Chain | undefined, Account | undef
|
|
|
23
22
|
* })
|
|
24
23
|
*/
|
|
25
24
|
export declare const createBundlerClient: <transport extends Transport, chain extends Chain | undefined = undefined>(parameters: {
|
|
26
|
-
name?: string | undefined;
|
|
27
|
-
pollingInterval?: number | undefined;
|
|
28
|
-
chain?: Chain | chain | undefined;
|
|
29
|
-
key?: string | undefined;
|
|
30
25
|
batch?: {
|
|
31
26
|
multicall?: boolean | {
|
|
32
27
|
batchSize?: number | undefined;
|
|
@@ -34,6 +29,10 @@ export declare const createBundlerClient: <transport extends Transport, chain ex
|
|
|
34
29
|
} | undefined;
|
|
35
30
|
} | undefined;
|
|
36
31
|
cacheTime?: number | undefined;
|
|
32
|
+
chain?: Chain | chain | undefined;
|
|
33
|
+
key?: string | undefined;
|
|
34
|
+
name?: string | undefined;
|
|
35
|
+
pollingInterval?: number | undefined;
|
|
37
36
|
transport: transport;
|
|
38
37
|
}) => BundlerClient;
|
|
39
38
|
//# sourceMappingURL=bundler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../clients/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAGjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;AACvH
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../clients/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAGjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;AACvH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;MAE7B,aASF,CAAA"}
|
|
@@ -7,8 +7,7 @@ export type PimlicoPaymasterClient = Client<Transport, Chain | undefined, Accoun
|
|
|
7
7
|
/**
|
|
8
8
|
* 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).
|
|
9
9
|
*
|
|
10
|
-
* - Docs:
|
|
11
|
-
* - Example: [TODO://add link]
|
|
10
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/pimlicoBundlerClient
|
|
12
11
|
*
|
|
13
12
|
* 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).
|
|
14
13
|
*
|
|
@@ -25,10 +24,6 @@ export type PimlicoPaymasterClient = Client<Transport, Chain | undefined, Accoun
|
|
|
25
24
|
* })
|
|
26
25
|
*/
|
|
27
26
|
export declare const createPimlicoBundlerClient: <transport extends Transport, chain extends Chain | undefined = undefined>(parameters: {
|
|
28
|
-
name?: string | undefined;
|
|
29
|
-
pollingInterval?: number | undefined;
|
|
30
|
-
chain?: Chain | chain | undefined;
|
|
31
|
-
key?: string | undefined;
|
|
32
27
|
batch?: {
|
|
33
28
|
multicall?: boolean | {
|
|
34
29
|
batchSize?: number | undefined;
|
|
@@ -36,15 +31,18 @@ export declare const createPimlicoBundlerClient: <transport extends Transport, c
|
|
|
36
31
|
} | undefined;
|
|
37
32
|
} | undefined;
|
|
38
33
|
cacheTime?: number | undefined;
|
|
34
|
+
chain?: Chain | chain | undefined;
|
|
35
|
+
key?: string | undefined;
|
|
36
|
+
name?: string | undefined;
|
|
37
|
+
pollingInterval?: number | undefined;
|
|
39
38
|
transport: transport;
|
|
40
39
|
}) => PimlicoBundlerClient;
|
|
41
40
|
/**
|
|
42
41
|
* 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).
|
|
43
42
|
*
|
|
44
|
-
* - Docs:
|
|
45
|
-
* - Example: [TODO://add link]
|
|
43
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/clients/pimlicoPaymasterClient
|
|
46
44
|
*
|
|
47
|
-
* 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
|
|
45
|
+
* 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.
|
|
48
46
|
*
|
|
49
47
|
* @param config - {@link PublicClientConfig}
|
|
50
48
|
* @returns A Pimlico Paymaster Client. {@link PimlicoPaymasterClient}
|
|
@@ -59,10 +57,6 @@ export declare const createPimlicoBundlerClient: <transport extends Transport, c
|
|
|
59
57
|
* })
|
|
60
58
|
*/
|
|
61
59
|
export declare const createPimlicoPaymasterClient: <transport extends Transport, chain extends Chain | undefined = undefined>(parameters: {
|
|
62
|
-
name?: string | undefined;
|
|
63
|
-
pollingInterval?: number | undefined;
|
|
64
|
-
chain?: Chain | chain | undefined;
|
|
65
|
-
key?: string | undefined;
|
|
66
60
|
batch?: {
|
|
67
61
|
multicall?: boolean | {
|
|
68
62
|
batchSize?: number | undefined;
|
|
@@ -70,6 +64,10 @@ export declare const createPimlicoPaymasterClient: <transport extends Transport,
|
|
|
70
64
|
} | undefined;
|
|
71
65
|
} | undefined;
|
|
72
66
|
cacheTime?: number | undefined;
|
|
67
|
+
chain?: Chain | chain | undefined;
|
|
68
|
+
key?: string | undefined;
|
|
69
|
+
name?: string | undefined;
|
|
70
|
+
pollingInterval?: number | undefined;
|
|
73
71
|
transport: transport;
|
|
74
72
|
}) => PimlicoPaymasterClient;
|
|
75
73
|
//# sourceMappingURL=pimlico.d.ts.map
|
|
@@ -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;AAGjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAGrC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAE1F,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
|
|
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;AAGjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAGrC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAE1F,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"}
|
package/_types/index.d.ts
CHANGED
package/_types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
|
@@ -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
|
@@ -8,7 +8,8 @@ import type {
|
|
|
8
8
|
SendUserOperationParameters
|
|
9
9
|
} from "./bundler"
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import {
|
|
12
|
+
bundlerActions,
|
|
12
13
|
chainId,
|
|
13
14
|
estimateUserOperationGas,
|
|
14
15
|
getUserOperationByHash,
|
|
@@ -17,6 +18,10 @@ import bundlerActions, {
|
|
|
17
18
|
supportedEntryPoints
|
|
18
19
|
} from "./bundler"
|
|
19
20
|
|
|
21
|
+
import type { GetSenderAddressParams } from "./public"
|
|
22
|
+
|
|
23
|
+
import { getSenderAddress } from "./public"
|
|
24
|
+
|
|
20
25
|
export type {
|
|
21
26
|
SendUserOperationParameters,
|
|
22
27
|
EstimateUserOperationGasParameters,
|
|
@@ -24,7 +29,8 @@ export type {
|
|
|
24
29
|
GetUserOperationByHashParameters,
|
|
25
30
|
GetUserOperationByHashReturnType,
|
|
26
31
|
GetUserOperationReceiptParameters,
|
|
27
|
-
GetUserOperationReceiptReturnType
|
|
32
|
+
GetUserOperationReceiptReturnType,
|
|
33
|
+
GetSenderAddressParams
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
export {
|
|
@@ -34,5 +40,6 @@ export {
|
|
|
34
40
|
supportedEntryPoints,
|
|
35
41
|
chainId,
|
|
36
42
|
getUserOperationByHash,
|
|
37
|
-
getUserOperationReceipt
|
|
43
|
+
getUserOperationReceipt,
|
|
44
|
+
getSenderAddress
|
|
38
45
|
}
|
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}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Address,
|
|
3
|
+
ContractFunctionExecutionErrorType,
|
|
4
|
+
ContractFunctionRevertedErrorType,
|
|
5
|
+
Hex,
|
|
6
|
+
PublicClient
|
|
7
|
+
} from "viem"
|
|
8
|
+
import { BaseError } from "viem"
|
|
9
|
+
|
|
10
|
+
export type GetSenderAddressParams = { initCode: Hex; entryPoint: Address }
|
|
11
|
+
|
|
12
|
+
export class InvalidEntryPointError extends BaseError {
|
|
13
|
+
override name = "InvalidEntryPointError"
|
|
14
|
+
|
|
15
|
+
constructor({ cause, entryPoint }: { cause?: BaseError; entryPoint?: Address } = {}) {
|
|
16
|
+
super(
|
|
17
|
+
`The entry point address (\`entryPoint\`${
|
|
18
|
+
entryPoint ? ` = ${entryPoint}` : ""
|
|
19
|
+
}) is not a valid entry point. getSenderAddress did not revert with a SenderAddressResult error.`,
|
|
20
|
+
{
|
|
21
|
+
cause
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Returns the address of the account that will be deployed with the given init code.
|
|
29
|
+
*
|
|
30
|
+
* - Docs: https://docs.pimlico.io/permissionless/reference/public-actions/getSenderAddress
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* @param publicClient {@link PublicClient} that you created using viem's createPublicClient.
|
|
34
|
+
* @param args {@link GetSenderAddressParams}
|
|
35
|
+
* @returns Address
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* import { createPublicClient } from "viem"
|
|
39
|
+
* import { getSenderAddress } from "permissionless/actions"
|
|
40
|
+
*
|
|
41
|
+
* const publicClient = createPublicClient({
|
|
42
|
+
* chain: goerli,
|
|
43
|
+
* transport: http("https://goerli.infura.io/v3/your-infura-key")
|
|
44
|
+
* })
|
|
45
|
+
*
|
|
46
|
+
* const senderAddress = await getSenderAddress(publicClient, {
|
|
47
|
+
* initCode,
|
|
48
|
+
* entryPoint
|
|
49
|
+
* })
|
|
50
|
+
*
|
|
51
|
+
* // Return '0x7a88a206ba40b37a8c07a2b5688cf8b287318b63'
|
|
52
|
+
*/
|
|
53
|
+
export const getSenderAddress = async (
|
|
54
|
+
publicClient: PublicClient,
|
|
55
|
+
{ initCode, entryPoint }: GetSenderAddressParams
|
|
56
|
+
): Promise<Address> => {
|
|
57
|
+
try {
|
|
58
|
+
await publicClient.simulateContract({
|
|
59
|
+
address: entryPoint,
|
|
60
|
+
abi: [
|
|
61
|
+
{
|
|
62
|
+
inputs: [
|
|
63
|
+
{
|
|
64
|
+
internalType: "address",
|
|
65
|
+
name: "sender",
|
|
66
|
+
type: "address"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
name: "SenderAddressResult",
|
|
70
|
+
type: "error"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
inputs: [
|
|
74
|
+
{
|
|
75
|
+
internalType: "bytes",
|
|
76
|
+
name: "initCode",
|
|
77
|
+
type: "bytes"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
name: "getSenderAddress",
|
|
81
|
+
outputs: [],
|
|
82
|
+
stateMutability: "nonpayable",
|
|
83
|
+
type: "function"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
functionName: "getSenderAddress",
|
|
87
|
+
args: [initCode]
|
|
88
|
+
})
|
|
89
|
+
} catch (e) {
|
|
90
|
+
const err = e as ContractFunctionExecutionErrorType
|
|
91
|
+
|
|
92
|
+
if (err.cause.name === "ContractFunctionRevertedError") {
|
|
93
|
+
const revertError = err.cause as ContractFunctionRevertedErrorType
|
|
94
|
+
const errorName = revertError.data?.errorName ?? ""
|
|
95
|
+
if (errorName === "SenderAddressResult" && revertError.data?.args && revertError.data?.args[0]) {
|
|
96
|
+
return revertError.data?.args[0] as Address
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
throw e
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
throw new InvalidEntryPointError({ entryPoint })
|
|
104
|
+
}
|
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.5",
|
|
4
4
|
"author": "Pimlico",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
@@ -42,9 +42,14 @@
|
|
|
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": {
|
|
48
|
-
"viem": "^1.
|
|
53
|
+
"viem": "^1.14.0"
|
|
49
54
|
}
|
|
50
55
|
}
|