provider

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainProvider

type ChainProvider interface {
	ChainQuery
	NID() string
	Name() string
	Init(context.Context, string, kms.KMS) error
	Type() string
	Config() Config
	Listener(ctx context.Context, lastSavedHeight uint64, blockInfo chan *types.BlockInfo) error
	Route(ctx context.Context, message *types.Message, callback types.TxResponseFunc) error
	ShouldReceiveMessage(ctx context.Context, message *types.Message) (bool, error)
	ShouldSendMessage(ctx context.Context, message *types.Message) (bool, error)
	MessageReceived(ctx context.Context, key *types.MessageKey) (bool, error)
	SetAdmin(context.Context, string) error

	FinalityBlock(ctx context.Context) uint64
	GenerateMessages(ctx context.Context, messageKey *types.MessageKeyWithMessageHeight) ([]*types.Message, error)
	QueryBalance(ctx context.Context, addr string) (*types.Coin, error)

	NewKeystore(string) (string, error)
	RestoreKeystore(context.Context) error
	ImportKeystore(context.Context, string, string) (string, error)
	RevertMessage(context.Context, *big.Int) error
	GetFee(context.Context, string, bool) (uint64, error)
	SetFee(context.Context, string, uint64, uint64) error
	ClaimFee(context.Context) error
}

type ChainQuery

type ChainQuery interface {
	QueryLatestHeight(ctx context.Context) (uint64, error)
	QueryTransactionReceipt(ctx context.Context, txHash string) (*types.Receipt, error)
}

type Config added in v1.1.0

type Config interface {
	NewProvider(context.Context, *zap.Logger, string, bool, string) (ChainProvider, error)
	SetWallet(string)
	GetWallet() string
	Validate() error
}

Jump to

Keyboard shortcuts

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