@virtuals-protocol/acp-node 0.2.0-beta.12 → 0.2.0-beta.13

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.d.mts CHANGED
@@ -96,6 +96,7 @@ declare class Fare {
96
96
  contractAddress: Address;
97
97
  decimals: number;
98
98
  constructor(contractAddress: Address, decimals: number);
99
+ maxAmount(): bigint;
99
100
  formatAmount(amount: number): bigint;
100
101
  }
101
102
  interface IFareAmount {
@@ -442,6 +443,7 @@ declare class AcpContractClient {
442
443
  [x: `bool[${string}]`]: undefined;
443
444
  [x: `bytes4[${string}]`]: undefined;
444
445
  [x: `bytes[${string}]`]: undefined;
446
+ [x: `bytes10[${string}]`]: undefined;
445
447
  [x: `bytes1[${string}]`]: undefined;
446
448
  [x: `bytes6[${string}]`]: undefined;
447
449
  [x: `bytes18[${string}]`]: undefined;
@@ -451,7 +453,6 @@ declare class AcpContractClient {
451
453
  [x: `bytes7[${string}]`]: undefined;
452
454
  [x: `bytes8[${string}]`]: undefined;
453
455
  [x: `bytes9[${string}]`]: undefined;
454
- [x: `bytes10[${string}]`]: undefined;
455
456
  [x: `bytes11[${string}]`]: undefined;
456
457
  [x: `bytes12[${string}]`]: undefined;
457
458
  [x: `bytes13[${string}]`]: undefined;
@@ -544,6 +545,7 @@ declare class AcpContractClient {
544
545
  bool?: undefined;
545
546
  bytes4?: undefined;
546
547
  bytes?: undefined;
548
+ bytes10?: undefined;
547
549
  bytes1?: undefined;
548
550
  bytes6?: undefined;
549
551
  bytes18?: undefined;
@@ -553,7 +555,6 @@ declare class AcpContractClient {
553
555
  bytes7?: undefined;
554
556
  bytes8?: undefined;
555
557
  bytes9?: undefined;
556
- bytes10?: undefined;
557
558
  bytes11?: undefined;
558
559
  bytes12?: undefined;
559
560
  bytes13?: undefined;
@@ -7752,6 +7753,7 @@ declare class AcpContractClient {
7752
7753
  [x: `bool[${string}]`]: undefined;
7753
7754
  [x: `bytes4[${string}]`]: undefined;
7754
7755
  [x: `bytes[${string}]`]: undefined;
7756
+ [x: `bytes10[${string}]`]: undefined;
7755
7757
  [x: `bytes1[${string}]`]: undefined;
7756
7758
  [x: `bytes6[${string}]`]: undefined;
7757
7759
  [x: `bytes18[${string}]`]: undefined;
@@ -7761,7 +7763,6 @@ declare class AcpContractClient {
7761
7763
  [x: `bytes7[${string}]`]: undefined;
7762
7764
  [x: `bytes8[${string}]`]: undefined;
7763
7765
  [x: `bytes9[${string}]`]: undefined;
7764
- [x: `bytes10[${string}]`]: undefined;
7765
7766
  [x: `bytes11[${string}]`]: undefined;
7766
7767
  [x: `bytes12[${string}]`]: undefined;
7767
7768
  [x: `bytes13[${string}]`]: undefined;
@@ -7854,6 +7855,7 @@ declare class AcpContractClient {
7854
7855
  bool?: undefined;
7855
7856
  bytes4?: undefined;
7856
7857
  bytes?: undefined;
7858
+ bytes10?: undefined;
7857
7859
  bytes1?: undefined;
7858
7860
  bytes6?: undefined;
7859
7861
  bytes18?: undefined;
@@ -7863,7 +7865,6 @@ declare class AcpContractClient {
7863
7865
  bytes7?: undefined;
7864
7866
  bytes8?: undefined;
7865
7867
  bytes9?: undefined;
7866
- bytes10?: undefined;
7867
7868
  bytes11?: undefined;
7868
7869
  bytes12?: undefined;
7869
7870
  bytes13?: undefined;
@@ -8203,6 +8204,7 @@ declare class AcpContractClient {
8203
8204
  [x: `bool[${string}]`]: undefined;
8204
8205
  [x: `bytes4[${string}]`]: undefined;
8205
8206
  [x: `bytes[${string}]`]: undefined;
8207
+ [x: `bytes10[${string}]`]: undefined;
8206
8208
  [x: `bytes1[${string}]`]: undefined;
8207
8209
  [x: `bytes6[${string}]`]: undefined;
8208
8210
  [x: `bytes18[${string}]`]: undefined;
@@ -8212,7 +8214,6 @@ declare class AcpContractClient {
8212
8214
  [x: `bytes7[${string}]`]: undefined;
8213
8215
  [x: `bytes8[${string}]`]: undefined;
8214
8216
  [x: `bytes9[${string}]`]: undefined;
8215
- [x: `bytes10[${string}]`]: undefined;
8216
8217
  [x: `bytes11[${string}]`]: undefined;
8217
8218
  [x: `bytes12[${string}]`]: undefined;
8218
8219
  [x: `bytes13[${string}]`]: undefined;
@@ -8305,6 +8306,7 @@ declare class AcpContractClient {
8305
8306
  bool?: undefined;
8306
8307
  bytes4?: undefined;
8307
8308
  bytes?: undefined;
8309
+ bytes10?: undefined;
8308
8310
  bytes1?: undefined;
8309
8311
  bytes6?: undefined;
8310
8312
  bytes18?: undefined;
@@ -8314,7 +8316,6 @@ declare class AcpContractClient {
8314
8316
  bytes7?: undefined;
8315
8317
  bytes8?: undefined;
8316
8318
  bytes9?: undefined;
8317
- bytes10?: undefined;
8318
8319
  bytes11?: undefined;
8319
8320
  bytes12?: undefined;
8320
8321
  bytes13?: undefined;
package/dist/index.d.ts CHANGED
@@ -96,6 +96,7 @@ declare class Fare {
96
96
  contractAddress: Address;
97
97
  decimals: number;
98
98
  constructor(contractAddress: Address, decimals: number);
99
+ maxAmount(): bigint;
99
100
  formatAmount(amount: number): bigint;
100
101
  }
101
102
  interface IFareAmount {
@@ -442,6 +443,7 @@ declare class AcpContractClient {
442
443
  [x: `bool[${string}]`]: undefined;
443
444
  [x: `bytes4[${string}]`]: undefined;
444
445
  [x: `bytes[${string}]`]: undefined;
446
+ [x: `bytes10[${string}]`]: undefined;
445
447
  [x: `bytes1[${string}]`]: undefined;
446
448
  [x: `bytes6[${string}]`]: undefined;
447
449
  [x: `bytes18[${string}]`]: undefined;
@@ -451,7 +453,6 @@ declare class AcpContractClient {
451
453
  [x: `bytes7[${string}]`]: undefined;
452
454
  [x: `bytes8[${string}]`]: undefined;
453
455
  [x: `bytes9[${string}]`]: undefined;
454
- [x: `bytes10[${string}]`]: undefined;
455
456
  [x: `bytes11[${string}]`]: undefined;
456
457
  [x: `bytes12[${string}]`]: undefined;
457
458
  [x: `bytes13[${string}]`]: undefined;
@@ -544,6 +545,7 @@ declare class AcpContractClient {
544
545
  bool?: undefined;
545
546
  bytes4?: undefined;
546
547
  bytes?: undefined;
548
+ bytes10?: undefined;
547
549
  bytes1?: undefined;
548
550
  bytes6?: undefined;
549
551
  bytes18?: undefined;
@@ -553,7 +555,6 @@ declare class AcpContractClient {
553
555
  bytes7?: undefined;
554
556
  bytes8?: undefined;
555
557
  bytes9?: undefined;
556
- bytes10?: undefined;
557
558
  bytes11?: undefined;
558
559
  bytes12?: undefined;
559
560
  bytes13?: undefined;
@@ -7752,6 +7753,7 @@ declare class AcpContractClient {
7752
7753
  [x: `bool[${string}]`]: undefined;
7753
7754
  [x: `bytes4[${string}]`]: undefined;
7754
7755
  [x: `bytes[${string}]`]: undefined;
7756
+ [x: `bytes10[${string}]`]: undefined;
7755
7757
  [x: `bytes1[${string}]`]: undefined;
7756
7758
  [x: `bytes6[${string}]`]: undefined;
7757
7759
  [x: `bytes18[${string}]`]: undefined;
@@ -7761,7 +7763,6 @@ declare class AcpContractClient {
7761
7763
  [x: `bytes7[${string}]`]: undefined;
7762
7764
  [x: `bytes8[${string}]`]: undefined;
7763
7765
  [x: `bytes9[${string}]`]: undefined;
7764
- [x: `bytes10[${string}]`]: undefined;
7765
7766
  [x: `bytes11[${string}]`]: undefined;
7766
7767
  [x: `bytes12[${string}]`]: undefined;
7767
7768
  [x: `bytes13[${string}]`]: undefined;
@@ -7854,6 +7855,7 @@ declare class AcpContractClient {
7854
7855
  bool?: undefined;
7855
7856
  bytes4?: undefined;
7856
7857
  bytes?: undefined;
7858
+ bytes10?: undefined;
7857
7859
  bytes1?: undefined;
7858
7860
  bytes6?: undefined;
7859
7861
  bytes18?: undefined;
@@ -7863,7 +7865,6 @@ declare class AcpContractClient {
7863
7865
  bytes7?: undefined;
7864
7866
  bytes8?: undefined;
7865
7867
  bytes9?: undefined;
7866
- bytes10?: undefined;
7867
7868
  bytes11?: undefined;
7868
7869
  bytes12?: undefined;
7869
7870
  bytes13?: undefined;
@@ -8203,6 +8204,7 @@ declare class AcpContractClient {
8203
8204
  [x: `bool[${string}]`]: undefined;
8204
8205
  [x: `bytes4[${string}]`]: undefined;
8205
8206
  [x: `bytes[${string}]`]: undefined;
8207
+ [x: `bytes10[${string}]`]: undefined;
8206
8208
  [x: `bytes1[${string}]`]: undefined;
8207
8209
  [x: `bytes6[${string}]`]: undefined;
8208
8210
  [x: `bytes18[${string}]`]: undefined;
@@ -8212,7 +8214,6 @@ declare class AcpContractClient {
8212
8214
  [x: `bytes7[${string}]`]: undefined;
8213
8215
  [x: `bytes8[${string}]`]: undefined;
8214
8216
  [x: `bytes9[${string}]`]: undefined;
8215
- [x: `bytes10[${string}]`]: undefined;
8216
8217
  [x: `bytes11[${string}]`]: undefined;
8217
8218
  [x: `bytes12[${string}]`]: undefined;
8218
8219
  [x: `bytes13[${string}]`]: undefined;
@@ -8305,6 +8306,7 @@ declare class AcpContractClient {
8305
8306
  bool?: undefined;
8306
8307
  bytes4?: undefined;
8307
8308
  bytes?: undefined;
8309
+ bytes10?: undefined;
8308
8310
  bytes1?: undefined;
8309
8311
  bytes6?: undefined;
8310
8312
  bytes18?: undefined;
@@ -8314,7 +8316,6 @@ declare class AcpContractClient {
8314
8316
  bytes7?: undefined;
8315
8317
  bytes8?: undefined;
8316
8318
  bytes9?: undefined;
8317
- bytes10?: undefined;
8318
8319
  bytes11?: undefined;
8319
8320
  bytes12?: undefined;
8320
8321
  bytes13?: undefined;
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ var require_package = __commonJS({
72
72
  "package.json"(exports2, module2) {
73
73
  module2.exports = {
74
74
  name: "@virtuals-protocol/acp-node",
75
- version: "0.2.0-beta.12",
75
+ version: "0.2.0-beta.11",
76
76
  main: "./dist/index.js",
77
77
  module: "./dist/index.mjs",
78
78
  types: "./dist/index.d.ts",
@@ -1939,6 +1939,9 @@ var Fare = class {
1939
1939
  this.contractAddress = contractAddress;
1940
1940
  this.decimals = decimals;
1941
1941
  }
1942
+ maxAmount() {
1943
+ return BigInt(Number.MAX_SAFE_INTEGER) * BigInt(10 ** this.decimals);
1944
+ }
1942
1945
  formatAmount(amount) {
1943
1946
  return (0, import_viem.parseUnits)(amount.toString(), this.decimals);
1944
1947
  }
@@ -2586,7 +2589,8 @@ var AcpJob = class {
2586
2589
  }
2587
2590
  return yield this.acpClient.payJob(
2588
2591
  this.id,
2589
- this.baseFare.formatAmount(amount),
2592
+ // this.baseFare.formatAmount(amount),
2593
+ this.baseFare.maxAmount(),
2590
2594
  memo.id,
2591
2595
  reason
2592
2596
  );
@@ -2746,7 +2750,8 @@ var AcpJob = class {
2746
2750
  return yield this.acpClient.responseFundsRequest(
2747
2751
  memo.id,
2748
2752
  accept,
2749
- this.baseFare.formatAmount(payload.data.amount),
2753
+ // this.baseFare.formatAmount(payload.data.amount),
2754
+ this.baseFare.maxAmount(),
2750
2755
  reason
2751
2756
  );
2752
2757
  });
@@ -3298,13 +3303,13 @@ var AcpClient = class {
3298
3303
  const isFeeTokenDifferent = feeFareAmount.fare.contractAddress !== transferFareAmount.fare.contractAddress;
3299
3304
  if (isFeeTokenDifferent) {
3300
3305
  yield this.acpContractClient.approveAllowance(
3301
- feeFareAmount.amount,
3306
+ feeFareAmount.fare.maxAmount(),
3302
3307
  feeFareAmount.fare.contractAddress
3303
3308
  );
3304
3309
  }
3305
3310
  const finalAmount = isFeeTokenDifferent ? transferFareAmount : transferFareAmount.add(feeFareAmount);
3306
3311
  yield this.acpContractClient.approveAllowance(
3307
- finalAmount.amount,
3312
+ finalAmount.fare.maxAmount(),
3308
3313
  transferFareAmount.fare.contractAddress
3309
3314
  );
3310
3315
  return yield this.acpContractClient.createPayableMemo(
package/dist/index.mjs CHANGED
@@ -47,7 +47,7 @@ var require_package = __commonJS({
47
47
  "package.json"(exports, module) {
48
48
  module.exports = {
49
49
  name: "@virtuals-protocol/acp-node",
50
- version: "0.2.0-beta.12",
50
+ version: "0.2.0-beta.11",
51
51
  main: "./dist/index.js",
52
52
  module: "./dist/index.mjs",
53
53
  types: "./dist/index.d.ts",
@@ -1888,6 +1888,9 @@ var Fare = class {
1888
1888
  this.contractAddress = contractAddress;
1889
1889
  this.decimals = decimals;
1890
1890
  }
1891
+ maxAmount() {
1892
+ return BigInt(Number.MAX_SAFE_INTEGER) * BigInt(10 ** this.decimals);
1893
+ }
1891
1894
  formatAmount(amount) {
1892
1895
  return parseUnits(amount.toString(), this.decimals);
1893
1896
  }
@@ -2535,7 +2538,8 @@ var AcpJob = class {
2535
2538
  }
2536
2539
  return yield this.acpClient.payJob(
2537
2540
  this.id,
2538
- this.baseFare.formatAmount(amount),
2541
+ // this.baseFare.formatAmount(amount),
2542
+ this.baseFare.maxAmount(),
2539
2543
  memo.id,
2540
2544
  reason
2541
2545
  );
@@ -2695,7 +2699,8 @@ var AcpJob = class {
2695
2699
  return yield this.acpClient.responseFundsRequest(
2696
2700
  memo.id,
2697
2701
  accept,
2698
- this.baseFare.formatAmount(payload.data.amount),
2702
+ // this.baseFare.formatAmount(payload.data.amount),
2703
+ this.baseFare.maxAmount(),
2699
2704
  reason
2700
2705
  );
2701
2706
  });
@@ -3247,13 +3252,13 @@ var AcpClient = class {
3247
3252
  const isFeeTokenDifferent = feeFareAmount.fare.contractAddress !== transferFareAmount.fare.contractAddress;
3248
3253
  if (isFeeTokenDifferent) {
3249
3254
  yield this.acpContractClient.approveAllowance(
3250
- feeFareAmount.amount,
3255
+ feeFareAmount.fare.maxAmount(),
3251
3256
  feeFareAmount.fare.contractAddress
3252
3257
  );
3253
3258
  }
3254
3259
  const finalAmount = isFeeTokenDifferent ? transferFareAmount : transferFareAmount.add(feeFareAmount);
3255
3260
  yield this.acpContractClient.approveAllowance(
3256
- finalAmount.amount,
3261
+ finalAmount.fare.maxAmount(),
3257
3262
  transferFareAmount.fare.contractAddress
3258
3263
  );
3259
3264
  return yield this.acpContractClient.createPayableMemo(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virtuals-protocol/acp-node",
3
- "version": "0.2.0-beta.12",
3
+ "version": "0.2.0-beta.13",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",