Documentation
¶
Overview ¶
Package luno is a wrapper for the Luno API.
Index ¶
- Constants
- func IsErrorCode(err error, code string) bool
- type AccountBalance
- type AccountType
- type AddressMeta
- type BankAccountType
- type CancelWithdrawalRequest
- type CancelWithdrawalResponse
- type Candle
- type Client
- func (cl *Client) CancelWithdrawal(ctx context.Context, req *CancelWithdrawalRequest) (*CancelWithdrawalResponse, error)
- func (cl *Client) CreateAccount(ctx context.Context, req *CreateAccountRequest) (*CreateAccountResponse, error)
- func (cl *Client) CreateBeneficiary(ctx context.Context, req *CreateBeneficiaryRequest) (*CreateBeneficiaryResponse, error)
- func (cl *Client) CreateFundingAddress(ctx context.Context, req *CreateFundingAddressRequest) (*CreateFundingAddressResponse, error)
- func (cl *Client) CreateWithdrawal(ctx context.Context, req *CreateWithdrawalRequest) (*CreateWithdrawalResponse, error)
- func (cl *Client) DeleteBeneficiary(ctx context.Context, req *DeleteBeneficiaryRequest) error
- func (cl *Client) GetBalances(ctx context.Context, req *GetBalancesRequest) (*GetBalancesResponse, error)
- func (cl *Client) GetCandles(ctx context.Context, req *GetCandlesRequest) (*GetCandlesResponse, error)
- func (cl *Client) GetFeeInfo(ctx context.Context, req *GetFeeInfoRequest) (*GetFeeInfoResponse, error)
- func (cl *Client) GetFundingAddress(ctx context.Context, req *GetFundingAddressRequest) (*GetFundingAddressResponse, error)
- func (cl *Client) GetMove(ctx context.Context, req *GetMoveRequest) (*GetMoveResponse, error)
- func (cl *Client) GetOrder(ctx context.Context, req *GetOrderRequest) (*GetOrderResponse, error)
- func (cl *Client) GetOrderBook(ctx context.Context, req *GetOrderBookRequest) (*GetOrderBookResponse, error)
- func (cl *Client) GetOrderBookFull(ctx context.Context, req *GetOrderBookFullRequest) (*GetOrderBookFullResponse, error)
- func (cl *Client) GetOrderV2(ctx context.Context, req *GetOrderV2Request) (*GetOrderV2Response, error)
- func (cl *Client) GetOrderV3(ctx context.Context, req *GetOrderV3Request) (*GetOrderV3Response, error)
- func (cl *Client) GetTicker(ctx context.Context, req *GetTickerRequest) (*GetTickerResponse, error)
- func (cl *Client) GetTickers(ctx context.Context, req *GetTickersRequest) (*GetTickersResponse, error)
- func (cl *Client) GetWithdrawal(ctx context.Context, req *GetWithdrawalRequest) (*GetWithdrawalResponse, error)
- func (cl *Client) ListBeneficiaries(ctx context.Context, req *ListBeneficiariesRequest) (*ListBeneficiariesResponse, error)
- func (cl *Client) ListMoves(ctx context.Context, req *ListMovesRequest) (*ListMovesResponse, error)
- func (cl *Client) ListOrders(ctx context.Context, req *ListOrdersRequest) (*ListOrdersResponse, error)
- func (cl *Client) ListOrdersV2(ctx context.Context, req *ListOrdersV2Request) (*ListOrdersV2Response, error)
- func (cl *Client) ListPendingTransactions(ctx context.Context, req *ListPendingTransactionsRequest) (*ListPendingTransactionsResponse, error)
- func (cl *Client) ListTrades(ctx context.Context, req *ListTradesRequest) (*ListTradesResponse, error)
- func (cl *Client) ListTransactions(ctx context.Context, req *ListTransactionsRequest) (*ListTransactionsResponse, error)
- func (cl *Client) ListTransfers(ctx context.Context, req *ListTransfersRequest) (*ListTransfersResponse, error)
- func (cl *Client) ListUserTrades(ctx context.Context, req *ListUserTradesRequest) (*ListUserTradesResponse, error)
- func (cl *Client) ListWithdrawals(ctx context.Context, req *ListWithdrawalsRequest) (*ListWithdrawalsResponse, error)
- func (cl *Client) Markets(ctx context.Context, req *MarketsRequest) (*MarketsResponse, error)
- func (cl *Client) Move(ctx context.Context, req *MoveRequest) (*MoveResponse, error)
- func (cl *Client) PostLimitOrder(ctx context.Context, req *PostLimitOrderRequest) (*PostLimitOrderResponse, error)
- func (cl *Client) PostMarketOrder(ctx context.Context, req *PostMarketOrderRequest) (*PostMarketOrderResponse, error)
- func (cl *Client) Send(ctx context.Context, req *SendRequest) (*SendResponse, error)
- func (cl *Client) SendFee(ctx context.Context, req *SendFeeRequest) (*SendFeeResponse, 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) SetRateLimiter(rateLimiter Limiter)
- func (cl *Client) SetTimeout(timeout time.Duration)
- func (cl *Client) StopOrder(ctx context.Context, req *StopOrderRequest) (*StopOrderResponse, error)
- func (cl *Client) UpdateAccountName(ctx context.Context, req *UpdateAccountNameRequest) (*UpdateAccountNameResponse, error)
- func (cl *Client) Validate(ctx context.Context, req *ValidateRequest) (*ValidateResponse, error)
- type CreateAccountRequest
- type CreateAccountResponse
- type CreateBeneficiaryRequest
- type CreateBeneficiaryResponse
- type CreateFundingAddressRequest
- type CreateFundingAddressResponse
- type CreateWithdrawalRequest
- type CreateWithdrawalResponse
- type CryptoDetails
- type DeleteBeneficiaryRequest
- type DetailFields
- type Error
- type FundsMove
- type GetBalancesRequest
- type GetBalancesResponse
- type GetCandlesRequest
- type GetCandlesResponse
- type GetFeeInfoRequest
- type GetFeeInfoResponse
- type GetFundingAddressRequest
- type GetFundingAddressResponse
- type GetMoveRequest
- type GetMoveResponse
- type GetOrderBookFullRequest
- type GetOrderBookFullResponse
- type GetOrderBookRequest
- type GetOrderBookResponse
- type GetOrderRequest
- type GetOrderResponse
- type GetOrderV2Request
- type GetOrderV2Response
- type GetOrderV3Request
- type GetOrderV3Response
- type GetTickerRequest
- type GetTickerResponse
- type GetTickersRequest
- type GetTickersResponse
- type GetWithdrawalRequest
- type GetWithdrawalResponse
- type Kind
- type Limiter
- type ListBeneficiariesRequest
- type ListBeneficiariesResponse
- type ListMovesRequest
- type ListMovesResponse
- type ListOrdersRequest
- type ListOrdersResponse
- type ListOrdersV2Request
- type ListOrdersV2Response
- type ListPendingTransactionsRequest
- type ListPendingTransactionsResponse
- type ListTradesRequest
- type ListTradesResponse
- type ListTransactionsRequest
- type ListTransactionsResponse
- type ListTransfersRequest
- type ListTransfersResponse
- type ListUserTradesRequest
- type ListUserTradesResponse
- type ListWithdrawalsRequest
- type ListWithdrawalsResponse
- type MarketInfo
- type MarketsRequest
- type MarketsResponse
- type MoveRequest
- type MoveResponse
- type Order
- type OrderBookEntry
- type OrderState
- type OrderType
- type OrderV2
- type PostLimitOrderRequest
- type PostLimitOrderResponse
- type PostMarketOrderRequest
- type PostMarketOrderResponse
- type PublicTrade
- type QueryValuer
- type SendFeeRequest
- type SendFeeResponse
- type SendRequest
- type SendResponse
- type Side
- type Status
- type StopDirection
- type StopOrderRequest
- type StopOrderResponse
- type Ticker
- type Time
- type TimeInForce
- type TradeDetails
- type TradeV2
- type TradingStatus
- type Transaction
- type Transfer
- type Type
- type UpdateAccountNameRequest
- type UpdateAccountNameResponse
- type ValidateRequest
- type ValidateResponse
- type Withdrawal
Constants ¶
const Version = "0.0.33"
Variables ¶
This section is empty.
Functions ¶
func IsErrorCode ¶ added in v0.0.19
IsErrorCode returns whether an error is identifiable by a given code. This can be used to handle luno.Client errors. Any other errors will cause this to return false.
Types ¶
type AccountBalance ¶
type AccountBalance struct { // ID of the account. AccountId string `json:"account_id"` // Currency code for the asset held in this account. Asset string `json:"asset"` // The amount available to send or trade. Balance decimal.Decimal `json:"balance"` // The name set by the user upon creating the account. Name string `json:"name"` // Amount locked by Luno and cannot be sent or traded. This could be due to // open orders. Reserved decimal.Decimal `json:"reserved"` // Amount that is awaiting some sort of verification to be credited to this // account. This could be an on-chain transaction that Luno is waiting for // further block verifications to happen. Unconfirmed decimal.Decimal `json:"unconfirmed"` }
type AccountType ¶ added in v0.0.32
type AccountType string
const ( AccountTypeCurrentcheque AccountType = "Current/Cheque" AccountTypeSavings AccountType = "Savings" AccountTypeTransmission AccountType = "Transmission" )
type AddressMeta ¶ added in v0.0.12
type BankAccountType ¶ added in v0.0.32
type BankAccountType string
const ( BankAccountTypeCurrentcheque BankAccountType = "Current/Cheque" BankAccountTypeSavings BankAccountType = "Savings" BankAccountTypeTransmission BankAccountType = "Transmission" )
type CancelWithdrawalRequest ¶
type CancelWithdrawalRequest struct { // ID of the withdrawal to cancel. // // required: true Id int64 `json:"id" url:"id"` }
CancelWithdrawalRequest is the request struct for CancelWithdrawal.
type CancelWithdrawalResponse ¶
type CancelWithdrawalResponse struct { // Amount to withdraw Amount decimal.Decimal `json:"amount"` // Unix time the withdrawal was initiated, in milliseconds CreatedAt Time `json:"created_at"` // Withdrawal currency. Currency string `json:"currency"` // External ID has the value that was passed in when the Withdrawal request was posted. ExternalId string `json:"external_id"` // Withdrawal fee Fee decimal.Decimal `json:"fee"` Id string `json:"id"` // Status Status Status `json:"status"` // Transfer ID is the identifier of the Withdrawal's transfer once it completes. TransferId string `json:"transfer_id"` // Type distinguishes between different withdrawal methods where more than one is supported // for the given currency. Type string `json:"type"` }
CancelWithdrawalResponse is the response struct for CancelWithdrawal.
type Candle ¶ added in v0.0.26
type Candle struct { // Closing price Close decimal.Decimal `json:"close"` // High price High decimal.Decimal `json:"high"` // Low price Low decimal.Decimal `json:"low"` // Opening price Open decimal.Decimal `json:"open"` // Unix timestamp in milliseconds Timestamp Time `json:"timestamp"` // Volume traded Volume decimal.Decimal `json:"volume"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Luno API client.
func NewClient ¶
func NewClient() *Client
NewClient creates a new Luno API client with the default base URL.
func (*Client) CancelWithdrawal ¶
func (cl *Client) CancelWithdrawal(ctx context.Context, req *CancelWithdrawalRequest) (*CancelWithdrawalResponse, error)
CancelWithdrawal makes a call to DELETE /api/1/withdrawals/{id}.
Cancels a withdrawal request. This can only be done if the request is still in state <code>PENDING</code>.
Permissions required: <code>Perm_W_Withdrawals</code>
func (*Client) CreateAccount ¶
func (cl *Client) CreateAccount(ctx context.Context, req *CreateAccountRequest) (*CreateAccountResponse, error)
CreateAccount makes a call to POST /api/1/accounts.
This request creates an Account for the specified currency. Please note that the balances for the Account will be displayed based on the <code>asset</code> value, which is the currency the Account is based on.
Permissions required: <code>Perm_W_Addresses</code>
func (*Client) CreateBeneficiary ¶ added in v0.0.32
func (cl *Client) CreateBeneficiary(ctx context.Context, req *CreateBeneficiaryRequest) (*CreateBeneficiaryResponse, error)
CreateBeneficiary makes a call to POST /api/1/beneficiaries.
Create a new beneficiary.
Permissions required: <code>Perm_W_Beneficiaries</code>
func (*Client) CreateFundingAddress ¶
func (cl *Client) CreateFundingAddress(ctx context.Context, req *CreateFundingAddressRequest) (*CreateFundingAddressResponse, error)
CreateFundingAddress makes a call to POST /api/1/funding_address.
Allocates a new receive address to your account. There is a rate limit of 1 address per hour, but bursts of up to 10 addresses are allowed. Only 1 Ethereum receive address can be created.
Permissions required: <code>Perm_W_Addresses</code>
func (*Client) CreateWithdrawal ¶
func (cl *Client) CreateWithdrawal(ctx context.Context, req *CreateWithdrawalRequest) (*CreateWithdrawalResponse, error)
CreateWithdrawal makes a call to POST /api/1/withdrawals.
Creates a new withdrawal request to the specified beneficiary.
Permissions required: <code>Perm_W_Withdrawals</code>
func (*Client) DeleteBeneficiary ¶ added in v0.0.32
func (cl *Client) DeleteBeneficiary(ctx context.Context, req *DeleteBeneficiaryRequest) error
DeleteBeneficiary makes a call to DELETE /api/1/beneficiaries/{id}.
Delete a beneficiary ¶
Permissions required: <code>Perm_W_Beneficiaries</code>
func (*Client) GetBalances ¶
func (cl *Client) GetBalances(ctx context.Context, req *GetBalancesRequest) (*GetBalancesResponse, error)
GetBalances makes a call to GET /api/1/balance.
The list of all Accounts and their respective balances for the requesting user.
Permissions required: <code>Perm_R_Balance</code>
func (*Client) GetCandles ¶ added in v0.0.26
func (cl *Client) GetCandles(ctx context.Context, req *GetCandlesRequest) (*GetCandlesResponse, error)
GetCandles makes a call to GET /api/exchange/1/candles.
Get candlestick market data from the specified time until now, from the oldest to the most recent.
Permissions required: <code>MP_None</code>
func (*Client) GetFeeInfo ¶
func (cl *Client) GetFeeInfo(ctx context.Context, req *GetFeeInfoRequest) (*GetFeeInfoResponse, error)
GetFeeInfo makes a call to GET /api/1/fee_info.
Returns the fees and 30 day trading volume (as of midnight) for a given currency pair. For complete details, please see <a href="en/countries">Fees & Features</a>.
Permissions required: <code>Perm_R_Orders</code>
func (*Client) GetFundingAddress ¶
func (cl *Client) GetFundingAddress(ctx context.Context, req *GetFundingAddressRequest) (*GetFundingAddressResponse, error)
GetFundingAddress makes a call to GET /api/1/funding_address.
Returns the default receive address associated with your account and the amount received via the address. Users can specify an optional address parameter to return information for a non-default receive address. In the response, <code>total_received</code> is the total confirmed amount received excluding unconfirmed transactions. <code>total_unconfirmed</code> is the total sum of unconfirmed receive transactions.
Permissions required: <code>Perm_R_Addresses</code>
func (*Client) GetMove ¶ added in v0.0.26
func (cl *Client) GetMove(ctx context.Context, req *GetMoveRequest) (*GetMoveResponse, error)
GetMove makes a call to GET /api/exchange/1/move.
Get a specific move funds instruction by either <code>id</code> or <code>client_move_id</code>. If both are provided an API error will be returned.
Permissions required: <code>MP_None</code>
func (*Client) GetOrder ¶
func (cl *Client) GetOrder(ctx context.Context, req *GetOrderRequest) (*GetOrderResponse, error)
GetOrder makes a call to GET /api/1/orders/{id}.
Get an Order's details by its ID.
Permissions required: <code>Perm_R_Orders</code>
func (*Client) GetOrderBook ¶
func (cl *Client) GetOrderBook(ctx context.Context, req *GetOrderBookRequest) (*GetOrderBookResponse, error)
GetOrderBook makes a call to GET /api/1/orderbook_top.
This request returns the best 100 `bids` and `asks`, for the currency pair specified, in the Order Book.
`asks` are sorted by price ascending and `bids` are sorted by price descending.
Multiple orders at the same price are aggregated.
func (*Client) GetOrderBookFull ¶ added in v0.0.3
func (cl *Client) GetOrderBookFull(ctx context.Context, req *GetOrderBookFullRequest) (*GetOrderBookFullResponse, error)
GetOrderBookFull makes a call to GET /api/1/orderbook.
This request returns all `bids` and `asks`, for the currency pair specified, in the Order Book.
`asks` are sorted by price ascending and `bids` are sorted by price descending.
Multiple orders at the same price are not aggregated.
<b>WARNING:</b> This may return a large amount of data. Users are recommended to use the <a href="#operation/getOrderBookTop">top 100 bids and asks</a> or the <a href="#tag/Streaming-API">Streaming API</a>.
func (*Client) GetOrderV2 ¶ added in v0.0.16
func (cl *Client) GetOrderV2(ctx context.Context, req *GetOrderV2Request) (*GetOrderV2Response, error)
GetOrderV2 makes a call to GET /api/exchange/2/orders/{id}.
Get the details for an order.
Permissions required: <code>Perm_R_Orders</code>
func (*Client) GetOrderV3 ¶ added in v0.0.26
func (cl *Client) GetOrderV3(ctx context.Context, req *GetOrderV3Request) (*GetOrderV3Response, error)
GetOrderV3 makes a call to GET /api/exchange/3/order.
Get the details for an order by order reference or client order ID. Exactly one of the two parameters must be provided, otherwise an error is returned. Permissions required: <code>Perm_R_Orders</code>
func (*Client) GetTicker ¶
func (cl *Client) GetTicker(ctx context.Context, req *GetTickerRequest) (*GetTickerResponse, error)
GetTicker makes a call to GET /api/1/ticker.
Returns the latest ticker indicators for the specified currency pair.
Please see the <a href="#tag/currency ">Currency list</a> for the complete list of supported currency pairs.
func (*Client) GetTickers ¶
func (cl *Client) GetTickers(ctx context.Context, req *GetTickersRequest) (*GetTickersResponse, error)
GetTickers makes a call to GET /api/1/tickers.
Returns the latest ticker indicators from all active Luno exchanges.
Please see the <a href="#tag/currency ">Currency list</a> for the complete list of supported currency pairs.
func (*Client) GetWithdrawal ¶
func (cl *Client) GetWithdrawal(ctx context.Context, req *GetWithdrawalRequest) (*GetWithdrawalResponse, error)
GetWithdrawal makes a call to GET /api/1/withdrawals/{id}.
Returns the status of a particular withdrawal request.
Permissions required: <code>Perm_R_Withdrawals</code>
func (*Client) ListBeneficiaries ¶ added in v0.0.32
func (cl *Client) ListBeneficiaries(ctx context.Context, req *ListBeneficiariesRequest) (*ListBeneficiariesResponse, error)
ListBeneficiaries makes a call to GET /api/1/beneficiaries.
Returns a list of bank beneficiaries.
Permissions required: <code>Perm_R_Beneficiaries</code>
func (*Client) ListMoves ¶ added in v0.0.26
func (cl *Client) ListMoves(ctx context.Context, req *ListMovesRequest) (*ListMovesResponse, error)
ListMoves makes a call to GET /api/exchange/1/move/list_moves.
Returns a list of the most recent moves ordered from newest to oldest. This endpoint will list up to 100 most recent moves by default.
Permissions required: <code>MP_None</code>
func (*Client) ListOrders ¶
func (cl *Client) ListOrders(ctx context.Context, req *ListOrdersRequest) (*ListOrdersResponse, error)
ListOrders makes a call to GET /api/1/listorders.
Returns a list of the most recently placed Orders. Users can specify an optional <code>state=PENDING</code> parameter to restrict the results to only open Orders. Users can also specify the market by using the optional currency pair parameter.
Permissions required: <code>Perm_R_Orders</code>
func (*Client) ListOrdersV2 ¶ added in v0.0.16
func (cl *Client) ListOrdersV2(ctx context.Context, req *ListOrdersV2Request) (*ListOrdersV2Response, error)
ListOrdersV2 makes a call to GET /api/exchange/2/listorders.
Returns a list of the most recently placed orders ordered from newest to oldest. This endpoint will list up to 100 most recent open orders by default.
<b>Please note:</b> This data is archived 100 days after an exchange order is completed.
Permissions required: <Code>Perm_R_Orders</Code>
func (*Client) ListPendingTransactions ¶
func (cl *Client) ListPendingTransactions(ctx context.Context, req *ListPendingTransactionsRequest) (*ListPendingTransactionsResponse, error)
ListPendingTransactions makes a call to GET /api/1/accounts/{id}/pending.
Return a list of all transactions that have not completed for the Account.
Pending transactions are not numbered, and may be reordered, deleted or updated at any time.
Permissions required: <code>Perm_R_Transactions</code>
func (*Client) ListTrades ¶
func (cl *Client) ListTrades(ctx context.Context, req *ListTradesRequest) (*ListTradesResponse, error)
ListTrades makes a call to GET /api/1/trades.
Returns a list of recent trades for the specified currency pair. At most 100 trades are returned per call and never trades older than 24h. The trades are sorted from newest to oldest.
Please see the <a href="#tag/currency ">Currency list</a> for the complete list of supported currency pairs.
func (*Client) ListTransactions ¶
func (cl *Client) ListTransactions(ctx context.Context, req *ListTransactionsRequest) (*ListTransactionsResponse, error)
ListTransactions makes a call to GET /api/1/accounts/{id}/transactions.
Return a list of transaction entries from an account.
Transaction entry rows are numbered sequentially starting from 1, where 1 is the oldest entry. The range of rows to return are specified with the <code>min_row</code> (inclusive) and <code>max_row</code> (exclusive) parameters. At most 1000 rows can be requested per call.
If <code>min_row</code> or <code>max_row</code> is non-positive, the range wraps around the most recent row. For example, to fetch the 100 most recent rows, use <code>min_row=-100</code> and <code>max_row=0</code>.
Permissions required: <code>Perm_R_Transactions</code>
func (*Client) ListTransfers ¶ added in v0.0.26
func (cl *Client) ListTransfers(ctx context.Context, req *ListTransfersRequest) (*ListTransfersResponse, error)
ListTransfers makes a call to GET /api/exchange/1/transfers.
Returns a list of the most recent confirmed transfers ordered from newest to oldest. This includes bank transfers, card payments, or on-chain transactions that have been reflected on your account available balance.
Note that the Transfer `amount` is always a positive value and you should use the `inbound` flag to determine the direction of the transfer.
If you need to paginate the results you can set the `before` parameter to the last returned transfer `created_at` field value and repeat the request until you have all the transfers you need. This endpoint will list up to 100 transfers at a time by default.
Permissions required: <Code>Perm_R_Transfers</Code>
func (*Client) ListUserTrades ¶
func (cl *Client) ListUserTrades(ctx context.Context, req *ListUserTradesRequest) (*ListUserTradesResponse, error)
ListUserTrades makes a call to GET /api/1/listtrades.
Returns a list of the recent Trades for a given currency pair for this user, sorted by oldest first. If <code>before</code> is specified, then Trades are returned sorted by most-recent first.
<code>type</code> in the response indicates the type of Order that was placed to participate in the trade. Possible types: <code>BID</code>, <code>ASK</code>.
If <code>is_buy</code> in the response is true, then the Order which completed the trade (market taker) was a Bid Order.
Results of this query may lag behind the latest data.
Permissions required: <code>Perm_R_Orders</code>
func (*Client) ListWithdrawals ¶
func (cl *Client) ListWithdrawals(ctx context.Context, req *ListWithdrawalsRequest) (*ListWithdrawalsResponse, error)
ListWithdrawals makes a call to GET /api/1/withdrawals.
Returns a list of withdrawal requests.
Permissions required: <code>Perm_R_Withdrawals</code>
func (*Client) Markets ¶ added in v0.0.16
func (cl *Client) Markets(ctx context.Context, req *MarketsRequest) (*MarketsResponse, error)
Markets makes a call to GET /api/exchange/1/markets.
List all supported markets parameter information like price scale, min and max order volumes and market ID.
func (*Client) Move ¶ added in v0.0.26
func (cl *Client) Move(ctx context.Context, req *MoveRequest) (*MoveResponse, error)
Move makes a call to POST /api/exchange/1/move.
Move funds between two of your transactional accounts with the same currency The funds may not be moved by the time the request returns. The GET method can be used to poll for the move's status.
Note: moves will show as transactions, but not as transfers.
Permissions required: <code>MP_None_Write</code>
func (*Client) PostLimitOrder ¶
func (cl *Client) PostLimitOrder(ctx context.Context, req *PostLimitOrderRequest) (*PostLimitOrderResponse, error)
PostLimitOrder makes a call to POST /api/1/postorder.
<b>Warning!</b> Orders cannot be reversed once they have executed. Please ensure your program has been thoroughly tested before submitting Orders.
If no <code>base_account_id</code> or <code>counter_account_id</code> are specified, your default base currency or counter currency account will be used. You can find your Account IDs by calling the <a href="#operation/getBalances">Balances</a> API.
Permissions required: <code>Perm_W_Orders</code>
func (*Client) PostMarketOrder ¶
func (cl *Client) PostMarketOrder(ctx context.Context, req *PostMarketOrderRequest) (*PostMarketOrderResponse, error)
PostMarketOrder makes a call to POST /api/1/marketorder.
A Market Order executes immediately, and either buys as much of the asset that can be bought for a set amount of fiat currency, or sells a set amount of the asset for as much as possible.
<b>Warning!</b> Orders cannot be reversed once they have executed. Please ensure your program has been thoroughly tested before submitting Orders.
If no <code>base_account_id</code> or <code>counter_account_id</code> are specified, the default base currency or counter currency account will be used. Users can find their account IDs by calling the <a href="#operation/getBalances">Balances</a> request.
Permissions required: <code>Perm_W_Orders</code>
func (*Client) Send ¶
func (cl *Client) Send(ctx context.Context, req *SendRequest) (*SendResponse, error)
Send makes a call to POST /api/1/send.
Send assets from an Account. Please note that the asset type sent must match the receive address of the same cryptocurrency of the same type - Bitcoin to Bitcoin, Ethereum to Ethereum, etc.
Sends can be made to cryptocurrency receive addresses.
<b>Note:</b> This is currently unavailable to users who are verified in countries with money travel rules.
Permissions required: <code>Perm_W_Send</code>
func (*Client) SendFee ¶ added in v0.0.26
func (cl *Client) SendFee(ctx context.Context, req *SendFeeRequest) (*SendFeeResponse, error)
SendFee makes a call to GET /api/1/send_fee.
Calculate fees involved with a crypto send request.
Send address can be to a cryptocurrency receive address, or the email address of another Luno platform user.
Permissions required: <code>MP_None</code>
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 ¶ added in v0.0.3
SetHTTPClient sets the HTTP client that will be used for API calls.
func (*Client) SetRateLimiter ¶ added in v0.0.29
SetRateLimiter sets the rate limiter that will be used to throttle calls made through the client.
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.
func (*Client) StopOrder ¶
func (cl *Client) StopOrder(ctx context.Context, req *StopOrderRequest) (*StopOrderResponse, error)
StopOrder makes a call to POST /api/1/stoporder.
Request to cancel an Order.
<b>Note!</b>: Once an Order has been completed, it can not be reversed. The return value from this request will indicate if the Stop request was successful or not.
Permissions required: <code>Perm_W_Orders</code>
func (*Client) UpdateAccountName ¶ added in v0.0.12
func (cl *Client) UpdateAccountName(ctx context.Context, req *UpdateAccountNameRequest) (*UpdateAccountNameResponse, error)
UpdateAccountName makes a call to PUT /api/1/accounts/{id}/name.
Update the name of an account with a given ID.
Permissions required: <code>Perm_W_Addresses</code>
func (*Client) Validate ¶ added in v0.0.30
func (cl *Client) Validate(ctx context.Context, req *ValidateRequest) (*ValidateResponse, error)
Validate makes a call to POST /api/1/address/validate.
Validate receive addresses, to which a customer wishes to make cryptocurrency sends, are verified under covering regulatory requirements for the customer such as travel rules.
Permissions required: <code>Perm_W_Send</code>
type CreateAccountRequest ¶
type CreateAccountRequest struct { // The currency code for the Account you want to create. Please see the Currency section for a detailed list of currencies supported by the Luno platform. // // Users must be verified to trade currency in order to be able to create an Account. For more information on the verification process, please see <a href="/help/en/articles/1000168396">How do I verify my identity?</a>. // // Users have a limit of 10 accounts per currency. // // required: true Currency string `json:"currency" url:"currency"` // The label to use for this account // // required: true Name string `json:"name" url:"name"` }
CreateAccountRequest is the request struct for CreateAccount.
type CreateAccountResponse ¶
type CreateAccountResponse struct { Currency string `json:"currency"` Id string `json:"id"` Name string `json:"name"` }
CreateAccountResponse is the response struct for CreateAccount.
type CreateBeneficiaryRequest ¶ added in v0.0.32
type CreateBeneficiaryRequest struct { // Bank account type // // required: true AccountType AccountType `json:"account_type" url:"account_type"` // Beneficiary bank account number // // required: true BankAccountNumber string `json:"bank_account_number" url:"bank_account_number"` // Bank SWIFT code // // required: true BankName string `json:"bank_name" url:"bank_name"` // The owner of the recipient account // // required: true BankRecipient string `json:"bank_recipient" url:"bank_recipient"` }
CreateBeneficiaryRequest is the request struct for CreateBeneficiary.
type CreateBeneficiaryResponse ¶ added in v0.0.32
type CreateBeneficiaryResponse struct {
Id string `json:"id"`
}
CreateBeneficiaryResponse is the response struct for CreateBeneficiary.
type CreateFundingAddressRequest ¶
type CreateFundingAddressRequest struct { // Currency code of the asset. // // required: true Asset string `json:"asset" url:"asset"` // An optional account_id to assign the new Receive Address too AccountId int64 `json:"account_id" url:"account_id"` // An optional name for the new Receive Address Name string `json:"name" url:"name"` }
CreateFundingAddressRequest is the request struct for CreateFundingAddress.
type CreateFundingAddressResponse ¶
type CreateFundingAddressResponse struct { AccountId string `json:"account_id"` Address string `json:"address"` AddressMeta []AddressMeta `json:"address_meta"` Asset string `json:"asset"` AssignedAt Time `json:"assigned_at"` Name string `json:"name"` QrCodeUri string `json:"qr_code_uri"` ReceiveFee decimal.Decimal `json:"receive_fee"` TotalReceived decimal.Decimal `json:"total_received"` TotalUnconfirmed decimal.Decimal `json:"total_unconfirmed"` }
CreateFundingAddressResponse is the response struct for CreateFundingAddress.
type CreateWithdrawalRequest ¶
type CreateWithdrawalRequest struct { // Amount to withdraw. The currency withdrawn depends on the type setting. // // required: true Amount decimal.Decimal `json:"amount" url:"amount"` // Withdrawal method. // // required: true Type string `json:"type" url:"type"` // The beneficiary ID of the bank account the withdrawal will be paid out to. // This parameter is required if the user has set up multiple beneficiaries. // The beneficiary ID can be found by selecting on the beneficiary name on the user’s <a href="/wallet/beneficiaries">Beneficiaries</a> page. BeneficiaryId int64 `json:"beneficiary_id" url:"beneficiary_id"` // Optional unique ID to associate with this withdrawal. // Useful to prevent duplicate sends. // This field supports all alphanumeric characters including "-" and "_". ExternalId string `json:"external_id" url:"external_id"` // If true, it will be a fast withdrawal if possible. Fast withdrawals come with a fee. // Currently fast withdrawals are only available for `type=ZAR_EFT`; for other types, an error is returned. // Fast withdrawals are not possible for Bank of Baroda, Deutsche Bank, Merrill Lynch South Africa, UBS, Postbank and Tyme Bank. // The fee to be charged is the same as when withdrawing from the UI. Fast bool `json:"fast" url:"fast"` // For internal use. // Deprecated: We don't allow custom references and will remove this soon. Reference string `json:"reference" url:"reference"` }
CreateWithdrawalRequest is the request struct for CreateWithdrawal.
type CreateWithdrawalResponse ¶
type CreateWithdrawalResponse struct { // Amount to withdraw Amount decimal.Decimal `json:"amount"` // Unix time the withdrawal was initiated, in milliseconds CreatedAt Time `json:"created_at"` // Withdrawal currency. Currency string `json:"currency"` // External ID has the value that was passed in when the Withdrawal request was posted. ExternalId string `json:"external_id"` // Withdrawal fee Fee decimal.Decimal `json:"fee"` Id string `json:"id"` // Status Status Status `json:"status"` // Transfer ID is the identifier of the Withdrawal's transfer once it completes. TransferId string `json:"transfer_id"` // Type distinguishes between different withdrawal methods where more than one is supported // for the given currency. Type string `json:"type"` }
CreateWithdrawalResponse is the response struct for CreateWithdrawal.
type CryptoDetails ¶ added in v0.0.9
type DeleteBeneficiaryRequest ¶ added in v0.0.32
type DeleteBeneficiaryRequest struct { // ID of the Beneficiary to delete. // // required: true Id int64 `json:"id" url:"id"` }
DeleteBeneficiaryRequest is the request struct for DeleteBeneficiary.
type DetailFields ¶ added in v0.0.9
type DetailFields struct { CryptoDetails CryptoDetails `json:"crypto_details"` TradeDetails TradeDetails `json:"trade_details"` }
type Error ¶
type Error struct { // Code can be used to identify errors even if the error message is // localised. Code string `json:"error_code"` // Message may be localised for authenticated API calls. Message string `json:"error"` }
Error is a Luno API error.
type FundsMove ¶ added in v0.0.26
type FundsMove struct { // The assets quantity to move from the debit account to credit account. This is always a positive value. Amount decimal.Decimal `json:"amount"` // User defined unique ID ClientMoveId string `json:"client_move_id"` // Unix time the move was initiated, in milliseconds CreatedAt Time `json:"created_at"` // The account to credit the funds to. CreditAccountId string `json:"credit_account_id"` // The account to debit the funds from. DebitAccountId string `json:"debit_account_id"` // Unique ID, defined by Luno Id string `json:"id"` // Current status of the move. // // Status meaning:<br> // <code>CREATED</code> The move is awaiting execution.<br> // <code>MOVING</code> The funds have been reserved and the move is being executed.<br> // <code>SUCCESSFUL</code> The move has completed successfully and should be reflected in both accounts available // balance.<br> // <code>FAILED</code> The move has failed. There could be many reasons for this but the most likely is that the // debit account doesn't have enough available funds to move.<br> Status Status `json:"status"` // Unix time the move was last updated, in milliseconds UpdatedAt Time `json:"updated_at"` }
type GetBalancesRequest ¶
type GetBalancesRequest struct { // Only return balances for wallets with these currencies (if not provided, // all balances will be returned). To request balances for multiple currencies, // pass the parameter multiple times, // e.g. `assets=XBT&assets=ETH`. Assets []string `json:"assets" url:"assets"` }
GetBalancesRequest is the request struct for GetBalances.
type GetBalancesResponse ¶
type GetBalancesResponse struct {
Balance []AccountBalance `json:"balance"`
}
GetBalancesResponse is the response struct for GetBalances.
type GetCandlesRequest ¶ added in v0.0.26
type GetCandlesRequest struct { // Candle duration in seconds. // For example, 300 corresponds to 5m candles. Currently supported // durations are: 60 (1m), 300 (5m), 900 (15m), 1800 (30m), 3600 (1h), // 10800 (3h), 14400 (4h), 28800 (8h), 86400 (24h), 259200 (3d), 604800 // (7d). // // required: true Duration int64 `json:"duration" url:"duration"` // Currency pair // // required: true Pair string `json:"pair" url:"pair"` // Filter to candles starting on or after this timestamp (Unix milliseconds). // Only up to 1000 of the earliest candles are returned. // // required: true Since Time `json:"since" url:"since"` }
GetCandlesRequest is the request struct for GetCandles.
type GetCandlesResponse ¶ added in v0.0.26
type GetCandlesResponse struct { Candles []Candle `json:"candles"` // Duration in seconds Duration int64 `json:"duration"` Pair string `json:"pair"` }
GetCandlesResponse is the response struct for GetCandles.
type GetFeeInfoRequest ¶
type GetFeeInfoRequest struct { // Get fee information about this pair. // // required: true Pair string `json:"pair" url:"pair"` }
GetFeeInfoRequest is the request struct for GetFeeInfo.
type GetFeeInfoResponse ¶
type GetFeeInfoResponse struct { MakerFee string `json:"maker_fee"` TakerFee string `json:"taker_fee"` ThirtyDayVolume string `json:"thirty_day_volume"` }
GetFeeInfoResponse is the response struct for GetFeeInfo.
type GetFundingAddressRequest ¶
type GetFundingAddressRequest struct { // Currency code of the asset. // // required: true Asset string `json:"asset" url:"asset"` // Specific cryptocurrency address to retrieve. If not provided, the // default address will be used. Address string `json:"address" url:"address"` }
GetFundingAddressRequest is the request struct for GetFundingAddress.
type GetFundingAddressResponse ¶
type GetFundingAddressResponse struct { AccountId string `json:"account_id"` Address string `json:"address"` AddressMeta []AddressMeta `json:"address_meta"` Asset string `json:"asset"` AssignedAt Time `json:"assigned_at"` Name string `json:"name"` QrCodeUri string `json:"qr_code_uri"` ReceiveFee decimal.Decimal `json:"receive_fee"` TotalReceived decimal.Decimal `json:"total_received"` TotalUnconfirmed decimal.Decimal `json:"total_unconfirmed"` }
GetFundingAddressResponse is the response struct for GetFundingAddress.
type GetMoveRequest ¶ added in v0.0.26
type GetMoveRequest struct { // Get by the user defined ID. This is mutually exclusive with <code>id</code> and is required if <code>id</code> is // not provided. ClientMoveId string `json:"client_move_id" url:"client_move_id"` // Get by the system ID. This is mutually exclusive with <code>client_move_id</code> and is required if // <code>client_move_id</code> is not provided. Id string `json:"id" url:"id"` }
GetMoveRequest is the request struct for GetMove.
type GetMoveResponse ¶ added in v0.0.26
type GetMoveResponse struct { // The assets quantity to move from the debit account to credit account. This is always a positive value. Amount decimal.Decimal `json:"amount"` // User defined unique ID ClientMoveId string `json:"client_move_id"` // Unix time the move was initiated, in milliseconds CreatedAt Time `json:"created_at"` // The account to credit the funds to. CreditAccountId string `json:"credit_account_id"` // The account to debit the funds from. DebitAccountId string `json:"debit_account_id"` // Unique ID, defined by Luno Id string `json:"id"` // Current status of the move. // // Status meaning:<br> // <code>CREATED</code> The move is awaiting execution.<br> // <code>MOVING</code> The funds have been reserved and the move is being executed.<br> // <code>SUCCESSFUL</code> The move has completed successfully and should be reflected in both accounts available // balance.<br> // <code>FAILED</code> The move has failed. There could be many reasons for this but the most likely is that the // debit account doesn't have enough available funds to move.<br> Status Status `json:"status"` // Unix time the move was last updated, in milliseconds UpdatedAt Time `json:"updated_at"` }
GetMoveResponse is the response struct for GetMove.
type GetOrderBookFullRequest ¶ added in v0.0.3
type GetOrderBookFullRequest struct { // Currency pair of the Orders to retrieve // // required: true Pair string `json:"pair" url:"pair"` }
GetOrderBookFullRequest is the request struct for GetOrderBookFull.
type GetOrderBookFullResponse ¶ added in v0.0.3
type GetOrderBookFullResponse struct { // List of asks sorted from lowest to highest price Asks []OrderBookEntry `json:"asks"` // List of bids sorted from highest to lowest price Bids []OrderBookEntry `json:"bids"` // Unix timestamp in milliseconds Timestamp int64 `json:"timestamp"` }
GetOrderBookFullResponse is the response struct for GetOrderBookFull.
type GetOrderBookRequest ¶
type GetOrderBookRequest struct { // Currency pair of the Orders to retrieve // // required: true Pair string `json:"pair" url:"pair"` }
GetOrderBookRequest is the request struct for GetOrderBook.
type GetOrderBookResponse ¶
type GetOrderBookResponse struct { // List of asks sorted from lowest to highest price Asks []OrderBookEntry `json:"asks"` // List of bids sorted from highest to lowest price Bids []OrderBookEntry `json:"bids"` // Unix timestamp in milliseconds Timestamp int64 `json:"timestamp"` }
GetOrderBookResponse is the response struct for GetOrderBook.
type GetOrderRequest ¶
type GetOrderRequest struct { // Order reference // // required: true Id string `json:"id" url:"id"` }
GetOrderRequest is the request struct for GetOrder.
type GetOrderResponse ¶
type GetOrderResponse struct { // Amount of base filled, this value is always positive. Base decimal.Decimal `json:"base"` // Time of order completion (Unix milliseconds) // // This value is set at the time of this order leaving the order book, // either immediately upon posting or later on due to a trade or cancellation. // Whilst the order is still pending/live it will be 0. CompletedTimestamp Time `json:"completed_timestamp"` // Amount of counter filled, this value is always positive. Counter decimal.Decimal `json:"counter"` // Time of order creation (Unix milliseconds) CreationTimestamp Time `json:"creation_timestamp"` // Time of order expiration (Unix milliseconds) // // This value is set at the time of processing a request from you to cancel the order, otherwise it will be 0. ExpirationTimestamp Time `json:"expiration_timestamp"` // Base amount of fees to be charged FeeBase decimal.Decimal `json:"fee_base"` // Counter amount of fees to be charged FeeCounter decimal.Decimal `json:"fee_counter"` // Limit price to transact LimitPrice decimal.Decimal `json:"limit_price"` // Limit volume to transact LimitVolume decimal.Decimal `json:"limit_volume"` OrderId string `json:"order_id"` // Specifies the market. Pair string `json:"pair"` // <code>PENDING</code> The order has been placed. Some trades may have // taken place but the order is not filled yet.<br> // <code>COMPLETE</code> The order is no longer active. It has been settled // or has been cancelled. State OrderState `json:"state"` // The Time in force option used when the LimitOrder was posted. // // Only returned on limit orders.<br> // <code>GTC</code> Good 'Til Cancelled. The order remains open until it is filled or cancelled by the user. (default)</br> // <code>IOC</code> Immediate Or Cancel. The part of the order that cannot be filled immediately will be cancelled. Cannot be post-only.</br> // <code>FOK</code> Fill Or Kill. If the order cannot be filled immediately and completely it will be cancelled before any trade. Cannot be post-only. TimeInForce string `json:"time_in_force"` // <code>BUY</code> buy market order.<br> // <code>SELL</code> sell market order.<br> // <code>BID</code> bid (buy) limit order.<br> // <code>ASK</code> ask (sell) limit order. Type OrderType `json:"type"` }
GetOrderResponse is the response struct for GetOrder.
type GetOrderV2Request ¶ added in v0.0.16
type GetOrderV2Request struct { // Order reference // // required: true Id string `json:"id" url:"id"` }
GetOrderV2Request is the request struct for GetOrderV2.
type GetOrderV2Response ¶ added in v0.0.16
type GetOrderV2Response struct { // Amount of base filled, this value is always positive. // // Use this field and `side` to determine credit or debit of funds. Base decimal.Decimal `json:"base"` // The base currency account BaseAccountId int64 `json:"base_account_id"` // Client Order ID has the value that was passed in when the Order was posted. ClientOrderId string `json:"client_order_id"` // Time of order completion (Unix milliseconds) // // This value is set at the time of this order leaving the order book, // either immediately upon posting or later on due to a trade or cancellation. // Whilst the order is still pending/live it will be 0. CompletedTimestamp Time `json:"completed_timestamp"` // Amount of counter filled, this value is always positive. // // Use this field and `side` to determine credit or debit of funds. Counter decimal.Decimal `json:"counter"` // The counter currency account CounterAccountId int64 `json:"counter_account_id"` // Time of order creation (Unix milliseconds) CreationTimestamp Time `json:"creation_timestamp"` // Time of order expiration (Unix milliseconds) // // This value is set at the time of processing a request from you to cancel the order, otherwise it will be 0. ExpirationTimestamp Time `json:"expiration_timestamp"` // Base amount of fees to be charged FeeBase decimal.Decimal `json:"fee_base"` // Counter amount of fees to be charged FeeCounter decimal.Decimal `json:"fee_counter"` // Limit price to transact LimitPrice decimal.Decimal `json:"limit_price"` // Limit volume to transact LimitVolume decimal.Decimal `json:"limit_volume"` // The order reference OrderId string `json:"order_id"` // Specifies the market Pair string `json:"pair"` // The intention of the order, whether to buy or sell funds in the market. // // You can use this to determine the flow of funds in the order. Side Side `json:"side"` // The current state of the order // // Status meaning:<br> // <code>AWAITING</code> The order is awaiting to enter the order book.<br> // <code>PENDING</code> The order is in the order book. Some trades may // have taken place but the order is not filled yet.<br> // <code>COMPLETE</code> The order is no longer in the order book. It has // been settled/filled or has been cancelled. Status Status `json:"status"` // Direction to trigger the order StopDirection StopDirection `json:"stop_direction"` // Price to trigger the order StopPrice decimal.Decimal `json:"stop_price"` // The Time in force option used when the LimitOrder was posted. // // Only returned on limit orders.<br> // <code>GTC</code> Good 'Til Cancelled. The order remains open until it is filled or cancelled by the user. (default)</br> // <code>IOC</code> Immediate Or Cancel. The part of the order that cannot be filled immediately will be cancelled. Cannot be post-only.</br> // <code>FOK</code> Fill Or Kill. If the order cannot be filled immediately and completely it will be cancelled before any trade. Cannot be post-only. TimeInForce string `json:"time_in_force"` // The order type Type Type `json:"type"` }
GetOrderV2Response is the response struct for GetOrderV2.
type GetOrderV3Request ¶ added in v0.0.26
type GetOrderV3Request struct { // Client Order ID has the value that was passed in when the Order was posted. ClientOrderId string `json:"client_order_id" url:"client_order_id"` // Order reference Id string `json:"id" url:"id"` }
GetOrderV3Request is the request struct for GetOrderV3.
type GetOrderV3Response ¶ added in v0.0.26
type GetOrderV3Response struct { // Amount of base filled, this value is always positive. // // Use this field and `side` to determine credit or debit of funds. Base decimal.Decimal `json:"base"` // The base currency account BaseAccountId int64 `json:"base_account_id"` // Client Order ID has the value that was passed in when the Order was posted. ClientOrderId string `json:"client_order_id"` // Time of order completion (Unix milliseconds) // // This value is set at the time of this order leaving the order book, // either immediately upon posting or later on due to a trade or cancellation. // Whilst the order is still pending/live it will be 0. CompletedTimestamp Time `json:"completed_timestamp"` // Amount of counter filled, this value is always positive. // // Use this field and `side` to determine credit or debit of funds. Counter decimal.Decimal `json:"counter"` // The counter currency account CounterAccountId int64 `json:"counter_account_id"` // Time of order creation (Unix milliseconds) CreationTimestamp Time `json:"creation_timestamp"` // Time of order expiration (Unix milliseconds) // // This value is set at the time of processing a request from you to cancel the order, otherwise it will be 0. ExpirationTimestamp Time `json:"expiration_timestamp"` // Base amount of fees to be charged FeeBase decimal.Decimal `json:"fee_base"` // Counter amount of fees to be charged FeeCounter decimal.Decimal `json:"fee_counter"` // Limit price to transact LimitPrice decimal.Decimal `json:"limit_price"` // Limit volume to transact LimitVolume decimal.Decimal `json:"limit_volume"` // The order reference OrderId string `json:"order_id"` // Specifies the market Pair string `json:"pair"` // The intention of the order, whether to buy or sell funds in the market. // // You can use this to determine the flow of funds in the order. Side Side `json:"side"` // The current state of the order // // Status meaning:<br> // <code>AWAITING</code> The order is awaiting to enter the order book.<br> // <code>PENDING</code> The order is in the order book. Some trades may // have taken place but the order is not filled yet.<br> // <code>COMPLETE</code> The order is no longer in the order book. It has // been settled/filled or has been cancelled. Status Status `json:"status"` // Direction to trigger the order StopDirection StopDirection `json:"stop_direction"` // Price to trigger the order StopPrice decimal.Decimal `json:"stop_price"` // The Time in force option used when the LimitOrder was posted. // // Only returned on limit orders.<br> // <code>GTC</code> Good 'Til Cancelled. The order remains open until it is filled or cancelled by the user. (default)</br> // <code>IOC</code> Immediate Or Cancel. The part of the order that cannot be filled immediately will be cancelled. Cannot be post-only.</br> // <code>FOK</code> Fill Or Kill. If the order cannot be filled immediately and completely it will be cancelled before any trade. Cannot be post-only. TimeInForce string `json:"time_in_force"` // The order type Type Type `json:"type"` }
GetOrderV3Response is the response struct for GetOrderV3.
type GetTickerRequest ¶
type GetTickerRequest struct { // Currency pair // // required: true Pair string `json:"pair" url:"pair"` }
GetTickerRequest is the request struct for GetTicker.
type GetTickerResponse ¶
type GetTickerResponse struct { // The lowest ask price Ask decimal.Decimal `json:"ask"` // The highest bid price Bid decimal.Decimal `json:"bid"` // Last trade price LastTrade decimal.Decimal `json:"last_trade"` Pair string `json:"pair"` // 24h rolling trade volume Rolling24HourVolume decimal.Decimal `json:"rolling_24_hour_volume"` // Market current status // // <code>ACTIVE</code> when the market is trading normally // // <code>POSTONLY</code> when the market has been suspended and only post-only orders will be accepted // // <code>DISABLED</code> when the market is shutdown and no orders can be accepted // // <code>UNKNOWN</code> the market status could not be determined. This is a temporary state. Status Status `json:"status"` // Unix timestamp in milliseconds of the tick Timestamp Time `json:"timestamp"` }
GetTickerResponse is the response struct for GetTicker.
type GetTickersRequest ¶
type GetTickersRequest struct { // Return tickers for multiple markets (if not provided, all tickers will be returned). // To request tickers for multiple markets, pass the parameter multiple times, // e.g. `pair=XBTZAR&pair=ETHZAR`. Pair []string `json:"pair" url:"pair"` }
GetTickersRequest is the request struct for GetTickers.
type GetTickersResponse ¶
type GetTickersResponse struct {
Tickers []Ticker `json:"tickers"`
}
GetTickersResponse is the response struct for GetTickers.
type GetWithdrawalRequest ¶
type GetWithdrawalRequest struct { // Withdrawal ID to retrieve. // // required: true Id int64 `json:"id" url:"id"` }
GetWithdrawalRequest is the request struct for GetWithdrawal.
type GetWithdrawalResponse ¶
type GetWithdrawalResponse struct { // Amount to withdraw Amount decimal.Decimal `json:"amount"` // Unix time the withdrawal was initiated, in milliseconds CreatedAt Time `json:"created_at"` // Withdrawal currency. Currency string `json:"currency"` // External ID has the value that was passed in when the Withdrawal request was posted. ExternalId string `json:"external_id"` // Withdrawal fee Fee decimal.Decimal `json:"fee"` Id string `json:"id"` // Status Status Status `json:"status"` // Transfer ID is the identifier of the Withdrawal's transfer once it completes. TransferId string `json:"transfer_id"` // Type distinguishes between different withdrawal methods where more than one is supported // for the given currency. Type string `json:"type"` }
GetWithdrawalResponse is the response struct for GetWithdrawal.
type ListBeneficiariesRequest ¶ added in v0.0.32
type ListBeneficiariesRequest struct {
BankRecipient string `json:"bank_recipient" url:"bank_recipient"`
}
ListBeneficiariesRequest is the request struct for ListBeneficiaries.
type ListBeneficiariesResponse ¶ added in v0.0.32
type ListBeneficiariesResponse struct {
Beneficiaries []beneficiary `json:"beneficiaries"`
}
ListBeneficiariesResponse is the response struct for ListBeneficiaries.
type ListMovesRequest ¶ added in v0.0.26
type ListMovesRequest struct { // Filter to moves requested before this timestamp (Unix milliseconds) Before int64 `json:"before" url:"before"` // Limit to this many moves Limit int64 `json:"limit" url:"limit"` }
ListMovesRequest is the request struct for ListMoves.
type ListMovesResponse ¶ added in v0.0.26
type ListMovesResponse struct {
Moves []FundsMove `json:"moves"`
}
ListMovesResponse is the response struct for ListMoves.
type ListOrdersRequest ¶
type ListOrdersRequest struct { // Filter to orders created before this timestamp (Unix milliseconds) CreatedBefore int64 `json:"created_before" url:"created_before"` // Limit to this many orders Limit int64 `json:"limit" url:"limit"` // Filter to only orders of this currency pair Pair string `json:"pair" url:"pair"` // Filter to only orders of this state State OrderState `json:"state" url:"state"` }
ListOrdersRequest is the request struct for ListOrders.
type ListOrdersResponse ¶
type ListOrdersResponse struct {
Orders []Order `json:"orders"`
}
ListOrdersResponse is the response struct for ListOrders.
type ListOrdersV2Request ¶ added in v0.0.16
type ListOrdersV2Request struct { // If true, will return closed orders instead of open orders. Closed bool `json:"closed" url:"closed"` // Filter to orders created before this timestamp (Unix milliseconds) CreatedBefore int64 `json:"created_before" url:"created_before"` // Limit to this many orders Limit int64 `json:"limit" url:"limit"` // Filter to only orders of this currency pair. Pair string `json:"pair" url:"pair"` }
ListOrdersV2Request is the request struct for ListOrdersV2.
type ListOrdersV2Response ¶ added in v0.0.16
type ListOrdersV2Response struct {
Orders []OrderV2 `json:"orders"`
}
ListOrdersV2Response is the response struct for ListOrdersV2.
type ListPendingTransactionsRequest ¶
type ListPendingTransactionsRequest struct { // Account ID // // required: true Id int64 `json:"id" url:"id"` }
ListPendingTransactionsRequest is the request struct for ListPendingTransactions.
type ListPendingTransactionsResponse ¶
type ListPendingTransactionsResponse struct { Currency string `json:"currency"` Id string `json:"id"` Name string `json:"name"` Pending []Transaction `json:"pending"` Transactions []Transaction `json:"transactions"` }
ListPendingTransactionsResponse is the response struct for ListPendingTransactions.
type ListTradesRequest ¶
type ListTradesRequest struct { // Currency pair of the market to list the trades from // // required: true Pair string `json:"pair" url:"pair"` // Fetch trades executed after this time, specified as a Unix timestamp in // milliseconds. An error will be returned if this is before 24h ago. Use // this parameter to either restrict to a shorter window or to iterate over // the trades in case you need more than the 100 most recent trades. Since Time `json:"since" url:"since"` }
ListTradesRequest is the request struct for ListTrades.
type ListTradesResponse ¶
type ListTradesResponse struct {
Trades []PublicTrade `json:"trades"`
}
ListTradesResponse is the response struct for ListTrades.
type ListTransactionsRequest ¶
type ListTransactionsRequest struct { // Account ID - the unique identifier for the specific Account. // // required: true Id int64 `json:"id" url:"id"` // Maximum of the row range to return (exclusive) // // required: true MaxRow int64 `json:"max_row" url:"max_row"` // Minimum of the row range to return (inclusive) // // required: true MinRow int64 `json:"min_row" url:"min_row"` }
ListTransactionsRequest is the request struct for ListTransactions.
type ListTransactionsResponse ¶
type ListTransactionsResponse struct { Id string `json:"id"` Transactions []Transaction `json:"transactions"` }
ListTransactionsResponse is the response struct for ListTransactions.
type ListTransfersRequest ¶ added in v0.0.26
type ListTransfersRequest struct { // Unique identifier of the account to list the transfers from. // // required: true AccountId int64 `json:"account_id" url:"account_id"` // Filter to transfers created before this timestamp (Unix milliseconds). // The default value (0) will return the latest transfers on the account. Before int64 `json:"before" url:"before"` // Limit to this many transfers. Limit int64 `json:"limit" url:"limit"` }
ListTransfersRequest is the request struct for ListTransfers.
type ListTransfersResponse ¶ added in v0.0.26
type ListTransfersResponse struct {
Transfers []Transfer `json:"transfers"`
}
ListTransfersResponse is the response struct for ListTransfers.
type ListUserTradesRequest ¶
type ListUserTradesRequest struct { // Filter to trades of this currency pair. // // required: true Pair string `json:"pair" url:"pair"` // Filter to trades from (including) this sequence number. // Default behaviour is not to include this filter. AfterSeq int64 `json:"after_seq" url:"after_seq"` // Filter to trades before this timestamp (Unix milliseconds). Before Time `json:"before" url:"before"` // Filter to trades before (excluding) this sequence number. // Default behaviour is not to include this filter. BeforeSeq int64 `json:"before_seq" url:"before_seq"` // Limit to this number of trades (default 100). Limit int64 `json:"limit" url:"limit"` // Filter to trades on or after this timestamp (Unix milliseconds). Since Time `json:"since" url:"since"` // If set to true, sorts trades in descending order, otherwise ascending // order will be assumed. SortDesc bool `json:"sort_desc" url:"sort_desc"` }
ListUserTradesRequest is the request struct for ListUserTrades.
type ListUserTradesResponse ¶
type ListUserTradesResponse struct {
Trades []TradeV2 `json:"trades"`
}
ListUserTradesResponse is the response struct for ListUserTrades.
type ListWithdrawalsRequest ¶
type ListWithdrawalsRequest struct { // Filter to withdrawals requested on or before the withdrawal with this ID. // Can be used for pagination. BeforeId int64 `json:"before_id" url:"before_id"` // Limit to this many withdrawals Limit int64 `json:"limit" url:"limit"` }
ListWithdrawalsRequest is the request struct for ListWithdrawals.
type ListWithdrawalsResponse ¶
type ListWithdrawalsResponse struct {
Withdrawals []Withdrawal `json:"withdrawals"`
}
ListWithdrawalsResponse is the response struct for ListWithdrawals.
type MarketInfo ¶ added in v0.0.16
type MarketInfo struct { // Base currency code BaseCurrency string `json:"base_currency"` // Counter currency code CounterCurrency string `json:"counter_currency"` // Fee decimal places FeeScale int64 `json:"fee_scale"` // Unique identifier for the market MarketId string `json:"market_id"` // Maximum order price MaxPrice decimal.Decimal `json:"max_price"` // Maximum order volume MaxVolume decimal.Decimal `json:"max_volume"` // Minimum order price MinPrice decimal.Decimal `json:"min_price"` // Minimum order volume MinVolume decimal.Decimal `json:"min_volume"` // Price decimal places PriceScale int64 `json:"price_scale"` // Current market trading status:<br> // <code>POST_ONLY</code> Trading is indefinitely suspended. This state is // commonly used when new markets are being launched to give traders enough // time to setup their orders before trading begins. When in this status, // orders can only be posted as post-only.<br> // <code>ACTIVE</code> Trading is fully enabled.<br> // <code>SUSPENDED</code> Trading has been temporarily suspended due to very // high volatility. When in this status, orders can only be posted as // post-only.<br> // <code>Unknown</code> Trading status is unknown. This could indicate a temporary error // on the market and should resolve shortly. TradingStatus TradingStatus `json:"trading_status"` // Volume decimal places VolumeScale int64 `json:"volume_scale"` }
type MarketsRequest ¶ added in v0.0.16
type MarketsRequest struct { // List of market pairs to return. Requesting only the required pairs will improve response times. Pair []string `json:"pair" url:"pair"` }
MarketsRequest is the request struct for Markets.
type MarketsResponse ¶ added in v0.0.16
type MarketsResponse struct {
Markets []MarketInfo `json:"markets"`
}
MarketsResponse is the response struct for Markets.
type MoveRequest ¶ added in v0.0.26
type MoveRequest struct { // Amount to transfer. Must be positive. // // required: true Amount decimal.Decimal `json:"amount" url:"amount"` // The account to credit the funds to. // // required: true CreditAccountId int64 `json:"credit_account_id" url:"credit_account_id"` // The account to debit the funds from. // // required: true DebitAccountId int64 `json:"debit_account_id" url:"debit_account_id"` // Client move ID. // May only contain alphanumeric (0-9, a-z, or A-Z) and special characters (_ ; , . -). Maximum length: 255. // It will be available in read endpoints, so you can use it to avoid duplicate moves between the same accounts. // Values must be unique across all your successful calls of this endpoint; trying to create a move request // with the same `client_move_id` as one of your past move requests will result in a HTTP 409 Conflict response. ClientMoveId string `json:"client_move_id" url:"client_move_id"` }
MoveRequest is the request struct for Move.
type MoveResponse ¶ added in v0.0.26
type MoveResponse struct { // Move unique identifier Id string `json:"id"` // The current state of the move. // // Status meaning:<br> // <code>CREATED</code> The move is awaiting execution.<br> // <code>MOVING</code> The funds have been reserved and the move is being executed.<br> // <code>SUCCESSFUL</code> The move has completed successfully and should be reflected in both accounts available // balance.<br> // <code>FAILED</code> The move has failed. There could be many reasons for this but the most likely is that the // debit account doesn't have enough available funds to move.<br> Status Status `json:"status"` }
MoveResponse is the response struct for Move.
type Order ¶
type Order struct { // Amount of base filled, this value is always positive. Base decimal.Decimal `json:"base"` // Time of order completion (Unix milliseconds) // // This value is set at the time of this order leaving the order book, // either immediately upon posting or later on due to a trade or cancellation. // Whilst the order is still pending/live it will be 0. CompletedTimestamp Time `json:"completed_timestamp"` // Amount of counter filled, this value is always positive. Counter decimal.Decimal `json:"counter"` // Time of order creation (Unix milliseconds) CreationTimestamp Time `json:"creation_timestamp"` // Time of order expiration (Unix milliseconds) // // This value is set at the time of processing a request from you to cancel the order, otherwise it will be 0. ExpirationTimestamp Time `json:"expiration_timestamp"` // Base amount of fees to be charged FeeBase decimal.Decimal `json:"fee_base"` // Counter amount of fees to be charged FeeCounter decimal.Decimal `json:"fee_counter"` // Limit price to transact LimitPrice decimal.Decimal `json:"limit_price"` // Limit volume to transact LimitVolume decimal.Decimal `json:"limit_volume"` OrderId string `json:"order_id"` // Specifies the market. Pair string `json:"pair"` // <code>PENDING</code> The order has been placed. Some trades may have // taken place but the order is not filled yet.<br> // <code>COMPLETE</code> The order is no longer active. It has been settled // or has been cancelled. State OrderState `json:"state"` // The Time in force option used when the LimitOrder was posted. // // Only returned on limit orders.<br> // <code>GTC</code> Good 'Til Cancelled. The order remains open until it is filled or cancelled by the user. (default)</br> // <code>IOC</code> Immediate Or Cancel. The part of the order that cannot be filled immediately will be cancelled. Cannot be post-only.</br> // <code>FOK</code> Fill Or Kill. If the order cannot be filled immediately and completely it will be cancelled before any trade. Cannot be post-only. TimeInForce string `json:"time_in_force"` // <code>BUY</code> buy market order.<br> // <code>SELL</code> sell market order.<br> // <code>BID</code> bid (buy) limit order.<br> // <code>ASK</code> ask (sell) limit order. Type OrderType `json:"type"` }
type OrderBookEntry ¶
type OrderState ¶
type OrderState string
const ( OrderStateComplete OrderState = "COMPLETE" OrderStatePending OrderState = "PENDING" )
type OrderV2 ¶ added in v0.0.16
type OrderV2 struct { // Amount of base filled, this value is always positive. // // Use this field and `side` to determine credit or debit of funds. Base decimal.Decimal `json:"base"` // The base currency account BaseAccountId int64 `json:"base_account_id"` // Client Order ID has the value that was passed in when the Order was posted. ClientOrderId string `json:"client_order_id"` // Time of order completion (Unix milliseconds) // // This value is set at the time of this order leaving the order book, // either immediately upon posting or later on due to a trade or cancellation. // Whilst the order is still pending/live it will be 0. CompletedTimestamp Time `json:"completed_timestamp"` // Amount of counter filled, this value is always positive. // // Use this field and `side` to determine credit or debit of funds. Counter decimal.Decimal `json:"counter"` // The counter currency account CounterAccountId int64 `json:"counter_account_id"` // Time of order creation (Unix milliseconds) CreationTimestamp Time `json:"creation_timestamp"` // Time of order expiration (Unix milliseconds) // // This value is set at the time of processing a request from you to cancel the order, otherwise it will be 0. ExpirationTimestamp Time `json:"expiration_timestamp"` // Base amount of fees to be charged FeeBase decimal.Decimal `json:"fee_base"` // Counter amount of fees to be charged FeeCounter decimal.Decimal `json:"fee_counter"` // Limit price to transact LimitPrice decimal.Decimal `json:"limit_price"` // Limit volume to transact LimitVolume decimal.Decimal `json:"limit_volume"` // The order reference OrderId string `json:"order_id"` // Specifies the market Pair string `json:"pair"` // The intention of the order, whether to buy or sell funds in the market. // // You can use this to determine the flow of funds in the order. Side Side `json:"side"` // The current state of the order // // Status meaning:<br> // <code>AWAITING</code> The order is awaiting to enter the order book.<br> // <code>PENDING</code> The order is in the order book. Some trades may // have taken place but the order is not filled yet.<br> // <code>COMPLETE</code> The order is no longer in the order book. It has // been settled/filled or has been cancelled. Status Status `json:"status"` // Direction to trigger the order StopDirection StopDirection `json:"stop_direction"` // Price to trigger the order StopPrice decimal.Decimal `json:"stop_price"` // The Time in force option used when the LimitOrder was posted. // // Only returned on limit orders.<br> // <code>GTC</code> Good 'Til Cancelled. The order remains open until it is filled or cancelled by the user. (default)</br> // <code>IOC</code> Immediate Or Cancel. The part of the order that cannot be filled immediately will be cancelled. Cannot be post-only.</br> // <code>FOK</code> Fill Or Kill. If the order cannot be filled immediately and completely it will be cancelled before any trade. Cannot be post-only. TimeInForce string `json:"time_in_force"` // The order type Type Type `json:"type"` }
type PostLimitOrderRequest ¶
type PostLimitOrderRequest struct { // The currency pair to trade. // // required: true Pair string `json:"pair" url:"pair"` // Limit price as a decimal string in units of ZAR/BTC. // // required: true Price decimal.Decimal `json:"price" url:"price"` // <code>BID</code> for a bid (buy) limit order<br> // <code>ASK</code> for an ask (sell) limit order // // required: true Type OrderType `json:"type" url:"type"` // Amount of cryptocurrency to buy or sell as a decimal string in units of the currency. // // required: true Volume decimal.Decimal `json:"volume" url:"volume"` // The base currency Account to use in the trade. BaseAccountId int64 `json:"base_account_id" url:"base_account_id"` // Client order ID. // May only contain alphanumeric (0-9, a-z, or A-Z) and special characters (_ ; , . -). Maximum length: 255. // It will be available in read endpoints, so you can use it to reconcile Luno with your internal system. // Values must be unique across all your successful order creation endpoint calls; trying to create an order // with the same `client_order_id` as one of your past orders will result in a HTTP 409 Conflict response. ClientOrderId string `json:"client_order_id" url:"client_order_id"` // The counter currency Account to use in the trade. CounterAccountId int64 `json:"counter_account_id" url:"counter_account_id"` // Post-only Orders will be cancelled if they would otherwise have traded // immediately. // For example, if there's a bid at ZAR 100,000 and you place a post-only ask at ZAR 100,000, // your order will be cancelled instead of trading. // If the best bid is ZAR 100,000 and you place a post-only ask at ZAR 101,000, // your order won't trade but will go into the order book. PostOnly bool `json:"post_only" url:"post_only"` // Side of the trigger price to activate the order. This should be set if `stop_price` is also // set. // // `RELATIVE_LAST_TRADE` will automatically infer the direction based on the last // trade price and the stop price. If last trade price is less than stop price then stop // direction is ABOVE otherwise is BELOW. StopDirection StopDirection `json:"stop_direction" url:"stop_direction"` // Trigger trade price to activate this order as a decimal string. If this // is set then this is treated as a Stop Limit Order and `stop_direction` // is expected to be set too. StopPrice decimal.Decimal `json:"stop_price" url:"stop_price"` // <code>GTC</code> Good 'Til Cancelled. The order remains open until it is filled or cancelled by the user.</br> // <code>IOC</code> Immediate Or Cancel. The part of the order that cannot be filled immediately will be cancelled. Cannot be post-only.</br> // <code>FOK</code> Fill Or Kill. If the order cannot be filled immediately and completely it will be cancelled before any trade. Cannot be post-only. TimeInForce TimeInForce `json:"time_in_force" url:"time_in_force"` // Unix timestamp in milliseconds of when the request was created and sent. Timestamp int64 `json:"timestamp" url:"timestamp"` // Specifies the number of milliseconds after timestamp the request is valid for. // If `timestamp` is not specified, `ttl` will not be used. Ttl int64 `json:"ttl" url:"ttl"` }
PostLimitOrderRequest is the request struct for PostLimitOrder.
type PostLimitOrderResponse ¶
type PostLimitOrderResponse struct { // Unique order identifier OrderId string `json:"order_id"` }
PostLimitOrderResponse is the response struct for PostLimitOrder.
type PostMarketOrderRequest ¶
type PostMarketOrderRequest struct { // The currency pair to trade. // // required: true Pair string `json:"pair" url:"pair"` // <code>BUY</code> to buy an asset<br> // <code>SELL</code> to sell an asset // // required: true Type OrderType `json:"type" url:"type"` // The base currency account to use in the trade. BaseAccountId int64 `json:"base_account_id" url:"base_account_id"` // For a <code>SELL</code> order: amount of the base currency to use (e.g. how much BTC to sell for EUR in the BTC/EUR market) BaseVolume decimal.Decimal `json:"base_volume" url:"base_volume"` // Client order ID. // May only contain alphanumeric (0-9, a-z, or A-Z) and special characters (_ ; , . -). Maximum length: 255. // It will be available in read endpoints, so you can use it to reconcile Luno with your internal system. // Values must be unique across all your successful order creation endpoint calls; trying to create an order // with the same `client_order_id` as one of your past orders will result in a HTTP 409 Conflict response. ClientOrderId string `json:"client_order_id" url:"client_order_id"` // The counter currency account to use in the trade. CounterAccountId int64 `json:"counter_account_id" url:"counter_account_id"` // For a <code>BUY</code> order: amount of the counter currency to use (e.g. how much EUR to use to buy BTC in the BTC/EUR market) CounterVolume decimal.Decimal `json:"counter_volume" url:"counter_volume"` // Unix timestamp in milliseconds of when the request was created and sent. Timestamp int64 `json:"timestamp" url:"timestamp"` // Specifies the number of milliseconds after timestamp the request is valid for. // If `timestamp` is not specified, `ttl` will not be used. Ttl int64 `json:"ttl" url:"ttl"` }
PostMarketOrderRequest is the request struct for PostMarketOrder.
type PostMarketOrderResponse ¶
type PostMarketOrderResponse struct { // Unique order identifier OrderId string `json:"order_id"` }
PostMarketOrderResponse is the response struct for PostMarketOrder.
type PublicTrade ¶ added in v0.0.26
type PublicTrade struct { // Whether the taker was buying or not. IsBuy bool `json:"is_buy"` // Price at which the asset traded at Price decimal.Decimal `json:"price"` // The ever incrementing trade identifier within a market Sequence int64 `json:"sequence"` // Unix timestamp in milliseconds Timestamp Time `json:"timestamp"` // Amount of assets traded Volume decimal.Decimal `json:"volume"` }
type QueryValuer ¶ added in v0.0.12
type QueryValuer interface {
QueryValue() string
}
type SendFeeRequest ¶ added in v0.0.26
type SendFeeRequest struct { // Destination address or email address. // // <b>Note</b>: // <ul> // <li>Ethereum addresses must be // <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md" target="_blank" rel="nofollow">checksummed</a>.</li> // <li>Ethereum sends to email addresses are not supported.</li> // </ul> // // required: true Address string `json:"address" url:"address"` // Amount to send as a decimal string. // // required: true Amount decimal.Decimal `json:"amount" url:"amount"` // Currency to send. // // required: true Currency string `json:"currency" url:"currency"` }
SendFeeRequest is the request struct for SendFee.
type SendFeeResponse ¶ added in v0.0.26
SendFeeResponse is the response struct for SendFee.
type SendRequest ¶
type SendRequest struct { // Destination address or email address. // // <b>Note</b>: // <ul> // <li>Ethereum addresses must be // <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md" target="_blank" rel="nofollow">checksummed</a>.</li> // <li>Ethereum sends to email addresses are not supported.</li> // </ul> // // required: true Address string `json:"address" url:"address"` // Amount to send as a decimal string. // // required: true Amount decimal.Decimal `json:"amount" url:"amount"` // Currency to send. // // required: true Currency string `json:"currency" url:"currency"` // Optional source account. In case of multiple accounts for a single currency, the source account that will provide the funds for the transaction may be specified. If omitted, the default account will be used. AccountId int64 `json:"account_id" url:"account_id"` // User description for the transaction to record on the account statement. Description string `json:"description" url:"description"` // Optional XRP destination tag. Note that HasDestinationTag must be true if this value is provided. DestinationTag int64 `json:"destination_tag" url:"destination_tag"` // Optional unique ID to associate with this withdrawal. // Useful to prevent duplicate sends in case of failure. // This supports all alphanumeric characters, as well as "-" and "_". ExternalId string `json:"external_id" url:"external_id"` // Only required for Foreign Exchange Notification under the Malaysia FEN rules. ForexNoticeSelfDeclaration must be true if the user has exceeded his/her annual investment limit in foreign currency assets. ForexNoticeSelfDeclaration bool `json:"forex_notice_self_declaration" url:"forex_notice_self_declaration"` // Optional boolean flag indicating that a XRP destination tag is provided (even if zero). HasDestinationTag bool `json:"has_destination_tag" url:"has_destination_tag"` // Only required for Foreign Exchange Notification under the Malaysia FEN rules. IsDRB must be true if the user has Domestic Ringgit Borrowing (DRB). IsDrb bool `json:"is_drb" url:"is_drb"` // Only required for Foreign Exchange Notification under the Malaysia FEN rules. IsForexSend must be true if sending to an address hosted outside of Malaysia. IsForexSend bool `json:"is_forex_send" url:"is_forex_send"` // Optional memo string used to provide account information for ATOM, etc. where it holds "account" information // for a generic address. Memo string `json:"memo" url:"memo"` // Message to send to the recipient. // This is only relevant when sending to an email address. Message string `json:"message" url:"message"` }
SendRequest is the request struct for Send.
type SendResponse ¶
type SendResponse struct { Success bool `json:"success"` WithdrawalId string `json:"withdrawal_id"` }
SendResponse is the response struct for Send.
type Status ¶ added in v0.0.8
type Status string
const ( StatusActive Status = "ACTIVE" StatusAwaiting Status = "AWAITING" StatusCancelled Status = "CANCELLED" StatusCancelling Status = "CANCELLING" StatusComplete Status = "COMPLETE" StatusCompleted Status = "COMPLETED" StatusCreated Status = "CREATED" StatusDisabled Status = "DISABLED" StatusFailed Status = "FAILED" StatusMoving Status = "MOVING" StatusPending Status = "PENDING" StatusPostonly Status = "POSTONLY" StatusProcessing Status = "PROCESSING" StatusSuccessful Status = "SUCCESSFUL" StatusUnknown Status = "UNKNOWN" StatusWaiting Status = "WAITING" )
type StopDirection ¶ added in v0.0.16
type StopDirection string
const ( StopDirectionAbove StopDirection = "ABOVE" StopDirectionBelow StopDirection = "BELOW" StopDirectionRelative_last_trade StopDirection = "RELATIVE_LAST_TRADE" )
type StopOrderRequest ¶
type StopOrderRequest struct { // The Order identifier as a string. // // required: true OrderId string `json:"order_id" url:"order_id"` }
StopOrderRequest is the request struct for StopOrder.
type StopOrderResponse ¶
type StopOrderResponse struct {
Success bool `json:"success"`
}
StopOrderResponse is the response struct for StopOrder.
type Ticker ¶
type Ticker struct { // The lowest ask price Ask decimal.Decimal `json:"ask"` // The highest bid price Bid decimal.Decimal `json:"bid"` // Last trade price LastTrade decimal.Decimal `json:"last_trade"` Pair string `json:"pair"` // 24h rolling trade volume Rolling24HourVolume decimal.Decimal `json:"rolling_24_hour_volume"` // Market current status // // <code>ACTIVE</code> when the market is trading normally // // <code>POSTONLY</code> when the market has been suspended and only post-only orders will be accepted // // <code>DISABLED</code> when the market is shutdown and no orders can be accepted // // <code>UNKNOWN</code> the market status could not be determined. This is a temporary state. Status Status `json:"status"` // Unix timestamp in milliseconds of the tick Timestamp Time `json:"timestamp"` }
type Time ¶
func (Time) MarshalJSON ¶
func (Time) QueryValue ¶ added in v0.0.12
func (*Time) UnmarshalJSON ¶
type TimeInForce ¶ added in v0.0.27
type TimeInForce string
const ( TimeInForceGtc TimeInForce = "GTC" TimeInForceIoc TimeInForce = "IOC" TimeInForceFok TimeInForce = "FOK" )
type TradeDetails ¶ added in v0.0.16
type TradeDetails struct { // Pair of the market Pair string `json:"pair"` // Price at which the volume traded for Price decimal.Decimal `json:"price"` // Sequence identifies the trade within a market Sequence int64 `json:"sequence"` // Volume is the amount of base traded Volume decimal.Decimal `json:"volume"` }
type TradeV2 ¶ added in v0.0.26
type TradeV2 struct { // Amount of base filled Base decimal.Decimal `json:"base"` // Client Order ID has the value that was passed in when the Order was posted. ClientOrderId string `json:"client_order_id"` // Amount of counter filled Counter decimal.Decimal `json:"counter"` // Base amount of fees charged FeeBase decimal.Decimal `json:"fee_base"` // Counter amount of fees charged FeeCounter decimal.Decimal `json:"fee_counter"` IsBuy bool `json:"is_buy"` // Unique order identifier OrderId string `json:"order_id"` // Currency pair Pair string `json:"pair"` // Order price Price decimal.Decimal `json:"price"` Sequence int64 `json:"sequence"` // Unix timestamp in milliseconds Timestamp Time `json:"timestamp"` // Order type Type OrderType `json:"type"` // Order volume Volume decimal.Decimal `json:"volume"` }
type TradingStatus ¶ added in v0.0.16
type TradingStatus string
const ( TradingStatusPost_only TradingStatus = "POST_ONLY" TradingStatusActive TradingStatus = "ACTIVE" TradingStatusSuspended TradingStatus = "SUSPENDED" TradingStatusUnknown TradingStatus = "UNKNOWN" )
type Transaction ¶
type Transaction struct { AccountId string `json:"account_id"` // Amount available Available decimal.Decimal `json:"available"` // Change in amount available AvailableDelta decimal.Decimal `json:"available_delta"` // Account balance Balance decimal.Decimal `json:"balance"` // Change in balance BalanceDelta decimal.Decimal `json:"balance_delta"` Currency string `json:"currency"` // Human-readable description of the transaction. Description string `json:"description"` DetailFields DetailFields `json:"detail_fields"` // Human-readable label-value attributes. Details map[string]string `json:"details"` // The kind of the transaction indicates the transaction flow // // Kinds explained:<br> // <code>FEE</code> when transaction is towards Luno fees<br> // <code>TRANSFER</code> when the transaction is a one way flow of funds, e.g. a deposit or crypto send<br> // <code>EXCHANGE</code> when the transaction is part of a two way exchange, e.g. a trade or instant buy Kind Kind `json:"kind"` // A unique reference for the transaction this statement entry relates to. // There may be multiple statement entries related to the same transaction. // E.g. a withdrawal and the withdrawal fee are two separate statement entries with the same reference. Reference string `json:"reference"` RowIndex int64 `json:"row_index"` // Unix timestamp, in milliseconds Timestamp Time `json:"timestamp"` }
type Transfer ¶ added in v0.0.26
type Transfer struct { // Amount that has been credited or debited on the account. This is always a // positive value regardless of the transfer direction. Amount decimal.Decimal `json:"amount"` // Unix timestamp the transfer was initiated, in milliseconds CreatedAt Time `json:"created_at"` // Fee that has been charged by Luno with regards to this transfer. // This is not included in the `amount`. // For example, if you receive a transaction with the raw amount of 1 BTC // and we charge a `fee` of 0.003 BTC on this transaction you will be // credited the `amount` of 0.997 BTC. Fee decimal.Decimal `json:"fee"` // Transfer unique identifier Id string `json:"id"` // True for credit transfers, false for debits. Inbound bool `json:"inbound"` // When the transfer reflects an on-chain transaction this field will have // the transaction ID. TransactionId string `json:"transaction_id"` }
type UpdateAccountNameRequest ¶ added in v0.0.12
type UpdateAccountNameRequest struct { // Account ID - the unique identifier for the specific Account. // // required: true Id int64 `json:"id" url:"id"` // The label to use for this account // // required: true Name string `json:"name" url:"name"` }
UpdateAccountNameRequest is the request struct for UpdateAccountName.
type UpdateAccountNameResponse ¶ added in v0.0.12
type UpdateAccountNameResponse struct {
Success bool `json:"success"`
}
UpdateAccountNameResponse is the response struct for UpdateAccountName.
type ValidateRequest ¶ added in v0.0.30
type ValidateRequest struct { // Destination address or email address. // // <b>Note</b>: // <ul> // <li>Ethereum addresses must be // <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md" target="_blank" rel="nofollow">checksummed</a>.</li> // <li>Ethereum validations of email addresses are not supported.</li> // </ul> // // required: true Address string `json:"address" url:"address"` // Currency is the currency associated with the address. // // required: true Currency string `json:"currency" url:"currency"` // AddressName is the optional name under which to store the address as in the address book. AddressName string `json:"address_name" url:"address_name"` // BeneficiaryName is the name of the beneficial owner if is it is a private address BeneficiaryName string `json:"beneficiary_name" url:"beneficiary_name"` // Country is the ISO 3166-1 country code of the beneficial owner of the address Country string `json:"country" url:"country"` // DateOfBirth is the date of birth of the (non-institutional) beneficial owner of the address in the form "YYYY-MM-DD" DateOfBirth string `json:"date_of_birth" url:"date_of_birth"` // Optional XRP destination tag. Note that HasDestinationTag must be true if this value is provided. DestinationTag int64 `json:"destination_tag" url:"destination_tag"` // Optional boolean flag indicating that a XRP destination tag is provided (even if zero). HasDestinationTag bool `json:"has_destination_tag" url:"has_destination_tag"` // InstitutionName is the name of the beneficial owner if is it is a legal entities address InstitutionName string `json:"institution_name" url:"institution_name"` // IsLegalEntity indicates if the address is for a legal entity and not a private beneficiary. // If this field is true then the fields BeneficiaryName, Nationality & DateOfBirth should be empty but the // fields InstitutionName and Country should be populated. // If this field is false and IsSelfSend is false (or empty) then the field InstitutionName should be empty but the // fields BeneficiaryName, Nationality & DateOfBirth and Country should be populated. IsLegalEntity bool `json:"is_legal_entity" url:"is_legal_entity"` // IsPrivateWallet indicates if the address is for private wallet and not held at an exchange. IsPrivateWallet bool `json:"is_private_wallet" url:"is_private_wallet"` // IsSelfSend to indicate that the address belongs to the customer. // If this field is true then the remaining omitempty fields should not // be populated. IsSelfSend bool `json:"is_self_send" url:"is_self_send"` // Optional memo string used to provide account information for ATOM, etc. where it holds "account" information // for a generic address. Memo string `json:"memo" url:"memo"` // Nationality ISO 3166-1 country code of the nationality of the (non-institutional) beneficial owner of the address Nationality string `json:"nationality" url:"nationality"` // PhysicalAddress is the legal physical address of the beneficial owner of the crypto address PhysicalAddress string `json:"physical_address" url:"physical_address"` // PrivateWalletName is the name of the private wallet WalletName string `json:"wallet_name" url:"wallet_name"` }
ValidateRequest is the request struct for Validate.
type ValidateResponse ¶ added in v0.0.30
type ValidateResponse struct {
Success bool `json:"success"`
}
ValidateResponse is the response struct for Validate.
type Withdrawal ¶
type Withdrawal struct { // Amount to withdraw Amount decimal.Decimal `json:"amount"` // Unix time the withdrawal was initiated, in milliseconds CreatedAt Time `json:"created_at"` // Withdrawal currency. Currency string `json:"currency"` // External ID has the value that was passed in when the Withdrawal request was posted. ExternalId string `json:"external_id"` // Withdrawal fee Fee decimal.Decimal `json:"fee"` Id string `json:"id"` // Status Status Status `json:"status"` // Transfer ID is the identifier of the Withdrawal's transfer once it completes. TransferId string `json:"transfer_id"` // Type distinguishes between different withdrawal methods where more than one is supported // for the given currency. Type string `json:"type"` }