@ic-reactor/core 1.7.0 → 1.7.1

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/README.md CHANGED
@@ -19,7 +19,7 @@ yarn add @ic-reactor/core
19
19
  or you can use the UMD version:
20
20
 
21
21
  ```html
22
- <script src="https://github.com/B3Pay/ic-reactor/releases/download/v1.6.5/ic-reactor-core.min.js"></script>
22
+ <script src="https://github.com/B3Pay/ic-reactor/releases/download/v1.7.0/ic-reactor-core.min.js"></script>
23
23
  ```
24
24
 
25
25
  ### Using `createReactorCore`
@@ -47,15 +47,8 @@ const jsonToString = (json, space = 2) => {
47
47
  };
48
48
  exports.jsonToString = jsonToString;
49
49
  const generateRequestHash = (args = []) => {
50
- const serializedArgs = args
51
- .map((arg) => {
52
- if (typeof arg === "bigint") {
53
- return arg.toString();
54
- }
55
- return JSON.stringify(arg);
56
- })
57
- .join("|");
58
- return (0, exports.stringToHash)(serializedArgs !== null && serializedArgs !== void 0 ? serializedArgs : "");
50
+ const serializedArgs = (0, agent_1.hashValue)(args);
51
+ return `0x${(0, agent_1.toHex)(serializedArgs)}`;
59
52
  };
60
53
  exports.generateRequestHash = generateRequestHash;
61
54
  const generateHash = (field) => {
@@ -74,5 +67,5 @@ const stringToHash = (str) => {
74
67
  };
75
68
  exports.stringToHash = stringToHash;
76
69
  function toHexString(bytes) {
77
- return new Uint8Array(bytes).reduce((str, byte) => str + byte.toString(16).padStart(2, "0"), "");
70
+ return (0, agent_1.toHex)(bytes);
78
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/core",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "A library for intracting with the Internet Computer canisters",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -56,5 +56,5 @@
56
56
  "engines": {
57
57
  "node": ">=10"
58
58
  },
59
- "gitHead": "0fac1036d11ae1b2498e6568d5eff514bd657116"
59
+ "gitHead": "d4013e2399602abb8646efad8bb564934a254b23"
60
60
  }