grpcclient

package
v0.0.0-...-25b3476 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chainnode

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

Chainnode implements chainnode.Chainnode

func New

func New(logger log.Logger) *Chainnode

New creates a new instance

func (*Chainnode) BroadcastTransaction

func (ch *Chainnode) BroadcastTransaction(chain, symbol string, signedTxData []byte) (
	transactionHash string, err error)

BroadcastTransaction broadcasts the signedTransaction

func (*Chainnode) ConvertAddress

func (ch *Chainnode) ConvertAddress(chain string, publicKey []byte) (string, error)

ConvertAddress converts publicKey to address

func (*Chainnode) CreateAccountSignedTransaction

func (ch *Chainnode) CreateAccountSignedTransaction(chain, symbol string, raw []byte, signatures, pubKeys []byte) (
	[]byte, []byte, error)

func (*Chainnode) CreateAccountTransaction

func (ch *Chainnode) CreateAccountTransaction(chain, symbol, contractAddress string, transaction *chainnode.ExtAccountTransaction) (
	[]byte, []byte, error)

CreateTransaction for a transaction,

func (*Chainnode) CreateUtxoSignedTransaction

func (ch *Chainnode) CreateUtxoSignedTransaction(chain, symbol string, raw []byte, signatures, pubKeys [][]byte) (
	[]byte, []byte, error)

CreateSignedTransaction for a transaction with signature, pubkey is only for BTC, signatures for multi-Vin in BTC

func (*Chainnode) CreateUtxoTransaction

func (ch *Chainnode) CreateUtxoTransaction(chain, symbol string, transaction *chainnode.ExtUtxoTransaction) (
	transactionData []byte, signHashs [][]byte, err error)

CreateTransaction for a transaction,

func (*Chainnode) Init

func (ch *Chainnode) Init(network string) error

Connect to Chainnode server via grpc

func (*Chainnode) QueryAccountTransaction

func (ch *Chainnode) QueryAccountTransaction(chain, symbol, hash string, asynMode bool) (*chainnode.ExtAccountTransaction, error)

func (*Chainnode) QueryAccountTransactionFromData

func (ch *Chainnode) QueryAccountTransactionFromData(chain, symbol string, rawData []byte) (*chainnode.ExtAccountTransaction, []byte, error)

QueryAccountTransactionFromData for an address and a signed transaction bytes

func (*Chainnode) QueryAccountTransactionFromSignedData

func (ch *Chainnode) QueryAccountTransactionFromSignedData(chain, symbol string, signedTxData []byte) (*chainnode.ExtAccountTransaction, error)

QueryAccountTransactionFromSignedData for an address and a signed transaction bytes

func (*Chainnode) QueryBalance

func (ch *Chainnode) QueryBalance(chain, symbol, address, contractAddress string, blockHeight uint64) (
	sdk.Int, error)

func (*Chainnode) QueryGasPrice

func (ch *Chainnode) QueryGasPrice(chain string) (sdk.Int, error)

func (*Chainnode) QueryNonce

func (ch *Chainnode) QueryNonce(chain, address string) (uint64, error)

func (*Chainnode) QueryUtxo

func (ch *Chainnode) QueryUtxo(chain, symbol string, vin *sdk.UtxoIn) (
	bool, error)

func (*Chainnode) QueryUtxoInsFromData

func (ch *Chainnode) QueryUtxoInsFromData(chain, symbol string, data []byte) ([]*sdk.UtxoIn, error)

VerifySignedTransaction for an address and a signed transaction bytes

func (*Chainnode) QueryUtxoTransaction

func (ch *Chainnode) QueryUtxoTransaction(chain, symbol, hash string, asynMode bool) (*chainnode.ExtUtxoTransaction, error)

func (*Chainnode) QueryUtxoTransactionFromData

func (ch *Chainnode) QueryUtxoTransactionFromData(chain, symbol string, rawData []byte, vins []*sdk.UtxoIn) (*chainnode.ExtUtxoTransaction, [][]byte, error)

VerifySignedTransaction for an address and a signed transaction bytes

func (*Chainnode) QueryUtxoTransactionFromSignedData

func (ch *Chainnode) QueryUtxoTransactionFromSignedData(chain, symbol string, signedTxData []byte, vins []*sdk.UtxoIn) (*chainnode.ExtUtxoTransaction, error)

QueryUtxoTransactionFromSignedData for an address and a signed transaction bytes

func (*Chainnode) SupportChain

func (ch *Chainnode) SupportChain(chain string) bool

SupportAsset checks if a symbol is supported

func (*Chainnode) ValidAddress

func (ch *Chainnode) ValidAddress(chain, symbol, address string) (bool, string)

IsValidAddress checks the validity of an address and to be withdrawed to

func (*Chainnode) VerifyAccountSignedTransaction

func (ch *Chainnode) VerifyAccountSignedTransaction(chain, symbol string, address string, signedTxData []byte) (bool, error)

VerifySignedTransaction for an address and a signed transaction bytes

func (*Chainnode) VerifyUtxoSignedTransaction

func (ch *Chainnode) VerifyUtxoSignedTransaction(chain, symbol string, addresses []string, signedTxData []byte, vins []*sdk.UtxoIn) (bool, error)

VerifyUtxoSignedTransaction for an address and a signed transaction bytes

Jump to

Keyboard shortcuts

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