service

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: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TransferBatchEventTopic  = common.HexToHash("0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb")
	TransferSingleEventTopic = common.HexToHash("0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62")
	TransferEventTopic       = common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef")
)
View Source
var ContractVerityChain = make(chan *types.ContractVerityTmp, 100)
View Source
var TokenTopics = []string{
	"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
	"0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62",
	"0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb",
}

Functions

func CheckLog

func CheckLog(log *types.Log) (*types.EventTransferData, error)

func DecodeBig

func DecodeBig(num string) *big.Int

func GetAccountContracts

func GetAccountContracts(addresses map[string]common.Address) (map[string]*types.Contract, error)

func GetAccountErc1155Txs

func GetAccountErc1155Txs(pager *types.Pager, address common.Address) ([]*types.Erc1155TxResp, uint64, error)

func GetAccountErc20Txns

func GetAccountErc20Txns(pager *types.Pager, address common.Address) ([]*types.Erc20TxResp, uint64, error)

func GetAccountErc721Txs

func GetAccountErc721Txs(pager *types.Pager, address common.Address) ([]*types.Erc721TxResp, uint64, error)

func GetAccountInfo

func GetAccountInfo(address common.Address) (*types.AccountResp, error)

func GetAccountItxs

func GetAccountItxs(pager *types.Pager, address common.Address) ([]*types.InternalTxResp, uint64, error)

func GetAccountTotal

func GetAccountTotal(address common.Address) (map[string]uint64, error)

func GetAccountTxs

func GetAccountTxs(pager *types.Pager, address common.Address) (map[string]interface{}, error)

func GetAccounts

func GetAccounts(addresses map[string]common.Address) (map[string]*types.Account, error)

func GetBlock

func GetBlock(blockNum string) (*types.BlockResp, error)

func GetBlockTxs

func GetBlockTxs(blockNum string, pager *types.Pager) ([]*types.ListTransactionResp, uint64, error)

func GetContractABI

func GetContractABI(address common.Address) (string, error)

func GetDateTxs

func GetDateTxs(dateTxs map[string]*field.BigInt) []map[string]string

func GetHomeMetrics

func GetHomeMetrics(home *types.Home, dateTxs []map[string]string, totalTxs, t uint64) map[string]interface{}

func GetMethodNames

func GetMethodNames(methodIDs []string) (methodNames map[string]string, err error)

func GetTokenType

func GetTokenType(address common.Address) (interface{}, error)

func GetTraceTx

func GetTraceTx(hash common.Hash) (*types.TraceTxResp, error)

func GetTraceTx2

func GetTraceTx2(hash common.Hash) (*types.TraceTx2Resp, error)

func GetTx

func GetTx(tx string) (*types.TxResp, error)

func GetTxBase

func GetTxBase(tx string) (*types.TransactionBaseResp, error)

func GetValidateContract

func GetValidateContract(address common.Address) (*types.ContractVerityInfoResp, error)

func GetValidateContractStatus

func GetValidateContractStatus(address string) (status *types.ContractStatus, err error)

func Home

func Home() (map[string]interface{}, error)

func IsNumber

func IsNumber(number string) bool

func ListErc1155Holders

func ListErc1155Holders(pager *types.Pager, address common.Address) ([]*types.HolderResp, uint64, error)

func ListErc1155Inventory

func ListErc1155Inventory(pager *types.Pager, address common.Address) ([]*types.InventoryResp, uint64, error)

func ListErc1155Transfers

func ListErc1155Transfers(pager *types.Pager, address common.Address) ([]*types.Erc1155TxResp, uint64, error)

func ListErc1155Txs

func ListErc1155Txs(pager *types.Pager) ([]*types.Erc1155TxResp, uint64, error)

func ListErc20Holders

func ListErc20Holders(pager *types.Pager, address common.Address) ([]*types.HolderResp, uint64, error)

func ListErc20Transfers

func ListErc20Transfers(pager *types.Pager, address common.Address) ([]*types.Erc20TxResp, uint64, error)

func ListErc20Txs

func ListErc20Txs(pager *types.Pager) ([]*types.Erc20TxResp, uint64, error)

func ListErc721Holders

func ListErc721Holders(pager *types.Pager, address common.Address) ([]*types.HolderResp, uint64, error)

func ListErc721Inventory

func ListErc721Inventory(pager *types.Pager, address common.Address) ([]*types.InventoryResp, uint64, error)

func ListErc721Transfers

func ListErc721Transfers(pager *types.Pager, address common.Address) ([]*types.Erc721TxResp, uint64, error)

