Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstError ¶
FirstError returns the first error among err and apiError which is non-nil (or non-Empty in the case of apiError) or nil if neither represent errors.
A common use case is an API which prefers to return any a network error, if any, and return an API error in the absence of network errors.
Types ¶
type APIError ¶
type APIError struct {
Errors []ErrorDetail `json:"errors"`
}
APIError represents a Digits API Error response
type Balances ¶
type Balances struct {
Address string `json:"address,omitempty"`
AssetID string `json:"assetId"`
Issued bool `json:"issued,omitempty"`
Balance int `json:"balance,omitempty"`
}
Balances represent balances
type Blocks ¶
type Blocks struct {
Version int `json:"version"`
Timestamp int64 `json:"timestamp"`
Reference string `json:"reference"`
NxtCconsensus NxtCconsensus `json:"nxt-consensus"`
Features []int `json:"features"`
Generator string `json:"generator"`
Signature string `json:"signature"`
Blocksize int `json:"blocksize"`
TransactionCount int `json:"transactionCount"`
Fee int64 `json:"fee"`
Transactions []Transactions `json:"transactions"`
Height int64 `json:"height"`
}
Transactions is transaction response body
type ErrorDetail ¶
ErrorDetail represents an individual error in an APIError.
type NxtCconsensus ¶
type Order ¶
type Order struct {
Type int `json:"type"`
ID string `json:"id"`
SenderPublicKey string `json:"senderPublicKey"`
MatcherPublicKey string `json:"matcherPublicKey,omitempty"`
AssetPair AssetPair `json:"assetPair,omitempty"`
OrderType string `json:"orderType,omitempty"`
Price int `json:"price,omitempty"`
Expiration int `json:"expiration,omitempty"`
MatcherFee int `json:"matcherFee,omitempty"`
Signature string `json:"signature"`
Amount int64 `json:"amount"`
Timestamp int64 `json:"timestamp"`
}
type Transactions ¶
type Transactions struct {
Type int `json:"type"`
ID string `json:"id"`
Sender string `json:"sender"`
SenderPublicKey string `json:"senderPublicKey"`
Recipient string `json:"recipient"`
AssetID string `json:"assetId"`
Amount int64 `json:"amount"`
FeeAsset string `json:"feeAsset"`
Fee int64 `json:"fee"`
Timestamp int64 `json:"timestamp"`
Attachment string `json:"attachment"`
Signature string `json:"signature"`
Height int64 `json:"height"`
// Blocks
OrderType AssetPair `json:"orderType,omitempty"`
Price int `json:"price,omitempty"`
Expiration int `json:"expiration,omitempty"`
MatcherFee int `json:"matcherFee,omitempty"`
Order1 Order `json:"order1,omitempty"`
Order2 Order `json:"order2,omitempty"`
BuyMatcherFee int64 `json:"buyMatcherFee,omitempty"`
SellMatcherFee int64 `json:"sellMatcherFee,omitempty"`
}
Transactions is transaction response body
Click to show internal directories.
Click to hide internal directories.