mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-18 03:45:02 +03:00
update signOrder types
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.22.0-rc2",
|
||||
"version": "0.22.0-rc3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.22.0-rc2",
|
||||
"version": "0.22.0-rc3",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.22.0-rc2",
|
||||
"version": "0.22.0-rc3",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -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