client

package
v3.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(cylinderCtx *cylinderctx.Context) (*Client, error)

New creates a new instance of the Client. It returns the created Client instance and an error if the initialization fails.

func (*Client) Broadcast

func (c *Client) Broadcast(key *keyring.Record, msgs []sdk.Msg, gasAdjust float64) (*sdk.TxResponse, error)

Broadcast signs and broadcasts the provided messages using the given key. It adjusts the gas according to the gasAdjust parameter and returns the transaction response or an error.

func (*Client) BroadcastAndConfirm

func (c *Client) BroadcastAndConfirm(
	logger *logger.Logger,
	key *keyring.Record,
	msgs []sdk.Msg,
) (res *sdk.TxResponse, err error)

BroadcastAndConfirm broadcasts and confirms the messages by signing and submitting them using the provided key. It returns the transaction response or an error. It retries broadcasting and confirming up to maxTry times.

func (*Client) GetTxFromTxHash

func (c *Client) GetTxFromTxHash(txHash string) (txRes *sdk.TxResponse, err error)

GetTxFromTxHash retrieves the transaction response for the given transaction hash. It waits for the transaction to be committed and returns the transaction response or an error if it exceeds timeout.

func (*Client) QueryAccount

func (c *Client) QueryAccount(key *keyring.Record) (client.Account, error)

QueryAccount queries the account information associated with the given key. It returns the account or an error if the account retrieval fails.

func (*Client) QueryDE

func (c *Client) QueryDE(address string, offset uint64, limit uint64) (*DEResponse, error)

QueryDE queries the DE information with the given address. It returns the de response or an error.

func (*Client) QueryGroup

func (c *Client) QueryGroup(groupID tss.GroupID) (*GroupResult, error)

QueryGroup queries the group information with the given group ID. It returns the group response or an error.

func (*Client) QueryMember

func (c *Client) QueryMember(address string) (*bandtsstypes.QueryMemberResponse, error)

QueryMember queries the member information of the given address. It returns the member information on current and incoming group or an error.

func (*Client) QueryPendingGroups

func (c *Client) QueryPendingGroups(address string) (*tsstypes.QueryPendingGroupsResponse, error)

QueryPendingGroups queries the all pending groups with the given address. It returns the QueryPendingSignsResponse or an error.

func (*Client) QueryPendingSignings

func (c *Client) QueryPendingSignings(address string) (*tsstypes.QueryPendingSigningsResponse, error)

QueryPendingSignings queries the all pending signings with the given address. It returns the QueryPendingSignsResponse or an error.

func (*Client) QuerySigning

func (c *Client) QuerySigning(signingID tss.SigningID) (*SigningResponse, error)

QuerySigning queries the signing information with the given signing ID. It returns the signing response or an error.

func (*Client) Stop

func (c *Client) Stop() error

Stop stops the client by terminating the underlying RPC client connection. It returns an error if the client cannot be stopped.

func (*Client) Subscribe

func (c *Client) Subscribe(subscriber, query string, outCapacity ...int) (out <-chan ctypes.ResultEvent, err error)

Subscribe subscribes to an event query with the provided subscriber and query string. It returns a channel of ResultEvent to receive the subscribed events and an error if any.

type DEResponse

type DEResponse struct {
	types.QueryDEResponse
}

DEResponse wraps the types.QueryDEResponse to provide additional helper methods.

func NewDEResponse

func NewDEResponse(der *types.QueryDEResponse) *DEResponse

NewDEResponse creates a new instance of DEResponse.

func (DEResponse) GetRemaining

func (der DEResponse) GetRemaining() uint64

GetRemaining retrieves the remaining DE in the blockchain for the address.

type GroupResult

type GroupResult struct {
	types.GroupResult
}

GroupResult wraps the types.GroupResult to provide additional helper methods.

func NewGroupResult

func NewGroupResult(gr *types.QueryGroupResponse) *GroupResult

NewGroupResult creates a new instance of GroupResponse.

func (GroupResult) GetEncryptedSecretShare

func (gr GroupResult) GetEncryptedSecretShare(senderID, receiverID tss.MemberID) (tss.EncSecretShare, error)

GetEncryptedSecretShare retrieves the encrypted secret share from member (Sender) to member (Receiver).

func (GroupResult) GetMemberID

func (gr GroupResult) GetMemberID(address string) (tss.MemberID, error)

GetMemberID returns member's id of the address in the group.

func (GroupResult) GetRound1Info

func (gr GroupResult) GetRound1Info(mid tss.MemberID) (types.Round1Info, error)

GetRound1Info retrieves the Round1Commitment for the specified member ID.

func (GroupResult) GetRound2Info

func (gr GroupResult) GetRound2Info(mid tss.MemberID) (types.Round2Info, error)

GetRound2Info retrieves the Round1Commitment for the specified member ID.

func (GroupResult) IsMember

func (gr GroupResult) IsMember(address string) bool

IsMember returns boolean to show if the address is the member in the group.

type SigningResponse

type SigningResponse struct {
	types.QuerySigningResponse
}

SigningResponse wraps the types.QuerySigningResponse to provide additional helper methods.

func NewSigningResponse

func NewSigningResponse(gr *types.QuerySigningResponse) *SigningResponse

NewSigningResponse creates a new instance of SigningResponse.

func (SigningResponse) GetAssignedMember

func (sr SigningResponse) GetAssignedMember(address string) (types.AssignedMember, error)

GetAssignedMember returns assigned member of the specific address

func (SigningResponse) GetMemberIDs

func (sr SigningResponse) GetMemberIDs() []tss.MemberID

GetMemberIDs returns all assigned member's id of the assigned members

Jump to

Keyboard shortcuts

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