UNPKG

@velora-dex/sdk

Version:
50 lines 2.69 kB
import type { ConstructFetchInput, EnumerateLiteral, RequestParameters } from '../../types'; import type { BridgePrice } from './getDeltaPrice'; import { type SignableDeltaOrderData } from './helpers/buildDeltaOrderData'; import { SwapSide } from '../../constants'; import type { MarkOptional } from 'ts-essentials'; export type { SignableDeltaOrderData } from './helpers/buildDeltaOrderData'; export type SwapSideUnion = EnumerateLiteral<typeof SwapSide>; export type BuildDeltaOrderDataParams = { /** @description The address of the order owner */ owner: string; /** @description The address of the order beneficiary */ beneficiary?: string; /** @description The address of the src token */ srcToken: string; /** @description The address of the dest token. For Crosschain Order - destination token on the destination chain */ destToken: string; /** @description The amount of src token to swap */ srcAmount: string; /** @description The minimum amount of dest token to receive */ destAmount: string; /** @description The deadline for the order */ deadline?: number; /** @description The nonce of the order */ nonce?: number | string; /** @description Optional permit signature for the src token https://developers.velora.xyz/api/velora-api/velora-delta-api/build-a-delta-order-to-sign#supported-permits-order#supported-permits */ permit?: string; /** @description Partner string. */ partner?: string; /** @description Destination Chain ID for Crosschain Orders */ destChainId?: number; /** @description price response received from /delta/prices (getDeltaPrice method) */ deltaPrice: MarkOptional<Pick<BridgePrice, 'destAmount' | 'partner' | 'partnerFee' | 'destToken' | 'srcAmount' | 'bridge'>, 'partner' | 'partnerFee'>; /** @description partner fee in basis points (bps), 50bps=0.5% */ partnerFeeBps?: number; /** @description partner address */ partnerAddress?: string; /** @description take surplus */ partnerTakesSurplus?: boolean; /** @description The side of the order. Default is SELL */ side?: SwapSideUnion; /** @description Metadata for the order, hex string */ metadata?: string; }; type BuildDeltaOrder = (buildOrderParams: BuildDeltaOrderDataParams, requestParams?: RequestParameters) => Promise<SignableDeltaOrderData>; export type BuildDeltaOrderFunctions = { /** @description Build Orders to be posted to Delta API for execution */ buildDeltaOrder: BuildDeltaOrder; }; export declare const constructBuildDeltaOrder: (options: ConstructFetchInput) => BuildDeltaOrderFunctions; //# sourceMappingURL=buildDeltaOrder.d.ts.map