interfaces

package
v0.0.0-...-50aa497 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package interfaces provides interfaces for clients and signers for the chain to interact with

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainID

type ChainID = int64

type Nonce

type Nonce = uint64

type TSSSigner

type TSSSigner interface {
	PubKey() tss.PubKey

	Sign(_ context.Context,
		data []byte,
		height uint64,
		nonce uint64,
		chainID int64,
	) ([65]byte, error)

	SignBatch(_ context.Context,
		digests [][]byte,
		height uint64,
		nonce uint64,
		chainID int64,
	) ([][65]byte, error)
}

TSSSigner is the interface for the TSS signer.

type ZetacoreClient

type ZetacoreClient interface {
	ZetacoreWriter

	Chain() chains.Chain

	GetKeys() keys.ObserverKeys

	GetSupportedChains(context.Context) ([]chains.Chain, error)

	GetAdditionalChains(context.Context) ([]chains.Chain, error)

	GetChainParams(context.Context) ([]*observer.ChainParams, error)

	GetForeignCoinsFromAsset(context.Context, ChainID, eth.Address) (fungible.ForeignCoins, error)

	GetKeyGen(context.Context) (observer.Keygen, error)

	GetTSS(context.Context) (observer.TSS, error)
	GetTSSHistory(context.Context) ([]observer.TSS, error)

	GetBlockHeight(context.Context) (int64, error)

	ListPendingCCTX(context.Context, chains.Chain) ([]*crosschain.CrossChainTx, uint64, error)

	ListPendingCCTXWithinRateLimit(context.Context,
	) (*crosschain.QueryListPendingCctxWithinRateLimitResponse, error)

	GetRateLimiterInput(_ context.Context,
		window int64,
	) (*crosschain.QueryRateLimiterInputResponse, error)

	GetPendingNoncesByChain(context.Context, ChainID) (observer.PendingNonces, error)

	GetCctxByNonce(context.Context, ChainID, Nonce) (*crosschain.CrossChainTx, error)

	GetCctxByHash(context.Context, string) (*crosschain.CrossChainTx, error)

	GetBallotByID(context.Context, string) (*observer.QueryBallotByIdentifierResponse, error)

	GetOutboundTracker(context.Context, ChainID, Nonce) (*crosschain.OutboundTracker, error)

	GetOutboundTrackers(context.Context, ChainID) ([]crosschain.OutboundTracker, error)

	GetInboundTrackersForChain(context.Context, ChainID) ([]crosschain.InboundTracker, error)

	GetCrosschainFlags(context.Context) (observer.CrosschainFlags, error)
	GetRateLimiterFlags(context.Context) (crosschain.RateLimiterFlags, error)
	GetOperationalFlags(context.Context) (observer.OperationalFlags, error)

	GetObserverList(context.Context) ([]string, error)

	GetBTCTSSAddress(context.Context, ChainID) (string, error)

	GetZetaHotKeyBalance(context.Context) (cosmosmath.Int, error)

	GetUpgradePlan(context.Context) (*upgrade.Plan, error)

	NewBlockSubscriber(context.Context) (chan cometbft.EventDataNewBlock, error)
}

ZetacoreClient is the client interface that interacts with zetacore.

type ZetacoreWriter

type ZetacoreWriter interface {
	PostVoteGasPrice(_ context.Context,
		_ chains.Chain,
		gasPrice uint64,
		priorityFee uint64,
		blockNum uint64,
	) (string, error)

	PostVoteTSS(_ context.Context,
		tssPubKey string,
		keyGenZetaHeight int64,
		_ chains.ReceiveStatus,
	) (string, error)

	PostVoteBlameData(_ context.Context,
		_ *blame.Blame,
		_ ChainID,
		index string,
	) (string, error)

	PostVoteOutbound(_ context.Context,
		gasLimit uint64,
		retryGasLimit uint64,
		_ *crosschain.MsgVoteOutbound,
	) (string, string, error)

	PostVoteInbound(_ context.Context,
		gasLimit uint64,
		retryGasLimit uint64,
		_ *crosschain.MsgVoteInbound,
	) (string, string, error)

	PostOutboundTracker(_ context.Context,
		_ ChainID,
		_ Nonce,
		txHash string,
	) (string, error)
}

Jump to

Keyboard shortcuts

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