Documentation ¶
Index ¶
- Constants
- func QueryAccount(ctx context.Context, conn *grpc.ClientConn, encCfg encoding.Config, ...) (accNum uint64, seqNum uint64, err error)
- type Signer
- func NewSigner(keys keyring.Keyring, conn *grpc.ClientConn, address sdktypes.AccAddress, ...) (*Signer, error)
- func SetupSigner(ctx context.Context, keys keyring.Keyring, conn *grpc.ClientConn, ...) (*Signer, error)
- func SetupSingleSigner(ctx context.Context, keys keyring.Keyring, conn *grpc.ClientConn, ...) (*Signer, error)
- func (s *Signer) AccountNumber() uint64
- func (s *Signer) Address() sdktypes.AccAddress
- func (s *Signer) BroadcastTx(ctx context.Context, txBytes []byte) (*sdktypes.TxResponse, error)
- func (s *Signer) ChainID() string
- func (s *Signer) ConfirmTx(ctx context.Context, txHash string) (*sdktypes.TxResponse, error)
- func (s *Signer) CreatePayForBlob(blobs []*blob.Blob, opts ...TxOption) ([]byte, error)
- func (s *Signer) CreateTx(msgs []sdktypes.Msg, opts ...TxOption) ([]byte, error)
- func (s *Signer) ForceSetSequence(seq uint64)
- func (s *Signer) GetSequence() uint64
- func (s *Signer) PubKey() cryptotypes.PubKey
- func (s *Signer) SetPollTime(pollTime time.Duration)
- func (s *Signer) SubmitPayForBlob(ctx context.Context, blobs []*blob.Blob, opts ...TxOption) (*sdktypes.TxResponse, error)
- func (s *Signer) SubmitTx(ctx context.Context, msgs []sdktypes.Msg, opts ...TxOption) (*sdktypes.TxResponse, error)
- type TxOption
- func SetFee(fees uint64) TxOption
- func SetFeeAmount(fees sdk.Coins) TxOption
- func SetFeeGranter(feeGranter sdk.AccAddress) TxOption
- func SetFeePayer(feePayer sdk.AccAddress) TxOption
- func SetGasLimit(limit uint64) TxOption
- func SetGasLimitAndFee(gasLimit uint64, gasPrice float64) TxOption
- func SetMemo(memo string) TxOption
- func SetTimeoutHeight(height uint64) TxOption
- func SetTip(tip *tx.Tip) TxOption
Constants ¶
const DefaultPollTime = 3 * time.Second
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer is an abstraction for building, signing, and broadcasting Celestia transactions
func NewSigner ¶
func NewSigner( keys keyring.Keyring, conn *grpc.ClientConn, address sdktypes.AccAddress, enc client.TxConfig, chainID string, accountNumber uint64, sequence uint64, ) (*Signer, error)
NewSigner returns a new signer using the provided keyring
func SetupSigner ¶
func SetupSigner( ctx context.Context, keys keyring.Keyring, conn *grpc.ClientConn, address sdktypes.AccAddress, encCfg encoding.Config, ) (*Signer, error)
SetupSigner uses the underlying grpc connection to populate the chainID, accountNumber and sequence number of the account.
func SetupSingleSigner ¶
func SetupSingleSigner(ctx context.Context, keys keyring.Keyring, conn *grpc.ClientConn, encCfg encoding.Config) (*Signer, error)
SetupSingleSigner sets up a signer based on the provided keyring. The keyring must contain exactly one key. It extracts the address from the key and uses the grpc connection to populate the chainID, account number, and sequence number.
func (*Signer) AccountNumber ¶
AccountNumber returns the account number of the signer.
func (*Signer) Address ¶
func (s *Signer) Address() sdktypes.AccAddress
Address returns the address of the signer.
func (*Signer) BroadcastTx ¶
BroadcastTx submits the provided transaction bytes to the chain and returns the response.
func (*Signer) ConfirmTx ¶
ConfirmTx periodically pings the provided node for the commitment of a transaction by its hash. It will continually loop until the context is cancelled, the tx is found or an error is encountered.
func (*Signer) CreatePayForBlob ¶
func (*Signer) CreateTx ¶
CreateTx forms a transaction from the provided messages and signs it. TxOptions may be optionally used to set the gas limit and fee.
func (*Signer) ForceSetSequence ¶
ForceSetSequence manually overrides the current sequence number. Be careful when invoking this as it may cause the transactions to reject the sequence if it doesn't match the one in state
func (*Signer) GetSequence ¶
GetSequence gets the latest signed sequence and increments the local sequence number
func (*Signer) PubKey ¶
func (s *Signer) PubKey() cryptotypes.PubKey
PubKey returns the public key of the signer
func (*Signer) SetPollTime ¶
SetPollTime sets how often the signer should poll for the confirmation of the transaction
func (*Signer) SubmitPayForBlob ¶
func (s *Signer) SubmitPayForBlob(ctx context.Context, blobs []*blob.Blob, opts ...TxOption) (*sdktypes.TxResponse, error)
SubmitPayForBlob forms a transaction from the provided blobs, signs it, and submits it to the chain. TxOptions may be provided to set the fee and gas limit.
type TxOption ¶
func SetFeeAmount ¶
func SetFeeGranter ¶
func SetFeeGranter(feeGranter sdk.AccAddress) TxOption
func SetFeePayer ¶
func SetFeePayer(feePayer sdk.AccAddress) TxOption
func SetGasLimit ¶
func SetGasLimitAndFee ¶
SetGasLimitAndFee sets the gas limit and fee using the provided gas price and gas limit. Note that this could overwrite or be overwritten by other conflicting TxOptions.