types

package
v0.0.0-...-9f09256 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2022 uscan team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	Erc20Flag   byte = 0x01
	Erc721Flag  byte = 0x02
	Erc1155Flag byte = 0x04
)
View Source
const (
	SoliditySingleFile        = "solidity-single-file"
	SolidityStandardJsonInput = "solidity-standard-json-input"
)

Variables

View Source
var (
	ErrorInvalidByte = errors.New("invalid byte")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	Owner common.Address `rlp:"-"`

	Erc20            bool `rlp:"-"`
	Erc721           bool `rlp:"-"`
	Erc1155          bool `rlp:"-"`
	ErcFlag          byte
	BlockNumber      field.BigInt
	Balance          field.BigInt
	Name, Symbol     string
	TokenTotalSupply field.BigInt
	NftTotalSupply   field.BigInt
	Decimals         field.BigInt // erc20 decimals

	Creator common.Address
	TxHash  common.Hash

	Retry field.BigInt
}

func (*Account) Marshal

func (b *Account) Marshal() ([]byte, error)

func (*Account) Unmarshal

func (b *Account) Unmarshal(bin []byte) (err error)

type AccountResp

type AccountResp struct {
	Owner            string  `json:"owner"`
	Balance          string  `json:"balance"`
	BlockNumber      *string `json:"blockNumber"`
	Creator          *string `json:"creator"`
	TxHash           *string `json:"txHash"`
	Code             *string `json:"code"`
	Name             string  `json:"name"`
	Symbol           string  `json:"symbol"`
	TokenTotalSupply *string `json:"tokenTotalSupply"`
	NftTotalSupply   *string `json:"nftTotalSupply"`
	Decimals         uint64  `json:"decimals"`
	//CreatedTime      uint64  `json:"createdTime"`
	Erc20   bool `json:"erc20"`
	Erc721  bool `json:"erc721"`
	Erc1155 bool `json:"erc1155"`
}

type BkSim

type BkSim struct {
	Number            field.BigInt   `json:"number"`
	Timestamp         field.BigInt   `json:"timestamp"`
	Miner             common.Address `json:"miner"`
	GasUsed           field.BigInt   `json:"gas_used"`
	TransactionsTotal field.BigInt   `json:"transactions_total"`
}

type Block

type Block struct {
	Number           *field.BigInt  `json:"number"  rlp:"-"`
	Hash             common.Hash    `json:"hash"`
	ParentHash       common.Hash    `json:"parentHash"`
	UncleHash        common.Hash    `json:"sha3Uncles"`
	Coinbase         common.Address `json:"miner"`
	Root             common.Hash    `json:"stateRoot"`
	TxHash           common.Hash    `json:"transactionsRoot"`
	ReceiptHash      common.Hash    `json:"receiptsRoot"`
	Bloom            Bloom          `json:"logsBloom"`
	Difficulty       field.BigInt   `json:"difficulty"`
	GasLimit         field.BigInt   `json:"gasLimit"`
	GasUsed          field.BigInt   `json:"gasUsed"`
	TimeStamp        field.BigInt   `json:"timestamp"`
	Extra            []byte         `json:"extraData"`
	MixDigest        common.Hash    `json:"mixHash"`
	Nonce            BlockNonce     `json:"nonce"`
	BaseFee          field.BigInt   `json:"baseFeePerGas"`
	Size             field.BigInt   `json:"size"`
	TotalDifficulty  field.BigInt   `json:"totalDifficulty"`
	Transactions     []common.Hash  `json:"transactions" rlp:"-"`
	TransactionTotal field.BigInt   `json:"-"`
}

func (*Block) Marshal

func (b *Block) Marshal() ([]byte, error)

func (*Block) Unmarshal

func (b *Block) Unmarshal(bin []byte) (err error)

type BlockNonce

type BlockNonce [8]byte

func (BlockNonce) MarshalText

func (n BlockNonce) MarshalText() ([]byte, error)

MarshalText encodes n as a hex string with 0x prefix.

func (*BlockNonce) UnmarshalText

