Documentation
¶
Overview ¶
Package pushcore provides a client for interacting with Push Chain gRPC endpoints. It implements a fan-out pattern that tries multiple endpoints in round-robin order to provide high availability and fault tolerance.
Index ¶
- type Client
- func (c *Client) BroadcastTx(ctx context.Context, txBytes []byte) (*tx.BroadcastTxResponse, error)
- func (c *Client) Close() error
- func (c *Client) GetAccount(ctx context.Context, address string) (*authtypes.QueryAccountResponse, error)
- func (c *Client) GetAllChainConfigs(ctx context.Context) ([]*uregistrytypes.ChainConfig, error)
- func (c *Client) GetAllPendingOutbounds(ctx context.Context) ([]*uexecutortypes.PendingOutboundEntry, []*uexecutortypes.OutboundTx, error)
- func (c *Client) GetAllUniversalValidators(ctx context.Context) ([]*uvalidatortypes.UniversalValidator, error)
- func (c *Client) GetCurrentKey(ctx context.Context) (*utsstypes.TssKey, error)
- func (c *Client) GetGasPrice(ctx context.Context, chainID string) (*big.Int, error)
- func (c *Client) GetGranteeGrants(ctx context.Context, granteeAddr string) (*authz.QueryGranteeGrantsResponse, error)
- func (c *Client) GetLatestBlock(ctx context.Context) (uint64, error)
- func (c *Client) GetPendingFundMigrations(ctx context.Context) ([]*utsstypes.FundMigration, error)
- func (c *Client) GetPendingTssEvents(ctx context.Context) ([]*utsstypes.TssEvent, error)
- func (c *Client) GetTx(ctx context.Context, txHash string) (*tx.GetTxResponse, error)
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
}
Client is a fan-out client that connects to multiple Push Chain gRPC endpoints. It implements round-robin failover, trying each endpoint in sequence until one succeeds.
func New ¶
New creates a new Client by dialing the provided gRPC URLs. It attempts to connect to all endpoints and skips any that fail to dial. At least one endpoint must succeed, otherwise an error is returned.
func (*Client) BroadcastTx ¶ added in v0.0.13
BroadcastTx broadcasts a signed transaction to the chain.
func (*Client) Close ¶
Close gracefully closes all gRPC connections owned by the client. Returns the first error encountered, if any.
func (*Client) GetAccount ¶ added in v0.0.13
func (c *Client) GetAccount(ctx context.Context, address string) (*authtypes.QueryAccountResponse, error)
GetAccount retrieves account information for a given address.
func (*Client) GetAllChainConfigs ¶
func (c *Client) GetAllChainConfigs(ctx context.Context) ([]*uregistrytypes.ChainConfig, error)
GetAllChainConfigs retrieves all chain configurations from Push Chain.
func (*Client) GetAllPendingOutbounds ¶ added in v0.0.23
func (c *Client) GetAllPendingOutbounds(ctx context.Context) ([]*uexecutortypes.PendingOutboundEntry, []*uexecutortypes.OutboundTx, error)
GetAllPendingOutbounds retrieves up to the first 1000 pending outbound transactions from Push Chain. Sorted by created_at (block height) ascending — oldest first.
func (*Client) GetAllUniversalValidators ¶ added in v0.0.13
func (c *Client) GetAllUniversalValidators(ctx context.Context) ([]*uvalidatortypes.UniversalValidator, error)
GetAllUniversalValidators retrieves all universal validators from Push Chain.
func (*Client) GetCurrentKey ¶ added in v0.0.13
GetCurrentKey retrieves the current TSS key from Push Chain.
func (*Client) GetGasPrice ¶ added in v0.0.13
GetGasPrice retrieves the median gas price for a specific chain from the on-chain oracle.
func (*Client) GetGranteeGrants ¶ added in v0.0.13
func (c *Client) GetGranteeGrants(ctx context.Context, granteeAddr string) (*authz.QueryGranteeGrantsResponse, error)
GetGranteeGrants queries AuthZ grants for a grantee using round-robin logic.
func (*Client) GetLatestBlock ¶ added in v0.0.13
GetLatestBlock retrieves the latest block from Push Chain.
func (*Client) GetPendingFundMigrations ¶ added in v0.0.28
GetPendingFundMigrations retrieves all pending fund migrations from Push Chain.
func (*Client) GetPendingTssEvents ¶ added in v0.0.23
GetPendingTssEvents retrieves up to the first 1000 pending TSS events from Push Chain. Sorted by process_id ascending (oldest first).