mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-31 10:08:03 +03:00
fix signLockOrder
This commit is contained in:
@@ -6,6 +6,5 @@ export const LOCK_ORDER_TYPES = {
|
||||
{ name: 'asset', type: 'string' },
|
||||
{ name: 'amount', type: 'uint64' },
|
||||
{ name: 'targetChainId', type: 'uint64' },
|
||||
{ name: 'secretHash', type: 'string' },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -44,7 +44,6 @@ export const signLockOrder = async ({
|
||||
BigNumber.ROUND_FLOOR,
|
||||
)),
|
||||
targetChainId,
|
||||
secretHash,
|
||||
};
|
||||
|
||||
const signature = await signer.signTypedData(
|
||||
@@ -62,7 +61,8 @@ export const signLockOrder = async ({
|
||||
const signedOrder: SignedLockOrder = {
|
||||
...order,
|
||||
signature: fixedSignature,
|
||||
secret
|
||||
secret,
|
||||
secretHash
|
||||
};
|
||||
|
||||
return signedOrder;
|
||||
|
||||
@@ -56,7 +56,6 @@ export const signOrder = async (
|
||||
expiration,
|
||||
...(isCrossChain
|
||||
? {
|
||||
secretHash,
|
||||
targetChainId
|
||||
}
|
||||
: {}),
|
||||
@@ -79,7 +78,7 @@ export const signOrder = async (
|
||||
...order,
|
||||
id: hashOrder(order),
|
||||
signature: fixedSignature,
|
||||
...(isCrossChain ? { secret } : {})
|
||||
...(isCrossChain ? { secret, secretHash } : {})
|
||||
};
|
||||
return signedOrder;
|
||||
};
|
||||
|
||||
@@ -267,7 +267,7 @@ class Aggregator {
|
||||
{
|
||||
headers,
|
||||
method: 'POST',
|
||||
body: JSON.stringify(signedLockOrder),
|
||||
body: JSON.stringify({ ...signedLockOrder, sign: '' }), // TODO: remove field sign when api updated
|
||||
},
|
||||
errorSchema,
|
||||
);
|
||||
|
||||
@@ -62,12 +62,12 @@ export type LockOrder = {
|
||||
asset: string // address(?)
|
||||
amount: number // uint64
|
||||
targetChainId: SupportedChainId // uint64
|
||||
secretHash: string // uint64
|
||||
}
|
||||
|
||||
type SignedOrderAdditionalProps = {
|
||||
signature: string // bytes
|
||||
secret?: string
|
||||
secretHash?: string // bytes32
|
||||
needWithdraw?: boolean // bool (not supported yet by smart-contract)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user