mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-22 21:59:44 +03:00
removed crypto-js dependency
This commit is contained in:
@@ -19,8 +19,9 @@ import httpToWS from '../../utils/httpToWS.js';
|
|||||||
import { ethers } from 'ethers';
|
import { ethers } from 'ethers';
|
||||||
import orderSchema from './schemas/orderSchema.js';
|
import orderSchema from './schemas/orderSchema.js';
|
||||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||||
import hmacSHA256 from "crypto-js/hmac-sha256";
|
// import hmacSHA256 from "crypto-js/hmac-sha256";
|
||||||
import Hex from "crypto-js/enc-hex";
|
// import Hex from "crypto-js/enc-hex";
|
||||||
|
const crypto = require('crypto')
|
||||||
import {pmmOrderSchema} from "../../Unit/Pmm/schemas/order";
|
import {pmmOrderSchema} from "../../Unit/Pmm/schemas/order";
|
||||||
|
|
||||||
class Aggregator {
|
class Aggregator {
|
||||||
@@ -379,10 +380,9 @@ class Aggregator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private sign(message : string, key: string) {
|
private sign(message : string, key: string) {
|
||||||
return hmacSHA256(
|
return crypto.createHmac('sha256', this.encode_utf8(key))
|
||||||
this.encode_utf8(message),
|
.update(this.encode_utf8(message))
|
||||||
this.encode_utf8(key)
|
.digest('hex');
|
||||||
).toString(Hex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private generateHeaders(body : any, method : string, path : string, timestamp : number, apiKey : string, secretKey : string) {
|
private generateHeaders(body : any, method : string, path : string, timestamp : number, apiKey : string, secretKey : string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user