Documentation
¶
Overview ¶
Package coinbase reads a Coinbase account (the retail app and Advanced Trade) with a view-only CDP API key. Coinbase keeps one account per currency (plus vaults); they are treated as one: moves between them are not activities, and balances are summed per currency.
History comes from each account's ledger, GET /v2/accounts/{id}/transactions, which lists every balance change, Advanced Trade fills included. The v3 fills endpoint is not used: it only covers the key's portfolio and may ask EU users for a 2FA proof token, while the v2 ledger has both legs of every fill; reading both would count each fill twice.
A trade appears as one transaction in each account it touches (bought currency, paid currency); legs are joined into one Trade by the id they share (buy/sell/trade id, or the fill's order and time).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
APIError is an error answered by Coinbase. v2 sends {"errors": [{"id", "message"}]}, v3 {"error", "message"}.