Struct coinbase_pro_rs::private::Private
source · [−]pub struct Private<Adapter> { /* private fields */ }
Implementations
sourceimpl<A> Private<A>
impl<A> Private<A>
pub fn sign(
secret: &str,
timestamp: u64,
method: Method,
uri: &str,
body_str: &str
) -> String
sourcepub fn new(uri: &str, key: &str, secret: &str, passphrase: &str) -> Self where
A: AdapterNew,
pub fn new(uri: &str, key: &str, secret: &str, passphrase: &str) -> Self where
A: AdapterNew,
Creates a new Private struct
sourcepub fn get_accounts(&self) -> A::Result where
A: Adapter<Vec<Account>> + 'static,
pub fn get_accounts(&self) -> A::Result where
A: Adapter<Vec<Account>> + 'static,
Get an Account
Get a list of trading accounts
API Key Permissions
This endpoint requires either the “view” or “trade” permission.
sourcepub fn get_account(&self, account_id: Uuid) -> A::Result where
A: Adapter<Account> + 'static,
pub fn get_account(&self, account_id: Uuid) -> A::Result where
A: Adapter<Account> + 'static,
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 |
sourcepub fn get_account_hist(&self, id: Uuid) -> A::Result where
A: Adapter<Vec<AccountHistory>> + 'static,
pub fn get_account_hist(&self, id: Uuid) -> A::Result where
A: Adapter<Vec<AccountHistory>> + 'static,
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.
sourcepub fn get_account_holds(&self, id: Uuid) -> A::Result where
A: Adapter<Vec<AccountHolds>> + 'static,
pub fn get_account_holds(&self, id: Uuid) -> A::Result where
A: Adapter<Vec<AccountHolds>> + 'static,
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.
sourcepub fn set_order(&self, order: Order<'_>) -> A::Result where
A: Adapter<Order> + 'static,
pub fn set_order(&self, order: Order<'_>) -> A::Result where
A: Adapter<Order> + 'static,
Make Order
General function. Can be used to use own generated Order
structure for order
sourcepub fn buy_limit(
&self,
product_id: &str,
size: f64,
price: f64,
post_only: bool
) -> A::Result where
A: Adapter<Order> + 'static,
pub fn buy_limit(
&self,
product_id: &str,
size: f64,
price: f64,
post_only: bool
) -> A::Result where
A: Adapter<Order> + 'static,
Buy limit Makes Buy limit order
sourcepub fn sell_limit(
&self,
product_id: &str,
size: f64,
price: f64,
post_only: bool
) -> A::Result where
A: Adapter<Order> + 'static,
pub fn sell_limit(
&self,
product_id: &str,
size: f64,
price: f64,
post_only: bool
) -> A::Result where
A: Adapter<Order> + 'static,
Sell limit Makes Sell limit order
sourcepub fn buy_market(&self, product_id: &str, size: f64) -> A::Result where
A: Adapter<Order> + 'static,
pub fn buy_market(&self, product_id: &str, size: f64) -> A::Result where
A: Adapter<Order> + 'static,
Buy market Makes Buy market order with desired amount in base currency, eg: BTC if product_id is BTC-USD
sourcepub fn buy_market_funds(&self, product_id: &str, funds: f64) -> A::Result where
A: Adapter<Order> + 'static,
pub fn buy_market_funds(&self, product_id: &str, funds: f64) -> A::Result where
A: Adapter<Order> + 'static,
Makes Buy market order with desired amount in quoted currency, eg: USD if product_id is BTC-USD
sourcepub fn sell_market(&self, product_id: &str, size: f64) -> A::Result where
A: Adapter<Order> + 'static,
pub fn sell_market(&self, product_id: &str, size: f64) -> A::Result where
A: Adapter<Order> + 'static,
Sell market Makes Sell market order with desired amount in base currency, eg: BTC if product_id is BTC-USD
sourcepub fn sell_market_funds(&self, product_id: &str, funds: f64) -> A::Result where
A: Adapter<Order> + 'static,
pub fn sell_market_funds(&self, product_id: &str, funds: f64) -> A::Result where
A: Adapter<Order> + 'static,
Makes Sell market order with desired amount in quoted currency, eg: USD if product_id is BTC-USD
sourcepub fn cancel_order(&self, id: Uuid) -> A::Result where
A: Adapter<Uuid> + 'static,
pub fn cancel_order(&self, id: Uuid) -> A::Result where
A: Adapter<Uuid> + 'static,
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.
sourcepub fn cancel_all(&self, product_id: Option<&str>) -> A::Result where
A: Adapter<Vec<Uuid>> + 'static,
pub fn cancel_all(&self, product_id: Option<&str>) -> A::Result where
A: Adapter<Vec<Uuid>> + 'static,
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 |
sourcepub fn get_orders(
&self,
status: Option<OrderStatus>,
product_id: Option<&str>
) -> A::Result where
A: Adapter<Vec<Order>> + 'static,
pub fn get_orders(
&self,
status: Option<OrderStatus>,
product_id: Option<&str>
) -> A::Result where
A: Adapter<Vec<Order>> + 'static,
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 |
sourcepub fn get_order(&self, id: Uuid) -> A::Result where
A: Adapter<Order> + 'static,
pub fn get_order(&self, id: Uuid) -> A::Result where
A: Adapter<Order> + 'static,
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.
sourcepub fn get_fills(
&self,
order_id: Option<Uuid>,
product_id: Option<&str>
) -> A::Result where
A: Adapter<Vec<Fill>> + 'static,
pub fn get_fills(
&self,
order_id: Option<Uuid>,
product_id: Option<&str>
) -> A::Result where
A: Adapter<Vec<Fill>> + 'static,
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.
sourcepub fn get_trailing_volume(&self) -> A::Result where
A: Adapter<Vec<TrailingVolume>> + 'static,
pub fn get_trailing_volume(&self) -> A::Result where
A: Adapter<Vec<TrailingVolume>> + 'static,
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.
sourcepub fn get_fees(&self) -> A::Result where
A: Adapter<Fees> + 'static,
pub fn get_fees(&self) -> A::Result where
A: Adapter<Fees> + 'static,
Fees
This request will return your current maker & taker fee rates, as well as your 30-day trailing volume. Quoted rates are subject to change. More information on fees can found on the support page.
pub fn get_transfers(
&self,
transfer_type: Option<TransferType>,
profile_id: Option<String>,
before: Option<DateTime>,
after: Option<DateTime>,
limit: Option<usize>
) -> A::Result where
A: Adapter<Vec<Transfer>> + 'static,
pub fn public(&self) -> &Public<A>
Auto Trait Implementations
impl<Adapter> !RefUnwindSafe for Private<Adapter>
impl<Adapter> Send for Private<Adapter> where
Adapter: Send,
impl<Adapter> Sync for Private<Adapter> where
Adapter: Sync,
impl<Adapter> Unpin for Private<Adapter> where
Adapter: Unpin,
impl<Adapter> !UnwindSafe for Private<Adapter>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more