mychain

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: BSD-3-Clause Imports: 20 Imported by: 1

README

mychain 061902

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImpEth

func ImpEth() ethChain

func ImpTron

func ImpTron(token string) tronChain

Types

type EthBlock

type EthBlock struct {
	Jsonrpc string `json:"jsonrpc"`
	Id      int    `json:"id"`
	Result  struct {
		BaseFeePerGas         string `json:"baseFeePerGas"`
		BlobGasUsed           string `json:"blobGasUsed"`
		Difficulty            string `json:"difficulty"`
		ExcessBlobGas         string `json:"excessBlobGas"`
		ExtraData             string `json:"extraData"`
		GasLimit              string `json:"gasLimit"`
		GasUsed               string `json:"gasUsed"`
		Hash                  string `json:"hash"`
		LogsBloom             string `json:"logsBloom"`
		Miner                 string `json:"miner"`
		MixHash               string `json:"mixHash"`
		Nonce                 string `json:"nonce"`
		Number                string `json:"number"`
		ParentBeaconBlockRoot string `json:"parentBeaconBlockRoot"`
		ParentHash            string `json:"parentHash"`
		ReceiptsRoot          string `json:"receiptsRoot"`
		Sha3Uncles            string `json:"sha3Uncles"`
		Size                  string `json:"size"`
		StateRoot             string `json:"stateRoot"`
		Timestamp             string `json:"timestamp"`
		TotalDifficulty       string `json:"totalDifficulty"`
		Transactions          []struct {
			BlockHash            string `json:"blockHash"`
			BlockNumber          string `json:"blockNumber"`
			From                 string `json:"from"`
			Gas                  string `json:"gas"`
			GasPrice             string `json:"gasPrice"`
			MaxFeePerGas         string `json:"maxFeePerGas,omitempty"`
			MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas,omitempty"`
			Hash                 string `json:"hash"`
			Input                string `json:"input"`
			Nonce                string `json:"nonce"`
			To                   string `json:"to"`
			TransactionIndex     string `json:"transactionIndex"`
			Value                string `json:"value"`
			Type                 string `json:"type"`
			AccessList           []struct {
				Address     string   `json:"address"`
				StorageKeys []string `json:"storageKeys"`
			} `json:"accessList,omitempty"`
			ChainId             string   `json:"chainId"`
			V                   string   `json:"v"`
			R                   string   `json:"r"`
			S                   string   `json:"s"`
			YParity             string   `json:"yParity,omitempty"`
			MaxFeePerBlobGas    string   `json:"maxFeePerBlobGas,omitempty"`
			BlobVersionedHashes []string `json:"blobVersionedHashes,omitempty"`
		} `json:"transactions"`
		TransactionsRoot string `json:"transactionsRoot"`
		//Uncles           []interface{} `json:"uncles"`
		Withdrawals []struct {
			Index          string `json:"index"`
			ValidatorIndex string `json:"validatorIndex"`
			Address        string `json:"address"`
			Amount         string `json:"amount"`
		} `json:"withdrawals"`
		WithdrawalsRoot string `json:"withdrawalsRoot"`
	} `json:"result"`
}

type EthBlockNum

type EthBlockNum struct {
	Jsonrpc string `json:"jsonrpc"`
	Id      int    `json:"id"`
	Result  string `json:"result"`
}

func (*EthBlockNum) ToNumber

func (self *EthBlockNum) ToNumber() int64

type TokenData added in v1.0.3

type TokenData struct {
	TokenId         string  `json:"tokenId"`
	TokenName       string  `json:"tokenName"`
	TokenDecimal    int     `json:"tokenDecimal"`
	TokenAbbr       string  `json:"tokenAbbr"`
	TokenCanShow    int     `json:"tokenCanShow"`
	TokenType       string  `json:"tokenType"`
	Vip             bool    `json:"vip"`
	Balance         string  `json:"balance"`
	TokenPriceInTrx int     `json:"tokenPriceInTrx"`
	TokenPriceInUsd float64 `json:"tokenPriceInUsd"`
	AssetInTrx      float64 `json:"assetInTrx"`
	AssetInUsd      float64 `json:"assetInUsd"`
	Percent         int     `json:"percent"`
}

代币详情

type TokenOverview added in v1.0.3

type TokenOverview struct {
	TotalAssetInTrx float64     `json:"totalAssetInTrx"`
	Data            []TokenData `json:"data"`
	TotalTokenCount int         `json:"totalTokenCount"`
	TotalAssetInUsd float64     `json:"totalAssetInUsd"`
}

代币概览

type TronBlock

type TronBlock struct {
	BlockID     string `json:"blockID"` //区块编号,
	BlockHeader struct {
		RawData struct {
			Number         int64  `json:"number"`          //区块编号,也就是链上区块的高度
			TxTrieRoot     string `json:"txTrieRoot"`      //交易根节点的哈希值
			WitnessAddress string `json:"witness_address"` //产生该区块的超级代表的帐户地址
			ParentHash     string `json:"parentHash"`      //上一区块的ID
			Version        int    `json:"version"`         //标识链的版本
			Timestamp      int64  `json:"timestamp"`       //创建块的时间戳
		} `json:"raw_data"`
		WitnessSignature string `json:"witness_signature"` //产生区块的超级代表的签名
	} `json:"block_header"`
	Transactions []TronTransactionInfo `json:"transactions"` //打包进该区块的交易清单
}

type TronContractInfo

type TronContractInfo struct {
	Parameter struct {
		Value struct {
			Data            string `json:"data"` //从中解析交易类型,交易对象,交易金额
			OwnerAddress    string `json:"owner_address"`
			ToAddress       string `json:"to_address"`
			ContractAddress string `json:"contract_address"`
			Amount          int    `json:"amount"`
		} `json:"value"`
		TypeUrl string `json:"type_url"`
	} `json:"parameter"`
	Type string `json:"type"`
}

type TronTrRawInfo

type TronTrRawInfo struct {
	Contract      []TronContractInfo `json:"contract"`
	RefBlockBytes string             `json:"ref_block_bytes"`
	RefBlockHash  string             `json:"ref_block_hash"`
	Expiration    int64              `json:"expiration"`
	Timestamp     int64              `json:"timestamp"`
	FeeLimit      int                `json:"fee_limit"`
}

type TronTrResult

type TronTrResult struct {
	ContractRet string `json:"contractRet"`
}

type TronTransactionInfo

type TronTransactionInfo struct {
	TxID       string         `json:"txID"`
	Ret        []TronTrResult `json:"ret"`
	Signature  []string       `json:"signature"`
	RawDataHex string         `json:"raw_data_hex"`
	RawData    TronTrRawInfo  `json:"raw_data"`
}

Jump to

Keyboard shortcuts

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