diff --git a/package-lock.json b/package-lock.json index da90263..9ea111b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { diff --git a/package.json b/package.json index 1bb4ed7..03529bc 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/constants/orderTypes.ts b/src/constants/orderTypes.ts index b14ecd7..4961fec 100644 --- a/src/constants/orderTypes.ts +++ b/src/constants/orderTypes.ts @@ -1,5 +1,5 @@ const ORDER_TYPES = { - Order: [ + CrossChainOrder: [ { name: 'limitOrder', type: 'bytes32' }, { name: 'chainId', type: 'uint24' }, { name: 'secretHash', type: 'bytes32' }, diff --git a/src/crypt/signOrder.ts b/src/crypt/signOrder.ts index f7b2134..a86ca13 100644 --- a/src/crypt/signOrder.ts +++ b/src/crypt/signOrder.ts @@ -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; };