Documentation
¶
Index ¶
- Constants
- type API
- type Ether
- func (e *Ether) Balance(chainCode int64, address string, tag string) (string, error)
- func (e *Ether) BalanceCluster(blockChain int64) *config.NodeCluster
- func (e *Ether) GetBlockByHash(chainCode int64, hash string) (string, error)
- func (e *Ether) GetBlockByNumber(chainCode int64, number string) (string, error)
- func (e *Ether) GetTxByHash(chainCode int64, hash string) (string, error)
- func (e *Ether) LatestBlock(chainCode int64) (string, error)
- func (e *Ether) Nonce(chainCode int64, address string, tag string) (string, error)
- func (e *Ether) SendEthReq(blockChain int64, reqBody string) (string, error)
- func (e *Ether) SendJsonRpc(chainCode int64, req string) (string, error)
- func (e *Ether) SendRawTransaction(chainCode int64, signedTx string) (string, error)
- func (e *Ether) TokenBalance(chainCode int64, address string, contractAddr string, abi string) (string, error)
- type HttpHandler
- func (h *HttpHandler) Error(c *gin.Context, req string, path string, err string)
- func (h *HttpHandler) GetBalance(ctx *gin.Context)
- func (h *HttpHandler) GetBlockByHash(ctx *gin.Context)
- func (h *HttpHandler) GetBlockByNumber(ctx *gin.Context)
- func (h *HttpHandler) GetLatestBlock(ctx *gin.Context)
- func (h *HttpHandler) GetNonce(ctx *gin.Context)
- func (h *HttpHandler) GetTokenBalance(ctx *gin.Context)
- func (h *HttpHandler) GetTxByHash(ctx *gin.Context)
- func (h *HttpHandler) HandlerReq(ctx *gin.Context)
- func (h *HttpHandler) SendRawTx(ctx *gin.Context)
- func (h *HttpHandler) Success(c *gin.Context, req string, resp interface{}, path string)
- type Tron
- func (t *Tron) Balance(chainCode int64, address string, tag string) (string, error)
- func (t *Tron) BalanceCluster(blockChain int64) *config.NodeCluster
- func (t *Tron) GetBlockByHash(chainCode int64, hash string) (string, error)
- func (t *Tron) GetBlockByNumber(chainCode int64, number string) (string, error)
- func (t *Tron) GetTxByHash(chainCode int64, hash string) (string, error)
- func (t *Tron) LatestBlock(chainCode int64) (string, error)
- func (t *Tron) Nonce(chainCode int64, address string, tag string) (string, error)
- func (t *Tron) SendJsonRpc(chainCode int64, req string) (string, error)
- func (t *Tron) SendRawTransaction(chainCode int64, signedTx string) (string, error)
- func (t *Tron) SendReq(blockChain int64, reqBody string, url string) (string, error)
- func (t *Tron) TokenBalance(chainCode int64, address string, contractAddr string, abi string) (string, error)
- type WsHandler
- type WsReqMessage
- type WsRespMessage
Constants ¶
View Source
const ( SUCCESS = 0 FAIL = 1 )
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) (string, error) GetBlockByNumber(chainCode int64, number string) (string, error) GetTxByHash(chainCode int64, hash string) (string, error) SendJsonRpc(chainCode int64, req string) (string, error) }
type Ether ¶
type Ether struct {
// contains filtered or unexported fields
}
func (*Ether) BalanceCluster ¶
func (e *Ether) BalanceCluster(blockChain int64) *config.NodeCluster
func (*Ether) GetBlockByHash ¶
func (*Ether) GetBlockByNumber ¶
func (*Ether) GetTxByHash ¶
func (*Ether) SendEthReq ¶
func (*Ether) SendJsonRpc ¶
func (*Ether) SendRawTransaction ¶
type HttpHandler ¶
type HttpHandler struct {
// contains filtered or unexported fields
}
func NewHttpHandler ¶
func NewHttpHandler(cluster map[int64][]*config.NodeCluster, xlog *xlog.XLog) *HttpHandler
func (*HttpHandler) GetBalance ¶
func (h *HttpHandler) GetBalance(ctx *gin.Context)
func (*HttpHandler) GetBlockByHash ¶
func (h *HttpHandler) GetBlockByHash(ctx *gin.Context)
func (*HttpHandler) GetBlockByNumber ¶
func (h *HttpHandler) GetBlockByNumber(ctx *gin.Context)
func (*HttpHandler) GetLatestBlock ¶
func (h *HttpHandler) GetLatestBlock(ctx *gin.Context)
func (*HttpHandler) GetNonce ¶
func (h *HttpHandler) GetNonce(ctx *gin.Context)
GetNonce todo 仅适用于 ether,tron 暂不支持
func (*HttpHandler) GetTokenBalance ¶
func (h *HttpHandler) GetTokenBalance(ctx *gin.Context)
GetTokenBalance ERC20协议代币余额,后期补充
func (*HttpHandler) GetTxByHash ¶
func (h *HttpHandler) GetTxByHash(ctx *gin.Context)
func (*HttpHandler) HandlerReq ¶
func (h *HttpHandler) HandlerReq(ctx *gin.Context)
HandlerReq 有用户自定义请求内容,然后直接发送到节点 ,和eth_call 函数无关
func (*HttpHandler) SendRawTx ¶
func (h *HttpHandler) SendRawTx(ctx *gin.Context)
type Tron ¶
type Tron struct {
// contains filtered or unexported fields
}
func (*Tron) BalanceCluster ¶
func (t *Tron) BalanceCluster(blockChain int64) *config.NodeCluster
func (*Tron) GetBlockByHash ¶
func (*Tron) GetBlockByNumber ¶
func (*Tron) SendRawTransaction ¶
type WsHandler ¶
type WsHandler struct {
// contains filtered or unexported fields
}
func NewWsHandler ¶
Click to show internal directories.
Click to hide internal directories.