client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTokenIssueTx

func CreateTokenIssueTx(conn *grpc.ClientConn, fromAddress, toAddress types.Address, pubKeyBytes []byte, tokenName string,
	tokenTotalSupply uint64, signer crypto.Signer) (*types.Transaction, error)

CreateTokenIssueTx retrieves all the utxo of a public key, and use some of them to fund token issurance tx

func CreateTokenTransferTx

func CreateTokenTransferTx(conn *grpc.ClientConn, fromAddress types.Address, targets map[types.Address]uint64, pubKeyBytes []byte,
	tokenTxHash *crypto.HashType, tokenTxOutIdx uint32, signer crypto.Signer) (*types.Transaction, error)

CreateTokenTransferTx retrieves all the token utxo of a public key, and use some of them to fund token transfer tx

func CreateTransaction

func CreateTransaction(conn *grpc.ClientConn, fromAddress types.Address, targets map[types.Address]uint64, pubKeyBytes []byte, signer crypto.Signer) (*types.Transaction, error)

CreateTransaction retrieves all the utxo of a public key, and use some of them to send transaction

func FundTokenTransaction

func FundTokenTransaction(conn *grpc.ClientConn, addr types.Address, token *types.OutPoint, boxAmount, tokenAmount uint64) (*rpcpb.ListUtxosResponse, error)

FundTokenTransaction gets the utxo of a public key containing a certain amount of box and token

func FundTransaction

func FundTransaction(conn *grpc.ClientConn, addr types.Address, amount uint64) (*rpcpb.ListUtxosResponse, error)

FundTransaction gets the utxo of a public key

func GetBalance

func GetBalance(conn *grpc.ClientConn, addresses []string) (map[string]uint64, error)

GetBalance returns total amount of an address

func GetBlock

func GetBlock(conn *grpc.ClientConn, hash string) (*types.Block, error)

GetBlock returns block info of a block hash

func GetBlockCount

func GetBlockCount(conn *grpc.ClientConn) (uint32, error)

GetBlockCount query chain height

func GetBlockHash

func GetBlockHash(conn *grpc.ClientConn, height uint32) (string, error)

GetBlockHash returns block hash of a height

func GetBlockHeader

func GetBlockHeader(conn *grpc.ClientConn, hash string) (*types.BlockHeader, error)

GetBlockHeader returns header info of a block

func GetFeePrice

func GetFeePrice(conn *grpc.ClientConn) (uint64, error)

GetFeePrice gets the recommended mining fee price according to recent packed transactions

func GetRawTransaction

func GetRawTransaction(conn *grpc.ClientConn, hash []byte) (*types.Transaction, error)

GetRawTransaction get the transaction info of given hash

func GetTokenBalance

func GetTokenBalance(conn *grpc.ClientConn, addr types.Address, tokenTxHash *crypto.HashType, tokenTxOutIdx uint32) uint64

GetTokenBalance returns the token balance of a public key

func GetTransactionsInPool

func GetTransactionsInPool(conn *grpc.ClientConn) ([]*types.Transaction, error)

GetTransactionsInPool gets all transactions in memory pool

func ListTransactions

func ListTransactions(conn *grpc.ClientConn, addr string, offset, limit uint32) ([]*types.Transaction, error)

ListTransactions list transactions of certain address

func ListUtxos

func ListUtxos(conn *grpc.ClientConn) (*rpcpb.ListUtxosResponse, error)

ListUtxos list all utxos

func NewConnectionWithHostPort

func NewConnectionWithHostPort(host string, port int) *grpc.ClientConn

NewConnectionWithHostPort initializes a grpc connection using host and port params

func NewConnectionWithViper

func NewConnectionWithViper(v *viper.Viper) *grpc.ClientConn

NewConnectionWithViper initializes a grpc connection using configs parsed by viper

func SetDebugLevel

func SetDebugLevel(conn *grpc.ClientConn, level string) error

SetDebugLevel calls the DebugLevel gRPC methods.

func UpdateNetworkID

func UpdateNetworkID(conn *grpc.ClientConn, id uint32) error

UpdateNetworkID calls the UpdateNetworkID gRPC methods.

Types

type TransferParam

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

TransferParam wraps info of transfer target, type and amount

Jump to

Keyboard shortcuts

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