contract

package
v0.0.0-...-92ca402 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxWaitError = &tracer.Error{
	Kind: "MaxWaitError",
	Desc: "The maximum amount of time to wait passed, returning this error.",
}
View Source
var TransactionFailedError = &tracer.Error{
	Kind: "TransactionFailedError",
	Desc: "The transaction was mined, but failed with a status code other than 1, which implies that the transaction reverted.",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	// Key is the private key signing transactions for contract writes.
	Key string
	// Log is a simple logger interface to print system relevant information.
	Log logger.Interface
	// RPC is the RPC endpoint for network connection.
	RPC string
}

type Contract

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

func New

func New(c Config) *Contract

func (*Contract) Claims

func (c *Contract) Claims(add string) claimscontract.Interface

func (*Contract) Client

func (c *Contract) Client() *ethclient.Client

func (*Contract) UVX

func (c *Contract) UVX(add string) uvxcontract.Interface

func (*Contract) Wait

func (c *Contract) Wait(txn *types.Transaction, max time.Duration) error

type Interface

type Interface interface {
	// UVX returns a Claims contract interface for the given address and the
	// underlying RPC configured.
	Claims(string) claimscontract.Interface

	// Client is the underlying go-ethereum client interacting with the configured
	// RPC.
	Client() *ethclient.Client

	// UVX returns a UVX contract interface for the given address and the
	// underlying RPC configured.
	UVX(string) uvxcontract.Interface

	// Wait allows the caller to wait for the given transaction to be mined
	// onchain, but only for the maximum amount of time provided. Should the
	// provided transaction not be mined successfully within "max", then Wait will
	// return MaxWaitError. Should the provided transaction fail in time, then
	// TransactionFailedError is returned.
	Wait(txn *types.Transaction, max time.Duration) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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