diff --git a/package.json b/package.json index a7bb329..2fd1522 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.19.60", + "version": "0.19.61", "description": "Orion Protocol SDK", "main": "./lib/index.cjs", "module": "./lib/index.js", diff --git a/src/Orion/bridge/index.ts b/src/Orion/bridge/index.ts index 8dce712..d34f93a 100644 --- a/src/Orion/bridge/index.ts +++ b/src/Orion/bridge/index.ts @@ -1,6 +1,6 @@ import { ethers } from 'ethers'; import type { - Orion, Unit, AtomicSwapLocal, SupportedChainId, TransactionInfo + Unit, AtomicSwapLocal, SupportedChainId, TransactionInfo, AtomicSwap } from '../../index.js'; import { INTERNAL_PROTOCOL_PRECISION, TxStatus, TxType } from '../../index.js'; import getHistoryExt from './getHistory.js'; @@ -14,30 +14,6 @@ import { invariant } from '../../utils/invariant.js'; export const SECONDS_IN_DAY = 60 * 60 * 24; export const EXPIRATION_DAYS = 4; -type BridgeHistory = Awaited>; - -type BridgeHistoryItem = NonNullable; - -export type AtomicSwap = Partial< - Omit -> & Partial< - Omit -> & { - sourceChainId: SupportedChainId - targetChainId: SupportedChainId - lockExpiration: number - secretHash: string - walletAddress: string - secret?: string | undefined - - creationDate?: number | undefined - redeemExpired?: boolean | undefined - - lockTx?: TransactionInfo | undefined - redeemTx?: TransactionInfo | undefined - refundTx?: TransactionInfo | undefined - liquidityMigrationTx?: TransactionInfo | undefined -} export default class Bridge { constructor( private readonly unitsArray: Unit[], diff --git a/src/types.ts b/src/types.ts index db51432..0494c39 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,6 +3,7 @@ import type { BigNumber } from 'bignumber.js'; import type subOrderStatuses from './constants/subOrderStatuses.js'; import type positionStatuses from './constants/positionStatuses.js'; import type { knownEnvs } from './config/schemas/index.js'; +import type getHistory from './Orion/bridge/getHistory.js'; export type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; @@ -315,9 +316,16 @@ export interface AtomicSwapLocal { } export enum TxStatus { + QUEUED = 'queued', + SIGN_FAILED = 'sign_failed', + GAS_ESTIMATING = 'gas_estimating', + ESTIMATE_GAS_FAILED = 'estimate_gas_failed', + CANCELLED = 'cancelled', PENDING = 'pending', FAILED = 'failed', SETTLED = 'settled', + SIGNING = 'signing', + UNKNOWN = 'unknown', } export enum TxType { @@ -353,3 +361,28 @@ export type TransactionInfo = { hash?: string payload?: BridgeLockTxPayload | BridgeRedeemTxPayload | BridgeRefundTxPayload } + +type BridgeHistory = Awaited>; + +type BridgeHistoryItem = NonNullable; + +export type AtomicSwap = Partial< + Omit +> & Partial< + Omit +> & { + sourceChainId: SupportedChainId + targetChainId: SupportedChainId + lockExpiration: number + secretHash: string + walletAddress: string + secret?: string | undefined + + creationDate?: number | undefined + redeemExpired?: boolean | undefined + + lockTx?: TransactionInfo | undefined + redeemTx?: TransactionInfo | undefined + refundTx?: TransactionInfo | undefined + liquidityMigrationTx?: TransactionInfo | undefined +}