rpc

package
v0.0.0-...-96e9b90 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractApi

type ContractApi interface {
	GetTokenInfoById(ctx context.Context, tokenId string) (*api.RpcTokenInfo, error)
}

func NewContractApi

func NewContractApi(cc *rpc.Client) ContractApi

type LedgerApi

type LedgerApi interface {
	GetSnapshotGenesisBlock() (*api.SnapshotBlock, error)

	GetSnapshotBlockByHash(ctx context.Context, hash types.Hash) (*api.SnapshotBlock, error)
	GetSnapshotBlockByHeight(ctx context.Context, height uint64) (*api.SnapshotBlock, error)
	GetLatestSnapshotHash(ctx context.Context) (*types.Hash, error)

	GetAccountBlockByHash(ctx context.Context, blockHash types.Hash) (*api.AccountBlock, error)
	GetAccountBlocks(ctx context.Context, address types.Address, hash *types.Hash, count uint64) ([]*api.AccountBlock, error)
	GetAccountInfoByAddress(ctx context.Context, address types.Address) (*api.AccountInfo, error)
	GetConfirmedBalances(ctx context.Context, snapshotHash types.Hash, addrList []types.Address, tokenIds []types.TokenTypeId) (result *api.GetBalancesRes, err error)
	GetLatestAccountBlock(ctx context.Context, address types.Address) (*api.AccountBlock, error)
	GetUnreceivedBlocksByAddress(ctx context.Context, address types.Address, page uint64, pageSize uint64) ([]*api.AccountBlock, error)

	GetPoWDifficulty(ctx context.Context, param *api.GetPoWDifficultyParam) (*api.GetPoWDifficultyResult, error)

	SendRawTransaction(ctx context.Context, accountBlock *api.AccountBlock) error
}

LedgerApi ...

func NewLedgerApi

func NewLedgerApi(cc *rpc.Client) LedgerApi

type NetApi

type NetApi interface {
	GetNodeInfo(ctx context.Context) (*net.NodeInfo, error)
	GetSyncInfo(ctx context.Context) (*api.SyncInfo, error)
}

func NewNetApi

func NewNetApi(cc *rpc.Client) NetApi

type RpcClient

type RpcClient interface {
	LedgerApi
	ContractApi
	NetApi
	UtilApi

	GetClient() *rpc.Client
}

func NewRpcClient

func NewRpcClient(rawurl string) (RpcClient, error)

type UtilApi

type UtilApi interface {
	GetPoWNonce(ctx context.Context, difficulty string, hash string) (string, error)
}

func NewUtilApi

func NewUtilApi(cc *rpc.Client) UtilApi

Jump to

Keyboard shortcuts

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