@perkos/scheme-deferred 1.0.0 → 1.1.0
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/index.mjs +4 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Hex, DeferredPayload, PaymentRequirements, VerifyResponse, Voucher } from '@perkos/types-x402';
|
|
2
|
-
export { Address, DeferredPayload, Hex, PaymentRequirements, VerifyResponse, Voucher } from '@perkos/types-x402';
|
|
2
|
+
export { Address, DeferredPayload, Hex, PaymentRequirements, VerifyResponse, Voucher, getPaymentAmount } from '@perkos/types-x402';
|
|
3
3
|
import { SupportedNetwork } from '@perkos/util-chains';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Hex, DeferredPayload, PaymentRequirements, VerifyResponse, Voucher } from '@perkos/types-x402';
|
|
2
|
-
export { Address, DeferredPayload, Hex, PaymentRequirements, VerifyResponse, Voucher } from '@perkos/types-x402';
|
|
2
|
+
export { Address, DeferredPayload, Hex, PaymentRequirements, VerifyResponse, Voucher, getPaymentAmount } from '@perkos/types-x402';
|
|
3
3
|
import { SupportedNetwork } from '@perkos/util-chains';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/index.js
CHANGED
|
@@ -32,11 +32,14 @@ __export(index_exports, {
|
|
|
32
32
|
createVoucherMessage: () => createVoucherMessage,
|
|
33
33
|
createVoucherTuple: () => createVoucherTuple,
|
|
34
34
|
generateVoucherId: () => generateVoucherId,
|
|
35
|
+
getPaymentAmount: () => import_types_x4022.getPaymentAmount,
|
|
35
36
|
parseSignature: () => parseSignature
|
|
36
37
|
});
|
|
37
38
|
module.exports = __toCommonJS(index_exports);
|
|
38
39
|
var import_viem = require("viem");
|
|
40
|
+
var import_types_x402 = require("@perkos/types-x402");
|
|
39
41
|
var import_util_chains = require("@perkos/util-chains");
|
|
42
|
+
var import_types_x4022 = require("@perkos/types-x402");
|
|
40
43
|
var VOUCHER_TYPE_DEF = [
|
|
41
44
|
{ name: "id", type: "bytes32" },
|
|
42
45
|
{ name: "buyer", type: "address" },
|
|
@@ -212,7 +215,7 @@ var DeferredSchemeVerifier = class {
|
|
|
212
215
|
return false;
|
|
213
216
|
}
|
|
214
217
|
const valueAggregate = BigInt(voucher.valueAggregate);
|
|
215
|
-
const maxAmount = BigInt(
|
|
218
|
+
const maxAmount = BigInt((0, import_types_x402.getPaymentAmount)(requirements));
|
|
216
219
|
if (valueAggregate > maxAmount) {
|
|
217
220
|
return false;
|
|
218
221
|
}
|
|
@@ -372,5 +375,6 @@ function createVoucherTuple(voucher) {
|
|
|
372
375
|
createVoucherMessage,
|
|
373
376
|
createVoucherTuple,
|
|
374
377
|
generateVoucherId,
|
|
378
|
+
getPaymentAmount,
|
|
375
379
|
parseSignature
|
|
376
380
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -4,11 +4,13 @@ import {
|
|
|
4
4
|
http,
|
|
5
5
|
recoverTypedDataAddress
|
|
6
6
|
} from "viem";
|
|
7
|
+
import { getPaymentAmount } from "@perkos/types-x402";
|
|
7
8
|
import {
|
|
8
9
|
getChainById,
|
|
9
10
|
getChainIdFromNetwork,
|
|
10
11
|
getRpcUrl
|
|
11
12
|
} from "@perkos/util-chains";
|
|
13
|
+
import { getPaymentAmount as getPaymentAmount2 } from "@perkos/types-x402";
|
|
12
14
|
var VOUCHER_TYPE_DEF = [
|
|
13
15
|
{ name: "id", type: "bytes32" },
|
|
14
16
|
{ name: "buyer", type: "address" },
|
|
@@ -184,7 +186,7 @@ var DeferredSchemeVerifier = class {
|
|
|
184
186
|
return false;
|
|
185
187
|
}
|
|
186
188
|
const valueAggregate = BigInt(voucher.valueAggregate);
|
|
187
|
-
const maxAmount = BigInt(requirements
|
|
189
|
+
const maxAmount = BigInt(getPaymentAmount(requirements));
|
|
188
190
|
if (valueAggregate > maxAmount) {
|
|
189
191
|
return false;
|
|
190
192
|
}
|
|
@@ -343,5 +345,6 @@ export {
|
|
|
343
345
|
createVoucherMessage,
|
|
344
346
|
createVoucherTuple,
|
|
345
347
|
generateVoucherId,
|
|
348
|
+
getPaymentAmount2 as getPaymentAmount,
|
|
346
349
|
parseSignature
|
|
347
350
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perkos/scheme-deferred",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "EIP-712 Voucher-based deferred payment verification utilities for x402 deferred scheme",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"url": "https://github.com/PerkOS-xyz/pkg-scheme-deferred"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@perkos/types-x402": "^1.
|
|
39
|
+
"@perkos/types-x402": "^1.1.0",
|
|
40
40
|
"@perkos/util-chains": "^1.0.0",
|
|
41
41
|
"viem": "^2.28.2"
|
|
42
42
|
},
|