config

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Provider Provider `json:"provider"`
	Signer   Signer   `json:"signer"`
}

func FromData

func FromData(data []byte) (Config, error)

func FromEnv

func FromEnv() Config

func FromFile

func FromFile(filePath string) (Config, error)

Function to load and parse the JSON file

func (*Config) Check

func (c *Config) Check() error

Verifies its data is appropiatly set

func (*Config) Fill

func (c *Config) Fill(other *Config)

Fills its missing fields with data from other config

type ContractAddresses

type ContractAddresses struct {
	Staking string
	Attest  string
}

func (*ContractAddresses) Check

func (ca *ContractAddresses) Check() error

func (*ContractAddresses) SetDefaults

func (ca *ContractAddresses) SetDefaults(chainIDStr string) *ContractAddresses

func (*ContractAddresses) String

func (ca *ContractAddresses) String() string

type Provider

type Provider struct {
	Http string `json:"http"`
	Ws   string `json:"ws"`
}

func ProviderFromEnv

func ProviderFromEnv() Provider

func (*Provider) Check

func (p *Provider) Check() error

func (*Provider) Fill

func (p *Provider) Fill(other *Provider)

Merge its missing fields with data from other provider

type Signer

type Signer struct {
	ExternalURL        string `json:"url"`
	PrivKey            string `json:"privateKey"`
	OperationalAddress string `json:"operationalAddress"`
}

func SignerFromEnv

func SignerFromEnv() Signer

func (*Signer) Check

func (s *Signer) Check() error

func (*Signer) External

func (s *Signer) External() bool

func (*Signer) Fill

func (s *Signer) Fill(other *Signer)

Merge its missing fields with data from other signer

type StarknetConfig

type StarknetConfig struct {
	ContractAddresses ContractAddresses
	AttestOptions     string
}

func (*StarknetConfig) Check

func (c *StarknetConfig) Check() error

func (*StarknetConfig) SetDefaults

func (c *StarknetConfig) SetDefaults(chainID string) *StarknetConfig

Jump to

Keyboard shortcuts

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