Struct stellar_client::endpoint::account::Payments[][src]

pub struct Payments { /* fields omitted */ }

Represents the payments for account endpoint on the stellar horizon server. The endpoint will return all the Payment operations where a specific account is either the sender or receiver.

https://www.stellar.org/developers/horizon/reference/endpoints/payments-for-account.html

Example

use stellar_client::sync::Client;
use stellar_client::endpoint::{account, payment, Limit};
use stellar_client::resources::operation::OperationKind;

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

// Grab payments and associated account to ensure an account with payments
let all_payments = client.request(payment::All::default().with_limit(1)).unwrap();
let payment      = &all_payments.records()[0];
let account_id   = match payment.kind() {
    &OperationKind::Payment(ref payment)       => payment.from(),
    &OperationKind::CreateAccount(ref payment) => payment.account(),
    _ => panic!("Expected payment type")
};

// Now we issue a request for that account's payments
let endpoint      = account::Payments::new(account_id);
let acct_payments = client.request(endpoint).unwrap();

assert!(acct_payments.records().len() > 0);

Methods

impl Payments
[src]

Creates a new account::Payments endpoint struct. Hand this to the client in order to request payment operations for a specific account.

use stellar_client::endpoint::account;

let payments = account::Payments::new("abc123");

Trait Implementations

impl Debug for Payments
[src]

Formats the value using the given formatter. Read more

impl Clone for Payments
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Cursor for Payments
[src]

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

Returns the cursor that has been set, if it has been set.

impl Limit for Payments
[src]

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

Returns the limit or None.

impl Order for Payments
[src]

Sets the order on the struct and returns an owned version.

Returns the order that has been set, if it has been set.

impl IntoRequest for Payments
[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 Payments

impl Sync for Payments