api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

@Title @Description @Author Niels 2020/9/15

@Title @Description @Author Niels 2020/9/29

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountStatus

type AccountStatus struct {
	//账户地址
	Address string

	//可用余额
	Balance *big.Int
	//当前nonce值
	Nonce []byte
	//该nonce值的类型,1:已确认的nonce值,0:未确认的nonce值
	NonceType int
	//总的余额:可用+锁定
	TotalBalance *big.Int
	// contains filtered or unexported fields
}

type ApiSDK

type ApiSDK interface {
	Broadcast(txHex string) (string, error)
	ValidateTx(txHex string) (string, error)
	GetBalance(address string, chainId uint16, assetsId uint16) (*AccountStatus, error)
	GetTxJson(txHash string) (string, error)
	GetNodeStatus() (*NodeStatus, error)
}

func GetApiSDK

func GetApiSDK(apiURL string, chainId uint16, prefix string) ApiSDK

type NerveApiSDK

type NerveApiSDK struct {
	// contains filtered or unexported fields
}

func (*NerveApiSDK) ApiRequest

func (sdk *NerveApiSDK) ApiRequest(param *rpc.RequestParam) (*rpc.RequestResult, error)

接口请求 请求的地址是client中的默认地址 本工具针对NULS的api模块的jsonrpc接口进行设计,适用范围有限

func (*NerveApiSDK) Broadcast

func (sdk *NerveApiSDK) Broadcast(txHex string) (string, error)

广播交易

func (*NerveApiSDK) GetBalance

func (sdk *NerveApiSDK) GetBalance(address string, chainId uint16, assetsId uint16) (*AccountStatus, error)

func (*NerveApiSDK) GetNodeStatus

func (sdk *NerveApiSDK) GetNodeStatus() (*NodeStatus, error)

接口请求 请求的地址是client中的默认地址 本工具针对NULS的api模块的jsonrpc接口进行设计,适用范围有限

func (*NerveApiSDK) GetTxJson

func (sdk *NerveApiSDK) GetTxJson(txHash string) (string, error)

func (*NerveApiSDK) ValidateTx

func (sdk *NerveApiSDK) ValidateTx(txhex string) (string, error)

type NervePSSDK

type NervePSSDK struct {
	// contains filtered or unexported fields
}

func (*NervePSSDK) GetNode

func (sdk *NervePSSDK) GetNode(psApiURL string, nodeHash string) (*NodeInfo, error)

type NodeInfo

type NodeInfo struct {
	NodeHash       string
	Amount         *big.Int
	NodeAddress    string
	RewardAddress  string
	PackingAddress string
	CreditVal      float64
	NodeId         string
	NodeAlias      string
	IsBank         bool
}

type NodeStatus

type NodeStatus struct {
	LocalBestHeight uint64

	NetBestHeight uint64

	InCount int

	OutCount int
}

type PSSDK

type PSSDK interface {
	GetNode(psApiURL string, nodeHash string) (*NodeInfo, error)
}

func GetPSSDK

func GetPSSDK(chainId uint16, prefix string) PSSDK

Jump to

Keyboard shortcuts

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