Documentation
¶
Index ¶
- Constants
- Variables
- func ParseAccAddressFromString(addrStr string) (types.AccAddress, error)
- func ParseAccountKey(kr keyring.Keyring, accountKey string) (sdktypes.AccAddress, error)
- type ConfigOption
- func WithFeeGranterAddress(granter string) ConfigOption
- func WithGas(gas uint64) ConfigOption
- func WithGasPrice(gasPrice float64) ConfigOption
- func WithKeyName(key string) ConfigOption
- func WithMaxGasPrice(gasPrice float64) ConfigOption
- func WithSignerAddress(address string) ConfigOption
- func WithTxPriority(priority int) ConfigOption
- type Option
- type TxClient
- func (c *TxClient) Start(context.Context) error
- func (c *TxClient) Stop(context.Context) error
- func (c *TxClient) SubmitMessage(ctx context.Context, msg types.Msg, cfg *TxConfig) (*user.TxResponse, error)
- func (c *TxClient) SubmitPayForBlob(ctx context.Context, libBlobs []*libshare.Blob, author types.AccAddress, ...) (_ *user.TxResponse, err error)
- func (c *TxClient) WithMetrics() error
- type TxConfig
- func (cfg *TxConfig) FeeGranterAddress() string
- func (cfg *TxConfig) GasLimit() uint64
- func (cfg *TxConfig) GasPrice() float64
- func (cfg *TxConfig) IsGasPriceSet() bool
- func (cfg *TxConfig) KeyName() string
- func (cfg *TxConfig) MarshalJSON() ([]byte, error)
- func (cfg *TxConfig) MaxGasPrice() float64
- func (cfg *TxConfig) SignerAddress() string
- func (cfg *TxConfig) TxPriority() TxPriority
- func (cfg *TxConfig) UnmarshalJSON(data []byte) error
- type TxPriority
Constants ¶
const ( // DefaultGasPrice specifies the default gas price value to be used when the user // wants to use the global minimal gas price, which is fetched from the celestia-app. DefaultGasPrice float64 = -1.0 DefaultMaxGasPrice = appconsts.DefaultMinGasPrice * 100 )
const ( TxPriorityLow = iota + 1 TxPriorityMedium TxPriorityHigh )
Variables ¶
var ErrGasPriceExceedsLimit = errors.New("state: estimated gas price exceeds max gas price in tx config")
Functions ¶
func ParseAccAddressFromString ¶
func ParseAccAddressFromString(addrStr string) (types.AccAddress, error)
func ParseAccountKey ¶
Types ¶
type ConfigOption ¶
type ConfigOption func(cfg *TxConfig)
ConfigOption is the functional option that is applied to the TxConfig instance to configure parameters.
func WithFeeGranterAddress ¶
func WithFeeGranterAddress(granter string) ConfigOption
WithFeeGranterAddress is an option that allows you to specify a GranterAddress to pay the fees.
func WithGas ¶
func WithGas(gas uint64) ConfigOption
WithGas is an option that allows to specify Gas. Gas will be calculated in case it wasn't specified.
func WithGasPrice ¶
func WithGasPrice(gasPrice float64) ConfigOption
WithGasPrice is an option that allows to specify a GasPrice, which is needed to calculate the fee. In case GasPrice is not specified, the global GasPrice fetched from celestia-app will be used.
func WithKeyName ¶
func WithKeyName(key string) ConfigOption
WithKeyName is an option that allows you to specify an KeyName, which is needed to sign the transaction. This key should be associated with the address and stored locally in the key store. Default Account will be used in case it wasn't specified.
func WithMaxGasPrice ¶
func WithMaxGasPrice(gasPrice float64) ConfigOption
WithMaxGasPrice is an option that allows you to specify a `maxGasPrice` field.
func WithSignerAddress ¶
func WithSignerAddress(address string) ConfigOption
WithSignerAddress is an option that allows you to specify an address, that will sign the transaction. This address must be stored locally in the key store. Default signerAddress will be used in case it wasn't specified.
func WithTxPriority ¶
func WithTxPriority(priority int) ConfigOption
WithTxPriority is an option that allows you to specify a priority of the tx.
type Option ¶
type Option func(c *TxClient)
func WithAdditionalCoreEndpoints ¶
func WithAdditionalCoreEndpoints(conns []*grpc.ClientConn) Option
func WithEstimatorService ¶
WithEstimatorService indicates to the CoreAccessor to pass the given address for the estimator service to the TxClient to use for all gas price and usage estimation queries.
func WithEstimatorServiceTLS ¶
func WithEstimatorServiceTLS() Option
WithEstimatorServiceTLS indicates to the CoreAccessor to use TLS for the estimator service connection.
func WithTxWorkerAccounts ¶
WithTxWorkerAccounts configures the CoreAccessor to manage the provided number of worker accounts via the TxClient.
- Value of 0 submits transactions immediately (without a submission queue).
- Value of 1 uses synchronous submission (submission queue with default signer as author of transactions).
- Value of > 1 uses parallel submission (submission queue with several accounts submitting blobs). Parallel submission is not guaranteed to include blobs in the same order as they were submitted.
type TxClient ¶
type TxClient struct {
// contains filtered or unexported fields
}
func BuildClient ¶
func NewTxClient ¶
func (*TxClient) SubmitMessage ¶
func (*TxClient) SubmitPayForBlob ¶
func (*TxClient) WithMetrics ¶
type TxConfig ¶
type TxConfig struct {
// contains filtered or unexported fields
}
TxConfig specifies additional options that will be applied to the Tx.
func NewTxConfig ¶
func NewTxConfig(opts ...ConfigOption) *TxConfig
NewTxConfig constructs a new TxConfig with the provided options. It starts with a DefaultGasPrice and then applies any additional options provided through the variadic parameter.
func (*TxConfig) FeeGranterAddress ¶
func (*TxConfig) IsGasPriceSet ¶
func (*TxConfig) MarshalJSON ¶
func (*TxConfig) MaxGasPrice ¶
MaxGasPrice will return the max gas price that the user set in the TxConfig. If no value was set, it will return the default value.
func (*TxConfig) SignerAddress ¶
func (*TxConfig) TxPriority ¶
func (cfg *TxConfig) TxPriority() TxPriority
func (*TxConfig) UnmarshalJSON ¶
type TxPriority ¶
type TxPriority int
func (TxPriority) ToApp ¶
func (t TxPriority) ToApp() gasestimation.TxPriority