fix signLockOrder

This commit is contained in:
TheJuze
2024-01-24 15:01:14 +03:00
parent c6be1c73c3
commit e815373b0b
7 changed files with 8 additions and 10 deletions

View File

@@ -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' },
],
};

View File

@@ -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;

View File

@@ -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;
};

View File

@@ -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,
);

View File

@@ -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)
}