Documentation ¶
Index ¶
- Variables
- type Account
- type Client
- func (c *Client) Accounts() ([]Account, error)
- func (c *Client) Epoch() (string, error)
- func (c *Client) Get(path string) (*http.Response, error)
- func (c *Client) Post(path string, body interface{}) (*http.Response, error)
- func (c *Client) Send(from, to, amount, currency, description string) (Transaction, error)
- func (c *Client) Transactions(accountID string) ([]Transaction, error)
- func (c *Client) Transfer(from, to, amount, currency, description string) (Transaction, error)
- func (c *Client) UnsignedGet(path string) (*http.Response, error)
- type Errors
- type Money
- type Request
- type Transaction
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyAccount = Account{}
EmptyAccount result
View Source
var EmptyAccounts = []Account{}
EmptyAccounts result
View Source
var EmptyTransaction = Transaction{}
EmptyTransaction result
View Source
var EmptyTransactions = []Transaction{}
EmptyTransactions result
View Source
var ErrAccountNotFound = errors.New("account not found")
ErrAccountNotFound is thrown when a acc with the given id was not found
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string `json:"id"` Name string `json:"name"` Primary bool `json:"primary"` Currency string `json:"currency"` Balance Money `json:"balance"` NativeBalance Money `json:"native_balance"` }
Account JSON
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client to coinbase api
func (*Client) Send ¶
func (c *Client) Send( from, to, amount, currency, description string, ) (Transaction, error)
Send money from an acc to a btc addr
func (*Client) Transactions ¶
func (c *Client) Transactions(accountID string) ([]Transaction, error)
Transactions for a given account
type Errors ¶
type Errors struct { List []struct { ID string `json:"id"` Message string `json:"message"` } `json:"errors"` }
Errors to include in any JSON response object
type Request ¶
type Request struct { Type string `json:"type"` To string `json:"to"` Amount string `json:"amount"` Currency string `json:"currency"` Description string `json:"description"` Idem string `json:"idem"` }
Request JSON
type Transaction ¶
type Transaction struct { ID string `json:"id"` Type string `json:"type"` Status string `json:"status"` Description string `json:"description"` Amount Money `json:"amount"` NativeAmount Money `json:"native_amount"` Created time.Time `json:"created_at"` Updated time.Time `json:"updated_at"` To struct { Resource string `json:"resource"` Email string `json:"email"` ID string `json:"id"` } `json:"to"` }
Transaction JSON
Click to show internal directories.
Click to hide internal directories.