mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 14:12:35 +03:00
change lockOrderExpiration (mock)
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -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": {
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user