binance

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BNBAsset = "BNB"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountMeta

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

type Client

type Client struct {
	client.Request
}

func InitClient

func InitClient(url, apiKey string) Client

func (Client) FetchAccountMeta

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

func (Client) FetchLatestBlockNumber

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

func (Client) FetchTokens

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

func (Client) FetchTransactionsByAddressAndTokenID

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

func (Client) FetchTransactionsInBlock

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

type NodeInfoResponse

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

type Platform

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

func Init

func Init(api, apiKey, stakingApi string) *Platform

func (*Platform) Coin

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

func (*Platform) CurrentBlockNumber

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

func (*Platform) GetActiveValidators

func (p *Platform) GetActiveValidators() (blockatlas.StakeValidators, error)

func (*Platform) GetBlockByNumber

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

func (*Platform) GetDelegations

func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, error)

func (*Platform) GetDetails

func (p *Platform) GetDetails() blockatlas.StakingDetails

func (*Platform) GetTokenListByAddress

func (p *Platform) GetTokenListByAddress(address string) ([]types.Token, error)

func (*Platform) GetTokenListIdsByAddress

func (p *Platform) GetTokenListIdsByAddress(address string) ([]string, error)

func (*Platform) GetTokenTxsByAddress

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

func (*Platform) GetTxsByAddress

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

func (*Platform) GetValidators

func (p *Platform) GetValidators() (blockatlas.ValidatorPage, error)

func (*Platform) UndelegatedBalance

func (p *Platform) UndelegatedBalance(address string) (string, error)

type SubTransactions

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

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

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

type Tokens

type Tokens []Token

type TransactionData

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

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

type TransactionsInBlockResponse

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

type Tx

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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