func ListErc721Txs

func ListErc721Txs(pager *types.Pager) ([]*types.Erc721TxResp, uint64, error)

func ListFullFieldBlocks

func ListFullFieldBlocks(pager *types.Pager) ([]*types.ListBlockResp, uint64, error)

func ListInventory

func ListInventory(typ string, pager *types.Pager, address common.Address) (map[string]interface{}, error)

func ListTokenHolders

func ListTokenHolders(typ string, pager *types.Pager, address common.Address) (map[string]interface{}, error)

func ListTokenTransfers

func ListTokenTransfers(address common.Address, typ string, pager *types.Pager) (map[string]interface{}, error)

func ListTxs

func ListTxs(pager *types.Pager) ([]*types.ListTransactionResp, uint64, error)

func NewStore

func NewStore(st *storage.StorageImpl)

func ParsePage

func ParsePage(num *field.BigInt, offset, limit int64) (*field.BigInt, *field.BigInt)

func ReadMetaData

func ReadMetaData() (*types.ValidateContractMetadata, error)

func ReadValidateContractMetadata

func ReadValidateContractMetadata() (*types.ValidateContractMetadata, error)
func Search(f *types.SearchFilter) (map[string]interface{}, error)

func StartContractVerity

func StartContractVerity(body *types.ContractVerityTmp)

func StartHandleContractVerity

func StartHandleContractVerity()

func ValidateContract

func ValidateContract(req *types.ValidateContractReq) (map[string]string, error)

func WriteMetadata

func WriteMetadata() error

func WriteValidateContractMetadata

func WriteValidateContractMetadata(metadata *types.ValidateContractMetadata) error

Types

type Storage

type Storage interface {
	GetBlock(blockNum *field.BigInt) (*types.Block, error)
	ListBlockTxs(total, blockNum *field.BigInt, offset, limit int64) ([]*types.Tx, error)
	ListBlocks(total *field.BigInt, offset, limit int64) ([]*types.Block, error)
	GetBlockTotal() (bk *field.BigInt, err error)

	GetAccount(address common.Address) (acc *types.Account, err error)
	GetContract(address common.Address) (*types.Contract, error)
	GetAccountTxTotal(address common.Address) (total *field.BigInt, err error)
	GetAccountErc20Total(address common.Address) (total *field.BigInt, err error)
	GetAccountErc721Total(address common.Address) (total *field.BigInt, err error)
	GetAccountErc1155Total(address common.Address) (total *field.BigInt, err error)
	GetAccountITxTotal(address common.Address) (total *field.BigInt, err error)

	ListAccountTxs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.Tx, error)
	ListAccountITxs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.InternalTx, error)
	ListAccountErc20Txs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.Erc20Transfer, error)
	ListAccountErc721Txs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.Erc721Transfer, error)
	ListAccountErc1155Txs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.Erc1155Transfer, error)

	GetHome() (home *types.Home, err error)

	GetTx(txhash common.Hash) (data *types.Tx, err error)
	GetRt(txhash common.Hash) (data *types.Rt, err error)
	GetTxTotal() (total *field.BigInt, err error)
	ListTxs(total *field.BigInt, offset, limit int64) ([]*types.Tx, error)

	GetErc20Total() (total *field.BigInt, err error)
	GetErc721Total() (total *field.BigInt, err error)
	GetErc1155Total() (total *field.BigInt, err error)
	ListErc20Transfers(total *field.BigInt, offset, limit int64) ([]*types.Erc20Transfer, error)
	ListErc721Transfers(total *field.BigInt, offset, limit int64) ([]*types.Erc721Transfer, error)
	ListErc1155Transfers(total *field.BigInt, offset, limit int64) ([]*types.Erc1155Transfer, error)

	ListErc20Holders(address common.Address, offset, limit int64) (holders []*types.Holder, err error)
	GetErc20HolderCount(address common.Address) (count uint64, err error)
	ListErc721Holders(address common.Address, offset, limit int64) (holders []*types.Holder, err error)
	GetErc721HolderCount(address common.Address) (count uint64, err error)
	ListErc1155Holders(address common.Address, offset, limit int64) (holders []*types.Holder, err error)
	GetErc1155HolderCount(address common.Address) (count uint64, err error)

	GetMethodName(methodID string) (string, error)

	ListErc721Inventories(address common.Address, offset, limit int64) ([]*types.Inventory, error)
	GetErc721InventoryCount(address common.Address) (count uint64, err error)
	ListErc1155Inventories(address common.Address, offset, limit int64) ([]*field.BigInt, error)
	GetErc1155InventoryCount(address common.Address) (count uint64, err error)

	WriteValidateContractMetadata(metadata *types.ValidateContractMetadata) error
	GetValidateContractMetadata() (data *types.ValidateContractMetadata, err error)
	GetValidateContract(address common.Address) (data *types.ContractVerity, err error)
	WriteValidateContractStatus(address common.Address, status *types.ContractStatus) error
	GetValidateContractStatus(address common.Address) (status *types.ContractStatus, err error)
	WriteMethodName(id, name string) error
	WriteValidateContract(address common.Address, data *types.ContractVerity) error
	GetProxyContract(address common.Address) (logic common.Address, err error)

	GetErc20ContractTransfer(contract common.Address, offset, limit int64) (data []*types.Erc20Transfer, total *field.BigInt, err error)
	GetErc721ContractTransfer(contract common.Address, offset, limit int64) (data []*types.Erc721Transfer, total *field.BigInt, err error)
	GetErc1155ContractTransfer(contract common.Address, offset, limit int64) (data []*types.Erc1155Transfer, total *field.BigInt, err error)

	ReadTraceTx2(address common.Hash) (res *types.TraceTx2, err error)

	ReadErc20ContractTotal(contract common.Address) (total *field.BigInt, err error)
	ReadErc721ContractTotal(contract common.Address) (total *field.BigInt, err error)
	ReadErc1155ContractTotal(contract common.Address) (total *field.BigInt, err error)
}

