add lock order expiration = 4 days

This commit is contained in:
TheJuze
2024-05-30 12:38:18 +03:00
parent af8eb67959
commit 5f4e540160
3 changed files with 8 additions and 6 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.22.0-rc9",
"version": "0.22.0-rc10",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.22.0-rc9",
"version": "0.22.0-rc10",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {

View File

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

View File

@@ -8,7 +8,9 @@ import getDomainData from './getDomainData.js';
import generateSecret from '../utils/generateSecret';
import { getOrderHash } from './hashOrder';
const DEFAULT_EXPIRATION = 29 * 24 * 60 * 60 * 1000; // 29 days
const DAY = 24 * 60 * 60 * 1000;
const LOCK_ORDER_EXPIRATION = 4 * DAY;
const DEFAULT_EXPIRATION = 29 * DAY;
export type SignOrderProps = {
baseAssetAddress: string
@@ -82,7 +84,7 @@ export const signOrder = async ({
limitOrder: order,
chainId: Number(chainId),
secretHash,
lockOrderExpiration: expiration // TODO: change to fillAndLockAtomic data
lockOrderExpiration: LOCK_ORDER_EXPIRATION
}
// TODO: change what to show
@@ -107,7 +109,7 @@ export const signOrder = async ({
targetChainId: Number(targetChainId)
}
: {}),
lockOrderExpiration: expiration
lockOrderExpiration: LOCK_ORDER_EXPIRATION
}
const orderHash = getOrderHash(signedOrderWithoutId, chainId);