Documentation
¶
Index ¶
- Constants
- func MakeURLValues(v interface{}) (url.Values, error)
- type AccountBalance
- type AdditionalTransactionInfo
- type BankInfo
- type Client
- func (cl *Client) DelOrderRequest(ctx context.Context, req *DelOrderRequest) (*DelOrderResponse, error)
- func (cl *Client) GetAccountBalancesRequest(ctx context.Context, req *GetAccountBalancesRequest) (*GetAccountBalancesResponse, error)
- func (cl *Client) GetAllOpenOrdersRequest(ctx context.Context, req *GetAllOpenOrdersRequest) (*GetAllOpenOrdersResponse, error)
- func (cl *Client) GetAuthFullOrderBookRequest(ctx context.Context, req *GetAuthFullOrderBookRequest) (*GetAuthFullOrderBookResponse, error)
- func (cl *Client) GetAuthOrderBookRequest(ctx context.Context, req *GetAuthOrderBookRequest) (*GetAuthOrderBookResponse, error)
- func (cl *Client) GetAuthTradeHistoryForPairRequest(ctx context.Context, req *GetAuthTradeHistoryForPairRequest) (*GetAuthTradeHistoryForPairResponse, error)
- func (cl *Client) GetBankAccountForAssetRequest(ctx context.Context, req *GetBankAccountForAssetRequest) (*GetBankAccountForAssetResponse, error)
- func (cl *Client) GetCurrencies(ctx context.Context, req *GetCurrenciesRequest) (*GetCurrenciesResponse, error)
- func (cl *Client) GetCurrencyPairs(ctx context.Context, req *GetCurrencyPairsRequest) (*GetCurrencyPairsResponse, error)
- func (cl *Client) GetDepositAddressRequest(ctx context.Context, req *GetDepositAddressRequest) (*GetDepositAddressResponse, error)
- func (cl *Client) GetDepositHistoryForAssetRequest(ctx context.Context, req *GetDepositHistoryForAssetRequest) (*GetDepositHistoryForAssetResponse, error)
- func (cl *Client) GetMarketSummaryForPairRequest(ctx context.Context, req *GetMarketSummaryForPairRequest) (*GetMarketSummaryForPairResponse, error)
- func (cl *Client) GetMarketSummaryRequest(ctx context.Context, req *GetMarketSummaryRequest) (*GetMarketSummaryResponse, error)
- func (cl *Client) GetOrderBook(ctx context.Context, req *GetOrderBookRequest) (*GetOrderBookResponse, error)
- func (cl *Client) GetOrderHistoryDetailsByCustomerOrderIDRequest(ctx context.Context, req *GetOrderHistoryDetailsByCustomerOrderIDRequest) (*GetOrderHistoryDetailsByCustomerOrderIDResponse, error)
- func (cl *Client) GetOrderHistoryDetailsByOrderIDRequest(ctx context.Context, req *GetOrderHistoryDetailsByOrderIDRequest) (*GetOrderHistoryDetailsByOrderIDResponse, error)
- func (cl *Client) GetOrderHistoryRequest(ctx context.Context, req *GetOrderHistoryRequest) (*GetOrderHistoryResponse, error)
- func (cl *Client) GetOrderHistorySummaryByCustomerOrderIDRequest(ctx context.Context, req *GetOrderHistorySummaryByCustomerOrderIDRequest) (*GetOrderHistorySummaryByCustomerOrderIDResponse, error)
- func (cl *Client) GetOrderHistorySummaryByOrderIDRequest(ctx context.Context, req *GetOrderHistorySummaryByOrderIDRequest) (*GetOrderHistorySummaryByOrderIDResponse, error)
- func (cl *Client) GetOrderStatusByCustomerOrderIDRequest(ctx context.Context, req *GetOrderStatusByCustomerOrderIDRequest) (*GetOrderStatusByCustomerOrderIDResponse, error)
- func (cl *Client) GetOrderStatusByOrderIDRequest(ctx context.Context, req *GetOrderStatusByOrderIDRequest) (*GetOrderStatusByOrderIDResponse, error)
- func (cl *Client) GetOrderTypesForPairRequest(ctx context.Context, req *GetOrderTypesForPairRequest) (*GetOrderTypesForPairResponse, error)
- func (cl *Client) GetOrderTypesRequest(ctx context.Context, req *GetOrderTypesRequest) (*GetOrderTypesResponse, error)
- func (cl *Client) GetServerTimeRequest(ctx context.Context, req *GetServerTimeRequest) (*GetServerTimeResponse, error)
- func (cl *Client) GetSimpleBuyOrSellOrderStatusRequest(ctx context.Context, req *GetSimpleBuyOrSellOrderStatusRequest) (*GetSimpleBuyOrSellOrderStatusResponse, error)
- func (cl *Client) GetTradeHistoryForPairRequest(ctx context.Context, req *GetTradeHistoryForPairRequest) (*GetTradeHistoryForPairResponse, error)
- func (cl *Client) GetTransactionHistoryRequest(ctx context.Context, req *GetTransactionHistoryRequest) (*GetTransactionHistoryResponse, error)
- func (cl *Client) GetWithdrawHistoryForAssetRequest(ctx context.Context, req *GetWithdrawHistoryForAssetRequest) (*GetWithdrawHistoryForAssetResponse, error)
- func (cl *Client) GetWithdrawInfoRequest(ctx context.Context, req *GetWithdrawInfoRequest) (*GetWithdrawInfoResponse, error)
- func (cl *Client) GetWithdrawStatusRequest(ctx context.Context, req *GetWithdrawStatusRequest) (*GetWithdrawStatusResponse, error)
- func (cl *Client) PostLimitOrderRequest(ctx context.Context, req *PostLimitOrderRequest) (*PostLimitOrderResponse, error)
- func (cl *Client) PostMarketBuyRequest(ctx context.Context, req *PostMarketOrderBuyRequest) (*PostMarketOrderResponse, error)
- func (cl *Client) PostMarketSellRequest(ctx context.Context, req *PostMarketOrderSellRequest) (*PostMarketOrderResponse, error)
- func (cl *Client) PostNewCryptoWithdrawRequest(ctx context.Context, req *PostNewCryptoWithdrawRequest) (*PostNewCryptoWithdrawResponse, error)
- func (cl *Client) PostNewFiatWithdrawRequest(ctx context.Context, req *PostNewFiatWithdrawRequest) (*PostNewFiatWithdrawResponse, error)
- func (cl *Client) PostSimpleBuyOrSellOrderRequest(ctx context.Context, req *PostSimpleBuyOrSellOrderRequest) (*PostSimpleBuyOrSellOrderResponse, error)
- func (cl *Client) PostSimpleBuyOrSellQuoteRequest(ctx context.Context, req *PostSimpleBuyOrSellQuoteRequest) (*PostSimpleBuyOrSellQuoteResponse, error)
- func (cl *Client) SetAuth(apiKeyID, apiKeySecret string) error
- func (cl *Client) SetBaseURL(baseURL string)
- func (cl *Client) SetDebug(debug bool)
- func (cl *Client) SetHTTPClient(httpClient *http.Client)
- func (cl *Client) SetTimeout(timeout *time.Duration)
- type CurrencyInfo
- type DelOrderRequest
- type DelOrderResponse
- type DepositInfo
- type GetAccountBalancesRequest
- type GetAccountBalancesResponse
- type GetAllOpenOrdersRequest
- type GetAllOpenOrdersResponse
- type GetAuthFullOrderBookRequest
- type GetAuthFullOrderBookResponse
- type GetAuthOrderBookRequest
- type GetAuthOrderBookResponse
- type GetAuthTradeHistoryForPairRequest
- type GetAuthTradeHistoryForPairResponse
- type GetBankAccountForAssetRequest
- type GetBankAccountForAssetResponse
- type GetCurrenciesRequest
- type GetCurrenciesResponse
- type GetCurrencyPairsRequest
- type GetCurrencyPairsResponse
- type GetDepositAddressRequest
- type GetDepositAddressResponse
- type GetDepositHistoryForAssetRequest
- type GetDepositHistoryForAssetResponse
- type GetMarketSummaryForPairRequest
- type GetMarketSummaryForPairResponse
- type GetMarketSummaryRequest
- type GetMarketSummaryResponse
- type GetOrderBookRequest
- type GetOrderBookResponse
- type GetOrderHistoryDetailsByCustomerOrderIDRequest
- type GetOrderHistoryDetailsByCustomerOrderIDResponse
- type GetOrderHistoryDetailsByOrderIDRequest
- type GetOrderHistoryDetailsByOrderIDResponse
- type GetOrderHistoryRequest
- type GetOrderHistoryResponse
- type GetOrderHistorySummaryByCustomerOrderIDRequest
- type GetOrderHistorySummaryByCustomerOrderIDResponse
- type GetOrderHistorySummaryByOrderIDRequest
- type GetOrderHistorySummaryByOrderIDResponse
- type GetOrderStatusByCustomerOrderIDRequest
- type GetOrderStatusByCustomerOrderIDResponse
- type GetOrderStatusByOrderIDRequest
- type GetOrderStatusByOrderIDResponse
- type GetOrderTypesForPairRequest
- type GetOrderTypesForPairResponse
- type GetOrderTypesRequest
- type GetOrderTypesResponse
- type GetServerTimeRequest
- type GetServerTimeResponse
- type GetSimpleBuyOrSellOrderStatusRequest
- type GetSimpleBuyOrSellOrderStatusResponse
- type GetTradeHistoryForPairRequest
- type GetTradeHistoryForPairResponse
- type GetTransactionHistoryRequest
- type GetTransactionHistoryResponse
- type GetWithdrawHistoryForAssetRequest
- type GetWithdrawHistoryForAssetResponse
- type GetWithdrawInfoRequest
- type GetWithdrawInfoResponse
- type GetWithdrawStatusRequest
- type GetWithdrawStatusResponse
- type MarketSummary
- type OpenOrder
- type OrderBook
- type OrderBookEntry
- type OrderReceipt
- type OrderStatus
- type OrderTypes
- type PairInfo
- type PostLimitOrderRequest
- type PostLimitOrderResponse
- type PostMarketOrderBuyRequest
- type PostMarketOrderResponse
- type PostMarketOrderSellRequest
- type PostNewCryptoWithdrawRequest
- type PostNewCryptoWithdrawResponse
- type PostNewFiatWithdrawRequest
- type PostNewFiatWithdrawResponse
- type PostSimpleBuyOrSellOrderRequest
- type PostSimpleBuyOrSellOrderResponse
- type PostSimpleBuyOrSellQuoteRequest
- type PostSimpleBuyOrSellQuoteResponse
- type RequestSide
- type ResponseSide
- type TradeHistoryInfo
- type TradeInfo
- type TransactionInfo
- type TransactionType
- type WithdrawInfo
Constants ¶
const Version = "0.0.1"
Variables ¶
This section is empty.
Functions ¶
func MakeURLValues ¶
MakeURLValues converts a request struct into a url.Values map.
Types ¶
type AccountBalance ¶
type AccountBalance struct { Currency string `json:"currency"` Available decimal.Decimal `json:"available"` Reserved decimal.Decimal `json:"reserved"` Total decimal.Decimal `json:"total"` }
AccountBalance represent the balance info for a specific asset
type AdditionalTransactionInfo ¶
type AdditionalTransactionInfo struct { CostPerCoin decimal.Decimal `json:"costPerCoin"` CostPerCoinSymbol string `json:"costPerCoinSymbol"` CurrencyPairSymbol string `json:"currencyPairSymbol"` OrderID string `json:"orderId"` }
AdditionalTransactionInfo holds additional info for a transaction
type BankInfo ¶
type BankInfo struct { ID string `json:"id"` Bank string `json:"bank"` AccountHolder string `json:"accountHolder"` AccountNumber string `json:"accountNumber"` BranchCode string `json:"branchCode"` AccountType string `json:"accountType"` CreatedAt time.Time `json:"createdAt"` }
BankInfo holds data related to a bank account
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Valr API client.
func NewClient ¶
func NewClient() *Client
NewClient creates a new Valr API client with the default base URL.
func (*Client) DelOrderRequest ¶
func (cl *Client) DelOrderRequest(ctx context.Context, req *DelOrderRequest) (*DelOrderResponse, error)
DelOrderRequest
Cancel an open order. A 202 Accepted response means the request to cancel the order was accepted. You can either use the Order Status REST API or use WebSocket API to receive status update about this request.
The DELETE request requires a JSON request body in the following format:
{ "orderId": "UUID", "pair": "BTCZAR" }
func (*Client) GetAccountBalancesRequest ¶
func (cl *Client) GetAccountBalancesRequest(ctx context.Context, req *GetAccountBalancesRequest) (*GetAccountBalancesResponse, error)
GetAccountBalancesRequest
Returns the list of all wallets with their respective balances.
func (*Client) GetAllOpenOrdersRequest ¶
func (cl *Client) GetAllOpenOrdersRequest(ctx context.Context, req *GetAllOpenOrdersRequest) (*GetAllOpenOrdersResponse, error)
GetAllOpenOrdersRequest
Get all open orders for your account. A customerOrderId field will be returned in the response for all those orders that were created with a customerOrderId field.
func (*Client) GetAuthFullOrderBookRequest ¶
func (cl *Client) GetAuthFullOrderBookRequest(ctx context.Context, req *GetAuthFullOrderBookRequest) (*GetAuthFullOrderBookResponse, error)
GetAuthFullOrderBookRequest
Returns a list of the top 20 bids and asks in the order book. Ask orders are sorted by price ascending. Bid orders are sorted by price descending. Orders of the same price are aggregated.
func (*Client) GetAuthOrderBookRequest ¶
func (cl *Client) GetAuthOrderBookRequest(ctx context.Context, req *GetAuthOrderBookRequest) (*GetAuthOrderBookResponse, error)
GetAuthOrderBookRequest
Returns a list of the top 20 bids and asks in the order book. Ask orders are sorted by price ascending. Bid orders are sorted by price descending. Orders of the same price are aggregated.
func (*Client) GetAuthTradeHistoryForPairRequest ¶
func (cl *Client) GetAuthTradeHistoryForPairRequest(ctx context.Context, req *GetAuthTradeHistoryForPairRequest) (*GetAuthTradeHistoryForPairResponse, error)
GetAuthTradeHistoryForPairRequest
Get the last 100 recent trades for a given currency pair. You can limit the number of trades returned by specifying the limit parameter.
func (*Client) GetBankAccountForAssetRequest ¶
func (cl *Client) GetBankAccountForAssetRequest(ctx context.Context, req *GetBankAccountForAssetRequest) (*GetBankAccountForAssetResponse, error)
GetBankAccountForAssetRequest Get a list of bank accounts that are linked to your VALR account. Bank accounts can be linked by signing in to your account on www.VALR.com.
func (*Client) GetCurrencies ¶
func (cl *Client) GetCurrencies(ctx context.Context, req *GetCurrenciesRequest) (*GetCurrenciesResponse, error)
GetCurrencies
Get a list of currencies supported by VALR.
func (*Client) GetCurrencyPairs ¶
func (cl *Client) GetCurrencyPairs(ctx context.Context, req *GetCurrencyPairsRequest) (*GetCurrencyPairsResponse, error)
GetCurrencyPairs
Get a list of all the currency pairs supported by VALR.
func (*Client) GetDepositAddressRequest ¶
func (cl *Client) GetDepositAddressRequest(ctx context.Context, req *GetDepositAddressRequest) (*GetDepositAddressResponse, error)
GetDepositAddressRequest
Returns the default deposit address associated with currency specified in the path variable {currencyCode}.
func (*Client) GetDepositHistoryForAssetRequest ¶
func (cl *Client) GetDepositHistoryForAssetRequest(ctx context.Context, req *GetDepositHistoryForAssetRequest) (*GetDepositHistoryForAssetResponse, error)
GetDepositHistoryForAssetRequest
Get the Deposit History records for a given currency.
func (*Client) GetMarketSummaryForPairRequest ¶
func (cl *Client) GetMarketSummaryForPairRequest(ctx context.Context, req *GetMarketSummaryForPairRequest) (*GetMarketSummaryForPairResponse, error)
GetMarketSummaryForPairRequest
Get the market summary for a given currency pair.
func (*Client) GetMarketSummaryRequest ¶
func (cl *Client) GetMarketSummaryRequest(ctx context.Context, req *GetMarketSummaryRequest) (*GetMarketSummaryResponse, error)
GetMarketSummaryRequest
Get the market summary for all supported currency pairs.
func (*Client) GetOrderBook ¶
func (cl *Client) GetOrderBook(ctx context.Context, req *GetOrderBookRequest) (*GetOrderBookResponse, error)
GetOrderBook
Returns a list of the top 20 bids and asks in the order book. Ask orders are sorted by price ascending. Bid orders are sorted by price descending. Orders of the same price are aggregated.
func (*Client) GetOrderHistoryDetailsByCustomerOrderIDRequest ¶
func (cl *Client) GetOrderHistoryDetailsByCustomerOrderIDRequest(ctx context.Context, req *GetOrderHistoryDetailsByCustomerOrderIDRequest) (*GetOrderHistoryDetailsByCustomerOrderIDResponse, error)
GetOrderHistoryDetailsByCustomerOrderIDRequest
Get a detailed history of an order's statuses. This call returns an array of "Order Status" objects. The latest and most up-to-date status of this order is the zeroth element in the array.
func (*Client) GetOrderHistoryDetailsByOrderIDRequest ¶
func (cl *Client) GetOrderHistoryDetailsByOrderIDRequest(ctx context.Context, req *GetOrderHistoryDetailsByOrderIDRequest) (*GetOrderHistoryDetailsByOrderIDResponse, error)
GetOrderHistoryDetailsByOrderIDRequest
Get a detailed history of an order's statuses. This call returns an array of "Order Status" objects. The latest and most up-to-date status of this order is the zeroth element in the array.
func (*Client) GetOrderHistoryRequest ¶
func (cl *Client) GetOrderHistoryRequest(ctx context.Context, req *GetOrderHistoryRequest) (*GetOrderHistoryResponse, error)
GetOrderHistoryRequest
Get historical orders placed by you.
func (*Client) GetOrderHistorySummaryByCustomerOrderIDRequest ¶
func (cl *Client) GetOrderHistorySummaryByCustomerOrderIDRequest(ctx context.Context, req *GetOrderHistorySummaryByCustomerOrderIDRequest) (*GetOrderHistorySummaryByCustomerOrderIDResponse, error)
GetOrderHistorySummaryByCustomerOrderIDRequest
An order is considered completed when the "Order Status" call returns one of the following statuses: "Filled", "Cancelled" or "Failed". When this happens, you can get a more detailed summary about this order using this call. Orders that are not completed are invalid for this request.
func (*Client) GetOrderHistorySummaryByOrderIDRequest ¶
func (cl *Client) GetOrderHistorySummaryByOrderIDRequest(ctx context.Context, req *GetOrderHistorySummaryByOrderIDRequest) (*GetOrderHistorySummaryByOrderIDResponse, error)
GetOrderHistorySummaryByOrderIDRequest
An order is considered completed when the "Order Status" call returns one of the following statuses: "Filled", "Cancelled" or "Failed". When this happens, you can get a more detailed summary about this order using this call. Orders that are not completed are invalid for this request.
func (*Client) GetOrderStatusByCustomerOrderIDRequest ¶
func (cl *Client) GetOrderStatusByCustomerOrderIDRequest(ctx context.Context, req *GetOrderStatusByCustomerOrderIDRequest) (*GetOrderStatusByCustomerOrderIDResponse, error)
GetOrderStatusByCustomerOrderIDRequest
This API returns the status of an order that was placed on the Exchange queried using customerOrderId. The customer can specify a customerOrderId while placing an order on the Exchange. Use this API to query the order status using that customerOrderId.
func (*Client) GetOrderStatusByOrderIDRequest ¶
func (cl *Client) GetOrderStatusByOrderIDRequest(ctx context.Context, req *GetOrderStatusByOrderIDRequest) (*GetOrderStatusByOrderIDResponse, error)
GetOrderStatusByOrderIDRequest
This API returns the status of an order that was placed on the Exchange queried using the id provided by VALR. VALR provides an id for every order that is placed on the Exchange. Use this id to populate the path variable orderId in this API to query the status of the order.
Note: If a customerOrderId was also specified while placing the order, that customerOrderId will be returned as part of the response.
func (*Client) GetOrderTypesForPairRequest ¶
func (cl *Client) GetOrderTypesForPairRequest(ctx context.Context, req *GetOrderTypesForPairRequest) (*GetOrderTypesForPairResponse, error)
GetOrderTypesForPairRequest
Get the order types supported for a given currency pair. An array of order types is returned. You can only place an order that is listed in this array for this currency pair.
The order types supported are as follows: limit post-only : Place a limit order on the Exchange that will either be added to the order book or, should it match, be cancelled completely. limit : Place a limit order on the Exchange. market : Place a market order on the Exchange (only crypto-to-ZAR pairs). simple : Similar to a market order, but allows for crypto-to-crypto pairs.
func (*Client) GetOrderTypesRequest ¶
func (cl *Client) GetOrderTypesRequest(ctx context.Context, req *GetOrderTypesRequest) (*GetOrderTypesResponse, error)
GetOrderTypesRequest
Get all the order types supported for all currency pairs. An array of currency pairs is returned along with an array of order types for each currency pair. You can only place an order that is supported by that currency pair.
The order types supported are as follows: limit post-only : Place a limit order on the Exchange that will either be added to the order book or, should it match, be cancelled completely. limit : Place a limit order on the Exchange. market : Place a market order on the Exchange (only crypto-to-ZAR pairs). simple : Similar to a market order, but allows for crypto-to-crypto pairs.
func (*Client) GetServerTimeRequest ¶
func (cl *Client) GetServerTimeRequest(ctx context.Context, req *GetServerTimeRequest) (*GetServerTimeResponse, error)
GetServerTimeRequest
Get the server time.
func (*Client) GetSimpleBuyOrSellOrderStatusRequest ¶
func (cl *Client) GetSimpleBuyOrSellOrderStatusRequest(ctx context.Context, req *GetSimpleBuyOrSellOrderStatusRequest) (*GetSimpleBuyOrSellOrderStatusResponse, error)
GetSimpleBuyOrSellOrderStatusRequest
Get the status of a Simple Buy/Sell order.
func (*Client) GetTradeHistoryForPairRequest ¶
func (cl *Client) GetTradeHistoryForPairRequest(ctx context.Context, req *GetTradeHistoryForPairRequest) (*GetTradeHistoryForPairResponse, error)
GetTradeHistoryForPairRequest
Get the last 100 recent trades for a given currency pair for your account. You can limit the number of trades returned by specifying the limit parameter.
func (*Client) GetTransactionHistoryRequest ¶
func (cl *Client) GetTransactionHistoryRequest(ctx context.Context, req *GetTransactionHistoryRequest) (*GetTransactionHistoryResponse, error)
GetTransactionHistoryRequest
Transaction history for your account. Note: This API supports pagination.
func (*Client) GetWithdrawHistoryForAssetRequest ¶
func (cl *Client) GetWithdrawHistoryForAssetRequest(ctx context.Context, req *GetWithdrawHistoryForAssetRequest) (*GetWithdrawHistoryForAssetResponse, error)
GetWithdrawHistoryForAssetRequest
Get Withdrawal History records for a given currency.
func (*Client) GetWithdrawInfoRequest ¶
func (cl *Client) GetWithdrawInfoRequest(ctx context.Context, req *GetWithdrawInfoRequest) (*GetWithdrawInfoResponse, error)
GetWithdrawInfoRequest
Get all the information about withdrawing a given currency from your VALR account. That will include withdrawal costs, minimum withdrawal amount etc.
func (*Client) GetWithdrawStatusRequest ¶
func (cl *Client) GetWithdrawStatusRequest(ctx context.Context, req *GetWithdrawStatusRequest) (*GetWithdrawStatusResponse, error)
GetWithdrawStatusRequest
Check the status of a withdrawal.
func (*Client) PostLimitOrderRequest ¶
func (cl *Client) PostLimitOrderRequest(ctx context.Context, req *PostLimitOrderRequest) (*PostLimitOrderResponse, error)
PostLimitOrderRequest
Create a new limit order.
The JSON body used to create a limit order looks like this:
{ "side": "SELL", "quantity": "0.100000", "price": "10000", "pair": "BTCZAR", "postOnly": true, "customerOrderId": "1234" }
func (*Client) PostMarketBuyRequest ¶
func (cl *Client) PostMarketBuyRequest(ctx context.Context, req *PostMarketOrderBuyRequest) (*PostMarketOrderResponse, error)
PostMarketBuyRequest
Create a new market order. When the response is 202 Accepted, you can either use the Order Status REST API or use WebSocket API to receive updates about this order.
Example request body:
{ "side": "BUY", "quoteAmount": "0.100000", "pair": "BTCZAR", "customerOrderId": "1234" }
func (*Client) PostMarketSellRequest ¶
func (cl *Client) PostMarketSellRequest(ctx context.Context, req *PostMarketOrderSellRequest) (*PostMarketOrderResponse, error)
PostMarketBuyRequest
Create a new market order. When the response is 202 Accepted, you can either use the Order Status REST API or use WebSocket API to receive updates about this order.
Example request body:
{ "side": "SELL", "baseAmount": "0.100000", "pair": "BTCZAR", "customerOrderId": "1234" }
func (*Client) PostNewCryptoWithdrawRequest ¶
func (cl *Client) PostNewCryptoWithdrawRequest(ctx context.Context, req *PostNewCryptoWithdrawRequest) (*PostNewCryptoWithdrawResponse, error)
PostNewCryptoWithdrawRequest
Withdraw cryptocurrency funds to an address. The request body for XRP, XMR, XEM, XLM will accept an optional field called "paymentReference". Max length for paymentReference is 256.
func (*Client) PostNewFiatWithdrawRequest ¶
func (cl *Client) PostNewFiatWithdrawRequest(ctx context.Context, req *PostNewFiatWithdrawRequest) (*PostNewFiatWithdrawResponse, error)
PostNewFiatWithdrawRequest
Withdraw your ZAR funds into one of your linked bank accounts.
func (*Client) PostSimpleBuyOrSellOrderRequest ¶
func (cl *Client) PostSimpleBuyOrSellOrderRequest(ctx context.Context, req *PostSimpleBuyOrSellOrderRequest) (*PostSimpleBuyOrSellOrderResponse, error)
PostSimpleBuyOrSellOrderRequest
Submit an order to buy or sell instantly using Simple Buy/Sell.
A sample request body is as follows:
{ "payInCurrency": "BTC", "payAmount": "0.001", "side": "SELL" }
func (*Client) PostSimpleBuyOrSellQuoteRequest ¶
func (cl *Client) PostSimpleBuyOrSellQuoteRequest(ctx context.Context, req *PostSimpleBuyOrSellQuoteRequest) (*PostSimpleBuyOrSellQuoteResponse, error)
PostSimpleBuyOrSellQuoteRequest
Get a quote to buy or sell instantly using Simple Buy.
A sample request body is as follows:
{ "payInCurrency": "BTC", "payAmount": "0.001", "side": "SELL" }
func (*Client) SetBaseURL ¶
SetBaseURL overrides the default base URL. For internal use.
func (*Client) SetDebug ¶
SetDebug enables or disables debug mode. In debug mode, HTTP requests and responses will be logged.
func (*Client) SetHTTPClient ¶
SetHTTPClient sets the HTTP client that will be used for API calls.
func (*Client) SetTimeout ¶
SetTimeout sets the timeout for requests made by this client. Note: if you set a timeout and then call .SetHTTPClient(), the timeout in the new HTTP client will be used.
type CurrencyInfo ¶
type CurrencyInfo struct { Symbol string `json:"symbol"` Active bool `json:"isActive"` ShortName string `json:"shortName"` LongName string `json:"longName"` }
CurrencyInfo holds info for a specific asset
type DelOrderRequest ¶
type DelOrderRequest struct { // https://api.valr.com/v1/orders/order // Currency Pair // Order ID // required: true Pair string `json:"pair" url:"pair"` ID string `json:"orderId" url:"orderId"` }
DelOrderRequest is the request struct for DelOrder
type DelOrderResponse ¶
type DelOrderResponse struct { }
DelOrderResponse is the struct that DelOrder responses are unpacked into
type DepositInfo ¶
type DepositInfo struct { CurrencyCode string `json:"currencyCode"` ReceiveAddress string `json:"receiveAddress"` TransactionHash string `json:"transactionHash"` Amount decimal.Decimal `json:"amount"` CreatedAt time.Time `json:"createdAt"` Confirmations int `json:"confirmations"` Confirmed bool `json:"confirmed"` ConfirmedAt time.Time `json:"confirmedAt"` }
DepositInfo holds info about a specific deposit
type GetAccountBalancesRequest ¶
type GetAccountBalancesRequest struct { }
GetAccountBalancesRequest is the request struct for GetAccountBalances
type GetAccountBalancesResponse ¶
type GetAccountBalancesResponse []AccountBalance
GetAccountBalancesResponse is the type that GetAccountBalances responses are unpacked into
type GetAllOpenOrdersRequest ¶
type GetAllOpenOrdersRequest struct { }
GetAllOpenOrdersRequest is the request struct for GetAllOpenOrders
type GetAllOpenOrdersResponse ¶
type GetAllOpenOrdersResponse []OpenOrder
GetAllOpenOrdersResponse is the type that GetAllOpenOrders responses are unpacked into
type GetAuthFullOrderBookRequest ¶
type GetAuthFullOrderBookRequest struct { // https://api.valr.com/v1/marketdata/:currencyPair/orderbook/full // Currency pair // required: true Pair string `json:"currencyPair" url:"currencyPair"` }
GetAuthFullOrderBookRequest is the request struct for GetAuthFullOrderBook
type GetAuthFullOrderBookResponse ¶
type GetAuthFullOrderBookResponse struct {
OrderBook
}
GetAuthFullOrderBookResponse is the struct that GetAuthFullOrderBook responses are unpacked into
type GetAuthOrderBookRequest ¶
type GetAuthOrderBookRequest struct { // https://api.valr.com/v1/marketdata/:currencyPair/orderbook // Currency pair // required: true Pair string `json:"currencyPair" url:"currencyPair"` }
GetAuthOrderBookRequest is the request struct for GetAuthOrderBook
type GetAuthOrderBookResponse ¶
type GetAuthOrderBookResponse struct {
GetOrderBookResponse
}
GetAuthOrderBookResponse is the struct that GetAuthOrderBook responses are unpacked into
type GetAuthTradeHistoryForPairRequest ¶
type GetAuthTradeHistoryForPairRequest struct { // https://api.valr.com/v1/marketdata/:currencyPair/tradehistory?limit=10 // Currency Pair // required: true // Limit // required: false Pair string `json:"currencyPair" url:"currencyPair"` Limit int `json:"limit" url:"limit"` }
GetAuthTradeHistoryForPairRequest is the request struct for GetAuthTradeHistoryForPair
type GetAuthTradeHistoryForPairResponse ¶
type GetAuthTradeHistoryForPairResponse []TradeHistoryInfo
GetAuthTradeHistoryForPairResponse is the type that GetAuthTradeHistoryForPair responses are unpacked into
type GetBankAccountForAssetRequest ¶
type GetBankAccountForAssetRequest struct { // https://api.valr.com/v1/wallet/fiat/:currencyCode/accounts // Currency Code // required: true Asset string `json:"currencyCode" url:"currencyCode"` // note: ZAR is the only supported asset at this time }
GetBankAccountForAssetRequest is the request struct for GetBankAccountForAsset
type GetBankAccountForAssetResponse ¶
type GetBankAccountForAssetResponse []BankInfo
GetBankAccountForAssetResponse is the type that GetBankAccountForAsset responses are unpacked into
type GetCurrenciesRequest ¶
type GetCurrenciesRequest struct { }
GetCurrenciesRequest is the request struct for GetCurrencies
type GetCurrenciesResponse ¶
type GetCurrenciesResponse []CurrencyInfo
GetCurrenciesResponse is the type that GetCurrencies responses are unpacked into
type GetCurrencyPairsRequest ¶
type GetCurrencyPairsRequest struct { }
GetCurrencyPairsRequest is the request struct for GetCurrencyPairs
type GetCurrencyPairsResponse ¶
type GetCurrencyPairsResponse []PairInfo
GetCurrencyPairsResponse is the type that GetCurrencyPairs responses are unpacked into
type GetDepositAddressRequest ¶
type GetDepositAddressRequest struct { // https://api.valr.com/v1/wallet/crypto/:currencyCode/deposit/address // Currency Code // required: true Asset string `json:"currencyCode" url:"currencyCode"` }
GetDepositAddressRequest is the request struct for GetDepositAddress
type GetDepositAddressResponse ¶
type GetDepositAddressResponse struct { Currency string `json:"currency"` Address string `json:"address"` }
GetDepositAddressResponse is the struct that GetDepositAddress responses are unpacked into
type GetDepositHistoryForAssetRequest ¶
type GetDepositHistoryForAssetRequest struct { // https://api.valr.com/v1/wallet/crypto/:currencyCode/deposit/history?skip=0&limit=10 // Currency Code // required: true // Skip // Limit // required: false Asset string `json:"currencyCode" url:"currencyCode"` Skip int `json:"skip" url:"skip"` Limit int `json:"limit" url:"limit"` }
GetDepositHistoryForAssetRequest is the request struct for GetDepositHistoryForAsset
type GetDepositHistoryForAssetResponse ¶
type GetDepositHistoryForAssetResponse []DepositInfo
GetDepositHistoryForAssetResponse is the type that GetDepositHistoryForAsset responses are unpacked into
type GetMarketSummaryForPairRequest ¶
type GetMarketSummaryForPairRequest struct { // https://api.valr.com/v1/public/:currencyPair/marketsummary // Currency Pair // required: true Pair string `json:"currencyPair" url:"currencyPair"` }
GetMarketSummaryForPairRequest is the request struct for GetMarketSummaryForPair
type GetMarketSummaryForPairResponse ¶
type GetMarketSummaryForPairResponse struct {
MarketSummary
}
GetMarketSummaryForPairResponse is the struct that GetMarketSummaryForPair responses are unpacked into
type GetMarketSummaryRequest ¶
type GetMarketSummaryRequest struct { }
GetMarketSummaryRequest is the request struct for GetMarketSummary
type GetMarketSummaryResponse ¶
type GetMarketSummaryResponse []MarketSummary
GetMarketSummaryResponse is the type that GetMarketSummary responses are unpacked into
type GetOrderBookRequest ¶
type GetOrderBookRequest struct { // https://api.valr.com/v1/public/:currencyPair/orderbook // Currency pair // required: true Pair string `json:"currencyPair" url:"currencyPair"` }
GetOrderBookRequest is the request struct for GetOrderBook.
type GetOrderBookResponse ¶
type GetOrderBookResponse struct {
OrderBook
}
GetOrderBookResponse is the struct that GetOrderBook responses are unpacked into
type GetOrderHistoryDetailsByCustomerOrderIDRequest ¶
type GetOrderHistoryDetailsByCustomerOrderIDRequest struct { // https://api.valr.com/v1/orders/history/detail/customerorderid/:customerOrderId // Order ID // required: true ID string `json:"customerOrderId" url:"customerOrderId"` }
GetOrderHistoryDetailsByCustomerOrderIDRequest is the request struct for GetOrderHistoryDetailsByCustomerOrderID
type GetOrderHistoryDetailsByCustomerOrderIDResponse ¶
type GetOrderHistoryDetailsByCustomerOrderIDResponse []OrderStatus
GetOrderHistoryDetailsByCustomerOrderIDResponse is the type that GetOrderHistoryDetailsByCustomerOrderID responses are unpacked into
type GetOrderHistoryDetailsByOrderIDRequest ¶
type GetOrderHistoryDetailsByOrderIDRequest struct { // https://api.valr.com/v1/orders/history/detail/orderid/:orderId // Order ID // required: true ID string `json:"orderId" url:"orderId"` }
GetOrderHistoryDetailsByOrderIDRequest is the request struct for GetOrderHistoryDetailsByOrderID
type GetOrderHistoryDetailsByOrderIDResponse ¶
type GetOrderHistoryDetailsByOrderIDResponse []OrderStatus
GetOrderHistoryDetailsByOrderIDResponse is the type that GetOrderHistoryDetailsByOrderID responses are unpacked into
type GetOrderHistoryRequest ¶
type GetOrderHistoryRequest struct { // https://api.valr.com/v1/orders/history?skip=0&limit=2 // Skip // Limit // required: false Skip int `json:"skip" url:"skip"` Limit int `json:"limit" url:"limit"` }
GetOrderHistoryRequest is the request struct for GetOrderHistory
type GetOrderHistoryResponse ¶
type GetOrderHistoryResponse []OrderReceipt
GetOrderHistoryResponse is the type that GetOrderHistory responses are unpacked into
type GetOrderHistorySummaryByCustomerOrderIDRequest ¶
type GetOrderHistorySummaryByCustomerOrderIDRequest struct { // https://api.valr.com/v1/orders/history/summary/customerorderid/:customerOrderId // Customer Order ID // required: true ID string `json:"customerOrderId" url:"customerOrderId"` }
GetOrderHistorySummaryByCustomerOrderIDRequest is the request struct for GetOrderHistorySummaryByCustomerOrderID
type GetOrderHistorySummaryByCustomerOrderIDResponse ¶
type GetOrderHistorySummaryByCustomerOrderIDResponse struct { OrderID string `json:"orderId"` CustomerOrderID string `json:"customerOrderId"` OrderStatusType bool `json:"orderStatusType"` Pair string `json:"currencyPair"` AveragePrice decimal.Decimal `json:"averagePrice"` OriginalPrice decimal.Decimal `json:"originalPrice"` RemainingQuantity decimal.Decimal `json:"remainingQuantity"` OriginalQuantity decimal.Decimal `json:"originalQuantity"` Total decimal.Decimal `json:"total"` TotalFee decimal.Decimal `json:"totalFee"` FeeCurrency string `json:"feeCurrency"` OrderSide ResponseSide `json:"orderSide"` OrderType string `json:"orderType"` FailedReason string `json:"failedReason"` OrderUpdatedAt time.Time `json:"orderUpdatedAt"` OrderCreatedAt time.Time `json:"orderCreatedAt"` }
GetOrderHistorySummaryByCustomerOrderIDResponse is the struct that GetOrderHistorySummaryByCustomerOrderID responses are unpacked into
type GetOrderHistorySummaryByOrderIDRequest ¶
type GetOrderHistorySummaryByOrderIDRequest struct { // https://api.valr.com/v1/orders/history/summary/orderid/:orderId // Order ID // required: true ID string `json:"orderId" url:"orderId"` }
GetOrderHistorySummaryByOrderIDRequest is the request struct for GetOrderHistorySummaryByOrderID
type GetOrderHistorySummaryByOrderIDResponse ¶
type GetOrderHistorySummaryByOrderIDResponse struct { OrderID string `json:"orderId"` OrderStatusType bool `json:"orderStatusType"` Pair string `json:"currencyPair"` AveragePrice decimal.Decimal `json:"averagePrice"` OriginalPrice decimal.Decimal `json:"originalPrice"` RemainingQuantity decimal.Decimal `json:"remainingQuantity"` OriginalQuantity decimal.Decimal `json:"originalQuantity"` Total decimal.Decimal `json:"total"` TotalFee decimal.Decimal `json:"totalFee"` FeeCurrency string `json:"feeCurrency"` OrderSide ResponseSide `json:"orderSide"` OrderType string `json:"orderType"` FailedReason string `json:"failedReason"` OrderUpdatedAt time.Time `json:"orderUpdatedAt"` OrderCreatedAt time.Time `json:"orderCreatedAt"` }
GetOrderHistorySummaryByOrderIDResponse is the struct that GetOrderHistorySummaryByOrderID responses are unpacked into
type GetOrderStatusByCustomerOrderIDRequest ¶
type GetOrderStatusByCustomerOrderIDRequest struct { // https://api.valr.com/v1/orders/:currencyPair/customerorderid/:customerOrderId // Currency Pair // Customer Order ID // required: true Pair string `json:"currencyPair" url:"currencyPair"` ID string `json:"customerOrderId" url:"customerOrderId"` }
GetOrderStatusByCustomerOrderIDRequest is the request struct for GetOrderStatusByCustomerOrderID
type GetOrderStatusByCustomerOrderIDResponse ¶
type GetOrderStatusByCustomerOrderIDResponse struct {
GetOrderStatusByOrderIDResponse
}
GetOrderStatusByCustomerOrderIDResponse is the struct that GetOrderStatusByCustomerOrderID responses are unpacked into
type GetOrderStatusByOrderIDRequest ¶
type GetOrderStatusByOrderIDRequest struct { // https://api.valr.com/v1/orders/:currencyPair/orderid/:orderId // Currency Pair // Order ID // required: true Pair string `json:"currencyPair" url:"currencyPair"` ID string `json:"orderId" url:"orderId"` }
GetOrderStatusByOrderIDRequest is the request struct for GetOrderStatusByOrderID
type GetOrderStatusByOrderIDResponse ¶
type GetOrderStatusByOrderIDResponse struct { OrderID string `json:"orderId"` OrderStatusType bool `json:"orderStatusType"` CurrencyPair string `json:"currencyPair"` OriginalPrice decimal.Decimal `json:"originalPrice"` RemainingQuantity decimal.Decimal `json:"remainingQuantity"` OriginalQuantity decimal.Decimal `json:"originalQuantity"` OrderSide ResponseSide `json:"orderSide"` OrderType string `json:"orderType"` FailedReason string `json:"failedReason"` CustomerOrderID string `json:"customerOrderId"` OrderUpdatedAt time.Time `json:"orderUpdatedAt"` OrderCreatedAt time.Time `json:"orderCreatedAt"` }
GetOrderStatusByOrderIDResponse is the struct that GetOrderStatusByOrderID responses are unpacked into
type GetOrderTypesForPairRequest ¶
type GetOrderTypesForPairRequest struct { // https://api.valr.com/v1/public/:currencyPair/ordertypes // Currency Pair // required: true Pair string `json:"currencyPair" url:"currencyPair"` }
GetOrderTypesForPairRequest is the request struct for GetOrderTypesForPair
type GetOrderTypesForPairResponse ¶
type GetOrderTypesForPairResponse []string
GetOrderTypesForPairResponse is the type that GetOrderTypesForPair responses are unpacked into
type GetOrderTypesRequest ¶
type GetOrderTypesRequest struct { }
GetOrderTypesRequest is the request struct for GetOrderTypes
type GetOrderTypesResponse ¶
type GetOrderTypesResponse []OrderTypes
GetOrderTypesResponse is the type that GetOrderTypes responses are unpacked into
type GetServerTimeRequest ¶
type GetServerTimeRequest struct { }
GetServerTimeRequest is the request struct for GetServerTime
type GetServerTimeResponse ¶
GetServerTimeResponse is the struct that GetServerTime responses are unpacked into
type GetSimpleBuyOrSellOrderStatusRequest ¶
type GetSimpleBuyOrSellOrderStatusRequest struct { // https://api.valr.com/v1/simple/:currencyPair/order/:orderId // Currency Pair // Order ID // required: true Pair string `json:"currencyPair" url:"currencyPair"` ID string `json:"orderId" url:"orderId"` }
GetSimpleBuyOrSellOrderStatusRequest is the request struct for GetSimpleBuyOrSellOrderStatus
type GetSimpleBuyOrSellOrderStatusResponse ¶
type GetSimpleBuyOrSellOrderStatusResponse struct { OrderID string `json:"orderId"` Success bool `json:"success"` Processing bool `json:"processing"` PaidAmount decimal.Decimal `json:"paidAmount"` PaidCurrency string `json:"paidCurrency"` ReceiveAmount decimal.Decimal `json:"receivedAmount"` FeeAmount decimal.Decimal `json:"feeAmount"` FeeCurrency string `json:"feeCurrency"` OrderExecutedAt time.Time `json:"orderExecutedAt"` }
GetSimpleBuyOrSellOrderStatusResponse is the struct that GetSimpleBuyOrSellOrderStatus responses are unpacked into
type GetTradeHistoryForPairRequest ¶
type GetTradeHistoryForPairRequest struct { // https://api.valr.com/v1/account/:currencyPair/tradehistory?limit=10 // Currency Pair // required: true // Limit // required: false Pair string `json:"currencyPair" url:"currencyPair"` Limit int `json:"limit" url:"limit"` }
GetTradeHistoryForPairRequest is the request struct for GetTradeHistoryForPair
type GetTradeHistoryForPairResponse ¶
type GetTradeHistoryForPairResponse []TradeInfo
GetTradeHistoryForPairResponse is the type that GetTradeHistoryForPair responses are unpacked into
type GetTransactionHistoryRequest ¶
type GetTransactionHistoryRequest struct { // https://api.valr.com/v1/account/transactionhistory?skip=0&limit=100 // Skip // Limit // required: false Skip int `json:"skip" url:"skip"` Limit int `json:"limit" url:"limit"` }
GetTransactionHistoryRequest is the request struct for GetTransactionHistory
type GetTransactionHistoryResponse ¶
type GetTransactionHistoryResponse []TransactionInfo
GetTransactionHistoryResponse is the type that GetTransactionHistory responses are unpacked into
type GetWithdrawHistoryForAssetRequest ¶
type GetWithdrawHistoryForAssetRequest struct { // https://api.valr.com/v1/wallet/crypto/:currencyCode/withdraw/history?skip=0&limit=10 // Currency Code // required: true // Skip // Limit // required: false Asset string `json:"currencyCode" url:"currencyCode"` Skip int `json:"skip" url:"skip"` Limit int `json:"limit" url:"limit"` }
GetWithdrawHistoryForAssetRequest is the request struct for GetWithdrawHistoryForAsset
type GetWithdrawHistoryForAssetResponse ¶
type GetWithdrawHistoryForAssetResponse []WithdrawInfo
GetWithdrawHistoryForAssetResponse is the type that GetWithdrawHistoryForAsset responses are unpacked into
type GetWithdrawInfoRequest ¶
type GetWithdrawInfoRequest struct { // https://api.valr.com/v1/wallet/crypto/:currencyCode/withdraw // Currency Code // required: true Asset string `json:"currencyCode" url:"currencyCode"` }
GetWithdrawInfoRequest is the request struct for GetWithdrawInfo
type GetWithdrawInfoResponse ¶
type GetWithdrawInfoResponse struct { Currency string `json:"currency"` MinimumWithdrawAmount decimal.Decimal `json:"minimumWithdrawAmount"` Active bool `json:"isActive"` WithdrawCost decimal.Decimal `json:"withdrawCost"` SupportsPaymentReference bool `json:"supportsPaymentReference"` }
GetWithdrawInfoResponse is the struct that GetWithdrawInfo responses are unpacked into
type GetWithdrawStatusRequest ¶
type GetWithdrawStatusRequest struct { // https://api.valr.com/v1/wallet/crypto/:currencyCode/withdraw/:withdrawId // Currency Code // Withdraw ID // required: true Asset string `json:"currencyCode" url:"currencyCode"` ID string `json:"withdrawId" url:"withdrawId"` }
GetWithdrawStatusRequest is the request struct for GetWithdrawStatus
type GetWithdrawStatusResponse ¶
type GetWithdrawStatusResponse struct {
WithdrawInfo
}
GetWithdrawStatusResponse is the struct that GetWithdrawStatus responses are unpacked into
type MarketSummary ¶
type MarketSummary struct { Pair string `json:"currencyPair"` AskPrice decimal.Decimal `json:"askPrice"` BidPrice decimal.Decimal `json:"bidPrice"` LastPrice decimal.Decimal `json:"lastTradedPrice"` ClosePrice decimal.Decimal `json:"previousClosePrice"` BaseVolume decimal.Decimal `json:"baseVolume"` HighPrice decimal.Decimal `json:"highPrice"` LowPrice decimal.Decimal `json:"lowPrice"` Created time.Time `json:"created"` ChangeFromPrevious string `json:"changeFromPrevious"` }
MarketSummary holds market summary information
type OpenOrder ¶
type OpenOrder struct { OrderID string `json:"orderId"` Side ResponseSide `json:"side"` Price decimal.Decimal `json:"price"` Pair string `json:"currencyPair"` CreatedAt time.Time `json:"createdAt"` RemainingQuantity decimal.Decimal `json:"remainingQuantity"` OriginalQuantity decimal.Decimal `json:"originalQuantity"` FilledPercentage decimal.Decimal `json:"filledPercentage"` CustomerOrderID string `json:"customerOrderId"` }
OpenOrder holds info for an open order on the market
type OrderBook ¶
type OrderBook struct { Asks []OrderBookEntry `json:"Asks"` Bids []OrderBookEntry `json:"Bids"` }
OrderBook holds OrderBookEntries
type OrderBookEntry ¶
type OrderBookEntry struct { Price decimal.Decimal `json:"price"` Quantity decimal.Decimal `json:"quantity"` Side string `json:"side"` Pair string `json:"currencyPair"` OrderCount int `json:"orderCount"` }
OrderBookEntry is a single entry in an OrderBook
type OrderReceipt ¶
type OrderReceipt struct { OrderID string `json:"orderId"` CustomerOrderID string `json:"customerOrderId"` OrderStatusType bool `json:"orderStatusType"` Pair string `json:"currencyPair"` AveragePrice decimal.Decimal `json:"averagePrice"` OriginalPrice decimal.Decimal `json:"originalPrice"` Quantity decimal.Decimal `json:"quantity"` OriginalQuantity decimal.Decimal `json:"originalQuantity"` Total decimal.Decimal `json:"total"` TotalFee decimal.Decimal `json:"totalFee"` OrderSide ResponseSide `json:"orderSide"` OrderType string `json:"orderType"` FailedReason string `json:"failedReason"` OrderUpdatedAt time.Time `json:"orderUpdatedAt"` OrderCreatedAt time.Time `json:"orderCreatedAt"` }
OrderReceipt collects info for a successful order
type OrderStatus ¶
type OrderStatus struct { OrderID string `json:"orderId"` OrderStatusType string `json:"orderStatusType"` Pair string `json:"currencyPair"` OriginalPrice decimal.Decimal `json:"originalPrice"` RemainingQuantity decimal.Decimal `json:"remainingQuantity"` OriginalQuantity decimal.Decimal `json:"originalQuantity"` OrderSide ResponseSide `json:"orderSide"` OrderType string `json:"orderType"` FailedReason string `json:"failedReason"` OrderUpdatedAt time.Time `json:"orderUpdatedAt"` OrderCreatedAt time.Time `json:"orderCreatedAt"` CustomerOrderID string `json:"customerOrderId"` }
OrderStatus holds info related to the status of a specific order
type OrderTypes ¶
type OrderTypes struct { Pair string `json:"currencyPair"` OrderTypes []string `json:"orderTypes"` }
OrderTypes associates order types with a specific pair
type PairInfo ¶
type PairInfo struct { Symbol string `json:"symbol"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` ShortName string `json:"shortName"` Active bool `json:"active"` MinBaseAmount decimal.Decimal `json:"minBaseAmount"` MaxBaseAmount decimal.Decimal `json:"maxBaseAmount"` MinQuoteAmount decimal.Decimal `json:"minQuoteAmount"` MaxQuoteAmount decimal.Decimal `json:"maxQuoteAmount"` }
PairInfo holds info for a specific pair
type PostLimitOrderRequest ¶
type PostLimitOrderRequest struct { // https://api.valr.com/v1/orders/limit // Currency Pair // Quantity // Price // Side // required: true // Post Only // Customer Order ID // required: false Pair string `json:"pair" url:"pair"` Quantity decimal.Decimal `json:"quantity" url:"quantity"` Price decimal.Decimal `json:"price" url:"price"` Side RequestSide `json:"side" url:"side"` PostOnly bool `json:"postOnly" url:"postOnly"` CustomerOrderID string `json:"customerOrderId" url:"customerOrderId"` }
PostLimitOrderRequest is the request struct for PostLimitOrder
type PostLimitOrderResponse ¶
type PostLimitOrderResponse struct {
ID string `json:"id"`
}
PostLimitOrderResponse is the struct that PostLimitOrder responses are unpacked into
type PostMarketOrderBuyRequest ¶
type PostMarketOrderBuyRequest struct { // https://api.valr.com/v1/orders/market // Currency Pair // Quantity // Side // required: true // Customer Order ID // required: false Side RequestSide `json:"side" url:"side"` Quantity decimal.Decimal `json:"quoteAmount" url:"quoteAmount"` Pair string `json:"pair" url:"pair"` CustomerOrderID string `json:"customerOrderId" url:"customerOrderId"` }
PostMarketOrderBuyRequest is the request struct for PostMarketOrder
type PostMarketOrderResponse ¶
type PostMarketOrderResponse struct {
ID string `json:"id"`
}
PostMarketOrderResponse is the struct that PostMarketOrder responses are unpacked into
type PostMarketOrderSellRequest ¶
type PostMarketOrderSellRequest struct { // https://api.valr.com/v1/orders/market // Currency Pair // Quantity // Side // required: true // Customer Order ID // required: false Side RequestSide `json:"side" url:"side"` Quantity decimal.Decimal `json:"baseAmount" url:"baseAmount"` Pair string `json:"pair" url:"pair"` CustomerOrderID string `json:"customerOrderId" url:"customerOrderId"` }
PostMarketOrderBuyRequest is the request struct for PostMarketOrder
type PostNewCryptoWithdrawRequest ¶
type PostNewCryptoWithdrawRequest struct { // https://api.valr.com/v1/wallet/crypto/:currencyCode/withdraw // Currency Code // Amount // Address // required: true Asset string `json:"currencyCode" url:"currencyCode"` Amount decimal.Decimal `json:"amount" url:"amount"` Address string `json:"address" url:"address"` }
PostNewCryptoWithdrawRequest is the request struct for PostNewCryptoWithdraw
type PostNewCryptoWithdrawResponse ¶
type PostNewCryptoWithdrawResponse struct {
ID string `json:"id"`
}
PostNewCryptoWithdrawResponse is the struct that PostNewCryptoWithdraw responses are unpacked into
type PostNewFiatWithdrawRequest ¶
type PostNewFiatWithdrawRequest struct { // https://api.valr.com/v1/wallet/fiat/:currencyCode/withdraw // Currency Code // Amount // BankAccountID // required: true Asset string `json:"currencyCode" url:"currencyCode"` Amount decimal.Decimal `json:"amount" url:"amount"` BankAccountID string `json:"linkedBankAccountId" url:"linkedBankAccountId"` }
PostNewFiatWithdrawRequest is the request struct for PostNewFiatWithdraw
type PostNewFiatWithdrawResponse ¶
type PostNewFiatWithdrawResponse struct {
ID string `json:"id"`
}
PostNewFiatWithdrawResponse is the struct that PostNewFiatWithdraw responses are unpacked into
type PostSimpleBuyOrSellOrderRequest ¶
type PostSimpleBuyOrSellOrderRequest struct { // https://api.valr.com/v1/simple/:currencyPair/order // Currency Pair // Pay in currency // Pay amount // Side // required: true Pair string `json:"currencyPair" url:"currencyPair"` PayInCurrency string `json:"payInCurrency" url:"payInCurrency"` PayAmount decimal.Decimal `json:"payAmount" url:"payAmount"` Side RequestSide `json:"side" url:"side"` }
PostSimpleBuyOrSellOrderRequest is the request struct for PostSimpleBuyOrSellOrder
type PostSimpleBuyOrSellOrderResponse ¶
type PostSimpleBuyOrSellOrderResponse struct { Code string `json:"code"` Message string `json:"message"` }
PostSimpleBuyOrSellOrderResponse is the struct that PostSimpleBuyOrSellOrder responses are unpacked into
type PostSimpleBuyOrSellQuoteRequest ¶
type PostSimpleBuyOrSellQuoteRequest struct { // https://api.valr.com/v1/simple/:currencyPair/quote // Currency Pair // Pay in currency // Pay amount // Side // required: true Pair string `json:"currencyPair" url:"currencyPair"` PayInCurrency string `json:"payInCurrency" url:"payInCurrency"` PayAmount decimal.Decimal `json:"payAmount" url:"payAmount"` Side RequestSide `json:"side" url:"side"` }
PostSimpleBuyOrSellQuoteRequest is the request stuct for PostSimpleBuyOrSellQuote
type PostSimpleBuyOrSellQuoteResponse ¶
type PostSimpleBuyOrSellQuoteResponse struct { Pair string `json:"currencyPair"` PayAmount decimal.Decimal `json:"payAmount"` ReceiveAmount decimal.Decimal `json:"receiveAmount"` Fee decimal.Decimal `json:"fee"` FeeCurrency string `json:"feeCurrency"` CreatedAt time.Time `json:"createdAt"` OrderID string `json:"id"` }
PostSimpleBuyOrSellQuoteResponse is the struct that PostSimpleBuyOrSellQuote responses are unpacked into
type RequestSide ¶
type RequestSide string
RequestSide type for explicitly representing the two options
const ( BUY RequestSide = "BUY" SELL RequestSide = "SELL" )
type ResponseSide ¶
type ResponseSide string
ResponseSide type for explicitly representing the two options
const ( Buy ResponseSide = "buy" Sell ResponseSide = "sell" )
type TradeHistoryInfo ¶
type TradeHistoryInfo struct { Price decimal.Decimal `json:"price"` Quantity decimal.Decimal `json:"quantity"` Pair string `json:"currencyPair"` TradedAt time.Ticker `json:"tradedAt"` TakerSide ResponseSide `json:"takerSide"` SequenceID int `json:"sequenceId"` ID string `json:"id"` }
TradeHistoryInfo is the data for a specific trade in trade history
type TradeInfo ¶
type TradeInfo struct { Price decimal.Decimal `json:"price"` Quantity decimal.Decimal `json:"quantity"` Pair string `json:"currencyPair"` TradedAt time.Ticker `json:"tradedAt"` Side ResponseSide `json:"side"` TradeID int `json:"tradeId"` }
TradeInfo holds info about a specific trade
type TransactionInfo ¶
type TransactionInfo struct { TransactionType TransactionType `json:"transactionType"` DebitCurrency string `json:"debitCurrency"` DebitValue decimal.Decimal `json:"debitValue"` CreditCurrency string `json:"creditCurrency"` CreditValue decimal.Decimal `json:"creditValue"` FeeCurrency string `json:"feeCurrency"` FeeValue decimal.Decimal `json:"feeValue"` EventAt time.Time `json:"eventAt"` AdditionalInfo AdditionalTransactionInfo `json:"additionalInfo"` }
TransactionInfo holds transaction info
type TransactionType ¶
TransactionType associates a transction type with its description
type WithdrawInfo ¶
type WithdrawInfo struct { Currency string `json:"currency"` Address string `json:"address"` Amount decimal.Decimal `json:"amount"` FeeAmount decimal.Decimal `json:"feeAmount"` TransactionHash string `json:"transactionHash"` Confirmations int `json:"confirmations"` LastConfirmationAt time.Time `json:"lastConfirmationAt"` UniqueID string `json:"uniqueId"` CreateAt time.Time `json:"createdAt"` Verified bool `json:"verified"` State string `json:"status"` }
WithdrawInfo holds info about a specific withdraw