Small updates

This commit is contained in:
Mikhail Gladchenko
2023-03-02 14:04:36 +00:00
parent 9b3c2406f0
commit 853f6b5a13
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.17.25-rc.5",
"version": "0.17.25-rc.6",
"description": "Orion Protocol SDK",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",

View File

@@ -1,6 +1,6 @@
import type { TypedDataSigner } from '@ethersproject/abstract-signer';
import BigNumber from 'bignumber.js';
import { ethers } from 'ethers';
import type { ethers } from 'ethers';
import { joinSignature, splitSignature } from 'ethers/lib/utils';
import { INTERNAL_ORION_PRECISION } from '../constants';
import type { CFDOrder, SignedCFDOrder, SupportedChainId } from '../types';
@@ -45,8 +45,8 @@ export const signCFDOrder = async (
INTERNAL_ORION_PRECISION,
BigNumber.ROUND_FLOOR,
).toNumber());
console.log('ethers.BigNumber.from(stopPrice)', ethers.BigNumber.from(stopPrice?.toString()));
console.log('ethers.BigNumber.from(stopPrice).toNumber()', ethers.BigNumber.from(stopPrice?.toString()).toNumber());
// console.log('ethers.BigNumber.from(stopPrice)', ethers.BigNumber.from(stopPrice?.toString()));
// console.log('ethers.BigNumber.from(stopPrice).toNumber()', ethers.BigNumber.from(stopPrice?.toString()).toNumber());
const order: CFDOrder = {
senderAddress,
@@ -71,7 +71,7 @@ export const signCFDOrder = async (
expiration,
buySide: side === 'BUY' ? 1 : 0,
stopPrice: stopPrice !== undefined
? ethers.BigNumber.from(stopPrice?.toString()).toNumber()
? new BigNumber(stopPrice).toNumber()
: undefined,
isPersonalSign: usePersonalSign,
};