type Store

type Store struct {
	St *storage.StorageImpl
	// contains filtered or unexported fields
}

func (*Store) GetAccount

func (s *Store) GetAccount(address common.Address) (*types.Account, error)

func (*Store) GetAccountErc1155Total

func (s *Store) GetAccountErc1155Total(address common.Address) (total *field.BigInt, err error)

func (*Store) GetAccountErc20Total

func (s *Store) GetAccountErc20Total(address common.Address) (total *field.BigInt, err error)

func (*Store) GetAccountErc721Total

func (s *Store) GetAccountErc721Total(address common.Address) (total *field.BigInt, err error)

func (*Store) GetAccountITxTotal

func (s *Store) GetAccountITxTotal(address common.Address) (total *field.BigInt, err error)

func (*Store) GetAccountTxTotal

func (s *Store) GetAccountTxTotal(address common.Address) (total *field.BigInt, err error)

func (*Store) GetBlock

func (s *Store) GetBlock(blockNum *field.BigInt) (*types.Block, error)

func (*Store) GetBlockTotal

func (s *Store) GetBlockTotal() (bk *field.BigInt, err error)

func (*Store) GetContract

func (s *Store) GetContract(address common.Address) (*types.Contract, error)

func (*Store) GetErc1155ContractTransfer

func (s *Store) GetErc1155ContractTransfer(contract common.Address, offset, limit int64) (data []*types.Erc1155Transfer, total *field.BigInt, err error)

func (*Store) GetErc1155HolderCount

func (s *Store) GetErc1155HolderCount(address common.Address) (count uint64, err error)

func (*Store) GetErc1155InventoryCount

func (s *Store) GetErc1155InventoryCount(address common.Address) (count uint64, err error)

func (*Store) GetErc1155Total

func (s *Store) GetErc1155Total() (total *field.BigInt, err error)

func (*Store) GetErc20ContractTransfer

func (s *Store) GetErc20ContractTransfer(contract common.Address, offset, limit int64) (data []*types.Erc20Transfer, total *field.BigInt, err error)

func (*Store) GetErc20HolderCount

func (s *Store) GetErc20HolderCount(address common.Address) (count uint64, err error)

func (*Store) GetErc20Total

func (s *Store) GetErc20Total() (total *field.BigInt, err error)

func (*Store) GetErc721ContractTransfer

func (s *Store) GetErc721ContractTransfer(contract common.Address, offset, limit int64) (data []*types.Erc721Transfer, total *field.BigInt, err error)

func (*Store) GetErc721HolderCount

func (s *Store) GetErc721HolderCount(address common.Address) (count uint64, err error)

func (*Store) GetErc721InventoryCount

func (s *Store) GetErc721InventoryCount(address common.Address) (count uint64, err error)

func (*Store) GetErc721Total

func (s *Store) GetErc721Total() (total *field.BigInt, err error)

func (*Store) GetHome

func (s *Store) GetHome() (home *types.Home, err error)

