@devasher/kuru-sdk
Version:
Ethers v6 SDK to interact with Kuru (forked from @kuru-labs/kuru-sdk)
46 lines • 3.1 kB
TypeScript
import { ethers } from 'ethers';
import { MarketParams, LIMIT, TransactionOptions } from '../types';
export declare abstract class GTC {
/**
* @dev Places a limit 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 limit order object containing price, size, isBuy, and postOnly properties.
* @param txOptions - The transaction options for the order.
* @returns A promise that resolves to a boolean indicating success or failure.
*/
static placeLimit(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, order: LIMIT): Promise<ethers.TransactionReceipt>;
static estimateGas(providerOrSigner: ethers.JsonRpcProvider | ethers.AbstractSigner, orderbookAddress: string, marketParams: MarketParams, order: LIMIT): Promise<bigint>;
/**
* @dev Constructs a transaction for a buy limit order.
* @param signer - The signer instance.
* @param orderbookAddress - The address of the order book contract.
* @param price - The price of the order.
* @param size - The size of the order.
* @param postOnly - Whether the order is post-only.
* @param txOptions - Transaction options.
* @returns A promise that resolves to the transaction request object.
*/
static constructBuyOrderTransaction(signer: ethers.AbstractSigner, orderbookAddress: string, price: bigint, size: bigint, postOnly: boolean, txOptions?: TransactionOptions): Promise<ethers.TransactionRequest>;
/**
* @dev Constructs a transaction for a sell limit order.
* @param signer - The signer instance.
* @param orderbookAddress - The address of the order book contract.
* @param price - The price of the order.
* @param size - The size of the order.
* @param postOnly - Whether the order is post-only.
* @param txOptions - Transaction options.
* @returns A promise that resolves to the transaction request object.
*/
static constructSellOrderTransaction(signer: ethers.AbstractSigner, orderbookAddress: string, price: bigint, size: bigint, postOnly: boolean, txOptions?: TransactionOptions): Promise<ethers.TransactionRequest>;
/**
* @dev Places a buy limit order on the order book.
*/
static addBuyOrder(orderbook: ethers.Contract, price: bigint, size: bigint, postOnly: boolean, txOptions?: TransactionOptions, providerOrSigner?: ethers.JsonRpcProvider | ethers.AbstractSigner): Promise<ethers.TransactionReceipt>;
/**
* @dev Places a sell limit order on the order book.
*/
static addSellOrder(orderbook: ethers.Contract, price: bigint, size: bigint, postOnly: boolean, txOptions?: TransactionOptions, providerOrSigner?: ethers.JsonRpcProvider | ethers.AbstractSigner): Promise<ethers.TransactionReceipt>;
}
//# sourceMappingURL=gtc.d.ts.map