binance

package
v1.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BNBAsset = "BNB"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountMeta added in v1.1.6

type AccountMeta struct {
	Balances []TokenBalance `json:"balances"`
}

type Client added in v1.0.0

type Client struct {
	client.Request
}

func InitClient added in v1.1.6

func InitClient(url, apiKey string) Client

func (Client) FetchAccountMeta added in v1.1.6

func (c Client) FetchAccountMeta(address string) (AccountMeta, error)

func (Client) FetchLatestBlockNumber added in v1.1.6

func (c Client) FetchLatestBlockNumber() (int64, error)

func (Client) FetchTokens added in v1.1.6

func (c Client) FetchTokens() (Tokens, error)

func (Client) FetchTransactionsByAddressAndTokenID added in v1.1.6

func (c Client) FetchTransactionsByAddressAndTokenID(address, tokenID string) ([]Tx, error)

func (Client) FetchTransactionsInBlock added in v1.1.6

func (c Client) FetchTransactionsInBlock(blockNumber int64) (TransactionsInBlockResponse, error)

type NodeInfoResponse added in v1.1.6

type NodeInfoResponse struct {
	SyncInfo struct {
		LatestBlockHeight int `json:"latest_block_height"`
	} `json:"sync_info"`
}

type Platform added in v1.0.0

type Platform struct {
	// contains filtered or unexported fields
}

func Init added in v1.1.0

func Init(api, apiKey string) *Platform

func (*Platform) Coin added in v1.0.0

func (p *Platform) Coin() coin.Coin

func (*Platform) CurrentBlockNumber added in v1.0.0

func (p *Platform) CurrentBlockNumber() (int64, error)

func (*Platform) GetBlockByNumber added in v1.0.0

func (p *Platform) GetBlockByNumber(num int64) (*types.Block, error)

func (*Platform) GetTokenListByAddress added in v1.0.37

func (p *Platform) GetTokenListByAddress(address string) (types.TokenPage, error)

func (*Platform) GetTokenTxsByAddress added in v1.0.37

func (p *Platform) GetTokenTxsByAddress(address, token string) (types.TxPage, error)

func (*Platform) GetTxsByAddress added in v1.0.37

func (p *Platform) GetTxsByAddress(address string) (types.TxPage, error)

type SubTransactions added in v1.1.6

type SubTransactions struct {
	TxHash      string `json:"txHash"`
	BlockHeight int    `json:"blockHeight"`
	TxType      string `json:"txType"`
	FromAddr    string `json:"fromAddr"`
	ToAddr      string `json:"toAddr"`
	TxAsset     string `json:"txAsset"`
	TxFee       string `json:"txFee"`
	Value       string `json:"value"`
}

type Token added in v1.0.37

type Token struct {
	Name           string `json:"name"`
	OriginalSymbol string `json:"original_symbol"`
	Owner          string `json:"owner"`
	Symbol         string `json:"symbol"`
	TotalSupply    string `json:"total_supply"`
}

type TokenBalance added in v1.1.6

type TokenBalance struct {
	Free   string `json:"free"`
	Frozen string `json:"frozen"`
	Locked string `json:"locked"`
	Symbol string `json:"symbol"`
}

type Tokens added in v1.1.6

type Tokens []Token

type TransactionData added in v1.1.6

type TransactionData struct {
	OrderData struct {
		Symbol      string `json:"symbol"`
		OrderType   string `json:"orderType"`
		Side        string `json:"side"`
		Price       string `json:"price"`
		Quantity    string `json:"quantity"`
		TimeInForce string `json:"timeInForce"`
		OrderID     string `json:"orderId"`
	} `json:"orderData"`
}

type TransactionsByAddressAndAssetResponse added in v1.1.6

type TransactionsByAddressAndAssetResponse struct {
	Txs []Tx `json:"tx"`
}

type TransactionsInBlockResponse added in v1.1.6

type TransactionsInBlockResponse struct {
	BlockHeight int  `json:"blockHeight"`
	Tx          []Tx `json:"tx"`
}

type Tx added in v1.0.0

type Tx struct {
	TxHash          string            `json:"txHash"`
	BlockHeight     int               `json:"blockHeight"`
	TxType          TxType            `json:"txType"`
	TimeStamp       time.Time         `json:"timeStamp"`
	FromAddr        interface{}       `json:"fromAddr"`
	ToAddr          interface{}       `json:"toAddr"`
	Value           string            `json:"value"`
	TxAsset         string            `json:"txAsset"`
	TxFee           string            `json:"txFee"`
	OrderID         string            `json:"orderId,omitempty"`
	Code            int               `json:"code"`
	Data            string            `json:"data"`
	Memo            string            `json:"memo"`
	Source          int               `json:"source"`
	SubTransactions []SubTransactions `json:"subTransactions,omitempty"`
	Sequence        int               `json:"sequence"`
}

type TxType added in v1.0.37

type TxType string
const (
	NewOrder    TxType = "NEW_ORDER"
	CancelOrder TxType = "CANCEL_ORDER"
	Transfer    TxType = "TRANSFER"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL