payid 0.3.7 → 0.3.9

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.
@@ -208,7 +208,7 @@ var hash = (v) => ethers.keccak256(ethers.toUtf8Bytes(v));
208
208
  async function generateDecisionProof(params) {
209
209
  const now = Math.floor(Date.now() / 1e3);
210
210
  const expiresAt = now + (params.ttlSeconds ?? 60);
211
- const network = await params.signer.provider.getNetwork();
211
+ const chainId = params.chainId ?? Number((await params.signer.provider.getNetwork()).chainId);
212
212
  const requiresAttestation = Array.isArray(params.ruleConfig?.requires) && params.ruleConfig.requires.length > 0;
213
213
  const payload = {
214
214
  version: hash("2"),
@@ -228,7 +228,8 @@ async function generateDecisionProof(params) {
228
228
  const domain = {
229
229
  name: "PAY.ID Decision",
230
230
  version: "2",
231
- chainId: Number(network.chainId),
231
+ chainId,
232
+ // FIX: langsung pakai, tidak perlu await lagi
232
233
  verifyingContract: params.verifyingContract
233
234
  };
234
235
  const types = {
@@ -2,7 +2,7 @@ import {
2
2
  evaluate,
3
3
  generateDecisionProof,
4
4
  resolveRule
5
- } from "./chunk-AXFEJV2K.js";
5
+ } from "./chunk-METOE7DV.js";
6
6
  import {
7
7
  __export
8
8
  } from "./chunk-R5U7XKVJ.js";
@@ -99,6 +99,7 @@ var PayIDServer = class {
99
99
  signer: this.signer,
100
100
  verifyingContract: params.verifyingContract,
101
101
  ruleAuthority: params.ruleAuthority,
102
+ chainId: params.context?.tx?.chainId,
102
103
  ttlSeconds: params.ttlSeconds
103
104
  });
104
105
  return { result, proof };
@@ -8,7 +8,7 @@ import {
8
8
  evaluate,
9
9
  generateDecisionProof,
10
10
  resolveRule
11
- } from "./chunk-AXFEJV2K.js";
11
+ } from "./chunk-METOE7DV.js";
12
12
  import {
13
13
  __export
14
14
  } from "./chunk-R5U7XKVJ.js";
@@ -69,6 +69,7 @@ var PayIDClient = class {
69
69
  signer: params.signer,
70
70
  verifyingContract: params.verifyingContract,
71
71
  ruleAuthority: params.ruleAuthority,
72
+ chainId: params.context?.tx?.chainId,
72
73
  ttlSeconds: params.ttlSeconds
73
74
  });
74
75
  return { result, proof };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createPayID
3
- } from "../../chunk-2PDWRUBU.js";
3
+ } from "../../chunk-UBGZH6HB.js";
4
4
  import "../../chunk-QYH3FNQ4.js";
5
5
  import "../../chunk-MXKZJKXE.js";
6
6
  import "../../chunk-JJEWYFOV.js";
7
- import "../../chunk-AXFEJV2K.js";
7
+ import "../../chunk-METOE7DV.js";
8
8
  import "../../chunk-5ZEKI5Y2.js";
9
9
  import "../../chunk-R5U7XKVJ.js";
10
10
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPayID
3
- } from "../../chunk-VJDL2PUS.js";
4
- import "../../chunk-AXFEJV2K.js";
3
+ } from "../../chunk-SIHQPH55.js";
4
+ import "../../chunk-METOE7DV.js";
5
5
  import "../../chunk-5ZEKI5Y2.js";
6
6
  import "../../chunk-R5U7XKVJ.js";
7
7
  export {
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-ATWJEWZH.js";
14
14
  import {
15
15
  client_exports
16
- } from "./chunk-2PDWRUBU.js";
16
+ } from "./chunk-UBGZH6HB.js";
17
17
  import "./chunk-QYH3FNQ4.js";
18
18
  import "./chunk-MXKZJKXE.js";
19
19
  import "./chunk-JJEWYFOV.js";
@@ -22,12 +22,12 @@ import {
22
22
  buildPayETHCallData,
23
23
  buildUserOperation,
24
24
  server_exports
25
- } from "./chunk-VJDL2PUS.js";
25
+ } from "./chunk-SIHQPH55.js";
26
26
  import {
27
27
  evaluate,
28
28
  generateDecisionProof,
29
29
  resolveRule
30
- } from "./chunk-AXFEJV2K.js";
30
+ } from "./chunk-METOE7DV.js";
31
31
  import "./chunk-5ZEKI5Y2.js";
32
32
  import {
33
33
  __export
@@ -83,6 +83,7 @@ var PayID = class {
83
83
  signer: params.signer,
84
84
  verifyingContract: params.verifyingContract,
85
85
  ruleAuthority: params.ruleAuthority,
86
+ chainId: params.context?.tx?.chainId,
86
87
  ttlSeconds: params.ttlSeconds
87
88
  });
88
89
  return { result, proof };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payid",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "ethers": "^6.16.0",
40
- "payid-rule-engine": "^0.1.6",
40
+ "payid-rule-engine": "^0.1.7",
41
41
  "payid-types": "^0.1.7"
42
42
  },
43
43
  "files": [