mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-28 08:37:51 +03:00
update signOrder types
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const ORDER_TYPES = {
|
||||
Order: [
|
||||
CrossChainOrder: [
|
||||
{ name: 'limitOrder', type: 'bytes32' },
|
||||
{ name: 'chainId', type: 'uint24' },
|
||||
{ name: 'secretHash', type: 'bytes32' },
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user