@dcentralab/d402-client 0.3.13 → 0.3.15

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.mjs CHANGED
@@ -95,8 +95,7 @@ var init_constants = __esm({
95
95
  { name: "provider", type: "address" },
96
96
  { name: "token", type: "address" },
97
97
  { name: "amount", type: "uint256" },
98
- { name: "deadline", type: "uint256" },
99
- { name: "requestPath", type: "string" }
98
+ { name: "deadline", type: "uint256" }
100
99
  ]
101
100
  };
102
101
  }
@@ -299,13 +298,8 @@ async function signD402Payment(params) {
299
298
  walletClient,
300
299
  paymentRequirement,
301
300
  iatpWalletAddress,
302
- requestPath,
303
301
  d402Version = 1
304
302
  } = params;
305
- let finalRequestPath = requestPath || paymentRequirement.resource || "/mcp";
306
- if (!finalRequestPath || finalRequestPath.trim() === "") {
307
- finalRequestPath = "/mcp";
308
- }
309
303
  const nonce = generateNonce();
310
304
  const now = getCurrentTimestamp();
311
305
  const validAfter = (now - 60).toString();
@@ -325,8 +319,7 @@ async function signD402Payment(params) {
325
319
  provider: paymentRequirement.payTo,
326
320
  token: paymentRequirement.asset,
327
321
  amount: BigInt(paymentRequirement.maxAmountRequired),
328
- deadline: BigInt(validBefore),
329
- requestPath: finalRequestPath
322
+ deadline: BigInt(validBefore)
330
323
  };
331
324
  let signature;
332
325
  if (walletClient) {
@@ -363,8 +356,7 @@ async function signD402Payment(params) {
363
356
  value: paymentRequirement.maxAmountRequired,
364
357
  validAfter,
365
358
  validBefore,
366
- nonce,
367
- requestPath: finalRequestPath
359
+ nonce
368
360
  }
369
361
  }
370
362
  };
@@ -3259,6 +3251,19 @@ var sepolia_default = {
3259
3251
  stateMutability: "view",
3260
3252
  type: "function"
3261
3253
  },
