Documentation ¶
Index ¶
- func BroadcastTx(ctx context.Context, conn *grpc.ClientConn, mode tx.BroadcastMode, ...) (*tx.BroadcastTxResponse, error)
- func QueryAccount(ctx context.Context, conn *grpc.ClientConn, encCfg params.EncodingConfig, ...) (accNum uint64, seqNum uint64, err error)
- type KeyringSigner
- func (k KeyringSigner) BuildSignedTx(builder sdkclient.TxBuilder, msg sdktypes.Msg) (authsigning.Tx, error)
- func (k KeyringSigner) EncodeTx(tx sdktypes.Tx) ([]byte, error)
- func (k KeyringSigner) NewTxBuilder() sdkclient.TxBuilder
- func (k *KeyringSigner) QueryAccountNumber(ctx context.Context, conn *grpc.ClientConn) error
- func (k *KeyringSigner) SetAccountNumber(n uint64)
- func (k *KeyringSigner) SetKeyringAccName(name string)
- func (k *KeyringSigner) SetSequence(n uint64)
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 ¶
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