change lockOrderExpiration (mock)

This commit is contained in:
TheJuze
2024-06-10 12:24:55 +03:00
parent 296d644997
commit 543a74e959
3 changed files with 7 additions and 5 deletions

4
package-lock.json generated
View File

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

View File

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

View File

@@ -6,7 +6,9 @@ import { BigNumber } from 'bignumber.js';
import normalizeNumber from '../utils/normalizeNumber'; import normalizeNumber from '../utils/normalizeNumber';
import { INTERNAL_PROTOCOL_PRECISION, LOCK_ORDER_TYPES } from '../constants'; import { INTERNAL_PROTOCOL_PRECISION, LOCK_ORDER_TYPES } from '../constants';
const DEFAULT_EXPIRATION = 29 * 24 * 60 * 60 * 1000; // 29 days // TODO: return LOCK_ORDER_EXPIRATION and remove MOCK_LOCK_ORDER_EXPIRATION
// const DEFAULT_EXPIRATION = 29 * 24 * 60 * 60 * 1000; // 29 days
const MOCK_ORDER_EXPIRATION = 10 * 60 * 1000; // 10 mins
export type SignLockOrderProps = { export type SignLockOrderProps = {
senderAddress: string // user senderAddress: string // user
@@ -26,7 +28,7 @@ export const signLockOrder = async ({
signer, signer,
}: SignLockOrderProps) => { }: SignLockOrderProps) => {
const nonce = Date.now(); const nonce = Date.now();
const expiration = nonce + DEFAULT_EXPIRATION; const expiration = nonce + MOCK_ORDER_EXPIRATION;
const secret = generateSecret(); const secret = generateSecret();
const secretHash = ethers.keccak256(secret); const secretHash = ethers.keccak256(secret);