Documentation
¶
Index ¶
- Constants
- type Account
- type Accounts
- type Coinbase
- func (c *Coinbase) GetAccounts() (accounts Accounts, err error)
- func (c *Coinbase) GetPrimaryAccountBalance() (balance float64, err error)
- func (c *Coinbase) GetTransactionDetails(id string) (transaction Transaction, err error)
- func (c *Coinbase) SendMoney(transaction *SmTransaction) (response SmMoneyResponse, err error)
- type SmMoneyResponse
- type SmTransaction
- type Transaction
Constants ¶
View Source
const (
API_ENDPOINT = "https://coinbase.com/api/v1"
)
View Source
const TIME_FORMAT = "2006-01-02T15:04:05-07:00"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
Id string `json:"id"`
Name string `json:"name"`
Balance struct {
Amount amount `json:"amount"`
Currency string `json:"currency"`
} `json:"balance"`
NativeBalance struct {
Amount amount `json:"amount"`
Currency string `json:"currency"`
} `json:"native_balance"`
CreatedAt string `json:"created_at"`
Primary bool `json:"primary"`
Active bool `json:"active"`
}
Accout represents an account
type Accounts ¶
type Accounts struct {
Accounts []Account `json:"accounts"`
TotalCount int `json:"total_count"`
NumPages int `json:"num_pages"`
CurrentPage int `json:"current_page"`
}
Accounts represents a getAccounts response
type Coinbase ¶
type Coinbase struct {
// contains filtered or unexported fields
}
Coinbase represents a coinbase client wrapper
func (*Coinbase) GetAccounts ¶
Balance returns the user's accounts
func (*Coinbase) GetPrimaryAccountBalance ¶
GetPrimaryAccountBalance returns balance for the primary account
func (*Coinbase) GetTransactionDetails ¶
func (c *Coinbase) GetTransactionDetails(id string) (transaction Transaction, err error)
GetTransactionDetails return transaction with ID id
func (*Coinbase) SendMoney ¶
func (c *Coinbase) SendMoney(transaction *SmTransaction) (response SmMoneyResponse, err error)
SendMoney call send_money for tansaction transaction
type SmMoneyResponse ¶
type SmMoneyResponse struct {
Success bool `json:"success"`
Errors []string `json:"errors"`
Transaction Transaction `json:"transaction"`
}
smMoneyResponse represents a response to a send_money_call
type SmTransaction ¶
type SmTransaction struct {
// An email address or a bitcoin address
To string `json:"to"`
// A string amount that will be converted to BTC, such as ‘1’ or ‘1.234567’.
// Also must be >= ‘0.01’ or it will shown an error.
Amount string `json:"amount"`
AmountString string `json:"amount_string,omitempty"`
AmountCurrencyIso string `json:"amount_currency_iso,omitempty"`
// Notes
Notes string `json:"notes,omitempty"`
// User fee
UserFee string `json:"user_fee,omitempty"`
// Referrer ID
ReferrerId string `json:"referrer_id,omitempty"`
// idem
Idem string `json:"idem,omitempty"`
// instant Buy
InstantBuy bool `json:"instant_buy,omitempty"`
// order_id
OrderId string `json:"order_ids,omitempty"`
}
smTransaction represents the transactions parameter for send_money call
type Transaction ¶
type Transaction struct {
Id string `json:"id"`
CreatedAt string `json:"created_at"`
Hsh string `json:"hsh"`
Notes string `json:"notes"`
Idem string `json:"idem"`
Amount struct {
Amount string `json:"amount"`
Currency string `json:"currency"`
} `json:"amount"`
Request bool `json:"request"`
Status string `json:"status"`
Sender struct {
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
} `json:"sender"`
Recipient struct {
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
} `json:"recipient"`
RecipientAddress string `json:"recipient_address"`
}
Tansaction represents a transaction
Click to show internal directories.
Click to hide internal directories.