client

package
v0.0.0-...-74176f6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastTx

func BroadcastTx(ctx context.Context, conn *grpc.ClientConn, mode tx.BroadcastMode, txBytes []byte) (*tx.BroadcastTxResponse, error)

BroadcastTx uses the provided grpc connection to broadcast a signed and encoded transaction

func QueryAccount

func QueryAccount(ctx context.Context, conn *grpc.ClientConn, encCfg params.EncodingConfig, address string) (accNum uint64, seqNum uint64, err error)

QueryAccount fetches the account number and sequence number from the lazyledger-app node.

Types

type KeyringSigner

type KeyringSigner struct {
	keyring.Keyring
	// contains filtered or unexported fields
}

KeyringSigner uses a keyring to sign and build lazyledger-app transactions

func NewKeyringSigner

func NewKeyringSigner(ring keyring.Keyring, name string, chainID string) *KeyringSigner

NewKeyringSigner returns a new KeyringSigner using the provided keyring

func (KeyringSigner) BuildSignedTx

func (k KeyringSigner) BuildSignedTx(builder sdkclient.TxBuilder, msg sdktypes.Msg) (authsigning.Tx, error)

BuildSignedTx creates and signs a sdk.Tx that contains the provided message. The interal account number must be set by calling k.QueryAccountNumber or by manually setting it via k.SetAccountNumber for the built transactions to be valid.

func (KeyringSigner) EncodeTx

func (k KeyringSigner) EncodeTx(tx sdktypes.Tx) ([]byte, error)

EncodeTx uses the keyring signer's encoding config to encode the provided sdk transaction

func (KeyringSigner) NewTxBuilder

func (k KeyringSigner) NewTxBuilder() sdkclient.TxBuilder

NewTxBuilder returns the default sdk Tx builder using the lazyledger-app encoding config

func (*KeyringSigner) QueryAccountNumber

func (k *KeyringSigner) QueryAccountNumber(ctx context.Context, conn *grpc.ClientConn) error

QueryAccountNumber queries the applicaiton to find the latest account number and sequence, updating the respective internal fields. The internal account number must be set by this method or by manually calling k.SetAccountNumber in order for any built transactions to be valide

func (*KeyringSigner) SetAccountNumber

func (k *KeyringSigner) SetAccountNumber(n uint64)

SetAccountNumber manually sets the underlying account number

func (*KeyringSigner) SetKeyringAccName

func (k *KeyringSigner) SetKeyringAccName(name string)

SetKeyringAccName manually sets the underlying keyring account name

func (*KeyringSigner) SetSequence

func (k *KeyringSigner) SetSequence(n uint64)

SetSequence manually sets the underlying sequence number

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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