Documentation ¶
Index ¶
- Constants
- Variables
- func NewConvert(paraTitle, symbol string, _ []string) db.ExecConvert
- func NewEVMKey(id string) *db.IKey
- func RegisterEventHandle(name string, convert EventHandle)
- func RegisterFuncConvert(name string, convert FuncConvert)
- func RegisterInitDB(initDB InitDB)
- func TokenID(contractAddr, ownerAddr, goodsID string) string
- func TransferID(txHash, TokenID string) string
- func UnpackEvent(data []byte, topics []pcom.Hash, abi *pabi.ABI) (name string, ans map[string]interface{}, err error)
- func UnpackEventData(data []byte, topic pcom.Hash, abi *pabi.ABI) (event *pabi.Event, args []interface{}, err error)
- func UnpackParam(data []byte, abi *pabi.ABI) (args map[string]interface{}, err error)
- func UnpackParamData(data []byte, abi *pabi.ABI) (method *pabi.Method, args []interface{}, err error)
- func UpperFirstLetter(name string) string
- type Convert
- type EVM
- type EventHandle
- type FuncConvert
- type InitDB
- type RecordEVM
- type RecordToken
- type RecordTransfer
- type Token
- type TokenDB
- type Transfer
- type TxOption
Constants ¶
View Source
const ( EVMX = "evm" EVMTokenX = "evm_token" EVMTransferX = "evm_transfer" )
db
View Source
const EVMMapping = `` /* 548-byte string literal not displayed */
EVMMapping evm执行记录表
View Source
const EVMTransferMapping = `` /* 875-byte string literal not displayed */
View Source
const EmptyAddr = "1111111111111111111114oLvT2"
View Source
const EmptyAddrEth = "0x0000000000000000000000000000000000000000"
View Source
const TokenMapping = `` /* 864-byte string literal not displayed */
TokenMapping mapping nolint
Variables ¶
View Source
var ErrNoEvent = errors.New("no event")
View Source
var ErrNoEvents = errors.New("no events")
Functions ¶
func NewConvert ¶
func NewConvert(paraTitle, symbol string, _ []string) db.ExecConvert
NewConvert new convert
func RegisterEventHandle ¶
func RegisterEventHandle(name string, convert EventHandle)
func RegisterFuncConvert ¶
func RegisterFuncConvert(name string, convert FuncConvert)
func RegisterInitDB ¶
func RegisterInitDB(initDB InitDB)
func TransferID ¶
func UnpackEvent ¶
func UnpackEventData ¶
func UnpackEventData(data []byte, topic pcom.Hash, abi *pabi.ABI) (event *pabi.Event, args []interface{}, err error)
UnpackEventData use abi and topic unpack event data
func UnpackParam ¶
func UnpackParamData ¶
func UnpackParamData(data []byte, abi *pabi.ABI) (method *pabi.Method, args []interface{}, err error)
UnpackParamData 通过abi解析调用方法和输入参数
func UpperFirstLetter ¶
Types ¶
type Convert ¶
type Convert struct { ConfigDB proofconfig.ConfigDB ContractDB contract.DB ContractVrfDB contractverify.DB NftTokenDb ndb.TokenDB EvmTokenDb TokenDB // contains filtered or unexported fields }
Convert tx convert
type EVM ¶
type EVM map[string]interface{}
EVM evm执行记录
type EventHandle ¶
func GetEventHandle ¶
func GetEventHandle(name string) (EventHandle, bool)
type FuncConvert ¶
func GetFuncConvert ¶
func GetFuncConvert(name string) (FuncConvert, bool)
type RecordToken ¶
func NewRecordToken ¶
func NewRecordToken(token *Token, op int) *RecordToken
type RecordTransfer ¶
func NewRecordTransfer ¶
func NewRecordTransfer(token *Transfer, op int) *RecordTransfer
func (*RecordTransfer) Source ¶
func (r *RecordTransfer) Source() interface{}
type Token ¶
type Token struct { TokenID string `json:"token_id"` Owner string `json:"owner"` TokenType string `json:"token_type"` Amount int64 `json:"amount"` ContractAddr string `json:"contract_addr"` PublishAddress string `json:"publish_address"` PublishTxHash string `json:"publish_tx_hash"` PublishHeight int64 `json:"publish_height"` PublishHeightIndex int64 `json:"publish_height_index"` PublishBlockHash string `json:"publish_block_hash"` PublishBlockTime int64 `json:"publish_block_time"` }
func (*Token) LoadBlockData ¶
type TokenDB ¶
type TokenDB interface { GetToken(contractAddr, ownerAddr string, goodsID string) (*Token, error) GetTokens(contractAddr string, goodsID string) ([]*Token, error) GetNft(contractAddr string, goodsID string) (*Token, error) UpdateCache(token *Token) GetTokenList(contractAddr, ownerAddr string, ids []string) ([]*Token, error) GetTokenMap(contractAddr, ownerAddr string, ids []string) (map[string]*Token, error) }
type Transfer ¶
type Transfer struct { TokenID string `json:"token_id"` From string `json:"from"` To string `json:"to"` Operator string `json:"operator"` Amount int64 `json:"amount"` TokenType string `json:"token_type"` ContractAddr string `json:"contract_addr"` TxHash string `json:"tx_hash"` Height int64 `json:"height"` HeightIndex int64 `json:"height_index"` BlockHash string `json:"block_hash"` BlockTime int64 `json:"block_time"` }
func (*Transfer) LoadBlockData ¶
type TxOption ¶
type TxOption struct { ContractAddr string `json:"contract_addr,omitempty"` ContractType string `json:"contract_type,omitempty"` CallFunName string `json:"call_fun_name,omitempty"` TokenID []string `json:"token_id,omitempty"` Transfers []*Transfer `json:"transfers,omitempty"` Events map[string]interface{} `json:"events,omitempty"` Params map[string]interface{} `json:"params,omitempty"` }
TxOption Evm TxOption
Click to show internal directories.
Click to hide internal directories.