Documentation
¶
Overview ¶
Package rawapi is a statically-typed layer over the wire client with one function per REST endpoint. Each endpoint has a typed request struct and a typed response struct (or element slice for an array response), and a method that builds the ordered wire parameters, issues exactly one call through the wire client under a caller-supplied policy, and returns the decoded typed value alongside the verbatim response bytes.
The layer is static: it carries no runtime catalog, spec, documentation registry, or validation engine. It holds no retry or idempotency policy — the caller supplies the policy for the single call each function issues. Money and quantity values are decimal strings end to end and pass through untouched.
Ordered parameters follow the wire declaration order: positionals first, then the remaining parameters, with absent optional parameters omitted. The wire client signs the exact encoded parameter string it sends, so this ordering is the signing-byte contract.
Index ¶
- type Balance
- type BalanceRequest
- type Candle
- type CandlesRequest
- type Client
- func (c *Client) Balance(ctx context.Context, req BalanceRequest, pol korbit.Policy) ([]Balance, json.RawMessage, korbit.Meta, error)
- func (c *Client) Candles(ctx context.Context, req CandlesRequest, pol korbit.Policy) ([]Candle, json.RawMessage, korbit.Meta, error)
- func (c *Client) Currencies(ctx context.Context, _ CurrenciesRequest, pol korbit.Policy) ([]CurrencyInfo, json.RawMessage, korbit.Meta, error)
- func (c *Client) DepositAddress(ctx context.Context, req DepositAddressRequest, pol korbit.Policy) (DepositAddress, json.RawMessage, korbit.Meta, error)
- func (c *Client) DepositAddresses(ctx context.Context, req DepositAddressesRequest, pol korbit.Policy) ([]DepositAddress, json.RawMessage, korbit.Meta, error)
- func (c *Client) DepositGenerate(ctx context.Context, req DepositGenerateRequest, pol korbit.Policy) (DepositAddress, json.RawMessage, korbit.Meta, error)
- func (c *Client) DepositHistory(ctx context.Context, req DepositHistoryRequest, pol korbit.Policy) ([]CoinDeposit, json.RawMessage, korbit.Meta, error)
- func (c *Client) DepositStatus(ctx context.Context, req DepositStatusRequest, pol korbit.Policy) (CoinDeposit, json.RawMessage, korbit.Meta, error)
- func (c *Client) Fees(ctx context.Context, req FeesRequest, pol korbit.Policy) ([]Fee, json.RawMessage, korbit.Meta, error)
- func (c *Client) Fills(ctx context.Context, req FillsRequest, pol korbit.Policy) ([]Fill, json.RawMessage, korbit.Meta, error)
- func (c *Client) KRWDeposit(ctx context.Context, req KRWDepositRequest, pol korbit.Policy) (KRWPushResponse, json.RawMessage, korbit.Meta, error)
- func (c *Client) KRWDeposits(ctx context.Context, req KRWDepositsRequest, pol korbit.Policy) ([]KRWDeposit, json.RawMessage, korbit.Meta, error)
- func (c *Client) KRWWithdraw(ctx context.Context, req KRWWithdrawRequest, pol korbit.Policy) (KRWPushResponse, json.RawMessage, korbit.Meta, error)
- func (c *Client) KRWWithdrawals(ctx context.Context, req KRWWithdrawalsRequest, pol korbit.Policy) ([]KRWWithdrawal, json.RawMessage, korbit.Meta, error)
- func (c *Client) OrderCancel(ctx context.Context, req OrderCancelRequest, pol korbit.Policy) (OrderCancelResponse, json.RawMessage, korbit.Meta, error)
- func (c *Client) OrderGet(ctx context.Context, req OrderGetRequest, pol korbit.Policy) (Order, json.RawMessage, korbit.Meta, error)
- func (c *Client) OrderHistory(ctx context.Context, req OrderHistoryRequest, pol korbit.Policy) ([]Order, json.RawMessage, korbit.Meta, error)
- func (c *Client) OrderOpen(ctx context.Context, req OrderOpenRequest, pol korbit.Policy) ([]Order, json.RawMessage, korbit.Meta, error)
- func (c *Client) OrderPlace(ctx context.Context, req OrderPlaceRequest, pol korbit.Policy) (OrderPlaceResponse, json.RawMessage, korbit.Meta, error)
- func (c *Client) Orderbook(ctx context.Context, req OrderbookRequest, pol korbit.Policy) (Orderbook, json.RawMessage, korbit.Meta, error)
- func (c *Client) Pairs(ctx context.Context, _ PairsRequest, pol korbit.Policy) ([]Pair, json.RawMessage, korbit.Meta, error)
- func (c *Client) TickSize(ctx context.Context, req TickSizeRequest, pol korbit.Policy) ([]TickSizePolicy, json.RawMessage, korbit.Meta, error)
- func (c *Client) Ticker(ctx context.Context, req TickerRequest, pol korbit.Policy) ([]Ticker, json.RawMessage, korbit.Meta, error)
- func (c *Client) Time(ctx context.Context, _ TimeRequest, pol korbit.Policy) (ServerTime, json.RawMessage, korbit.Meta, error)
- func (c *Client) Trades(ctx context.Context, req TradesRequest, pol korbit.Policy) ([]Trade, json.RawMessage, korbit.Meta, error)
- func (c *Client) Whoami(ctx context.Context, _ WhoamiRequest, pol korbit.Policy) (KeyInfo, json.RawMessage, korbit.Meta, error)
- func (c *Client) WithdrawAddresses(ctx context.Context, req WithdrawAddressesRequest, pol korbit.Policy) ([]WithdrawableAddress, json.RawMessage, korbit.Meta, error)
- func (c *Client) WithdrawAmount(ctx context.Context, req WithdrawAmountRequest, pol korbit.Policy) ([]WithdrawableAmount, json.RawMessage, korbit.Meta, error)
- func (c *Client) WithdrawCancel(ctx context.Context, req WithdrawCancelRequest, pol korbit.Policy) (WithdrawCancelResponse, json.RawMessage, korbit.Meta, error)
- func (c *Client) WithdrawHistory(ctx context.Context, req WithdrawHistoryRequest, pol korbit.Policy) ([]CoinWithdrawal, json.RawMessage, korbit.Meta, error)
- func (c *Client) WithdrawRequest(ctx context.Context, req WithdrawRequestRequest, pol korbit.Policy) (WithdrawRequestResponse, json.RawMessage, korbit.Meta, error)
- func (c *Client) WithdrawStatus(ctx context.Context, req WithdrawStatusRequest, pol korbit.Policy) (CoinWithdrawal, json.RawMessage, korbit.Meta, error)
- type CoinDeposit
- type CoinWithdrawal
- type CurrenciesRequest
- type Currency
- type CurrencyInfo
- type CurrencyNetwork
- type DepositAddress
- type DepositAddressRequest
- type DepositAddressesRequest
- type DepositGenerateRequest
- type DepositHistoryRequest
- type DepositStatusRequest
- type Doer
- type Fee
- type FeesRequest
- type Fill
- type FillsRequest
- type KRWDeposit
- type KRWDepositRequest
- type KRWDepositsRequest
- type KRWPushResponse
- type KRWWithdrawRequest
- type KRWWithdrawal
- type KRWWithdrawalsRequest
- type KeyInfo
- type Order
- type OrderCancelRequest
- type OrderCancelResponse
- type OrderGetRequest
- type OrderHistoryRequest
- type OrderOpenRequest
- type OrderPlaceRequest
- type OrderPlaceResponse
- type OrderType
- type Orderbook
- type OrderbookLevel
- type OrderbookRequest
- type Pair
- type PairsRequest
- type ServerTime
- type Side
- type Symbol
- type TickSizeBand
- type TickSizePolicy
- type TickSizeRequest
- type Ticker
- type TickerRequest
- type TimeInForce
- type TimeRequest
- type Trade
- type TradesRequest
- type WhoamiRequest
- type WithdrawAddressesRequest
- type WithdrawAmountRequest
- type WithdrawCancelRequest
- type WithdrawCancelResponse
- type WithdrawHistoryRequest
- type WithdrawRequestRequest
- type WithdrawRequestResponse
- type WithdrawStatusRequest
- type WithdrawableAddress
- type WithdrawableAmount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balance ¶
type Balance struct {
Currency string `json:"currency"`
Balance string `json:"balance"`
Available string `json:"available"`
TradeInUse string `json:"tradeInUse"`
WithdrawalInUse string `json:"withdrawalInUse"`
AvgPrice string `json:"avgPrice"`
}
Balance is one asset's balance.
type BalanceRequest ¶
BalanceRequest fetches account balances. Currencies is the optional comma-separated asset filter.
type Candle ¶
type Candle struct {
Timestamp int64 `json:"timestamp"`
Open string `json:"open"`
High string `json:"high"`
Low string `json:"low"`
Close string `json:"close"`
Volume string `json:"volume"`
}
Candle is one candlestick.
type CandlesRequest ¶
type CandlesRequest struct {
Symbol Symbol
Interval string
// Limit is required: the endpoint rejects a missing or out-of-range limit
// (1..200) with BAD_REQUEST "limit out of range", so it is a value, not a
// pointer — every call must carry one.
Limit int
StartTime *int
EndTime *int
}
CandlesRequest is one symbol's candle request. Interval is required; the time bounds are optional.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the typed endpoint layer over a wire client. It is configured once (with a Doer, a *korbit.Client in production) and reused; safety for concurrent use matches the wrapped client.
func New ¶
New wraps a wire client in the typed endpoint layer. log is the optional operational logger (nil = silent): the typed layer's one diagnostic is a typed-decode mismatch — the verbatim bytes did not fit the endpoint's typed view — logged at Debug so a --log-level debug run explains why a typed field (e.g. an order's id) came back empty even though the call succeeded. The wire layer below already logs the request target/status/timing; the typed layer adds nothing per call on the happy path. It never sees a secret (the signature is appended below it) and never logs the response body.
func (*Client) Currencies ¶
func (c *Client) Currencies(ctx context.Context, _ CurrenciesRequest, pol korbit.Policy) ([]CurrencyInfo, json.RawMessage, korbit.Meta, error)
func (*Client) DepositAddress ¶
func (c *Client) DepositAddress(ctx context.Context, req DepositAddressRequest, pol korbit.Policy) (DepositAddress, json.RawMessage, korbit.Meta, error)
func (*Client) DepositAddresses ¶
func (c *Client) DepositAddresses(ctx context.Context, req DepositAddressesRequest, pol korbit.Policy) ([]DepositAddress, json.RawMessage, korbit.Meta, error)
func (*Client) DepositGenerate ¶
func (c *Client) DepositGenerate(ctx context.Context, req DepositGenerateRequest, pol korbit.Policy) (DepositAddress, json.RawMessage, korbit.Meta, error)
func (*Client) DepositHistory ¶
func (c *Client) DepositHistory(ctx context.Context, req DepositHistoryRequest, pol korbit.Policy) ([]CoinDeposit, json.RawMessage, korbit.Meta, error)
func (*Client) DepositStatus ¶
func (c *Client) DepositStatus(ctx context.Context, req DepositStatusRequest, pol korbit.Policy) (CoinDeposit, json.RawMessage, korbit.Meta, error)
func (*Client) KRWDeposit ¶
func (c *Client) KRWDeposit(ctx context.Context, req KRWDepositRequest, pol korbit.Policy) (KRWPushResponse, json.RawMessage, korbit.Meta, error)
func (*Client) KRWDeposits ¶
func (c *Client) KRWDeposits(ctx context.Context, req KRWDepositsRequest, pol korbit.Policy) ([]KRWDeposit, json.RawMessage, korbit.Meta, error)
func (*Client) KRWWithdraw ¶
func (c *Client) KRWWithdraw(ctx context.Context, req KRWWithdrawRequest, pol korbit.Policy) (KRWPushResponse, json.RawMessage, korbit.Meta, error)
func (*Client) KRWWithdrawals ¶
func (c *Client) KRWWithdrawals(ctx context.Context, req KRWWithdrawalsRequest, pol korbit.Policy) ([]KRWWithdrawal, json.RawMessage, korbit.Meta, error)
func (*Client) OrderCancel ¶
func (c *Client) OrderCancel(ctx context.Context, req OrderCancelRequest, pol korbit.Policy) (OrderCancelResponse, json.RawMessage, korbit.Meta, error)
func (*Client) OrderHistory ¶
func (*Client) OrderPlace ¶
func (c *Client) OrderPlace(ctx context.Context, req OrderPlaceRequest, pol korbit.Policy) (OrderPlaceResponse, json.RawMessage, korbit.Meta, error)
func (*Client) TickSize ¶
func (c *Client) TickSize(ctx context.Context, req TickSizeRequest, pol korbit.Policy) ([]TickSizePolicy, json.RawMessage, korbit.Meta, error)
TickSize returns the queried symbol's tick-size policy. The endpoint's data payload is an array (one element per symbol), so the typed value is a slice; a single-symbol query yields a one-element slice.
func (*Client) Time ¶
func (c *Client) Time(ctx context.Context, _ TimeRequest, pol korbit.Policy) (ServerTime, json.RawMessage, korbit.Meta, error)
func (*Client) WithdrawAddresses ¶
func (c *Client) WithdrawAddresses(ctx context.Context, req WithdrawAddressesRequest, pol korbit.Policy) ([]WithdrawableAddress, json.RawMessage, korbit.Meta, error)
func (*Client) WithdrawAmount ¶
func (c *Client) WithdrawAmount(ctx context.Context, req WithdrawAmountRequest, pol korbit.Policy) ([]WithdrawableAmount, json.RawMessage, korbit.Meta, error)
func (*Client) WithdrawCancel ¶
func (c *Client) WithdrawCancel(ctx context.Context, req WithdrawCancelRequest, pol korbit.Policy) (WithdrawCancelResponse, json.RawMessage, korbit.Meta, error)
func (*Client) WithdrawHistory ¶
func (c *Client) WithdrawHistory(ctx context.Context, req WithdrawHistoryRequest, pol korbit.Policy) ([]CoinWithdrawal, json.RawMessage, korbit.Meta, error)
func (*Client) WithdrawRequest ¶
func (c *Client) WithdrawRequest(ctx context.Context, req WithdrawRequestRequest, pol korbit.Policy) (WithdrawRequestResponse, json.RawMessage, korbit.Meta, error)
func (*Client) WithdrawStatus ¶
func (c *Client) WithdrawStatus(ctx context.Context, req WithdrawStatusRequest, pol korbit.Policy) (CoinWithdrawal, json.RawMessage, korbit.Meta, error)
type CoinDeposit ¶
type CoinDeposit struct {
ID int64 `json:"id"`
Currency string `json:"currency"`
Network string `json:"network"`
Address string `json:"address"`
SecondaryAddress string `json:"secondaryAddress,omitempty"`
Status string `json:"status"`
Quantity string `json:"quantity"`
TransactionHash string `json:"transactionHash"`
CreatedAt int64 `json:"createdAt"`
}
CoinDeposit is one crypto deposit record.
type CoinWithdrawal ¶
type CoinWithdrawal struct {
ID int64 `json:"id"`
Currency string `json:"currency"`
Network string `json:"network"`
Address string `json:"address"`
SecondaryAddress string `json:"secondaryAddress,omitempty"`
Quantity string `json:"quantity"`
Fee string `json:"fee"`
Status string `json:"status"`
TransactionHash string `json:"transactionHash,omitempty"`
CreatedAt int64 `json:"createdAt"`
}
CoinWithdrawal is one crypto withdrawal record.
type CurrencyInfo ¶
type CurrencyInfo struct {
Name string `json:"name"`
FullName string `json:"fullName"`
WithdrawalMaxAmountPerRequest string `json:"withdrawalMaxAmountPerRequest"`
WithdrawalMinAmount string `json:"withdrawalMinAmount"`
DefaultNetwork string `json:"defaultNetwork"`
NetworkList []CurrencyNetwork `json:"networkList"`
}
CurrencyInfo is one supported cryptocurrency. NetworkList is absent for fiat.
type CurrencyNetwork ¶
type CurrencyNetwork struct {
Name string `json:"name"`
WithdrawalStatus string `json:"withdrawalStatus,omitempty"`
DepositStatus string `json:"depositStatus,omitempty"`
Raw json.RawMessage `json:"-"`
}
CurrencyNetwork is one supported network for a currency. The network detail fields beyond name vary by asset, so the verbatim object is preserved in Raw alongside the common fields for the typed surface.
func (*CurrencyNetwork) UnmarshalJSON ¶
func (n *CurrencyNetwork) UnmarshalJSON(b []byte) error
UnmarshalJSON keeps the verbatim network object in Raw while decoding the common fields, since the per-network detail set varies by asset.
type DepositAddress ¶
type DepositAddress struct {
Currency string `json:"currency"`
Network string `json:"network"`
Address string `json:"address"`
SecondaryAddress string `json:"secondaryAddress,omitempty"`
}
DepositAddress is a crypto deposit address.
type DepositAddressRequest ¶
DepositAddressRequest shows the deposit address for one asset.
type DepositAddressesRequest ¶
type DepositAddressesRequest struct {
AccountSeq *int
}
DepositAddressesRequest lists deposit addresses. AccountSeq is main-only (the API accepts only 1); see the funding accountSeq note below.
type DepositGenerateRequest ¶
DepositGenerateRequest generates (or returns the existing) deposit address.
type DepositHistoryRequest ¶
DepositHistoryRequest lists recent crypto deposits for an asset.
type DepositStatusRequest ¶
DepositStatusRequest fetches one crypto deposit by id.
type Doer ¶
type Doer interface {
Do(ctx context.Context, call korbit.Call, pol korbit.Policy) (json.RawMessage, korbit.Meta, error)
}
Doer is the minimal wire surface the typed layer drives: one logical call executed under a policy. *korbit.Client satisfies it; an interface here keeps the typed layer testable with a scripted fake and documents that it needs nothing more than Do.
type Fee ¶
type Fee struct {
Symbol string `json:"symbol"`
BuyFeeCurrency string `json:"buyFeeCurrency"`
SellFeeCurrency string `json:"sellFeeCurrency"`
MaxFeeRate string `json:"maxFeeRate"`
TakerFeeRate string `json:"takerFeeRate"`
MakerFeeRate string `json:"makerFeeRate"`
}
Fee is one symbol's trading fee policy.
type FeesRequest ¶
FeesRequest fetches the trading fee policy. Symbol is the optional comma-separated trading-pair filter.
type Fill ¶
type Fill struct {
Symbol string `json:"symbol"`
TradeID int64 `json:"tradeId"`
OrderID int64 `json:"orderId"`
Side string `json:"side"`
Price string `json:"price"`
Qty string `json:"qty"`
Amt string `json:"amt"`
TradedAt int64 `json:"tradedAt"`
IsTaker bool `json:"isTaker"`
FeeCurrency string `json:"feeCurrency"`
FeeQty string `json:"feeQty"`
}
Fill is one executed trade.
type FillsRequest ¶
FillsRequest lists your executed trades for a symbol.
type KRWDeposit ¶
type KRWDeposit struct {
ID int64 `json:"id"`
Status string `json:"status"`
Quantity string `json:"quantity"`
CreatedAt int64 `json:"createdAt"`
}
KRWDeposit is one KRW deposit record.
type KRWDepositRequest ¶
KRWDepositRequest sends a KRW-deposit push to the Korbit app.
type KRWDepositsRequest ¶
KRWDepositsRequest lists recent KRW deposits.
type KRWPushResponse ¶
type KRWPushResponse struct {
Success bool `json:"success,omitempty"`
}
KRWPushResponse is a KRW deposit/withdrawal push acknowledgement.
type KRWWithdrawRequest ¶
KRWWithdrawRequest sends a KRW-withdrawal push to the Korbit app.
type KRWWithdrawal ¶
type KRWWithdrawal struct {
ID int64 `json:"id"`
Quantity string `json:"quantity"`
Fee string `json:"fee"`
Status string `json:"status"`
CreatedAt int64 `json:"createdAt"`
}
KRWWithdrawal is one KRW withdrawal record.
type KRWWithdrawalsRequest ¶
KRWWithdrawalsRequest lists recent KRW withdrawals.
type KeyInfo ¶
type KeyInfo struct {
APIKey string `json:"apiKey"`
UserUUID string `json:"userUuid,omitempty"`
Type string `json:"type"`
PublicKey string `json:"publicKey,omitempty"`
Permissions []string `json:"permissions"`
Whitelist string `json:"whitelist"`
Expiration int64 `json:"expiration"`
Status string `json:"status"`
Label string `json:"label"`
AllowedAccountSeqs []int `json:"allowedAccountSeqs"`
CreatedAt int64 `json:"createdAt"`
}
KeyInfo is the current API key's metadata.
type Order ¶
type Order struct {
OrderID int64 `json:"orderId"`
ClientOrderID string `json:"clientOrderId,omitempty"`
Symbol string `json:"symbol"`
OrderType string `json:"orderType"`
Side string `json:"side"`
TimeInForce string `json:"timeInForce"`
Price string `json:"price,omitempty"`
Qty string `json:"qty"`
Amt string `json:"amt,omitempty"`
FilledQty string `json:"filledQty"`
FilledAmt string `json:"filledAmt"`
AvgPrice string `json:"avgPrice,omitempty"`
CreatedAt int64 `json:"createdAt"`
LastFilledAt int64 `json:"lastFilledAt"`
Status string `json:"status"`
}
Order is the full order document returned by the order query endpoints.
type OrderCancelRequest ¶
OrderCancelRequest cancels one open order by order id or clientOrderId.
type OrderCancelResponse ¶
type OrderCancelResponse struct {
Success bool `json:"success,omitempty"`
}
OrderCancelResponse is the cancel acknowledgement (a bare ack normalizes to success only).
type OrderGetRequest ¶
OrderGetRequest fetches one order by order id or clientOrderId.
type OrderHistoryRequest ¶
type OrderHistoryRequest struct {
Symbol Symbol
Limit *int
StartTime *int
EndTime *int
AccountSeq *int
}
OrderHistoryRequest lists recent orders for a symbol.
type OrderOpenRequest ¶
OrderOpenRequest lists open orders for a symbol.
type OrderPlaceRequest ¶
type OrderPlaceRequest struct {
Symbol Symbol
Side Side
OrderType OrderType
Price *string
Qty *string
Amt *string
TimeInForce *TimeInForce
BestNth *int
ClientOrderID *string
PP *bool
PPPercent *int
AccountSeq *int
}
OrderPlaceRequest is a place-order request. Symbol, Side, and OrderType are required; the remaining fields are optional and appended in wire declaration order only when set.
type OrderPlaceResponse ¶
type OrderPlaceResponse struct {
OrderID int64 `json:"orderId"`
ClientOrderID string `json:"clientOrderId,omitempty"`
}
OrderPlaceResponse is the place-order acknowledgement.
type Orderbook ¶
type Orderbook struct {
Timestamp int64 `json:"timestamp"`
Bids []OrderbookLevel `json:"bids"`
Asks []OrderbookLevel `json:"asks"`
}
Orderbook is an orderbook snapshot.
type OrderbookLevel ¶
type OrderbookLevel struct {
Price string `json:"price"`
Qty string `json:"qty"`
Amt string `json:"amt,omitempty"`
}
OrderbookLevel is one price level in the orderbook. Amt is present only on some grouping levels.
type OrderbookRequest ¶
OrderbookRequest is one symbol's orderbook request. Level is the optional price-grouping level.
type ServerTime ¶
type ServerTime struct {
Time int64 `json:"time"`
}
ServerTime is the Korbit server time.
type TickSizeBand ¶
TickSizeBand is one price band of the tick-size policy.
type TickSizePolicy ¶
type TickSizePolicy struct {
Symbol string `json:"symbol"`
TickSizePolicy []TickSizeBand `json:"tickSizePolicy"`
OrderbookLevels []string `json:"orderbookLevels"`
}
TickSizePolicy is a symbol's tick-size policy and orderbook grouping levels.
type TickSizeRequest ¶
type TickSizeRequest struct {
Symbol Symbol
}
TickSizeRequest is one symbol's tick-size request.
type Ticker ¶
type Ticker struct {
Symbol string `json:"symbol"`
Open string `json:"open"`
High string `json:"high"`
Low string `json:"low"`
Close string `json:"close"`
PrevClose string `json:"prevClose"`
PriceChange string `json:"priceChange"`
PriceChangePercent string `json:"priceChangePercent"`
Volume string `json:"volume"`
QuoteVolume string `json:"quoteVolume"`
BestBidPrice string `json:"bestBidPrice"`
BestAskPrice string `json:"bestAskPrice"`
LastTradedAt int64 `json:"lastTradedAt"`
}
Ticker is one symbol's latest price and 24h stats.
type TickerRequest ¶
type TickerRequest struct {
Symbol *string
}
TickerRequest selects the symbols to fetch. Symbol is the comma-separated wire parameter; an empty value omits it (all symbols).
type TimeInForce ¶
type TimeInForce string
TimeInForce is an order time-in-force.
const ( TimeInForceGTC TimeInForce = "gtc" TimeInForceIOC TimeInForce = "ioc" TimeInForceFOK TimeInForce = "fok" TimeInForcePO TimeInForce = "po" )
type Trade ¶
type Trade struct {
Timestamp int64 `json:"timestamp"`
Price string `json:"price"`
Qty string `json:"qty"`
IsBuyerTaker bool `json:"isBuyerTaker"`
TradeID int64 `json:"tradeId"`
}
Trade is one public trade.
type TradesRequest ¶
TradesRequest is one symbol's recent-trades request.
type WithdrawAddressesRequest ¶
type WithdrawAddressesRequest struct {
AccountSeq *int
}
WithdrawAddressesRequest lists registered withdrawal addresses. AccountSeq is main-only (see the funding accountSeq note above).
type WithdrawAmountRequest ¶
WithdrawAmountRequest fetches withdrawable amounts. Currency is optional (omit for all).
type WithdrawCancelRequest ¶
WithdrawCancelRequest cancels a crypto withdrawal by id.
type WithdrawCancelResponse ¶
type WithdrawCancelResponse struct {
Success bool `json:"success,omitempty"`
}
WithdrawCancelResponse is the cancel acknowledgement.
type WithdrawHistoryRequest ¶
WithdrawHistoryRequest lists recent crypto withdrawals for an asset.
type WithdrawRequestRequest ¶
type WithdrawRequestRequest struct {
Currency Currency
Amount string
Address string
Network *string
SecondaryAddress *string
AccountSeq *int
}
WithdrawRequestRequest requests a crypto withdrawal to a registered address. Amount and Address are required; Network and SecondaryAddress are optional and appended in declaration order when set.
type WithdrawRequestResponse ¶
type WithdrawRequestResponse struct {
Status string `json:"status"`
CoinWithdrawalID int64 `json:"coinWithdrawalId"`
}
WithdrawRequestResponse is the withdrawal-request acknowledgement.
type WithdrawStatusRequest ¶
WithdrawStatusRequest fetches one crypto withdrawal by id.
type WithdrawableAddress ¶
type WithdrawableAddress struct {
Network string `json:"network"`
Currency string `json:"currency,omitempty"`
Address string `json:"address"`
SecondaryAddress string `json:"secondaryAddress,omitempty"`
}
WithdrawableAddress is one address registered for API withdrawals.
type WithdrawableAmount ¶
type WithdrawableAmount struct {
Currency string `json:"currency"`
WithdrawableAmount string `json:"withdrawableAmount"`
WithdrawalInUseAmount string `json:"withdrawalInUseAmount"`
}
WithdrawableAmount is one asset's withdrawable amount.