app

package
v0.0.0-...-22cf739 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 11 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 {
	Port                 int      `mapstructure:"port"`
	RPCURL               string   `mapstructure:"rpcURL"`
	Ticker               string   `mapstructure:"ticker"`
	TokenAddress         string   `mapstructure:"tokenAddress"`
	TokenMintBlockNumber uint64   `mapstructure:"tokenMintBlockNumber"`
	ExcludedAddresses    []string `mapstructure:"excludedAddresses"`
	SDLPool              string   `mapstructure:"sdlPool"`
	VestingAddresses     []string `mapstructure:"vestingAddresses"`
}

Config object

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig returns the initialised config from file

type TokenSupply

type TokenSupply struct {
	ETHClient *ethclient.Client
	Config    *Config
	ERC20     *abi.ERC20

	Uncirculating []Uncirculating
	// contains filtered or unexported fields
}

TokenSupply represents application memory state

func NewTokenSupply

func NewTokenSupply(configPath string, uncirculating ...Uncirculating) (*TokenSupply, error)

NewTokenSupply returns a new instance of the app

func (*TokenSupply) CirculatingSupply

func (t *TokenSupply) CirculatingSupply() *big.Float

CirculatingSupply returns the circulating supply of the token

func (*TokenSupply) Start

func (t *TokenSupply) Start() error

Start will start the app refreshing token supply

func (*TokenSupply) Stop

func (t *TokenSupply) Stop()

Stop will stop the app refreshing

func (*TokenSupply) TotalSupply

func (t *TokenSupply) TotalSupply() *big.Float

TotalSupply returns the total supply of the token

type Uncirculating

type Uncirculating interface {
	Init(t *TokenSupply) error
	Uncirculating() (*big.Int, error)
}

Uncirculating is an interface for plugins that exclude tokens to calculate circulating supply

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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