blockchain

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Balance(chainCode int64, address string, tag string) (string, error)
	TokenBalance(chainCode int64, address string, contractAddr string, abi string) (string, error)
	Nonce(chainCode int64, address string, tag string) (string, error)
	LatestBlock(chainCode int64) (string, error)
	SendRawTransaction(chainCode int64, signedTx string) (string, error)

	GetBlockByHash(chainCode int64, hash string, flag bool) (string, error)
	GetBlockByNumber(chainCode int64, number string, flag bool) (string, error)
	GetTxByHash(chainCode int64, hash string) (string, error)
	SendJsonRpc(chainCode int64, req string) (string, error)

	GetBlockReceiptByBlockNumber(chainCode int64, number string) (string, error)
	GetBlockReceiptByBlockHash(chainCode int64, hash string) (string, error)
	GetTransactionReceiptByHash(chainCode int64, hash string) (string, error)

	SubscribePendingTx(chainCode int64, receiverCh chan string, sendCh chan string) (string, error)
	SubscribeLogs(chainCode int64, address string, topics []string, receiverCh chan string, sendCh chan string) (string, error)
	UnSubscribe(chainCode int64, subId string) (string, error)

	// GetAddressType 0x1:外部账户,0x2:合约地址
	GetAddressType(chainCode int64, address string) (string, error)
	GetCode(chainCode int64, address string) (string, error)

	StartWDT()
	MonitorCluster() any
}

type BlockChain

type BlockChain interface {
	SendRequestToChain(host string, token string, query string) (string, error)
	SendRequestToChainByHttp(host string, token string, query string) (string, error)
	EthSubscribe(host string, token string) (string, error)
	EthUnSubscribe(host string, token string) (string, error)
	GetTokenBalance(host string, token string, contractAddress string, userAddress string) (map[string]interface{}, error)
	GetTokenBalanceByHttp(host string, token string, contractAddress string, userAddress string) (map[string]interface{}, error)
}

type ChainCluster

type ChainCluster interface {
	BalanceCluster() *config.NodeCluster
}

type ChainNet

type ChainNet interface {
	SendReq(blockChain int64, reqBody string) (string, error)
	SendReqByWs(blockChain int64, receiverCh chan string, sendCh chan string) (string, error)
}

type WsReqMessage

type WsReqMessage struct {
	Id     int64
	Code   int64
	Params map[string]string
}

type WsRespMessage

type WsRespMessage struct {
	Id     int64
	Code   int64
	Status int //0:成功 1:失败
	Err    string
	Params map[string]string
	Resp   interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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