@dcentralab/d402-client 0.2.1 → 0.2.3

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/dist/index.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  var viem = require('viem');
4
4
  var chains = require('viem/chains');
5
- var accounts = require('viem/accounts');
6
5
 
7
6
  var __defProp = Object.defineProperty;
8
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -200,38 +199,17 @@ exports.CHAIN_IDS = void 0; exports.NETWORKS = void 0; exports.TOKEN_ADDRESSES =
200
199
  var init_constants = __esm({
201
200
  "src/constants.ts"() {
202
201
  exports.CHAIN_IDS = {
203
- mainnet: 1,
204
- sepolia: 11155111,
205
- base: 8453,
206
- polygon: 137
202
+ sepolia: 11155111
207
203
  };
208
204
  exports.NETWORKS = {
209
- mainnet: {
210
- chainId: 1,
211
- name: "Ethereum Mainnet",
212
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }
213
- },
214
205
  sepolia: {
215
206
  chainId: 11155111,
216
207
  name: "Sepolia Testnet",
217
208
  nativeCurrency: { name: "Sepolia Ether", symbol: "SEP", decimals: 18 }
218
- },
219
- base: {
220
- chainId: 8453,
221
- name: "Base",
222
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }
223
- },
224
- polygon: {
225
- chainId: 137,
226
- name: "Polygon",
227
- nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18 }
228
209
  }
229
210
  };
230
211
  exports.TOKEN_ADDRESSES = {
231
- mainnet: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
232
- sepolia: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
233
- base: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
234
- polygon: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"
212
+ sepolia: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"
235
213
  };
236
214
  exports.DEFAULT_VALIDITY_WINDOW_SECONDS = 300;
237
215
  exports.EIP712_TYPES = {
@@ -292,8 +270,7 @@ function getChainId(network) {
292
270
  "arbitrum-sepolia": 421614,
293
271
  "arbitrum-mainnet": 42161,
294
272
  "avalanche-fuji": 43113,
295
- "avalanche": 43114,
296
- "localhost": 31337
273
+ "avalanche": 43114
297
274
  };
298
275
  const chainId = networkMap[network];
299
276
  if (!chainId) {
@@ -534,132 +511,6 @@ function sortPaymentRequirements(requirements, preferredNetwork) {
534
511
  });
535
512
  }
536
513
 
537
- // src/client.ts
538
- var D402Client = class {
539
- /**
540
- * Create a new D402 Client.
541
- *
542
- * Matches Python: d402Client.__init__ (base.py lines 66-95)
543
- *
544
- * @param config - Client configuration
545
- */
546
- constructor(config) {
547
- this.operatorAccount = config.operatorAccount;
548
- this.iatpWalletAddress = config.iatpWalletAddress || config.operatorAccount.address;
549
- this.maxValue = config.maxValue;
550
- this.networkFilter = config.networkFilter;
551
- this.schemeFilter = config.schemeFilter || "exact";
552
- this.paymentRequirementsSelector = config.paymentRequirementsSelector || selectPaymentRequirement;
553
- }
554
- /**
555
- * Select payment requirement from list of options.
556
- *
557
- * Matches Python: select_payment_requirements (base.py lines 152-174)
558
- *
559
- * @param requirements - List of payment requirements from 402 response
560
- * @returns Selected payment requirement
561
- */
562
- selectPaymentRequirement(requirements) {
563
- return this.paymentRequirementsSelector(requirements, {
564
- network: this.networkFilter,
565
- scheme: this.schemeFilter,
566
- maxAmount: this.maxValue
567
- });
568
- }
569
- /**
570
- * Get the IATP wallet address used for payments.
571
- *
572
- * @returns IATPWallet contract address or operator EOA address
573
- */
574
- getIATPWalletAddress() {
575
- return this.iatpWalletAddress;
576
- }
577
- /**
578
- * Get the operator account used for signing.
579
- *
580
- * @returns Operator account
581
- */
582
- getOperatorAccount() {
583
- return this.operatorAccount;
584
- }
585
- /**
586
- * Get the maximum payment value limit.
587
- *
588
- * @returns Maximum value in base units, or undefined if no limit
589
- */
590
- getMaxValue() {
591
- return this.maxValue;
592
- }
593
- /**
594
- * Fetch with automatic 402 payment handling.
595
- *
596
- * Matches Python: HttpxHooks.on_response() (httpx.py lines 33-117)
597
- *
598
- * Flow:
599
- * 1. Make request without payment
600
- * 2. If 402 response, parse payment requirements
601
- * 3. Select appropriate payment option
602
- * 4. Sign payment with EIP-712
603
- * 5. Retry request with X-Payment header
604
- * 6. Return final response
605
- *
606
- * @param url - URL to fetch
607
- * @param init - Fetch options (method, headers, body, etc.)
608
- * @returns Response object (after payment if 402)
609
- *
610
- * @example
611
- * ```ts
612
- * const client = new D402Client({ operatorAccount, iatpWalletAddress })
613
- *
614
- * const response = await client.fetch('http://api.example.com/analyze', {
615
- * method: 'POST',
616
- * headers: { 'Content-Type': 'application/json' },
617
- * body: JSON.stringify({ text: 'Analyze this' })
618
- * })
619
- *
620
- * const data = await response.json()
621
- * ```
622
- */
623
- async fetch(url, init) {
624
- const { parseAllPaymentRequirements: parseAllPaymentRequirements2 } = await Promise.resolve().then(() => (init_parser(), parser_exports));
625
- const { signD402Payment: signD402Payment2 } = await Promise.resolve().then(() => (init_signer(), signer_exports));
626
- const { encodePayment: encodePayment2 } = await Promise.resolve().then(() => (init_encoder(), encoder_exports));
627
- let response = await fetch(url, init);
628
- if (response.status !== 402) {
629
- return response;
630
- }
631
- try {
632
- const requirements = await parseAllPaymentRequirements2(response);
633
- const selectedRequirement = this.selectPaymentRequirement(requirements);
634
- const signedPayment = await signD402Payment2({
635
- operatorAccount: this.operatorAccount,
636
- paymentRequirement: selectedRequirement,
637
- iatpWalletAddress: this.iatpWalletAddress
638
- });
639
- const paymentHeader = encodePayment2(signedPayment);
640
- response = await fetch(url, {
641
- ...init,
642
- headers: {
643
- ...init?.headers,
644
- "X-Payment": paymentHeader,
645
- "Access-Control-Expose-Headers": "X-Payment-Response"
646
- }
647
- });
648
- return response;
649
- } catch (error) {
650
- throw error;
651
- }
652
- }
653
- };
654
-
655
- // src/index.ts
656
- init_signer();
657
- init_parser();
658
- init_encoder();
659
- init_utils();
660
- init_errors();
661
- init_constants();
662
-
663
514
  // src/contracts/abis/sepolia.json
