Struct Bitso

Source
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

Source

pub fn default() -> Bitso

Bitso instance

Source

pub fn prefix(self, prefix: &str) -> Bitso

Set prefix

Source

pub fn client_credentials_manager( self, client_credential_manager: BitsoCredentials, ) -> Bitso

Set client credentials

Source

pub fn build(self) -> Bitso

Build Bitso API object

Source

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

Source

pub fn convert_result<'a, T: Deserialize<'a>>( &self, input: &'a str, ) -> Result<T>

Function to convert result to models

Source

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

Source

pub async fn get_ticker(&self, book: &str) -> Result<JSONResponse<BookTicker>>

Make a request to get ticker See: https://bitso.com/api_info/#ticker

Source

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

Source

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

Source

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

Source

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

Source

pub async fn get_fees(&self) -> Result<JSONResponse<FeesPayload>>

Make a request to get fees See: https://bitso.com/api_info#fees

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Auto Trait Implementations§

§

impl Freeze for Bitso

§

impl RefUnwindSafe for Bitso

§

impl Send for Bitso

§

impl Sync for Bitso

§

impl Unpin for Bitso

§

impl UnwindSafe for Bitso

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,