@tristeroresearch/mach-sdk
Version:
A TypeScript SDK for integrating with Mach's API.
45 lines • 1.71 kB
TypeScript
/**
* @fileoverview This file contains the helper function to place an order between two assets.
*/
import { type Asset } from '../@types/asset';
import { type Hex } from 'viem';
import { type GasData } from '../@types/gasData';
/**
* A helper function to place an order between two assets by converting asset amounts, retrieving quotes, submitting orders, and completing market-making processes.
* @param srcAsset - The source asset
* @param dstAsset - The destination asset
* @param srcAmount - The source amount
* @param gasData - The gas data for the transaction
* @param privateKey - The private key for the transaction
* @returns The response from the order data api with transaction hash
*/
export declare const order: (srcAsset: Asset | Hex, dstAsset: Asset | Hex, srcAmount: number | bigint | string, gasData?: GasData, privateKey?: Hex) => Promise<{
transactionHash: `0x${string}`;
message: import("../enums").OrderResponseMessage;
status: import("../enums").ResultCode;
eta?: undefined;
id?: undefined;
errorobj?: undefined;
} | {
transactionHash: `0x${string}`;
message: import("../enums").OrderResponseMessage;
status: import("../enums").ResultCode;
eta: any;
id: any;
errorobj?: undefined;
} | {
transactionHash: `0x${string}`;
message: import("../enums").OrderResponseMessage;
status: import("../enums").ResultCode;
eta: any;
id?: undefined;
errorobj?: undefined;
} | {
transactionHash: `0x${string}`;
message: import("../enums").OrderResponseMessage;
status: import("../enums").ResultCode;
errorobj: any;
eta?: undefined;
id?: undefined;
}>;
//# sourceMappingURL=order.helper.d.ts.map