@metamask-previews/chomp-api-service 4.0.1-preview-b13d916 → 4.0.1-preview-4f4c98e

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 (44) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/dist/{chomp-api-service-method-action-types.d.mts → chomp-api-service-method-action-types.d.ts} +2 -2
  3. package/dist/chomp-api-service-method-action-types.d.ts.map +1 -0
  4. package/dist/{chomp-api-service-method-action-types.mjs → chomp-api-service-method-action-types.js} +1 -1
  5. package/dist/chomp-api-service-method-action-types.js.map +1 -0
  6. package/dist/{chomp-api-service.d.cts → chomp-api-service.d.ts} +9 -9
  7. package/dist/chomp-api-service.d.ts.map +1 -0
  8. package/dist/{chomp-api-service.mjs → chomp-api-service.js} +5 -5
  9. package/dist/chomp-api-service.js.map +1 -0
  10. package/dist/{index.d.cts → index.d.ts} +5 -5
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +2 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/{types.d.cts → types.d.ts} +2 -2
  15. package/dist/types.d.ts.map +1 -0
  16. package/dist/types.js +2 -0
  17. package/dist/types.js.map +1 -0
  18. package/package.json +12 -16
  19. package/dist/chomp-api-service-method-action-types.cjs +0 -7
  20. package/dist/chomp-api-service-method-action-types.cjs.map +0 -1
  21. package/dist/chomp-api-service-method-action-types.d.cts +0 -133
  22. package/dist/chomp-api-service-method-action-types.d.cts.map +0 -1
  23. package/dist/chomp-api-service-method-action-types.d.mts.map +0 -1
  24. package/dist/chomp-api-service-method-action-types.mjs.map +0 -1
  25. package/dist/chomp-api-service.cjs +0 -451
  26. package/dist/chomp-api-service.cjs.map +0 -1
  27. package/dist/chomp-api-service.d.cts.map +0 -1
  28. package/dist/chomp-api-service.d.mts +0 -175
  29. package/dist/chomp-api-service.d.mts.map +0 -1
  30. package/dist/chomp-api-service.mjs.map +0 -1
  31. package/dist/index.cjs +0 -6
  32. package/dist/index.cjs.map +0 -1
  33. package/dist/index.d.cts.map +0 -1
  34. package/dist/index.d.mts +0 -5
  35. package/dist/index.d.mts.map +0 -1
  36. package/dist/index.mjs +0 -2
  37. package/dist/index.mjs.map +0 -1
  38. package/dist/types.cjs +0 -3
  39. package/dist/types.cjs.map +0 -1
  40. package/dist/types.d.cts.map +0 -1
  41. package/dist/types.d.mts +0 -162
  42. package/dist/types.d.mts.map +0 -1
  43. package/dist/types.mjs +0 -2
  44. package/dist/types.mjs.map +0 -1