3254
+ {
3255
+ inputs: [],
3256
+ name: "MAX_BATCH_DISPUTE_SIZE",
3257
+ outputs: [
3258
+ {
3259
+ internalType: "uint256",
3260
+ name: "",
3261
+ type: "uint256"
3262
+ }
3263
+ ],
3264
+ stateMutability: "view",
3265
+ type: "function"
3266
+ },
3262
3267
  {
3263
3268
  inputs: [],
3264
3269
  name: "MAX_DISPUTE_REASON_LENGTH",
@@ -3324,93 +3329,6 @@ var sepolia_default = {
3324
3329
  stateMutability: "view",
3325
3330
  type: "function"
3326
3331
  },
3327
- {
3328
- inputs: [
3329
- {
3330
- components: [
3331
- {
3332
- components: [
3333
- {
3334
- internalType: "contract IIATPWallet",
3335
- name: "consumer",
3336
- type: "address"
3337
- },
3338
- {
3339
- internalType: "contract IIATPWallet",
3340
- name: "provider",
3341
- type: "address"
3342
- },
3343
- {
3344
- internalType: "address",
3345
- name: "tokenAddress",
3346
- type: "address"
3347
- },
3348
- {
3349
- internalType: "uint256",
3350
- name: "amount",
3351
- type: "uint256"
3352
- },
3353
- {
3354
- internalType: "string",
3355
- name: "requestPath",
3356
- type: "string"
3357
- },
3358
- {
3359
- internalType: "uint256",
3360
- name: "consumerDeadline",
3361
- type: "uint256"
3362
- },
3363
- {
3364
- internalType: "uint256",
3365
- name: "timestamp",
3366
- type: "uint256"
3367
- },
3368
- {
3369
- internalType: "bytes32",
3370
- name: "serviceDescription",
3371
- type: "bytes32"
3372
- },
3373
- {
3374
- internalType: "bytes",
3375
- name: "outputHash",
3376
- type: "bytes"
3377
- },
3378
- {
3379
- internalType: "uint256",
3380
- name: "facilitatorFeePercent",
3381
- type: "uint256"
3382
- }
3383
- ],
3384
- internalType: "struct IIATPSettlementLayer.SettlementRequestData",
3385
- name: "requestData",
3386
- type: "tuple"
3387
- },
3388
- {
3389
- internalType: "bytes",
3390
- name: "consumerSignature",
3391
- type: "bytes"
3392
- },
3393
- {
3394
- internalType: "bytes",
3395
- name: "providerSignature",
3396
- type: "bytes"
3397
- }
3398
- ],
3399
- internalType: "struct IIATPSettlementLayer.SettlementRequest",
3400
- name: "req",
3401
- type: "tuple"
3402
- },
3403
- {
3404
- internalType: "address",
3405
- name: "facilitator",
3406
- type: "address"
3407
- }
3408
- ],
3409
- name: "_settleRequest",
3410
- outputs: [],
3411
- stateMutability: "nonpayable",
3412
- type: "function"
3413
- },
3414
3332
  {
3415
3333
  inputs: [
3416
3334
  {
@@ -3463,20 +3381,10 @@ var sepolia_default = {
3463
3381
  name: "failed",
3464
3382
  type: "uint256"
3465
3383
  },
3466
- {
3467
- internalType: "uint256",
3468
- name: "faults",
3469
- type: "uint256"
3470
- },
3471
3384
  {
3472
3385
  internalType: "int256",
3473
3386
  name: "score",
3474
3387
  type: "int256"
3475
- },
3476
- {
3477
- internalType: "uint256",
3478
- name: "firstSettlementAt",
3479
- type: "uint256"
3480
3388
  }
3481
3389
  ],
3482
3390
  stateMutability: "view",
@@ -3519,6 +3427,24 @@ var sepolia_default = {
3519
3427
  stateMutability: "nonpayable",
3520
3428
  type: "function"
3521
3429
  },
3430
+ {
3431
+ inputs: [
3432
+ {
3433
+ internalType: "bytes32[]",
3434
+ name: "requestIds",
3435
+ type: "bytes32[]"
3436
+ },
3437
+ {
3438
+ internalType: "string[]",
3439
+ name: "reasons",
3440
+ type: "string[]"
3441
+ }
3442
+ ],
3443
+ name: "disputeRequests",
3444
+ outputs: [],
3445
+ stateMutability: "nonpayable",
3446
+ type: "function"
3447
+ },
3522
3448
  {
3523
3449
  inputs: [
3524
3450
  {
@@ -3672,6 +3598,72 @@ var sepolia_default = {
3672
3598
  stateMutability: "view",
3673
3599
  type: "function"
3674
3600
  },
3601
+ {
3602
+ inputs: [
3603
+ {
3604
+ internalType: "address",
3605
+ name: "consumer",
3606
+ type: "address"
3607
+ },
3608
+ {
3609
+ internalType: "uint256",
3610
+ name: "offset",
3611
+ type: "uint256"
3612
+ },
3613
+ {
3614
+ internalType: "uint256",
3615
+ name: "limit",
3616
+ type: "uint256"
3617
+ }
3618
+ ],
3619
+ name: "getConsumerSettlements",
3620
+ outputs: [
3621
+ {
3622
+ components: [
3623
+ {
3624
+ internalType: "address",
3625
+ name: "consumer",
3626
+ type: "address"
3627
+ },
3628
+ {
3629
+ internalType: "address",
3630
+ name: "provider",
3631
+ type: "address"
3632
+ },
3633
+ {
3634
+ internalType: "address",
3635
+ name: "tokenAddress",
3636
+ type: "address"
3637
+ },
3638
+ {
3639
+ internalType: "uint128",
3640
+ name: "providerAmount",
3641
+ type: "uint128"
3642
+ },
3643
+ {
3644
+ internalType: "uint64",
3645
+ name: "epoch",
3646
+ type: "uint64"
3647
+ },
3648
+ {
3649
+ internalType: "enum IIATPSettlementLayer.RequestStatus",
3650
+ name: "status",
3651
+ type: "uint8"
3652
+ }
3653
+ ],
3654
+ internalType: "struct IIATPSettlementLayer.SettlementRecord[]",
3655
+ name: "records",
3656
+ type: "tuple[]"
3657
+ },
3658
+ {
3659
+ internalType: "uint256",
3660
+ name: "total",
3661
+ type: "uint256"
3662
+ }
3663
+ ],
3664
+ stateMutability: "view",
3665
+ type: "function"
3666
+ },
3675
3667
  {
3676
3668
  inputs: [],
3677
3669
  name: "getCurrentEpoch",
@@ -3685,6 +3677,19 @@ var sepolia_default = {
3685
3677
  stateMutability: "view",
3686
3678
  type: "function"
3687
3679
  },
3680
+ {
3681
+ inputs: [],
3682
+ name: "getDeploymentTimestamp",
3683
+ outputs: [
3684
+ {
3685
+ internalType: "uint256",
3686
+ name: "",
3687
+ type: "uint256"
3688
+ }
3689
+ ],
3690
+ stateMutability: "view",
3691
+ type: "function"
3692
+ },
3688
3693
  {
3689
3694
  inputs: [
3690
3695
  {
@@ -3835,39 +3840,12 @@ var sepolia_default = {
3835
3840
  type: "address"
3836
3841
  }
3837
3842
  ],
3838
- name: "getProviderReputation",
3843
+ name: "getProviderReputationScore",
3839
3844
  outputs: [
3840
3845
  {
3841
- components: [
3842
- {
3843
- internalType: "uint256",
3844
- name: "completed",
3845
- type: "uint256"
3846
- },
3847
- {
3848
- internalType: "uint256",
3849
- name: "failed",
3850
- type: "uint256"
3851
- },
3852
- {
3853
- internalType: "uint256",
3854
- name: "faults",
3855
- type: "uint256"
3856
- },
3857
- {
3858
- internalType: "int256",
3859
- name: "score",
3860
- type: "int256"
3861
- },
3862
- {
3863
- internalType: "uint256",
3864
- name: "firstSettlementAt",
3865
- type: "uint256"
3866
- }
3867
- ],
3868
- internalType: "struct IIATPSettlementLayer.Reputation",
3846
+ internalType: "int256",
3869
3847
  name: "",
3870
- type: "tuple"
3848
+ type: "int256"
3871
3849
  }
3872
3850
  ],
3873
3851
  stateMutability: "view",
@@ -3877,19 +3855,24 @@ var sepolia_default = {
3877
3855
  inputs: [
3878
3856
  {
3879
3857
  internalType: "address",
3880
- name: "provider",
3858
+ name: "consumer",
3881
3859
  type: "address"
3860
+ },
3861
+ {
3862
+ internalType: "uint256",
3863
+ name: "count",
3864
+ type: "uint256"
3882
3865
  }
3883
3866
  ],
3884
- name: "getProviderReputationScore",
3867
+ name: "getRequestIdFromConsumer",
3885
3868
  outputs: [
3886
3869
  {
3887
- internalType: "int256",
3870
+ internalType: "bytes32",
3888
3871
  name: "",
3889
- type: "int256"
3872
+ type: "bytes32"
3890
3873
  }
3891
3874
  ],
3892
- stateMutability: "view",
3875
+ stateMutability: "pure",
3893
3876
  type: "function"
3894
3877
  },
3895
3878
  {
@@ -4101,19 +4084,57 @@ var sepolia_default = {
4101
4084
  name: "failed",
4102
4085
  type: "uint256"
4103
4086
  },
4104
- {
4105
- internalType: "uint256",
4106
- name: "faults",
4107
- type: "uint256"
4108
- },
4109
4087
  {
4110
4088
  internalType: "int256",
4111
4089
  name: "score",
4112
4090
  type: "int256"
4091
+ }
4092
+ ],
4093
+ stateMutability: "view",
4094
+ type: "function"
4095
+ },
4096
+ {
4097
+ inputs: [
4098
+ {
4099
+ internalType: "address",
4100
+ name: "",
4101
+ type: "address"
4102
+ },
4103
+ {
4104
+ internalType: "address",
4105
+ name: "",
4106
+ type: "address"
4107
+ }
4108
+ ],
4109
+ name: "providerTotalBalance",
4110
+ outputs: [
4111
+ {
4112
+ internalType: "uint256",
4113
+ name: "",
4114
+ type: "uint256"
4115
+ }
4116
+ ],
4117
+ stateMutability: "view",
4118
+ type: "function"
4119
+ },
4120
+ {
4121
+ inputs: [
4122
+ {
4123
+ internalType: "address",
4124
+ name: "",
4125
+ type: "address"
4113
4126
  },
4127
+ {
4128
+ internalType: "address",
4129
+ name: "",
4130
+ type: "address"
4131
+ }
4132
+ ],
4133
+ name: "providerTotalDisputeInProgress",
4134
+ outputs: [
4114
4135
  {
4115
4136
  internalType: "uint256",
4116
- name: "firstSettlementAt",
4137
+ name: "",
4117
4138
  type: "uint256"
4118
4139
  }
4119
4140
  ],
@@ -4164,6 +4185,24 @@ var sepolia_default = {
4164
4185
  stateMutability: "nonpayable",
4165
4186
  type: "function"
4166
4187
  },
4188
+ {
4189
+ inputs: [
4190
+ {
4191
+ internalType: "bytes32[]",
4192
+ name: "requestIds",
4193
+ type: "bytes32[]"
4194
+ },
4195
+ {
4196
+ internalType: "bool[]",
4197
+ name: "consumerWonArray",
4198
+ type: "bool[]"
4199
+ }
4200
+ ],
4201
+ name: "resolveDisputes",
4202
+ outputs: [],
4203
+ stateMutability: "nonpayable",
4204
+ type: "function"
4205
+ },
4167
4206
  {
4168
4207
  inputs: [],
4169
4208
  name: "roleManager",
@@ -4278,11 +4317,6 @@ var sepolia_default = {
4278
4317
  name: "amount",
4279
4318
  type: "uint256"
4280
4319
  },
4281
- {
4282
- internalType: "string",
4283
- name: "requestPath",
4284
- type: "string"
4285
- },
4286
4320
  {
4287
4321
  internalType: "uint256",
4288
4322
  name: "consumerDeadline",
@@ -4299,9 +4333,9 @@ var sepolia_default = {
4299
4333
  type: "bytes32"
4300
4334
  },
4301
4335
  {
4302
- internalType: "bytes",
4336
+ internalType: "bytes32",
4303
4337
  name: "outputHash",
4304
- type: "bytes"
4338
+ type: "bytes32"
4305
4339
  },
4306
4340
  {
4307
4341
  internalType: "uint256",
@@ -4360,11 +4394,6 @@ var sepolia_default = {
4360
4394
  name: "amount",
4361
4395
  type: "uint256"
4362
4396
  },
4363
- {
4364
- internalType: "string",
4365
- name: "requestPath",
4366
- type: "string"
4367
- },
4368
4397
  {
4369
4398
  internalType: "uint256",
4370
4399
  name: "consumerDeadline",
@@ -4381,9 +4410,9 @@ var sepolia_default = {
4381
4410
  type: "bytes32"
4382
4411
  },
4383
4412
  {
4384
- internalType: "bytes",
4413
+ internalType: "bytes32",
4385
4414
  name: "outputHash",
4386
- type: "bytes"
4415
+ type: "bytes32"
4387
4416
  },
4388
4417
  {
4389
4418
  internalType: "uint256",
@@ -4424,14 +4453,6 @@ var sepolia_default = {
4424
4453
  },
4425
4454
  {
4426
4455
  inputs: [
4427
- {
4428
- internalType: "bytes32",
4429
- name: "",
4430
- type: "bytes32"
4431
- }
4432
- ],
4433
- name: "settlements",
4434
- outputs: [
4435
4456
  {
4436
4457
  components: [
4437
4458
  {
@@ -4456,11 +4477,6 @@ var sepolia_default = {
4456
4477
  name: "amount",
4457
4478
  type: "uint256"
4458
4479
  },
4459
- {
4460
- internalType: "string",
4461
- name: "requestPath",
4462
- type: "string"
4463
- },
4464
4480
  {
4465
4481
  internalType: "uint256",
4466
4482
  name: "consumerDeadline",
@@ -4477,9 +4493,9 @@ var sepolia_default = {
4477
4493
  type: "bytes32"
4478
4494
  },
4479
4495
  {
4480
- internalType: "bytes",
4496
+ internalType: "bytes32",
4481
4497
  name: "outputHash",
4482
- type: "bytes"
4498
+ type: "bytes32"
4483
4499
  },
4484
4500
  {
4485
4501
  internalType: "uint256",
@@ -4502,14 +4518,50 @@ var sepolia_default = {
4502
4518
  type: "bytes"
4503
4519
  }
4504
4520
  ],
4505
- internalType: "struct IIATPSettlementLayer.SettlementRequest",
4506
- name: "settlementRequest",
4507
- type: "tuple"
4521
+ internalType: "struct IIATPSettlementLayer.SettlementRequest[]",
4522
+ name: "serviceRequests",
4523
+ type: "tuple[]"
4524
+ }
4525
+ ],
4526
+ name: "settleRequestsStrict",
4527
+ outputs: [],
4528
+ stateMutability: "nonpayable",
4529
+ type: "function"
4530
+ },
4531
+ {
4532
+ inputs: [
4533
+ {
4534
+ internalType: "bytes32",
4535
+ name: "",
4536
+ type: "bytes32"
4537
+ }
4538
+ ],
4539
+ name: "settlements",
4540
+ outputs: [
4541
+ {
4542
+ internalType: "address",
4543
+ name: "consumer",
4544
+ type: "address"
4508
4545
  },
4509
4546
  {
4510
- internalType: "uint256",
4547
+ internalType: "address",
4548
+ name: "provider",
4549
+ type: "address"
4550
+ },
4551
+ {
4552
+ internalType: "address",
4553
+ name: "tokenAddress",
4554
+ type: "address"
4555
+ },
4556
+ {
4557
+ internalType: "uint128",
4558
+ name: "providerAmount",
4559
+ type: "uint128"
4560
+ },
4561
+ {
4562
+ internalType: "uint64",
4511
4563
  name: "epoch",
4512
- type: "uint256"
4564
+ type: "uint64"
4513
4565
  },
4514
4566
  {
4515
4567
  internalType: "enum IIATPSettlementLayer.RequestStatus",
@@ -4633,24 +4685,6 @@ var sepolia_default = {
4633
4685
  stateMutability: "nonpayable",
4634
4686
  type: "function"
4635
4687
  },
4636
- {
4637
- inputs: [
4638
- {
4639
- internalType: "uint256",
4640
- name: "epoch",
4641
- type: "uint256"
4642
- },
4643
- {
4644
- internalType: "address",
4645
- name: "token",
4646
- type: "address"
4647
- }
4648
- ],
4649
- name: "withdrawEpochToken",
4650
- outputs: [],
4651
- stateMutability: "nonpayable",
4652
- type: "function"
4653
- },
4654
4688
  {
4655
4689
  inputs: [
4656
4690
  {
@@ -5361,6 +5395,19 @@ var sepolia_default = {
5361
5395
  stateMutability: "view",
5362
5396
  type: "function"
5363
5397
  },
5398
+ {
5399
+ inputs: [
5400
+ {
5401
+ internalType: "address",
5402
+ name: "_wallet",
5403
+ type: "address"
5404
+ }
5405
+ ],
5406
+ name: "registerWalletWithSettlementLayer",
5407
+ outputs: [],
5408
+ stateMutability: "nonpayable",
5409
+ type: "function"
5410
+ },
5364
5411
  {
5365
5412
  inputs: [],
5366
5413
  name: "roleManager",
@@ -10364,8 +10411,8 @@ var arbitrum_default = {
10364
10411
  var proxies_default = {
10365
10412
  sepolia: {
10366
10413
  RoleManager: "0x71d388142EA9194e5b51Eee3FEfe3B87D494dd38",
10367
- IATPSettlementLayer: "0x0205ea98258eda5f6C94116a44f9811d8089f110",
10368
- IATPWalletFactory: "0x54083Cc03c5D9D408D71D36170Ef01310E0C78fE"
10414
+ IATPSettlementLayer: "0xB82816BA396fB06aF7076202cb5d7D9e4dACBb15",
10415
+ IATPWalletFactory: "0x2A95caE178142EC53864b42891828455f45a9E01"
10369
10416
  },
10370
10417
  arbitrum: {
10371
10418
  RoleManager: "0xB256b27681FaC8b4EaB79d392083B2D992972eff",