fix: build

This commit is contained in:
Kirill Litvinov
2024-04-04 18:54:33 +03:00
parent 7b463dc823
commit 5e19224114
3 changed files with 14 additions and 25 deletions

17
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.79",
"version": "0.20.81",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.20.79",
"version": "0.20.81",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
@@ -40,7 +40,6 @@
"@babel/plugin-syntax-import-assertions": "^7.20.0",
"@tsconfig/esm": "^1.0.4",
"@tsconfig/strictest": "^2.0.1",
"@types/crypto-js": "^4.2.2",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.1",
"@types/node": "^20.5.1",
@@ -2547,12 +2546,6 @@
"@types/node": "*"
}
},
"node_modules/@types/crypto-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz",
"integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==",
"dev": true
},
"node_modules/@types/eslint": {
"version": "8.44.2",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz",
@@ -13617,12 +13610,6 @@
"@types/node": "*"
}
},
"@types/crypto-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz",
"integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==",
"dev": true
},
"@types/eslint": {
"version": "8.44.2",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz",

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.80",
"version": "0.20.81",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -19,10 +19,10 @@ import httpToWS from '../../utils/httpToWS.js';
import { ethers } from 'ethers';
import orderSchema from './schemas/orderSchema.js';
import { fetchWithValidation } from 'simple-typed-fetch';
import { pmmOrderSchema } from '../../Unit/Pmm/schemas/order';
// import hmacSHA256 from "crypto-js/hmac-sha256";
// import Hex from "crypto-js/enc-hex";
const crypto = require('crypto')
import {pmmOrderSchema} from "../../Unit/Pmm/schemas/order";
// const crypto = require('crypto')
class Aggregator {
private readonly apiUrl: string;
@@ -379,14 +379,16 @@ class Aggregator {
return fetchWithValidation(url.toString(), atomicSwapHistorySchema, { headers: this.basicAuthHeaders });
};
private encode_utf8(s: string) {
return unescape(encodeURIComponent(s));
}
// private encode_utf8(s: string) {
// return unescape(encodeURIComponent(s));
// }
private sign(message : string, key: string) {
return crypto.createHmac('sha256', this.encode_utf8(key))
.update(this.encode_utf8(message))
.digest('hex');
// @ts-expect-error: TODO: please remove this line!
private sign(message: string, key: string) {
// return crypto.createHmac('sha256', this.encode_utf8(key))
// .update(this.encode_utf8(message))
// .digest('hex');
return '';
}
private generateHeaders(body: any, method: string, path: string, timestamp: number, apiKey: string, secretKey: string) {