binance

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TxTransfer              TxType                  = "TRANSFER"       // e.g: BNB, TWT-8C2
	SingleTransferOperation ExplorerTransactionType = "singleTransfer" // e.g: BNB, TWT-8C2
	MultiTransferOperation  ExplorerTransactionType = "multiTransfer"  // e.g [BNB, BNB], [TWT-8C2, TWT-8C2]
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account added in v1.0.0

type Account struct {
	AccountNumber int       `json:"account_number"`
	Address       string    `json:"address"`
	Balances      []Balance `json:"balances"`
	PublicKey     []byte    `json:"public_key"`
	Sequence      uint64    `json:"sequence"`
}

type Balance added in v1.0.0

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

type BlockTransactions added in v1.1.0

type BlockTransactions struct {
	BlockHeight int64  `json:"blockHeight"`
	Txs         []TxV2 `json:"tx"`
}

type Client added in v1.0.0

type Client struct {
	blockatlas.Request
}

type Coins added in v1.1.0

type Coins struct {
	Amount string `json:"amount"`
	Denom  string `json:"denom"`
}

type Error added in v1.0.0

type Error struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

func (*Error) Error added in v1.0.0

func (e *Error) Error() string

type ExplorerClient added in v1.1.0

type ExplorerClient struct {
	blockatlas.Request
}

type ExplorerResponse added in v1.1.0

type ExplorerResponse struct {
	Nums int           `json:"txNums"`
	Txs  []ExplorerTxs `json:"txArray"`
}

Transaction response from Explorer

type ExplorerTransactionType added in v1.1.0

type ExplorerTransactionType string

type ExplorerTxs added in v1.1.0

type ExplorerTxs struct {
	BlockHeight        uint64          `json:"blockHeight"`
	Code               int             `json:"code"`
	FromAddr           string          `json:"fromAddr"`
	HasChildren        int             `json:"hasChildren"`
	Memo               string          `json:"memo"`
	MultisendTransfers []MultiTransfer `json:"subTxsDto"` // Not part of response, added from hash info tx for simplifying logic
	Timestamp          int64           `json:"timeStamp"`
	ToAddr             string          `json:"toAddr"`
	TxFee              float64         `json:"txFee"`
	TxHash             string          `json:"txHash"`
	TxType             TxType          `json:"txType"`
	Value              float64         `json:"value"`
	TxAsset            string          `json:"txAsset"`
}

type Input added in v1.1.0

type Input struct {
	Address string `json:"address"`
}

type Msg added in v1.1.0

type Msg struct {
	Value MsgValue `json:"value"`
}

type MsgValue added in v1.1.0

type MsgValue struct {
	Inputs  []Input  `json:"inputs"`
	Outputs []Output `json:"outputs"`
}

type MultiTransfer added in v1.1.0

type MultiTransfer struct {
	Amount string `json:"amount"` // Float string ind decimal point
	Asset  string `json:"asset"`
	From   string `json:"from"`
	To     string `json:"to"`
}

type NodeInfo added in v1.1.0

type NodeInfo struct {
	SyncInfo SyncInfo `json:"sync_info"`
}

type Output added in v1.1.0

type Output struct {
	Address string  `json:"address"`
	Coins   []Coins `json:"coins"`
}

type Platform added in v1.0.0

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

func Init added in v1.1.0

func Init(rpcApi, explorerApi 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) (*blockatlas.Block, error)

func (*Platform) GetTokenListByAddress added in v1.0.37

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

func (*Platform) GetTokenTxsByAddress added in v1.0.37

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

func (*Platform) GetTxsByAddress added in v1.0.37

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

type SubTx added in v1.0.37

type SubTx struct {
	Asset    string `json:"txAsset"`
	Height   uint64 `json:"blockHeight"`
	Fee      string `json:"txFee"`
	FromAddr string `json:"fromAddr"`
	Hash     string `json:"txHash"`
	ToAddr   string `json:"toAddr"`
	Type     TxType `json:"txType"`
	Value    string `json:"value"`
}

type SyncInfo added in v1.1.0

type SyncInfo struct {
	LatestBlockHeight int64 `json:"latest_block_height"`
}

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 TokenList added in v1.1.0

type TokenList []Token

type Transactions added in v1.1.0

type Transactions struct {
	Total int  `json:"total"`
	Txs   []Tx `json:"tx"`
}

type Tx added in v1.0.0

type Tx struct {
	Asset       string `json:"txAsset"`
	BlockHeight uint64 `json:"blockHeight"`
	Code        int    `json:"code"`
	Data        string `json:"data"`
	Fee         string `json:"txFee"`
	FromAddr    string `json:"fromAddr"`
	Memo        string `json:"memo"`
	OrderID     string `json:"orderId"`
	Sequence    uint64 `json:"sequence"`
	Source      int    `json:"source"`
	Timestamp   string `json:"timeStamp"`
	ToAddr      string `json:"toAddr"`
	TxHash      string `json:"txHash"`
	Type        TxType `json:"txType"`
	Value       string `json:"value"`
}

type TxHashRPC added in v1.1.0

type TxHashRPC struct {
	Hash string   `json:"hash"`
	Tx   TxHashTx `json:"tx"`
}

type TxHashTx added in v1.1.0

type TxHashTx struct {
	Value Value `json:"value"`
}

type TxType added in v1.0.37

type TxType string

type TxV2 added in v1.1.0

type TxV2 struct {
	Tx
	OrderID         string  `json:"orderId"`         // Optional. Available when the transaction type is NEW_ORDER
	SubTransactions []SubTx `json:"subTransactions"` // Optional. Available when the transaction has sub-transactions, such as multi-send transaction or a transaction have multiple assets
}

type Value added in v1.1.0

type Value struct {
	Msg []Msg `json:"msg"`
}

Jump to

Keyboard shortcuts

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