Struct coinbase_pro_rs::private::Private[][src]

pub struct Private<Adapter> { /* fields omitted */ }

Implementations

impl<A> Private<A>[src]

pub fn sign(
    secret: &str,
    timestamp: u64,
    method: Method,
    uri: &str,
    body_str: &str
) -> String
[src]

pub fn new(uri: &str, key: &str, secret: &str, passphrase: &str) -> Self where
    A: AdapterNew
[src]

Creates a new Private struct

pub fn get_accounts(&self) -> A::Result where
    A: Adapter<Vec<Account>> + 'static, 
[src]

Get an Account

Get a list of trading accounts

API Key Permissions

This endpoint requires either the “view” or “trade” permission.

pub fn get_account(&self, account_id: Uuid) -> A::Result where
    A: Adapter<Account> + 'static, 
[src]

Get Account History

Information for a single account. Use this endpoint when you know the account_id.

API Key Permissions

This endpoint requires either the “view” or “trade” permission.

Account Fields

FieldDescription
idAccount ID
balancetotal funds in the account
holdsfunds on hold (not available for use)
availablefunds available to withdraw or trade

pub fn get_account_hist(&self, id: Uuid) -> A::Result where
    A: Adapter<Vec<AccountHistory>> + 'static, 
[src]

Get Account History List account activity. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first. See the Pagination section for retrieving additional entries after the first page.

API Key Permissions

This endpoint requires either the “view” or “trade” permission.

Entry Types

FieldDescription
typeEntry type indicates the reason for the account change.
transferFunds moved to/from Coinbase to Coinbase Pro
matchFunds moved as a result of a trade
feeFee as a result of a trade
rebateFee rebate as per our fee schedule

Details

If an entry is the result of a trade (match, fee), the details field will contain additional information about the trade.

pub fn get_account_holds(&self, id: Uuid) -> A::Result where
    A: Adapter<Vec<AccountHolds>> + 'static, 
[src]

Get Holds Holds are placed on an account for any active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For a withdraw, once it is completed, the hold is removed.

API Key Permissions

This endpoint requires either the “view” or “trade” permission.

Type

The type of the hold will indicate why the hold exists. The hold type is order for holds related to open orders and transfer for holds related to a withdraw.

Ref

The ref field contains the id of the order or transfer which created the hold.

pub fn set_order(&self, order: Order<'_>) -> A::Result where
    A: Adapter<Order> + 'static, 
[src]

Make Order General function. Can be used to use own generated Order structure for order

pub fn buy_limit(
    &self,
    product_id: &str,
    size: f64,
    price: f64,
    post_only: bool
) -> A::Result where
    A: Adapter<Order> + 'static, 
[src]

Buy limit Makes Buy limit order

pub fn sell_limit(
    &self,
    product_id: &str,
    size: f64,
    price: f64,
    post_only: bool
) -> A::Result where
    A: Adapter<Order> + 'static, 
[src]

Sell limit Makes Sell limit order

pub fn buy_market(&self, product_id: &str, size: f64) -> A::Result where
    A: Adapter<Order> + 'static, 
[src]

Buy market Makes Buy market order with desired amount in base currency, eg: BTC if product_id is BTC-USD

pub fn buy_market_funds(&self, product_id: &str, funds: f64) -> A::Result where
    A: Adapter<Order> + 'static, 
[src]

Makes Buy market order with desired amount in quoted currency, eg: USD if product_id is BTC-USD

pub fn sell_market(&self, product_id: &str, size: f64) -> A::Result where
    A: Adapter<Order> + 'static, 
[src]

Sell market Makes Sell market order with desired amount in base currency, eg: BTC if product_id is BTC-USD

pub fn sell_market_funds(&self, product_id: &str, funds: f64) -> A::Result where
    A: Adapter<Order> + 'static, 
[src]

Makes Sell market order with desired amount in quoted currency, eg: USD if product_id is BTC-USD

pub fn cancel_order(&self, id: Uuid) -> A::Result where
    A: Adapter<Uuid> + 'static, 
[src]

Cancel an Order

Cancel a previously placed order.

If the order had no matches during its lifetime its record may be purged. This means the order details will not be available with GET /orders/.

API Key Permissions

This endpoint requires the “trade” permission.

pub fn cancel_all(&self, product_id: Option<&str>) -> A::Result where
    A: Adapter<Vec<Uuid>> + 'static, 
[src]

Cancel all

With best effort, cancel all open orders. The response is a list of ids of the canceled orders.

API Key Permissions

This endpoint requires the “trade” permission.

Query Parameters

ParamDefaultDescription
product_idoptionalOnly cancel orders open for a specific product

pub fn get_orders(
    &self,
    status: Option<OrderStatus>,
    product_id: Option<&str>
) -> A::Result where
    A: Adapter<Vec<Order>> + 'static, 
[src]

List Orders

List your current open orders. Only open or un-settled orders are returned. As soon as an order is no longer open and settled, it will no longer appear in the default request.

API Key Permissions

This endpoint requires either the “view” or “trade” permission.

Query Parameters

| Param Default Description | | ------ | -------- | ------------ | | status | open, pending, active | Limit list of orders to these statuses. Passing all returns orders of all statuses. | | product_id | optional | Only list orders for a specific product |

pub fn get_order(&self, id: Uuid) -> A::Result where
    A: Adapter<Order> + 'static, 
[src]

Get an Order

Get a single order by order id.

API Key Permissions

This endpoint requires either the “view” or “trade” permission.

If the order is canceled the response may have status code 404 if the order had no matches.

pub fn get_fills(
    &self,
    order_id: Option<Uuid>,
    product_id: Option<&str>
) -> A::Result where
    A: Adapter<Vec<Fill>> + 'static, 
[src]

List Fills

Get a list of recent fills.

API Key Permissions

This endpoint requires either the “view” or “trade” permission. DEPRECATION NOTICE - Requests without either order_id or product_id will be rejected after 8/23/18.

pub fn get_trailing_volume(&self) -> A::Result where
    A: Adapter<Vec<TrailingVolume>> + 'static, 
[src]

Trailing Volume

This request will return your 30-day trailing volume for all products. This is a cached value that’s calculated every day at midnight UTC.

#API Key Permissions This endpoint requires either the “view” or “trade” permission.

pub fn public(&self) -> &Public<A>[src]

Auto Trait Implementations

impl<Adapter> !RefUnwindSafe for Private<Adapter>[src]

impl<Adapter> Send for Private<Adapter> where
    Adapter: Send
[src]

impl<Adapter> Sync for Private<Adapter> where
    Adapter: Sync
[src]

impl<Adapter> Unpin for Private<Adapter> where
    Adapter: Unpin
[src]

impl<Adapter> !UnwindSafe for Private<Adapter>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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