Documentation ¶
Index ¶
- Variables
- type AccountFetcher
- type AuthQueryClient
- type Identity
- type KeyRequestFulfilment
- type KeyRequestRejection
- type Msger
- type PageRequest
- type QueryClient
- type RawTxClient
- func (c *RawTxClient) BuildTx(ctx context.Context, gasLimit uint64, fees types.Coins, msgers ...Msger) ([]byte, error)
- func (c *RawTxClient) SendTx(ctx context.Context, txBytes []byte) (string, error)
- func (c *RawTxClient) SendWaitTx(ctx context.Context, txBytes []byte) error
- func (c *RawTxClient) WaitForTx(ctx context.Context, hash string) error
- type SignRequestFulfilment
- type SignRequestRejection
- type TxClient
- type WardenQueryClient
- func (t *WardenQueryClient) GetKeyRequest(ctx context.Context, requestID uint64) (*types.KeyRequest, error)
- func (t *WardenQueryClient) GetSignRequest(ctx context.Context, requestID uint64) (*types.SignRequest, error)
- func (t *WardenQueryClient) PendingKeyRequests(ctx context.Context, page *PageRequest, keychainId uint64) ([]*types.KeyRequest, error)
- func (t *WardenQueryClient) PendingSignRequests(ctx context.Context, page *PageRequest, keychainId uint64) ([]*types.SignRequest, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AccountFetcher ¶
type AuthQueryClient ¶
type AuthQueryClient struct {
// contains filtered or unexported fields
}
AuthQueryClient stores a query client for the warden auth module
func NewAuthQueryClient ¶
func NewAuthQueryClient(c *grpc.ClientConn) *AuthQueryClient
NewAuthQueryClient returns a new AuthQueryClient with the supplied GRPC client connection.
type Identity ¶
type Identity struct { Address sdktypes.AccAddress PrivKey cryptotypes.PrivKey }
Identity represents an account on the Warden Protocol. It can be used to sign transactions.
func NewIdentityFromSeed ¶
NewIdentityFromSeed returns a Identity from a seed phrase. This is useful in a mock environment or during testing but should not be used in production.
type KeyRequestFulfilment ¶ added in v0.1.1
type KeyRequestRejection ¶ added in v0.1.1
type PageRequest ¶
type PageRequest = query.PageRequest
type QueryClient ¶
type QueryClient struct { *AuthQueryClient *WardenQueryClient // contains filtered or unexported fields }
QueryClient holds a query client for the auth and treasury modules.
func NewQueryClient ¶
func NewQueryClient(url string, insecure bool) (*QueryClient, error)
NewQueryClient returns a QueryClient. The supplied url must be a GRPC compatible endpoint for wardend.
func NewQueryClientWithConn ¶
func NewQueryClientWithConn(c *grpc.ClientConn) *QueryClient
NewQueryClientWithConn returns a QueryClient with the supplied GRPC client connection.
func (*QueryClient) Conn ¶
func (c *QueryClient) Conn() *grpc.ClientConn
Conn returns the gRPC client connection.
type RawTxClient ¶
type RawTxClient struct { Identity Identity // contains filtered or unexported fields }
RawTxClient is the client used for sending new transactions to the chain.
func NewRawTxClient ¶
func NewRawTxClient(id Identity, chainID string, c *grpc.ClientConn, accountFetcher AccountFetcher) *RawTxClient
func (*RawTxClient) BuildTx ¶
func (c *RawTxClient) BuildTx(ctx context.Context, gasLimit uint64, fees types.Coins, msgers ...Msger) ([]byte, error)
Build a transaction with the given messages and sign it. Sequence and account numbers will be fetched automatically from the chain.
func (*RawTxClient) SendTx ¶
SendTx broadcasts a signed transaction and returns its hash. This method does not wait until the transaction is actually added to the, blockchain. Use SendWaitForTx for that.
func (*RawTxClient) SendWaitTx ¶
func (c *RawTxClient) SendWaitTx(ctx context.Context, txBytes []byte) error
Send a transaction and wait for it to be included in a block.
type SignRequestFulfilment ¶ added in v0.1.1
type SignRequestRejection ¶ added in v0.1.1
type TxClient ¶
type TxClient struct {
*RawTxClient
}
TxClient can read/write transactions to wardend and endpoints provided by the treasury module.
func NewTxClient ¶
func NewTxClient(id Identity, chainID string, c *grpc.ClientConn, accountFetcher AccountFetcher) *TxClient
NewTxClient returns a TxClient.
type WardenQueryClient ¶
type WardenQueryClient struct {
// contains filtered or unexported fields
}
WardenQueryClient is the client for the treasury module.
func NewWardenQueryClient ¶
func NewWardenQueryClient(c *grpc.ClientConn) *WardenQueryClient
NewWardenQueryClient returns a WardenQueryClient
func (*WardenQueryClient) GetKeyRequest ¶
func (t *WardenQueryClient) GetKeyRequest(ctx context.Context, requestID uint64) (*types.KeyRequest, error)
GetKeyRequest returns the key request corresponding to the specific request ID.
func (*WardenQueryClient) GetSignRequest ¶ added in v0.4.0
func (t *WardenQueryClient) GetSignRequest(ctx context.Context, requestID uint64) (*types.SignRequest, error)
GetSignRequest returns the signature request corresponding to the specific request ID.
func (*WardenQueryClient) PendingKeyRequests ¶
func (t *WardenQueryClient) PendingKeyRequests(ctx context.Context, page *PageRequest, keychainId uint64) ([]*types.KeyRequest, error)
PendingKeyRequests executes a paginated pending key request query with context. wardend will return a slice of pending key requests for the supplied keychain address.
func (*WardenQueryClient) PendingSignRequests ¶ added in v0.4.0
func (t *WardenQueryClient) PendingSignRequests(ctx context.Context, page *PageRequest, keychainId uint64) ([]*types.SignRequest, error)
PendingSignRequests executes a paginated pending signature request query with context. wardend will return a slice of pending signature requests for the supplied keychain address.