@gelatocloud/gasless 0.0.0

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.
Files changed (204) hide show
  1. package/_dist/account/actions/getFeeQuote.d.ts +11 -0
  2. package/_dist/account/actions/getFeeQuote.d.ts.map +1 -0
  3. package/_dist/account/actions/getFeeQuote.js +21 -0
  4. package/_dist/account/actions/getFeeQuote.js.map +1 -0
  5. package/_dist/account/actions/index.d.ts +4 -0
  6. package/_dist/account/actions/index.d.ts.map +1 -0
  7. package/_dist/account/actions/index.js +20 -0
  8. package/_dist/account/actions/index.js.map +1 -0
  9. package/_dist/account/actions/sendTransaction.d.ts +20 -0
  10. package/_dist/account/actions/sendTransaction.d.ts.map +1 -0
  11. package/_dist/account/actions/sendTransaction.js +33 -0
  12. package/_dist/account/actions/sendTransaction.js.map +1 -0
  13. package/_dist/account/actions/sendTransactionSync.d.ts +9 -0
  14. package/_dist/account/actions/sendTransactionSync.d.ts.map +1 -0
  15. package/_dist/account/actions/sendTransactionSync.js +34 -0
  16. package/_dist/account/actions/sendTransactionSync.js.map +1 -0
  17. package/_dist/account/adapters/gelato/abi.d.ts +39 -0
  18. package/_dist/account/adapters/gelato/abi.d.ts.map +1 -0
  19. package/_dist/account/adapters/gelato/abi.js +13 -0
  20. package/_dist/account/adapters/gelato/abi.js.map +1 -0
  21. package/_dist/account/adapters/gelato/constants.d.ts +7 -0
  22. package/_dist/account/adapters/gelato/constants.d.ts.map +1 -0
  23. package/_dist/account/adapters/gelato/constants.js +9 -0
  24. package/_dist/account/adapters/gelato/constants.js.map +1 -0
  25. package/_dist/account/adapters/gelato/index.d.ts +10 -0
  26. package/_dist/account/adapters/gelato/index.d.ts.map +1 -0
  27. package/_dist/account/adapters/gelato/index.js +160 -0
  28. package/_dist/account/adapters/gelato/index.js.map +1 -0
  29. package/_dist/account/adapters/index.d.ts +2 -0
  30. package/_dist/account/adapters/index.d.ts.map +1 -0
  31. package/_dist/account/adapters/index.js +18 -0
  32. package/_dist/account/adapters/index.js.map +1 -0
  33. package/_dist/account/adapters/types/index.d.ts +22 -0
  34. package/_dist/account/adapters/types/index.d.ts.map +1 -0
  35. package/_dist/account/adapters/types/index.js +3 -0
  36. package/_dist/account/adapters/types/index.js.map +1 -0
  37. package/_dist/account/index.d.ts +17 -0
  38. package/_dist/account/index.d.ts.map +1 -0
  39. package/_dist/account/index.js +41 -0
  40. package/_dist/account/index.js.map +1 -0
  41. package/_dist/account/utils/delegation.d.ts +4 -0
  42. package/_dist/account/utils/delegation.d.ts.map +1 -0
  43. package/_dist/account/utils/delegation.js +12 -0
  44. package/_dist/account/utils/delegation.js.map +1 -0
  45. package/_dist/account/utils/estimation.d.ts +3 -0
  46. package/_dist/account/utils/estimation.d.ts.map +1 -0
  47. package/_dist/account/utils/estimation.js +19 -0
  48. package/_dist/account/utils/estimation.js.map +1 -0
  49. package/_dist/account/utils/index.d.ts +3 -0
  50. package/_dist/account/utils/index.d.ts.map +1 -0
  51. package/_dist/account/utils/index.js +19 -0
  52. package/_dist/account/utils/index.js.map +1 -0
  53. package/_dist/bundler/actions/estimateUserOperationGas.d.ts +6 -0
  54. package/_dist/bundler/actions/estimateUserOperationGas.d.ts.map +1 -0
  55. package/_dist/bundler/actions/estimateUserOperationGas.js +43 -0
  56. package/_dist/bundler/actions/estimateUserOperationGas.js.map +1 -0
  57. package/_dist/bundler/actions/getUserOperationGasPrice.d.ts +5 -0
  58. package/_dist/bundler/actions/getUserOperationGasPrice.d.ts.map +1 -0
  59. package/_dist/bundler/actions/getUserOperationGasPrice.js +20 -0
  60. package/_dist/bundler/actions/getUserOperationGasPrice.js.map +1 -0
  61. package/_dist/bundler/actions/getUserOperationQuote.d.ts +13 -0
  62. package/_dist/bundler/actions/getUserOperationQuote.d.ts.map +1 -0
  63. package/_dist/bundler/actions/getUserOperationQuote.js +50 -0
  64. package/_dist/bundler/actions/getUserOperationQuote.js.map +1 -0
  65. package/_dist/bundler/actions/index.d.ts +7 -0
  66. package/_dist/bundler/actions/index.d.ts.map +1 -0
  67. package/_dist/bundler/actions/index.js +23 -0
  68. package/_dist/bundler/actions/index.js.map +1 -0
  69. package/_dist/bundler/actions/prepareUserOperation.d.ts +6 -0
  70. package/_dist/bundler/actions/prepareUserOperation.d.ts.map +1 -0
  71. package/_dist/bundler/actions/prepareUserOperation.js +340 -0
  72. package/_dist/bundler/actions/prepareUserOperation.js.map +1 -0
  73. package/_dist/bundler/actions/sendUserOperation.d.ts +6 -0
  74. package/_dist/bundler/actions/sendUserOperation.d.ts.map +1 -0
  75. package/_dist/bundler/actions/sendUserOperation.js +41 -0
  76. package/_dist/bundler/actions/sendUserOperation.js.map +1 -0
  77. package/_dist/bundler/actions/sendUserOperationSync.d.ts +9 -0
  78. package/_dist/bundler/actions/sendUserOperationSync.d.ts.map +1 -0
  79. package/_dist/bundler/actions/sendUserOperationSync.js +42 -0
  80. package/_dist/bundler/actions/sendUserOperationSync.js.map +1 -0
  81. package/_dist/bundler/index.d.ts +18 -0
  82. package/_dist/bundler/index.d.ts.map +1 -0
  83. package/_dist/bundler/index.js +61 -0
  84. package/_dist/bundler/index.js.map +1 -0
  85. package/_dist/index.d.ts +5 -0
  86. package/_dist/index.d.ts.map +1 -0
  87. package/_dist/index.js +21 -0
  88. package/_dist/index.js.map +1 -0
  89. package/_dist/relayer/constants/index.d.ts +3 -0
  90. package/_dist/relayer/constants/index.d.ts.map +1 -0
  91. package/_dist/relayer/constants/index.js +6 -0
  92. package/_dist/relayer/constants/index.js.map +1 -0
  93. package/_dist/relayer/evm/actions/getCapabilities.d.ts +21 -0
  94. package/_dist/relayer/evm/actions/getCapabilities.d.ts.map +1 -0
  95. package/_dist/relayer/evm/actions/getCapabilities.js +19 -0
  96. package/_dist/relayer/evm/actions/getCapabilities.js.map +1 -0
  97. package/_dist/relayer/evm/actions/getFeeData.d.ts +21 -0
  98. package/_dist/relayer/evm/actions/getFeeData.d.ts.map +1 -0
  99. package/_dist/relayer/evm/actions/getFeeData.js +26 -0
  100. package/_dist/relayer/evm/actions/getFeeData.js.map +1 -0
  101. package/_dist/relayer/evm/actions/getFeeQuote.d.ts +22 -0
  102. package/_dist/relayer/evm/actions/getFeeQuote.d.ts.map +1 -0
  103. package/_dist/relayer/evm/actions/getFeeQuote.js +27 -0
  104. package/_dist/relayer/evm/actions/getFeeQuote.js.map +1 -0
  105. package/_dist/relayer/evm/actions/getStatus.d.ts +81 -0
  106. package/_dist/relayer/evm/actions/getStatus.d.ts.map +1 -0
  107. package/_dist/relayer/evm/actions/getStatus.js +72 -0
  108. package/_dist/relayer/evm/actions/getStatus.js.map +1 -0
  109. package/_dist/relayer/evm/actions/index.d.ts +8 -0
  110. package/_dist/relayer/evm/actions/index.d.ts.map +1 -0
  111. package/_dist/relayer/evm/actions/index.js +24 -0
  112. package/_dist/relayer/evm/actions/index.js.map +1 -0
  113. package/_dist/relayer/evm/actions/sendTransaction.d.ts +12 -0
  114. package/_dist/relayer/evm/actions/sendTransaction.d.ts.map +1 -0
  115. package/_dist/relayer/evm/actions/sendTransaction.js +22 -0
  116. package/_dist/relayer/evm/actions/sendTransaction.js.map +1 -0
  117. package/_dist/relayer/evm/actions/sendTransactionSync.d.ts +8 -0
  118. package/_dist/relayer/evm/actions/sendTransactionSync.d.ts.map +1 -0
  119. package/_dist/relayer/evm/actions/sendTransactionSync.js +23 -0
  120. package/_dist/relayer/evm/actions/sendTransactionSync.js.map +1 -0
  121. package/_dist/relayer/evm/actions/waitForStatus.d.ts +4 -0
  122. package/_dist/relayer/evm/actions/waitForStatus.d.ts.map +1 -0
  123. package/_dist/relayer/evm/actions/waitForStatus.js +17 -0
  124. package/_dist/relayer/evm/actions/waitForStatus.js.map +1 -0
  125. package/_dist/relayer/evm/index.d.ts +18 -0
  126. package/_dist/relayer/evm/index.d.ts.map +1 -0
  127. package/_dist/relayer/evm/index.js +46 -0
  128. package/_dist/relayer/evm/index.js.map +1 -0
  129. package/_dist/relayer/index.d.ts +2 -0
  130. package/_dist/relayer/index.d.ts.map +1 -0
  131. package/_dist/relayer/index.js +18 -0
  132. package/_dist/relayer/index.js.map +1 -0
  133. package/_dist/tsconfig.build.tsbuildinfo +1 -0
  134. package/_dist/types/error.d.ts +14 -0
  135. package/_dist/types/error.d.ts.map +1 -0
  136. package/_dist/types/error.js +27 -0
  137. package/_dist/types/error.js.map +1 -0
  138. package/_dist/types/index.d.ts +4 -0
  139. package/_dist/types/index.d.ts.map +1 -0
  140. package/_dist/types/index.js +20 -0
  141. package/_dist/types/index.js.map +1 -0
  142. package/_dist/types/payment.d.ts +17 -0
  143. package/_dist/types/payment.d.ts.map +1 -0
  144. package/_dist/types/payment.js +16 -0
  145. package/_dist/types/payment.js.map +1 -0
  146. package/_dist/types/schema.d.ts +10 -0
  147. package/_dist/types/schema.d.ts.map +1 -0
  148. package/_dist/types/schema.js +25 -0
  149. package/_dist/types/schema.js.map +1 -0
  150. package/_dist/utils/index.d.ts +3 -0
  151. package/_dist/utils/index.d.ts.map +1 -0
  152. package/_dist/utils/index.js +19 -0
  153. package/_dist/utils/index.js.map +1 -0
  154. package/_dist/utils/payment.d.ts +3 -0
  155. package/_dist/utils/payment.d.ts.map +1 -0
  156. package/_dist/utils/payment.js +17 -0
  157. package/_dist/utils/payment.js.map +1 -0
  158. package/_dist/utils/serialize.d.ts +17 -0
  159. package/_dist/utils/serialize.d.ts.map +1 -0
  160. package/_dist/utils/serialize.js +77 -0
  161. package/_dist/utils/serialize.js.map +1 -0
  162. package/account/actions/getFeeQuote.ts +34 -0
  163. package/account/actions/index.ts +3 -0
  164. package/account/actions/sendTransaction.ts +61 -0
  165. package/account/actions/sendTransactionSync.ts +51 -0
  166. package/account/adapters/gelato/abi.ts +13 -0
  167. package/account/adapters/gelato/constants.ts +13 -0
  168. package/account/adapters/gelato/index.ts +216 -0
  169. package/account/adapters/index.ts +1 -0
  170. package/account/adapters/types/index.ts +36 -0
  171. package/account/index.ts +60 -0
  172. package/account/utils/delegation.ts +9 -0
  173. package/account/utils/estimation.ts +29 -0
  174. package/account/utils/index.ts +2 -0
  175. package/bundler/actions/estimateUserOperationGas.ts +63 -0
  176. package/bundler/actions/getUserOperationGasPrice.ts +25 -0
  177. package/bundler/actions/getUserOperationQuote.ts +83 -0
  178. package/bundler/actions/index.ts +6 -0
  179. package/bundler/actions/prepareUserOperation.ts +437 -0
  180. package/bundler/actions/sendUserOperation.ts +64 -0
  181. package/bundler/actions/sendUserOperationSync.ts +71 -0
  182. package/bundler/index.ts +98 -0
  183. package/index.ts +4 -0
  184. package/package.json +36 -0
  185. package/relayer/constants/index.ts +2 -0
  186. package/relayer/evm/actions/getCapabilities.ts +22 -0
  187. package/relayer/evm/actions/getFeeData.ts +36 -0
  188. package/relayer/evm/actions/getFeeQuote.ts +39 -0
  189. package/relayer/evm/actions/getStatus.ts +92 -0
  190. package/relayer/evm/actions/index.ts +7 -0
  191. package/relayer/evm/actions/sendTransaction.ts +33 -0
  192. package/relayer/evm/actions/sendTransactionSync.ts +30 -0
  193. package/relayer/evm/actions/waitForStatus.ts +24 -0
  194. package/relayer/evm/index.ts +68 -0
  195. package/relayer/index.ts +1 -0
  196. package/tsconfig.build.json +19 -0
  197. package/tsconfig.json +8 -0
  198. package/types/error.ts +38 -0
  199. package/types/index.ts +3 -0
  200. package/types/payment.ts +23 -0
  201. package/types/schema.ts +28 -0
  202. package/utils/index.ts +2 -0
  203. package/utils/payment.ts +20 -0
  204. package/utils/serialize.ts +91 -0
