pushcore

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 19 Imported by: 0

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

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

func New(urls []string, logger zerolog.Logger) (*Client, error)

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

func (c *Client) BroadcastTx(ctx context.Context, txBytes []byte) (*tx.BroadcastTxResponse, error)

BroadcastTx broadcasts a signed transaction to the chain.

func (*Client) Close

func (c *Client) Close() error

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

func (c *Client) GetCurrentKey(ctx context.Context) (*utsstypes.TssKey, error)

GetCurrentKey retrieves the current TSS key from Push Chain.

func (*Client) GetGasPrice added in v0.0.13

func (c *Client) GetGasPrice(ctx context.Context, chainID string) (*big.Int, error)

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

func (c *Client) GetLatestBlock(ctx context.Context) (uint64, error)

GetLatestBlock retrieves the latest block from Push Chain.

func (*Client) GetPendingFundMigrations added in v0.0.28

func (c *Client) GetPendingFundMigrations(ctx context.Context) ([]*utsstypes.FundMigration, error)

GetPendingFundMigrations retrieves all pending fund migrations from Push Chain.

func (*Client) GetPendingTssEvents added in v0.0.23

func (c *Client) GetPendingTssEvents(ctx context.Context) ([]*utsstypes.TssEvent, error)

GetPendingTssEvents retrieves up to the first 1000 pending TSS events from Push Chain. Sorted by process_id ascending (oldest first).

func (*Client) GetTx added in v0.0.28

func (c *Client) GetTx(ctx context.Context, txHash string) (*tx.GetTxResponse, error)

GetTx queries for a transaction by its hash. Returns the response if found, or an error if the tx does not exist or the query fails.

Jump to

Keyboard shortcuts

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