pub struct Details { /* fields omitted */ }Given an asset pair, the endpoint will return all bids and asks with an optional
limit parameter to cap the number of records returned.
https://www.stellar.org/developers/horizon/reference/endpoints/orderbook-details.html
use stellar_client::sync::Client;
use stellar_client::endpoint::{orderbook, trade, Limit};
let client = Client::horizon_test().unwrap();
let endpoint = trade::All::default().with_limit(1);
let records = client.request(endpoint).unwrap();
let trade = &records.records()[0];
let asset1 = trade.base_asset().clone();
let asset2 = trade.counter_asset().clone();
let orderbook_ep = orderbook::Details::for_asset_pair(asset1, asset2);
let orderbook = client.request(orderbook_ep).unwrap();
assert_eq!(orderbook.base(), trade.base_asset());
Creates a new orderbook::Details endpoint struct. Hand this to the client in order to request
information about all bids and asks for an asset pair.
use stellar_client::endpoint::orderbook;
use stellar_client::resources::AssetIdentifier;
let base = AssetIdentifier::native();
let counter = AssetIdentifier::native();
let details = orderbook::Details::for_asset_pair(base, counter);
Formats the value using the given formatter. Read more
Sets a limit on the struct and returns an owned version.
Returns the limit or None.
The deserializable type that is expected to come back from the stellar server.
The request body to be sent to stellar. Generally this is just a () unit. Converts the implementing struct into an http request. Read more