@@ -0,0 +1,340 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prepareUserOperation = void 0;
4
+ const account_abstraction_1 = require("viem/account-abstraction");
5
+ const accounts_1 = require("viem/accounts");
6
+ const actions_1 = require("viem/actions");
7
+ const utils_1 = require("viem/utils");
8
+ const index_js_1 = require("../../types/index.js");
9
+ const payment_js_1 = require("../../utils/payment.js");
10
+ const estimateUserOperationGas_js_1 = require("./estimateUserOperationGas.js");
11
+ const getUserOperationGasPrice_js_1 = require("./getUserOperationGasPrice.js");
12
+ const getUserOperationQuote_js_1 = require("./getUserOperationQuote.js");
13
+ const defaultParameters = [
14
+ 'factory',
15
+ 'fees',
16
+ 'gas',
17
+ 'paymaster',
18
+ 'nonce',
19
+ 'signature',
20
+ 'authorization'
21
+ ];
22
+ const prepareUserOperation = async (client, parameters_, capabilities, payment, quote = false) => {
23
+ const parameters = parameters_;
24
+ const { account: account_ = client.account, parameters: properties = defaultParameters, stateOverride } = parameters;
25
+ ////////////////////////////////////////////////////////////////////////////////
26
+ // Assert that an Account is defined.
27
+ ////////////////////////////////////////////////////////////////////////////////
28
+ if (!account_)
29
+ throw new index_js_1.AccountNotFoundError();
30
+ const account = (0, accounts_1.parseAccount)(account_);
31
+ ////////////////////////////////////////////////////////////////////////////////
32
+ // Declare typed Bundler Client.
33
+ ////////////////////////////////////////////////////////////////////////////////
34
+ const bundlerClient = client;
35
+ ////////////////////////////////////////////////////////////////////////////////
36
+ // Declare Paymaster properties.
37
+ ////////////////////////////////////////////////////////////////////////////////
38
+ const paymaster = parameters.paymaster ?? bundlerClient?.paymaster;
39
+ const paymasterAddress = typeof paymaster === 'string' ? paymaster : undefined;
40
+ const { getPaymasterStubData, getPaymasterData } = (() => {
41
+ // If `paymaster: true`, we will assume the Bundler Client supports Paymaster Actions.
42
+ if (paymaster === true)
43
+ return {
44
+ // biome-ignore lint/suspicious/noExplicitAny: copied from viem
45
+ getPaymasterData: (parameters) => (0, utils_1.getAction)(bundlerClient, account_abstraction_1.getPaymasterData, 'getPaymasterData')(parameters),
46
+ // biome-ignore lint/suspicious/noExplicitAny: copied from viem
47
+ getPaymasterStubData: (parameters) => (0, utils_1.getAction)(bundlerClient, account_abstraction_1.getPaymasterStubData, 'getPaymasterStubData')(parameters)
48
+ };
49
+ // If Actions are passed to `paymaster` (via Paymaster Client or directly), we will use them.
50
+ if (typeof paymaster === 'object') {
51
+ const { getPaymasterStubData, getPaymasterData } = paymaster;
52
+ return {
53
+ getPaymasterData: getPaymasterData && getPaymasterStubData ? getPaymasterData : undefined,
54
+ getPaymasterStubData: (getPaymasterData && getPaymasterStubData
55
+ ? getPaymasterStubData
56
+ : getPaymasterData)
57
+ };
58
+ }
59
+ // No Paymaster functions.
60
+ return {
61
+ getPaymasterData: undefined,
62
+ getPaymasterStubData: undefined
63
+ };
64
+ })();
65
+ const paymasterContext = parameters.paymasterContext
66
+ ? parameters.paymasterContext
67
+ : bundlerClient?.paymasterContext;
68
+ ////////////////////////////////////////////////////////////////////////////////
69
+ // Set up the User Operation request.
70
+ ////////////////////////////////////////////////////////////////////////////////
71
+ let request = {
72
+ ...parameters,
73
+ paymaster: paymasterAddress,
74
+ sender: account.address
75
+ };
76
+ ////////////////////////////////////////////////////////////////////////////////
77
+ // Concurrently prepare properties required to fill the User Operation.
78
+ ////////////////////////////////////////////////////////////////////////////////
79
+ const [{ callsWithoutPayment, callData }, factory, fees, nonce, authorization] = await Promise.all([
80
+ (async () => {
81
+ if (parameters.calls) {
82
+ const callsWithoutPayment = parameters.calls.map((call_) => {
83
+ const call = call_;
84
+ if (call.abi)
85
+ return {
86
+ data: (0, utils_1.encodeFunctionData)(call),
87
+ to: call.to,
88
+ value: call.value
89
+ };
90
+ return call;
91
+ });
92
+ const calls = payment?.type === index_js_1.PaymentType.Token
93
+ ? (0, payment_js_1.appendPayment)(callsWithoutPayment, payment.address, capabilities.feeCollector, 1n)
94
+ : callsWithoutPayment;
95
+ const callData = await account.encodeCalls(calls);
96
+ return {
97
+ callData,
98
+ callsWithoutPayment
99
+ };
100
+ }
101
+ if (payment?.type !== index_js_1.PaymentType.Token) {
102
+ return {
103
+ callData: parameters.callData,
104
+ callsWithoutPayment: undefined
105
+ };
106
+ }
107
+ if (!account.decodeCalls) {
108
+ throw new Error('Account must be able to decodeCalls in order to append token payments if raw callData is specified');
109
+ }
110
+ const callsWithoutPayment = (await account.decodeCalls(parameters.callData));
111
+ const calls = (0, payment_js_1.appendPayment)(callsWithoutPayment, payment.address, capabilities.feeCollector, 1n);
112
+ const callData = await account.encodeCalls(calls);
113
+ return {
114
+ callData,
115
+ callsWithoutPayment
116
+ };
117
+ })(),
118
+ (async () => {
119
+ if (!properties.includes('factory'))
120
+ return undefined;
121
+ if (parameters.initCode)
122
+ return { initCode: parameters.initCode };
123
+ if (parameters.factory && parameters.factoryData) {
124
+ return {
125
+ factory: parameters.factory,
126
+ factoryData: parameters.factoryData
127
+ };
128
+ }
129
+ const { factory, factoryData } = await account.getFactoryArgs();
130
+ if (account.entryPoint.version === '0.6')
131
+ return {
132
+ initCode: factory && factoryData ? (0, utils_1.concat)([factory, factoryData]) : undefined
133
+ };
134
+ return {
135
+ factory,
136
+ factoryData
137
+ };
138
+ })(),
139
+ (async () => {
140
+ if (!properties.includes('fees'))
141
+ return undefined;
142
+ // If we have sufficient properties for fees, return them.
143
+ if (typeof parameters.maxFeePerGas === 'bigint' &&
144
+ typeof parameters.maxPriorityFeePerGas === 'bigint')
145
+ return request;
146
+ const fees = await (0, getUserOperationGasPrice_js_1.getUserOperationGasPrice)(bundlerClient, payment);
147
+ return {
148
+ ...request,
149
+ ...fees
150
+ };
151
+ })(),
152
+ (async () => {
153
+ if (!properties.includes('nonce'))
154
+ return undefined;
155
+ if (typeof parameters.nonce === 'bigint')
156
+ return parameters.nonce;
157
+ return account.getNonce();
158
+ })(),
159
+ (async () => {
160
+ if (!properties.includes('authorization'))
161
+ return undefined;
162
+ if (typeof parameters.authorization === 'object')
163
+ return parameters.authorization;
164
+ if (account.authorization && !(await account.isDeployed())) {
165
+ const authorization = await (0, actions_1.prepareAuthorization)(account.client, account.authorization);
166
+ return {
167
+ ...authorization,
168
+ r: '0xfffffffffffffffffffffffffffffff000000000000000000000000000000000',
169
+ s: '0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
170
+ yParity: 1
171
+ };
172
+ }
173
+ return undefined;
174
+ })()
175
+ ]);
176
+ ////////////////////////////////////////////////////////////////////////////////
177
+ // Fill User Operation with the prepared properties from above.
178
+ ////////////////////////////////////////////////////////////////////////////////
179
+ if (typeof callData !== 'undefined')
180
+ request.callData = callData;
181
+ // biome-ignore lint/suspicious/noExplicitAny: copied from viem
182
+ if (typeof factory !== 'undefined')
183
+ request = { ...request, ...factory };
184
+ // biome-ignore lint/suspicious/noExplicitAny: copied from viem
185
+ if (typeof fees !== 'undefined')
186
+ request = { ...request, ...fees };
187
+ if (typeof nonce !== 'undefined')
188
+ request.nonce = nonce;
189
+ if (typeof authorization !== 'undefined')
190
+ request.authorization = authorization;
191
+ ////////////////////////////////////////////////////////////////////////////////
192
+ // Fill User Operation with the `signature` property.
193
+ ////////////////////////////////////////////////////////////////////////////////
194
+ if (properties.includes('signature')) {
195
+ if (typeof parameters.signature !== 'undefined')
196
+ request.signature = parameters.signature;
197
+ else
198
+ request.signature = await account.getStubSignature(request);
199
+ }
200
+ ////////////////////////////////////////////////////////////////////////////////
201
+ // `initCode` is required to be filled with EntryPoint 0.6.
202
+ ////////////////////////////////////////////////////////////////////////////////
203
+ // If no `initCode` is provided, we use an empty bytes string.
204
+ if (account.entryPoint.version === '0.6' && !request.initCode)
205
+ request.initCode = '0x';
206
+ ////////////////////////////////////////////////////////////////////////////////
207
+ // Fill User Operation with paymaster-related properties for **gas estimation**.
208
+ ////////////////////////////////////////////////////////////////////////////////
209
+ let chainId;
210
+ async function getChainId() {
211
+ if (chainId)
212
+ return chainId;
213
+ if (client.chain)
214
+ return client.chain.id;
215
+ const chainId_ = await (0, utils_1.getAction)(client, actions_1.getChainId, 'getChainId')({});
216
+ chainId = chainId_;
217
+ return chainId;
218
+ }
219
+ // If the User Operation is intended to be sponsored, we will need to fill the paymaster-related
220
+ // User Operation properties required to estimate the User Operation gas.
221
+ let isPaymasterPopulated = false;
222
+ if (properties.includes('paymaster') &&
223
+ getPaymasterStubData &&
224
+ !paymasterAddress &&
225
+ !parameters.paymasterAndData) {
226
+ const { isFinal = false, sponsor: _, ...paymasterArgs } = await getPaymasterStubData({
227
+ chainId: await getChainId(),
228
+ context: paymasterContext,
229
+ entryPointAddress: account.entryPoint.address,
230
+ ...request
231
+ });
232
+ isPaymasterPopulated = isFinal;
233
+ request = {
234
+ ...request,
235
+ ...paymasterArgs
236
+ };
237
+ }
238
+ ////////////////////////////////////////////////////////////////////////////////
239
+ // `paymasterAndData` is required to be filled with EntryPoint 0.6.
240
+ ////////////////////////////////////////////////////////////////////////////////
241
+ // If no `paymasterAndData` is provided, we use an empty bytes string.
242
+ if (account.entryPoint.version === '0.6' && !request.paymasterAndData)
243
+ request.paymasterAndData = '0x';
244
+ ////////////////////////////////////////////////////////////////////////////////
245
+ // Fill User Operation with gas-related properties.
246
+ ////////////////////////////////////////////////////////////////////////////////
247
+ if (quote && callsWithoutPayment && payment?.type === index_js_1.PaymentType.Token) {
248
+ const quote = await (0, getUserOperationQuote_js_1.getUserOperationQuote)(bundlerClient, {
249
+ account,
250
+ stateOverride,
251
+ ...request
252
+ }, capabilities, payment);
253
+ const calls = (0, payment_js_1.appendPayment)(callsWithoutPayment, payment.address, capabilities.feeCollector, quote.fee);
254
+ const callData = await account.encodeCalls(calls);
255
+ request = {
256
+ ...request,
257
+ callData,
258
+ callGasLimit: request.callGasLimit ?? quote.callGasLimit,
259
+ preVerificationGas: request.preVerificationGas ?? quote.preVerificationGas,
260
+ verificationGasLimit: request.verificationGasLimit ?? quote.verificationGasLimit
261
+ };
262
+ }
263
+ else if (properties.includes('gas')) {
264
+ // If the Account has opinionated gas estimation logic, run the `estimateGas` hook and
265
+ // fill the request with the prepared gas properties.
266
+ if (account.userOperation?.estimateGas) {
267
+ const gas = await account.userOperation.estimateGas(request);
268
+ request = {
269
+ ...request,
270
+ ...gas
271
+ };
272
+ }
273
+ // If not all the gas properties are already populated, we will need to estimate the gas
274
+ // to fill the gas properties.
275
+ if (typeof request.callGasLimit === 'undefined' ||
276
+ typeof request.preVerificationGas === 'undefined' ||
277
+ typeof request.verificationGasLimit === 'undefined' ||
278
+ (request.paymaster && typeof request.paymasterPostOpGasLimit === 'undefined') ||
279
+ (request.paymaster && typeof request.paymasterVerificationGasLimit === 'undefined')) {
280
+ const gas = await (0, estimateUserOperationGas_js_1.estimateUserOperationGas)(bundlerClient, {
281
+ account,
282
+ // Some Bundlers fail if nullish gas values are provided for gas estimation :') –
283
+ // so we will need to set a default zeroish value.
284
+ callGasLimit: 0n,
285
+ preVerificationGas: 0n,
286
+ stateOverride,
287
+ verificationGasLimit: 0n,
288
+ ...(request.paymaster
289
+ ? {
290
+ paymasterPostOpGasLimit: 0n,
291
+ paymasterVerificationGasLimit: 0n
292
+ }
293
+ : {}),
294
+ ...request
295
+ }, capabilities, payment);
296
+ request = {
297
+ ...request,
298
+ callGasLimit: request.callGasLimit ?? gas.callGasLimit,
299
+ paymasterPostOpGasLimit: request.paymasterPostOpGasLimit ?? gas.paymasterPostOpGasLimit,
300
+ paymasterVerificationGasLimit: request.paymasterVerificationGasLimit ?? gas.paymasterVerificationGasLimit,
301
+ preVerificationGas: request.preVerificationGas ?? gas.preVerificationGas,
302
+ verificationGasLimit: request.verificationGasLimit ?? gas.verificationGasLimit
303
+ };
304
+ }
305
+ }
306
+ ////////////////////////////////////////////////////////////////////////////////
307
+ // Fill User Operation with paymaster-related properties for **sending** the User Operation.
308
+ ////////////////////////////////////////////////////////////////////////////////
309
+ // If the User Operation is intended to be sponsored, we will need to fill the paymaster-related
310
+ // User Operation properties required to send the User Operation.
311
+ if (properties.includes('paymaster') &&
312
+ getPaymasterData &&
313
+ !paymasterAddress &&
314
+ !parameters.paymasterAndData &&
315
+ !isPaymasterPopulated) {
316
+ // Retrieve paymaster-related User Operation properties to be used for **sending** the User Operation.
317
+ const paymaster = await getPaymasterData({
318
+ chainId: await getChainId(),
319
+ context: paymasterContext,
320
+ entryPointAddress: account.entryPoint.address,
321
+ ...request
322
+ });
323
+ request = {
324
+ ...request,
325
+ ...paymaster
326
+ };
327
+ }
328
+ ////////////////////////////////////////////////////////////////////////////////
329
+ // Remove redundant properties that do not conform to the User Operation schema.
330
+ ////////////////////////////////////////////////////////////////////////////////
331
+ delete request.calls;
332
+ delete request.parameters;
333
+ delete request.paymasterContext;
334
+ if (typeof request.paymaster !== 'string')
335
+ delete request.paymaster;
336
+ ////////////////////////////////////////////////////////////////////////////////
337
+ return request;
338
+ };
339
+ exports.prepareUserOperation = prepareUserOperation;
340
+ //# sourceMappingURL=prepareUserOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareUserOperation.js","sourceRoot":"","sources":["../../../bundler/actions/prepareUserOperation.ts"],"names":[],"mappings":";;;AACA,kEASkC;AAClC,4CAA6C;AAC7C,0CAA+E;AAC/E,sCAAmE;AAEnE,mDAAuF;AACvF,uDAAuD;AAEvD,+EAAyE;AACzE,+EAAyE;AACzE,yEAAmE;AAEnE,MAAM,iBAAiB,GAAG;IACxB,SAAS;IACT,MAAM;IACN,KAAK;IACL,WAAW;IACX,OAAO;IACP,WAAW;IACX,eAAe;CACP,CAAC;AAEJ,MAAM,oBAAoB,GAAG,KAAK,EAMvC,MAAqD,EACrD,WAAqF,EACrF,YAAiC,EACjC,OAAiB,EACjB,QAAiB,KAAK,EAC6D,EAAE;IACrF,MAAM,UAAU,GAAG,WAA6C,CAAC;IACjE,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,UAAU,EAAE,UAAU,GAAG,iBAAiB,EAC1C,aAAa,EACd,GAAG,UAAU,CAAC;IAEf,gFAAgF;IAChF,qCAAqC;IACrC,gFAAgF;IAEhF,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,+BAAoB,EAAE,CAAC;IAChD,MAAM,OAAO,GAAG,IAAA,uBAAY,EAAC,QAAQ,CAAC,CAAC;IAEvC,gFAAgF;IAChF,gCAAgC;IAChC,gFAAgF;IAEhF,MAAM,aAAa,GAAG,MAAwC,CAAC;IAE/D,gFAAgF;IAChF,gCAAgC;IAChC,gFAAgF;IAEhF,MAAM,SAAS,GAAG,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AO,GAAG;YACR,GAAG,OAAO;YACV,GAAG,SAAS;SACkB,CAAC;IACnC,CAAC;IAED,gFAAgF;IAChF,gFAAgF;IAChF,gFAAgF;IAEhF,OAAO,OAAO,CAAC,KAAK,CAAC;IACrB,OAAO,OAAO,CAAC,UAAU,CAAC;IAC1B,OAAO,OAAO,CAAC,gBAAgB,CAAC;IAChC,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,SAAS,CAAC;IAEpE,gFAAgF;IAEhF,OAAO,OAKN,CAAC;AACJ,CAAC,CAAC;AApZW,QAAA,oBAAoB,wBAoZ/B"}
@@ -0,0 +1,6 @@
1
+ import type { Chain, Client, Transport } from 'viem';
2
+ import { type SendUserOperationParameters, type SendUserOperationReturnType, type SmartAccount } from 'viem/account-abstraction';
3
+ import type { CapabilitiesByChain } from '../../relayer/evm/actions/index.js';
4
+ import { type Payment } from '../../types/index.js';
5
+ export declare const sendUserOperation: <account extends SmartAccount | undefined>(client: Client<Transport, Chain | undefined, account>, parameters: SendUserOperationParameters, capabilities: CapabilitiesByChain, payment?: Payment) => Promise<SendUserOperationReturnType>;
6
+ //# sourceMappingURL=sendUserOperation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendUserOperation.d.ts","sourceRoot":"","sources":["../../../bundler/actions/sendUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,YAAY,EAElB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG1E,eAAO,MAAM,iBAAiB,GAAU,OAAO,SAAS,YAAY,GAAG,SAAS,EAC9E,QAAQ,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,CAAC,EACrD,YAAY,2BAA2B,EACvC,cAAc,mBAAmB,EACjC,UAAU,OAAO,KAChB,OAAO,CAAC,2BAA2B,CA2CrC,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendUserOperation = void 0;
4
+ const account_abstraction_1 = require("viem/account-abstraction");
5
+ const accounts_1 = require("viem/accounts");
6
+ const index_js_1 = require("../../types/index.js");
7
+ const prepareUserOperation_js_1 = require("./prepareUserOperation.js");
8
+ const sendUserOperation = async (client, parameters, capabilities, payment) => {
9
+ const { account: account_ = client.account, entryPointAddress } = parameters;
10
+ if (!account_ && !parameters.sender)
11
+ throw new index_js_1.AccountNotFoundError();
12
+ const account = account_ ? (0, accounts_1.parseAccount)(account_) : undefined;
13
+ const request = account
14
+ ? await (0, prepareUserOperation_js_1.prepareUserOperation)(client, parameters, capabilities, payment, true)
15
+ : parameters;
16
+ // biome-ignore lint/style/noNonNullAssertion: copied from viem
17
+ const signature = (parameters.signature ||
18
+ (await account?.signUserOperation?.(request)));
19
+ const rpcParameters = (0, account_abstraction_1.formatUserOperationRequest)({
20
+ ...request,
21
+ signature
22
+ });
23
+ try {
24
+ return await client.request({
25
+ method: 'eth_sendUserOperation',
26
+ // biome-ignore lint/style/noNonNullAssertion: copied from viem
27
+ params: [rpcParameters, (entryPointAddress ?? account?.entryPoint?.address)]
28
+ }, { retryCount: 0 });
29
+ }
30
+ catch (error) {
31
+ // biome-ignore lint/suspicious/noExplicitAny: copied from viem
32
+ const calls = parameters.calls;
33
+ throw (0, account_abstraction_1.getUserOperationError)(error, {
34
+ ...request,
35
+ ...(calls ? { calls } : {}),
36
+ signature
37
+ });
38
+ }
39
+ };
40
+ exports.sendUserOperation = sendUserOperation;
41
+ //# sourceMappingURL=sendUserOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendUserOperation.js","s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QAC/D,MAAM,KAAK,GAAI,UAAkB,CAAC,KAAK,CAAC;QACxC,MAAM,IAAA,2CAAqB,EAAC,KAAkB,EAAE;YAC9C,GAAI,OAAyB;YAC7B,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,SAAS;SACV,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAhDW,QAAA,iBAAiB,qBAgD5B"}
@@ -0,0 +1,9 @@
1
+ import type { Chain, Client, Transport } from 'viem';
2
+ import { type SendUserOperationParameters, type SmartAccount, type UserOperationReceipt } from 'viem/account-abstraction';
3
+ import type { CapabilitiesByChain } from '../../relayer/evm/actions/index.js';
4
+ import { type Payment } from '../../types/index.js';
5
+ export type SendUserOperationSyncParameters = SendUserOperationParameters & {
6
+ timeout: number;
7
+ };
8
+ export declare const sendUserOperationSync: <account extends SmartAccount | undefined>(client: Client<Transport, Chain | undefined, account>, parameters: SendUserOperationSyncParameters, capabilities: CapabilitiesByChain, payment?: Payment) => Promise<UserOperationReceipt>;
9
+ //# sourceMappingURL=sendUserOperationSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendUserOperationSync.d.ts","sourceRoot":"","sources":["../../../bundler/actions/sendUserOperationSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAChE,OAAO,EAKL,KAAK,2BAA2B,EAChC,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG1E,MAAM,MAAM,+BAA+B,GAAG,2BAA2B,GAAG;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAU,OAAO,SAAS,YAAY,GAAG,SAAS,EAClF,QAAQ,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,CAAC,EACrD,YAAY,+BAA+B,EAC3C,cAAc,mBAAmB,EACjC,UAAU,OAAO,KAChB,OAAO,CAAC,oBAAoB,CA6C9B,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendUserOperationSync = void 0;
4
+ const account_abstraction_1 = require("viem/account-abstraction");
5
+ const accounts_1 = require("viem/accounts");
6
+ const index_js_1 = require("../../types/index.js");
7
+ const prepareUserOperation_js_1 = require("./prepareUserOperation.js");
8
+ const sendUserOperationSync = async (client, parameters, capabilities, payment) => {
9
+ const { account: account_ = client.account, entryPointAddress, timeout } = parameters;
10
+ if (!account_ && !parameters.sender)
11
+ throw new index_js_1.AccountNotFoundError();
12
+ const account = account_ ? (0, accounts_1.parseAccount)(account_) : undefined;
13
+ const request = account
14
+ ? await (0, prepareUserOperation_js_1.prepareUserOperation)(client, parameters, capabilities, payment, true)
15
+ : parameters;
16
+ // biome-ignore lint/style/noNonNullAssertion: copied from viem
17
+ const signature = (parameters.signature ||
18
+ (await account?.signUserOperation?.(request)));
19
+ const rpcParameters = (0, account_abstraction_1.formatUserOperationRequest)({
20
+ ...request,
21
+ signature
22
+ });
23
+ try {
24
+ const receipt = await client.request({
25
+ method: 'eth_sendUserOperationSync',
26
+ // biome-ignore lint/style/noNonNullAssertion: copied from viem
27
+ params: [rpcParameters, (entryPointAddress ?? account?.entryPoint?.address), { timeout }]
28
+ }, { retryCount: 0 });
29
+ return (0, account_abstraction_1.formatUserOperationReceipt)(receipt);
30
+ }
31
+ catch (error) {
32
+ // biome-ignore lint/suspicious/noExplicitAny: copied from viem
33
+ const calls = parameters.calls;
34
+ throw (0, account_abstraction_1.getUserOperationError)(error, {
35
+ ...request,
36
+ ...(calls ? { calls } : {}),
37
+ signature
38
+ });
39
+ }
40
+ };
41
+ exports.sendUserOperationSync = sendUserOperationSync;
42
+ //# sourceMappingURL=sendUserOperationSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendUserOperationSync.js","sourceRoot":"","sources":["../../../bundler/actions/sendUserOperationSync.ts"],"names":[],"mappings":";;;AACA,kEASkC;AAClC,4CAA6C;AAE7C,mDAA0E;AAC1E,uEAAiE;AAM1D,MAAM,qBAAqB,GAAG,KAAK,EACxC,MAAqD,EACrD,UAA2C,EAC3C,YAAiC,EACjC,OAAiB,EACc,EAAE;IACjC,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAEtF,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,MAAM;QAAE,MAAM,IAAI,+BAAoB,EAAE,CAAC;IACtE,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAA,uBAAY,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE9D,MAAM,OAAO,GAAG,OAAO;QACrB,CAAC,CAAC,MAAM,IAAA,8CAAoB,EACxB,MAAM,EACN,UAAuD,EACvD,YAAY,EACZ,OAAO,EACP,IAAI,CACL;QACH,CAAC,CAAC,UAAU,CAAC;IAEf,+DAA+D;IAC/D,MAAM,SAAS,GAAG,CAAC,UAAU,CAAC,SAAS;QACrC,CAAC,MAAM,OAAO,EAAE,iBAAiB,EAAE,CAAC,OAAwB,CAAC,CAAC,CAAE,CAAC;IAEnE,MAAM,aAAa,GAAG,IAAA,gDAA0B,EAAC;QAC/C,GAAG,OAAO;QACV,SAAS;KACO,CAAC,CAAC;IAEpB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,CAClC;YACE,MAAM,EAAE,2BAA2B;YACnC,+DAA+D;YAC/D,MAAM,EAAE,CAAC,aAAa,EAAE,CAAC,iBAAiB,IAAI,OAAO,EAAE,UAAU,EAAE,OAAO,CAAE,EAAE,EAAE,OAAO,EAAE,CAAC;SAClF,EACV,EAAE,UAAU,EAAE,CAAC,EAAE,CAClB,CAAC;QAEF,OAAO,IAAA,gDAA0B,EAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,+DAA+D;QAC/D,MAAM,KAAK,GAAI,UAAkB,CAAC,KAAK,CAAC;QACxC,MAAM,IAAA,2CAAqB,EAAC,KAAkB,EAAE;YAC9C,GAAI,OAAyB;YAC7B,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,SAAS;SACV,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAlDW,QAAA,qBAAqB,yBAkDhC"}
@@ -0,0 +1,18 @@
1
+ import { type Chain, type Client, type Transport } from 'viem';
2
+ import { type BundlerActions, type BundlerClient, type BundlerClientConfig, type UserOperationReceipt } from 'viem/account-abstraction';
3
+ import { type Payment } from '../types/index.js';
4
+ import { type GetUserOperationGasPriceReturnType, type GetUserOperationQuoteParameters, type GetUserOperationQuoteReturnType, type SendUserOperationSyncParameters } from './actions/index.js';
5
+ export * from './actions/index.js';
6
+ export type GelatoBundlerActions = Partial<BundlerActions> & {
7
+ sendUserOperationSync: (parameters: SendUserOperationSyncParameters) => Promise<UserOperationReceipt>;
8
+ getUserOperationGasPrice: () => Promise<GetUserOperationGasPriceReturnType>;
9
+ getUserOperationQuote: (parameters: GetUserOperationQuoteParameters) => Promise<GetUserOperationQuoteReturnType>;
10
+ };
11
+ export type GelatoBundlerClient = BundlerClient & GelatoBundlerActions;
12
+ export type GelatoBundlerClientConfig = Omit<BundlerClientConfig, 'transport' | 'userOperation'> & {
13
+ client: Client<Transport, Chain>;
14
+ payment?: Payment;
15
+ apiKey: string;
16
+ };
17
+ export declare const createGelatoBundlerClient: (parameters: GelatoBundlerClientConfig) => Promise<GelatoBundlerClient>;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../bundler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAQ,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,KAAK,OAAO,EAAe,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAEL,KAAK,kCAAkC,EACvC,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EAIpC,KAAK,+BAA+B,EAGrC,MAAM,oBAAoB,CAAC;AAE5B,cAAc,oBAAoB,CAAC;AAEnC,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG;IAC3D,qBAAqB,EAAE,CACrB,UAAU,EAAE,+BAA+B,KACxC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnC,wBAAwB,EAAE,MAAM,OAAO,CAAC,kCAAkC,CAAC,CAAC;IAC5E,qBAAqB,EAAE,CACrB,UAAU,EAAE,+BAA+B,KACxC,OAAO,CAAC,+BAA+B,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAEvE,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,eAAe,CAAC,GAAG;IACjG,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,YAAY,yBAAyB,KACpC,OAAO,CAAC,mBAAmB,CAmD7B,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.createGelatoBundlerClient = void 0;
18
+ const viem_1 = require("viem");
19
+ const account_abstraction_1 = require("viem/account-abstraction");
20
+ const index_js_1 = require("../relayer/constants/index.js");
21
+ const index_js_2 = require("../relayer/evm/actions/index.js");
22
+ const index_js_3 = require("../types/index.js");
23
+ const index_js_4 = require("./actions/index.js");
24
+ __exportStar(require("./actions/index.js"), exports);
25
+ const createGelatoBundlerClient = async (parameters) => {
26
+ const { client: client_, payment, apiKey } = parameters;
27
+ // TODO: can just use prod endpoint in the future
28
+ const base = client_.chain.testnet ? index_js_1.GELATO_STAGING_API : index_js_1.GELATO_PROD_API;
29
+ let endpoint = `${base}/rpc/${client_.chain.id}`;
30
+ if (payment) {
31
+ endpoint += `?payment=${payment.type}`;
32
+ if (payment.type === index_js_3.PaymentType.Token) {
33
+ endpoint += `&address=${payment.address}`;
34
+ }
35
+ }
36
+ const transport = (0, viem_1.http)(endpoint, {
37
+ fetchOptions: {
38
+ headers: {
39
+ 'X-API-Key': apiKey
40
+ }
41
+ }
42
+ });
43
+ const client = (0, account_abstraction_1.createBundlerClient)({
44
+ ...parameters,
45
+ transport
46
+ });
47
+ const capabilities = (await (0, index_js_2.getCapabilities)(transport({})))[client_.chain.id];
48
+ if (!capabilities) {
49
+ throw new Error(`Chain not supported: ${client_.chain.id}`);
50
+ }
51
+ return client.extend((client) => ({
52
+ estimateUserOperationGas: (parameters) => (0, index_js_4.estimateUserOperationGas)(client, parameters, capabilities, payment),
53
+ getUserOperationGasPrice: () => (0, index_js_4.getUserOperationGasPrice)(client, payment),
54
+ getUserOperationQuote: (parameters) => (0, index_js_4.getUserOperationQuote)(client, parameters, capabilities, payment),
55
+ prepareUserOperation: (parameters) => (0, index_js_4.prepareUserOperation)(client, parameters, capabilities, payment),
56
+ sendUserOperation: (parameters) => (0, index_js_4.sendUserOperation)(client, parameters, capabilities, payment),
57
+ sendUserOperationSync: (parameters) => (0, index_js_4.sendUserOperationSync)(client, parameters, capabilities, payment)
58
+ }));
59
+ };
60
+ exports.createGelatoBundlerClient = createGelatoBundlerClient;
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../bundler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+BAAqE;AACrE,kEAMkC;AAClC,4DAAoF;AACpF,8DAAkE;AAClE,gDAA8D;AAC9D,iDAW4B;AAE5B,qDAAmC;AAoB5B,MAAM,yBAAyB,GAAG,KAAK,EAC5C,UAAqC,EACP,EAAE;IAChC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IAExD,iDAAiD;IACjD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,6BAAkB,CAAC,CAAC,CAAC,0BAAe,CAAC;IAE1E,IAAI,QAAQ,GAAG,GAAG,IAAI,QAAQ,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;IAEjD,IAAI,OAAO,EAAE,CAAC;QACZ,QAAQ,IAAI,YAAY,OAAO,CAAC,IAAI,EAAE,CAAC;QAEvC,IAAI,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AAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC;QAC9D,qBAAqB,EAAE,CAAC,UAAU,EAAE,EAAE,CACpC,IAAA,gCAAqB,EAAC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC;KACnE,CAAyB,CACK,CAAC;AACtC,CAAC,CAAC;AArDW,QAAA,yBAAyB,6BAqDpC"}
@@ -0,0 +1,5 @@
1
+ export * from './account/index.js';
2
+ export * from './bundler/index.js';
3
+ export * from './relayer/index.js';
4
+ export * from './types/index.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
package/_dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./account/index.js"), exports);
18
+ __exportStar(require("./bundler/index.js"), exports);
19
+ __exportStar(require("./relayer/index.js"), exports);
20
+ __exportStar(require("./types/index.js"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AACnC,mDAAiC"}