update signOrder types

This commit is contained in:
TheJuze
2024-05-28 18:30:05 +03:00
parent 7cbf81eb77
commit ef5ef4f97e
4 changed files with 10 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
const ORDER_TYPES = {
Order: [
CrossChainOrder: [
{ name: 'limitOrder', type: 'bytes32' },
{ name: 'chainId', type: 'uint24' },
{ name: 'secretHash', type: 'bytes32' },

View File

@@ -99,7 +99,7 @@ export const signOrder = async ({
const crossChainOrder = {
limitOrder: limitOrderHash,
chainId,
chainId: Number(chainId),
secretHash,
lockOrderExpiration: expiration
}
@@ -114,7 +114,10 @@ export const signOrder = async ({
const signature = await signer.signTypedData(
getDomainData(chainId),
ORDER_TYPES,
crossChainOrder,
{
order,
...crossChainOrder,
}
);
// https://github.com/poap-xyz/poap-fun/pull/62#issue-928290265
@@ -128,7 +131,7 @@ export const signOrder = async ({
...order,
id: limitOrderHash, // TODO: change to orderHash
signature: fixedSignature,
...(isCrossChain ? { secret, secretHash, targetChainId } : {})
...(isCrossChain ? { secret, secretHash, targetChainId: Number(targetChainId) } : {})
};
return signedOrder;
};