func (*Store) GetMethodName

func (s *Store) GetMethodName(methodID string) (string, error)

func (*Store) GetProxyContract

func (s *Store) GetProxyContract(address common.Address) (logic common.Address, err error)

func (*Store) GetRt

func (s *Store) GetRt(txhash common.Hash) (data *types.Rt, err error)

func (*Store) GetTx

func (s *Store) GetTx(txhash common.Hash) (data *types.Tx, err error)

func (*Store) GetTxTotal

func (s *Store) GetTxTotal() (total *field.BigInt, err error)

func (*Store) GetValidateContract

func (s *Store) GetValidateContract(address common.Address) (data *types.ContractVerity, err error)

func (*Store) GetValidateContractMetadata

func (s *Store) GetValidateContractMetadata() (data *types.ValidateContractMetadata, err error)

func (*Store) GetValidateContractStatus

func (s *Store) GetValidateContractStatus(address common.Address) (status *types.ContractStatus, err error)

func (*Store) ListAccountErc1155Txs

func (s *Store) ListAccountErc1155Txs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.Erc1155Transfer, error)

func (*Store) ListAccountErc20Txs

func (s *Store) ListAccountErc20Txs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.Erc20Transfer, error)

func (*Store) ListAccountErc721Txs

func (s *Store) ListAccountErc721Txs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.Erc721Transfer, error)

func (*Store) ListAccountITxs

func (s *Store) ListAccountITxs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.InternalTx, error)

func (*Store) ListAccountTxs

func (s *Store) ListAccountTxs(address common.Address, total *field.BigInt, offset, limit int64) ([]*types.Tx, error)

func (*Store) ListBlockTxs

func (s *Store) ListBlockTxs(total, blockNum *field.BigInt, offset, limit int64) ([]*types.Tx, error)

func (*Store) ListBlocks

func (s *Store) ListBlocks(total *field.BigInt, offset, limit int64) ([]*types.Block, error)

func (*Store) ListErc1155Holders

func (s *Store) ListErc1155Holders(address common.Address, offset, limit int64) (holders []*types.Holder, err error)

func (*Store) ListErc1155Inventories

func (s *Store) ListErc1155Inventories(address common.Address, offset, limit int64) ([]*field.BigInt, error)

func (*Store) ListErc1155Transfers

func (s *Store) ListErc1155Transfers(total *field.BigInt, offset, limit int64) ([]*types.Erc1155Transfer, error)

func (*Store) ListErc20Holders

func (s *Store) ListErc20Holders(address common.Address, offset, limit int64) (holders []*types.Holder, err error)

func (*Store) ListErc20Transfers

func (s *Store) ListErc20Transfers(total *field.BigInt, offset, limit int64) ([]*types.Erc20Transfer, error)

func (*Store) ListErc721Holders

func (s *Store) ListErc721Holders(address common.Address, offset, limit int64) (holders []*types.Holder, err error)

func (*Store) ListErc721Inventories

func (s *Store) ListErc721Inventories(address common.Address, offset, limit int64) ([]*types.Inventory, error)

func (*Store) ListErc721Transfers

func (s *Store) ListErc721Transfers(total *field.BigInt, offset, limit int64) ([]*types.Erc721Transfer, error)

func (*Store) ListTxs

func (s *Store) ListTxs(total *field.BigInt, offset, limit int64) ([]*types.Tx, error)

func (*Store) ReadErc1155ContractTotal

func (s *Store) ReadErc1155ContractTotal(contract common.Address) (total *field.BigInt, err error)

func (*Store) ReadErc20ContractTotal

func (s *Store) ReadErc20ContractTotal(contract common.Address) (total *field.BigInt, err error)

func (*Store) ReadErc721ContractTotal

func (s *Store) ReadErc721ContractTotal(contract common.Address) (total *field.BigInt, err error)

func (*Store) ReadTraceTx2

func (s *Store) ReadTraceTx2(address common.Hash) (res *types.TraceTx2, err error)

func (*Store) WriteMethodName

func (s *Store) WriteMethodName(id, name string) error

func (*Store) WriteValidateContract

func (s *Store) WriteValidateContract(address common.Address, data *types.ContractVerity) error

func (*Store) WriteValidateContractMetadata

func (s *Store) WriteValidateContractMetadata(metadata *types.ValidateContractMetadata) error

func (*Store) WriteValidateContractStatus

func (s *Store) WriteValidateContractStatus(address common.Address, status *types.ContractStatus) error

Jump to

Keyboard shortcuts

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