framework

package
v0.0.0-...-bf73579 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GatewayAddr

func GatewayAddr() string

GatewayAddr returns the IP address of the Docker gateway. This is, the IP address to access the host machine.

Types

type Artifact

type Artifact struct {
	Abi *abi.ABI

	// Code is the code to deploy the contract
	Code []byte
}

func ReadArtifact

func ReadArtifact(path string) (*Artifact, error)

type Chain

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

func (*Chain) DeployContract

func (c *Chain) DeployContract(path string) *Contract

func (*Chain) FundAccount

func (c *Chain) FundAccount(to common.Address, value *big.Int) error

func (*Chain) RPC

func (c *Chain) RPC() *ethclient.Client

func (*Chain) SignTx

func (c *Chain) SignTx(priv *PrivKey, tx *types.LegacyTx) (*types.Transaction, error)

type Config

type Config struct {
	KettleRPC string `env:"KETTLE_RPC, default=http://localhost:8545"`

	// This account is funded in your local SUAVE devnet
	// address: 0xBE69d72ca5f88aCba033a063dF5DBe43a4148De0
	FundedAccount *PrivKey `env:"KETTLE_PRIVKEY, default=91ab9a7e53c220e6210460b65a7a3bb2ca181412a8a7b43ff336b3df1737ce12"`

	L1RPC string `env:"L1_RPC, default=http://localhost:8555"`

	// This account is funded in your local L1 devnet
	// address: 0xB5fEAfbDD752ad52Afb7e1bD2E40432A485bBB7F
	FundedAccountL1 *PrivKey `env:"L1_PRIVKEY, default=6c45335a22461ccdb978b78ab61b238bad2fae4544fb55c14eb096c875ccfc52"`

	// Whether to enable L1 or not
	L1Enabled bool
}

type ConfigOption

type ConfigOption func(c *Config)

func WithL1

func WithL1() ConfigOption

type Contract

type Contract struct {
	Abi *abi.ABI
	// contains filtered or unexported fields
}

func (*Contract) Call

func (c *Contract) Call(methodName string, args []interface{}) []interface{}

func (*Contract) Raw

func (c *Contract) Raw() *sdk.Contract

func (*Contract) Ref

func (c *Contract) Ref(acct *PrivKey) *Contract

func (*Contract) SendConfidentialRequest

func (c *Contract) SendConfidentialRequest(method string, args []interface{}, confidentialBytes []byte) *types.Receipt

SendConfidentialRequest sends the confidential request to the kettle

type Framework

type Framework struct {
	KettleAddress common.Address

	Suave *Chain
	L1    *Chain
	// contains filtered or unexported fields
}

func New

func New(opts ...ConfigOption) *Framework

type PrivKey

type PrivKey struct {
	Priv *ecdsa.PrivateKey
}

func GeneratePrivKey

func GeneratePrivKey() *PrivKey

func NewPrivKeyFromHex

func NewPrivKeyFromHex(hex string) *PrivKey

func (*PrivKey) Address

func (p *PrivKey) Address() common.Address

func (*PrivKey) MarshalPrivKey

func (p *PrivKey) MarshalPrivKey() []byte

func (*PrivKey) UnmarshalText

func (p *PrivKey) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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