664
515
  var sepolia_default = {
665
516
  sepolia: {
@@ -1229,6 +1080,25 @@ var sepolia_default = {
1229
1080
  stateMutability: "nonpayable",
1230
1081
  type: "function"
1231
1082
  },
1083
+ {
1084
+ inputs: [
1085
+ {
1086
+ internalType: "address",
1087
+ name: "token",
1088
+ type: "address"
1089
+ }
1090
+ ],
1091
+ name: "getAvailableBalance",
1092
+ outputs: [
1093
+ {
1094
+ internalType: "uint256",
1095
+ name: "",
1096
+ type: "uint256"
1097
+ }
1098
+ ],
1099
+ stateMutability: "view",
1100
+ type: "function"
1101
+ },
1232
1102
  {
1233
1103
  inputs: [
1234
1104
  {
@@ -1341,6 +1211,50 @@ var sepolia_default = {
1341
1211
  stateMutability: "view",
1342
1212
  type: "function"
1343
1213
  },
1214
+ {
1215
+ inputs: [
1216
+ {
1217
+ internalType: "address",
1218
+ name: "token",
1219
+ type: "address"
1220
+ },
1221
+ {
1222
+ internalType: "uint256",
1223
+ name: "amount",
1224
+ type: "uint256"
1225
+ },
1226
+ {
1227
+ internalType: "address",
1228
+ name: "provider",
1229
+ type: "address"
1230
+ },
1231
+ {
1232
+ internalType: "uint256",
1233
+ name: "deadline",
1234
+ type: "uint256"
1235
+ },
1236
+ {
1237
+ internalType: "string",
1238
+ name: "requestPath",
1239
+ type: "string"
1240
+ },
1241
+ {
1242
+ internalType: "bytes",
1243
+ name: "signature",
1244
+ type: "bytes"
1245
+ }
1246
+ ],
1247
+ name: "isValidSettlementRequest",
1248
+ outputs: [
1249
+ {
1250
+ internalType: "bool",
1251
+ name: "",
1252
+ type: "bool"
1253
+ }
1254
+ ],
1255
+ stateMutability: "view",
1256
+ type: "function"
1257
+ },
1344
1258
  {
1345
1259
  inputs: [],
1346
1260
  name: "operatorAddress",
@@ -1581,6 +1495,11 @@ var sepolia_default = {
1581
1495
  internalType: "address",
1582
1496
  name: "token",
1583
1497
  type: "address"
1498
+ },
1499
+ {
1500
+ internalType: "bool",
1501
+ name: "sendToOwner",
1502
+ type: "bool"
1584
1503
  }
1585
1504
  ],
1586
1505
  name: "withdrawAllFromSettlement",
@@ -2570,6 +2489,31 @@ var sepolia_default = {
2570
2489
  name: "EpochReleased",
2571
2490
  type: "event"
2572
2491
  },
2492
+ {
2493
+ anonymous: false,
2494
+ inputs: [
2495
+ {
2496
+ indexed: true,
2497
+ internalType: "address",
2498
+ name: "facilitator",
2499
+ type: "address"
2500
+ },
2501
+ {
2502
+ indexed: true,
2503
+ internalType: "address",
2504
+ name: "token",
2505
+ type: "address"
2506
+ },
2507
+ {
2508
+ indexed: false,
2509
+ internalType: "uint256",
2510
+ name: "amount",
2511
+ type: "uint256"
2512
+ }
2513
+ ],
2514
+ name: "FacilitatorEarningsWithdrawn",
2515
+ type: "event"
2516
+ },
2573
2517
  {
2574
2518
  anonymous: false,
2575
2519
  inputs: [
@@ -2988,6 +2932,11 @@ var sepolia_default = {
2988
2932
  internalType: "struct IIATPSettlementLayer.SettlementRequest",
2989
2933
  name: "req",
2990
2934
  type: "tuple"
2935
+ },
2936
+ {
2937
+ internalType: "address",
2938
+ name: "facilitator",
2939
+ type: "address"
2991
2940
  }
2992
2941
  ],
2993
2942
  name: "_settleRequest",
@@ -3200,6 +3149,30 @@ var sepolia_default = {
3200
3149
  stateMutability: "view",
3201
3150
  type: "function"
3202
3151
  },
3152
+ {
3153
+ inputs: [
3154
+ {
3155
+ internalType: "address",
3156
+ name: "",
3157
+ type: "address"
3158
+ },
3159
+ {
3160
+ internalType: "address",
3161
+ name: "",
3162
+ type: "address"
3163
+ }
3164
+ ],
3165
+ name: "facilitatorFeeBalances",
3166
+ outputs: [
3167
+ {
3168
+ internalType: "uint256",
3169
+ name: "",
3170
+ type: "uint256"
3171
+ }
3172
+ ],
3173
+ stateMutability: "view",
3174
+ type: "function"
3175
+ },
3203
3176
  {
3204
3177
  inputs: [
3205
3178
  {
@@ -3322,13 +3295,18 @@ var sepolia_default = {
3322
3295
  },
3323
3296
  {
3324
3297
  inputs: [
3298
+ {
3299
+ internalType: "address",
3300
+ name: "facilitator",
3301
+ type: "address"
3302
+ },
3325
3303
  {
3326
3304
  internalType: "address",
3327
3305
  name: "token",
3328
3306
  type: "address"
3329
3307
  }
3330
3308
  ],
3331
- name: "getFeeBalance",
3309
+ name: "getFacilitatorEarnings",
3332
3310
  outputs: [
3333
3311
  {
3334
3312
  internalType: "uint256",
@@ -3341,18 +3319,13 @@ var sepolia_default = {
3341
3319
  },
3342
3320
  {
3343
3321
  inputs: [
3344
- {
3345
- internalType: "address",
3346
- name: "provider",
3347
- type: "address"
3348
- },
3349
3322
  {
3350
3323
  internalType: "address",
3351
3324
  name: "token",
3352
3325
  type: "address"
3353
3326
  }
3354
3327
  ],
3355
- name: "getLockedBalanceForProvider",
3328
+ name: "getFeeBalance",
3356
3329
  outputs: [
3357
3330
  {
3358
3331
  internalType: "uint256",
@@ -3369,4083 +3342,14 @@ var sepolia_default = {
3369
3342
  internalType: "address",
3370
3343
  name: "provider",
3371
3344
  type: "address"
3345
+ },
3346
+ {
3347
+ internalType: "address",
3348
+ name: "token",
3349
+ type: "address"
3372
3350
  }
3373
3351
  ],
3374
- name: "getProviderReputation",
3375
- outputs: [
3376
- {
3377
- components: [
3378
- {
3379
- internalType: "uint256",
3380
- name: "completed",
3381
- type: "uint256"
3382
- },
3383
- {
3384
- internalType: "uint256",
3385
- name: "failed",
3386
- type: "uint256"
3387
- },
3388
- {
3389
- internalType: "uint256",
3390
- name: "faults",
3391
- type: "uint256"
3392
- },
3393
- {
3394
- internalType: "int256",
3395
- name: "score",
3396
- type: "int256"
3397
- },
3398
- {
3399
- internalType: "uint256",
3400
- name: "firstSettlementAt",
3401
- type: "uint256"
3402
- }
3403
- ],
3404
- internalType: "struct IIATPSettlementLayer.Reputation",
3405
- name: "",
3406
- type: "tuple"
3407
- }
3408
- ],
3409
- stateMutability: "view",
3410
- type: "function"
3411
- },
3412
- {
3413
- inputs: [
3414
- {
3415
- internalType: "address",
3416
- name: "provider",
3417
- type: "address"
3418
- }
3419
- ],
3420
- name: "getProviderReputationScore",
3421
- outputs: [
3422
- {
3423
- internalType: "int256",
3424
- name: "",
3425
- type: "int256"
3426
- }
3427
- ],
3428
- stateMutability: "view",
3429
- type: "function"
3430
- },
3431
- {
3432
- inputs: [
3433
- {
3434
- internalType: "address",
3435
- name: "provider",
3436
- type: "address"
3437
- },
3438
- {
3439
- internalType: "address",
3440
- name: "token",
3441
- type: "address"
3442
- }
3443
- ],
3444
- name: "getUnlockedBalanceForProvider",
3445
- outputs: [
3446
- {
3447
- internalType: "uint256",
3448
- name: "",
3449
- type: "uint256"
3450
- }
3451
- ],
3452
- stateMutability: "view",
3453
- type: "function"
3454
- },
3455
- {
3456
- inputs: [
3457
- {
3458
- internalType: "address",
3459
- name: "_roleManager",
3460
- type: "address"
3461
- },
3462
- {
3463
- internalType: "address",
3464
- name: "_feeCollector",
3465
- type: "address"
3466
- }
3467
- ],
3468
- name: "initialize",
3469
- outputs: [],
3470
- stateMutability: "nonpayable",
3471
- type: "function"
3472
- },
3473
- {
3474
- inputs: [
3475
- {
3476
- internalType: "address",
3477
- name: "account",
3478
- type: "address"
3479
- }
3480
- ],
3481
- name: "isMaintainer",
3482
- outputs: [
3483
- {
3484
- internalType: "bool",
3485
- name: "",
3486
- type: "bool"
3487
- }
3488
- ],
3489
- stateMutability: "view",
3490
- type: "function"
3491
- },
3492
- {
3493
- inputs: [
3494
- {
3495
- internalType: "address",
3496
- name: "",
3497
- type: "address"
3498
- },
3499
- {
3500
- internalType: "address",
3501
- name: "",
3502
- type: "address"
3503
- }
3504
- ],
3505
- name: "lastWithdrawnEpoch",
3506
- outputs: [
3507
- {
3508
- internalType: "uint256",
3509
- name: "",
3510
- type: "uint256"
3511
- }
3512
- ],
3513
- stateMutability: "view",
3514
- type: "function"
3515
- },
3516
- {
3517
- inputs: [],
3518
- name: "maxFacilitatorFee",
3519
- outputs: [
3520
- {
3521
- internalType: "uint256",
3522
- name: "",
3523
- type: "uint256"
3524
- }
3525
- ],
3526
- stateMutability: "view",
3527
- type: "function"
3528
- },
3529
- {
3530
- inputs: [],
3531
- name: "protocolFee",
3532
- outputs: [
3533
- {
3534
- internalType: "uint256",
3535
- name: "",
3536
- type: "uint256"
3537
- }
3538
- ],
3539
- stateMutability: "view",
3540
- type: "function"
3541
- },
3542
- {
3543
- inputs: [
3544
- {
3545
- internalType: "address",
3546
- name: "",
3547
- type: "address"
3548
- },
3549
- {
3550
- internalType: "uint256",
3551
- name: "",
3552
- type: "uint256"
3553
- },
3554
- {
3555
- internalType: "address",
3556
- name: "",
3557
- type: "address"
3558
- }
3559
- ],
3560
- name: "providerEpochBalances",
3561
- outputs: [
3562
- {
3563
- internalType: "uint256",
3564
- name: "balance",
3565
- type: "uint256"
3566
- },
3567
- {
3568
- internalType: "uint256",
3569
- name: "disputeInProgressBalance",
3570
- type: "uint256"
3571
- },
3572
- {
3573
- internalType: "bool",
3574
- name: "isWithdrawn",
3575
- type: "bool"
3576
- }
3577
- ],
3578
- stateMutability: "view",
3579
- type: "function"
3580
- },
3581
- {
3582
- inputs: [
3583
- {
3584
- internalType: "address",
3585
- name: "",
3586
- type: "address"
3587
- }
3588
- ],
3589
- name: "providerReputations",
3590
- outputs: [
3591
- {
3592
- internalType: "uint256",
3593
- name: "completed",
3594
- type: "uint256"
3595
- },
3596
- {
3597
- internalType: "uint256",
3598
- name: "failed",
3599
- type: "uint256"
3600
- },
3601
- {
3602
- internalType: "uint256",
3603
- name: "faults",
3604
- type: "uint256"
3605
- },
3606
- {
3607
- internalType: "int256",
3608
- name: "score",
3609
- type: "int256"
3610
- },
3611
- {
3612
- internalType: "uint256",
3613
- name: "firstSettlementAt",
3614
- type: "uint256"
3615
- }
3616
- ],
3617
- stateMutability: "view",
3618
- type: "function"
3619
- },
3620
- {
3621
- inputs: [],
3622
- name: "proxiableUUID",
3623
- outputs: [
3624
- {
3625
- internalType: "bytes32",
3626
- name: "",
3627
- type: "bytes32"
3628
- }
3629
- ],
3630
- stateMutability: "view",
3631
- type: "function"
3632
- },
3633
- {
3634
- inputs: [
3635
- {
3636
- internalType: "bytes32",
3637
- name: "requestId",
3638
- type: "bytes32"
3639
- },
3640
- {
3641
- internalType: "bool",
3642
- name: "consumerWon",
3643
- type: "bool"
3644
- }
3645
- ],
3646
- name: "resolveDispute",
3647
- outputs: [],
3648
- stateMutability: "nonpayable",
3649
- type: "function"
3650
- },
3651
- {
3652
- inputs: [],
3653
- name: "roleManager",
3654
- outputs: [
3655
- {
3656
- internalType: "contract IRoleManager",
3657
- name: "",
3658
- type: "address"
3659
- }
3660
- ],
3661
- stateMutability: "view",
3662
- type: "function"
3663
- },
3664
- {
3665
- inputs: [
3666
- {
3667
- internalType: "uint256",
3668
- name: "_epochDuration",
3669
- type: "uint256"
3670
- },
3671
- {
3672
- internalType: "uint256",
3673
- name: "_epochReleaseDelay",
3674
- type: "uint256"
3675
- }
3676
- ],
3677
- name: "setEpochParameters",
3678
- outputs: [],
3679
- stateMutability: "nonpayable",
3680
- type: "function"
3681
- },
3682
- {
3683
- inputs: [
3684
- {
3685
- internalType: "uint256",
3686
- name: "_protocolFee",
3687
- type: "uint256"
3688
- },
3689
- {
3690
- internalType: "address",
3691
- name: "_feeCollector",
3692
- type: "address"
3693
- }
3694
- ],
3695
- name: "setFeeConfig",
3696
- outputs: [],
3697
- stateMutability: "nonpayable",
3698
- type: "function"
3699
- },
3700
- {
3701
- inputs: [
3702
- {
3703
- internalType: "uint256",
3704
- name: "_maxFacilitatorFee",
3705
- type: "uint256"
3706
- }
3707
- ],
3708
- name: "setMaxFacilitatorFee",
3709
- outputs: [],
3710
- stateMutability: "nonpayable",
3711
- type: "function"
3712
- },
3713
- {
3714
- inputs: [
3715
- {
3716
- internalType: "uint256",
3717
- name: "_requestExpirationTime",
3718
- type: "uint256"
3719
- }
3720
- ],
3721
- name: "setRequestExpirationTime",
3722
- outputs: [],
3723
- stateMutability: "nonpayable",
3724
- type: "function"
3725
- },
3726
- {
3727
- inputs: [
3728
- {
3729
- components: [
3730
- {
3731
- components: [
3732
- {
3733
- internalType: "contract IIATPWallet",
3734
- name: "consumer",
3735
- type: "address"
3736
- },
3737
- {
3738
- internalType: "contract IIATPWallet",
3739
- name: "provider",
3740
- type: "address"
3741
- },
3742
- {
3743
- internalType: "address",
3744
- name: "tokenAddress",
3745
- type: "address"
3746
- },
3747
- {
3748
- internalType: "uint256",
3749
- name: "amount",
3750
- type: "uint256"
3751
- },
3752
- {
3753
- internalType: "string",
3754
- name: "requestPath",
3755
- type: "string"
3756
- },
3757
- {
3758
- internalType: "uint256",
3759
- name: "consumerDeadline",
3760
- type: "uint256"
3761
- },
3762
- {
3763
- internalType: "uint256",
3764
- name: "timestamp",
3765
- type: "uint256"
3766
- },
3767
- {
3768
- internalType: "bytes32",
3769
- name: "serviceDescription",
3770
- type: "bytes32"
3771
- },
3772
- {
3773
- internalType: "bytes",
3774
- name: "outputHash",
3775
- type: "bytes"
3776
- },
3777
- {
3778
- internalType: "uint256",
3779
- name: "facilitatorFeePercent",
3780
- type: "uint256"
3781
- }
3782
- ],
3783
- internalType: "struct IIATPSettlementLayer.SettlementRequestData",
3784
- name: "requestData",
3785
- type: "tuple"
3786
- },
3787
- {
3788
- internalType: "bytes",
3789
- name: "consumerSignature",
3790
- type: "bytes"
3791
- },
3792
- {
3793
- internalType: "bytes",
3794
- name: "providerSignature",
3795
- type: "bytes"
3796
- }
3797
- ],
3798
- internalType: "struct IIATPSettlementLayer.SettlementRequest",
3799
- name: "req",
3800
- type: "tuple"
3801
- }
3802
- ],
3803
- name: "settleRequest",
3804
- outputs: [],
3805
- stateMutability: "nonpayable",
3806
- type: "function"
3807
- },
3808
- {
3809
- inputs: [
3810
- {
3811
- components: [
3812
- {
3813
- components: [
3814
- {
3815
- internalType: "contract IIATPWallet",
3816
- name: "consumer",
3817
- type: "address"
3818
- },
3819
- {
3820
- internalType: "contract IIATPWallet",
3821
- name: "provider",
3822
- type: "address"
3823
- },
3824
- {
3825
- internalType: "address",
3826
- name: "tokenAddress",
3827
- type: "address"
3828
- },
3829
- {
3830
- internalType: "uint256",
3831
- name: "amount",
3832
- type: "uint256"
3833
- },
3834
- {
3835
- internalType: "string",
3836
- name: "requestPath",
3837
- type: "string"
3838
- },
3839
- {
3840
- internalType: "uint256",
3841
- name: "consumerDeadline",
3842
- type: "uint256"
3843
- },
3844
- {
3845
- internalType: "uint256",
3846
- name: "timestamp",
3847
- type: "uint256"
3848
- },
3849
- {
3850
- internalType: "bytes32",
3851
- name: "serviceDescription",
3852
- type: "bytes32"
3853
- },
3854
- {
3855
- internalType: "bytes",
3856
- name: "outputHash",
3857
- type: "bytes"
3858
- },
3859
- {
3860
- internalType: "uint256",
3861
- name: "facilitatorFeePercent",
3862
- type: "uint256"
3863
- }
3864
- ],
3865
- internalType: "struct IIATPSettlementLayer.SettlementRequestData",
3866
- name: "requestData",
3867
- type: "tuple"
3868
- },
3869
- {
3870
- internalType: "bytes",
3871
- name: "consumerSignature",
3872
- type: "bytes"
3873
- },
3874
- {
3875
- internalType: "bytes",
3876
- name: "providerSignature",
3877
- type: "bytes"
3878
- }
3879
- ],
3880
- internalType: "struct IIATPSettlementLayer.SettlementRequest[]",
3881
- name: "serviceRequests",
3882
- type: "tuple[]"
3883
- }
3884
- ],
3885
- name: "settleRequests",
3886
- outputs: [
3887
- {
3888
- internalType: "uint256[]",
3889
- name: "failedIndices",
3890
- type: "uint256[]"
3891
- }
3892
- ],
3893
- stateMutability: "nonpayable",
3894
- type: "function"
3895
- },
3896
- {
3897
- inputs: [
3898
- {
3899
- internalType: "bytes32",
3900
- name: "",
3901
- type: "bytes32"
3902
- }
3903
- ],
3904
- name: "settlements",
3905
- outputs: [
3906
- {
3907
- components: [
3908
- {
3909
- components: [
3910
- {
3911
- internalType: "contract IIATPWallet",
3912
- name: "consumer",
3913
- type: "address"
3914
- },
3915
- {
3916
- internalType: "contract IIATPWallet",
3917
- name: "provider",
3918
- type: "address"
3919
- },
3920
- {
3921
- internalType: "address",
3922
- name: "tokenAddress",
3923
- type: "address"
3924
- },
3925
- {
3926
- internalType: "uint256",
3927
- name: "amount",
3928
- type: "uint256"
3929
- },
3930
- {
3931
- internalType: "string",
3932
- name: "requestPath",
3933
- type: "string"
3934
- },
3935
- {
3936
- internalType: "uint256",
3937
- name: "consumerDeadline",
3938
- type: "uint256"
3939
- },
3940
- {
3941
- internalType: "uint256",
3942
- name: "timestamp",
3943
- type: "uint256"
3944
- },
3945
- {
3946
- internalType: "bytes32",
3947
- name: "serviceDescription",
3948
- type: "bytes32"
3949
- },
3950
- {
3951
- internalType: "bytes",
3952
- name: "outputHash",
3953
- type: "bytes"
3954
- },
3955
- {
3956
- internalType: "uint256",
3957
- name: "facilitatorFeePercent",
3958
- type: "uint256"
3959
- }
3960
- ],
3961
- internalType: "struct IIATPSettlementLayer.SettlementRequestData",
3962
- name: "requestData",
3963
- type: "tuple"
3964
- },
3965
- {
3966
- internalType: "bytes",
3967
- name: "consumerSignature",
3968
- type: "bytes"
3969
- },
3970
- {
3971
- internalType: "bytes",
3972
- name: "providerSignature",
3973
- type: "bytes"
3974
- }
3975
- ],
3976
- internalType: "struct IIATPSettlementLayer.SettlementRequest",
3977
- name: "settlementRequest",
3978
- type: "tuple"
3979
- },
3980
- {
3981
- internalType: "uint256",
3982
- name: "epoch",
3983
- type: "uint256"
3984
- },
3985
- {
3986
- internalType: "enum IIATPSettlementLayer.RequestStatus",
3987
- name: "status",
3988
- type: "uint8"
3989
- }
3990
- ],
3991
- stateMutability: "view",
3992
- type: "function"
3993
- },
3994
- {
3995
- inputs: [
3996
- {
3997
- internalType: "address",
3998
- name: "newImplementation",
3999
- type: "address"
4000
- },
4001
- {
4002
- internalType: "bytes",
4003
- name: "data",
4004
- type: "bytes"
4005
- }
4006
- ],
4007
- name: "upgradeToAndCall",
4008
- outputs: [],
4009
- stateMutability: "payable",
4010
- type: "function"
4011
- },
4012
- {
4013
- inputs: [
4014
- {
4015
- internalType: "bytes32",
4016
- name: "",
4017
- type: "bytes32"
4018
- }
4019
- ],
4020
- name: "usedSignatures",
4021
- outputs: [
4022
- {
4023
- internalType: "bool",
4024
- name: "",
4025
- type: "bool"
4026
- }
4027
- ],
4028
- stateMutability: "view",
4029
- type: "function"
4030
- },
4031
- {
4032
- inputs: [
4033
- {
4034
- internalType: "address",
4035
- name: "token",
4036
- type: "address"
4037
- }
4038
- ],
4039
- name: "withdrawAllAvailableEpochs",
4040
- outputs: [],
4041
- stateMutability: "nonpayable",
4042
- type: "function"
4043
- },
4044
- {
4045
- inputs: [
4046
- {
4047
- internalType: "uint256",
4048
- name: "epoch",
4049
- type: "uint256"
4050
- },
4051
- {
4052
- internalType: "address",
4053
- name: "token",
4054
- type: "address"
4055
- }
4056
- ],
4057
- name: "withdrawEpochToken",
4058
- outputs: [],
4059
- stateMutability: "nonpayable",
4060
- type: "function"
4061
- }
4062
- ],
4063
- IATPWalletFactory: [
4064
- {
4065
- inputs: [],
4066
- stateMutability: "nonpayable",
4067
- type: "constructor"
4068
- },
4069
- {
4070
- inputs: [
4071
- {
4072
- internalType: "address",
4073
- name: "target",
4074
- type: "address"
4075
- }
4076
- ],
4077
- name: "AddressEmptyCode",
4078
- type: "error"
4079
- },
4080
- {
4081
- inputs: [
4082
- {
4083
- internalType: "address",
4084
- name: "implementation",
4085
- type: "address"
4086
- }
4087
- ],
4088
- name: "ERC1967InvalidImplementation",
4089
- type: "error"
4090
- },
4091
- {
4092
- inputs: [],
4093
- name: "ERC1967NonPayable",
4094
- type: "error"
4095
- },
4096
- {
4097
- inputs: [],
4098
- name: "FailedCall",
4099
- type: "error"
4100
- },
4101
- {
4102
- inputs: [],
4103
- name: "InvalidInitialization",
4104
- type: "error"
4105
- },
4106
- {
4107
- inputs: [],
4108
- name: "InvalidParameters",
4109
- type: "error"
4110
- },
4111
- {
4112
- inputs: [],
4113
- name: "NotInitializing",
4114
- type: "error"
4115
- },
4116
- {
4117
- inputs: [],
4118
- name: "UUPSUnauthorizedCallContext",
4119
- type: "error"
4120
- },
4121
- {
4122
- inputs: [
4123
- {
4124
- internalType: "bytes32",
4125
- name: "slot",
4126
- type: "bytes32"
4127
- }
4128
- ],
4129
- name: "UUPSUnsupportedProxiableUUID",
4130
- type: "error"
4131
- },
4132
- {
4133
- inputs: [],
4134
- name: "ZeroAddress",
4135
- type: "error"
4136
- },
4137
- {
4138
- anonymous: false,
4139
- inputs: [
4140
- {
4141
- indexed: false,
4142
- internalType: "uint64",
4143
- name: "version",
4144
- type: "uint64"
4145
- }
4146
- ],
4147
- name: "Initialized",
4148
- type: "event"
4149
- },
4150
- {
4151
- anonymous: false,
4152
- inputs: [
4153
- {
4154
- indexed: true,
4155
- internalType: "address",
4156
- name: "newRoleManager",
4157
- type: "address"
4158
- }
4159
- ],
4160
- name: "RoleManagerUpdated",
4161
- type: "event"
4162
- },
4163
- {
4164
- anonymous: false,
4165
- inputs: [
4166
- {
4167
- indexed: true,
4168
- internalType: "address",
4169
- name: "newSettlementLayer",
4170
- type: "address"
4171
- }
4172
- ],
4173
- name: "SettlementLayerUpdated",
4174
- type: "event"
4175
- },
4176
- {
4177
- anonymous: false,
4178
- inputs: [
4179
- {
4180
- indexed: true,
4181
- internalType: "address",
4182
- name: "implementation",
4183
- type: "address"
4184
- }
4185
- ],
4186
- name: "Upgraded",
4187
- type: "event"
4188
- },
4189
- {
4190
- anonymous: false,
4191
- inputs: [
4192
- {
4193
- indexed: true,
4194
- internalType: "address",
4195
- name: "wallet",
4196
- type: "address"
4197
- },
4198
- {
4199
- indexed: true,
4200
- internalType: "address",
4201
- name: "owner",
4202
- type: "address"
4203
- },
4204
- {
4205
- indexed: true,
4206
- internalType: "address",
4207
- name: "operatorAddress",
4208
- type: "address"
4209
- },
4210
- {
4211
- indexed: false,
4212
- internalType: "address",
4213
- name: "settlementLayer",
4214
- type: "address"
4215
- }
4216
- ],
4217
- name: "WalletCreated",
4218
- type: "event"
4219
- },
4220
- {
4221
- anonymous: false,
4222
- inputs: [
4223
- {
4224
- indexed: true,
4225
- internalType: "address",
4226
- name: "newImplementation",
4227
- type: "address"
4228
- }
4229
- ],
4230
- name: "WalletImplementationUpdated",
4231
- type: "event"
4232
- },
4233
- {
4234
- anonymous: false,
4235
- inputs: [
4236
- {
4237
- indexed: true,
4238
- internalType: "address",
4239
- name: "newRoleManager",
4240
- type: "address"
4241
- }
4242
- ],
4243
- name: "WalletRoleManagerUpdated",
4244
- type: "event"
4245
- },
4246
- {
4247
- inputs: [],
4248
- name: "BONDING_ROLE",
4249
- outputs: [
4250
- {
4251
- internalType: "bytes32",
4252
- name: "",
4253
- type: "bytes32"
4254
- }
4255
- ],
4256
- stateMutability: "view",
4257
- type: "function"
4258
- },
4259
- {
4260
- inputs: [],
4261
- name: "DEFAULT_ADMIN_ROLE",
4262
- outputs: [
4263
- {
4264
- internalType: "bytes32",
4265
- name: "",
4266
- type: "bytes32"
4267
- }
4268
- ],
4269
- stateMutability: "view",
4270
- type: "function"
4271
- },
4272
- {
4273
- inputs: [],
4274
- name: "UPGRADE_INTERFACE_VERSION",
4275
- outputs: [
4276
- {
4277
- internalType: "string",
4278
- name: "",
4279
- type: "string"
4280
- }
4281
- ],
4282
- stateMutability: "view",
4283
- type: "function"
4284
- },
4285
- {
4286
- inputs: [
4287
- {
4288
- internalType: "uint256",
4289
- name: "",
4290
- type: "uint256"
4291
- }
4292
- ],
4293
- name: "allWallets",
4294
- outputs: [
4295
- {
4296
- internalType: "address",
4297
- name: "",
4298
- type: "address"
4299
- }
4300
- ],
4301
- stateMutability: "view",
4302
- type: "function"
4303
- },
4304
- {
4305
- inputs: [
4306
- {
4307
- internalType: "address",
4308
- name: "_operatorAddress",
4309
- type: "address"
4310
- }
4311
- ],
4312
- name: "createWallet",
4313
- outputs: [
4314
- {
4315
- internalType: "address",
4316
- name: "wallet",
4317
- type: "address"
4318
- }
4319
- ],
4320
- stateMutability: "nonpayable",
4321
- type: "function"
4322
- },
4323
- {
4324
- inputs: [
4325
- {
4326
- internalType: "address",
4327
- name: "_owner",
4328
- type: "address"
4329
- },
4330
- {
4331
- internalType: "address",
4332
- name: "_operatorAddress",
4333
- type: "address"
4334
- }
4335
- ],
4336
- name: "createWalletFor",
4337
- outputs: [
4338
- {
4339
- internalType: "address",
4340
- name: "wallet",
4341
- type: "address"
4342
- }
4343
- ],
4344
- stateMutability: "nonpayable",
4345
- type: "function"
4346
- },
4347
- {
4348
- inputs: [
4349
- {
4350
- internalType: "address",
4351
- name: "_operator",
4352
- type: "address"
4353
- }
4354
- ],
4355
- name: "getOperatorWalletCount",
4356
- outputs: [
4357
- {
4358
- internalType: "uint256",
4359
- name: "",
4360
- type: "uint256"
4361
- }
4362
- ],
4363
- stateMutability: "view",
4364
- type: "function"
4365
- },
4366
- {
4367
- inputs: [
4368
- {
4369
- internalType: "address",
4370
- name: "_owner",
4371
- type: "address"
4372
- }
4373
- ],
4374
- name: "getOwnerWalletCount",
4375
- outputs: [
4376
- {
4377
- internalType: "uint256",
4378
- name: "",
4379
- type: "uint256"
4380
- }
4381
- ],
4382
- stateMutability: "view",
4383
- type: "function"
4384
- },
4385
- {
4386
- inputs: [],
4387
- name: "getTotalWallets",
4388
- outputs: [
4389
- {
4390
- internalType: "uint256",
4391
- name: "",
4392
- type: "uint256"
4393
- }
4394
- ],
4395
- stateMutability: "view",
4396
- type: "function"
4397
- },
4398
- {
4399
- inputs: [
4400
- {
4401
- internalType: "address",
4402
- name: "_owner",
4403
- type: "address"
4404
- }
4405
- ],
4406
- name: "getWallet",
4407
- outputs: [
4408
- {
4409
- internalType: "address",
4410
- name: "",
4411
- type: "address"
4412
- }
4413
- ],
4414
- stateMutability: "view",
4415
- type: "function"
4416
- },
4417
- {
4418
- inputs: [
4419
- {
4420
- internalType: "uint256",
4421
- name: "_offset",
4422
- type: "uint256"
4423
- },
4424
- {
4425
- internalType: "uint256",
4426
- name: "_limit",
4427
- type: "uint256"
4428
- }
4429
- ],
4430
- name: "getWallets",
4431
- outputs: [
4432
- {
4433
- internalType: "address[]",
4434
- name: "wallets",
4435
- type: "address[]"
4436
- },
4437
- {
4438
- internalType: "uint256",
4439
- name: "total",
4440
- type: "uint256"
4441
- }
4442
- ],
4443
- stateMutability: "view",
4444
- type: "function"
4445
- },
4446
- {
4447
- inputs: [
4448
- {
4449
- internalType: "address",
4450
- name: "_operator",
4451
- type: "address"
4452
- }
4453
- ],
4454
- name: "getWalletsByOperator",
4455
- outputs: [
4456
- {
4457
- internalType: "address[]",
4458
- name: "",
4459
- type: "address[]"
4460
- }
4461
- ],
4462
- stateMutability: "view",
4463
- type: "function"
4464
- },
4465
- {
4466
- inputs: [
4467
- {
4468
- internalType: "address",
4469
- name: "_owner",
4470
- type: "address"
4471
- }
4472
- ],
4473
- name: "getWalletsByOwner",
4474
- outputs: [
4475
- {
4476
- internalType: "address[]",
4477
- name: "",
4478
- type: "address[]"
4479
- }
4480
- ],
4481
- stateMutability: "view",
4482
- type: "function"
4483
- },
4484
- {
4485
- inputs: [
4486
- {
4487
- internalType: "address",
4488
- name: "_owner",
4489
- type: "address"
4490
- }
4491
- ],
4492
- name: "hasWallet",
4493
- outputs: [
4494
- {
4495
- internalType: "bool",
4496
- name: "",
4497
- type: "bool"
4498
- }
4499
- ],
4500
- stateMutability: "view",
4501
- type: "function"
4502
- },
4503
- {
4504
- inputs: [
4505
- {
4506
- internalType: "address",
4507
- name: "_roleManager",
4508
- type: "address"
4509
- },
4510
- {
4511
- internalType: "address",
4512
- name: "_walletRoleManager",
4513
- type: "address"
4514
- },
4515
- {
4516
- internalType: "address",
4517
- name: "_settlementLayer",
4518
- type: "address"
4519
- },
4520
- {
4521
- internalType: "address",
4522
- name: "_walletImplementation",
4523
- type: "address"
4524
- }
4525
- ],
4526
- name: "initialize",
4527
- outputs: [],
4528
- stateMutability: "nonpayable",
4529
- type: "function"
4530
- },
4531
- {
4532
- inputs: [
4533
- {
4534
- internalType: "address",
4535
- name: "account",
4536
- type: "address"
4537
- }
4538
- ],
4539
- name: "isMaintainer",
4540
- outputs: [
4541
- {
4542
- internalType: "bool",
4543
- name: "",
4544
- type: "bool"
4545
- }
4546
- ],
4547
- stateMutability: "view",
4548
- type: "function"
4549
- },
4550
- {
4551
- inputs: [
4552
- {
4553
- internalType: "address",
4554
- name: "",
4555
- type: "address"
4556
- }
4557
- ],
4558
- name: "ownerByWallet",
4559
- outputs: [
4560
- {
4561
- internalType: "address",
4562
- name: "",
4563
- type: "address"
4564
- }
4565
- ],
4566
- stateMutability: "view",
4567
- type: "function"
4568
- },
4569
- {
4570
- inputs: [],
4571
- name: "proxiableUUID",
4572
- outputs: [
4573
- {
4574
- internalType: "bytes32",
4575
- name: "",
4576
- type: "bytes32"
4577
- }
4578
- ],
4579
- stateMutability: "view",
4580
- type: "function"
4581
- },
4582
- {
4583
- inputs: [],
4584
- name: "roleManager",
4585
- outputs: [
4586
- {
4587
- internalType: "contract IRoleManager",
4588
- name: "",
4589
- type: "address"
4590
- }
4591
- ],
4592
- stateMutability: "view",
4593
- type: "function"
4594
- },
4595
- {
4596
- inputs: [
4597
- {
4598
- internalType: "address",
4599
- name: "_newSettlementLayer",
4600
- type: "address"
4601
- }
4602
- ],
4603
- name: "setSettlementLayer",
4604
- outputs: [],
4605
- stateMutability: "nonpayable",
4606
- type: "function"
4607
- },
4608
- {
4609
- inputs: [
4610
- {
4611
- internalType: "address",
4612
- name: "_newWalletImplementation",
4613
- type: "address"
4614
- }
4615
- ],
4616
- name: "setWalletImplementation",
4617
- outputs: [],
4618
- stateMutability: "nonpayable",
4619
- type: "function"
4620
- },
4621
- {
4622
- inputs: [
4623
- {
4624
- internalType: "address",
4625
- name: "_newWalletRoleManager",
4626
- type: "address"
4627
- }
4628
- ],
4629
- name: "setWalletRoleManager",
4630
- outputs: [],
4631
- stateMutability: "nonpayable",
4632
- type: "function"
4633
- },
4634
- {
4635
- inputs: [],
4636
- name: "settlementLayer",
4637
- outputs: [
4638
- {
4639
- internalType: "address",
4640
- name: "",
4641
- type: "address"
4642
- }
4643
- ],
4644
- stateMutability: "view",
4645
- type: "function"
4646
- },
4647
- {
4648
- inputs: [],
4649
- name: "totalWallets",
4650
- outputs: [
4651
- {
4652
- internalType: "uint256",
4653
- name: "",
4654
- type: "uint256"
4655
- }
4656
- ],
4657
- stateMutability: "view",
4658
- type: "function"
4659
- },
4660
- {
4661
- inputs: [
4662
- {
4663
- internalType: "address",
4664
- name: "newImplementation",
4665
- type: "address"
4666
- },
4667
- {
4668
- internalType: "bytes",
4669
- name: "data",
4670
- type: "bytes"
4671
- }
4672
- ],
4673
- name: "upgradeToAndCall",
4674
- outputs: [],
4675
- stateMutability: "payable",
4676
- type: "function"
4677
- },
4678
- {
4679
- inputs: [],
4680
- name: "walletImplementation",
4681
- outputs: [
4682
- {
4683
- internalType: "address",
4684
- name: "",
4685
- type: "address"
4686
- }
4687
- ],
4688
- stateMutability: "view",
4689
- type: "function"
4690
- },
4691
- {
4692
- inputs: [],
4693
- name: "walletRoleManager",
4694
- outputs: [
4695
- {
4696
- internalType: "address",
4697
- name: "",
4698
- type: "address"
4699
- }
4700
- ],
4701
- stateMutability: "view",
4702
- type: "function"
4703
- },
4704
- {
4705
- inputs: [
4706
- {
4707
- internalType: "address",
4708
- name: "",
4709
- type: "address"
4710
- },
4711
- {
4712
- internalType: "uint256",
4713
- name: "",
4714
- type: "uint256"
4715
- }
4716
- ],
4717
- name: "walletsByOperator",
4718
- outputs: [
4719
- {
4720
- internalType: "address",
4721
- name: "",
4722
- type: "address"
4723
- }
4724
- ],
4725
- stateMutability: "view",
4726
- type: "function"
4727
- },
4728
- {
4729
- inputs: [
4730
- {
4731
- internalType: "address",
4732
- name: "",
4733
- type: "address"
4734
- },
4735
- {
4736
- internalType: "uint256",
4737
- name: "",
4738
- type: "uint256"
4739
- }
4740
- ],
4741
- name: "walletsByOwner",
4742
- outputs: [
4743
- {
4744
- internalType: "address",
4745
- name: "",
4746
- type: "address"
4747
- }
4748
- ],
4749
- stateMutability: "view",
4750
- type: "function"
4751
- }
4752
- ]
4753
- }
4754
- };
4755
-
4756
- // src/contracts/abis/localhost.json
4757
- var localhost_default = {
4758
- localhost: {
4759
- IATPWallet: [
4760
- {
4761
- inputs: [],
4762
- stateMutability: "nonpayable",
4763
- type: "constructor"
4764
- },
4765
- {
4766
- inputs: [
4767
- {
4768
- internalType: "address",
4769
- name: "target",
4770
- type: "address"
4771
- }
4772
- ],
4773
- name: "AddressEmptyCode",
4774
- type: "error"
4775
- },
4776
- {
4777
- inputs: [],
4778
- name: "ECDSAInvalidSignature",
4779
- type: "error"
4780
- },
4781
- {
4782
- inputs: [
4783
- {
4784
- internalType: "uint256",
4785
- name: "length",
4786
- type: "uint256"
4787
- }
4788
- ],
4789
- name: "ECDSAInvalidSignatureLength",
4790
- type: "error"
4791
- },
4792
- {
4793
- inputs: [
4794
- {
4795
- internalType: "bytes32",
4796
- name: "s",
4797
- type: "bytes32"
4798
- }
4799
- ],
4800
- name: "ECDSAInvalidSignatureS",
4801
- type: "error"
4802
- },
4803
- {
4804
- inputs: [
4805
- {
4806
- internalType: "address",
4807
- name: "implementation",
4808
- type: "address"
4809
- }
4810
- ],
4811
- name: "ERC1967InvalidImplementation",
4812
- type: "error"
4813
- },
4814
- {
4815
- inputs: [],
4816
- name: "ERC1967NonPayable",
4817
- type: "error"
4818
- },
4819
- {
4820
- inputs: [],
4821
- name: "FailedCall",
4822
- type: "error"
4823
- },
4824
- {
4825
- inputs: [],
4826
- name: "InsufficientBalance",
4827
- type: "error"
4828
- },
4829
- {
4830
- inputs: [],
4831
- name: "InvalidAmount",
4832
- type: "error"
4833
- },
4834
- {
4835
- inputs: [],
4836
- name: "InvalidInitialization",
4837
- type: "error"
4838
- },
4839
- {
4840
- inputs: [],
4841
- name: "InvalidOperatorAddress",
4842
- type: "error"
4843
- },
4844
- {
4845
- inputs: [],
4846
- name: "InvalidOwnerAddress",
4847
- type: "error"
4848
- },
4849
- {
4850
- inputs: [],
4851
- name: "InvalidProvider",
4852
- type: "error"
4853
- },
4854
- {
4855
- inputs: [],
4856
- name: "InvalidSettlementLayerAddress",
4857
- type: "error"
4858
- },
4859
- {
4860
- inputs: [],
4861
- name: "InvalidSignature",
4862
- type: "error"
4863
- },
4864
- {
4865
- inputs: [],
4866
- name: "InvalidTokenAddress",
4867
- type: "error"
4868
- },
4869
- {
4870
- inputs: [],
4871
- name: "NotAuthorized",
4872
- type: "error"
4873
- },
4874
- {
4875
- inputs: [],
4876
- name: "NotInitializing",
4877
- type: "error"
4878
- },
4879
- {
4880
- inputs: [],
4881
- name: "NotSettlementLayer",
4882
- type: "error"
4883
- },
4884
- {
4885
- inputs: [],
4886
- name: "OnlyOwner",
4887
- type: "error"
4888
- },
4889
- {
4890
- inputs: [],
4891
- name: "PendingWithdrawalExists",
4892
- type: "error"
4893
- },
4894
- {
4895
- inputs: [
4896
- {
4897
- internalType: "address",
4898
- name: "token",
4899
- type: "address"
4900
- }
4901
- ],
4902
- name: "SafeERC20FailedOperation",
4903
- type: "error"
4904
- },
4905
- {
4906
- inputs: [],
4907
- name: "SignatureExpired",
4908
- type: "error"
4909
- },
4910
- {
4911
- inputs: [],
4912
- name: "TransferFailed",
4913
- type: "error"
4914
- },
4915
- {
4916
- inputs: [],
4917
- name: "UUPSUnauthorizedCallContext",
4918
- type: "error"
4919
- },
4920
- {
4921
- inputs: [
4922
- {
4923
- internalType: "bytes32",
4924
- name: "slot",
4925
- type: "bytes32"
4926
- }
4927
- ],
4928
- name: "UUPSUnsupportedProxiableUUID",
4929
- type: "error"
4930
- },
4931
- {
4932
- inputs: [],
4933
- name: "WithdrawalAlreadyExecuted",
4934
- type: "error"
4935
- },
4936
- {
4937
- inputs: [],
4938
- name: "WithdrawalLockupNotExpired",
4939
- type: "error"
4940
- },
4941
- {
4942
- inputs: [],
4943
- name: "WithdrawalRequestNotFound",
4944
- type: "error"
4945
- },
4946
- {
4947
- anonymous: false,
4948
- inputs: [
4949
- {
4950
- indexed: true,
4951
- internalType: "address",
4952
- name: "owner",
4953
- type: "address"
4954
- },
4955
- {
4956
- indexed: true,
4957
- internalType: "address",
4958
- name: "operatorAddress",
4959
- type: "address"
4960
- },
4961
- {
4962
- indexed: false,
4963
- internalType: "address",
4964
- name: "settlementLayer",
4965
- type: "address"
4966
- }
4967
- ],
4968
- name: "ClientInitialized",
4969
- type: "event"
4970
- },
4971
- {
4972
- anonymous: false,
4973
- inputs: [],
4974
- name: "EIP712DomainChanged",
4975
- type: "event"
4976
- },
4977
- {
4978
- anonymous: false,
4979
- inputs: [
4980
- {
4981
- indexed: true,
4982
- internalType: "address",
4983
- name: "token",
4984
- type: "address"
4985
- },
4986
- {
4987
- indexed: false,
4988
- internalType: "uint256",
4989
- name: "amount",
4990
- type: "uint256"
4991
- }
4992
- ],
4993
- name: "FundsDeposited",
4994
- type: "event"
4995
- },
4996
- {
4997
- anonymous: false,
4998
- inputs: [
4999
- {
5000
- indexed: true,
5001
- internalType: "address",
5002
- name: "token",
5003
- type: "address"
5004
- },
5005
- {
5006
- indexed: false,
5007
- internalType: "uint256",
5008
- name: "amount",
5009
- type: "uint256"
5010
- },
5011
- {
5012
- indexed: true,
5013
- internalType: "address",
5014
- name: "provider",
5015
- type: "address"
5016
- },
5017
- {
5018
- indexed: true,
5019
- internalType: "address",
5020
- name: "signer",
5021
- type: "address"
5022
- }
5023
- ],
5024
- name: "FundsTransferredToSettlement",
5025
- type: "event"
5026
- },
5027
- {
5028
- anonymous: false,
5029
- inputs: [
5030
- {
5031
- indexed: false,
5032
- internalType: "uint64",
5033
- name: "version",
5034
- type: "uint64"
5035
- }
5036
- ],
5037
- name: "Initialized",
5038
- type: "event"
5039
- },
5040
- {
5041
- anonymous: false,
5042
- inputs: [
5043
- {
5044
- indexed: true,
5045
- internalType: "address",
5046
- name: "oldOperator",
5047
- type: "address"
5048
- },
5049
- {
5050
- indexed: true,
5051
- internalType: "address",
5052
- name: "newOperator",
5053
- type: "address"
5054
- }
5055
- ],
5056
- name: "OperatorAddressUpdated",
5057
- type: "event"
5058
- },
5059
- {
5060
- anonymous: false,
5061
- inputs: [
5062
- {
5063
- indexed: true,
5064
- internalType: "address",
5065
- name: "newRoleManager",
5066
- type: "address"
5067
- }
5068
- ],
5069
- name: "RoleManagerUpdated",
5070
- type: "event"
5071
- },
5072
- {
5073
- anonymous: false,
5074
- inputs: [
5075
- {
5076
- indexed: true,
5077
- internalType: "address",
5078
- name: "implementation",
5079
- type: "address"
5080
- }
5081
- ],
5082
- name: "Upgraded",
5083
- type: "event"
5084
- },
5085
- {
5086
- anonymous: false,
5087
- inputs: [
5088
- {
5089
- indexed: true,
5090
- internalType: "address",
5091
- name: "token",
5092
- type: "address"
5093
- },
5094
- {
5095
- indexed: false,
5096
- internalType: "uint256",
5097
- name: "amount",
5098
- type: "uint256"
5099
- }
5100
- ],
5101
- name: "WithdrawalCancelled",
5102
- type: "event"
5103
- },
5104
- {
5105
- anonymous: false,
5106
- inputs: [
5107
- {
5108
- indexed: true,
5109
- internalType: "address",
5110
- name: "token",
5111
- type: "address"
5112
- },
5113
- {
5114
- indexed: false,
5115
- internalType: "uint256",
5116
- name: "amount",
5117
- type: "uint256"
5118
- },
5119
- {
5120
- indexed: true,
5121
- internalType: "address",
5122
- name: "recipient",
5123
- type: "address"
5124
- }
5125
- ],
5126
- name: "WithdrawalExecuted",
5127
- type: "event"
5128
- },
5129
- {
5130
- anonymous: false,
5131
- inputs: [
5132
- {
5133
- indexed: true,
5134
- internalType: "address",
5135
- name: "token",
5136
- type: "address"
5137
- },
5138
- {
5139
- indexed: false,
5140
- internalType: "uint256",
5141
- name: "amount",
5142
- type: "uint256"
5143
- },
5144
- {
5145
- indexed: false,
5146
- internalType: "uint256",
5147
- name: "requestedAt",
5148
- type: "uint256"
5149
- },
5150
- {
5151
- indexed: false,
5152
- internalType: "uint256",
5153
- name: "unlockTime",
5154
- type: "uint256"
5155
- }
5156
- ],
5157
- name: "WithdrawalRequested",
5158
- type: "event"
5159
- },
5160
- {
5161
- inputs: [],
5162
- name: "BONDING_ROLE",
5163
- outputs: [
5164
- {
5165
- internalType: "bytes32",
5166
- name: "",
5167
- type: "bytes32"
5168
- }
5169
- ],
5170
- stateMutability: "view",
5171
- type: "function"
5172
- },
5173
- {
5174
- inputs: [],
5175
- name: "DEFAULT_ADMIN_ROLE",
5176
- outputs: [
5177
- {
5178
- internalType: "bytes32",
5179
- name: "",
5180
- type: "bytes32"
5181
- }
5182
- ],
5183
- stateMutability: "view",
5184
- type: "function"
5185
- },
5186
- {
5187
- inputs: [],
5188
- name: "PROVIDER_ATTESTATION_TYPEHASH",
5189
- outputs: [
5190
- {
5191
- internalType: "bytes32",
5192
- name: "",
5193
- type: "bytes32"
5194
- }
5195
- ],
5196
- stateMutability: "view",
5197
- type: "function"
5198
- },
5199
- {
5200
- inputs: [],
5201
- name: "PULL_FUNDS_FOR_SETTLEMENT_TYPEHASH",
5202
- outputs: [
5203
- {
5204
- internalType: "bytes32",
5205
- name: "",
5206
- type: "bytes32"
5207
- }
5208
- ],
5209
- stateMutability: "view",
5210
- type: "function"
5211
- },
5212
- {
5213
- inputs: [],
5214
- name: "UPGRADE_INTERFACE_VERSION",
5215
- outputs: [
5216
- {
5217
- internalType: "string",
5218
- name: "",
5219
- type: "string"
5220
- }
5221
- ],
5222
- stateMutability: "view",
5223
- type: "function"
5224
- },
5225
- {
5226
- inputs: [],
5227
- name: "WITHDRAWAL_LOCKUP_PERIOD",
5228
- outputs: [
5229
- {
5230
- internalType: "uint256",
5231
- name: "",
5232
- type: "uint256"
5233
- }
5234
- ],
5235
- stateMutability: "view",
5236
- type: "function"
5237
- },
5238
- {
5239
- inputs: [
5240
- {
5241
- internalType: "address",
5242
- name: "token",
5243
- type: "address"
5244
- }
5245
- ],
5246
- name: "cancelWithdrawal",
5247
- outputs: [],
5248
- stateMutability: "nonpayable",
5249
- type: "function"
5250
- },
5251
- {
5252
- inputs: [
5253
- {
5254
- internalType: "address",
5255
- name: "token",
5256
- type: "address"
5257
- },
5258
- {
5259
- internalType: "uint256",
5260
- name: "amount",
5261
- type: "uint256"
5262
- }
5263
- ],
5264
- name: "deposit",
5265
- outputs: [],
5266
- stateMutability: "nonpayable",
5267
- type: "function"
5268
- },
5269
- {
5270
- inputs: [],
5271
- name: "eip712Domain",
5272
- outputs: [
5273
- {
5274
- internalType: "bytes1",
5275
- name: "fields",
5276
- type: "bytes1"
5277
- },
5278
- {
5279
- internalType: "string",
5280
- name: "name",
5281
- type: "string"
5282
- },
5283
- {
5284
- internalType: "string",
5285
- name: "version",
5286
- type: "string"
5287
- },
5288
- {
5289
- internalType: "uint256",
5290
- name: "chainId",
5291
- type: "uint256"
5292
- },
5293
- {
5294
- internalType: "address",
5295
- name: "verifyingContract",
5296
- type: "address"
5297
- },
5298
- {
5299
- internalType: "bytes32",
5300
- name: "salt",
5301
- type: "bytes32"
5302
- },
5303
- {
5304
- internalType: "uint256[]",
5305
- name: "extensions",
5306
- type: "uint256[]"
5307
- }
5308
- ],
5309
- stateMutability: "view",
5310
- type: "function"
5311
- },
5312
- {
5313
- inputs: [
5314
- {
5315
- internalType: "address",
5316
- name: "token",
5317
- type: "address"
5318
- }
5319
- ],
5320
- name: "executeWithdrawal",
5321
- outputs: [],
5322
- stateMutability: "nonpayable",
5323
- type: "function"
5324
- },
5325
- {
5326
- inputs: [
5327
- {
5328
- internalType: "address",
5329
- name: "token",
5330
- type: "address"
5331
- }
5332
- ],
5333
- name: "getBalance",
5334
- outputs: [
5335
- {
5336
- internalType: "uint256",
5337
- name: "",
5338
- type: "uint256"
5339
- }
5340
- ],
5341
- stateMutability: "view",
5342
- type: "function"
5343
- },
5344
- {
5345
- inputs: [
5346
- {
5347
- internalType: "address",
5348
- name: "token",
5349
- type: "address"
5350
- }
5351
- ],
5352
- name: "getWithdrawalRequest",
5353
- outputs: [
5354
- {
5355
- components: [
5356
- {
5357
- internalType: "address",
5358
- name: "token",
5359
- type: "address"
5360
- },
5361
- {
5362
- internalType: "uint256",
5363
- name: "amount",
5364
- type: "uint256"
5365
- },
5366
- {
5367
- internalType: "uint256",
5368
- name: "requestedAt",
5369
- type: "uint256"
5370
- },
5371
- {
5372
- internalType: "bool",
5373
- name: "executed",
5374
- type: "bool"
5375
- }
5376
- ],
5377
- internalType: "struct IIATPWallet.WithdrawalRequest",
5378
- name: "request",
5379
- type: "tuple"
5380
- },
5381
- {
5382
- internalType: "uint256",
5383
- name: "unlockTime",
5384
- type: "uint256"
5385
- }
5386
- ],
5387
- stateMutability: "view",
5388
- type: "function"
5389
- },
5390
- {
5391
- inputs: [
5392
- {
5393
- internalType: "address",
5394
- name: "_roleManager",
5395
- type: "address"
5396
- },
5397
- {
5398
- internalType: "address",
5399
- name: "_owner",
5400
- type: "address"
5401
- },
5402
- {
5403
- internalType: "address",
5404
- name: "_operatorAddress",
5405
- type: "address"
5406
- },
5407
- {
5408
- internalType: "address",
5409
- name: "_settlementLayer",
5410
- type: "address"
5411
- }
5412
- ],
5413
- name: "initialize",
5414
- outputs: [],
5415
- stateMutability: "nonpayable",
5416
- type: "function"
5417
- },
5418
- {
5419
- inputs: [
5420
- {
5421
- internalType: "address",
5422
- name: "account",
5423
- type: "address"
5424
- }
5425
- ],
5426
- name: "isMaintainer",
5427
- outputs: [
5428
- {
5429
- internalType: "bool",
5430
- name: "",
5431
- type: "bool"
5432
- }
5433
- ],
5434
- stateMutability: "view",
5435
- type: "function"
5436
- },
5437
- {
5438
- inputs: [],
5439
- name: "operatorAddress",
5440
- outputs: [
5441
- {
5442
- internalType: "address",
5443
- name: "",
5444
- type: "address"
5445
- }
5446
- ],
5447
- stateMutability: "view",
5448
- type: "function"
5449
- },
5450
- {
5451
- inputs: [],
5452
- name: "owner",
5453
- outputs: [
5454
- {
5455
- internalType: "address",
5456
- name: "",
5457
- type: "address"
5458
- }
5459
- ],
5460
- stateMutability: "view",
5461
- type: "function"
5462
- },
5463
- {
5464
- inputs: [],
5465
- name: "proxiableUUID",
5466
- outputs: [
5467
- {
5468
- internalType: "bytes32",
5469
- name: "",
5470
- type: "bytes32"
5471
- }
5472
- ],
5473
- stateMutability: "view",
5474
- type: "function"
5475
- },
5476
- {
5477
- inputs: [
5478
- {
5479
- internalType: "address",
5480
- name: "token",
5481
- type: "address"
5482
- },
5483
- {
5484
- internalType: "uint256",
5485
- name: "amount",
5486
- type: "uint256"
5487
- },
5488
- {
5489
- internalType: "address",
5490
- name: "provider",
5491
- type: "address"
5492
- },
5493
- {
5494
- internalType: "uint256",
5495
- name: "deadline",
5496
- type: "uint256"
5497
- },
5498
- {
5499
- internalType: "string",
5500
- name: "requestPath",
5501
- type: "string"
5502
- },
5503
- {
5504
- internalType: "bytes",
5505
- name: "signature",
5506
- type: "bytes"
5507
- }
5508
- ],
5509
- name: "pullFundsForSettlement",
5510
- outputs: [],
5511
- stateMutability: "nonpayable",
5512
- type: "function"
5513
- },
5514
- {
5515
- inputs: [
5516
- {
5517
- internalType: "address",
5518
- name: "token",
5519
- type: "address"
5520
- },
5521
- {
5522
- internalType: "uint256",
5523
- name: "amount",
5524
- type: "uint256"
5525
- }
5526
- ],
5527
- name: "requestWithdrawal",
5528
- outputs: [],
5529
- stateMutability: "nonpayable",
5530
- type: "function"
5531
- },
5532
- {
5533
- inputs: [],
5534
- name: "roleManager",
5535
- outputs: [
5536
- {
5537
- internalType: "contract IRoleManager",
5538
- name: "",
5539
- type: "address"
5540
- }
5541
- ],
5542
- stateMutability: "view",
5543
- type: "function"
5544
- },
5545
- {
5546
- inputs: [],
5547
- name: "settlementLayer",
5548
- outputs: [
5549
- {
5550
- internalType: "contract IIATPSettlementLayer",
5551
- name: "",
5552
- type: "address"
5553
- }
5554
- ],
5555
- stateMutability: "view",
5556
- type: "function"
5557
- },
5558
- {
5559
- inputs: [
5560
- {
5561
- internalType: "address",
5562
- name: "_newOperatorAddress",
5563
- type: "address"
5564
- }
5565
- ],
5566
- name: "updateOperatorAddress",
5567
- outputs: [],
5568
- stateMutability: "nonpayable",
5569
- type: "function"
5570
- },
5571
- {
5572
- inputs: [
5573
- {
5574
- internalType: "address",
5575
- name: "newImplementation",
5576
- type: "address"
5577
- },
5578
- {
5579
- internalType: "bytes",
5580
- name: "data",
5581
- type: "bytes"
5582
- }
5583
- ],
5584
- name: "upgradeToAndCall",
5585
- outputs: [],
5586
- stateMutability: "payable",
5587
- type: "function"
5588
- },
5589
- {
5590
- inputs: [
5591
- {
5592
- internalType: "address",
5593
- name: "token",
5594
- type: "address"
5595
- },
5596
- {
5597
- internalType: "uint256",
5598
- name: "amount",
5599
- type: "uint256"
5600
- },
5601
- {
5602
- internalType: "address",
5603
- name: "provider",
5604
- type: "address"
5605
- },
5606
- {
5607
- internalType: "uint256",
5608
- name: "deadline",
5609
- type: "uint256"
5610
- },
5611
- {
5612
- internalType: "string",
5613
- name: "requestPath",
5614
- type: "string"
5615
- },
5616
- {
5617
- internalType: "bytes",
5618
- name: "signature",
5619
- type: "bytes"
5620
- }
5621
- ],
5622
- name: "validateConsumerSignature",
5623
- outputs: [
5624
- {
5625
- internalType: "bool",
5626
- name: "",
5627
- type: "bool"
5628
- }
5629
- ],
5630
- stateMutability: "view",
5631
- type: "function"
5632
- },
5633
- {
5634
- inputs: [
5635
- {
5636
- internalType: "bytes",
5637
- name: "consumerSignature",
5638
- type: "bytes"
5639
- },
5640
- {
5641
- internalType: "bytes",
5642
- name: "outputHash",
5643
- type: "bytes"
5644
- },
5645
- {
5646
- internalType: "uint256",
5647
- name: "timestamp",
5648
- type: "uint256"
5649
- },
5650
- {
5651
- internalType: "bytes32",
5652
- name: "serviceDescription",
5653
- type: "bytes32"
5654
- },
5655
- {
5656
- internalType: "uint256",
5657
- name: "facilitatorFeePercent",
5658
- type: "uint256"
5659
- },
5660
- {
5661
- internalType: "bytes",
5662
- name: "signature",
5663
- type: "bytes"
5664
- }
5665
- ],
5666
- name: "validateProviderAttestation",
5667
- outputs: [],
5668
- stateMutability: "view",
5669
- type: "function"
5670
- },
5671
- {
5672
- inputs: [
5673
- {
5674
- internalType: "address",
5675
- name: "token",
5676
- type: "address"
5677
- }
5678
- ],
5679
- name: "withdrawAllFromSettlement",
5680
- outputs: [],
5681
- stateMutability: "nonpayable",
5682
- type: "function"
5683
- },
5684
- {
5685
- inputs: [
5686
- {
5687
- internalType: "uint256",
5688
- name: "epoch",
5689
- type: "uint256"
5690
- },
5691
- {
5692
- internalType: "address",
5693
- name: "token",
5694
- type: "address"
5695
- }
5696
- ],
5697
- name: "withdrawEpochFromSettlement",
5698
- outputs: [],
5699
- stateMutability: "nonpayable",
5700
- type: "function"
5701
- },
5702
- {
5703
- inputs: [
5704
- {
5705
- internalType: "address",
5706
- name: "",
5707
- type: "address"
5708
- }
5709
- ],
5710
- name: "withdrawalRequests",
5711
- outputs: [
5712
- {
5713
- internalType: "address",
5714
- name: "token",
5715
- type: "address"
5716
- },
5717
- {
5718
- internalType: "uint256",
5719
- name: "amount",
5720
- type: "uint256"
5721
- },
5722
- {
5723
- internalType: "uint256",
5724
- name: "requestedAt",
5725
- type: "uint256"
5726
- },
5727
- {
5728
- internalType: "bool",
5729
- name: "executed",
5730
- type: "bool"
5731
- }
5732
- ],
5733
- stateMutability: "view",
5734
- type: "function"
5735
- },
5736
- {
5737
- stateMutability: "payable",
5738
- type: "receive"
5739
- }
5740
- ],
5741
- RoleManager: [
5742
- {
5743
- inputs: [],
5744
- name: "AccessControlBadConfirmation",
5745
- type: "error"
5746
- },
5747
- {
5748
- inputs: [
5749
- {
5750
- internalType: "address",
5751
- name: "account",
5752
- type: "address"
5753
- },
5754
- {
5755
- internalType: "bytes32",
5756
- name: "neededRole",
5757
- type: "bytes32"
5758
- }
5759
- ],
5760
- name: "AccessControlUnauthorizedAccount",
5761
- type: "error"
5762
- },
5763
- {
5764
- inputs: [
5765
- {
5766
- internalType: "address",
5767
- name: "target",
5768
- type: "address"
5769
- }
5770
- ],
5771
- name: "AddressEmptyCode",
5772
- type: "error"
5773
- },
5774
- {
5775
- inputs: [
5776
- {
5777
- internalType: "address",
5778
- name: "implementation",
5779
- type: "address"
5780
- }
5781
- ],
5782
- name: "ERC1967InvalidImplementation",
5783
- type: "error"
5784
- },
5785
- {
5786
- inputs: [],
5787
- name: "ERC1967NonPayable",
5788
- type: "error"
5789
- },
5790
- {
5791
- inputs: [],
5792
- name: "FailedCall",
5793
- type: "error"
5794
- },
5795
- {
5796
- inputs: [],
5797
- name: "InvalidInitialization",
5798
- type: "error"
5799
- },
5800
- {
5801
- inputs: [],
5802
- name: "NotInitializing",
5803
- type: "error"
5804
- },
5805
- {
5806
- inputs: [],
5807
- name: "UUPSUnauthorizedCallContext",
5808
- type: "error"
5809
- },
5810
- {
5811
- inputs: [
5812
- {
5813
- internalType: "bytes32",
5814
- name: "slot",
5815
- type: "bytes32"
5816
- }
5817
- ],
5818
- name: "UUPSUnsupportedProxiableUUID",
5819
- type: "error"
5820
- },
5821
- {
5822
- anonymous: false,
5823
- inputs: [
5824
- {
5825
- indexed: false,
5826
- internalType: "uint64",
5827
- name: "version",
5828
- type: "uint64"
5829
- }
5830
- ],
5831
- name: "Initialized",
5832
- type: "event"
5833
- },
5834
- {
5835
- anonymous: false,
5836
- inputs: [
5837
- {
5838
- indexed: true,
5839
- internalType: "bytes32",
5840
- name: "role",
5841
- type: "bytes32"
5842
- },
5843
- {
5844
- indexed: true,
5845
- internalType: "bytes32",
5846
- name: "previousAdminRole",
5847
- type: "bytes32"
5848
- },
5849
- {
5850
- indexed: true,
5851
- internalType: "bytes32",
5852
- name: "newAdminRole",
5853
- type: "bytes32"
5854
- }
5855
- ],
5856
- name: "RoleAdminChanged",
5857
- type: "event"
5858
- },
5859
- {
5860
- anonymous: false,
5861
- inputs: [
5862
- {
5863
- indexed: true,
5864
- internalType: "bytes32",
5865
- name: "role",
5866
- type: "bytes32"
5867
- },
5868
- {
5869
- indexed: true,
5870
- internalType: "address",
5871
- name: "account",
5872
- type: "address"
5873
- },
5874
- {
5875
- indexed: true,
5876
- internalType: "address",
5877
- name: "sender",
5878
- type: "address"
5879
- }
5880
- ],
5881
- name: "RoleGranted",
5882
- type: "event"
5883
- },
5884
- {
5885
- anonymous: false,
5886
- inputs: [
5887
- {
5888
- indexed: true,
5889
- internalType: "bytes32",
5890
- name: "role",
5891
- type: "bytes32"
5892
- },
5893
- {
5894
- indexed: true,
5895
- internalType: "address",
5896
- name: "account",
5897
- type: "address"
5898
- },
5899
- {
5900
- indexed: true,
5901
- internalType: "address",
5902
- name: "sender",
5903
- type: "address"
5904
- }
5905
- ],
5906
- name: "RoleRevoked",
5907
- type: "event"
5908
- },
5909
- {
5910
- anonymous: false,
5911
- inputs: [
5912
- {
5913
- indexed: true,
5914
- internalType: "address",
5915
- name: "implementation",
5916
- type: "address"
5917
- }
5918
- ],
5919
- name: "Upgraded",
5920
- type: "event"
5921
- },
5922
- {
5923
- inputs: [],
5924
- name: "DEFAULT_ADMIN_ROLE",
5925
- outputs: [
5926
- {
5927
- internalType: "bytes32",
5928
- name: "",
5929
- type: "bytes32"
5930
- }
5931
- ],
5932
- stateMutability: "view",
5933
- type: "function"
5934
- },
5935
- {
5936
- inputs: [],
5937
- name: "MAINTAINER_ROLE",
5938
- outputs: [
5939
- {
5940
- internalType: "bytes32",
5941
- name: "",
5942
- type: "bytes32"
5943
- }
5944
- ],
5945
- stateMutability: "view",
5946
- type: "function"
5947
- },
5948
- {
5949
- inputs: [],
5950
- name: "UPGRADE_INTERFACE_VERSION",
5951
- outputs: [
5952
- {
5953
- internalType: "string",
5954
- name: "",
5955
- type: "string"
5956
- }
5957
- ],
5958
- stateMutability: "view",
5959
- type: "function"
5960
- },
5961
- {
5962
- inputs: [
5963
- {
5964
- internalType: "address",
5965
- name: "maintainer",
5966
- type: "address"
5967
- }
5968
- ],
5969
- name: "addMaintainer",
5970
- outputs: [],
5971
- stateMutability: "nonpayable",
5972
- type: "function"
5973
- },
5974
- {
5975
- inputs: [],
5976
- name: "getDefaultAdmin",
5977
- outputs: [
5978
- {
5979
- internalType: "address",
5980
- name: "",
5981
- type: "address"
5982
- }
5983
- ],
5984
- stateMutability: "view",
5985
- type: "function"
5986
- },
5987
- {
5988
- inputs: [
5989
- {
5990
- internalType: "bytes32",
5991
- name: "role",
5992
- type: "bytes32"
5993
- }
5994
- ],
5995
- name: "getRoleAdmin",
5996
- outputs: [
5997
- {
5998
- internalType: "bytes32",
5999
- name: "",
6000
- type: "bytes32"
6001
- }
6002
- ],
6003
- stateMutability: "view",
6004
- type: "function"
6005
- },
6006
- {
6007
- inputs: [
6008
- {
6009
- internalType: "bytes32",
6010
- name: "role",
6011
- type: "bytes32"
6012
- },
6013
- {
6014
- internalType: "uint256",
6015
- name: "index",
6016
- type: "uint256"
6017
- }
6018
- ],
6019
- name: "getRoleMember",
6020
- outputs: [
6021
- {
6022
- internalType: "address",
6023
- name: "",
6024
- type: "address"
6025
- }
6026
- ],
6027
- stateMutability: "view",
6028
- type: "function"
6029
- },
6030
- {
6031
- inputs: [
6032
- {
6033
- internalType: "bytes32",
6034
- name: "role",
6035
- type: "bytes32"
6036
- }
6037
- ],
6038
- name: "getRoleMemberCount",
6039
- outputs: [
6040
- {
6041
- internalType: "uint256",
6042
- name: "",
6043
- type: "uint256"
6044
- }
6045
- ],
6046
- stateMutability: "view",
6047
- type: "function"
6048
- },
6049
- {
6050
- inputs: [
6051
- {
6052
- internalType: "bytes32",
6053
- name: "role",
6054
- type: "bytes32"
6055
- }
6056
- ],
6057
- name: "getRoleMembers",
6058
- outputs: [
6059
- {
6060
- internalType: "address[]",
6061
- name: "",
6062
- type: "address[]"
6063
- }
6064
- ],
6065
- stateMutability: "view",
6066
- type: "function"
6067
- },
6068
- {
6069
- inputs: [
6070
- {
6071
- internalType: "bytes32",
6072
- name: "role",
6073
- type: "bytes32"
6074
- },
6075
- {
6076
- internalType: "address",
6077
- name: "account",
6078
- type: "address"
6079
- }
6080
- ],
6081
- name: "grantRole",
6082
- outputs: [],
6083
- stateMutability: "nonpayable",
6084
- type: "function"
6085
- },
6086
- {
6087
- inputs: [
6088
- {
6089
- internalType: "bytes32",
6090
- name: "role",
6091
- type: "bytes32"
6092
- },
6093
- {
6094
- internalType: "address",
6095
- name: "account",
6096
- type: "address"
6097
- }
6098
- ],
6099
- name: "hasRole",
6100
- outputs: [
6101
- {
6102
- internalType: "bool",
6103
- name: "",
6104
- type: "bool"
6105
- }
6106
- ],
6107
- stateMutability: "view",
6108
- type: "function"
6109
- },
6110
- {
6111
- inputs: [
6112
- {
6113
- internalType: "address",
6114
- name: "congress",
6115
- type: "address"
6116
- },
6117
- {
6118
- internalType: "address[]",
6119
- name: "maintainers",
6120
- type: "address[]"
6121
- }
6122
- ],
6123
- name: "initialize",
6124
- outputs: [],
6125
- stateMutability: "nonpayable",
6126
- type: "function"
6127
- },
6128
- {
6129
- inputs: [],
6130
- name: "proxiableUUID",
6131
- outputs: [
6132
- {
6133
- internalType: "bytes32",
6134
- name: "",
6135
- type: "bytes32"
6136
- }
6137
- ],
6138
- stateMutability: "view",
6139
- type: "function"
6140
- },
6141
- {
6142
- inputs: [
6143
- {
6144
- internalType: "address",
6145
- name: "maintainer",
6146
- type: "address"
6147
- }
6148
- ],
6149
- name: "removeMaintainer",
6150
- outputs: [],
6151
- stateMutability: "nonpayable",
6152
- type: "function"
6153
- },
6154
- {
6155
- inputs: [
6156
- {
6157
- internalType: "bytes32",
6158
- name: "role",
6159
- type: "bytes32"
6160
- },
6161
- {
6162
- internalType: "address",
6163
- name: "callerConfirmation",
6164
- type: "address"
6165
- }
6166
- ],
6167
- name: "renounceRole",
6168
- outputs: [],
6169
- stateMutability: "nonpayable",
6170
- type: "function"
6171
- },
6172
- {
6173
- inputs: [
6174
- {
6175
- internalType: "bytes32",
6176
- name: "role",
6177
- type: "bytes32"
6178
- },
6179
- {
6180
- internalType: "address",
6181
- name: "account",
6182
- type: "address"
6183
- }
6184
- ],
6185
- name: "revokeRole",
6186
- outputs: [],
6187
- stateMutability: "nonpayable",
6188
- type: "function"
6189
- },
6190
- {
6191
- inputs: [
6192
- {
6193
- internalType: "bytes4",
6194
- name: "interfaceId",
6195
- type: "bytes4"
6196
- }
6197
- ],
6198
- name: "supportsInterface",
6199
- outputs: [
6200
- {
6201
- internalType: "bool",
6202
- name: "",
6203
- type: "bool"
6204
- }
6205
- ],
6206
- stateMutability: "view",
6207
- type: "function"
6208
- },
6209
- {
6210
- inputs: [
6211
- {
6212
- internalType: "address",
6213
- name: "newAdmin",
6214
- type: "address"
6215
- }
6216
- ],
6217
- name: "transferDefaultAdmin",
6218
- outputs: [],
6219
- stateMutability: "nonpayable",
6220
- type: "function"
6221
- },
6222
- {
6223
- inputs: [
6224
- {
6225
- internalType: "address",
6226
- name: "newImplementation",
6227
- type: "address"
6228
- },
6229
- {
6230
- internalType: "bytes",
6231
- name: "data",
6232
- type: "bytes"
6233
- }
6234
- ],
6235
- name: "upgradeToAndCall",
6236
- outputs: [],
6237
- stateMutability: "payable",
6238
- type: "function"
6239
- }
6240
- ],
6241
- IATPSettlementLayer: [
6242
- {
6243
- inputs: [],
6244
- stateMutability: "nonpayable",
6245
- type: "constructor"
6246
- },
6247
- {
6248
- inputs: [
6249
- {
6250
- internalType: "address",
6251
- name: "target",
6252
- type: "address"
6253
- }
6254
- ],
6255
- name: "AddressEmptyCode",
6256
- type: "error"
6257
- },
6258
- {
6259
- inputs: [],
6260
- name: "AmountMustBePositive",
6261
- type: "error"
6262
- },
6263
- {
6264
- inputs: [],
6265
- name: "ArrayLengthMismatch",
6266
- type: "error"
6267
- },
6268
- {
6269
- inputs: [],
6270
- name: "CannotReleaseEpochYet",
6271
- type: "error"
6272
- },
6273
- {
6274
- inputs: [],
6275
- name: "ConsumerProviderSame",
6276
- type: "error"
6277
- },
6278
- {
6279
- inputs: [],
6280
- name: "DisputeAlreadyFiled",
6281
- type: "error"
6282
- },
6283
- {
6284
- inputs: [],
6285
- name: "DisputeAlreadyResolved",
6286
- type: "error"
6287
- },
6288
- {
6289
- inputs: [],
6290
- name: "DisputeNotFound",
6291
- type: "error"
6292
- },
6293
- {
6294
- inputs: [],
6295
- name: "DisputePeriodExpired",
6296
- type: "error"
6297
- },
6298
- {
6299
- inputs: [
6300
- {
6301
- internalType: "address",
6302
- name: "implementation",
6303
- type: "address"
6304
- }
6305
- ],
6306
- name: "ERC1967InvalidImplementation",
6307
- type: "error"
6308
- },
6309
- {
6310
- inputs: [],
6311
- name: "ERC1967NonPayable",
6312
- type: "error"
6313
- },
6314
- {
6315
- inputs: [],
6316
- name: "EmptyArray",
6317
- type: "error"
6318
- },
6319
- {
6320
- inputs: [],
6321
- name: "EpochMustBeNextOne",
6322
- type: "error"
6323
- },
6324
- {
6325
- inputs: [],
6326
- name: "EpochMustBeOne",
6327
- type: "error"
6328
- },
6329
- {
6330
- inputs: [],
6331
- name: "FailedCall",
6332
- type: "error"
6333
- },
6334
- {
6335
- inputs: [],
6336
- name: "InsufficientBalance",
6337
- type: "error"
6338
- },
6339
- {
6340
- inputs: [],
6341
- name: "InvalidAddress",
6342
- type: "error"
6343
- },
6344
- {
6345
- inputs: [],
6346
- name: "InvalidConsumer",
6347
- type: "error"
6348
- },
6349
- {
6350
- inputs: [],
6351
- name: "InvalidConsumerSignature",
6352
- type: "error"
6353
- },
6354
- {
6355
- inputs: [],
6356
- name: "InvalidEpoch",
6357
- type: "error"
6358
- },
6359
- {
6360
- inputs: [],
6361
- name: "InvalidInitialization",
6362
- type: "error"
6363
- },
6364
- {
6365
- inputs: [],
6366
- name: "InvalidInput",
6367
- type: "error"
6368
- },
6369
- {
6370
- inputs: [],
6371
- name: "InvalidProvider",
6372
- type: "error"
6373
- },
6374
- {
6375
- inputs: [],
6376
- name: "InvalidProviderSignature",
6377
- type: "error"
6378
- },
6379
- {
6380
- inputs: [],
6381
- name: "InvalidTraiaToken",
6382
- type: "error"
6383
- },
6384
- {
6385
- inputs: [],
6386
- name: "InvalidUtilityAgentFactory",
6387
- type: "error"
6388
- },
6389
- {
6390
- inputs: [],
6391
- name: "NoFundsToRelease",
6392
- type: "error"
6393
- },
6394
- {
6395
- inputs: [],
6396
- name: "NoLockedFunds",
6397
- type: "error"
6398
- },
6399
- {
6400
- inputs: [],
6401
- name: "NotAuthorized",
6402
- type: "error"
6403
- },
6404
- {
6405
- inputs: [],
6406
- name: "NotInitializing",
6407
- type: "error"
6408
- },
6409
- {
6410
- inputs: [],
6411
- name: "ProviderNotRegistered",
6412
- type: "error"
6413
- },
6414
- {
6415
- inputs: [],
6416
- name: "ReentrancyGuardReentrantCall",
6417
- type: "error"
6418
- },
6419
- {
6420
- inputs: [],
6421
- name: "RequestAlreadyProcessed",
6422
- type: "error"
6423
- },
6424
- {
6425
- inputs: [],
6426
- name: "RequestExpired",
6427
- type: "error"
6428
- },
6429
- {
6430
- inputs: [],
6431
- name: "RequestNotSettled",
6432
- type: "error"
6433
- },
6434
- {
6435
- inputs: [
6436
- {
6437
- internalType: "address",
6438
- name: "token",
6439
- type: "address"
6440
- }
6441
- ],
6442
- name: "SafeERC20FailedOperation",
6443
- type: "error"
6444
- },
6445
- {
6446
- inputs: [],
6447
- name: "SignatureAlreadyUsed",
6448
- type: "error"
6449
- },
6450
- {
6451
- inputs: [],
6452
- name: "UUPSUnauthorizedCallContext",
6453
- type: "error"
6454
- },
6455
- {
6456
- inputs: [
6457
- {
6458
- internalType: "bytes32",
6459
- name: "slot",
6460
- type: "bytes32"
6461
- }
6462
- ],
6463
- name: "UUPSUnsupportedProxiableUUID",
6464
- type: "error"
6465
- },
6466
- {
6467
- anonymous: false,
6468
- inputs: [
6469
- {
6470
- indexed: true,
6471
- internalType: "address",
6472
- name: "consumer",
6473
- type: "address"
6474
- },
6475
- {
6476
- indexed: false,
6477
- internalType: "uint256",
6478
- name: "refillAmount",
6479
- type: "uint256"
6480
- },
6481
- {
6482
- indexed: false,
6483
- internalType: "uint256",
6484
- name: "previousBalance",
6485
- type: "uint256"
6486
- },
6487
- {
6488
- indexed: false,
6489
- internalType: "uint256",
6490
- name: "newBalance",
6491
- type: "uint256"
6492
- }
6493
- ],
6494
- name: "AutoRefillExecuted",
6495
- type: "event"
6496
- },
6497
- {
6498
- anonymous: false,
6499
- inputs: [
6500
- {
6501
- indexed: false,
6502
- internalType: "uint256",
6503
- name: "newMaxAutoRefillAmount",
6504
- type: "uint256"
6505
- },
6506
- {
6507
- indexed: false,
6508
- internalType: "uint256",
6509
- name: "newBalanceThresholdMultiplier",
6510
- type: "uint256"
6511
- },
6512
- {
6513
- indexed: false,
6514
- internalType: "uint256",
6515
- name: "newAutoRefillMultiplier",
6516
- type: "uint256"
6517
- }
6518
- ],
6519
- name: "AutoRefillParametersUpdated",
6520
- type: "event"
6521
- },
6522
- {
6523
- anonymous: false,
6524
- inputs: [
6525
- {
6526
- indexed: true,
6527
- internalType: "address",
6528
- name: "consumer",
6529
- type: "address"
6530
- },
6531
- {
6532
- indexed: false,
6533
- internalType: "uint256",
6534
- name: "amount",
6535
- type: "uint256"
6536
- }
6537
- ],
6538
- name: "ConsumerDeposit",
6539
- type: "event"
6540
- },
6541
- {
6542
- anonymous: false,
6543
- inputs: [
6544
- {
6545
- indexed: true,
6546
- internalType: "address",
6547
- name: "consumer",
6548
- type: "address"
6549
- },
6550
- {
6551
- indexed: false,
6552
- internalType: "uint256",
6553
- name: "amount",
6554
- type: "uint256"
6555
- }
6556
- ],
6557
- name: "ConsumerWithdraw",
6558
- type: "event"
6559
- },
6560
- {
6561
- anonymous: false,
6562
- inputs: [
6563
- {
6564
- indexed: true,
6565
- internalType: "bytes32",
6566
- name: "requestId",
6567
- type: "bytes32"
6568
- },
6569
- {
6570
- indexed: true,
6571
- internalType: "address",
6572
- name: "consumer",
6573
- type: "address"
6574
- },
6575
- {
6576
- indexed: true,
6577
- internalType: "address",
6578
- name: "provider",
6579
- type: "address"
6580
- },
6581
- {
6582
- indexed: false,
6583
- internalType: "string",
6584
- name: "reason",
6585
- type: "string"
6586
- }
6587
- ],
6588
- name: "DisputeFiled",
6589
- type: "event"
6590
- },
6591
- {
6592
- anonymous: false,
6593
- inputs: [
6594
- {
6595
- indexed: true,
6596
- internalType: "bytes32",
6597
- name: "requestId",
6598
- type: "bytes32"
6599
- },
6600
- {
6601
- indexed: false,
6602
- internalType: "bool",
6603
- name: "consumerWon",
6604
- type: "bool"
6605
- },
6606
- {
6607
- indexed: false,
6608
- internalType: "address",
6609
- name: "resolvedBy",
6610
- type: "address"
6611
- }
6612
- ],
6613
- name: "DisputeResolved",
6614
- type: "event"
6615
- },
6616
- {
6617
- anonymous: false,
6618
- inputs: [],
6619
- name: "EIP712DomainChanged",
6620
- type: "event"
6621
- },
6622
- {
6623
- anonymous: false,
6624
- inputs: [
6625
- {
6626
- indexed: false,
6627
- internalType: "uint256",
6628
- name: "epochDurationSeconds",
6629
- type: "uint256"
6630
- },
6631
- {
6632
- indexed: false,
6633
- internalType: "uint256",
6634
- name: "maxEpochsToRelease",
6635
- type: "uint256"
6636
- }
6637
- ],
6638
- name: "EpochParametersSet",
6639
- type: "event"
6640
- },
6641
- {
6642
- anonymous: false,
6643
- inputs: [
6644
- {
6645
- indexed: true,
6646
- internalType: "address",
6647
- name: "provider",
6648
- type: "address"
6649
- },
6650
- {
6651
- indexed: false,
6652
- internalType: "uint256",
6653
- name: "epoch",
6654
- type: "uint256"
6655
- },
6656
- {
6657
- indexed: false,
6658
- internalType: "uint256",
6659
- name: "amount",
6660
- type: "uint256"
6661
- }
6662
- ],
6663
- name: "EpochReleased",
6664
- type: "event"
6665
- },
6666
- {
6667
- anonymous: false,
6668
- inputs: [
6669
- {
6670
- indexed: false,
6671
- internalType: "uint256",
6672
- name: "newFeePercent",
6673
- type: "uint256"
6674
- },
6675
- {
6676
- indexed: true,
6677
- internalType: "address",
6678
- name: "newFeeCollector",
6679
- type: "address"
6680
- }
6681
- ],
6682
- name: "FeeConfigUpdated",
6683
- type: "event"
6684
- },
6685
- {
6686
- anonymous: false,
6687
- inputs: [
6688
- {
6689
- indexed: true,
6690
- internalType: "address",
6691
- name: "provider",
6692
- type: "address"
6693
- },
6694
- {
6695
- indexed: true,
6696
- internalType: "address",
6697
- name: "feeCollector",
6698
- type: "address"
6699
- },
6700
- {
6701
- indexed: false,
6702
- internalType: "uint256",
6703
- name: "feeAmount",
6704
- type: "uint256"
6705
- },
6706
- {
6707
- indexed: false,
6708
- internalType: "uint256",
6709
- name: "providerAmount",
6710
- type: "uint256"
6711
- }
6712
- ],
6713
- name: "FeesCollected",
6714
- type: "event"
6715
- },
6716
- {
6717
- anonymous: false,
6718
- inputs: [
6719
- {
6720
- indexed: false,
6721
- internalType: "uint64",
6722
- name: "version",
6723
- type: "uint64"
6724
- }
6725
- ],
6726
- name: "Initialized",
6727
- type: "event"
6728
- },
6729
- {
6730
- anonymous: false,
6731
- inputs: [
6732
- {
6733
- indexed: false,
6734
- internalType: "uint256",
6735
- name: "newMaxFacilitatorFee",
6736
- type: "uint256"
6737
- }
6738
- ],
6739
- name: "MaxFacilitatorFeeUpdated",
6740
- type: "event"
6741
- },
6742
- {
6743
- anonymous: false,
6744
- inputs: [
6745
- {
6746
- indexed: true,
6747
- internalType: "address",
6748
- name: "provider",
6749
- type: "address"
6750
- },
6751
- {
6752
- indexed: false,
6753
- internalType: "uint256",
6754
- name: "amount",
6755
- type: "uint256"
6756
- }
6757
- ],
6758
- name: "ProviderWithdrawn",
6759
- type: "event"
6760
- },
6761
- {
6762
- anonymous: false,
6763
- inputs: [
6764
- {
6765
- indexed: true,
6766
- internalType: "bytes32",
6767
- name: "requestId",
6768
- type: "bytes32"
6769
- },
6770
- {
6771
- indexed: true,
6772
- internalType: "address",
6773
- name: "consumer",
6774
- type: "address"
6775
- },
6776
- {
6777
- indexed: true,
6778
- internalType: "address",
6779
- name: "provider",
6780
- type: "address"
6781
- },
6782
- {
6783
- indexed: false,
6784
- internalType: "uint256",
6785
- name: "amount",
6786
- type: "uint256"
6787
- },
6788
- {
6789
- indexed: false,
6790
- internalType: "uint256",
6791
- name: "consumerRequestCount",
6792
- type: "uint256"
6793
- },
6794
- {
6795
- indexed: false,
6796
- internalType: "uint256",
6797
- name: "epoch",
6798
- type: "uint256"
6799
- },
6800
- {
6801
- indexed: false,
6802
- internalType: "address",
6803
- name: "tokenAddress",
6804
- type: "address"
6805
- }
6806
- ],
6807
- name: "RequestSettled",
6808
- type: "event"
6809
- },
6810
- {
6811
- anonymous: false,
6812
- inputs: [
6813
- {
6814
- indexed: true,
6815
- internalType: "uint256",
6816
- name: "index",
6817
- type: "uint256"
6818
- },
6819
- {
6820
- indexed: true,
6821
- internalType: "address",
6822
- name: "consumer",
6823
- type: "address"
6824
- },
6825
- {
6826
- indexed: true,
6827
- internalType: "address",
6828
- name: "provider",
6829
- type: "address"
6830
- },
6831
- {
6832
- indexed: false,
6833
- internalType: "bytes32",
6834
- name: "requestId",
6835
- type: "bytes32"
6836
- },
6837
- {
6838
- indexed: false,
6839
- internalType: "bytes",
6840
- name: "reason",
6841
- type: "bytes"
6842
- }
6843
- ],
6844
- name: "RequestSettlementFailed",
6845
- type: "event"
6846
- },
6847
- {
6848
- anonymous: false,
6849
- inputs: [
6850
- {
6851
- indexed: true,
6852
- internalType: "address",
6853
- name: "newRoleManager",
6854
- type: "address"
6855
- }
6856
- ],
6857
- name: "RoleManagerUpdated",
6858
- type: "event"
6859
- },
6860
- {
6861
- anonymous: false,
6862
- inputs: [
6863
- {
6864
- indexed: true,
6865
- internalType: "address",
6866
- name: "implementation",
6867
- type: "address"
6868
- }
6869
- ],
6870
- name: "Upgraded",
6871
- type: "event"
6872
- },
6873
- {
6874
- anonymous: false,
6875
- inputs: [
6876
- {
6877
- indexed: true,
6878
- internalType: "address",
6879
- name: "oldFactory",
6880
- type: "address"
6881
- },
6882
- {
6883
- indexed: true,
6884
- internalType: "address",
6885
- name: "newFactory",
6886
- type: "address"
6887
- }
6888
- ],
6889
- name: "UtilityAgentFactoryUpdated",
6890
- type: "event"
6891
- },
6892
- {
6893
- inputs: [],
6894
- name: "BASIS_POINTS",
6895
- outputs: [
6896
- {
6897
- internalType: "uint256",
6898
- name: "",
6899
- type: "uint256"
6900
- }
6901
- ],
6902
- stateMutability: "view",
6903
- type: "function"
6904
- },
6905
- {
6906
- inputs: [],
6907
- name: "BONDING_ROLE",
6908
- outputs: [
6909
- {
6910
- internalType: "bytes32",
6911
- name: "",
6912
- type: "bytes32"
6913
- }
6914
- ],
6915
- stateMutability: "view",
6916
- type: "function"
6917
- },
6918
- {
6919
- inputs: [],
6920
- name: "DEFAULT_ADMIN_ROLE",
6921
- outputs: [
6922
- {
6923
- internalType: "bytes32",
6924
- name: "",
6925
- type: "bytes32"
6926
- }
6927
- ],
6928
- stateMutability: "view",
6929
- type: "function"
6930
- },
6931
- {
6932
- inputs: [],
6933
- name: "EpochDuration",
6934
- outputs: [
6935
- {
6936
- internalType: "uint256",
6937
- name: "",
6938
- type: "uint256"
6939
- }
6940
- ],
6941
- stateMutability: "view",
6942
- type: "function"
6943
- },
6944
- {
6945
- inputs: [],
6946
- name: "EpochReleaseDelay",
6947
- outputs: [
6948
- {
6949
- internalType: "uint256",
6950
- name: "",
6951
- type: "uint256"
6952
- }
6953
- ],
6954
- stateMutability: "view",
6955
- type: "function"
6956
- },
6957
- {
6958
- inputs: [],
6959
- name: "MAX_FEE_PERCENT",
6960
- outputs: [
6961
- {
6962
- internalType: "uint256",
6963
- name: "",
6964
- type: "uint256"
6965
- }
6966
- ],
6967
- stateMutability: "view",
6968
- type: "function"
6969
- },
6970
- {
6971
- inputs: [],
6972
- name: "RequestExpirationTime",
6973
- outputs: [
6974
- {
6975
- internalType: "uint256",
6976
- name: "",
6977
- type: "uint256"
6978
- }
6979
- ],
6980
- stateMutability: "view",
6981
- type: "function"
6982
- },
6983
- {
6984
- inputs: [],
6985
- name: "SETTLEMENT_POINTS",
6986
- outputs: [
6987
- {
6988
- internalType: "uint256",
6989
- name: "",
6990
- type: "uint256"
6991
- }
6992
- ],
6993
- stateMutability: "view",
6994
- type: "function"
6995
- },
6996
- {
6997
- inputs: [],
6998
- name: "UPGRADE_INTERFACE_VERSION",
6999
- outputs: [
7000
- {
7001
- internalType: "string",
7002
- name: "",
7003
- type: "string"
7004
- }
7005
- ],
7006
- stateMutability: "view",
7007
- type: "function"
7008
- },
7009
- {
7010
- inputs: [
7011
- {
7012
- components: [
7013
- {
7014
- components: [
7015
- {
7016
- internalType: "contract IIATPWallet",
7017
- name: "consumer",
7018
- type: "address"
7019
- },
7020
- {
7021
- internalType: "contract IIATPWallet",
7022
- name: "provider",
7023
- type: "address"
7024
- },
7025
- {
7026
- internalType: "address",
7027
- name: "tokenAddress",
7028
- type: "address"
7029
- },
7030
- {
7031
- internalType: "uint256",
7032
- name: "amount",
7033
- type: "uint256"
7034
- },
7035
- {
7036
- internalType: "string",
7037
- name: "requestPath",
7038
- type: "string"
7039
- },
7040
- {
7041
- internalType: "uint256",
7042
- name: "consumerDeadline",
7043
- type: "uint256"
7044
- },
7045
- {
7046
- internalType: "uint256",
7047
- name: "timestamp",
7048
- type: "uint256"
7049
- },
7050
- {
7051
- internalType: "bytes32",
7052
- name: "serviceDescription",
7053
- type: "bytes32"
7054
- },
7055
- {
7056
- internalType: "bytes",
7057
- name: "outputHash",
7058
- type: "bytes"
7059
- },
7060
- {
7061
- internalType: "uint256",
7062
- name: "facilitatorFeePercent",
7063
- type: "uint256"
7064
- }
7065
- ],
7066
- internalType: "struct IIATPSettlementLayer.SettlementRequestData",
7067
- name: "requestData",
7068
- type: "tuple"
7069
- },
7070
- {
7071
- internalType: "bytes",
7072
- name: "consumerSignature",
7073
- type: "bytes"
7074
- },
7075
- {
7076
- internalType: "bytes",
7077
- name: "providerSignature",
7078
- type: "bytes"
7079
- }
7080
- ],
7081
- internalType: "struct IIATPSettlementLayer.SettlementRequest",
7082
- name: "req",
7083
- type: "tuple"
7084
- }
7085
- ],
7086
- name: "_settleRequest",
7087
- outputs: [],
7088
- stateMutability: "nonpayable",
7089
- type: "function"
7090
- },
7091
- {
7092
- inputs: [
7093
- {
7094
- internalType: "uint256",
7095
- name: "epoch",
7096
- type: "uint256"
7097
- }
7098
- ],
7099
- name: "canReleaseEpoch",
7100
- outputs: [
7101
- {
7102
- internalType: "bool",
7103
- name: "",
7104
- type: "bool"
7105
- }
7106
- ],
7107
- stateMutability: "view",
7108
- type: "function"
7109
- },
7110
- {
7111
- inputs: [
7112
- {
7113
- internalType: "address",
7114
- name: "token",
7115
- type: "address"
7116
- }
7117
- ],
7118
- name: "collectFees",
7119
- outputs: [],
7120
- stateMutability: "nonpayable",
7121
- type: "function"
7122
- },
7123
- {
7124
- inputs: [
7125
- {
7126
- internalType: "address",
7127
- name: "",
7128
- type: "address"
7129
- }
7130
- ],
7131
- name: "consumerReputations",
7132
- outputs: [
7133
- {
7134
- internalType: "uint256",
7135
- name: "completed",
7136
- type: "uint256"
7137
- },
7138
- {
7139
- internalType: "uint256",
7140
- name: "failed",
7141
- type: "uint256"
7142
- },
7143
- {
7144
- internalType: "uint256",
7145
- name: "faults",
7146
- type: "uint256"
7147
- },
7148
- {
7149
- internalType: "int256",
7150
- name: "score",
7151
- type: "int256"
7152
- },
7153
- {
7154
- internalType: "uint256",
7155
- name: "firstSettlementAt",
7156
- type: "uint256"
7157
- }
7158
- ],
7159
- stateMutability: "view",
7160
- type: "function"
7161
- },
7162
- {
7163
- inputs: [
7164
- {
7165
- internalType: "address",
7166
- name: "",
7167
- type: "address"
7168
- }
7169
- ],
7170
- name: "consumerRequestCounts",
7171
- outputs: [
7172
- {
7173
- internalType: "uint256",
7174
- name: "",
7175
- type: "uint256"
7176
- }
7177
- ],
7178
- stateMutability: "view",
7179
- type: "function"
7180
- },
7181
- {
7182
- inputs: [
7183
- {
7184
- internalType: "bytes32",
7185
- name: "requestId",
7186
- type: "bytes32"
7187
- },
7188
- {
7189
- internalType: "string",
7190
- name: "reason",
7191
- type: "string"
7192
- }
7193
- ],
7194
- name: "disputeRequest",
7195
- outputs: [],
7196
- stateMutability: "nonpayable",
7197
- type: "function"
7198
- },
7199
- {
7200
- inputs: [
7201
- {
7202
- internalType: "bytes32",
7203
- name: "",
7204
- type: "bytes32"
7205
- }
7206
- ],
7207
- name: "disputes",
7208
- outputs: [
7209
- {
7210
- internalType: "bytes32",
7211
- name: "requestId",
7212
- type: "bytes32"
7213
- },
7214
- {
7215
- internalType: "address",
7216
- name: "consumer",
7217
- type: "address"
7218
- },
7219
- {
7220
- internalType: "address",
7221
- name: "provider",
7222
- type: "address"
7223
- },
7224
- {
7225
- internalType: "uint256",
7226
- name: "amount",
7227
- type: "uint256"
7228
- },
7229
- {
7230
- internalType: "uint256",
7231
- name: "epoch",
7232
- type: "uint256"
7233
- },
7234
- {
7235
- internalType: "string",
7236
- name: "reason",
7237
- type: "string"
7238
- },
7239
- {
7240
- internalType: "uint256",
7241
- name: "filedAt",
7242
- type: "uint256"
7243
- },
7244
- {
7245
- internalType: "bool",
7246
- name: "resolved",
7247
- type: "bool"
7248
- }
7249
- ],
7250
- stateMutability: "view",
7251
- type: "function"
7252
- },
7253
- {
7254
- inputs: [],
7255
- name: "eip712Domain",
7256
- outputs: [
7257
- {
7258
- internalType: "bytes1",
7259
- name: "fields",
7260
- type: "bytes1"
7261
- },
7262
- {
7263
- internalType: "string",
7264
- name: "name",
7265
- type: "string"
7266
- },
7267
- {
7268
- internalType: "string",
7269
- name: "version",
7270
- type: "string"
7271
- },
7272
- {
7273
- internalType: "uint256",
7274
- name: "chainId",
7275
- type: "uint256"
7276
- },
7277
- {
7278
- internalType: "address",
7279
- name: "verifyingContract",
7280
- type: "address"
7281
- },
7282
- {
7283
- internalType: "bytes32",
7284
- name: "salt",
7285
- type: "bytes32"
7286
- },
7287
- {
7288
- internalType: "uint256[]",
7289
- name: "extensions",
7290
- type: "uint256[]"
7291
- }
7292
- ],
7293
- stateMutability: "view",
7294
- type: "function"
7295
- },
7296
- {
7297
- inputs: [
7298
- {
7299
- internalType: "address",
7300
- name: "",
7301
- type: "address"
7302
- }
7303
- ],
7304
- name: "feeBalances",
7305
- outputs: [
7306
- {
7307
- internalType: "uint256",
7308
- name: "",
7309
- type: "uint256"
7310
- }
7311
- ],
7312
- stateMutability: "view",
7313
- type: "function"
7314
- },
7315
- {
7316
- inputs: [],
7317
- name: "feeCollector",
7318
- outputs: [
7319
- {
7320
- internalType: "address",
7321
- name: "",
7322
- type: "address"
7323
- }
7324
- ],
7325
- stateMutability: "view",
7326
- type: "function"
7327
- },
7328
- {
7329
- inputs: [],
7330
- name: "getCurrentEpoch",
7331
- outputs: [
7332
- {
7333
- internalType: "uint256",
7334
- name: "",
7335
- type: "uint256"
7336
- }
7337
- ],
7338
- stateMutability: "view",
7339
- type: "function"
7340
- },
7341
- {
7342
- inputs: [
7343
- {
7344
- internalType: "address",
7345
- name: "provider",
7346
- type: "address"
7347
- },
7348
- {
7349
- internalType: "uint256",
7350
- name: "epoch",
7351
- type: "uint256"
7352
- },
7353
- {
7354
- internalType: "address",
7355
- name: "token",
7356
- type: "address"
7357
- }
7358
- ],
7359
- name: "getDisputeInProgressAmount",
7360
- outputs: [
7361
- {
7362
- internalType: "uint256",
7363
- name: "",
7364
- type: "uint256"
7365
- }
7366
- ],
7367
- stateMutability: "view",
7368
- type: "function"
7369
- },
7370
- {
7371
- inputs: [
7372
- {
7373
- internalType: "address",
7374
- name: "provider",
7375
- type: "address"
7376
- },
7377
- {
7378
- internalType: "uint256",
7379
- name: "epoch",
7380
- type: "uint256"
7381
- },
7382
- {
7383
- internalType: "address",
7384
- name: "token",
7385
- type: "address"
7386
- }
7387
- ],
7388
- name: "getEpochBalance",
7389
- outputs: [
7390
- {
7391
- components: [
7392
- {
7393
- internalType: "uint256",
7394
- name: "balance",
7395
- type: "uint256"
7396
- },
7397
- {
7398
- internalType: "uint256",
7399
- name: "disputeInProgressBalance",
7400
- type: "uint256"
7401
- },
7402
- {
7403
- internalType: "bool",
7404
- name: "isWithdrawn",
7405
- type: "bool"
7406
- }
7407
- ],
7408
- internalType: "struct IIATPSettlementLayer.EpochBalance",
7409
- name: "",
7410
- type: "tuple"
7411
- }
7412
- ],
7413
- stateMutability: "view",
7414
- type: "function"
7415
- },
7416
- {
7417
- inputs: [
7418
- {
7419
- internalType: "address",
7420
- name: "token",
7421
- type: "address"
7422
- }
7423
- ],
7424
- name: "getFeeBalance",
7425
- outputs: [
7426
- {
7427
- internalType: "uint256",
7428
- name: "",
7429
- type: "uint256"
7430
- }
7431
- ],
7432
- stateMutability: "view",
7433
- type: "function"
7434
- },
7435
- {
7436
- inputs: [
7437
- {
7438
- internalType: "address",
7439
- name: "provider",
7440
- type: "address"
7441
- },
7442
- {
7443
- internalType: "address",
7444
- name: "token",
7445
- type: "address"
7446
- }
7447
- ],
7448
- name: "getLockedBalanceForProvider",
3352
+ name: "getLockedBalanceForProvider",
7449
3353
  outputs: [
7450
3354
  {
7451
3355
  internalType: "uint256",
@@ -8121,6 +4025,30 @@ var localhost_default = {
8121
4025
  stateMutability: "view",
8122
4026
  type: "function"
8123
4027
  },
4028
+ {
4029
+ inputs: [
4030
+ {
4031
+ internalType: "uint256",
4032
+ name: "amount",
4033
+ type: "uint256"
4034
+ },
4035
+ {
4036
+ internalType: "uint256",
4037
+ name: "facilitatorFeePercent",
4038
+ type: "uint256"
4039
+ }
4040
+ ],
4041
+ name: "validatePaymentAmount",
4042
+ outputs: [
4043
+ {
4044
+ internalType: "bool",
4045
+ name: "isValid",
4046
+ type: "bool"
4047
+ }
4048
+ ],
4049
+ stateMutability: "view",
4050
+ type: "function"
4051
+ },
8124
4052
  {
8125
4053
  inputs: [
8126
4054
  {
@@ -8151,6 +4079,19 @@ var localhost_default = {
8151
4079
  outputs: [],
8152
4080
  stateMutability: "nonpayable",
8153
4081
  type: "function"
4082
+ },
4083
+ {
4084
+ inputs: [
4085
+ {
4086
+ internalType: "address[]",
4087
+ name: "tokens",
4088
+ type: "address[]"
4089
+ }
4090
+ ],
4091
+ name: "withdrawFacilitatorEarnings",
4092
+ outputs: [],
4093
+ stateMutability: "nonpayable",
4094
+ type: "function"
8154
4095
  }
8155
4096
  ],
8156
4097
  IATPWalletFactory: [
@@ -8848,11 +4789,6 @@ var localhost_default = {
8848
4789
 
8849
4790
  // src/contracts/addresses/proxies.json
8850
4791
  var proxies_default = {
8851
- localhost: {
8852
- RoleManager: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
8853
- IATPSettlementLayer: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
8854
- IATPWalletFactory: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"
8855
- },
8856
4792
  sepolia: {
8857
4793
  RoleManager: "0x71d388142EA9194e5b51Eee3FEfe3B87D494dd38",
8858
4794
  IATPSettlementLayer: "0xAa91081571404d7E2f2B8F12FB2Be092EBe6d2B8",
@@ -8862,19 +4798,12 @@ var proxies_default = {
8862
4798
 
8863
4799
  // src/contracts/addresses/implementations.json
8864
4800
  var implementations_default = {
8865
- localhost: {
8866
- IATPWalletImplementation: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
8867
- RoleManagerImplementation: "0x5FbDB2315678afecb367f032d93F642f64180aa3",
8868
- Congress: "0x94Fc9eddBd1779542b78eb92F0569762603876e2",
8869
- IATPSettlementLayerImplementation: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
8870
- IATPWalletFactoryImplementation: "0x0165878A594ca255338adfa4d48449f69242Eb8F"
8871
- },
8872
4801
  sepolia: {
8873
4802
  Congress: "0x94Fc9eddBd1779542b78eb92F0569762603876e2",
8874
4803
  TraiaCongressMembersRegistry: "0x3B685403b195f16D103b42FCf56F848A278d6049",
8875
- IATPWalletImplementation: "0xab2Ea0765B9dBCf997Fe7ad2fE826D0dA51cfB69",
4804
+ IATPWalletImplementation: "0xfE32B4ae6606F70342749AD0C62E1C7e5F84E1B4",
8876
4805
  RoleManagerImplementation: "0x585AD85FCFBec3B1503E50b46407bF65d4006560",
8877
- IATPSettlementLayerImplementation: "0x88Ff3cdb3c8F7cd480DC48E849D5550F9cAeCBb7",
4806
+ IATPSettlementLayerImplementation: "0x0fDd39d323EE3538c800d4A13730eecE3F0bA975",
8878
4807
  IATPWalletFactoryImplementation: "0xA1E5a53cE5b4e78801d9394EC60D0B53390CA240"
8879
4808
  }
8880
4809
  };
@@ -8888,8 +4817,7 @@ var ContractName = /* @__PURE__ */ ((ContractName2) => {
8888
4817
  return ContractName2;
8889
4818
  })(ContractName || {});
8890
4819
  var ABIS = {
8891
- sepolia: sepolia_default.sepolia || {},
8892
- localhost: localhost_default.localhost || {}
4820
+ sepolia: sepolia_default.sepolia || {}
8893
4821
  };
8894
4822
  var PROXY_ADDRESSES = proxies_default;
8895
4823
  var IMPL_ADDRESSES = implementations_default;
@@ -8924,16 +4852,16 @@ function isContractDeployed(contractName, network) {
8924
4852
  const abi = getContractAbi(contractName, network);
8925
4853
  return address !== null && abi !== null;
8926
4854
  }
8927
- init_utils();
4855
+
4856
+ // src/wallet.ts
8928
4857
  async function createIATPWallet(params) {
8929
- const { ownerAccount, network = "sepolia", rpcUrl, operatorPrivateKey } = params;
4858
+ const { ownerAccount, network = "sepolia", rpcUrl } = params;
8930
4859
  const factoryConfig = getContractConfig("IATPWalletFactory" /* IATP_WALLET_FACTORY */, network);
8931
4860
  if (!factoryConfig) {
8932
4861
  throw new Error(`IATPWalletFactory not found for network: ${network}`);
8933
4862
  }
8934
- const operatorKey = operatorPrivateKey || generateNonce();
8935
- const operatorAccount = accounts.privateKeyToAccount(operatorKey);
8936
- const chain = network === "sepolia" ? chains.sepolia : chains.localhost;
4863
+ const operatorAddress = ownerAccount.address;
4864
+ const chain = chains.sepolia;
8937
4865
  const transport = viem.http(rpcUrl);
8938
4866
  const publicClient = viem.createPublicClient({
8939
4867
  chain,
@@ -8953,7 +4881,7 @@ async function createIATPWallet(params) {
8953
4881
  address: factoryConfig.address,
8954
4882
  abi: factoryConfig.abi,
8955
4883
  functionName: "createWallet",
8956
- args: [operatorAccount.address]
4884
+ args: [operatorAddress]
8957
4885
  });
8958
4886
  const hash = await walletClient.writeContract(request);
8959
4887
  const receipt = await publicClient.waitForTransactionReceipt({
@@ -8987,8 +4915,6 @@ async function createIATPWallet(params) {
8987
4915
  return {
8988
4916
  walletAddress,
8989
4917
  ownerAddress: ownerAccount.address,
8990
- operatorAddress: operatorAccount.address,
8991
- operatorPrivateKey: operatorKey,
8992
4918
  transactionHash: hash,
8993
4919
  blockNumber: receipt.blockNumber,
8994
4920
  network,
@@ -9001,7 +4927,7 @@ async function getWalletsByOwner(params) {
9001
4927
  if (!factoryConfig) {
9002
4928
  throw new Error(`IATPWalletFactory not found for network: ${network}`);
9003
4929
  }
9004
- const chain = network === "sepolia" ? chains.sepolia : chains.localhost;
4930
+ const chain = chains.sepolia;
9005
4931
  const transport = viem.http(rpcUrl);
9006
4932
  const publicClient = viem.createPublicClient({
9007
4933
  chain,
@@ -9015,6 +4941,326 @@ async function getWalletsByOwner(params) {
9015
4941
  });
9016
4942
  return wallets;
9017
4943
  }
4944
+ async function getAvailableBalance(params) {
4945
+ const { publicClient, walletAddress, tokenAddress, network = "sepolia" } = params;
4946
+ const walletConfig = getContractConfig("IATPWallet" /* IATP_WALLET */, network);
4947
+ if (!walletConfig) {
4948
+ throw new Error(`IATPWallet contract not found for network: ${network}`);
4949
+ }
4950
+ const balance = await publicClient.readContract({
4951
+ address: walletAddress,
4952
+ abi: walletConfig.abi,
4953
+ functionName: "getAvailableBalance",
4954
+ args: [tokenAddress]
4955
+ });
4956
+ return balance;
4957
+ }
4958
+ async function getWithdrawalRequest(params) {
4959
+ const { publicClient, walletAddress, tokenAddress, network = "sepolia" } = params;
4960
+ const walletConfig = getContractConfig("IATPWallet" /* IATP_WALLET */, network);
4961
+ if (!walletConfig) {
4962
+ throw new Error(`IATPWallet contract not found for network: ${network}`);
4963
+ }
4964
+ const result = await publicClient.readContract({
4965
+ address: walletAddress,
4966
+ abi: walletConfig.abi,
4967
+ functionName: "getWithdrawalRequest",
4968
+ args: [tokenAddress]
4969
+ });
4970
+ if (result[0] === 0n) {
4971
+ return null;
4972
+ }
4973
+ return result;
4974
+ }
4975
+ async function requestWithdrawal(params) {
4976
+ const { walletClient, publicClient, walletAddress, tokenAddress, amount, account, network = "sepolia" } = params;
4977
+ const walletConfig = getContractConfig("IATPWallet" /* IATP_WALLET */, network);
4978
+ if (!walletConfig) {
4979
+ throw new Error(`IATPWallet contract not found for network: ${network}`);
4980
+ }
4981
+ const data = viem.encodeFunctionData({
4982
+ abi: walletConfig.abi,
4983
+ functionName: "requestWithdrawal",
4984
+ args: [tokenAddress, amount]
4985
+ });
4986
+ const estimatedGas = await publicClient.estimateGas({
4987
+ account: account.address,
4988
+ to: walletAddress,
4989
+ data
4990
+ });
4991
+ const gasLimit = estimatedGas + estimatedGas * BigInt(20) / BigInt(100);
4992
+ const { request } = await publicClient.simulateContract({
4993
+ account,
4994
+ address: walletAddress,
4995
+ abi: walletConfig.abi,
4996
+ functionName: "requestWithdrawal",
4997
+ args: [tokenAddress, amount]
4998
+ });
4999
+ const hash = await walletClient.writeContract({
5000
+ ...request,
5001
+ gas: gasLimit
5002
+ });
5003
+ await publicClient.waitForTransactionReceipt({ hash });
5004
+ return hash;
5005
+ }
5006
+ async function executeWithdrawal(params) {
5007
+ const { walletClient, publicClient, walletAddress, tokenAddress, account, network = "sepolia" } = params;
5008
+ const walletConfig = getContractConfig("IATPWallet" /* IATP_WALLET */, network);
5009
+ if (!walletConfig) {
5010
+ throw new Error(`IATPWallet contract not found for network: ${network}`);
5011
+ }
5012
+ const data = viem.encodeFunctionData({
5013
+ abi: walletConfig.abi,
5014
+ functionName: "executeWithdrawal",
5015
+ args: [tokenAddress]
5016
+ });
5017
+ const estimatedGas = await publicClient.estimateGas({
5018
+ account: account.address,
5019
+ to: walletAddress,
5020
+ data
5021
+ });
5022
+ const gasLimit = estimatedGas + estimatedGas * BigInt(20) / BigInt(100);
5023
+ const { request } = await publicClient.simulateContract({
5024
+ account,
5025
+ address: walletAddress,
5026
+ abi: walletConfig.abi,
5027
+ functionName: "executeWithdrawal",
5028
+ args: [tokenAddress]
5029
+ });
5030
+ const hash = await walletClient.writeContract({
5031
+ ...request,
5032
+ gas: gasLimit
5033
+ });
5034
+ await publicClient.waitForTransactionReceipt({ hash });
5035
+ return hash;
5036
+ }
5037
+
5038
+ // src/client.ts
5039
+ var D402Client = class {
5040
+ /**
5041
+ * Create a new D402 Client.
5042
+ *
5043
+ * @param config - Client configuration
5044
+ *
5045
+ * @example
5046
+ * ```ts
5047
+ * const client = new D402Client({
5048
+ * operatorAccount: walletClient.account, // User's wallet from wagmi
5049
+ * iatpWalletAddress: userWallet, // From createIATPWallet() or getWalletsByOwner()
5050
+ * maxValue: 1000000n // Safety limit: 1 USDC max
5051
+ * })
5052
+ * ```
5053
+ */
5054
+ constructor(config) {
5055
+ this.operatorAccount = config.operatorAccount;
5056
+ this.iatpWalletAddress = config.iatpWalletAddress;
5057
+ this.maxValue = config.maxValue;
5058
+ this.networkFilter = config.networkFilter;
5059
+ this.schemeFilter = config.schemeFilter || "exact";
5060
+ this.paymentRequirementsSelector = config.paymentRequirementsSelector || selectPaymentRequirement;
5061
+ }
5062
+ /**
5063
+ * Select payment requirement from list of options.
5064
+ *
5065
+ * Applies configured filters (network, scheme, maxValue) to choose
5066
+ * the appropriate payment option from the server's requirements list.
5067
+ *
5068
+ * @param requirements - List of payment requirements from 402 response
5069
+ * @returns Selected payment requirement
5070
+ */
5071
+ selectPaymentRequirement(requirements) {
5072
+ return this.paymentRequirementsSelector(requirements, {
5073
+ network: this.networkFilter,
5074
+ scheme: this.schemeFilter,
5075
+ maxAmount: this.maxValue
5076
+ });
5077
+ }
5078
+ /**
5079
+ * Get the IATP wallet address used for payments.
5080
+ *
5081
+ * @returns IATPWallet contract address, or user's EOA address if no wallet configured
5082
+ */
5083
+ getIATPWalletAddress() {
5084
+ return this.iatpWalletAddress;
5085
+ }
5086
+ /**
5087
+ * Get the user's account used for signing payments.
5088
+ *
5089
+ * @returns User's wallet account
5090
+ */
5091
+ getOperatorAccount() {
5092
+ return this.operatorAccount;
5093
+ }
5094
+ /**
5095
+ * Get the maximum payment value limit.
5096
+ *
5097
+ * @returns Maximum value in base units, or undefined if no limit
5098
+ */
5099
+ getMaxValue() {
5100
+ return this.maxValue;
5101
+ }
5102
+ /**
5103
+ * Get available balance for a token in the IATP wallet.
5104
+ *
5105
+ * @param publicClient - Viem PublicClient (from wagmi usePublicClient)
5106
+ * @param tokenAddress - Token contract address
5107
+ * @returns Available balance in token's base units (wei)
5108
+ */
5109
+ async getAvailableBalance(publicClient, tokenAddress) {
5110
+ return getAvailableBalance({
5111
+ publicClient,
5112
+ walletAddress: this.iatpWalletAddress,
5113
+ tokenAddress
5114
+ });
5115
+ }
5116
+ /**
5117
+ * Get withdrawal request for a token.
5118
+ *
5119
+ * @param publicClient - Viem PublicClient
5120
+ * @param tokenAddress - Token contract address
5121
+ * @returns Withdrawal request: [amount, unlockTimestamp] or null if no request exists
5122
+ */
5123
+ async getWithdrawalRequest(publicClient, tokenAddress) {
5124
+ return getWithdrawalRequest({
5125
+ publicClient,
5126
+ walletAddress: this.iatpWalletAddress,
5127
+ tokenAddress
5128
+ });
5129
+ }
5130
+ /**
5131
+ * Request a withdrawal from the IATP wallet.
5132
+ *
5133
+ * @param walletClient - Viem WalletClient (from wagmi useWalletClient)
5134
+ * @param publicClient - Viem PublicClient (from wagmi usePublicClient)
5135
+ * @param tokenAddress - Token contract address
5136
+ * @param amount - Amount in token's base units (wei)
5137
+ * @returns Transaction hash
5138
+ */
5139
+ async requestWithdrawal(walletClient, publicClient, tokenAddress, amount) {
5140
+ return requestWithdrawal({
5141
+ walletClient,
5142
+ publicClient,
5143
+ walletAddress: this.iatpWalletAddress,
5144
+ tokenAddress,
5145
+ amount,
5146
+ account: this.operatorAccount
5147
+ });
5148
+ }
5149
+ /**
5150
+ * Execute a withdrawal for a token (after unlock period).
5151
+ *
5152
+ * @param walletClient - Viem WalletClient
5153
+ * @param publicClient - Viem PublicClient
5154
+ * @param tokenAddress - Token contract address
5155
+ * @returns Transaction hash
5156
+ */
5157
+ async executeWithdrawal(walletClient, publicClient, tokenAddress) {
5158
+ return executeWithdrawal({
5159
+ walletClient,
5160
+ publicClient,
5161
+ walletAddress: this.iatpWalletAddress,
5162
+ tokenAddress,
5163
+ account: this.operatorAccount
5164
+ });
5165
+ }
5166
+ /**
5167
+ * Fetch with automatic 402 payment handling.
5168
+ *
5169
+ *
5170
+ * Flow:
5171
+ * 1. Make request without payment
5172
+ * 2. If 402 response, parse payment requirements
5173
+ * 3. Select appropriate payment option
5174
+ * 4. Sign payment with EIP-712
5175
+ * 5. Retry request with X-Payment header
5176
+ * 6. Return final response
5177
+ *
5178
+ * @param url - URL to fetch
5179
+ * @param init - Fetch options (method, headers, body, etc.)
5180
+ * @returns Response object (after payment if 402)
5181
+ *
5182
+ * @example
5183
+ * ```ts
5184
+ * const client = new D402Client({ operatorAccount, iatpWalletAddress })
5185
+ *
5186
+ * const response = await client.fetch('http://api.example.com/analyze', {
5187
+ * method: 'POST',
5188
+ * headers: { 'Content-Type': 'application/json' },
5189
+ * body: JSON.stringify({ text: 'Analyze this' })
5190
+ * })
5191
+ *
5192
+ * const data = await response.json()
5193
+ * ```
5194
+ */
5195
+ async fetch(url, init) {
5196
+ const { parseAllPaymentRequirements: parseAllPaymentRequirements2 } = await Promise.resolve().then(() => (init_parser(), parser_exports));
5197
+ const { signD402Payment: signD402Payment2 } = await Promise.resolve().then(() => (init_signer(), signer_exports));
5198
+ const { encodePayment: encodePayment2 } = await Promise.resolve().then(() => (init_encoder(), encoder_exports));
5199
+ let response = await fetch(url, init);
5200
+ if (response.status !== 402) {
5201
+ return response;
5202
+ }
5203
+ try {
5204
+ const requirements = await parseAllPaymentRequirements2(response);
5205
+ const selectedRequirement = this.selectPaymentRequirement(requirements);
5206
+ const signedPayment = await signD402Payment2({
5207
+ operatorAccount: this.operatorAccount,
5208
+ paymentRequirement: selectedRequirement,
5209
+ iatpWalletAddress: this.iatpWalletAddress
5210
+ });
5211
+ const paymentHeader = encodePayment2(signedPayment);
5212
+ response = await fetch(url, {
5213
+ ...init,
5214
+ headers: {
5215
+ ...init?.headers,
5216
+ "X-Payment": paymentHeader,
5217
+ "Access-Control-Expose-Headers": "X-Payment-Response"
5218
+ }
5219
+ });
5220
+ return response;
5221
+ } catch (error) {
5222
+ throw error;
5223
+ }
5224
+ }
5225
+ };
5226
+
5227
+ // src/index.ts
5228
+ init_signer();
5229
+ init_parser();
5230
+ init_encoder();
5231
+ init_utils();
5232
+ init_errors();
5233
+ init_constants();
5234
+
5235
+ // src/settlement.ts
5236
+ async function getLockedBalanceForProvider(params) {
5237
+ const { publicClient, settlementLayerAddress, providerAddress, network = "sepolia" } = params;
5238
+ const settlementConfig = getContractConfig("IATPSettlementLayer" /* IATP_SETTLEMENT_LAYER */, network);
5239
+ if (!settlementConfig) {
5240
+ throw new Error(`IATPSettlementLayer contract not found for network: ${network}`);
5241
+ }
5242
+ const balance = await publicClient.readContract({
5243
+ address: settlementLayerAddress,
5244
+ abi: settlementConfig.abi,
5245
+ functionName: "getLockedBalanceForProvider",
5246
+ args: [providerAddress]
5247
+ });
5248
+ return balance;
5249
+ }
5250
+ async function getUnlockedBalanceForProvider(params) {
5251
+ const { publicClient, settlementLayerAddress, providerAddress, network = "sepolia" } = params;
5252
+ const settlementConfig = getContractConfig("IATPSettlementLayer" /* IATP_SETTLEMENT_LAYER */, network);
5253
+ if (!settlementConfig) {
5254
+ throw new Error(`IATPSettlementLayer contract not found for network: ${network}`);
5255
+ }
5256
+ const balance = await publicClient.readContract({
5257
+ address: settlementLayerAddress,
5258
+ abi: settlementConfig.abi,
5259
+ functionName: "getUnlockedBalanceForProvider",
5260
+ args: [providerAddress]
5261
+ });
5262
+ return balance;
5263
+ }
9018
5264
 
9019
5265
  exports.ContractName = ContractName;
9020
5266
  exports.D402Client = D402Client;
@@ -9027,11 +5273,14 @@ exports.findMatchingPaymentRequirement = findMatchingPaymentRequirement;
9027
5273
  exports.formatMoney = formatMoney;
9028
5274
  exports.generateNonce = generateNonce;
9029
5275
  exports.getAllContractAddresses = getAllContractAddresses;
5276
+ exports.getAvailableBalance = getAvailableBalance;
9030
5277
  exports.getChainId = getChainId;
9031
5278
  exports.getContractAbi = getContractAbi;
9032
5279
  exports.getContractAddress = getContractAddress;
9033
5280
  exports.getContractConfig = getContractConfig;
9034
5281
  exports.getCurrentTimestamp = getCurrentTimestamp;
5282
+ exports.getLockedBalanceForProvider = getLockedBalanceForProvider;
5283
+ exports.getUnlockedBalanceForProvider = getUnlockedBalanceForProvider;
9035
5284
  exports.getUsdcAddress = getUsdcAddress;
9036
5285
  exports.getWalletsByOwner = getWalletsByOwner;
9037
5286
  exports.isContractDeployed = isContractDeployed;