UNPKG

@stellar/stellar-sdk

Version:

A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.

28 lines (25 loc) 1.13 kB
import { CallBuilder } from './call_builder.js'; class OrderbookCallBuilder extends CallBuilder { constructor(serverUrl, httpClient, selling, buying) { super(serverUrl, httpClient); this.setPath("order_book"); const sellingIssuer = selling.getIssuer(); if (!selling.isNative() && sellingIssuer !== void 0) { this.url.searchParams.set("selling_asset_type", selling.getAssetType()); this.url.searchParams.set("selling_asset_code", selling.getCode()); this.url.searchParams.set("selling_asset_issuer", sellingIssuer); } else { this.url.searchParams.set("selling_asset_type", "native"); } const buyingIssuer = buying.getIssuer(); if (!buying.isNative() && buyingIssuer !== void 0) { this.url.searchParams.set("buying_asset_type", buying.getAssetType()); this.url.searchParams.set("buying_asset_code", buying.getCode()); this.url.searchParams.set("buying_asset_issuer", buyingIssuer); } else { this.url.searchParams.set("buying_asset_type", "native"); } } } export { OrderbookCallBuilder }; //# sourceMappingURL=orderbook_call_builder.js.map