@bronlabs/intents-sdk 1.0.109 → 1.0.111
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/abi/OracleAggregator.json +166 -31
- package/dist/contracts.d.ts +25 -2
- package/dist/contracts.js.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +19 -11
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -186,6 +186,19 @@
|
|
|
186
186
|
"name": "OwnershipTransferred",
|
|
187
187
|
"type": "event"
|
|
188
188
|
},
|
|
189
|
+
{
|
|
190
|
+
"inputs": [],
|
|
191
|
+
"name": "bronTreasury",
|
|
192
|
+
"outputs": [
|
|
193
|
+
{
|
|
194
|
+
"internalType": "address",
|
|
195
|
+
"name": "",
|
|
196
|
+
"type": "address"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"stateMutability": "view",
|
|
200
|
+
"type": "function"
|
|
201
|
+
},
|
|
189
202
|
{
|
|
190
203
|
"inputs": [
|
|
191
204
|
{
|
|
@@ -259,29 +272,24 @@
|
|
|
259
272
|
"internalType": "string",
|
|
260
273
|
"name": "_orderId",
|
|
261
274
|
"type": "string"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"internalType": "bool",
|
|
278
|
+
"name": "_isUserTx",
|
|
279
|
+
"type": "bool"
|
|
262
280
|
}
|
|
263
281
|
],
|
|
264
|
-
"name": "
|
|
282
|
+
"name": "getActualRoundQuorumVoters",
|
|
265
283
|
"outputs": [
|
|
266
284
|
{
|
|
267
|
-
"internalType": "
|
|
268
|
-
"name": "",
|
|
269
|
-
"type": "uint256"
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
"internalType": "uint256",
|
|
273
|
-
"name": "",
|
|
274
|
-
"type": "uint256"
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"internalType": "uint256",
|
|
285
|
+
"internalType": "address[]",
|
|
278
286
|
"name": "",
|
|
279
|
-
"type": "
|
|
287
|
+
"type": "address[]"
|
|
280
288
|
},
|
|
281
289
|
{
|
|
282
|
-
"internalType": "
|
|
290
|
+
"internalType": "address[]",
|
|
283
291
|
"name": "",
|
|
284
|
-
"type": "
|
|
292
|
+
"type": "address[]"
|
|
285
293
|
}
|
|
286
294
|
],
|
|
287
295
|
"stateMutability": "view",
|
|
@@ -312,34 +320,52 @@
|
|
|
312
320
|
"internalType": "string",
|
|
313
321
|
"name": "_orderId",
|
|
314
322
|
"type": "string"
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
"internalType": "uint256",
|
|
318
|
-
"name": "_roundId",
|
|
319
|
-
"type": "uint256"
|
|
320
323
|
}
|
|
321
324
|
],
|
|
322
|
-
"name": "
|
|
325
|
+
"name": "getOracleConsensusRoundId",
|
|
323
326
|
"outputs": [
|
|
324
327
|
{
|
|
325
328
|
"internalType": "uint256",
|
|
326
329
|
"name": "",
|
|
327
330
|
"type": "uint256"
|
|
328
|
-
}
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"stateMutability": "view",
|
|
334
|
+
"type": "function"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"inputs": [
|
|
329
338
|
{
|
|
330
|
-
"internalType": "
|
|
331
|
-
"name": "",
|
|
332
|
-
"type": "
|
|
333
|
-
}
|
|
339
|
+
"internalType": "string",
|
|
340
|
+
"name": "_orderId",
|
|
341
|
+
"type": "string"
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
"name": "getOracleConsensusYesVotesCount",
|
|
345
|
+
"outputs": [
|
|
334
346
|
{
|
|
335
347
|
"internalType": "uint256",
|
|
336
348
|
"name": "",
|
|
337
349
|
"type": "uint256"
|
|
338
|
-
}
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
"stateMutability": "view",
|
|
353
|
+
"type": "function"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"inputs": [
|
|
339
357
|
{
|
|
340
|
-
"internalType": "
|
|
358
|
+
"internalType": "address",
|
|
359
|
+
"name": "_oracle",
|
|
360
|
+
"type": "address"
|
|
361
|
+
}
|
|
362
|
+
],
|
|
363
|
+
"name": "getOracleCooldownNetworks",
|
|
364
|
+
"outputs": [
|
|
365
|
+
{
|
|
366
|
+
"internalType": "string[]",
|
|
341
367
|
"name": "",
|
|
342
|
-
"type": "
|
|
368
|
+
"type": "string[]"
|
|
343
369
|
}
|
|
344
370
|
],
|
|
345
371
|
"stateMutability": "view",
|
|
@@ -364,6 +390,83 @@
|
|
|
364
390
|
"stateMutability": "view",
|
|
365
391
|
"type": "function"
|
|
366
392
|
},
|
|
393
|
+
{
|
|
394
|
+
"inputs": [
|
|
395
|
+
{
|
|
396
|
+
"internalType": "string",
|
|
397
|
+
"name": "_orderId",
|
|
398
|
+
"type": "string"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"internalType": "address",
|
|
402
|
+
"name": "_oracle",
|
|
403
|
+
"type": "address"
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"name": "getOracleYesVotes",
|
|
407
|
+
"outputs": [
|
|
408
|
+
{
|
|
409
|
+
"internalType": "uint256",
|
|
410
|
+
"name": "",
|
|
411
|
+
"type": "uint256"
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"stateMutability": "view",
|
|
415
|
+
"type": "function"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"inputs": [
|
|
419
|
+
{
|
|
420
|
+
"internalType": "string",
|
|
421
|
+
"name": "_orderId",
|
|
422
|
+
"type": "string"
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"name": "getParticipatingOraclesYesVotes",
|
|
426
|
+
"outputs": [
|
|
427
|
+
{
|
|
428
|
+
"internalType": "address[]",
|
|
429
|
+
"name": "",
|
|
430
|
+
"type": "address[]"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"stateMutability": "view",
|
|
434
|
+
"type": "function"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"inputs": [
|
|
438
|
+
{
|
|
439
|
+
"internalType": "string",
|
|
440
|
+
"name": "_orderId",
|
|
441
|
+
"type": "string"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"internalType": "uint256",
|
|
445
|
+
"name": "_roundId",
|
|
446
|
+
"type": "uint256"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"internalType": "bool",
|
|
450
|
+
"name": "_isUserTx",
|
|
451
|
+
"type": "bool"
|
|
452
|
+
}
|
|
453
|
+
],
|
|
454
|
+
"name": "getQuorumVoters",
|
|
455
|
+
"outputs": [
|
|
456
|
+
{
|
|
457
|
+
"internalType": "address[]",
|
|
458
|
+
"name": "",
|
|
459
|
+
"type": "address[]"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"internalType": "address[]",
|
|
463
|
+
"name": "",
|
|
464
|
+
"type": "address[]"
|
|
465
|
+
}
|
|
466
|
+
],
|
|
467
|
+
"stateMutability": "view",
|
|
468
|
+
"type": "function"
|
|
469
|
+
},
|
|
367
470
|
{
|
|
368
471
|
"inputs": [
|
|
369
472
|
{
|
|
@@ -471,6 +574,25 @@
|
|
|
471
574
|
"stateMutability": "view",
|
|
472
575
|
"type": "function"
|
|
473
576
|
},
|
|
577
|
+
{
|
|
578
|
+
"inputs": [
|
|
579
|
+
{
|
|
580
|
+
"internalType": "string",
|
|
581
|
+
"name": "",
|
|
582
|
+
"type": "string"
|
|
583
|
+
}
|
|
584
|
+
],
|
|
585
|
+
"name": "networkActiveCooldownCount",
|
|
586
|
+
"outputs": [
|
|
587
|
+
{
|
|
588
|
+
"internalType": "uint256",
|
|
589
|
+
"name": "",
|
|
590
|
+
"type": "uint256"
|
|
591
|
+
}
|
|
592
|
+
],
|
|
593
|
+
"stateMutability": "view",
|
|
594
|
+
"type": "function"
|
|
595
|
+
},
|
|
474
596
|
{
|
|
475
597
|
"inputs": [],
|
|
476
598
|
"name": "networkManager",
|
|
@@ -765,7 +887,7 @@
|
|
|
765
887
|
"type": "string"
|
|
766
888
|
}
|
|
767
889
|
],
|
|
768
|
-
"name": "
|
|
890
|
+
"name": "resetOracleConsensus",
|
|
769
891
|
"outputs": [],
|
|
770
892
|
"stateMutability": "nonpayable",
|
|
771
893
|
"type": "function"
|
|
@@ -783,6 +905,19 @@
|
|
|
783
905
|
"stateMutability": "nonpayable",
|
|
784
906
|
"type": "function"
|
|
785
907
|
},
|
|
908
|
+
{
|
|
909
|
+
"inputs": [
|
|
910
|
+
{
|
|
911
|
+
"internalType": "address",
|
|
912
|
+
"name": "_bronTreasury",
|
|
913
|
+
"type": "address"
|
|
914
|
+
}
|
|
915
|
+
],
|
|
916
|
+
"name": "setTreasury",
|
|
917
|
+
"outputs": [],
|
|
918
|
+
"stateMutability": "nonpayable",
|
|
919
|
+
"type": "function"
|
|
920
|
+
},
|
|
786
921
|
{
|
|
787
922
|
"inputs": [
|
|
788
923
|
{
|
|
@@ -879,4 +1014,4 @@
|
|
|
879
1014
|
"stateMutability": "view",
|
|
880
1015
|
"type": "function"
|
|
881
1016
|
}
|
|
882
|
-
]
|
|
1017
|
+
]
|
package/dist/contracts.d.ts
CHANGED
|
@@ -78,8 +78,31 @@ export interface OracleAggregatorContract {
|
|
|
78
78
|
oracleConfirmUserTx(orderId: string, isConfirmed: boolean, params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
79
79
|
oracleConfirmSolverTx(orderId: string, isConfirmed: boolean, params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
80
80
|
getOracleSubscribedNetworks(oracle: string): Promise<string[]>;
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
getOracleCooldownNetworks(oracle: string): Promise<string[]>;
|
|
82
|
+
getOracleYesVotes(orderId: string, oracle: string): Promise<bigint>;
|
|
83
|
+
getParticipatingOraclesYesVotes(orderId: string): Promise<string[]>;
|
|
84
|
+
getOracleConsensusRoundId(orderId: string): Promise<bigint>;
|
|
85
|
+
getOracleConsensusYesVotesCount(orderId: string): Promise<bigint>;
|
|
86
|
+
getActualRoundQuorumVoters(orderId: string, isUserTx: boolean): Promise<[string[], string[]]>;
|
|
87
|
+
getQuorumVoters(orderId: string, roundId: bigint, isUserTx: boolean): Promise<[string[], string[]]>;
|
|
88
|
+
getEffectiveOraclesCount(networkId: string): Promise<bigint>;
|
|
89
|
+
subscribeToNetwork(networkId: string, params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
90
|
+
unsubscribeFromNetwork(networkId: string, params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
91
|
+
registerOracle(params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
92
|
+
reconcileOracleConsensus(orderId: string, isUserTx: boolean, params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
93
|
+
claimOracleCollectedFees(feeToken: string, params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
94
|
+
cleanupExpiredNetworkCooldown(oracle: string, networkId: string, params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
95
|
+
setTreasury(bronTreasury: string, params?: NetworkParams): Promise<ethers.ContractTransactionResponse>;
|
|
96
|
+
oraclesCount(): Promise<bigint>;
|
|
97
|
+
networkOraclesCount(networkId: string): Promise<bigint>;
|
|
98
|
+
networkActiveCooldownCount(networkId: string): Promise<bigint>;
|
|
99
|
+
oracleCollectedFees(oracle: string, feeToken: string): Promise<bigint>;
|
|
100
|
+
oracleNetworkCooldownEndTime(networkId: string, oracle: string): Promise<bigint>;
|
|
101
|
+
oracleNetworkSubscription(networkId: string, oracle: string): Promise<boolean>;
|
|
102
|
+
oracleWrongDecisionCooldownEndTime(oracle: string): Promise<bigint>;
|
|
103
|
+
wrongOracleDecisionCooldown(): Promise<bigint>;
|
|
104
|
+
isOracleVotedInActualRound(orderId: string, oracle: string, isUserTx: boolean): Promise<boolean>;
|
|
105
|
+
isOracleVotedInRoundId(orderId: string, oracle: string, isUserTx: boolean, roundId: bigint): Promise<boolean>;
|
|
83
106
|
}
|
|
84
107
|
export declare function initOrderEngine(orderEngineAddress: string, provider: ethers.JsonRpcProvider | ethers.Signer): OrderEngineContract & ethers.Contract;
|
|
85
108
|
export declare function initOracleAggregator(oracleAggregatorAddress: string, provider: ethers.JsonRpcProvider | ethers.Signer): OracleAggregatorContract & ethers.Contract;
|
package/dist/contracts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,MAAM,CAAN,IAAY,WAWX;AAXD,WAAY,WAAW;IACrB,uDAAS,CAAA;IACT,iEAAc,CAAA;IACd,2EAAmB,CAAA;IACnB,qEAAgB,CAAA;IAChB,mGAA+B,CAAA;IAC/B,yEAAkB,CAAA;IAClB,uGAAiC,CAAA;IACjC,uDAAS,CAAA;IACT,yDAAU,CAAA;IACV,uDAAS,CAAA;AACX,CAAC,EAXW,WAAW,KAAX,WAAW,QAWtB;
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAA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AQ,CACxB,eAAe,EACf,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAsB,CAAC,EAAE,MAAM,CAAC,CAAC,EACjF,QAAQ,CACU,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,UAAsB,EAAE,WAAwB,EAAE,aAA4B;IACvG,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,UAAU,EAAE;YACV,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,YAAY,EAAE,UAAU,CAAC,YAAY;YACrC,aAAa,EAAE,UAAU,CAAC,aAAa;YACvC,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC;QACD,WAAW,EAAE;YACX,SAAS,EAAE,WAAW,CAAC,SAAS;YAChC,YAAY,EAAE,WAAW,CAAC,YAAY;YACtC,WAAW,EAAE,WAAW,CAAC,WAAW;YACpC,YAAY,EAAE,WAAW,CAAC,YAAY;SACvC;QACD,aAAa,EAAE;YACb,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE;YAC/C,WAAW,EAAE,aAAa,CAAC,WAAW,CAAC,QAAQ,EAAE;YACjD,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,QAAQ,EAAE;YAC7C,YAAY,EAAE,aAAa,CAAC,YAAY,CAAC,QAAQ,EAAE;YACnD,mBAAmB,EAAE,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE;SAClE;KACF,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACd,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as winston from 'winston';
|
|
2
2
|
export declare const log: winston.Logger;
|
|
3
|
+
export declare function configureLog(options: {
|
|
4
|
+
format?: 'json' | 'text';
|
|
5
|
+
level?: string;
|
|
6
|
+
}): void;
|
|
3
7
|
export declare const sleep: (ms: number) => Promise<void>;
|
|
4
8
|
export declare function withTimeout<T>(promise: Promise<T>, ms: number, message?: string): Promise<T>;
|
|
5
9
|
export declare function expRetry<T>(fn: () => Promise<T>, maxRetries?: number, retryIf?: (e: Error) => boolean): Promise<T>;
|
package/dist/utils.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import * as winston from 'winston';
|
|
2
|
+
const jsonFormat = winston.format.combine(winston.format.errors({ stack: true }), winston.format.timestamp(), winston.format.printf(({ level, message, timestamp, stack }) => {
|
|
3
|
+
return JSON.stringify({
|
|
4
|
+
'@timestamp': timestamp,
|
|
5
|
+
level: level.toUpperCase(),
|
|
6
|
+
message: stack || message
|
|
7
|
+
});
|
|
8
|
+
}));
|
|
9
|
+
const textFormat = winston.format.combine(winston.format.errors({ stack: true }), winston.format.colorize(), winston.format.printf(({ level, message, stack }) => {
|
|
10
|
+
return stack ? `${level}\t${message}\n${stack}` : `${level}\t${message}`;
|
|
11
|
+
}));
|
|
2
12
|
export const log = winston.createLogger({
|
|
3
13
|
level: process.env.LOG_LEVEL || 'info',
|
|
4
|
-
format: process.env.LOG_FORMAT === 'json'
|
|
5
|
-
? winston.format.combine(winston.format.errors({ stack: true }), winston.format.timestamp(), winston.format.printf(({ level, message, timestamp, stack }) => {
|
|
6
|
-
return JSON.stringify({
|
|
7
|
-
'@timestamp': timestamp,
|
|
8
|
-
level: level.toUpperCase(),
|
|
9
|
-
message: stack || message
|
|
10
|
-
});
|
|
11
|
-
}))
|
|
12
|
-
: winston.format.combine(winston.format.errors({ stack: true }), winston.format.colorize(), winston.format.printf(({ level, message, stack }) => {
|
|
13
|
-
return stack ? `${level}\t${message}\n${stack}` : `${level}\t${message}`;
|
|
14
|
-
})),
|
|
14
|
+
format: process.env.LOG_FORMAT === 'json' ? jsonFormat : textFormat,
|
|
15
15
|
transports: [new winston.transports.Console()]
|
|
16
16
|
});
|
|
17
|
+
export function configureLog(options) {
|
|
18
|
+
if (options.format) {
|
|
19
|
+
log.format = options.format === 'json' ? jsonFormat : textFormat;
|
|
20
|
+
}
|
|
21
|
+
if (options.level) {
|
|
22
|
+
log.level = options.level;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
17
25
|
export const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
18
26
|
export function withTimeout(promise, ms, message) {
|
|
19
27
|
return Promise.race([
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CACvC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EACtC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAC1B,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,YAAY,EAAE,SAAS;QACvB,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE;QAC1B,OAAO,EAAE,KAAK,IAAI,OAAO;KAC1B,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC;AAEF,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CACvC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EACtC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EACzB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAqC,EAAE,EAAE;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