Documentation ¶
Index ¶
- Constants
- type APIAddress
- type APIBalance
- type APIClient
- func (a *APIClient) Authenticate(path string, req *http.Request, body interface{}) error
- func (a *APIClient) CreateWithdrawal(currency string, amount string, address string, destTag string, ...) (transaction APITransaction, err error)
- func (a *APIClient) Fetch(method, path string, body interface{}, result interface{}) error
- func (a *APIClient) GenerateAddress(currency string, ipnURL string, description string) (address APIAddress, err error)
- func (a *APIClient) TransactionInfo(id int) (transaction APITransaction, err error)
- func (a *APIClient) WalletBalance(currency string) (balance APIBalance, err error)
- func (a *APIClient) WalletBalances() (balances map[string]string, err error)
- type APITransaction
- type AccountBlockedError
- type BadAddressError
- type BadDestTagError
- type CurrencyNotFoundError
- type InsufficientFundsError
- type MaxWithdrawError
- type MinWithdrawError
- type NotAllowedError
- type TransactionNotFoundError
- type WestWalletAPIError
- type WrongCredentialsError
Constants ¶
const ( // ENDPOINT defaults to https://api.westwallet.io // but can be overridden for test purposes ENDPOINT = "https://api.westwallet.io" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIAddress ¶
type APIBalance ¶
type APIClient ¶
APIClient is the interface for most of the API calls If Endpoint aren't defined the library will use the default https://api.westwallet.io
func (*APIClient) Authenticate ¶
Authenticate works with the Fetch call and adds certain Headers to the http request. This includes the actual API key and the timestamp of the request. Also a signature which is encoded with hmac and the API secret key.
func (*APIClient) CreateWithdrawal ¶
func (a *APIClient) CreateWithdrawal(currency string, amount string, address string, destTag string, description string) (transaction APITransaction, err error)
CreateWithdrawal requires currency, amount, address, destTag, description and returns an APITransaction struct
func (*APIClient) Fetch ¶
Fetch works as a wrapper for all kind of http requests. It requires a http method and a relative path to the API endpoint. It will try to decode all results into a single interface type which you can provide.
func (*APIClient) GenerateAddress ¶
func (a *APIClient) GenerateAddress(currency string, ipnURL string, description string) (address APIAddress, err error)
GenerateAddress requires an currency code and optional ipnURL and descripton and returns an APIAddresses struct
func (*APIClient) TransactionInfo ¶
func (a *APIClient) TransactionInfo(id int) (transaction APITransaction, err error)
TransactionInfo requires id and returns an APITransaction struct
func (*APIClient) WalletBalance ¶
func (a *APIClient) WalletBalance(currency string) (balance APIBalance, err error)
WalletBalance requires currency and returns an APIBalance struct
type APITransaction ¶
type AccountBlockedError ¶
type AccountBlockedError struct { }
func (*AccountBlockedError) Error ¶
func (e *AccountBlockedError) Error() string
type BadAddressError ¶
type BadAddressError struct { }
func (*BadAddressError) Error ¶
func (e *BadAddressError) Error() string
type BadDestTagError ¶
type BadDestTagError struct { }
func (*BadDestTagError) Error ¶
func (e *BadDestTagError) Error() string
type CurrencyNotFoundError ¶
type CurrencyNotFoundError struct { }
func (*CurrencyNotFoundError) Error ¶
func (e *CurrencyNotFoundError) Error() string
type InsufficientFundsError ¶
type InsufficientFundsError struct { }
func (*InsufficientFundsError) Error ¶
func (e *InsufficientFundsError) Error() string
type MaxWithdrawError ¶
type MaxWithdrawError struct { }
func (*MaxWithdrawError) Error ¶
func (e *MaxWithdrawError) Error() string
type MinWithdrawError ¶
type MinWithdrawError struct { }
func (*MinWithdrawError) Error ¶
func (e *MinWithdrawError) Error() string
type NotAllowedError ¶
type NotAllowedError struct { }
func (*NotAllowedError) Error ¶
func (e *NotAllowedError) Error() string
type TransactionNotFoundError ¶
type TransactionNotFoundError struct { }
func (*TransactionNotFoundError) Error ¶
func (e *TransactionNotFoundError) Error() string
type WestWalletAPIError ¶
type WestWalletAPIError struct {
S string
}
func (*WestWalletAPIError) Error ¶
func (e *WestWalletAPIError) Error() string
type WrongCredentialsError ¶
type WrongCredentialsError struct { }
func (*WrongCredentialsError) Error ¶
func (e *WrongCredentialsError) Error() string