pub struct PrivateClient { /* private fields */ }Expand description
PrivateClient requires authentication and provide access to placing orders and other account information
Implementations§
Source§impl PrivateClient
impl PrivateClient
Sourcepub fn new(secret: String, passphrase: String, key: String) -> Self
pub fn new(secret: String, passphrase: String, key: String) -> Self
Creates a new PrivateClient
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");Sourcepub fn new_sandbox(secret: String, passphrase: String, key: String) -> Self
pub fn new_sandbox(secret: String, passphrase: String, key: String) -> Self
Creates a new PrivateClient for testing API connectivity and web trading
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");Sourcepub async fn get_accounts(&self) -> Result<Vec<Account>, Error>
pub async fn get_accounts(&self) -> Result<Vec<Account>, Error>
Gets a list of trading accounts from the profile of the API key.
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let accounts = client.get_accounts().await.unwrap();Sourcepub async fn get_account(&self, account_id: &str) -> Result<Account, Error>
pub async fn get_account(&self, account_id: &str) -> Result<Account, Error>
Get trading account by account ID
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let account = client.get_account("1f6a7175-a89c-494f-986d-af9987e6dd69")
.await
.unwrap();Sourcepub async fn get_account_history(
&self,
account_id: &str,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Vec<AccountHistory>, Error>
pub async fn get_account_history( &self, account_id: &str, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Vec<AccountHistory>, Error>
Get account activity of the API key’s profile.
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let history = client
.get_account_history(
"680f85f4-1a99-4108-93ce-a9066f9de246",
Some("297946691"),
Some("296147671"),
Some(100),
)
.await
.unwrap();Sourcepub async fn get_account_holds(
&self,
account_id: &str,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Vec<Hold>, Error>
pub async fn get_account_holds( &self, account_id: &str, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Vec<Hold>, Error>
Get holds of an account that belong to the same profile as the API key.
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let _holds = client
.get_account_holds(
"680f85f4-1a99-4108-93ce-a9066f9de246",
None,
None,
Some(100),
)
.await
.unwrap();Sourcepub async fn place_order(&self, order: Order) -> Result<String, Error>
pub async fn place_order(&self, order: Order) -> Result<String, Error>
You can place three types of orders: limit, market and stop
Overview of order types and settings
Create order order useing OrderBuilder
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let order = OrderBuilder::market(OrderSide::Buy, "BTC-USD", SizeOrFunds::Funds(10.00))
.build();
let res = client.place_order(order).await.unwrap();Sourcepub async fn cancel_order(&self, order_id: &str) -> Result<String, Error>
pub async fn cancel_order(&self, order_id: &str) -> Result<String, Error>
Cancel order specified by order ID
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let order = OrderBuilder::limit(OrderSide::Buy, "BTC-USD", 33000.0, 1.0)
.build();
let order_to_cancel_id = client.place_order(order).await.unwrap();
let canceled_order_id = client.cancel_order(&order_to_cancel_id)
.await.unwrap();Sourcepub async fn cancel_order_by_oid(&self, oid: &str) -> Result<String, Error>
pub async fn cancel_order_by_oid(&self, oid: &str) -> Result<String, Error>
Cancel order specified by order OID
API docs
Sourcepub async fn cancel_orders(&self) -> Result<Vec<String>, Error>
pub async fn cancel_orders(&self) -> Result<Vec<String>, Error>
Cancel all orders
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let canceled_orders_ids = client.cancel_orders().await.unwrap();Sourcepub async fn get_orders(
&self,
order_status: Option<OrderStatus>,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Vec<OrderInfo>, Error>
pub async fn get_orders( &self, order_status: Option<OrderStatus>, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Vec<OrderInfo>, Error>
Get open orders from the profile that the API key belongs
API docs
This request is paginated
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let orders = client
.get_orders(
Some(OrderStatus::OpenActivePending),
Some("2021-06-19T20:24:20.467086Z"),
None,
None,
)
.await
.unwrap();Sourcepub async fn get_order(&self, order_id: &str) -> Result<OrderInfo, Error>
pub async fn get_order(&self, order_id: &str) -> Result<OrderInfo, Error>
Get open order from the profile that the API key belongs
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let order = OrderBuilder::limit(OrderSide::Buy, "BTC-USD", 36000.0, 1.0)
.build();
let order_id = client.place_order(order).await.unwrap();
let order = client.get_order(&order_id).await.unwrap();Sourcepub async fn get_order_by_oid(&self, oid: &str) -> Result<OrderInfo, Error>
pub async fn get_order_by_oid(&self, oid: &str) -> Result<OrderInfo, Error>
Gets order specified by order OID
API docs
Sourcepub async fn get_fill_by_order_id(
&self,
order_id: &str,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Vec<Fill>, Error>
pub async fn get_fill_by_order_id( &self, order_id: &str, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Vec<Fill>, Error>
Get recent fills by specified order_id of the API key’s profile
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let fills = client
.get_fill_by_order_id("4f2756cf-dcb5-492b-83e5-5f2141892758", None, None, None)
.await
.unwrap();Sourcepub async fn get_fills_by_product_id(
&self,
product_id: &str,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Vec<Fill>, Error>
pub async fn get_fills_by_product_id( &self, product_id: &str, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Vec<Fill>, Error>
Get recent fills by specified product_id of the API key’s profile
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let fills = client
.get_fills_by_product_id(&product_id, None, Some("29786034"), None)
.await
.unwrap();Sourcepub async fn get_limits(&self) -> Result<Json, Error>
pub async fn get_limits(&self) -> Result<Json, Error>
Get information on your payment method transfer limits, as well as buy/sell limits per currency
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let limits = client.get_limits().await.unwrap();Sourcepub async fn get_deposits(
&self,
profile_id: Option<&str>,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Json, Error>
pub async fn get_deposits( &self, profile_id: Option<&str>, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Json, Error>
Get deposits from the profile of the API key, in descending order by created time
optional parameters
profile_id: limit list of deposits to this profile_id. By default, it retrieves deposits using default profile
before: if before is set, then it returns deposits created after the before timestamp, sorted by oldest creation date
after: if after is set, then it returns deposits created before the after timestamp, sorted by newest
limit: truncate list to this many deposits, capped at 100. Default is 100.
API docs
This request is paginated
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let deposits = client
.get_deposits(
Some("b7482eaa-3eea-4065-9d81-1484257c5f92"),
None,
None,
None,
)
.await.unwrap();Sourcepub async fn get_internal_deposits(
&self,
profile_id: Option<&str>,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Json, Error>
pub async fn get_internal_deposits( &self, profile_id: Option<&str>, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Json, Error>
Get internal deposits from the profile of the API key, in descending order by created time
optional parameters
profile_id: limit list of internal deposits to this profile_id. By default, it retrieves internal deposits using default profile
before: if before is set, then it returns internal deposits created after the before timestamp, sorted by oldest creation date
after: if after is set, then it returns internal deposits created before the after timestamp, sorted by newest
limit: truncate list to this many internal deposits, capped at 100. Default is 100.
API docs
This request is paginated
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let deposits = client
.get_internal_deposits(
Some("e1d7731f-b7e2-4285-b711-eeec76fc2aff"),
None,
None,
None,
)
.await.unwrap();Sourcepub async fn get_deposit(&self, transfer_id: &str) -> Result<Json, Error>
pub async fn get_deposit(&self, transfer_id: &str) -> Result<Json, Error>
Get information on a single deposit
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let deposit = client
.get_deposit("80259339-7bf9-498f-8200-ddbd32a1c545")
.await;Sourcepub async fn get_payment_methods(&self) -> Result<Json, Error>
pub async fn get_payment_methods(&self) -> Result<Json, Error>
Get your payment methods
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let payment_methods = client.get_payment_methods().await.unwrap();Sourcepub async fn deposit_funds(
&self,
amount: f64,
currency: &str,
payment_method_id: &str,
) -> Result<DepositInfo, Error>
pub async fn deposit_funds( &self, amount: f64, currency: &str, payment_method_id: &str, ) -> Result<DepositInfo, Error>
Deposit funds from a payment method
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let res = client
.deposit_funds(10.00, "USD", "1b4b4fbc-8921-5e7c-b362-a1c589a2cf20")
.await
.unwrap();Sourcepub async fn deposit_funds_from_coinbase(
&self,
amount: f64,
currency: &str,
coinbase_account_id: &str,
) -> Result<DepositInfo, Error>
pub async fn deposit_funds_from_coinbase( &self, amount: f64, currency: &str, coinbase_account_id: &str, ) -> Result<DepositInfo, Error>
Deposit funds from a coinbase account
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let res = client
.deposit_funds_from_coinbase(10.00, "BTC", "95671473-4dda-5264-a654-fc6923e8a334")
.await
.unwrap();Sourcepub async fn get_coinbase_accounts(&self) -> Result<Json, Error>
pub async fn get_coinbase_accounts(&self) -> Result<Json, Error>
Get a list of your coinbase accounts
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let accounts = client.get_coinbase_accounts().await.unwrap();Sourcepub async fn generate_crypto_deposit_address(
&self,
coinbase_account_id: &str,
) -> Result<Json, Error>
pub async fn generate_crypto_deposit_address( &self, coinbase_account_id: &str, ) -> Result<Json, Error>
Generate an address for crypto deposits
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let address = client
.generate_crypto_deposit_address("95671473-4dda-5264-a654-fc6923e8a334")
.await
.unwrap(); Sourcepub async fn get_withdrawls(
&self,
profile_id: Option<&str>,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Json, Error>
pub async fn get_withdrawls( &self, profile_id: Option<&str>, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Json, Error>
Get withdrawals from the profile of the API key
optional parameters
profile_id: limit list of withdrawals to this profile_id. By default, it retrieves withdrawals using default profile
before: If before is set, then it returns withdrawals created after the before timestamp, sorted by oldest creation date
after: If after is set, then it returns withdrawals created before the after timestamp, sorted by newest
limit: truncate list to this many withdrawals, capped at 100. Default is 100
API docs
This request is paginated
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let withdrawls = client
.get_withdrawls(
Some("b7482eaa-3eea-4065-9d81-1484257c5f92"),
None,
None,
None,
)
.await
.unwrap();Sourcepub async fn get_internal_withdrawls(
&self,
profile_id: Option<&str>,
before: Option<&str>,
after: Option<&str>,
limit: Option<u16>,
) -> Result<Json, Error>
pub async fn get_internal_withdrawls( &self, profile_id: Option<&str>, before: Option<&str>, after: Option<&str>, limit: Option<u16>, ) -> Result<Json, Error>
Get withdrawals from the profile of the API key
optional parameters
profile_id: limit list of internal withdrawals to this profile_id. By default, it retrieves internal withdrawals using default profile
before: If before is set, then it returns internal withdrawals created after the before timestamp, sorted by oldest creation date
after: If after is set, then it returns internal withdrawals created before the after timestamp, sorted by newest
limit: truncate list to this many internal withdrawals, capped at 100. Default is 100
API docs
This request is paginated
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let withdrawls = client
.get_internal_withdrawls(
Some("b7482eaa-3eea-4065-9d81-1484257c5f92"),
None,
None,
None,
)
.await
.unwrap();Sourcepub async fn get_withdrawl(&self, transfer_id: &str) -> Result<Json, Error>
pub async fn get_withdrawl(&self, transfer_id: &str) -> Result<Json, Error>
Get information on a single withdrawal
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let withdrawl = client
.get_withdrawl("0e94a87f-9d50-4ead-86ac-7898830c5edf")
.await
.unwrap();Sourcepub async fn withdraw_funds(
&self,
amount: f64,
currency: &str,
payment_method_id: &str,
) -> Result<WithdrawInfo, Error>
pub async fn withdraw_funds( &self, amount: f64, currency: &str, payment_method_id: &str, ) -> Result<WithdrawInfo, Error>
Withdraw funds to a payment method
API docs
Sourcepub async fn withdraw_to_coinbase(
&self,
amount: f64,
currency: &str,
coinbase_account_id: &str,
) -> Result<WithdrawInfo, Error>
pub async fn withdraw_to_coinbase( &self, amount: f64, currency: &str, coinbase_account_id: &str, ) -> Result<WithdrawInfo, Error>
Withdraw funds to a coinbase account
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let res = client
.withdraw_to_coinbase(1.0, "ADA", "91bdfea7-f2sd-5waa-bb0d-5b93c9f09ffc")
.await
.unwrap(); Sourcepub async fn withdraw_to_crypto_address(
&self,
amount: f64,
currency: &str,
crypto_address: &str,
destination_tag: Option<&str>,
no_destination_tag: Option<bool>,
add_network_fee_to_total: Option<bool>,
) -> Result<Json, Error>
pub async fn withdraw_to_crypto_address( &self, amount: f64, currency: &str, crypto_address: &str, destination_tag: Option<&str>, no_destination_tag: Option<bool>, add_network_fee_to_total: Option<bool>, ) -> Result<Json, Error>
Withdraw funds to a crypto address.
parameters
amount: The amount to withdraw
currency: The type of currency
crypto_address: A crypto address of the recipient
destination_tag: A destination tag for currencies that support one
no_destination_tag: A boolean flag to opt out of using a destination tag for currencies that support one. This is required when not providing a destination tag.
add_network_fee_to_total: A boolean flag to add the network fee on top of the amount. If this is blank, it will default to deducting the network fee from the amount.
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let res = client.withdraw_to_crypto_address(6.0, "ADA", "addr1qyk0yr3ht9d6hcqwp8q8j38nxs04npyjauzz9wp5jcfr95h64lvegfk57zmzltj3nmpjff6490ayyvjh0g6sne6hm3hspnnscy", None, None, None).await.unwrap();Sourcepub async fn get_fees(&self) -> Result<Fees, Error>
pub async fn get_fees(&self) -> Result<Fees, Error>
Get your current maker & taker fee rates, as well as your 30-day trailing volume
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let fees = client.get_fees().await.unwrap();Sourcepub async fn get_fee_estimate(
&self,
currency: &str,
crypto_address: &str,
) -> Result<f64, Error>
pub async fn get_fee_estimate( &self, currency: &str, crypto_address: &str, ) -> Result<f64, Error>
Get the network fee estimate when sending to the given address
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let fee = client
.get_fee_estimate("ETH", "0x82289D45Ee8E806C63Ba0DC94a22d4238525d815")
.await
.unwrap();Sourcepub async fn convert_stablecoin(
&self,
from_currency_id: &str,
to_currency_id: &str,
amount: f64,
) -> Result<StablecoinConversion, Error>
pub async fn convert_stablecoin( &self, from_currency_id: &str, to_currency_id: &str, amount: f64, ) -> Result<StablecoinConversion, Error>
Convert between stablecoins
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let convertion = client
.convert_stablecoin("USD", "USDC", 10.00)
.await
.unwrap();Sourcepub async fn create_report<'a>(
&self,
report: Report,
) -> Result<ReportInfo, Error>
pub async fn create_report<'a>( &self, report: Report, ) -> Result<ReportInfo, Error>
Reports provide batches of historic information about your profile in various human and machine readable forms
Create a Report useing ReportBuilder
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let report = Report::account_builder(
"2014-11-01T00:00:00.000Z",
"2021-06-11T02:48:15.853Z",
"1f6a7175-a89c-494f-986d-af9987e6dd69",
)
.email("willstanhope@gmail.com")
.format(Format::CSV)
.build();
let res = client.create_report(report).await.unwrap();Sourcepub async fn get_report(&self, report_id: &str) -> Result<ReportInfo, Error>
pub async fn get_report(&self, report_id: &str) -> Result<ReportInfo, Error>
Get report status
Once a report request has been accepted for processing, the status becomes available
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let report = client
.get_report("d4a3e847-b618-454d-bcb3-e77b0ad61600")
.await
.unwrap();Sourcepub async fn get_profiles(&self) -> Result<Vec<Profile>, Error>
pub async fn get_profiles(&self) -> Result<Vec<Profile>, Error>
Get your profiles
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let profiles = client.get_profiles().await.unwrap();Sourcepub async fn get_profile(&self, profile_id: &str) -> Result<Profile, Error>
pub async fn get_profile(&self, profile_id: &str) -> Result<Profile, Error>
Get a single profile by profile id
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let profile = client
.get_profile("e1d7731f-b7e2-4285-b711-eeec76fc2aff")
.await
.unwrap();Sourcepub async fn create_profile_transfer(
&self,
from: &str,
to: &str,
currency: &str,
amount: f64,
) -> Result<String, Error>
pub async fn create_profile_transfer( &self, from: &str, to: &str, currency: &str, amount: f64, ) -> Result<String, Error>
Transfer funds from API key’s profile to another user owned profile
API docs
let client = PrivateClient::new("tGJSu7SuV3/HOR1/9DcFwO1s560BKI51SDEbnwuvTPbw4BbG5lYJLuKUFpD8TPU61R85dxJpGTygKZ5v+6wJdA==", "t9riylyad0r", "4a9f6de8bcdee641a0a207613dfb43ef");
let ok = client
.create_profile_transfer(
"e1d7731f-b7e2-4285-b711-eeec76fc2aff",
"3510ac37-1a99-4c9c-9865-15f1bc5a832e",
"USD",
100.00,
)
.await
.unwrap();