@@ -1,451 +0,0 @@
1
- "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _ChompApiService_instances, _ChompApiService_baseUrl, _ChompApiService_headersForToken, _ChompApiService_authHeaders;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ChompApiService = exports.serviceName = void 0;
16
- const base_data_service_1 = require("@metamask/base-data-service");
17
- const controller_utils_1 = require("@metamask/controller-utils");
18
- const superstruct_1 = require("@metamask/superstruct");
19
- const utils_1 = require("@metamask/utils");
20
- // === GENERAL ===
21
- /**
22
- * The name of the {@link ChompApiService}, used to namespace the service's
23
- * actions and events.
24
- */
25
- exports.serviceName = 'ChompApiService';
26
- // === MESSENGER ===
27
- /**
28
- * All of the methods within {@link ChompApiService} that are exposed via the
29
- * messenger.
30
- */
31
- const MESSENGER_EXPOSED_METHODS = [
32
- 'associateAddress',
33
- 'getAssociatedAddresses',
34
- 'createUpgrade',
35
- 'getUpgrades',
36
- 'verifyDelegation',
37
- 'createIntents',
38
- 'getIntentsByAddress',
39
- 'createWithdrawal',
40
- 'getServiceDetails',
41
- ];
42
- // === RESPONSE VALIDATION ===
43
- const AssociateAddressResponseStruct = (0, superstruct_1.type)({
44
- profileId: (0, superstruct_1.optional)((0, superstruct_1.string)()),
45
- address: utils_1.StrictHexStruct,
46
- status: (0, superstruct_1.enums)(['active', 'created']),
47
- });
48
- /**
49
- * Parses addresses into canonical lowercase form. CHOMP stores and returns
50
- * addresses lowercased, but `StrictHexStruct` alone accepts any casing, so
51
- * this makes the canonical form a guarantee of the parsed data rather than a
52
- * convention consumers must each remember.
53
- */
54
- const LowercaseHexAddressStruct = (0, superstruct_1.coerce)(utils_1.StrictHexStruct, (0, superstruct_1.string)(), (value) => value.toLowerCase());
55
- const ProfileAddressEntryArrayStruct = (0, superstruct_1.array)((0, superstruct_1.type)({
56
- profileId: (0, superstruct_1.string)(),
57
- address: LowercaseHexAddressStruct,
58
- status: (0, superstruct_1.enums)(['active']),
59
- }));
60
- const AccountUpgradeStatusStruct = (0, superstruct_1.enums)(['pending', 'upgraded']);
61
- const AuthorizationDataStruct = (0, superstruct_1.type)({
62
- r: utils_1.StrictHexStruct,
63
- s: utils_1.StrictHexStruct,
64
- v: (0, superstruct_1.number)(),
65
- yParity: (0, superstruct_1.number)(),
66
- address: utils_1.StrictHexStruct,
67
- chainId: utils_1.StrictHexStruct,
68
- nonce: utils_1.StrictHexStruct,
69
- });
70
- const CreateUpgradeResponseStruct = (0, superstruct_1.type)({
71
- signerAddress: utils_1.StrictHexStruct,
72
- address: utils_1.StrictHexStruct,
73
- chainId: utils_1.StrictHexStruct,
74
- nonce: utils_1.StrictHexStruct,
75
- status: AccountUpgradeStatusStruct,
76
- createdAt: (0, superstruct_1.string)(),
77
- });
78
- const UpgradeEntryArrayStruct = (0, superstruct_1.array)((0, superstruct_1.type)({
79
- signerAddress: utils_1.StrictHexStruct,
80
- chainId: utils_1.StrictHexStruct,
81
- nonce: utils_1.StrictHexStruct,
82
- authorization: AuthorizationDataStruct,
83
- status: AccountUpgradeStatusStruct,
84
- createdAt: (0, superstruct_1.string)(),
85
- }));
86
- const VerifyDelegationResponseStruct = (0, superstruct_1.type)({
87
- valid: (0, superstruct_1.boolean)(),
88
- delegationHash: (0, superstruct_1.optional)(utils_1.StrictHexStruct),
89
- errors: (0, superstruct_1.optional)((0, superstruct_1.array)((0, superstruct_1.string)())),
90
- });
91
- const SendIntentResponseArrayStruct = (0, superstruct_1.array)((0, superstruct_1.type)({
92
- delegationHash: utils_1.StrictHexStruct,
93
- metadata: (0, superstruct_1.type)({
94
- allowance: utils_1.StrictHexStruct,
95
- tokenSymbol: (0, superstruct_1.string)(),
96
- tokenAddress: utils_1.StrictHexStruct,
97
- type: (0, superstruct_1.enums)(['cash-deposit', 'cash-withdrawal']),
98
- }),
99
- createdAt: (0, superstruct_1.string)(),
100
- }));
101
- const IntentEntryArrayStruct = (0, superstruct_1.array)((0, superstruct_1.type)({
102
- account: utils_1.StrictHexStruct,
103
- delegationHash: utils_1.StrictHexStruct,
104
- chainId: utils_1.StrictHexStruct,
105
- status: (0, superstruct_1.enums)(['active', 'revoked']),
106
- metadata: (0, superstruct_1.type)({
107
- allowance: utils_1.StrictHexStruct,
108
- tokenAddress: utils_1.StrictHexStruct,
109
- tokenSymbol: (0, superstruct_1.string)(),
110
- type: (0, superstruct_1.enums)(['cash-deposit', 'cash-withdrawal']),
111
- }),
112
- }));
113
- const CreateWithdrawalResponseStruct = (0, superstruct_1.type)({
114
- success: (0, superstruct_1.literal)(true),
115
- });
116
- const ServiceDetailsProtocolStruct = (0, superstruct_1.type)({
117
- supportedTokens: (0, superstruct_1.array)((0, superstruct_1.type)({
118
- tokenAddress: utils_1.StrictHexStruct,
119
- tokenDecimals: (0, superstruct_1.number)(),
120
- })),
121
- adapterAddress: utils_1.StrictHexStruct,
122
- intentTypes: (0, superstruct_1.array)((0, superstruct_1.enums)(['cash-deposit', 'cash-withdrawal'])),
123
- });
124
- const ServiceDetailsResponseStruct = (0, superstruct_1.type)({
125
- auth: (0, superstruct_1.type)({
126
- message: (0, superstruct_1.string)(),
127
- }),
128
- chains: (0, superstruct_1.record)(utils_1.StrictHexStruct, (0, superstruct_1.type)({
129
- autoDepositDelegate: utils_1.StrictHexStruct,
130
- protocol: (0, superstruct_1.record)((0, superstruct_1.string)(), ServiceDetailsProtocolStruct),
131
- })),
132
- });
133
- // === RETRY POLICY ===
134
- /**
135
- * Determines whether an error from a CHOMP API call is worth retrying.
136
- *
137
- * 4xx responses (e.g. 409 "already exists", 400 validation, 401/403 auth) are
138
- * caused by the request itself and will not be resolved by re-issuing the same
139
- * request, so they bypass the retry loop. 429 is treated as transient and
140
- * retried alongside 5xx server errors. Non-HTTP errors (network/timeout) fall
141
- * through to the default "retry" behaviour.
142
- *
143
- * @param error - The error thrown by the query function.
144
- * @returns `true` when the error is worth retrying.
145
- */
146
- function isRetryableError(error) {
147
- if (error instanceof controller_utils_1.HttpError) {
148
- if (error.httpStatus === 429) {
149
- return true;
150
- }
151
- return error.httpStatus < 400 || error.httpStatus >= 500;
152
- }
153
- return true;
154
- }
155
- const DEFAULT_POLICY_OPTIONS = {
156
- retryFilterPolicy: (0, controller_utils_1.handleWhen)(isRetryableError),
157
- };
158
- // === SERVICE DEFINITION ===
159
- /**
160
- * This service is responsible for communicating with the CHOMP API.
161
- *
162
- * All requests are authenticated via JWT Bearer tokens obtained from the
163
- * `AuthenticationController:getBearerToken` messenger action.
164
- */
165
- class ChompApiService extends base_data_service_1.BaseDataService {
166
- /**
167
- * Constructs a new ChompApiService.
168
- *
169
- * @param args - The constructor arguments.
170
- * @param args.messenger - The messenger suited for this service.
171
- * @param args.baseUrl - The base URL of the CHOMP API.
172
- * @param args.queryClientConfig - Configuration for the underlying TanStack
173
- * Query client.
174
- * @param args.policyOptions - Options to pass to `createServicePolicy`.
175
- */
176
- constructor({ messenger, baseUrl, queryClientConfig = {}, policyOptions = {}, }) {
177
- super({
178
- name: exports.serviceName,
179
- messenger,
180
- queryClientConfig,
181
- policyOptions: { ...DEFAULT_POLICY_OPTIONS, ...policyOptions },
182
- });
183
- _ChompApiService_instances.add(this);
184
- _ChompApiService_baseUrl.set(this, void 0);
185
- __classPrivateFieldSet(this, _ChompApiService_baseUrl, baseUrl, "f");
186
- this.messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);
187
- }
188
- /**
189
- * Associates an address with a CHOMP profile.
190
- *
191
- * POST /v1/auth/address
192
- *
193
- * @param params - The association params containing signature, timestamp,
194
- * and address.
195
- * @returns The profile association result: `status: 'created'` for a new
196
- * association, `status: 'active'` when the address was already associated
197
- * with the authenticated profile. Throws on 409, which indicates the
198
- * address is associated with a different profile.
199
- */
200
- async associateAddress(params) {
201
- const jsonResponse = await this.fetchQuery({
202
- queryKey: [`${this.name}:associateAddress`, params],
203
- staleTime: 0,
204
- queryFn: async () => {
205
- const headers = await __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_authHeaders).call(this);
206
- const response = await fetch(new URL('/v1/auth/address', __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f")), {
207
- method: 'POST',
208
- headers,
209
- body: JSON.stringify(params),
210
- });
211
- if (!response.ok) {
212
- throw new controller_utils_1.HttpError(response.status, `POST /v1/auth/address failed with status '${response.status}'`);
213
- }
214
- return response.json();
215
- },
216
- });
217
- return (0, superstruct_1.create)(jsonResponse, AssociateAddressResponseStruct);
218
- }
219
- /**
220
- * Fetches the addresses associated with the authenticated profile.
221
- *
222
- * GET /v1/auth/address
223
- *
224
- * The result is scoped to the authenticated profile and consumers use it
225
- * to decide whether an association already exists, so it is always fetched
226
- * fresh (`staleTime: 0`) and evicted as soon as the call settles
227
- * (`gcTime: 0`). The query key carries a SHA-256 digest of the bearer
228
- * token — the same token the request is made with — so concurrent calls
229
- * only share an in-flight request when they are for the same profile. The
230
- * digest, not the token, is used because query keys leave the service via
231
- * the `cacheUpdated` messenger events.
232
- *
233
- * @returns The active address associations; empty array if none exist.
234
- * Addresses are lowercased.
235
- */
236
- async getAssociatedAddresses() {
237
- const token = await this.messenger.call('AuthenticationController:getBearerToken');
238
- const profileKey = (0, utils_1.bytesToHex)(await (0, utils_1.sha256)((0, utils_1.stringToBytes)(token)));
239
- const jsonResponse = await this.fetchQuery({
240
- queryKey: [`${this.name}:getAssociatedAddresses`, profileKey],
241
- staleTime: 0,
242
- gcTime: 0,
243
- queryFn: async () => {
244
- const response = await fetch(new URL('/v1/auth/address', __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f")), { headers: __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_headersForToken).call(this, token) });
245
- if (!response.ok) {
246
- throw new controller_utils_1.HttpError(response.status, `GET /v1/auth/address failed with status '${response.status}'`);
247
- }
248
- return response.json();
249
- },
250
- });
251
- return (0, superstruct_1.create)(jsonResponse, ProfileAddressEntryArrayStruct);
252
- }
253
- /**
254
- * Creates an account upgrade request.
255
- *
256
- * POST /v1/account-upgrade
257
- *
258
- * @param params - The upgrade params containing signature components and
259
- * chain details.
260
- * @returns The upgrade result.
261
- */
262
- async createUpgrade(params) {
263
- const jsonResponse = await this.fetchQuery({
264
- queryKey: [`${this.name}:createUpgrade`, params],
265
- staleTime: 0,
266
- queryFn: async () => {
267
- const headers = await __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_authHeaders).call(this);
268
- const response = await fetch(new URL('/v1/account-upgrade', __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f")), {
269
- method: 'POST',
270
- headers,
271
- body: JSON.stringify(params),
272
- });
273
- if (!response.ok) {
274
- throw new controller_utils_1.HttpError(response.status, `POST /v1/account-upgrade failed with status '${response.status}'`);
275
- }
276
- return response.json();
277
- },
278
- });
279
- return (0, superstruct_1.create)(jsonResponse, CreateUpgradeResponseStruct);
280
- }
281
- /**
282
- * Fetches all EIP-7702 upgrade authorizations for a given address (one per
283
- * chain).
284
- *
285
- * GET /v1/account-upgrade/:address
286
- *
287
- * @param address - The address to look up.
288
- * @returns The upgrade entries; empty array if none exist.
289
- */
290
- async getUpgrades(address) {
291
- const jsonResponse = await this.fetchQuery({
292
- queryKey: [`${this.name}:getUpgrades`, address],
293
- queryFn: async () => {
294
- const headers = await __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_authHeaders).call(this);
295
- const response = await fetch(new URL(`/v1/account-upgrade/${address}`, __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f")), { headers });
296
- if (!response.ok) {
297
- throw new controller_utils_1.HttpError(response.status, `Get upgrades request failed with status '${response.status}'`);
298
- }
299
- return response.json();
300
- },
301
- });
302
- return (0, superstruct_1.create)(jsonResponse, UpgradeEntryArrayStruct);
303
- }
304
- /**
305
- * Verifies a delegation signature.
306
- *
307
- * POST /v1/intent/verify-delegation
308
- *
309
- * @param params - The delegation verification params.
310
- * @returns The verification result including validity and optional errors.
311
- */
312
- async verifyDelegation(params) {
313
- const jsonResponse = await this.fetchQuery({
314
- queryKey: [`${this.name}:verifyDelegation`, params],
315
- staleTime: 0,
316
- queryFn: async () => {
317
- const headers = await __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_authHeaders).call(this);
318
- const response = await fetch(new URL('/v1/intent/verify-delegation', __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f")), {
319
- method: 'POST',
320
- headers,
321
- body: JSON.stringify(params),
322
- });
323
- if (!response.ok) {
324
- throw new controller_utils_1.HttpError(response.status, `POST /v1/intent/verify-delegation failed with status '${response.status}'`);
325
- }
326
- return response.json();
327
- },
328
- });
329
- return (0, superstruct_1.create)(jsonResponse, VerifyDelegationResponseStruct);
330
- }
331
- /**
332
- * Submits one or more intents to the CHOMP API.
333
- *
334
- * POST /v1/intent
335
- *
336
- * @param intents - The array of intents to submit.
337
- * @returns The array of intent responses.
338
- */
339
- async createIntents(intents) {
340
- const jsonResponse = await this.fetchQuery({
341
- queryKey: [`${this.name}:createIntents`, intents],
342
- staleTime: 0,
343
- queryFn: async () => {
344
- const headers = await __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_authHeaders).call(this);
345
- const response = await fetch(new URL('/v1/intent', __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f")), {
346
- method: 'POST',
347
- headers,
348
- body: JSON.stringify(intents),
349
- });
350
- if (!response.ok) {
351
- throw new controller_utils_1.HttpError(response.status, `POST /v1/intent failed with status '${response.status}'`);
352
- }
353
- return response.json();
354
- },
355
- });
356
- return (0, superstruct_1.create)(jsonResponse, SendIntentResponseArrayStruct);
357
- }
358
- /**
359
- * Fetches intents associated with a given address.
360
- *
361
- * GET /v1/intent/account/:address
362
- *
363
- * @param address - The address to look up intents for.
364
- * @returns The array of intents for the address.
365
- */
366
- async getIntentsByAddress(address) {
367
- const jsonResponse = await this.fetchQuery({
368
- queryKey: [`${this.name}:getIntentsByAddress`, address],
369
- queryFn: async () => {
370
- const headers = await __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_authHeaders).call(this);
371
- const response = await fetch(new URL(`/v1/intent/account/${address}`, __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f")), { headers });
372
- if (!response.ok) {
373
- throw new controller_utils_1.HttpError(response.status, `Get intents request failed with status '${response.status}'`);
374
- }
375
- return response.json();
376
- },
377
- });
378
- return (0, superstruct_1.create)(jsonResponse, IntentEntryArrayStruct);
379
- }
380
- /**
381
- * Creates a withdrawal for card spend flows.
382
- *
383
- * POST /v1/withdrawal
384
- *
385
- * @param params - The withdrawal params containing chainId, amount
386
- * (decimal or hex string), and account address.
387
- * @returns The withdrawal result.
388
- */
389
- async createWithdrawal(params) {
390
- const jsonResponse = await this.fetchQuery({
391
- queryKey: [`${this.name}:createWithdrawal`, params],
392
- staleTime: 0,
393
- queryFn: async () => {
394
- const headers = await __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_authHeaders).call(this);
395
- const response = await fetch(new URL('/v1/withdrawal', __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f")), {
396
- method: 'POST',
397
- headers,
398
- body: JSON.stringify(params),
399
- });
400
- if (!response.ok) {
401
- throw new controller_utils_1.HttpError(response.status, `POST /v1/withdrawal failed with status '${response.status}'`);
402
- }
403
- return response.json();
404
- },
405
- });
406
- return (0, superstruct_1.create)(jsonResponse, CreateWithdrawalResponseStruct);
407
- }
408
- /**
409
- * Retrieves service details including delegation redeemer addresses and DeFi
410
- * contract details for signing delegations for auto-deposit functionality.
411
- *
412
- * GET /v1/chomp
413
- *
414
- * @param chainIds - Array of chain IDs (0x-prefixed hex strings) to retrieve
415
- * details for.
416
- * @returns The service details for the requested chains.
417
- */
418
- async getServiceDetails(chainIds) {
419
- const jsonResponse = await this.fetchQuery({
420
- queryKey: [`${this.name}:getServiceDetails`, chainIds],
421
- queryFn: async () => {
422
- const headers = await __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_authHeaders).call(this);
423
- const url = new URL('/v1/chomp', __classPrivateFieldGet(this, _ChompApiService_baseUrl, "f"));
424
- url.searchParams.set('chainId', chainIds.join(','));
425
- const response = await fetch(url, { headers });
426
- if (!response.ok) {
427
- throw new controller_utils_1.HttpError(response.status, `GET /v1/chomp failed with status '${response.status}'`);
428
- }
429
- return response.json();
430
- },
431
- });
432
- return (0, superstruct_1.create)(jsonResponse, ServiceDetailsResponseStruct);
433
- }
434
- }
435
- exports.ChompApiService = ChompApiService;
436
- _ChompApiService_baseUrl = new WeakMap(), _ChompApiService_instances = new WeakSet(), _ChompApiService_headersForToken = function _ChompApiService_headersForToken(token) {
437
- return {
438
- Authorization: `Bearer ${token}`,
439
- 'Content-Type': 'application/json',
440
- };
441
- }, _ChompApiService_authHeaders =
442
- /**
443
- * Builds the standard headers for an authenticated CHOMP API request.
444
- *
445
- * @returns Headers including Authorization and Content-Type.
446
- */
447
- async function _ChompApiService_authHeaders() {
448
- const token = await this.messenger.call('AuthenticationController:getBearerToken');
449
- return __classPrivateFieldGet(this, _ChompApiService_instances, "m", _ChompApiService_headersForToken).call(this, token);
450
- };
451
- //# sourceMappingURL=chomp-api-service.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chomp-api-service.cjs","sourceRoot":"","sources":["../src/chomp-api-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAA8D;AAO9D,iEAAmE;AAEnE,uDAY+B;AAE/B,2CAKyB;AAqBzB,kBAAkB;AAElB;;;GAGG;AACU,QAAA,WAAW,GAAG,iBAAiB,CAAC;AAE7C,oBAAoB;AAEpB;;;GAGG;AACH,MAAM,yBAAyB,GAAG;IAChC,kBAAkB;IAClB,wBAAwB;IACxB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,eAAe;IACf,qBAAqB;IACrB,kBAAkB;IAClB,mBAAmB;CACX,CAAC;AA0DX,8BAA8B;AAE9B,MAAM,8BAA8B,GAAG,IAAA,kBAAI,EAAC;IAC1C,SAAS,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC7B,OAAO,EAAE,uBAAe;IACxB,MAAM,EAAE,IAAA,mBAAK,EAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,yBAAyB,GAAG,IAAA,oBAAM,EAAC,uBAAe,EAAE,IAAA,oBAAM,GAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAC5E,KAAK,CAAC,WAAW,EAAE,CACpB,CAAC;AAEF,MAAM,8BAA8B,GAAG,IAAA,mBAAK,EAC1C,IAAA,kBAAI,EAAC;IACH,SAAS,EAAE,IAAA,oBAAM,GAAE;IACnB,OAAO,EAAE,yBAAyB;IAClC,MAAM,EAAE,IAAA,mBAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;CAC1B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,IAAI,4BAAS,CACjB,QAAQ,CAAC,MAAM,EACf,qCAAqC,QAAQ,CAAC,MAAM,GAAG,CACxD,CAAC;gBACJ,CAAC;gBAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;YACzB,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,IAAA,oBAAM,EAAC,YAAY,EAAE,4BAA4B,CAAC,CAAC;IAC5D,CAAC;CACF;AAvZD,0CAuZC;mKAtWkB,KAAa;IAC5B,OAAO;QACL,aAAa,EAAE,UAAU,KAAK,EAAE;QAChC,cAAc,EAAE,kBAAkB;KACnC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,KAAK;IACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CACrC,yCAAyC,CAC1C,CAAC;IACF,OAAO,uBAAA,IAAI,oEAAiB,MAArB,IAAI,EAAkB,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { BaseDataService } from '@metamask/base-data-service';\nimport type {\n DataServiceCacheUpdatedEvent,\n DataServiceGranularCacheUpdatedEvent,\n DataServiceInvalidateQueriesAction,\n} from '@metamask/base-data-service';\nimport type { CreateServicePolicyOptions } from '@metamask/controller-utils';\nimport { handleWhen, HttpError } from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\nimport {\n array,\n boolean,\n coerce,\n create,\n enums,\n literal,\n number,\n optional,\n record,\n string,\n type,\n} from '@metamask/superstruct';\nimport type { Hex } from '@metamask/utils';\nimport {\n bytesToHex,\n sha256,\n stringToBytes,\n StrictHexStruct,\n} from '@metamask/utils';\nimport type { QueryClientConfig } from '@tanstack/query-core';\n\nimport type { ChompApiServiceMethodActions } from './chomp-api-service-method-action-types.js';\nimport type {\n AssociateAddressParams,\n AssociateAddressResponse,\n ProfileAddressEntry,\n CreateUpgradeParams,\n CreateUpgradeResponse,\n UpgradeEntry,\n CreateWithdrawalParams,\n CreateWithdrawalResponse,\n IntentEntry,\n SendIntentParams,\n SendIntentResponse,\n ServiceDetailsResponse,\n VerifyDelegationParams,\n VerifyDelegationResponse,\n} from './types.js';\n\n// === GENERAL ===\n\n/**\n * The name of the {@link ChompApiService}, used to namespace the service's\n * actions and events.\n */\nexport const serviceName = 'ChompApiService';\n\n// === MESSENGER ===\n\n/**\n * All of the methods within {@link ChompApiService} that are exposed via the\n * messenger.\n */\nconst MESSENGER_EXPOSED_METHODS = [\n 'associateAddress',\n 'getAssociatedAddresses',\n 'createUpgrade',\n 'getUpgrades',\n 'verifyDelegation',\n 'createIntents',\n 'getIntentsByAddress',\n 'createWithdrawal',\n 'getServiceDetails',\n] as const;\n\n/**\n * Invalidates cached queries for {@link ChompApiService}.\n */\nexport type ChompApiServiceInvalidateQueriesAction =\n DataServiceInvalidateQueriesAction<typeof serviceName>;\n\n/**\n * Actions that {@link ChompApiService} exposes to other consumers.\n */\nexport type ChompApiServiceActions =\n | ChompApiServiceMethodActions\n | ChompApiServiceInvalidateQueriesAction;\n\n/**\n * Actions from other messengers that {@link ChompApiService} calls.\n */\ntype AllowedActions = {\n type: 'AuthenticationController:getBearerToken';\n handler: (entropySourceId?: string) => Promise<string>;\n};\n\n/**\n * Published when {@link ChompApiService}'s cache is updated.\n */\nexport type ChompApiServiceCacheUpdatedEvent = DataServiceCacheUpdatedEvent<\n typeof serviceName\n>;\n\n/**\n * Published when a key within {@link ChompApiService}'s cache is updated.\n */\nexport type ChompApiServiceGranularCacheUpdatedEvent =\n DataServiceGranularCacheUpdatedEvent<typeof serviceName>;\n\n/**\n * Events that {@link ChompApiService} exposes to other consumers.\n */\nexport type ChompApiServiceEvents =\n | ChompApiServiceCacheUpdatedEvent\n | ChompApiServiceGranularCacheUpdatedEvent;\n\n/**\n * Events from other messengers that {@link ChompApiService} subscribes to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger which is restricted to actions and events accessed by\n * {@link ChompApiService}.\n */\nexport type ChompApiServiceMessenger = Messenger<\n typeof serviceName,\n ChompApiServiceActions | AllowedActions,\n ChompApiServiceEvents | AllowedEvents\n>;\n\n// === RESPONSE VALIDATION ===\n\nconst AssociateAddressResponseStruct = type({\n profileId: optional(string()),\n address: StrictHexStruct,\n status: enums(['active', 'created']),\n});\n\n/**\n * Parses addresses into canonical lowercase form. CHOMP stores and returns\n * addresses lowercased, but `StrictHexStruct` alone accepts any casing, so\n * this makes the canonical form a guarantee of the parsed data rather than a\n * convention consumers must each remember.\n */\nconst LowercaseHexAddressStruct = coerce(StrictHexStruct, string(), (value) =>\n value.toLowerCase(),\n);\n\nconst ProfileAddressEntryArrayStruct = array(\n type({\n profileId: string(),\n address: LowercaseHexAddressStruct,\n status: enums(['active']),\n }),\n);\n\nconst AccountUpgradeStatusStruct = enums(['pending', 'upgraded']);\n\nconst AuthorizationDataStruct = type({\n r: StrictHexStruct,\n s: StrictHexStruct,\n v: number(),\n yParity: number(),\n address: StrictHexStruct,\n chainId: StrictHexStruct,\n nonce: StrictHexStruct,\n});\n\nconst CreateUpgradeResponseStruct = type({\n signerAddress: StrictHexStruct,\n address: StrictHexStruct,\n chainId: StrictHexStruct,\n nonce: StrictHexStruct,\n status: AccountUpgradeStatusStruct,\n createdAt: string(),\n});\n\nconst UpgradeEntryArrayStruct = array(\n type({\n signerAddress: StrictHexStruct,\n chainId: StrictHexStruct,\n nonce: StrictHexStruct,\n authorization: AuthorizationDataStruct,\n status: AccountUpgradeStatusStruct,\n createdAt: string(),\n }),\n);\n\nconst VerifyDelegationResponseStruct = type({\n valid: boolean(),\n delegationHash: optional(StrictHexStruct),\n errors: optional(array(string())),\n});\n\nconst SendIntentResponseArrayStruct = array(\n type({\n delegationHash: StrictHexStruct,\n metadata: type({\n allowance: StrictHexStruct,\n tokenSymbol: string(),\n tokenAddress: StrictHexStruct,\n type: enums(['cash-deposit', 'cash-withdrawal']),\n }),\n createdAt: string(),\n }),\n);\n\nconst IntentEntryArrayStruct = array(\n type({\n account: StrictHexStruct,\n delegationHash: StrictHexStruct,\n chainId: StrictHexStruct,\n status: enums(['active', 'revoked']),\n metadata: type({\n allowance: StrictHexStruct,\n tokenAddress: StrictHexStruct,\n tokenSymbol: string(),\n type: enums(['cash-deposit', 'cash-withdrawal']),\n }),\n }),\n);\n\nconst CreateWithdrawalResponseStruct = type({\n success: literal(true),\n});\n\nconst ServiceDetailsProtocolStruct = type({\n supportedTokens: array(\n type({\n tokenAddress: StrictHexStruct,\n tokenDecimals: number(),\n }),\n ),\n adapterAddress: StrictHexStruct,\n intentTypes: array(enums(['cash-deposit', 'cash-withdrawal'])),\n});\n\nconst ServiceDetailsResponseStruct = type({\n auth: type({\n message: string(),\n }),\n chains: record(\n StrictHexStruct,\n type({\n autoDepositDelegate: StrictHexStruct,\n protocol: record(string(), ServiceDetailsProtocolStruct),\n }),\n ),\n});\n\n// === RETRY POLICY ===\n\n/**\n * Determines whether an error from a CHOMP API call is worth retrying.\n *\n * 4xx responses (e.g. 409 \"already exists\", 400 validation, 401/403 auth) are\n * caused by the request itself and will not be resolved by re-issuing the same\n * request, so they bypass the retry loop. 429 is treated as transient and\n * retried alongside 5xx server errors. Non-HTTP errors (network/timeout) fall\n * through to the default \"retry\" behaviour.\n *\n * @param error - The error thrown by the query function.\n * @returns `true` when the error is worth retrying.\n */\nfunction isRetryableError(error: unknown): boolean {\n if (error instanceof HttpError) {\n if (error.httpStatus === 429) {\n return true;\n }\n return error.httpStatus < 400 || error.httpStatus >= 500;\n }\n return true;\n}\n\nconst DEFAULT_POLICY_OPTIONS: CreateServicePolicyOptions = {\n retryFilterPolicy: handleWhen(isRetryableError),\n};\n\n// === SERVICE DEFINITION ===\n\n/**\n * This service is responsible for communicating with the CHOMP API.\n *\n * All requests are authenticated via JWT Bearer tokens obtained from the\n * `AuthenticationController:getBearerToken` messenger action.\n */\nexport class ChompApiService extends BaseDataService<\n typeof serviceName,\n ChompApiServiceMessenger\n> {\n readonly #baseUrl: string;\n\n /**\n * Constructs a new ChompApiService.\n *\n * @param args - The constructor arguments.\n * @param args.messenger - The messenger suited for this service.\n * @param args.baseUrl - The base URL of the CHOMP API.\n * @param args.queryClientConfig - Configuration for the underlying TanStack\n * Query client.\n * @param args.policyOptions - Options to pass to `createServicePolicy`.\n */\n constructor({\n messenger,\n baseUrl,\n queryClientConfig = {},\n policyOptions = {},\n }: {\n messenger: ChompApiServiceMessenger;\n baseUrl: string;\n queryClientConfig?: QueryClientConfig;\n policyOptions?: CreateServicePolicyOptions;\n }) {\n super({\n name: serviceName,\n messenger,\n queryClientConfig,\n policyOptions: { ...DEFAULT_POLICY_OPTIONS, ...policyOptions },\n });\n\n this.#baseUrl = baseUrl;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Builds the standard headers for a CHOMP API request authenticated with\n * the given bearer token.\n *\n * @param token - The bearer token to authenticate with.\n * @returns Headers including Authorization and Content-Type.\n */\n #headersForToken(token: string): Record<string, string> {\n return {\n Authorization: `Bearer ${token}`,\n 'Content-Type': 'application/json',\n };\n }\n\n /**\n * Builds the standard headers for an authenticated CHOMP API request.\n *\n * @returns Headers including Authorization and Content-Type.\n */\n async #authHeaders(): Promise<Record<string, string>> {\n const token = await this.messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n return this.#headersForToken(token);\n }\n\n /**\n * Associates an address with a CHOMP profile.\n *\n * POST /v1/auth/address\n *\n * @param params - The association params containing signature, timestamp,\n * and address.\n * @returns The profile association result: `status: 'created'` for a new\n * association, `status: 'active'` when the address was already associated\n * with the authenticated profile. Throws on 409, which indicates the\n * address is associated with a different profile.\n */\n async associateAddress(\n params: AssociateAddressParams,\n ): Promise<AssociateAddressResponse> {\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:associateAddress`, params],\n staleTime: 0,\n queryFn: async () => {\n const headers = await this.#authHeaders();\n const response = await fetch(\n new URL('/v1/auth/address', this.#baseUrl),\n {\n method: 'POST',\n headers,\n body: JSON.stringify(params),\n },\n );\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `POST /v1/auth/address failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, AssociateAddressResponseStruct);\n }\n\n /**\n * Fetches the addresses associated with the authenticated profile.\n *\n * GET /v1/auth/address\n *\n * The result is scoped to the authenticated profile and consumers use it\n * to decide whether an association already exists, so it is always fetched\n * fresh (`staleTime: 0`) and evicted as soon as the call settles\n * (`gcTime: 0`). The query key carries a SHA-256 digest of the bearer\n * token — the same token the request is made with — so concurrent calls\n * only share an in-flight request when they are for the same profile. The\n * digest, not the token, is used because query keys leave the service via\n * the `cacheUpdated` messenger events.\n *\n * @returns The active address associations; empty array if none exist.\n * Addresses are lowercased.\n */\n async getAssociatedAddresses(): Promise<ProfileAddressEntry[]> {\n const token = await this.messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n const profileKey = bytesToHex(await sha256(stringToBytes(token)));\n\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:getAssociatedAddresses`, profileKey],\n staleTime: 0,\n gcTime: 0,\n queryFn: async () => {\n const response = await fetch(\n new URL('/v1/auth/address', this.#baseUrl),\n { headers: this.#headersForToken(token) },\n );\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `GET /v1/auth/address failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, ProfileAddressEntryArrayStruct);\n }\n\n /**\n * Creates an account upgrade request.\n *\n * POST /v1/account-upgrade\n *\n * @param params - The upgrade params containing signature components and\n * chain details.\n * @returns The upgrade result.\n */\n async createUpgrade(\n params: CreateUpgradeParams,\n ): Promise<CreateUpgradeResponse> {\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:createUpgrade`, params],\n staleTime: 0,\n queryFn: async () => {\n const headers = await this.#authHeaders();\n const response = await fetch(\n new URL('/v1/account-upgrade', this.#baseUrl),\n {\n method: 'POST',\n headers,\n body: JSON.stringify(params),\n },\n );\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `POST /v1/account-upgrade failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, CreateUpgradeResponseStruct);\n }\n\n /**\n * Fetches all EIP-7702 upgrade authorizations for a given address (one per\n * chain).\n *\n * GET /v1/account-upgrade/:address\n *\n * @param address - The address to look up.\n * @returns The upgrade entries; empty array if none exist.\n */\n async getUpgrades(address: Hex): Promise<UpgradeEntry[]> {\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:getUpgrades`, address],\n queryFn: async () => {\n const headers = await this.#authHeaders();\n const response = await fetch(\n new URL(`/v1/account-upgrade/${address}`, this.#baseUrl),\n { headers },\n );\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Get upgrades request failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, UpgradeEntryArrayStruct);\n }\n\n /**\n * Verifies a delegation signature.\n *\n * POST /v1/intent/verify-delegation\n *\n * @param params - The delegation verification params.\n * @returns The verification result including validity and optional errors.\n */\n async verifyDelegation(\n params: VerifyDelegationParams,\n ): Promise<VerifyDelegationResponse> {\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:verifyDelegation`, params],\n staleTime: 0,\n queryFn: async () => {\n const headers = await this.#authHeaders();\n const response = await fetch(\n new URL('/v1/intent/verify-delegation', this.#baseUrl),\n {\n method: 'POST',\n headers,\n body: JSON.stringify(params),\n },\n );\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `POST /v1/intent/verify-delegation failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, VerifyDelegationResponseStruct);\n }\n\n /**\n * Submits one or more intents to the CHOMP API.\n *\n * POST /v1/intent\n *\n * @param intents - The array of intents to submit.\n * @returns The array of intent responses.\n */\n async createIntents(\n intents: SendIntentParams[],\n ): Promise<SendIntentResponse[]> {\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:createIntents`, intents],\n staleTime: 0,\n queryFn: async () => {\n const headers = await this.#authHeaders();\n const response = await fetch(new URL('/v1/intent', this.#baseUrl), {\n method: 'POST',\n headers,\n body: JSON.stringify(intents),\n });\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `POST /v1/intent failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, SendIntentResponseArrayStruct);\n }\n\n /**\n * Fetches intents associated with a given address.\n *\n * GET /v1/intent/account/:address\n *\n * @param address - The address to look up intents for.\n * @returns The array of intents for the address.\n */\n async getIntentsByAddress(address: Hex): Promise<IntentEntry[]> {\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:getIntentsByAddress`, address],\n queryFn: async () => {\n const headers = await this.#authHeaders();\n const response = await fetch(\n new URL(`/v1/intent/account/${address}`, this.#baseUrl),\n { headers },\n );\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Get intents request failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, IntentEntryArrayStruct);\n }\n\n /**\n * Creates a withdrawal for card spend flows.\n *\n * POST /v1/withdrawal\n *\n * @param params - The withdrawal params containing chainId, amount\n * (decimal or hex string), and account address.\n * @returns The withdrawal result.\n */\n async createWithdrawal(\n params: CreateWithdrawalParams,\n ): Promise<CreateWithdrawalResponse> {\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:createWithdrawal`, params],\n staleTime: 0,\n queryFn: async () => {\n const headers = await this.#authHeaders();\n const response = await fetch(new URL('/v1/withdrawal', this.#baseUrl), {\n method: 'POST',\n headers,\n body: JSON.stringify(params),\n });\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `POST /v1/withdrawal failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, CreateWithdrawalResponseStruct);\n }\n\n /**\n * Retrieves service details including delegation redeemer addresses and DeFi\n * contract details for signing delegations for auto-deposit functionality.\n *\n * GET /v1/chomp\n *\n * @param chainIds - Array of chain IDs (0x-prefixed hex strings) to retrieve\n * details for.\n * @returns The service details for the requested chains.\n */\n async getServiceDetails(chainIds: Hex[]): Promise<ServiceDetailsResponse> {\n const jsonResponse = await this.fetchQuery({\n queryKey: [`${this.name}:getServiceDetails`, chainIds],\n queryFn: async () => {\n const headers = await this.#authHeaders();\n const url = new URL('/v1/chomp', this.#baseUrl);\n url.searchParams.set('chainId', chainIds.join(','));\n const response = await fetch(url, { headers });\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `GET /v1/chomp failed with status '${response.status}'`,\n );\n }\n\n return response.json();\n },\n });\n\n return create(jsonResponse, ServiceDetailsResponseStruct);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"chomp-api-service.d.cts","sourceRoot":"","sources":["../src/chomp-api-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oCAAoC;AAC9D,OAAO,KAAK,EACV,4BAA4B,EAC5B,oCAAoC,EACpC,kCAAkC,EACnC,oCAAoC;AACrC,OAAO,KAAK,EAAE,0BAA0B,EAAE,mCAAmC;AAE7E,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAcrD,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAO3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,6BAA6B;AAE9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,oDAAmD;AAC/F,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,sBAAsB,EACtB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACzB,oBAAmB;AAIpB;;;GAGG;AACH,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAoB7C;;GAEG;AACH,MAAM,MAAM,sCAAsC,GAChD,kCAAkC,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,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