mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-04-01 02:27:56 +03:00
fix build and types
This commit is contained in:
@@ -3,7 +3,7 @@ import { BigNumber } from 'bignumber.js';
|
||||
import { ethers } from 'ethers';
|
||||
import { INTERNAL_PROTOCOL_PRECISION } from '../constants';
|
||||
import ORDER_TYPES from '../constants/orderTypes.js';
|
||||
import type { Order, SignedOrder, SupportedChainId } from '../types.js';
|
||||
import type { CrossOrder, Order, SignedOrder, SupportedChainId } from '../types.js';
|
||||
import normalizeNumber from '../utils/normalizeNumber.js';
|
||||
import getDomainData from './getDomainData.js';
|
||||
import hashOrder from './hashOrder.js';
|
||||
@@ -34,7 +34,7 @@ export const signOrder = async (
|
||||
|
||||
const isCrossChain = targetChainId === undefined || targetChainId === chainId;
|
||||
|
||||
const order: Order = {
|
||||
const order: Order | CrossOrder = {
|
||||
senderAddress,
|
||||
matcherAddress,
|
||||
baseAsset: baseAssetAddr,
|
||||
|
||||
@@ -50,8 +50,10 @@ export type Order = {
|
||||
nonce: number // uint64
|
||||
expiration: number // uint64
|
||||
buySide: 0 | 1 // uint8, 1=buy, 0=sell
|
||||
secretHash?: string // uint64
|
||||
targetChainId?: SupportedChainId // uint64
|
||||
}
|
||||
export type CrossOrder = Order & {
|
||||
secretHash: string // uint64
|
||||
targetChainId: SupportedChainId // uint64
|
||||
}
|
||||
|
||||
export type LockOrder = {
|
||||
@@ -71,7 +73,7 @@ type SignedOrderAdditionalProps = {
|
||||
needWithdraw?: boolean // bool (not supported yet by smart-contract)
|
||||
}
|
||||
|
||||
export type SignedOrder = SignedOrderAdditionalProps & Order & {
|
||||
export type SignedOrder = SignedOrderAdditionalProps & (Order | CrossOrder) & {
|
||||
id: string // hash of Order (it's not part of order structure in smart-contract)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user