@devasher/kuru-sdk
Version:
Ethers v6 SDK to interact with Kuru (forked from @kuru-labs/kuru-sdk)
26 lines • 1.18 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Orders = void 0;
// ============ External Imports ============
const ethers_1 = require("ethers");
// ============ Config Imports ============
const OrderBook_json_1 = __importDefault(require("../../abi/OrderBook.json"));
class Orders {
/**
* @dev Gets an order by its ID.
* @param providerOrSigner - The ethers.js provider to interact with the blockchain.
* @param orderbookAddress - The address of the order book contract.
* @param orderId - The ID of the order.
* @returns A promise that resolves to an Order object containing order details.
*/
static async getOrder(providerOrSigner, orderbookAddress, orderId) {
const orderbook = new ethers_1.ethers.Contract(orderbookAddress, OrderBook_json_1.default.abi, providerOrSigner);
const order = await orderbook.s_orders(orderId, { from: ethers_1.ZeroAddress });
return order;
}
}
exports.Orders = Orders;
//# sourceMappingURL=orders.js.map