mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-17 00:31:34 +03:00
remove ledger signature
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ethers } from 'ethers';
|
||||
import type { ethers } from 'ethers';
|
||||
import CANCEL_ORDER_TYPES from '../constants/cancelOrderTypes.js';
|
||||
import type { CancelOrderRequest, SignedCancelOrderRequest, SupportedChainId } from '../types.js';
|
||||
import getDomainData from './getDomainData.js';
|
||||
@@ -20,15 +20,9 @@ const signCancelOrder = async (
|
||||
cancelOrderRequest,
|
||||
);
|
||||
|
||||
// https://github.com/poap-xyz/poap-fun/pull/62#issue-928290265
|
||||
// "Signature's v was always send as 27 or 28, but from Ledger was 0 or 1"
|
||||
const fixedSignature = ethers.Signature.from(signature).serialized;
|
||||
|
||||
// if (!fixedSignature) throw new Error("Can't sign order cancel");
|
||||
|
||||
const signedCancelOrderReqeust: SignedCancelOrderRequest = {
|
||||
...cancelOrderRequest,
|
||||
signature: fixedSignature,
|
||||
signature,
|
||||
};
|
||||
return signedCancelOrderReqeust;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import { ethers, keccak256 } from 'ethers';
|
||||
import type { ethers } from 'ethers';
|
||||
import { keccak256 } from 'ethers';
|
||||
import { INTERNAL_PROTOCOL_PRECISION } from '../constants';
|
||||
import { CROSS_CHAIN_ORDER_TYPES } from '../constants/orderTypes/orderTypes';
|
||||
import type { Order, SignedCrossChainOrder, SupportedChainId } from '../types.js';
|
||||
@@ -87,14 +88,9 @@ export const signCrossChainOrder = async ({
|
||||
crossChainOrder
|
||||
);
|
||||
|
||||
// https://github.com/poap-xyz/poap-fun/pull/62#issue-928290265
|
||||
// "Signature's v was always send as 27 or 28, but from Ledger was 0 or 1"
|
||||
const fixedSignature = ethers.Signature.from(signature).serialized;
|
||||
|
||||
// if (!fixedSignature) throw new Error("Can't sign order");
|
||||
const signedOrderWithoutId: Omit<SignedCrossChainOrder, 'id'> = {
|
||||
...order,
|
||||
signature: fixedSignature,
|
||||
signature,
|
||||
secret,
|
||||
secretHash,
|
||||
targetChainId: Number(targetChainId),
|
||||
|
||||
@@ -50,15 +50,9 @@ export const signLockOrder = async ({
|
||||
order,
|
||||
);
|
||||
|
||||
// https://github.com/poap-xyz/poap-fun/pull/62#issue-928290265
|
||||
// "Signature's v was always send as 27 or 28, but from Ledger was 0 or 1"
|
||||
const fixedSignature = ethers.Signature.from(signature).serialized;
|
||||
|
||||
// if (!fixedSignature) throw new Error("Can't sign order");
|
||||
|
||||
const signedOrder: SignedLockOrder = {
|
||||
...order,
|
||||
signature: fixedSignature,
|
||||
signature,
|
||||
secret,
|
||||
secretHash
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import { ethers } from 'ethers';
|
||||
import type { ethers } from 'ethers';
|
||||
import { INTERNAL_PROTOCOL_PRECISION, ORDER_TYPES } from '../constants';
|
||||
import type { Order, SignedOrder, SupportedChainId } from '../types.js';
|
||||
import normalizeNumber from '../utils/normalizeNumber.js';
|
||||
@@ -70,16 +70,10 @@ export const signOrder = async ({
|
||||
order,
|
||||
);
|
||||
|
||||
// https://github.com/poap-xyz/poap-fun/pull/62#issue-928290265
|
||||
// "Signature's v was always send as 27 or 28, but from Ledger was 0 or 1"
|
||||
const fixedSignature = ethers.Signature.from(signature).serialized;
|
||||
|
||||
// if (!fixedSignature) throw new Error("Can't sign order");
|
||||
|
||||
const signedOrder: SignedOrder = {
|
||||
...order,
|
||||
id: hashOrder(order),
|
||||
signature: fixedSignature,
|
||||
signature,
|
||||
};
|
||||
return signedOrder;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user