pub struct Bitso {
pub prefix: String,
pub client_credentials_manager: Option<BitsoCredentials>,
}
Expand description
Bitso API object
Fields§
§prefix: String
§client_credentials_manager: Option<BitsoCredentials>
Implementations§
Source§impl Bitso
impl Bitso
Sourcepub fn client_credentials_manager(
self,
client_credential_manager: BitsoCredentials,
) -> Bitso
pub fn client_credentials_manager( self, client_credential_manager: BitsoCredentials, ) -> Bitso
Set client credentials
Sourcepub fn auth_headers(
&self,
method: &Method,
request_path: &str,
payload: Option<&Value>,
) -> String
pub fn auth_headers( &self, method: &Method, request_path: &str, payload: Option<&Value>, ) -> String
Construct authorization headers. See: https://bitso.com/api_info#creating-and-signing-requests
Sourcepub fn convert_result<'a, T: Deserialize<'a>>(
&self,
input: &'a str,
) -> Result<T>
pub fn convert_result<'a, T: Deserialize<'a>>( &self, input: &'a str, ) -> Result<T>
Function to convert result to models
Sourcepub async fn get_available_books(
&self,
) -> Result<JSONResponse<Vec<AvailableBook>>>
pub async fn get_available_books( &self, ) -> Result<JSONResponse<Vec<AvailableBook>>>
Make a request to get available books See: https://bitso.com/api_info/#available-books
Sourcepub async fn get_ticker(&self, book: &str) -> Result<JSONResponse<BookTicker>>
pub async fn get_ticker(&self, book: &str) -> Result<JSONResponse<BookTicker>>
Make a request to get ticker See: https://bitso.com/api_info/#ticker
Sourcepub async fn get_order_book(
&self,
book: &str,
aggregate: bool,
) -> Result<JSONResponse<OrderBookPayload>>
pub async fn get_order_book( &self, book: &str, aggregate: bool, ) -> Result<JSONResponse<OrderBookPayload>>
Make a request to get a specific order book See: https://bitso.com/api_info/#order-book
Sourcepub async fn get_trades(
&self,
book: &str,
optional_params: Option<OptionalParams<'_>>,
) -> Result<JSONResponse<Vec<Trade>>>
pub async fn get_trades( &self, book: &str, optional_params: Option<OptionalParams<'_>>, ) -> Result<JSONResponse<Vec<Trade>>>
Make a request to get a specific trade See: https://bitso.com/api_info/#trades
Sourcepub async fn get_account_status(
&self,
) -> Result<JSONResponse<AccountStatusPayload>>
pub async fn get_account_status( &self, ) -> Result<JSONResponse<AccountStatusPayload>>
Make a request to get account status See: https://bitso.com/api_info#account-status
Sourcepub async fn get_account_balance(&self) -> Result<JSONResponse<Balances>>
pub async fn get_account_balance(&self) -> Result<JSONResponse<Balances>>
Make a request to get account balance See: https://bitso.com/api_info#account-balance
Sourcepub async fn get_fees(&self) -> Result<JSONResponse<FeesPayload>>
pub async fn get_fees(&self) -> Result<JSONResponse<FeesPayload>>
Make a request to get fees See: https://bitso.com/api_info#fees
Sourcepub async fn get_ledger<'a>(
&self,
operation_type: Option<&str>,
optional_params: Option<OptionalParams<'_>>,
) -> Result<JSONResponse<Vec<LedgerInstance>>>
pub async fn get_ledger<'a>( &self, operation_type: Option<&str>, optional_params: Option<OptionalParams<'_>>, ) -> Result<JSONResponse<Vec<LedgerInstance>>>
Make a request to get ledger See: https://bitso.com/api_info#ledger
Sourcepub async fn get_withdrawals<'a>(
&self,
wid: Option<&str>,
wids: Option<Vec<&str>>,
origin_ids: Option<Vec<&str>>,
optional_params: Option<OptionalParams<'_>>,
method: Option<&str>,
) -> Result<JSONResponse<Vec<WithdrawalsPayload>>>
pub async fn get_withdrawals<'a>( &self, wid: Option<&str>, wids: Option<Vec<&str>>, origin_ids: Option<Vec<&str>>, optional_params: Option<OptionalParams<'_>>, method: Option<&str>, ) -> Result<JSONResponse<Vec<WithdrawalsPayload>>>
Make a request to get withdrawals See: https://bitso.com/api_info#withdrawals
Sourcepub async fn get_fundings<'a>(
&self,
fid: Option<&str>,
fids: Option<Vec<&str>>,
optional_params: Option<OptionalParams<'_>>,
txids: Option<Vec<&str>>,
method: Option<&str>,
) -> Result<JSONResponse<Vec<FundingsPayload>>>
pub async fn get_fundings<'a>( &self, fid: Option<&str>, fids: Option<Vec<&str>>, optional_params: Option<OptionalParams<'_>>, txids: Option<Vec<&str>>, method: Option<&str>, ) -> Result<JSONResponse<Vec<FundingsPayload>>>
Make a request to get fundings See: https://bitso.com/api_info#fundings
Sourcepub async fn get_user_trades(
&self,
book: Option<&str>,
tid: Option<&str>,
tids: Option<Vec<&str>>,
optional_params: Option<OptionalParams<'_>>,
) -> Result<JSONResponse<Vec<UserTradesPayload>>>
pub async fn get_user_trades( &self, book: Option<&str>, tid: Option<&str>, tids: Option<Vec<&str>>, optional_params: Option<OptionalParams<'_>>, ) -> Result<JSONResponse<Vec<UserTradesPayload>>>
Make a request to get user trades See: https://bitso.com/api_info#user-trades
Sourcepub async fn get_order_trades(
&self,
oid: Option<&str>,
origin_id: Option<&str>,
) -> Result<JSONResponse<Vec<OrderTradesPayload>>>
pub async fn get_order_trades( &self, oid: Option<&str>, origin_id: Option<&str>, ) -> Result<JSONResponse<Vec<OrderTradesPayload>>>
Make a request to get order trades See: https://bitso.com/api_info#order-trades
Sourcepub async fn get_open_orders<'a>(
&self,
book: Option<&str>,
currency: Option<&str>,
limit: Option<&u8>,
) -> Result<JSONResponse<Vec<OpenOrdersPayload>>>
pub async fn get_open_orders<'a>( &self, book: Option<&str>, currency: Option<&str>, limit: Option<&u8>, ) -> Result<JSONResponse<Vec<OpenOrdersPayload>>>
Make a request to get open orders See: https://bitso.com/api_info#open-orders
Sourcepub async fn get_lookup_orders(
&self,
oid: Option<&str>,
oids: Option<Vec<&str>>,
origin_ids: Option<Vec<&str>>,
) -> Result<JSONResponse<Vec<LookupOrdersPayload>>>
pub async fn get_lookup_orders( &self, oid: Option<&str>, oids: Option<Vec<&str>>, origin_ids: Option<Vec<&str>>, ) -> Result<JSONResponse<Vec<LookupOrdersPayload>>>
Make a request to get lookup orders See: https://bitso.com/api_info#lookup-orders
Sourcepub async fn cancel_order(
&self,
all: bool,
oid: Option<&str>,
oids: Option<Vec<&str>>,
origin_ids: Option<Vec<&str>>,
) -> Result<JSONResponse<Vec<String>>>
pub async fn cancel_order( &self, all: bool, oid: Option<&str>, oids: Option<Vec<&str>>, origin_ids: Option<Vec<&str>>, ) -> Result<JSONResponse<Vec<String>>>
Make a request to cancel order See: https://bitso.com/api_info#cancel-order
Sourcepub async fn place_order<'a>(
&self,
book: &str,
side: &str,
type: &str,
optional_order_params: Option<OptionalOrderParams<'_>>,
) -> Result<JSONResponse<PlaceOrderPayload>>
pub async fn place_order<'a>( &self, book: &str, side: &str, type: &str, optional_order_params: Option<OptionalOrderParams<'_>>, ) -> Result<JSONResponse<PlaceOrderPayload>>
Make a post request to place an order See: https://bitso.com/api_info#place-an-order
Sourcepub async fn get_funding_destination(
&self,
fund_currency: &str,
) -> Result<JSONResponse<FundingDestination>>
pub async fn get_funding_destination( &self, fund_currency: &str, ) -> Result<JSONResponse<FundingDestination>>
Make a request to get lookup orders See: https://bitso.com/api_info#funding-destination
Sourcepub async fn crypto_withdrawal(
&self,
currency: &str,
amount: &str,
address: &str,
max_fee: Option<&str>,
destination_tag: Option<&str>,
) -> Result<JSONResponse<Withdrawal<CryptoWithdrawal>>>
pub async fn crypto_withdrawal( &self, currency: &str, amount: &str, address: &str, max_fee: Option<&str>, destination_tag: Option<&str>, ) -> Result<JSONResponse<Withdrawal<CryptoWithdrawal>>>
Make a request to place an crypto withdrawal See: https://bitso.com/api_info#crypto-withdrawals
Sourcepub async fn spei_withdrawal(
&self,
amount: &str,
recipient_given_names: &str,
recipient_family_names: &str,
clabe: &str,
notes_ref: Option<&str>,
numeric_ref: Option<&str>,
) -> Result<JSONResponse<Withdrawal<SPEIWithdrawal>>>
pub async fn spei_withdrawal( &self, amount: &str, recipient_given_names: &str, recipient_family_names: &str, clabe: &str, notes_ref: Option<&str>, numeric_ref: Option<&str>, ) -> Result<JSONResponse<Withdrawal<SPEIWithdrawal>>>
Make a request to place a speri withdrawal See: https://bitso.com/api_info#spei-withdrawal
Sourcepub async fn get_bank_codes(&self) -> Result<JSONResponse<Vec<BankCode>>>
pub async fn get_bank_codes(&self) -> Result<JSONResponse<Vec<BankCode>>>
Make a request to get bank codes See: https://bitso.com/api_info#bank-codes
Sourcepub async fn debit_card_withdrawal(
&self,
amount: &str,
recipient_given_names: &str,
recipient_family_names: &str,
card_number: &str,
bank_code: &str,
) -> Result<JSONResponse<Withdrawal<DebitWithdrawal>>>
pub async fn debit_card_withdrawal( &self, amount: &str, recipient_given_names: &str, recipient_family_names: &str, card_number: &str, bank_code: &str, ) -> Result<JSONResponse<Withdrawal<DebitWithdrawal>>>
Make a post request to make a debit-card ithdrawal See: https://bitso.com/api_info#debit-card-withdrawal
Sourcepub async fn phone_number_withdrawal(
&self,
amount: &str,
recipient_given_names: &str,
recipient_family_names: &str,
phone_number: &str,
bank_code: &str,
) -> Result<JSONResponse<Withdrawal<PhoneWithdrawal>>>
pub async fn phone_number_withdrawal( &self, amount: &str, recipient_given_names: &str, recipient_family_names: &str, phone_number: &str, bank_code: &str, ) -> Result<JSONResponse<Withdrawal<PhoneWithdrawal>>>
Make a post request to make a phone-number withdrawal See: https://bitso.com/api_info#phone-number-withdrawal