Documentation
¶
Overview ¶
description: sync_eth
@author: xwc1125 @date: 2020/10/05
description: sync_eth
@author: xwc1125 @date: 2020/10/05
description: sync_eth
@author: xwc1125 @date: 2020/10/05
description: sync_eth
@author: xwc1125 @date: 2020/10/05
description: sync_eth
@author: xwc1125 @date: 2020/10/05
Index ¶
- Constants
- Variables
- type AccountMap
- type Accounts
- type Block
- type Contract
- type ContractMap
- type ContractMapSet
- func (s *ContractMapSet) Clear()
- func (s *ContractMapSet) Get(item string) (*Contract, bool)
- func (s *ContractMapSet) IsEmpty() bool
- func (s *ContractMapSet) Len() int
- func (s *ContractMapSet) List() ContractMap
- func (s *ContractMapSet) Remove(items ...string)
- func (s *ContractMapSet) SortList() []string
- func (s *ContractMapSet) Update(items ...*Contract)
- type ListenAddress
- type MapSet
- func (s *MapSet) Clear()
- func (s *MapSet) Get(item string, contract string) (*Accounts, bool)
- func (s *MapSet) IsEmpty() bool
- func (s *MapSet) Len() int
- func (s *MapSet) List() AccountMap
- func (s *MapSet) Remove(items ...string)
- func (s *MapSet) SortList() []string
- func (s *MapSet) Update(items ...*Accounts)
- type Transaction
Constants ¶
View Source
const ( TokenETH = 1 // eth TokenContract = 2 // Contract TokenERC20 = 3 // ERC20 TokenDeploy = 4 // deploy contract TypeAccountNormal = 0 TypeAccountContract = 1 )
Variables ¶
View Source
var ( ContractTypeUnknown = 0 ContractTypeERC20 = 1 ContractTypeERC721 = 2 )
Functions ¶
This section is empty.
Types ¶
type AccountMap ¶
type Accounts ¶
type Accounts struct {
Id int64 `json:"id"`
Address string `json:"address"`
Balance decimal.Decimal `json:"balance"` // balance
BalanceInput decimal.Decimal `json:"balanceInput"` // input balance
BalanceOutput decimal.Decimal `json:"balanceOutput"` // output balance
AccountType int64 `json:"type"` // 0:common,1:contract
Contract string `json:"contract"` // contract address
ContractExist int `json:"contractExist"` // 0:contract is nil,1: contract is not nil
TransactionCount int64 `json:"transactionCount"`
}
type Block ¶
type Block struct {
BlockNumber uint64 `json:"block_number" es:"long"`
BlockHash string `json:"block_hash" es:"text"`
ParentHash string `json:"parent_hash" es:"text"`
Miner string `json:"miner" es:"text"`
BlockTime uint64 `json:"block_time" es:"long"`
BlockAward decimal.Decimal `json:"block_award" es:"double"`
TxCount int `json:"tx_count" es:"int"`
BlockSize uint64 `json:"block_size" es:"long"`
Txs []string `json:"txs,omitempty" es:"text"`
Timestamp time.Time `json:"timestamp" es:"date"`
}
func (*Block) MarshalJSON ¶
type Contract ¶
type Contract struct {
Address string `json:"address" es:"keyword"` // contract
Name string `json:"name" es:"text"` // contract name
Symbol string `json:"symbol" es:"text"` // contract symbol
Creator string `json:"creator" es:"text"` // creator
Icon string `json:"icon" es:"text"` // icon
UnitLength int64 `json:"unit_length" es:"integer"` // unit_length
Introduction string `json:"introduction" es:"text"` // introduction
WebSite string `json:"web_site" es:"text"` // web_site
BlockTime uint64 `json:"block_time" es:"long"` // block_time
BlockNumber uint64 `json:"block_number" es:"long"` // block_number
Total decimal.Decimal `json:"total" es:"double"` // total
TxNum int64 `json:"tx_num" es:"integer"` // tx_num
TxHash string `json:"tx_hash" es:"text"` // tx_hash
Type int `json:"type" es:"integer"` // type,0:unknown,1:ERC20,2:ERC721
AccountNum int `json:"account_num" es:"integer"` // account num
TokenCirculation decimal.Decimal `json:"token_circulation" es:"double"` // token_circulation
TokenTxNum int64 `json:"token_tx_num" es:"integer"` // token_tx_num
IsShow bool `json:"is_show" es:"boolean"` // is_show
Timestamp time.Time `json:"timestamp" es:"date"` // timestamp
}
func (*Contract) MarshalJSON ¶
type ContractMap ¶
type ContractMapSet ¶
func NewContractMapSet ¶
func NewContractMapSet() *ContractMapSet
func (*ContractMapSet) Clear ¶
func (s *ContractMapSet) Clear()
func (*ContractMapSet) IsEmpty ¶
func (s *ContractMapSet) IsEmpty() bool
func (*ContractMapSet) Len ¶
func (s *ContractMapSet) Len() int
func (*ContractMapSet) List ¶
func (s *ContractMapSet) List() ContractMap
func (*ContractMapSet) Remove ¶
func (s *ContractMapSet) Remove(items ...string)
func (*ContractMapSet) SortList ¶
func (s *ContractMapSet) SortList() []string
func (*ContractMapSet) Update ¶
func (s *ContractMapSet) Update(items ...*Contract)
type ListenAddress ¶
type ListenAddress struct {
Address string `json:"address" es:"keyword"` // address
Remark string `json:"remark" es:"text"` // memo
}
func (*ListenAddress) String ¶
func (a *ListenAddress) String() string
func (ListenAddress) TableName ¶
func (a ListenAddress) TableName() string
type Transaction ¶
type Transaction struct {
//Id int64 `json:"id"`
TxHash string `json:"tx_hash" es:"keyword"`
From string `json:"from" es:"keyword"`
To string `json:"to" es:"keyword"`
Value decimal.Decimal `json:"value" es:"double"`
Nonce decimal.Decimal `json:"nonce" es:"long"`
GasPrice decimal.Decimal `json:"gas_price" es:"long"`
GasLimit uint64 `json:"gas_limit" es:"long"`
Contract string `json:"contract" es:"keyword"`
TxType int `json:"tx_type" es:"integer"`
Status bool `json:"status" es:"boolean"`
BlockNumber decimal.Decimal `json:"block_number" es:"long"`
BlockTime uint64 `json:"block_time" es:"long"`
TransactionIndex uint64 `json:"transaction_index" es:"integer"`
GasUsed decimal.Decimal `json:"gas_used" es:"long"`
Fee decimal.Decimal `json:"fee" es:"double"`
Input string `json:"input" es:"input"`
Timestamp time.Time `json:"timestamp" es:"date"`
}
func (*Transaction) MarshalJSON ¶
func (a *Transaction) MarshalJSON() ([]byte, error)
func (Transaction) TableName ¶
func (a Transaction) TableName() string
Click to show internal directories.
Click to hide internal directories.