UNPKG

@tristeroresearch/mach-sdk

Version:

A TypeScript SDK for integrating with Mach's API.

71 lines 2.69 kB
/** * @fileOverview This file contains functions that interact with the Mach Exchange API for order-related operations. * @function marketMake - Sends order data to the API and processes the response to determine order status. * @function apiNewPostReceiveCctpMessage - Posts a receive CCTP message to the API and returns the response. * @function apiGetOrderETA - Retrieves the estimated time of arrival (ETA) for an order. * @function apiGetOrderHistory - Fetches the order history for a given wallet address. */ /** * API function to send order data to the Mach Exchange backend to be processed and finalized * @param orderData - The order data * @returns The response from the order data api * @todo Error status codes can't be caught the way that hey are now -- non-2xx status codes are instantly throwing errors from the axios call and are ending up in the catch block */ import { ResultCode, OrderResponseMessage } from '../enums'; import { type OrderItemResponse } from '../@types/orderResponse'; export declare const marketMake: (orderData: any) => Promise<{ message: OrderResponseMessage; status: ResultCode; eta?: undefined; id?: undefined; errorobj?: undefined; } | { message: OrderResponseMessage; status: ResultCode; eta: any; id: any; errorobj?: undefined; } | { message: OrderResponseMessage; status: ResultCode; eta: any; id?: undefined; errorobj?: undefined; } | { message: OrderResponseMessage; status: ResultCode; errorobj: any; eta?: undefined; id?: undefined; }>; /** * API function to post a receive CCTP message * @param srcChain - The source chain * @param burnTx - The burn transaction * @returns The response from the post receive CCTP message api */ export declare const apiNewPostReceiveCctpMessage: (srcChain: string, burnTx: string) => Promise<{ message: OrderResponseMessage; status: ResultCode; eta: any; id: any; error?: undefined; } | { message: OrderResponseMessage; error: any; status: ResultCode; eta?: undefined; id?: undefined; }>; /** * API function to get the ETA for an order * @param srcChainName - The source chain name * @param dstChainName - The destination chain name * @param srcAsset - The source asset * @param dstAsset - The destination asset * @param amount - The amount * @returns The ETA for the order */ export declare const apiGetOrderETA: (srcChainName: string, dstChainName: string, srcAsset: string, dstAsset: string, amount: bigint) => Promise<any>; export declare const apiGetOrderHistory: (address: string) => Promise<OrderItemResponse[]>; //# sourceMappingURL=marketMake.api.d.ts.map