UNPKG

@velora-dex/sdk

Version:
49 lines 2.65 kB
import type { ConstructFetchInput, RequestParameters } from '../../types'; import { BridgePrice, DeltaPrice } from './getDeltaPrice'; import { type SignableDeltaOrderData } from './helpers/buildDeltaOrderData'; import { Bridge } from './helpers/types'; import { BeneficiaryType } from '../common/orders/types'; export type { SignableDeltaOrderData } from './helpers/buildDeltaOrderData'; 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 The bridge input */ bridge?: Bridge; /** @description Destination Chain ID for Crosschain Orders */ destChainId?: number; /** @description Whether the beneficiary is a contract. Needed to automatically fill in crosschain Bridge */ beneficiaryType?: BeneficiaryType; /** @description price response received from /delta/prices (getDeltaPrice method) */ deltaPrice: Pick<DeltaPrice, 'destAmount' | 'partner' | 'partnerFee' | 'destToken'> & Partial<Pick<BridgePrice, 'bridgeFee' | 'bridge'>>; /** @description partner fee in basis points (bps), 50bps=0.5% */ partnerFeeBps?: number; /** @description partner address */ partnerAddress?: string; /** @description take surplus */ partnerTakesSurplus?: boolean; }; 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