client

package
v2.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccBlockHeader

type AccBlockHeader struct {
	Hash           types.Hash    `json:"hash"`
	PrevHash       types.Hash    `json:"prevHash"`
	AccountAddress types.Address `json:"accountAddress"`
	Height         string        `json:"height"`
	Timestamp      int64         `json:"timestamp"`

	Amount string `json:"amount"`
	TInfo  `json:"tokenInfo"`
}

type AccountBlock

type AccountBlock struct {
}

type BalanceAllQuery

type BalanceAllQuery struct {
	Addr types.Address
}

type BalanceQuery

type BalanceQuery struct {
	Addr    types.Address
	TokenId types.TokenTypeId
}

type Block

type Block struct {
	Hash     types.Hash `json:"hash"`
	PrevHash types.Hash `json:"prevHash"`
	Height   uint64     `json:"height"`
}

type BlockHeader

type BlockHeader struct {
	Hash     types.Hash `json:"hash"`
	PrevHash types.Hash `json:"prevHash"`

	Height string `json:"height"`

	Timestamp int64 `json:"timestamp"`
}

type Client

type Client interface {
	// contains filtered or unexported methods
}

func NewClient

func NewClient(rpc RpcClient) (Client, error)

type DifficultyQuery

type DifficultyQuery struct {
	SelfAddr     types.Address `json:"selfAddr"`
	PrevHash     types.Hash    `json:"prevHash"`
	SnapshotHash types.Hash    `json:"snapshotHash"`

	BlockType byte           `json:"blockType"`
	ToAddr    *types.Address `json:"toAddr"`
	Data      []byte         `json:"data"`

	UsePledgeQuota bool `json:"usePledgeQuota"`
}

type OnroadQuery

type OnroadQuery struct {
	Address types.Address
	Index   int
	Cnt     int
}

type RequestTxParams

type RequestTxParams struct {
	ToAddr   types.Address
	SelfAddr types.Address
	Amount   *big.Int
	TokenId  types.TokenTypeId
	Data     []byte
}

type ResponseTxParams

type ResponseTxParams struct {
	SelfAddr     types.Address
	RequestHash  types.Hash
	SnapshotHash *types.Hash
}

type RpcClient

type RpcClient interface {
	SubmitRaw(block api.NormalRequestRawTxParam) error
	GetLatest(address types.Address) (*BlockHeader, error)
	GetSnapshotLatest() (*BlockHeader, error)
	GetFittestSnapshot() (*types.Hash, error)
	GetSnapshotByHash(hash types.Hash) (*BlockHeader, error)
	GetSnapshotByHeight(height uint64) (*BlockHeader, error)
	GetAccBlock(hash types.Hash) (*AccBlockHeader, error)
	GetOnroad(query OnroadQuery) ([]*AccBlockHeader, error)
	Balance(query BalanceQuery) (*TokenBalance, error)
	BalanceAll(query BalanceAllQuery) ([]*TokenBalance, error)
	GetDifficulty(query DifficultyQuery) (diffculty string, err error)

	GetRewardByIndex(index uint64) (reward *api.RewardInfo, err error)
	GetVoteDetailsByIndex(index uint64) (details []*consensus.VoteDetails, err error)

	GetClient() *rpc.Client
}

func NewRpcClient

func NewRpcClient(rawurl string) (RpcClient, error)

type SignFunc

type SignFunc func(addr types.Address, data []byte) (signedData, pubkey []byte, err error)

type TInfo

type TInfo struct {
	TokenId     types.TokenTypeId `json:"tokenId"`
	TokenName   string            `json:"tokenName"`
	TokenSymbol string            `json:"tokenSymbol"`
}

type TokenBalance

type TokenBalance struct {
	TotalAmount string `json:"totalAmount"`
	TInfo       `json:"tokenInfo"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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