Documentation ¶
Index ¶
- Constants
- func NewAccountKey(id string) *db.IKey
- func NewTokenKey(id string) *db.IKey
- func NewTransferKey(id string) *db.IKey
- func TokenID(contractAddr, ownerAddr string, goodsID int64) string
- type Account
- type AccountBalance
- type AddNewGoodsResult
- type BatchAddNewGoodsResult
- type EvmState
- type GoodsUsedResult
- type MintGoodsResult
- type RecordAccount
- type RecordToken
- type RecordTransfer
- type Token
- type TokenDB
- type TokenRemark
- type Transfer
Constants ¶
View Source
const ( TokenX = "nft" TransferX = "nft_transfer" AccountX = "nft_account" )
token db
View Source
const AccountMapping = `` /* 400-byte string literal not displayed */
View Source
const TokenMapping = `` /* 1370-byte string literal not displayed */
TokenMapping mapping nolint
View Source
const TransferMapping = `` /* 401-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func NewAccountKey ¶
func NewTransferKey ¶
Types ¶
type Account ¶
type AccountBalance ¶
type AccountBalance struct { Account pcom.Hash160Address `json:"account"` GoodsID int64 `json:"goodsID"` Balance int64 `json:"balance"` }
AccountBalance 账户余额event结构 由于使用时是数组形式,所以地址类型没有被解析成字符串
func (AccountBalance) GetAccount ¶
func (ab AccountBalance) GetAccount(info map[string]interface{}) *Account
type AddNewGoodsResult ¶
type AddNewGoodsResult struct { Owner string `json:"owner"` GoodsID int64 `json:"goodsID"` Amount int64 `json:"amount"` GoodsType int32 `json:"goodsType"` PublishTime int64 `json:"publishTime"` Hash []string `json:"hash"` Source []string `json:"source"` Publisher string `json:"publisher"` Name string `json:"name"` LabelID string `json:"labelID"` Remark string `json:"remark"` Operator string `json:"operator"` PublisherAddress string `json:"publisherAddress"` BatchNumber string `json:"batchNumber"` Image string `json:"image"` TraceHash string `json:"traceHash"` IsUsed bool `json:"isUsed"` }
AddNewGoodsResult 发行event结构
func NewAddNewGoodsResult ¶
func NewAddNewGoodsResult(m map[string]interface{}) (*AddNewGoodsResult, error)
func (AddNewGoodsResult) GetToken ¶
func (r AddNewGoodsResult) GetToken(info map[string]interface{}) *Token
type BatchAddNewGoodsResult ¶
type BatchAddNewGoodsResult struct { Owner string `json:"owner"` GoodsID []int64 `json:"goodsIDs"` Amount []int64 `json:"amounts"` GoodsType int32 `json:"goodsType"` PublishTime int64 `json:"publishTime"` Hash []string `json:"hash"` Source []string `json:"source"` Publisher string `json:"publisher"` Name []string `json:"names"` LabelID []string `json:"labelIDs"` Remark []string `json:"remarks"` Results []*AddNewGoodsResult }
func NewBatchAddNewGoodsResult ¶
func NewBatchAddNewGoodsResult(m map[string]interface{}) (*BatchAddNewGoodsResult, error)
type EvmState ¶
type EvmState struct { ContractAddr string `json:"contract_addr,omitempty"` TxHash string `json:"evm_tx_hash,omitempty"` HeightIndex int64 `json:"evm_height_index,omitempty"` Height int64 `json:"evm_height,omitempty"` BlockHash string `json:"evm_block_hash,omitempty"` BlockTime int64 `json:"evm_block_time,omitempty"` }
func (*EvmState) GetEvmState ¶
type GoodsUsedResult ¶
type GoodsUsedResult struct { From string `json:"from"` To string `json:"to"` GoodsID int64 `json:"id"` Code string `json:"code"` IsUsed bool `json:"isUsed"` }
GoodsUsedResult 货物领取event结构
func NewGoodsUsedResult ¶
func NewGoodsUsedResult(m map[string]interface{}) (*GoodsUsedResult, error)
type MintGoodsResult ¶
type MintGoodsResult struct { AddNewGoodsResult Owner *pcom.Hash160Address `json:"owner"` Operator *pcom.Hash160Address `json:"operator"` PublisherAddress *pcom.Hash160Address `json:"publisherAddress"` }
MintGoodsResult 批量发行event结构,由于使用时是数组形式,所以地址类型没有被解析成字符串
func NewMintGoodsResults ¶
func NewMintGoodsResults(m interface{}) ([]MintGoodsResult, error)
func (MintGoodsResult) GetToken ¶
func (r MintGoodsResult) GetToken(info map[string]interface{}) *Token
type RecordAccount ¶
RecordAccount db account
func NewRecordAccount ¶
func NewRecordAccount(acc *Account, op int) *RecordAccount
type RecordToken ¶
RecordToken db token
func NewRecordToken ¶
func NewRecordToken(token *Token, op int) *RecordToken
type RecordTransfer ¶
RecordTransfer db token
func NewRecordTransfer ¶
func NewRecordTransfer(transfer *Transfer, op int) *RecordTransfer
type Token ¶
type Token struct { Owner string `json:"owner,omitempty"` GoodsID int64 `json:"goods_id"` Amount int64 `json:"amount"` GoodsType int32 `json:"goods_type"` PublishTime int64 `json:"publish_time"` Hash []string `json:"trace_hash"` Source []string `json:"source_hash,omitempty"` Publisher string `json:"publisher"` PublisherAddress string `json:"publisher_address"` Name string `json:"name"` LabelID string `json:"label_id"` Remark string `json:"remark,omitempty"` FileURL string `json:"file_url"` FileType string `json:"file_type"` Operator string `json:"operator"` // 操作者 BatchNumber string `json:"batch_number,omitempty"` // 批次号 Image string `json:"image,omitempty"` IsUsed bool `json:"is_used"` // 使用标志 UseTime int64 `json:"use_time,omitempty"` // 使用时间 UserAddr string `json:"user_addr,omitempty"` // 使用人地址 UserName string `json:"user_name,omitempty"` // 使用人名称 UserRealName string `json:"user_real_name,omitempty"` // 使用人真实名称 UseCode string `json:"use_code,omitempty"` // 使用的验证码 TokenType string `json:"token_type"` EvmState }
type TokenDB ¶
type TokenRemark ¶
TokenRemark 合约备注信息
type Transfer ¶
type Transfer struct { From string `json:"from"` FromName string `json:"from_name"` FromRealName string `json:"from_real_name"` FromUserName string `json:"from_user_name"` To string `json:"to"` ToName string `json:"to_name"` ToRealName string `json:"to_real_name"` ToUserName string `json:"to_user_name"` IDs []string `json:"ids"` Amounts []int64 `json:"amounts"` Data []byte `json:"data"` EvmState }
func NewTransfer ¶
func NewTransfer(event, info map[string]interface{}, confDb proofconfig.ConfigDB) (*Transfer, error)
Click to show internal directories.
Click to hide internal directories.