@settlemint/dalp-sdk 3.1.16 → 3.1.17-main.33781630598
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/README.md +154 -169
- package/dist/auth/client.d.ts +113 -0
- package/dist/auth/live.d.ts +4366 -0
- package/dist/{auth-permissions.d.ts → auth/permissions.d.ts} +1 -2
- package/dist/{auth-wallet-plugins.d.ts → auth/wallet-plugins.d.ts} +69 -5
- package/dist/auth.d.ts +22 -115
- package/dist/auth.js +329 -0
- package/dist/bundler.d.ts +14 -207
- package/dist/bundler.js +99 -0
- package/dist/chunk-18qmk0m7.js +4 -0
- package/dist/chunk-def7rqy6.js +946 -0
- package/dist/chunk-f4t1bm86.js +67 -0
- package/dist/chunk-fjnq61hj.js +11 -0
- package/dist/chunk-h12fatty.js +63 -0
- package/dist/chunk-phgqjt4j.js +260 -0
- package/dist/chunk-r0vsftj4.js +102 -0
- package/dist/chunk-x0z79vz6.js +33 -0
- package/dist/chunk-y0d2c7kp.js +54 -0
- package/dist/client/conditional-request.d.ts +30 -0
- package/dist/client/factory.d.ts +14 -0
- package/dist/client/query-serializer.d.ts +2 -0
- package/dist/client/request-compression.d.ts +47 -0
- package/dist/client/ssr-fetch.d.ts +12 -0
- package/dist/effect.d.ts +69 -0
- package/dist/effect.js +82 -0
- package/dist/errors/api-error.d.ts +29 -0
- package/dist/errors/find-current-error.d.ts +8 -0
- package/dist/errors/sdk-error.d.ts +52 -0
- package/dist/errors/sdk-error.js +8 -0
- package/dist/generated/api-types.d.ts +41271 -0
- package/dist/generated/response-scalars.d.ts +9 -0
- package/dist/generated/routes.d.ts +12 -0
- package/dist/index.d.ts +28 -40
- package/dist/index.js +131 -96109
- package/dist/proxy/builder.d.ts +47 -0
- package/dist/proxy/client.d.ts +32 -0
- package/dist/proxy/fetch-executor.d.ts +28 -0
- package/dist/proxy/flat-args.d.ts +51 -0
- package/dist/proxy/settlement.d.ts +67 -0
- package/dist/proxy/sse.d.ts +54 -0
- package/dist/proxy/tanstack.d.ts +27 -0
- package/dist/proxy/transport.d.ts +73 -0
- package/dist/react-query.d.ts +16 -0
- package/dist/react-query.js +13 -0
- package/dist/readonly-deep.d.ts +12 -0
- package/dist/reads-as-funding-paused.d.ts +20 -0
- package/dist/routes/index.d.ts +20 -0
- package/dist/routes/index.js +10 -0
- package/dist/routes/types.d.ts +51 -0
- package/dist/runtime-exports.d.ts +20 -0
- package/dist/runtime-exports.js +16 -0
- package/dist/scalars/big-decimal.d.ts +16 -0
- package/dist/scalars/ethereum-address.d.ts +20 -0
- package/dist/scalars/exchange-rates.d.ts +27 -0
- package/dist/scalars/index.d.ts +18 -0
- package/dist/scalars/index.js +86 -0
- package/dist/scalars/organization-id.d.ts +20 -0
- package/dist/secret.d.ts +14 -0
- package/dist/sign-webhook-receipt.d.ts +76 -0
- package/dist/sign-webhook-receipt.js +26 -0
- package/dist/transport/cookie-store.d.ts +9 -0
- package/dist/transport/sse-lifecycle.d.ts +44 -0
- package/dist/types.d.ts +65 -102
- package/dist/url.d.ts +0 -1
- package/dist/verify-webhook.d.ts +17 -28
- package/dist/verify-webhook.js +8 -0
- package/dist/version.d.ts +0 -1
- package/dist/wait-for-transaction.d.ts +54 -81
- package/dist/wait-for-transaction.js +120 -0
- package/dist/webhook-events.d.ts +44 -27
- package/package.json +103 -30
- package/dist/auth-permissions.d.ts.map +0 -1
- package/dist/auth-wallet-plugins.d.ts.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/bundler.d.ts.map +0 -1
- package/dist/chunk-xm8h1dzh.js +0 -33
- package/dist/client.d.ts +0 -19
- package/dist/client.d.ts.map +0 -1
- package/dist/contract-errors.d.ts +0 -4156
- package/dist/contract-errors.d.ts.map +0 -1
- package/dist/contract.d.ts +0 -17
- package/dist/contract.d.ts.map +0 -1
- package/dist/cookie-store.d.ts +0 -10
- package/dist/cookie-store.d.ts.map +0 -1
- package/dist/dapi-errors.d.ts +0 -650
- package/dist/dapi-errors.d.ts.map +0 -1
- package/dist/errors.d.ts +0 -633
- package/dist/errors.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/platform.d.ts +0 -41
- package/dist/platform.d.ts.map +0 -1
- package/dist/plugins/index.d.ts +0 -13
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -10
- package/dist/sdk-error.d.ts +0 -74
- package/dist/sdk-error.d.ts.map +0 -1
- package/dist/serializers.d.ts +0 -41
- package/dist/serializers.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/url.d.ts.map +0 -1
- package/dist/verify-webhook.d.ts.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/wait-for-transaction.d.ts.map +0 -1
- package/dist/webhook-events.d.ts.map +0 -1
package/dist/bundler.d.ts
CHANGED
|
@@ -1,217 +1,24 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
2
|
import type { RpcEstimateUserOperationGasReturnType, RpcUserOperation, RpcUserOperationRequest } from "viem/account-abstraction";
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
/**
|
|
6
|
-
* viem's ERC-4337 RPC **input** types, re-exported under SDK-owned names so
|
|
7
|
-
* consumer code never imports from `viem`. These stay type-only — `import type`
|
|
8
|
-
* keeps viem's account-abstraction runtime off the published call path. The
|
|
9
|
-
* viem generic is pinned to `"0.9"` because the DALP bundler serves EntryPoint
|
|
10
|
-
* v0.9 only and reconstructs a `UserOperation<"0.9">` from the v0.9 fields; the
|
|
11
|
-
* version-generic types would accept older-EntryPoint fields (`initCode`,
|
|
12
|
-
* `paymasterAndData`) the server silently drops.
|
|
13
|
-
*/
|
|
3
|
+
import type { DalpFetch } from "./client/ssr-fetch.ts";
|
|
4
|
+
import type { ReadonlyDeep } from "./readonly-deep.ts";
|
|
14
5
|
export type DalpEstimateUserOperationGasReturnType = RpcEstimateUserOperationGasReturnType<"0.9">;
|
|
15
6
|
export type DalpUserOperation = RpcUserOperation<"0.9">;
|
|
16
7
|
export type DalpUserOperationRequest = RpcUserOperationRequest<"0.9">;
|
|
17
|
-
/**
|
|
18
|
-
* ERC-7769 / ERC-4337 account-abstraction JSON-RPC error codes, vendored from
|
|
19
|
-
* `kit/dapi/src/routes/bundler/types.ts`. The catalog is non-contiguous:
|
|
20
|
-
* `-32506` is intentionally absent from this v0.9 dispatcher surface. The codes
|
|
21
|
-
* are fixed by ERC-7769, so the drift test (`bundler.test.ts`) asserts these
|
|
22
|
-
* against the explicit standard values as a transcription guard.
|
|
23
|
-
*/
|
|
24
|
-
export declare const BUNDLER_AA_ERROR_CODES: {
|
|
25
|
-
readonly AA_VALIDATION: -32500;
|
|
26
|
-
readonly AA_PAYMASTER_VALIDATION: -32501;
|
|
27
|
-
readonly AA_OPCODE: -32502;
|
|
28
|
-
readonly AA_OUT_OF_TIME_RANGE: -32503;
|
|
29
|
-
readonly AA_PAYMASTER_THROTTLED: -32504;
|
|
30
|
-
readonly AA_STAKE: -32505;
|
|
31
|
-
readonly AA_SIGNATURE: -32507;
|
|
32
|
-
readonly AA_PAYMASTER_BALANCE: -32508;
|
|
33
|
-
};
|
|
34
|
-
export declare const BUNDLER_VENDOR_ERROR_CODES: {
|
|
35
|
-
readonly EXECUTION_REVERTED: -32521;
|
|
36
|
-
};
|
|
37
|
-
/** Name of a vendored ERC-7769 account-abstraction error code. */
|
|
38
|
-
export type BundlerAaErrorName = keyof typeof BUNDLER_AA_ERROR_CODES;
|
|
39
|
-
export type BundlerVendorErrorName = keyof typeof BUNDLER_VENDOR_ERROR_CODES;
|
|
40
|
-
/** Options for constructing a {@link DalpBundlerError}. */
|
|
41
|
-
export interface DalpBundlerErrorOptions {
|
|
42
|
-
/** The numeric JSON-RPC error code returned by the bundler endpoint. */
|
|
43
|
-
code: number;
|
|
44
|
-
message: string;
|
|
45
|
-
why: string;
|
|
46
|
-
fix: string;
|
|
47
|
-
aaErrorName?: BundlerAaErrorName;
|
|
48
|
-
vendorErrorName?: BundlerVendorErrorName;
|
|
49
|
-
revertData?: Hex;
|
|
50
|
-
dapiError?: DapiPublicError;
|
|
51
|
-
status?: number;
|
|
52
|
-
/** Whether the failure is retryable. Defaults to `false` when omitted. */
|
|
53
|
-
retryable?: boolean;
|
|
54
|
-
cause?: unknown;
|
|
55
|
-
}
|
|
56
|
-
declare class DalpBundlerRpcError extends DalpSdkError {
|
|
57
|
-
/** The vendored AA error name when `code` maps to a known ERC-7769 code. */
|
|
58
|
-
readonly aaErrorName?: BundlerAaErrorName;
|
|
59
|
-
readonly vendorErrorName?: BundlerVendorErrorName;
|
|
60
|
-
readonly revertData?: Hex;
|
|
61
|
-
constructor(options: DalpBundlerErrorOptions);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* A bundler/paymaster JSON-RPC failure. Extends {@link DalpSdkError}; the
|
|
65
|
-
* `code` field carries the numeric ERC-7769 JSON-RPC error code so callers can
|
|
66
|
-
* branch on `BUNDLER_AA_ERROR_CODES`. The concrete class is re-typed here so
|
|
67
|
-
* `code` surfaces as `number` rather than ORPCError's inherited `string`.
|
|
68
|
-
*/
|
|
69
|
-
export type DalpBundlerError = Omit<DalpBundlerRpcError, "code"> & {
|
|
70
|
-
readonly code: number;
|
|
71
|
-
};
|
|
72
|
-
export declare const DalpBundlerError: {
|
|
73
|
-
new (options: DalpBundlerErrorOptions): DalpBundlerError;
|
|
74
|
-
readonly prototype: DalpBundlerError;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* A mined or in-flight UserOperation as returned by `eth_getUserOperationByHash`.
|
|
78
|
-
*
|
|
79
|
-
* SDK-owned (not viem's `RpcGetUserOperationByHashReturnType`) because the server
|
|
80
|
-
* emits a DALP-partial shape: a mined result carries only
|
|
81
|
-
* `userOperation: { sender, nonce }` with `blockHash: null`, while an in-flight
|
|
82
|
-
* result carries the full canonical UserOperation with `blockNumber`/`blockHash`/
|
|
83
|
-
* `transactionHash` null. Fields the server always emits are required; fields it
|
|
84
|
-
* omits are optional.
|
|
85
|
-
*/
|
|
86
|
-
export interface BundlerUserOperationByHash {
|
|
87
|
-
userOperation: {
|
|
88
|
-
sender: Address;
|
|
89
|
-
nonce: Hex;
|
|
90
|
-
callData?: Hex;
|
|
91
|
-
callGasLimit?: Hex;
|
|
92
|
-
verificationGasLimit?: Hex;
|
|
93
|
-
preVerificationGas?: Hex;
|
|
94
|
-
maxFeePerGas?: Hex;
|
|
95
|
-
maxPriorityFeePerGas?: Hex;
|
|
96
|
-
factory?: Address;
|
|
97
|
-
factoryData?: Hex;
|
|
98
|
-
paymaster?: Address;
|
|
99
|
-
paymasterVerificationGasLimit?: Hex;
|
|
100
|
-
paymasterPostOpGasLimit?: Hex;
|
|
101
|
-
paymasterData?: Hex;
|
|
102
|
-
signature?: Hex;
|
|
103
|
-
};
|
|
104
|
-
entryPoint: Address;
|
|
105
|
-
transactionHash: Hex | null;
|
|
106
|
-
blockNumber: Hex | null;
|
|
107
|
-
blockHash: Hex | null;
|
|
108
|
-
}
|
|
109
|
-
/** A single log entry within a {@link BundlerUserOperationReceipt}. */
|
|
110
|
-
export interface BundlerUserOperationReceiptLog {
|
|
111
|
-
address: Address;
|
|
112
|
-
/** Raw indexed EVM log topics for this UserOperation-attributed event. */
|
|
113
|
-
topics: Hex[];
|
|
114
|
-
data: Hex;
|
|
115
|
-
blockNumber: Hex;
|
|
116
|
-
blockHash: Hex | null;
|
|
117
|
-
transactionHash: Hex;
|
|
118
|
-
transactionIndex: Hex;
|
|
119
|
-
logIndex: Hex;
|
|
120
|
-
removed: boolean;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* A UserOperation receipt as returned by `eth_getUserOperationReceipt`.
|
|
124
|
-
*
|
|
125
|
-
* SDK-owned (not viem's `RpcUserOperationReceipt`) because the server emits a
|
|
126
|
-
* minimal `receipt` ({@link BundlerUserOperationReceipt.receipt}), logs with a
|
|
127
|
-
* nullable `blockHash`, and a nullable `paymaster`.
|
|
128
|
-
*/
|
|
129
|
-
export interface BundlerUserOperationReceipt {
|
|
130
|
-
userOpHash: Hex;
|
|
131
|
-
entryPoint: Address;
|
|
132
|
-
sender: Address;
|
|
133
|
-
nonce: Hex;
|
|
134
|
-
paymaster: Address | null;
|
|
135
|
-
actualGasCost: Hex;
|
|
136
|
-
actualGasUsed: Hex;
|
|
137
|
-
success: boolean;
|
|
138
|
-
logs: BundlerUserOperationReceiptLog[];
|
|
139
|
-
receipt: {
|
|
140
|
-
transactionHash: Hex;
|
|
141
|
-
blockNumber: Hex;
|
|
142
|
-
transactionIndex: Hex;
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
/** Result of `pm_getPaymasterStubData`. */
|
|
146
|
-
export interface BundlerPaymasterStubData {
|
|
147
|
-
paymaster: Address;
|
|
148
|
-
paymasterData: Hex;
|
|
149
|
-
paymasterVerificationGasLimit?: Hex;
|
|
150
|
-
paymasterPostOpGasLimit?: Hex;
|
|
151
|
-
}
|
|
152
|
-
/** Result of `pm_getPaymasterData`. */
|
|
153
|
-
export interface BundlerPaymasterData {
|
|
154
|
-
paymaster: Address;
|
|
155
|
-
paymasterData: Hex;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Configuration for {@link createDalpBundlerClient}.
|
|
159
|
-
*
|
|
160
|
-
* Unlike {@link createDalpClient}, `apiKey` is **required**: the bundler
|
|
161
|
-
* endpoint is auth-only (`requireApiKey: true`) with no public variant.
|
|
162
|
-
*/
|
|
163
8
|
export interface DalpBundlerClientConfig {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Organization ID for multi-tenant setups.
|
|
170
|
-
* Pass this explicitly when the API key may map to more than one organization.
|
|
171
|
-
*/
|
|
172
|
-
organizationId?: string;
|
|
173
|
-
/**
|
|
174
|
-
* Additional headers merged into every request. Cannot override the security
|
|
175
|
-
* headers (`x-api-key`, `x-organization-id`).
|
|
176
|
-
*/
|
|
177
|
-
headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
|
|
178
|
-
/** Custom `fetch` implementation (logging, proxy, test doubles). */
|
|
179
|
-
fetch?: typeof globalThis.fetch;
|
|
9
|
+
readonly url: string;
|
|
10
|
+
readonly apiKey: string;
|
|
11
|
+
readonly organizationId?: string;
|
|
12
|
+
readonly fetch?: DalpFetch;
|
|
180
13
|
}
|
|
181
|
-
/** A typed client over the eight ERC-4337 / ERC-7677 bundler JSON-RPC methods. */
|
|
182
14
|
export interface DalpBundlerClient {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
* signature fields the estimate computes need not be populated.
|
|
189
|
-
*/
|
|
190
|
-
estimateUserOperationGas(userOperation: RpcUserOperationRequest<"0.9">, entryPoint: Address): Promise<RpcEstimateUserOperationGasReturnType<"0.9">>;
|
|
191
|
-
/** `eth_getUserOperationByHash` — resolves the (DALP-partial) UserOperation, or `null` on miss. */
|
|
192
|
-
getUserOperationByHash(hash: Hex): Promise<BundlerUserOperationByHash | null>;
|
|
193
|
-
/** `eth_getUserOperationReceipt` — resolves the receipt, or `null` on miss. */
|
|
194
|
-
getUserOperationReceipt(hash: Hex): Promise<BundlerUserOperationReceipt | null>;
|
|
195
|
-
/** `eth_supportedEntryPoints` — the EntryPoint addresses this bundler serves. */
|
|
196
|
-
getSupportedEntryPoints(): Promise<Address[]>;
|
|
197
|
-
/**
|
|
198
|
-
* `eth_chainId` — the served chain id as a `bigint`, decoded from its hex
|
|
199
|
-
* quantity. Returns `bigint` (not `number`) so chain ids above
|
|
200
|
-
* `Number.MAX_SAFE_INTEGER` are represented without precision loss.
|
|
201
|
-
*/
|
|
15
|
+
sendUserOperation(operation: ReadonlyDeep<DalpUserOperation>, entryPoint: Address): Promise<Hex>;
|
|
16
|
+
estimateUserOperationGas(operation: ReadonlyDeep<DalpUserOperationRequest>, entryPoint: Address): Promise<DalpEstimateUserOperationGasReturnType>;
|
|
17
|
+
getUserOperationByHash(hash: Hex): Promise<unknown>;
|
|
18
|
+
getUserOperationReceipt(hash: Hex): Promise<unknown>;
|
|
19
|
+
getSupportedEntryPoints(): Promise<ReadonlyArray<Address>>;
|
|
202
20
|
getChainId(): Promise<bigint>;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
* the partial request shape (`RpcUserOperationRequest`); paymaster fields are
|
|
206
|
-
* what this call produces.
|
|
207
|
-
*/
|
|
208
|
-
getPaymasterStubData(userOperation: RpcUserOperationRequest<"0.9">, entryPoint: Address, chainId: number | bigint, context?: unknown): Promise<BundlerPaymasterStubData>;
|
|
209
|
-
/**
|
|
210
|
-
* `pm_getPaymasterData` — final paymaster sponsorship data. Takes the partial
|
|
211
|
-
* request shape (`RpcUserOperationRequest`).
|
|
212
|
-
*/
|
|
213
|
-
getPaymasterData(userOperation: RpcUserOperationRequest<"0.9">, entryPoint: Address, chainId: number | bigint, context?: unknown): Promise<BundlerPaymasterData>;
|
|
21
|
+
getPaymasterStubData(operation: ReadonlyDeep<DalpUserOperationRequest>, entryPoint: Address): Promise<unknown>;
|
|
22
|
+
getPaymasterData(operation: ReadonlyDeep<DalpUserOperationRequest>, entryPoint: Address): Promise<unknown>;
|
|
214
23
|
}
|
|
215
24
|
export declare function createDalpBundlerClient(config: DalpBundlerClientConfig): DalpBundlerClient;
|
|
216
|
-
export {};
|
|
217
|
-
//# sourceMappingURL=bundler.d.ts.map
|
package/dist/bundler.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDalpClient
|
|
3
|
+
} from "./chunk-x0z79vz6.js";
|
|
4
|
+
import"./chunk-f4t1bm86.js";
|
|
5
|
+
import"./chunk-def7rqy6.js";
|
|
6
|
+
import"./chunk-fjnq61hj.js";
|
|
7
|
+
import"./chunk-18qmk0m7.js";
|
|
8
|
+
import"./chunk-h12fatty.js";
|
|
9
|
+
import"./chunk-y0d2c7kp.js";
|
|
10
|
+
|
|
11
|
+
// src/bundler.ts
|
|
12
|
+
import { getAddress, hexToBigInt, isHex } from "viem";
|
|
13
|
+
var responseData = (result) => {
|
|
14
|
+
const body = result !== null && typeof result === "object" ? Reflect.get(result, "data") : undefined;
|
|
15
|
+
const unwrapped = body ?? result;
|
|
16
|
+
return unwrapped !== null && typeof unwrapped === "object" ? unwrapped : {};
|
|
17
|
+
};
|
|
18
|
+
var requireHex = (value, field) => {
|
|
19
|
+
if (typeof value !== "string" || !isHex(value)) {
|
|
20
|
+
throw new TypeError(`DALP bundler response: ${field} must be an Ethereum hex value.`);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
function createDalpBundlerClient(config) {
|
|
25
|
+
const client = createDalpClient({
|
|
26
|
+
baseUrl: config.url,
|
|
27
|
+
apiKey: config.apiKey,
|
|
28
|
+
context: { organizationId: config.organizationId },
|
|
29
|
+
fetch: config.fetch,
|
|
30
|
+
runtime: "server"
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
async sendUserOperation(operation, entryPoint) {
|
|
34
|
+
const result = await client.execute("transactions/bundler/sendUserOperation", {
|
|
35
|
+
userOperation: operation,
|
|
36
|
+
entryPoint
|
|
37
|
+
});
|
|
38
|
+
return requireHex(responseData(result)["userOperationHash"], "userOperationHash");
|
|
39
|
+
},
|
|
40
|
+
async estimateUserOperationGas(operation, entryPoint) {
|
|
41
|
+
const result = await client.execute("transactions/bundler/estimateUserOperationGas", {
|
|
42
|
+
userOperation: operation,
|
|
43
|
+
entryPoint
|
|
44
|
+
});
|
|
45
|
+
const data = responseData(result);
|
|
46
|
+
return {
|
|
47
|
+
preVerificationGas: requireHex(data["preVerificationGas"], "preVerificationGas"),
|
|
48
|
+
verificationGasLimit: requireHex(data["verificationGasLimit"], "verificationGasLimit"),
|
|
49
|
+
callGasLimit: requireHex(data["callGasLimit"], "callGasLimit"),
|
|
50
|
+
...data["paymasterVerificationGasLimit"] === undefined ? {} : {
|
|
51
|
+
paymasterVerificationGasLimit: requireHex(data["paymasterVerificationGasLimit"], "paymasterVerificationGasLimit")
|
|
52
|
+
},
|
|
53
|
+
...data["paymasterPostOpGasLimit"] === undefined ? {} : { paymasterPostOpGasLimit: requireHex(data["paymasterPostOpGasLimit"], "paymasterPostOpGasLimit") }
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
async getUserOperationByHash(hash) {
|
|
57
|
+
const result = await client.execute("transactions/bundler/getUserOperationByHash", { userOperationHash: hash });
|
|
58
|
+
return responseData(result);
|
|
59
|
+
},
|
|
60
|
+
async getUserOperationReceipt(hash) {
|
|
61
|
+
const result = await client.execute("transactions/bundler/getUserOperationReceipt", { userOperationHash: hash });
|
|
62
|
+
return responseData(result);
|
|
63
|
+
},
|
|
64
|
+
async getSupportedEntryPoints() {
|
|
65
|
+
const result = await client.execute("transactions/bundler/getSupportedEntryPoints");
|
|
66
|
+
const entryPoints = responseData(result)["entryPoints"];
|
|
67
|
+
if (!Array.isArray(entryPoints)) {
|
|
68
|
+
throw new TypeError("DALP bundler response: entryPoints must be an array.");
|
|
69
|
+
}
|
|
70
|
+
return entryPoints.map((entryPoint) => {
|
|
71
|
+
if (typeof entryPoint !== "string") {
|
|
72
|
+
throw new TypeError("DALP bundler response: each entry point must be a string address.");
|
|
73
|
+
}
|
|
74
|
+
return getAddress(entryPoint);
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
async getChainId() {
|
|
78
|
+
const result = await client.execute("transactions/bundler/getChainId");
|
|
79
|
+
return hexToBigInt(requireHex(responseData(result)["chainId"], "chainId"));
|
|
80
|
+
},
|
|
81
|
+
async getPaymasterStubData(operation, entryPoint) {
|
|
82
|
+
const result = await client.execute("transactions/bundler/getPaymasterStubData", {
|
|
83
|
+
userOperation: operation,
|
|
84
|
+
entryPoint
|
|
85
|
+
});
|
|
86
|
+
return responseData(result);
|
|
87
|
+
},
|
|
88
|
+
async getPaymasterData(operation, entryPoint) {
|
|
89
|
+
const result = await client.execute("transactions/bundler/getPaymasterData", {
|
|
90
|
+
userOperation: operation,
|
|
91
|
+
entryPoint
|
|
92
|
+
});
|
|
93
|
+
return responseData(result);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
createDalpBundlerClient
|
|
99
|
+
};
|