@steerprotocol/app-loader 1.0.3 → 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.
Files changed (2) hide show
  1. package/lib/index.js +13 -0
  2. package/package.json +2 -1
package/lib/index.js CHANGED
@@ -33,6 +33,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.loadWasm = exports.loadWasmSync = exports.RawTradeData = exports.Candle = void 0;
36
+ const ethers_1 = require("ethers");
36
37
  const Candle_1 = require("./Candle");
37
38
  Object.defineProperty(exports, "Candle", { enumerable: true, get: function () { return Candle_1.Candle; } });
38
39
  const RawTradeData_1 = require("./RawTradeData");
@@ -104,6 +105,18 @@ function instantiate(module, imports = {}) {
104
105
  console.log(__liftString(text));
105
106
  },
106
107
  },
108
+ ethers: {
109
+ keccak256_str(str_ptr) {
110
+ const str = __liftString(str_ptr);
111
+ const hash = ethers_1.ethers.keccak256(str);
112
+ return __lowerString(hash);
113
+ },
114
+ keccak256_buf(buf_ptr) {
115
+ const buf = __liftBuffer(buf_ptr);
116
+ const hash = ethers_1.ethers.keccak256(new Uint8Array(buf));
117
+ return __lowerString(hash);
118
+ }
119
+ },
107
120
  // @ts-ignore
108
121
  env: {
109
122
  abort(message, fileName, lineNumber, columnNumber) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steerprotocol/app-loader",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "App Loader for Steer Protocol",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -47,6 +47,7 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "ccxt": "^4.1.19",
50
+ "ethers": "^6.12.1",
50
51
  "timestring": "^7.0.0",
51
52
  "undici": "^5.26.4"
52
53
  }