Struct stellar_client::endpoint::orderbook::Details[][src]

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

Example

use stellar_client::sync::Client;
use stellar_client::endpoint::{orderbook, trade, Limit};

let client = Client::horizon_test().unwrap();

// Grab a trade so we can get two valid assets.
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());

Methods

impl Details
[src]

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);

Trait Implementations

impl Debug for Details
[src]

Formats the value using the given formatter. Read more

impl Limit for Details
[src]

Sets a limit on the struct and returns an owned version.

Returns the limit or None.

impl IntoRequest for Details
[src]

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

Auto Trait Implementations

impl Send for Details

impl Sync for Details