add to signOrder secretHash only if targetChainId exist

This commit is contained in:
TheJuze
2024-01-19 12:15:17 +03:00
parent 72e1e9464e
commit 330fc513e5
4 changed files with 11 additions and 7 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.42-rc4",
"version": "0.20.42-rc5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.20.42-rc4",
"version": "0.20.42-rc5",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.20.42-rc4",
"version": "0.20.42-rc5",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -55,8 +55,12 @@ export const signOrder = async (
)),
nonce,
expiration,
secretHash,
targetChainId,
...(targetChainId !== undefined
? {
secretHash,
targetChainId
}
: {}),
buySide: side === 'BUY' ? 1 : 0,
};

View File

@@ -49,9 +49,9 @@ export type Order = {
matcherFee: number // uint64
nonce: number // uint64
expiration: number // uint64
secretHash: string // uint64
buySide: 0 | 1 // uint8, 1=buy, 0=sell
targetChainId: ethers.BigNumberish | undefined // uint64
secretHash?: string // uint64
targetChainId?: ethers.BigNumberish // uint64
}
export type LockOrder = {