payid 0.4.8 → 0.5.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.
@@ -2,7 +2,7 @@ import {
2
2
  evaluate,
3
3
  generateDecisionProof,
4
4
  resolveRule
5
- } from "./chunk-TIK4HPDU.js";
5
+ } from "./chunk-UBYKCXWR.js";
6
6
  import {
7
7
  __export
8
8
  } from "./chunk-R5U7XKVJ.js";
@@ -4,7 +4,7 @@ import {
4
4
  issueRiskContext,
5
5
  issueStateContext,
6
6
  signAttestation
7
- } from "./chunk-7U3P7XJE.js";
7
+ } from "./chunk-YKCMGGYB.js";
8
8
  import {
9
9
  __export
10
10
  } from "./chunk-R5U7XKVJ.js";
@@ -3,7 +3,7 @@ import {
3
3
  issueOracleContext,
4
4
  issueRiskContext,
5
5
  issueStateContext
6
- } from "./chunk-7U3P7XJE.js";
6
+ } from "./chunk-YKCMGGYB.js";
7
7
  import {
8
8
  __export
9
9
  } from "./chunk-R5U7XKVJ.js";
@@ -239,11 +239,14 @@ function stableStringify(obj) {
239
239
  }
240
240
  return JSON.stringify(obj);
241
241
  }
242
+ function toUtf8Bytes(str) {
243
+ return new TextEncoder().encode(str);
244
+ }
242
245
  function hashContext(context) {
243
- return keccak256(Buffer.from(stableStringify(context)));
246
+ return keccak256(toUtf8Bytes(stableStringify(context)));
244
247
  }
245
248
  function hashRuleSet(ruleConfig) {
246
- return keccak256(Buffer.from(stableStringify(ruleConfig)));
249
+ return keccak256(toUtf8Bytes(stableStringify(ruleConfig)));
247
250
  }
248
251
 
249
252
  // src/decision-proof/generate.ts
@@ -8,7 +8,7 @@ import {
8
8
  evaluate,
9
9
  generateDecisionProof,
10
10
  resolveRule
11
- } from "./chunk-TIK4HPDU.js";
11
+ } from "./chunk-UBYKCXWR.js";
12
12
  import {
13
13
  __export
14
14
  } from "./chunk-R5U7XKVJ.js";
@@ -1,5 +1,5 @@
1
1
  // src/issuer/signAttestation.ts
2
- import { keccak256, toUtf8Bytes } from "ethers";
2
+ import { keccak256, toUtf8Bytes, getBytes } from "ethers";
3
3
  async function signAttestation(issuerWallet, payload, ttlSeconds = 60) {
4
4
  const issuedAt = Math.floor(Date.now() / 1e3);
5
5
  const expiresAt = issuedAt + ttlSeconds;
@@ -7,7 +7,7 @@ async function signAttestation(issuerWallet, payload, ttlSeconds = 60) {
7
7
  toUtf8Bytes(JSON.stringify(payload))
8
8
  );
9
9
  const signature = await issuerWallet.signMessage(
10
- Buffer.from(hash.slice(2), "hex")
10
+ getBytes(hash)
11
11
  );
12
12
  return {
13
13
  issuer: issuerWallet.address,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildContextV2
3
- } from "../chunk-RCXMRX4F.js";
4
- import "../chunk-7U3P7XJE.js";
3
+ } from "../chunk-RICUEGTH.js";
4
+ import "../chunk-YKCMGGYB.js";
5
5
  import "../chunk-R5U7XKVJ.js";
6
6
  export {
7
7
  buildContextV2
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createPayID
3
- } from "../../chunk-E262BLMV.js";
3
+ } from "../../chunk-YGCGT2JP.js";
4
4
  import "../../chunk-GG34PNTF.js";
5
5
  import "../../chunk-MXKZJKXE.js";
6
6
  import "../../chunk-6VPSJFO4.js";
7
- import "../../chunk-TIK4HPDU.js";
7
+ import "../../chunk-UBYKCXWR.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-K2FSXHVA.js";
4
- import "../../chunk-TIK4HPDU.js";
3
+ } from "../../chunk-4RDYA3QD.js";
4
+ import "../../chunk-UBYKCXWR.js";
5
5
  import "../../chunk-5ZEKI5Y2.js";
6
6
  import "../../chunk-R5U7XKVJ.js";
7
7
  export {
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  context_exports
3
- } from "./chunk-RCXMRX4F.js";
3
+ } from "./chunk-RICUEGTH.js";
4
4
  import {
5
5
  issuer_exports
6
- } from "./chunk-AOKLY2QN.js";
7
- import "./chunk-7U3P7XJE.js";
6
+ } from "./chunk-J3SM3HWZ.js";
7
+ import "./chunk-YKCMGGYB.js";
8
8
  import {
9
9
  rule_exports
10
10
  } from "./chunk-ILV7Z3IN.js";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-Y75PSD7U.js";
14
14
  import {
15
15
  client_exports
16
- } from "./chunk-E262BLMV.js";
16
+ } from "./chunk-YGCGT2JP.js";
17
17
  import "./chunk-GG34PNTF.js";
18
18
  import "./chunk-MXKZJKXE.js";
19
19
  import "./chunk-6VPSJFO4.js";
@@ -22,12 +22,12 @@ import {
22
22
  buildPayETHCallData,
23
23
  buildUserOperation,
24
24
  server_exports
25
- } from "./chunk-K2FSXHVA.js";
25
+ } from "./chunk-4RDYA3QD.js";
26
26
  import {
27
27
  evaluate,
28
28
  generateDecisionProof,
29
29
  resolveRule
30
- } from "./chunk-TIK4HPDU.js";
30
+ } from "./chunk-UBYKCXWR.js";
31
31
  import "./chunk-5ZEKI5Y2.js";
32
32
  import {
33
33
  __export
@@ -1,11 +1,11 @@
1
- import "../chunk-AOKLY2QN.js";
1
+ import "../chunk-J3SM3HWZ.js";
2
2
  import {
3
3
  issueEnvContext,
4
4
  issueOracleContext,
5
5
  issueRiskContext,
6
6
  issueStateContext,
7
7
  signAttestation
8
- } from "../chunk-7U3P7XJE.js";
8
+ } from "../chunk-YKCMGGYB.js";
9
9
  import "../chunk-R5U7XKVJ.js";
10
10
  export {
11
11
  issueEnvContext,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payid",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
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.2.9",
40
+ "payid-rule-engine": "^0.3.0",
41
41
  "payid-types": "^0.1.9"
42
42
  },
43
43
  "files": [