func (n *BlockNonce) UnmarshalText(input []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type BlockResp

type BlockResp struct {
	BaseFeePerGas     *string  `json:"baseFeePerGas"`
	Difficulty        string   `json:"difficulty"`
	ExtraData         []byte   `json:"extraData"`
	GasLimit          string   `json:"gasLimit"` // int64 改成string
	GasUsed           string   `json:"gasUsed"`  // int64 改成string
	Hash              string   `json:"hash"`
	LogsBloom         string   `json:"logsBloom"`
	Miner             string   `json:"miner"`
	MixHash           string   `json:"mixHash"`
	Nonce             string   `json:"nonce"`
	Number            string   `json:"number"`
	ParentHash        string   `json:"parentHash"`
	ReceiptsRoot      string   `json:"receiptsRoot"`
	Sha3Uncles        string   `json:"sha3Uncles"`
	Size              string   `json:"size"`
	StateRoot         string   `json:"stateRoot"`
	Timestamp         uint64   `json:"timestamp"`
	TotalDifficulty   uint64   `json:"totalDifficulty"`
	Transactions      []string `json:"transactions"`
	TransactionsTotal uint64   `json:"transactionsTotal"`
	TransactionsRoot  string   `json:"transactionsRoot"`
}

type Bloom

type Bloom [types.BloomByteLength]byte

func (Bloom) MarshalText

func (b Bloom) MarshalText() ([]byte, error)

MarshalText encodes b as a hex string with 0x prefix.

func (*Bloom) UnmarshalText

func (b *Bloom) UnmarshalText(input []byte) error

UnmarshalText b as a hex string with 0x prefix.

type CallFrame

type CallFrame struct {
	Type    string         `json:"type"`
	From    common.Address `json:"from"`
	To      common.Address `json:"to,omitempty"`
	Value   field.BigInt   `json:"value,omitempty"`
	Gas     field.BigInt   `json:"gas"`
	GasUsed field.BigInt   `json:"gasUsed"`
	Input   hexutil.Bytes  `json:"input"`
	Output  hexutil.Bytes  `json:"output,omitempty"`
	Error   string         `json:"error,omitempty"`
	Calls   []*CallFrame   `json:"calls,omitempty"`
}

func (*CallFrame) JsonToString

func (c *CallFrame) JsonToString() string

type CompilerVersion

type CompilerVersion struct {
	ID       uint8  `json:"id"`
	Name     string `json:"name"`
	FileName string `json:"fileName"`
}

type Contract

type Contract struct {
	Owner                 common.Address `rlp:"-"`
	ByteCode              []byte
	ByteCodeHash          common.Hash
	ConstructorArguements []byte
	DeployedCode          []byte
}

func (*Contract) Marshal

func (b *Contract) Marshal() ([]byte, error)

func (*Contract) Unmarshal

func (b *Contract) Unmarshal(bin []byte) error

type ContractStatus

type ContractStatus struct {
	Status    uint64 `json:"status"`
	ErrReason string `json:"errReason"`
}

func (*ContractStatus) Marshal

func (b *ContractStatus) Marshal() ([]byte, error)

func (*ContractStatus) Unmarshal

func (b *ContractStatus) Unmarshal(bin []byte) error

type ContractType

type ContractType uint8
const (
	UnKnow ContractType = iota
	EIP20
	EIP721
	EIP1155
)

type ContractVerity

type ContractVerity struct {
	ContractName    string `json:"contractName"`
	CompilerVersion string `json:"compilerVersion"`
	Optimization    uint64 `json:"optimization"`
	Runs            uint64 `json:"runs"`
	EVMVersion      string `json:"evmVersion"`
	LicenseType     uint64 `json:"licenseType"`
	ABI             string `json:"abi"`
	Metadata        string `json:"metadata"`
	CodeHash        string `json:"codeHash"`
	Object          string `json:"object"`
}

func (*ContractVerity) Marshal

func (b *ContractVerity) Marshal() ([]byte, error)

func (*ContractVerity) Unmarshal

func (b *ContractVerity) Unmarshal(bin []byte) (err error)

type ContractVerityInfo

type ContractVerityInfo struct {
	ContractName    string            `json:"contractName"`
	CompilerVersion string            `json:"compilerVersion"`
	Optimization    uint64            `json:"optimization"`
	Runs            uint64            `json:"runs"`
	EVMVersion      string            `json:"evmVersion"`
	LicenseType     uint64            `json:"licenseType"`
	ABI             string            `json:"abi"`
	Metadata        map[string]string `json:"metadata"`
	Object          string            `json:"object"`
}

type ContractVerityInfoResp

type ContractVerityInfoResp struct {
	Contract             *ContractVerityInfo `json:"contract"`
	ProxyContractAddress string              `json:"proxyContractAddress"`
	ProxyContract        *ContractVerityInfo `json:"proxyContract"`
}

type ContractVerityTmp

type ContractVerityTmp struct {
	Address          string
	ContractName     string
	CompilerType     string
	CompilerVersion  string
	CompilerFileName string
	LicenseType      uint64
	SourceCode       string
	Optimization     uint64
	Runs             uint64
	EVMVersion       string // 当前默认default
	Status           int    // 0:handling  1 success 2 fail
}

func (*ContractVerityTmp) Marshal

func (b *ContractVerityTmp) Marshal() ([]byte, error)

func (*ContractVerityTmp) Unmarshal

func (b *ContractVerityTmp) Unmarshal(bin []byte) (err error)

type Deserializer

type Deserializer interface {
	Unmarshal(bin []byte) error
}

type Erc1155Transfer

type Erc1155Transfer struct {
	TransactionHash common.Hash
	BlockNumber     field.BigInt
	Contract        common.Address
	Method          []byte
	From            common.Address
	To              common.Address
	TokenID         field.BigInt
	Quantity        field.BigInt
	TimeStamp       field.BigInt
}

func (*Erc1155Transfer) Marshal

func (b *Erc1155Transfer) Marshal() ([]byte, error)

func (*Erc1155Transfer) Unmarshal

func (b *Erc1155Transfer) Unmarshal(bin []byte) error

type Erc1155TxResp

type Erc1155TxResp struct {
	TransactionHash  string `json:"transactionHash"`
	BlockHash        string `json:"blockHash"`
	BlockNumber      string `json:"blockNumber"`
	Contract         string `json:"contract"`
	ContractName     string `json:"contractName"`
	ContractSymbol   string `json:"contractSymbol"`
	ContractDecimals uint64 `json:"contractDecimals"`
	Method           string `json:"method"`
	From             string `json:"from"`
	FromName         string `json:"fromName"`
	FromSymbol       string `json:"fromSymbol"`
	FromContract     bool   `json:"fromContract"`
	To               string `json:"to"`
	ToName           string `json:"toName"`
	ToSymbol         string `json:"toSymbol"`
	ToContract       bool   `json:"toContract"`
	TokenID          string `json:"tokenID"`
	Value            string `json:"value"`
	CreatedTime      uint64 `json:"createdTime"`
}

type Erc20Transfer

type Erc20Transfer struct {
	TransactionHash common.Hash

	BlockNumber field.BigInt
	Contract    common.Address
	Method      []byte
	From        common.Address
	To          common.Address
	Amount      field.BigInt
	TimeStamp   field.BigInt
}

func (*Erc20Transfer) Marshal

func (b *Erc20Transfer) Marshal() ([]byte, error)

func (*Erc20Transfer) Unmarshal

func (b *Erc20Transfer) Unmarshal(bin []byte) error

type Erc20TxResp

type Erc20TxResp struct {
	TransactionHash  string `json:"transactionHash"`
	BlockHash        string `json:"blockHash"`
	BlockNumber      string `json:"blockNumber"`
	Contract         string `json:"contract"`
	ContractName     string `json:"contractName"`
	ContractSymbol   string `json:"contractSymbol"`
	ContractDecimals uint64 `json:"contractDecimals"`
	Method           string `json:"method"`
	From             string `json:"from"`
	FromName         string `json:"fromName"`
	FromSymbol       string `json:"fromSymbol"`
	FromContract     bool   `json:"fromContract"`
	To               string `json:"to"`
	ToName           string `json:"toName"`
	ToSymbol         string `json:"toSymbol"`
	ToContract       bool   `json:"toContract"`
	Value            string `json:"value"`
	CreatedTime      uint64 `json:"createdTime"`
}

type Erc721Transfer

type Erc721Transfer struct {
	TransactionHash common.Hash
	BlockNumber     field.BigInt
	Contract        common.Address
	Method          []byte
	From            common.Address
	To              common.Address
	TokenId         field.BigInt
	TimeStamp       field.BigInt
}

func (*Erc721Transfer) Marshal

func (b *Erc721Transfer) Marshal() ([]byte, error)

func (*Erc721Transfer) Unmarshal

func (b *Erc721Transfer) Unmarshal(bin []byte) error

type Erc721TxResp

type Erc721TxResp struct {
	TransactionHash  string `json:"transactionHash"`
	BlockHash        string `json:"blockHash"`
	BlockNumber      string `json:"blockNumber"`
	Contract         string `json:"contract"`
	ContractName     string `json:"contractName"`
	ContractSymbol   string `json:"contractSymbol"`
	ContractDecimals uint64 `json:"contractDecimals"`
	Method           string `json:"method"`
	From             string `json:"from"`
	FromName         string `json:"fromName"`
	FromSymbol       string `json:"fromSymbol"`
	FromContract     bool   `json:"fromContract"`
	To               string `json:"to"`
	ToName           string `json:"toName"`
	ToSymbol         string `json:"toSymbol"`
	ToContract       bool   `json:"toContract"`
	TokenID          string `json:"tokenID"`
	CreatedTime      uint64 `json:"createdTime"`
}

type EventTransferData

type EventTransferData struct {
	ContractType     ContractType `json:"contractType"`
	From             string       `json:"from"`
	To               string       `json:"to"`
	Contract         string       `json:"contract"`
	ContractName     string       `json:"contractName"`
	ContractSymbol   string       `json:"contractSymbol"`
	ContractDecimals uint64       `json:"contractDecimals"`
	TokenIDToNums    []*TokenNum  `json:"tokenIDToNums"`
	Value            string       `json:"value"`
}

type ExecutionResult

type ExecutionResult struct {
	Gas         uint64     `json:"gas"`
	Failed      bool       `json:"failed"`
	ReturnValue string     `json:"returnValue"`
	StructLogs  StructLogs `json:"structLogs"`
}

func (*ExecutionResult) JsonToString

func (c *ExecutionResult) JsonToString() string

type Holder

type Holder struct {
	Addr     common.Address
	Quantity field.BigInt
}

func ByteToHolder

func ByteToHolder(bin []byte) (*Holder, error)

func (Holder) ToBytes

func (h Holder) ToBytes() []byte

type HolderResp

type HolderResp struct {
	Address  string
	Quantity string
}

type Home

type Home struct {
	BlockNumber  field.BigInt `rlp:"-"`
	TxTotal      field.BigInt
	AddressTotal field.BigInt
	Erc20Total   field.BigInt
	Erc721Total  field.BigInt
	Erc1155Total field.BigInt
	Blocks       []*BkSim
	Txs          []*TxSim
	DateTxs      map[string]*field.BigInt `rlp:"-"` // example : 20221023 => 0x2
	DateTxsByte  []byte
}

func (*Home) Marshal

func (b *Home) Marshal() ([]byte, error)

func (*Home) Unmarshal

func (b *Home) Unmarshal(bin []byte) (err error)

type HomeBlock

type HomeBlock struct {
	Number            string `json:"number"`
	Timestamp         uint64 `json:"timestamp"`
	Miner             string `json:"miner"`
	GasUsed           string `json:"gasUsed"`
	TransactionsTotal uint64 `json:"transactionsTotal"`
}

type HomeTx

type HomeTx struct {
	Hash        string  `json:"hash"`
	From        string  `json:"from"`
	To          string  `json:"to"`
	GasPrice    *string `json:"gasPrice"`
	Gas         *string `json:"gas"`
	CreatedTime uint64  `json:"createTime"`
}

type InternalTx

type InternalTx struct {
	TransactionHash common.Hash `rlp:"-"`
	BlockNumber     field.BigInt
	Status          bool
	CallType        string
	Depth           string
	From            common.Address
	To              common.Address
	Amount          field.BigInt
	GasLimit        field.BigInt
	TimeStamp       field.BigInt
}

func (*InternalTx) Marshal

func (b *InternalTx) Marshal() ([]byte, error)

func (*InternalTx) Unmarshal

func (b *InternalTx) Unmarshal(bin []byte) error

type InternalTxKey

type InternalTxKey struct {
	TransactionHash common.Hash
	Index           field.BigInt
}

func (*InternalTxKey) Marshal

func (b *InternalTxKey) Marshal() ([]byte, error)

func (*InternalTxKey) Unmarshal

func (b *InternalTxKey) Unmarshal(bin []byte) error

type InternalTxResp

type InternalTxResp struct {
	TransactionHash string `json:"transactionHash"`
	BlockNumber     string `json:"blockNumber"`
	Status          bool   `json:"status"`
	CallType        string `json:"callType"`
	Depth           string `json:"depth"`
	From            string `json:"from"`
	To              string `json:"to"`
	Amount          string `json:"amount"`
	GasLimit        string `json:"gasLimit"`
	CreatedTime     uint64 `json:"createdTime"`
}

type Inventory

type Inventory struct {
	Addr    common.Address
	TokenID field.BigInt
}

func ByteToInventory

func ByteToInventory(bin []byte) (*Inventory, error)

func (Inventory) ToBytes

func (h Inventory) ToBytes() []byte

type InventoryResp

type InventoryResp struct {
	Address string
	TokenID string
}

type LicenseType

type LicenseType struct {
	ID   uint8  `json:"id"`
	Name string `json:"name"`
}

type ListBlockResp

type ListBlockResp struct {
	Number            string  `json:"number"`
	Timestamp         uint64  `json:"timestamp"`
	TransactionsTotal uint64  `json:"transactionsTotal"`
	Miner             string  `json:"miner"`
	GasLimit          string  `json:"gasLimit"` // int64 改成string
	GasUsed           string  `json:"gasUsed"`  // int64 改成string
	BaseFeePerGas     *string `json:"baseFeePerGas"`
}

type ListTransactionResp

type ListTransactionResp struct {
	Hash        string  `json:"hash"` // transaction Hash
	Method      string  `json:"method"`
	BlockHash   string  `json:"blockHash"`
	BlockNumber string  `json:"blockNumber"`
	From        string  `json:"from"`
	To          string  `json:"to"`
	ToName      string  `json:"toName"`
	ToSymbol    string  `json:"toSymbol"`
	ToContract  bool    `json:"toContract"`
	Gas         *string `json:"gas"`
	GasPrice    *string `json:"gasPrice"`
	Value       *string `json:"value"`
	CreatedTime uint64  `json:"createTime"`
}

type Log

type Log struct {
	Address  common.Address `json:"address"`
	Topics   []common.Hash  `json:"topics"`
	Data     hexutil.Bytes  `json:"data"`
	LogIndex field.BigInt   `json:"logIndex"`
}

func (*Log) ToEthLog

func (l *Log) ToEthLog() ethTypes.Log

type Pager

type Pager struct {
	Offset int64 `query:"offset"`
	Limit  int64 `query:"limit"`
}

func (*Pager) Complete

func (f *Pager) Complete()

type Rt

type Rt struct {
	TxHash            common.Hash     `json:"transactionHash"  rlp:"-"`
	Type              field.BigInt    `json:"type,omitempty"`
	PostState         hexutil.Bytes   `json:"root"`
	Status            field.BigInt    `json:"status"`
	CumulativeGasUsed field.BigInt    `json:"cumulativeGasUsed"`
	Bloom             Bloom           `json:"logsBloom"`
	Logs              []*Log          `json:"logs"`
	ContractAddress   *common.Address `json:"contractAddress"`
	GasUsed           field.BigInt    `json:"gasUsed"`
	EffectiveGasPrice field.BigInt    `json:"effectiveGasPrice"`
	ExistInternalTx   bool
	ReturnErr         string
}

func (*Rt) Marshal

func (b *Rt) Marshal() ([]byte, error)

func (*Rt) Unmarshal

func (b *Rt) Unmarshal(bin []byte) error

type RtLogResp

type RtLogResp struct {
	Address  string   `json:"address"`
	Topics   []string `json:"topics"`
	Data     string   `json:"data"`
	LogIndex uint64   `json:"logIndex"`
}

type RtResp

type RtResp struct {
	ContractAddress       *string `json:"contractAddress"`
	ContractAddressName   string  `json:"contractAddressName"`
	ContractAddressSymbol string  `json:"contractAddressSymbol"`
	CumulativeGasUsed     *string `json:"cumulativeGasUsed"`
	EffectiveGasPrice     *string `json:"effectiveGasPrice"`
	GasUsed               string  `json:"gasUsed"`
	LogsBloom             *string `json:"logsBloom"`
	Root                  string  `json:"root"`
	Status                uint64  `json:"status"`
	ErrorReturn           string  `json:"errorReturn"`
}

type SearchFilter

type SearchFilter struct {
	Type    int    `query:"type"` // 1 all filter 2 address
	Keyword string `query:"keyword"`
}

type Serializer

type Serializer interface {
	Marshal() ([]byte, error)
}

type StructLogRes

type StructLogRes struct {
	Pc      uint64      `json:"pc"`
	Op      string      `json:"op"`
	Gas     uint64      `json:"gas"`
	GasCost uint64      `json:"gasCost"`
	Depth   int         `json:"depth"`
	Error   interface{} `json:"error,omitempty"`
}

type StructLogs

type StructLogs []StructLogRes

func (*StructLogs) JsonToString

func (c *StructLogs) JsonToString() string

type TokenNum

type TokenNum struct {
	TokenId *string `json:"tokenID"`
	Num     *string `json:"num"`
}

type TokensTransferred

type TokensTransferred struct {
	From            string `json:"from"`
	FromHex         string `json:"fromHex"`
	To              string `json:"to"`
	ToHex           string `json:"toHex"`
	Address         string `json:"address"`
	AddressName     string `json:"addressName"`
	AddressSymbol   string `json:"addressSymbol"`
	AddressDecimals uint64 `json:"addressDecimals"`
	AddressType     string `json:"addressType"`
	AddressValue    string `json:"addressValue"`
	TokenID         string `json:"tokenID"`
}

type TraceTx

type TraceTx struct {
	Res    string
	LogNum field.BigInt
}

func (*TraceTx) Marshal

func (b *TraceTx) Marshal() ([]byte, error)

func (*TraceTx) Unmarshal

func (b *TraceTx) Unmarshal(bin []byte) error

type TraceTx2

type TraceTx2 struct {
	Res string
}

func (*TraceTx2) Marshal

func (b *TraceTx2) Marshal() ([]byte, error)

func (*TraceTx2) Unmarshal

func (b *TraceTx2) Unmarshal(bin []byte) error

type TraceTx2Resp

type TraceTx2Resp struct {
	Res string `json:"res"`
}

type TraceTxResp

type TraceTxResp struct {
	Res    string `json:"res"`
	LogNum string `json:"logNum"`
}

type TransactionBaseResp

type TransactionBaseResp struct {
	Hash     string  `json:"hash"` // transaction Hash
	Nonce    string  `json:"nonce"`
	GasUsed  string  `json:"gasUsed"`
	GasLimit string  `json:"gasLimit"`
	Status   uint64  `json:"status"`
	GasPrice *string `json:"gasPrice"`
}

type Tx

type Tx struct {
	Hash      common.Hash     `json:"hash"  rlp:"-"`
	BlockNum  field.BigInt    `json:"blockNumber"`
	GasTipCap field.BigInt    `json:"maxPriorityFeePerGas"`
	GasFeeCap field.BigInt    `json:"maxFeePerGas"`
	GasPrice  field.BigInt    `json:"gasPrice"`
	Nonce     field.BigInt    `json:"nonce"`
	Gas       field.BigInt    `json:"gas"`
	From      common.Address  `json:"from"`
	To        *common.Address `json:"to"` // nil means contract creation
	Value     field.BigInt    `json:"value"`
	Method    hexutil.Bytes   `json:"-"`
	Data      hexutil.Bytes   `json:"input"`
	TimeStamp field.BigInt    `json:"-"`

	// Signature values
	V field.BigInt `json:"v"`
	R field.BigInt `json:"r"`
	S field.BigInt `json:"s"`
}

func (*Tx) Marshal

func (b *Tx) Marshal() ([]byte, error)

func (*Tx) Unmarshal

func (b *Tx) Unmarshal(bin []byte) error

type TxResp

type TxResp struct {
	Hash                 string               `json:"hash"`
	Method               string               `json:"method"`
	BlockHash            string               `json:"blockHash"`
	BlockNumber          string               `json:"blockNumber"`
	From                 string               `json:"from"`
	FromName             string               `json:"fromName"`
	FromSymbol           string               `json:"fromSymbol"`
	FromContract         bool                 `json:"fromContract"`
	To                   string               `json:"to"`
	ToName               string               `json:"toName"`
	ToSymbol             string               `json:"toSymbol"`
	ToContract           bool                 `json:"toContract"`
	Gas                  string               `json:"gas"` // change string
	GasPrice             string               `json:"gasPrice"`
	Value                string               `json:"value"`
	CreatedTime          uint64               `json:"createTime"`
	MaxFeePerGas         *string              `json:"maxFeePerGas"`
	MaxPriorityFeePerGas *string              `json:"maxPriorityFeePerGas"`
	Input                string               `json:"input"`
	Nonce                string               `json:"nonce"` // change string
	V                    string               `json:"v"`
	R                    string               `json:"r"`
	S                    string               `json:"s"`
	TotalLogs            int                  `json:"totalLogs"`
	TokensTransferred    []*EventTransferData `json:"tokensTransferred"`
	BaseFeePerGas        *string              `json:"baseFeePerGas"`
	GasLimit             string               `json:"gasLimit"` // change string
	MethodName           string               `json:"methodName"`
	Logs                 []*RtLogResp         `json:"logs"`
	RtResp                                    // 新增
}

type TxSim

type TxSim struct {
	Hash      common.Hash    `json:"hash"`
	From      common.Address `json:"from"`
	To        common.Address `json:"to"`
	GasPrice  field.BigInt   `json:"gas_price"`
	Gas       field.BigInt   `json:"gas"`
	Timestamp field.BigInt   `json:"timestamp"`
}

type ValidateContractMetadata

type ValidateContractMetadata struct {
	CompilerVersions []*CompilerVersion `json:"compilerVersions"`
	LicenseTypes     []*LicenseType     `json:"licenseTypes"`
	CompilerTypes    []string           `json:"compilerTypes"`
}

func (*ValidateContractMetadata) Marshal

func (b *ValidateContractMetadata) Marshal() ([]byte, error)

func (*ValidateContractMetadata) Unmarshal

func (b *ValidateContractMetadata) Unmarshal(bin []byte) (err error)

type ValidateContractReq

type ValidateContractReq struct {
	ContractAddress  string `json:"contractAddress"`
	ContractName     string `json:"contractName"`
	CompilerType     string `json:"compilerType"` // solidity-single-file / solidity-standard-json-input
	CompilerVersion  string `json:"compilerVersion"`
	CompilerFileName string `json:"compilerFileName"`
	LicenseType      uint64 `json:"licenseType"` // int
	SourceCode       string `json:"sourceCode"`
	Optimization     uint64 `json:"optimization"` // bool
	Runs             uint64 `json:"runs"`         // int
	EVMVersion       string `json:"evmVersion"`   // 默认:default
}

type ValidateContractTmpReq

type ValidateContractTmpReq struct {
	ContractAddress  []string `json:"contractAddress"`
	ContractName     []string `json:"contractName"`
	CompilerType     []string `json:"compilerType"` // solidity-single-file / solidity-standard-json-input
	CompilerVersion  []string `json:"compilerVersion"`
	CompilerFileName []string `json:"compilerFileName"`
	LicenseType      []string `json:"licenseType"` // int
	SourceCode       []string `json:"sourceCode"`
	Optimization     []string `json:"optimization"` // bool
	Runs             []string `json:"runs"`         // int
	EVMVersion       []string `json:"evmVersion"`   // 默认:default
}

func (*ValidateContractTmpReq) ToValidateContractReq

func (r *ValidateContractTmpReq) ToValidateContractReq() *ValidateContractReq

Jump to

Keyboard shortcuts

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