Documentation
¶
Index ¶
- func NewBroadcastTx(ctx context.Context, bytes []byte, mode txv1beta1.BroadcastMode, ...) (<-chan *BroadcastTx, error)
- type AddressHuman
- type AddressRaw
- type Addresses
- type AuthenticationOption
- type BroadcastTx
- type BroadcastTxError
- type Client
- type DialOption
- type PubKeyRaw
- type Signer
- type SignerInfoExtended
- type SignerInfoProvider
- type Tx
- func (t *Tx) AddMsg(m proto.Message) error
- func (t *Tx) AddMsgs(msgs ...proto.Message) error
- func (t *Tx) AddSignerByAddr(addr string)
- func (t *Tx) AddSignerByPubKey(pubKey []byte)
- func (t *Tx) Broadcast(ctx context.Context, mode txv1beta1.BroadcastMode) (<-chan *BroadcastTx, error)
- func (t *Tx) SetFee(coins ...*basev1beta1.Coin)
- func (t *Tx) SetFeePayer(addr string)
- func (t *Tx) SetGasLimit(limit uint64)
- func (t *Tx) SetMemo(memo string)
- func (t *Tx) SetTimeoutHeight(height uint64)
- func (t *Tx) Sign(ctx context.Context) (*txv1beta1.TxRaw, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBroadcastTx ¶
func NewBroadcastTx(ctx context.Context, bytes []byte, mode txv1beta1.BroadcastMode, txSvc txv1beta1.ServiceClient, watcher *tx.Watcher) (<-chan *BroadcastTx, error)
Types ¶
type AddressHuman ¶
type AddressHuman = string
AddressHuman is a string type alias for a human-readable address representation.
type AddressRaw ¶
type AddressRaw = []byte
AddressRaw is a []byte type alias for a raw bytes address representation.
type Addresses ¶
type Addresses struct {
// contains filtered or unexported fields
}
Addresses provides utilities to work with addresses in cosmos-sdk based chains.
func NewAddresses ¶
NewAddresses instantiates a new *Addresses instance.
func (*Addresses) Decode ¶
func (a *Addresses) Decode(address AddressHuman) (AddressRaw, error)
Decode decodes an AddressHuman representation into its AddressRaw format.
func (*Addresses) Derive ¶
func (a *Addresses) Derive(address AddressRaw) (AddressHuman, error)
Derive derives an AddressRaw to its chain specific human-readable form.
func (*Addresses) DeriveFromPubKey ¶
func (a *Addresses) DeriveFromPubKey(pubKey PubKeyRaw) (AddressHuman, error)
type AuthenticationOption ¶
type AuthenticationOption func(opt *authenticationOptions)
func WithSigner ¶
func WithSigner(s Signer) AuthenticationOption
WithSigner sets the signature provider for tx requests
func WithSignerInfoProvider ¶
func WithSignerInfoProvider(s SignerInfoProvider) AuthenticationOption
WithSignerInfoProvider sets the SignerInfoProvider for Client
type BroadcastTx ¶
BroadcastTx is an alias of tx.Response and identifies a transaction which was broadcast
type BroadcastTxError ¶
type BroadcastTxError struct {
Response *abciv1beta1.TxResponse
}
BroadcastTxError identifies an error whilst broadcasting a TX.
func (*BroadcastTxError) Error ¶
func (e *BroadcastTxError) Error() string
type Client ¶
type Client struct { App *reflectionv2alpha1.AppDescriptor Codec *codec.Codec Addresses *Addresses // contains filtered or unexported fields }
func (*Client) ClientConn ¶
func (c *Client) ClientConn() grpc.ClientConnInterface
func (*Client) DynamicQuery ¶
type DialOption ¶
type DialOption func(options *options)
DialOption defines a Client Dial option
func WithAppDescriptor ¶
func WithAppDescriptor(desc *reflectionv2alpha1.AppDescriptor) DialOption
WithAppDescriptor allows to provide the application descriptor in case it was cached beforehand to speed up the dial process.
func WithAuthenticationOptions ¶
func WithAuthenticationOptions(authOpts ...AuthenticationOption) DialOption
WithAuthenticationOptions sets the authentication settings for the client.
func WithRemoteRegistry ¶
func WithRemoteRegistry(registry codec.ProtoFileRegistry) DialOption
WithRemoteRegistry allows to setup a custom protobuf file registry
type PubKeyRaw ¶
type PubKeyRaw = []byte
PubKeyRaw is a []byte type alias for a raw public key address representation
type SignerInfoExtended ¶
type SignerInfoExtended struct { SignerInfo *txv1beta1.SignerInfo AccountNumber uint64 }
SignerInfoExtended is like txv1beta1.SignerInfo but contains also the account number of the account.
func (SignerInfoExtended) String ¶
func (s SignerInfoExtended) String() string
type SignerInfoProvider ¶
type SignerInfoProvider interface {
SignerInfo(ctx context.Context, addr string) (*SignerInfoExtended, error)
}
SignerInfoProvider provides information regarding signers.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func NewTx ¶
func NewTx(cdc *codec.Codec, supportedMsgs map[protoreflect.FullName]struct{}, chainID string, signeInfoProvider SignerInfoProvider, signer Signer, watcher *tx.Watcher, txSvc txv1beta1.ServiceClient) *Tx
func (*Tx) AddSignerByAddr ¶
func (*Tx) AddSignerByPubKey ¶
func (*Tx) Broadcast ¶
func (t *Tx) Broadcast(ctx context.Context, mode txv1beta1.BroadcastMode) (<-chan *BroadcastTx, error)
func (*Tx) SetFee ¶
func (t *Tx) SetFee(coins ...*basev1beta1.Coin)
func (*Tx) SetFeePayer ¶
SetFeePayer sets the Tx fee payer. It also adds fee payer as a signer of the transaction.