@devasher/kuru-sdk
Version:
Ethers v6 SDK to interact with Kuru (forked from @kuru-labs/kuru-sdk)
28 lines • 2.24 kB
TypeScript
import { ethers } from 'ethers';
import { MarketParams, MARKET, TransactionOptions } from '../types';
export declare abstract class IOC {
/**
* @dev Places a market order (buy or sell) on the order book.
* @param providerOrSigner - The ethers.js provider or signer to interact with the blockchain.
* @param orderbookAddress - The address of the order book contract.
* @param marketParams - The market parameters including price and size precision.
* @param order - The market order object containing isBuy, size, and fillOrKill properties.
* @returns A promise that resolves to the credited size.
*/
static placeMarket(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, order: MARKET): Promise<ethers.TransactionReceipt>;
static estimateGas(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, order: MARKET, slippageTolerance: number): Promise<bigint>;
/**
* @dev Constructs a market buy transaction.
* @param signer - The signer instance.
* @param orderbookAddress - The address of the order book contract.
* @param marketParams - The market parameters including price and size precision.
* @param quoteSize - The size of the quote asset to spend.
* @param minAmountOut - The minimum amount of base asset to receive.
* @param isMargin - Whether this is a margin trade.
* @param isFillOrKill - Whether the order should be fill-or-kill.
* @param txOptions - Optional transaction parameters like gas price and nonce.
*/
static constructMarketBuyTransaction(signer: ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, quoteSize: string, minAmountOut: string, isMargin: boolean, isFillOrKill: boolean, txOptions?: TransactionOptions): Promise<ethers.TransactionRequest>;
static constructMarketSellTransaction(signer: ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, size: string, minAmountOut: string, isMargin: boolean, isFillOrKill: boolean, txOptions?: TransactionOptions): Promise<ethers.TransactionRequest>;
}
//# sourceMappingURL=ioc.d.ts.map