Documentation ¶
Index ¶
Constants ¶
View Source
const ( TronTopic = "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" EthTopic = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" EthTransferSingleTopic = "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62" EthTransferBatchTopic = "0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb" PolygonTopic = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupTx ¶ added in v0.5.1
type BackupTx struct { ChainCode uint64 `json:"chainCode" gorm:"column:block_chain"` Extra string `json:"extra" gorm:"column:extra"` Signed string `json:"signed" gorm:"column:signed"` From string `json:"from" gorm:"column:from_addr"` ID uint64 `json:"id" gorm:"column:id"` To string `json:"to" gorm:"column:to_addr"` Response string `json:"response" gorm:"column:response"` Status uint8 `json:"status" gorm:"column:tx_status"` }
{ "chainCode": 200, "extra": "", "from": "0x123", "id": 1692935834954910, "signed": "0xe5cB067E90D5Cd1F8052B83562Ae670bA4A211a8", "status": 0, "to": "0x456" "response": "{}" }
type Block ¶
type Block struct { Id uint64 `json:"id" gorm:"column:id"` BlockChain uint64 `json:"chainCode" gorm:"column:block_chain"` BlockHash string `json:"hash" gorm:"column:hash"` BlockTime string `json:"timestamp" gorm:"column:block_time"` BlockStatus string `json:"blockStatus" gorm:"column:block_status"` BlockNumber string `json:"number" gorm:"column:block_number"` ParentHash string `json:"parentHash" gorm:"column:parent_hash"` BlockReward string `json:"blockReward" gorm:"column:block_reward"` FeeRecipient string `json:"feeRecipient" gorm:"column:fee_recipient"` TotalDifficulty string `json:"totalDifficulty" gorm:"column:total_difficulty"` BlockSize string `json:"size" gorm:"column:block_size"` GasLimit string `json:"gasLimit" gorm:"column:gas_limit"` GasUsed string `json:"gasUsed" gorm:"column:gas_used"` BaseFee string `json:"baseFeePerGas" gorm:"column:base_fee_per_gas"` ExtraData string `json:"extraData" gorm:"column:extra_data"` Root string `json:"stateRoot" gorm:"column:state_root"` Transactions []string `json:"transactions" gorm:"-"` TransactionList string `json:"-" gorm:"column:transactions"` TxRoot string `json:"transactionsRoot" gorm:"column:transactions_root"` ReceiptRoot string `json:"receiptsRoot" gorm:"column:receipts_root"` Coinbase string `json:"miner" gorm:"column:miner"` Nonce string `json:"nonce" gorm:"column:nonce"` }
type ContractTx ¶
type DbStoreInterface ¶ added in v0.5.1
type DbStoreInterface interface { NewToken(token *NodeToken) error UpdateToken(token string, nodeToken *NodeToken) error GetNodeTokenByEmail(email string) (*NodeToken, error) GetNodeTokenByToken(token string) (*NodeToken, error) AddMonitorAddress(blockchain int64, address *MonitorAddress) error GetAddressByToken(blockchain int64, token string) ([]*MonitorAddress, error) GetAddressByToken2(token string) ([]*MonitorAddress, error) GetAddressByToken3(blockchain int64) ([]*MonitorAddress, error) DelMonitorAddress(blockchain int64, token string, address string) error NewTx(blockchain int64, tx []*Tx) error NewBlock(blockchain int64, block []*Block) error NewReceipt(blockchain int64, receipt []*Receipt) error NewSubTx(blockchain int64, tx []*SubTx) error NewBackupTx(blockchain int64, tx []*BackupTx) error NewSubFilter(filters []*SubFilter) error DelSubFilter(id int64) error DelSubFilter2(filter *SubFilter) error GetSubFilter(token string, blockChain int64, txCode string) ([]*SubFilter, error) }
type Logs ¶
type Logs []struct { BlockHash string `json:"blockHash" gorm:"column:block_hash"` Address string `json:"address" gorm:"column:address"` LogIndex string `json:"logIndex" gorm:"column:log_index"` Data string `json:"data" gorm:"column:data"` Removed bool `json:"removed" gorm:"column:removed"` Topics []string `json:"topics" gorm:"column:topics"` BlockNumber string `json:"blockNumber" gorm:"column:block_number"` TransactionIndex string `json:"transactionIndex" gorm:"column:transaction_index"` TransactionHash string `json:"transactionHash" gorm:"column:transaction_hash"` }
type MonitorAddress ¶
type Receipt ¶
type Receipt struct { Id uint64 `json:"id"` BlockChain uint64 `json:"chainCode" gorm:"column:block_chain"` BlockHash string `json:"blockHash" gorm:"column:block_hash"` LogsBloom string `json:"logsBloom" gorm:"column:logs_bloom"` ContractAddress string `json:"contractAddress" gorm:"column:contract_address"` TransactionIndex string `json:"transactionIndex" gorm:"column:transaction_index"` Type string `json:"type" gorm:"column:tx_type"` TransactionHash string `json:"transactionHash" gorm:"column:transaction_hash"` GasUsed string `json:"gasUsed" gorm:"column:gas_used"` BlockNumber string `json:"blockNumber" gorm:"column:block_number"` CumulativeGasUsed string `json:"cumulativeGasUsed" gorm:"column:cumulative_gas_used"` From string `json:"from" gorm:"column:from_addr"` To string `json:"to" gorm:"column:to_addr"` EffectiveGasPrice string `json:"effectiveGasPrice" gorm:"column:effective_gas_price"` Logs *Logs `json:"logs" gorm:"-"` LogList string `json:"-" gorm:"column:logs"` CreateTime string `json:"createTime" gorm:"column:create_time"` // 2006-01-02 Status string `json:"status" gorm:"column:status"` }
type SubTx ¶
type SubTx struct { Id uint64 `json:"id" gorm:"column:id"` BlockChain uint64 `json:"chainCode" gorm:"column:block_chain"` BlockHash string `json:"blockHash" gorm:"column:block_hash"` BlockNumber string `json:"blockNumber" gorm:"column:block_number"` ContractTx []*ContractTx `json:"txs" gorm:"-"` ContractTxs string `json:"-" gorm:"column:contract_tx"` Fee string `json:"fee" gorm:"column:fee"` FeeDetail interface{} `json:"-" gorm:"-"` FeeDetails string `json:"-" gorm:"column:fee_detail"` From string `json:"from" gorm:"column:from_addr"` Hash string `json:"hash" gorm:"column:hash"` Input string `json:"-" gorm:"column:input_data"` Status uint64 `json:"status" gorm:"column:tx_status"` //0x0:失败,0x1:成功 To string `json:"to" gorm:"column:to_addr"` TxTime string `json:"txTime" gorm:"column:tx_time"` TxType uint64 `json:"-" gorm:"column:tx_type"` //交易类型 1:合约调用,2:普通资产转移 3:资源代理 4:资源回收 5:激活 6:质押 7:解质押 8:解质押提现 Value string `json:"-" gorm:"column:value"` }
type Tx ¶
type Tx struct { Id uint64 `json:"id" gorm:"column:id"` BlockChain uint64 `json:"chainCode" gorm:"column:block_chain"` TxHash string `json:"hash" gorm:"column:hash"` TxTime string `json:"txTime" gorm:"column:tx_time"` TxStatus string `json:"txStatus" gorm:"column:tx_status"` BlockNumber string `json:"blockNumber" gorm:"column:block_number"` FromAddr string `json:"from" gorm:"column:from_addr"` ToAddr string `json:"to" gorm:"column:to_addr"` Value string `json:"value" gorm:"column:value"` Fee string `json:"fee" gorm:"column:fee"` GasPrice string `json:"gasPrice" gorm:"column:gas_price"` MaxPrice string `json:"maxFeePerGas" gorm:"column:max_fee_per_gas"` GasLimit string `json:"gas" gorm:"column:gas"` GasUsed string `json:"gasUsed" gorm:"column:gas_used"` BaseFee string `json:"baseFeePerGas" gorm:"column:base_fee_per_gas"` PriorityFee string `json:"maxPriorityFeePerGas" gorm:"column:max_priority_fee_per_gas"` InputData string `json:"input" gorm:"column:input_data"` BlockHash string `json:"blockHash" gorm:"column:block_hash"` TransactionIndex string `json:"transactionIndex" gorm:"column:transaction_index"` Type string `json:"type" gorm:"column:tx_type"` }
type WsPushMessage ¶
type WsPushMessage struct { // 1: Asset transfer transaction, 3: Pledged assets 5: Unlock assets 7: Withdraw 9: Agent resources 11: Recycle resources (cancel agent) 13: Activate account Code int64 `json:"code"` BlockChain int64 `json:"blockChain"` Token string `json:"token"` Data any `json:"data"` }
Click to show internal directories.
Click to hide internal directories.