builder

package
v0.0.0-...-3dbdd87 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

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 InheritTxConfig

func InheritTxConfig(builder sdkclient.TxBuilder, tx authsigning.Tx) sdkclient.TxBuilder

InheritTxConfig sets all of the accessible configurations from a given tx into a a give client.TxBuilder

func QueryAccount

func QueryAccount(ctx context.Context, conn *grpc.ClientConn, encCfg encoding.Config, address string) (authtypes.AccountI, error)

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

Types

type KeyringSigner

type KeyringSigner struct {
	keyring.Keyring

	sync.RWMutex
	// contains filtered or unexported fields
}

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

func NewKeyringSigner

func NewKeyringSigner(encCfg encoding.Config, 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, isSecondary bool, 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) GetSignerData

func (k *KeyringSigner) GetSignerData(isSecondary bool) (authsigning.SignerData, error)

func (*KeyringSigner) GetSignerInfo

func (k *KeyringSigner) GetSignerInfo() *keyring.Record

GetSignerInfo returns the signer info for the KeyringSigner's account. panics if the account in KeyringSigner does not exist.

func (*KeyringSigner) NewTxBuilder

func (k *KeyringSigner) NewTxBuilder(opts ...TxBuilderOption) sdkclient.TxBuilder

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

func (*KeyringSigner) SetAccountNumber

func (k *KeyringSigner) SetAccountNumber(n uint64) error

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) SetSecondarySequence

func (k *KeyringSigner) SetSecondarySequence(id string, n uint64) error

SetSecondarySequence manually sets the underlying secondary sequence number

func (*KeyringSigner) SetSequence

func (k *KeyringSigner) SetSequence(n uint64) error

SetSequence manually sets the underlying sequence number

func (*KeyringSigner) UpdateAccount

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

Update queries the application 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 valid

func (*KeyringSigner) UpdateAccountFromClient

func (k *KeyringSigner) UpdateAccountFromClient(clientCtx client.Context) error

type TxBuilderOption

type TxBuilderOption func(builder sdkclient.TxBuilder) sdkclient.TxBuilder

func SetFeeAmount

func SetFeeAmount(fees sdk.Coins) TxBuilderOption

func SetFeeGranter

func SetFeeGranter(feeGranter sdk.AccAddress) TxBuilderOption

func SetFeePayer

func SetFeePayer(feePayer sdk.AccAddress) TxBuilderOption

func SetGasLimit

func SetGasLimit(limit uint64) TxBuilderOption

func SetMemo

func SetMemo(memo string) TxBuilderOption

func SetTimeoutHeight

func SetTimeoutHeight(height uint64) TxBuilderOption

func SetTip

func SetTip(tip *tx.Tip) TxBuilderOption

Jump to

Keyboard shortcuts

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