mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-17 00:31:34 +03:00
@@ -1,4 +1,4 @@
|
||||
import { SupportedChainId } from '../types';
|
||||
import { type SupportedChainId } from '../types';
|
||||
import eip712DomainData from '../config/eip712DomainData.json';
|
||||
import eip712DomainSchema from '../config/schemas/eip712DomainSchema';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ethers } from 'ethers';
|
||||
import { CFDOrder } from '../types';
|
||||
import { type CFDOrder } from '../types';
|
||||
|
||||
const hashCFDOrder = (order: CFDOrder) => ethers.utils.solidityKeccak256(
|
||||
[
|
||||
@@ -24,7 +24,7 @@ const hashCFDOrder = (order: CFDOrder) => ethers.utils.solidityKeccak256(
|
||||
order.matcherFee,
|
||||
order.nonce,
|
||||
order.expiration,
|
||||
order.buySide ? '0x01' : '0x00',
|
||||
order.buySide === 1 ? '0x01' : '0x00',
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ethers } from 'ethers';
|
||||
import { Order } from '../types';
|
||||
import { type Order } from '../types';
|
||||
|
||||
const hashOrder = (order: Order) => ethers.utils.solidityKeccak256(
|
||||
[
|
||||
@@ -28,7 +28,7 @@ const hashOrder = (order: Order) => ethers.utils.solidityKeccak256(
|
||||
order.matcherFee,
|
||||
order.nonce,
|
||||
order.expiration,
|
||||
order.buySide ? '0x01' : '0x00',
|
||||
order.buySide === 1 ? '0x01' : '0x00',
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
import { TypedDataSigner } from '@ethersproject/abstract-signer';
|
||||
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 { CFDOrder, SignedCFDOrder, SupportedChainId } from '../types';
|
||||
import { type CFDOrder, type SignedCFDOrder, type SupportedChainId } from '../types';
|
||||
import normalizeNumber from '../utils/normalizeNumber';
|
||||
import getDomainData from './getDomainData';
|
||||
import signCFDOrderPersonal from './signCFDOrderPersonal';
|
||||
@@ -69,7 +68,7 @@ export const signCFDOrder = async (
|
||||
// "Signature's v was always send as 27 or 28, but from Ledger was 0 or 1"
|
||||
const fixedSignature = joinSignature(splitSignature(signature));
|
||||
|
||||
if (!fixedSignature) throw new Error("Can't sign order");
|
||||
// if (!fixedSignature) throw new Error("Can't sign order");
|
||||
|
||||
const signedOrder: SignedCFDOrder = {
|
||||
...order,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ethers } from 'ethers';
|
||||
import { CFDOrder } from '../types';
|
||||
import { type CFDOrder } from '../types';
|
||||
|
||||
const { arrayify, joinSignature, splitSignature } = ethers.utils;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
import { TypedDataSigner } from '@ethersproject/abstract-signer';
|
||||
import { ethers } from 'ethers';
|
||||
import { type TypedDataSigner } from '@ethersproject/abstract-signer';
|
||||
import { type ethers } from 'ethers';
|
||||
import { joinSignature, splitSignature } from 'ethers/lib/utils';
|
||||
import CANCEL_ORDER_TYPES from '../constants/cancelOrderTypes';
|
||||
import { CancelOrderRequest, SignedCancelOrderRequest, SupportedChainId } from '../types';
|
||||
import { type CancelOrderRequest, type SignedCancelOrderRequest, type SupportedChainId } from '../types';
|
||||
import getDomainData from './getDomainData';
|
||||
import signCancelOrderPersonal from './signCancelOrderPersonal';
|
||||
|
||||
@@ -37,7 +36,7 @@ const signCancelOrder = async (
|
||||
// "Signature's v was always send as 27 or 28, but from Ledger was 0 or 1"
|
||||
const fixedSignature = joinSignature(splitSignature(signature));
|
||||
|
||||
if (!fixedSignature) throw new Error("Can't sign order cancel");
|
||||
// if (!fixedSignature) throw new Error("Can't sign order cancel");
|
||||
|
||||
const signedCancelOrderReqeust: SignedCancelOrderRequest = {
|
||||
...cancelOrderRequest,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ethers } from 'ethers';
|
||||
import { arrayify, joinSignature, splitSignature } from 'ethers/lib/utils';
|
||||
import { CancelOrderRequest } from '../types';
|
||||
import { type CancelOrderRequest } from '../types';
|
||||
|
||||
const signCancelOrderPersonal = async (
|
||||
cancelOrderRequest: CancelOrderRequest,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
import { TypedDataSigner } from '@ethersproject/abstract-signer';
|
||||
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 ORDER_TYPES from '../constants/orderTypes';
|
||||
import { Order, SignedOrder, SupportedChainId } from '../types';
|
||||
import { type Order, type SignedOrder, type SupportedChainId } from '../types';
|
||||
import normalizeNumber from '../utils/normalizeNumber';
|
||||
import getDomainData from './getDomainData';
|
||||
import hashOrder from './hashOrder';
|
||||
@@ -74,7 +73,7 @@ export const signOrder = async (
|
||||
// "Signature's v was always send as 27 or 28, but from Ledger was 0 or 1"
|
||||
const fixedSignature = joinSignature(splitSignature(signature));
|
||||
|
||||
if (!fixedSignature) throw new Error("Can't sign order");
|
||||
// if (!fixedSignature) throw new Error("Can't sign order");
|
||||
|
||||
const signedOrder: SignedOrder = {
|
||||
...order,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ethers } from 'ethers';
|
||||
import { Order } from '../types';
|
||||
import { type Order } from '../types';
|
||||
|
||||
const { arrayify, joinSignature, splitSignature } = ethers.utils;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user