@velora-dex/sdk
Version:
40 lines • 2.35 kB
TypeScript
import type { Address, ConstructFetchInput, PaginatedResponse, RequestParameters } from '../../types';
import type { DeltaOrderType, OnChainOrderType } from './helpers/types';
import type { DeltaOrderStatus, DeltaAuction } from './types';
type GetDeltaOrderById = (orderId: string, requestParams?: RequestParameters) => Promise<DeltaAuction>;
type GetDeltaOrderByHash = (orderHash: string, requestParams?: RequestParameters) => Promise<DeltaAuction>;
type OrdersFilter<T extends OnChainOrderType = OnChainOrderType> = {
/** @description `order.owner` to fetch Delta Orders for. */
userAddress: Address;
/** @description Pagination option. Default 1. */
page?: number;
/** @description Pagination option. Default 100, max 1000. */
limit?: number;
/** @description Filter by chainId. Omitted = orders across all chains. */
chainId?: number[];
/** @description Filter by integrator-facing status. */
status?: DeltaOrderStatus[];
/** @description Filter by order type. MARKET or LIMIT. */
type?: DeltaOrderType;
/** @description Filter by on-chain order type. Narrows the returned `DeltaAuction<T>`. */
onChainOrderType?: T;
};
type GetDeltaOrders = <T extends OnChainOrderType = OnChainOrderType>(options: OrdersFilter<T>, requestParams?: RequestParameters) => Promise<PaginatedResponse<DeltaAuction<T>>>;
type GetRequiredBalanceParams = {
userAddress: Address;
tokenAddress?: Address;
};
type GetRequiredBalance = (userParams: GetRequiredBalanceParams, requestParams?: RequestParameters) => Promise<Record<string, string>>;
export type GetDeltaOrdersFunctions = {
/** @description Fetch a single order by its UUID. */
getDeltaOrderById: GetDeltaOrderById;
/** @description Fetch a single order by its EIP-712 order hash. */
getDeltaOrderByHash: GetDeltaOrderByHash;
/** @description List Delta orders with the v2 pagination envelope. */
getDeltaOrders: GetDeltaOrders;
/** @description Required balance per token across the user's open Delta v2 orders. Pass `tokenAddress` to narrow the result to a single token. */
getRequiredBalanceForDeltaOrders: GetRequiredBalance;
};
export declare const constructGetDeltaOrders: ({ apiURL, fetcher, chainId, }: ConstructFetchInput) => GetDeltaOrdersFunctions;
export {};
//# sourceMappingURL=getDeltaOrders.d.ts.map