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

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

Methods

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

Field Description
id Account ID
balance total funds in the account
holds funds on hold (not available for use)
available funds 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

Field Description
type Entry type indicates the reason for the account change.
transfer Funds moved to/from Coinbase to Coinbase Pro
match Funds moved as a result of a trade
fee Fee as a result of a trade
rebate Fee 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,
    time_in_force: Option<OrderTimeInForce>
) -> 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,
    time_in_force: Option<OrderTimeInForce>
) -> 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 marker order

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

Sell market Makes Sell marker order

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/<order-id>.

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

Param Default Description
product_id optional Only 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> Send for Private<Adapter> where
    Adapter: Send

impl<Adapter> Sync for Private<Adapter> where
    Adapter: Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self