axie-tools
Version:
TypeScript SDK for building Axie Infinity trading bots and AI agents on Ronin network. Programmatic marketplace operations for Axies, Materials, and Consumables (buy/sell/delist), batch transfers, floor price detection, and wallet management. Includes int
77 lines (76 loc) • 2.52 kB
TypeScript
export interface IAsset {
erc: string;
address: string;
id: string;
quantity: string;
orderId?: string;
availableQuantity?: string;
remainingQuantity?: string;
}
export interface IOrder {
id: string;
maker: string;
kind: string;
expiredAt: number;
paymentToken: string;
startedAt: number;
basePrice: string;
endedAt: number;
endedPrice: string;
expectedState: string | number;
nonce: string | number;
marketFeePercentage: string | number;
signature: string;
hash?: string;
duration?: number;
timeLeft?: number;
currentPrice: string;
suggestedPrice?: string;
currentPriceUsd?: string;
status?: string;
assets: IAsset[];
makerProfile?: {
name?: string;
addresses?: {
ronin?: string;
};
};
}
export interface ICreateOrderResult {
data?: {
createOrder: {
hash: string;
currentPriceUsd: string;
};
};
errors?: Array<{
message: string;
}>;
}
export interface IOperationResult {
success: boolean;
data?: any;
error?: string;
transactionHash?: string;
}
export interface ICancellationResult {
totalOrders: number;
canceled: number;
failed: number;
canceledOrders: Array<{
orderId: string;
transactionHash: string;
quantity: string;
price: string;
}>;
failedCancellations: Array<{
orderId: string;
error: string;
}>;
message?: string;
}
export declare const ORDER_FRAGMENTS = "\n fragment OrderInfo on Order {\n ...PartialOrderFields\n makerProfile {\n name\n addresses {\n ronin\n __typename\n }\n __typename\n }\n assets {\n ...AssetInfo\n availableQuantity\n remainingQuantity\n __typename\n }\n __typename\n }\n\n fragment PartialOrderFields on Order {\n id\n maker\n kind\n expiredAt\n paymentToken\n startedAt\n basePrice\n endedAt\n endedPrice\n expectedState\n nonce\n marketFeePercentage\n signature\n hash\n duration\n timeLeft\n currentPrice\n suggestedPrice\n currentPriceUsd\n status\n __typename\n }\n\n fragment AssetInfo on Asset {\n erc\n address\n id\n quantity\n orderId\n __typename\n }\n";
/**
* Check if an order is still valid (not expired and has available quantity)
*/
export declare function isOrderValid(order: IOrder): boolean;