types

package
v0.76.8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsMainUint added in v0.76.8

func AsMainUint(value *big.Int, decimals uint64) *big.Float

func FloatAsSubUnit added in v0.76.8

func FloatAsSubUnit(amount *big.Float, decimals uint64) *big.Int

func IntAsSubUnit added in v0.76.8

func IntAsSubUnit(amount *big.Int, decimal uint64) *big.Int

IntAsSubUnit return an asset's amount padded with the decimals. Given "12" with a decimal place of 2, it returns "1200".

Types

type Amount added in v0.76.8

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

Amount wraps an amount of a given asset to easily switch between main and sub-unit representation.

func NewAmount added in v0.76.8

func NewAmount(decimals uint64) *Amount

func NewAmountFromMainUnit added in v0.76.8

func NewAmountFromMainUnit(value *big.Float, decimals uint64) *Amount

func NewAmountFromSubUnit added in v0.76.8

func NewAmountFromSubUnit(value *big.Int, decimals uint64) *Amount

func ParseAmountFromSubUnit added in v0.76.8

func ParseAmountFromSubUnit(value string, decimals uint64) *Amount

func (*Amount) Add added in v0.76.8

func (a *Amount) Add(toAdd *big.Float)

func (*Amount) AsMainUnit added in v0.76.8

func (a *Amount) AsMainUnit() *big.Float

func (*Amount) AsSubUnit added in v0.76.8

func (a *Amount) AsSubUnit() *big.Int

func (*Amount) Cmp added in v0.76.8

func (a *Amount) Cmp(other *Amount) int

func (*Amount) Copy added in v0.76.8

func (a *Amount) Copy() *Amount

func (*Amount) Mul added in v0.76.8

func (a *Amount) Mul(toMul *big.Float)

func (*Amount) String added in v0.76.8

func (a *Amount) String() string

func (*Amount) StringWithDecimals added in v0.76.8

func (a *Amount) StringWithDecimals() string

func (*Amount) Sub added in v0.76.8

func (a *Amount) Sub(toSub *big.Float)

type NetworkParams

type NetworkParams struct {
	Params map[string]string
}

func NewNetworkParams

func NewNetworkParams(params map[string]string) *NetworkParams

func (*NetworkParams) EVMChainConfig added in v0.76.8

func (p *NetworkParams) EVMChainConfig() (*vega.EVMBridgeConfigs, error)

func (*NetworkParams) GetEthereumL2Configs added in v0.74.10

func (p *NetworkParams) GetEthereumL2Configs() (*vega.EthereumL2Configs, error)

func (*NetworkParams) GetMaxTransfersPerEpoch added in v0.76.8

func (p *NetworkParams) GetMaxTransfersPerEpoch() int64

func (*NetworkParams) GetMinFundsForApplyReferral added in v0.76.8

func (p *NetworkParams) GetMinFundsForApplyReferral() int64

func (*NetworkParams) GetMinimumEthereumEventsForNewValidator

func (p *NetworkParams) GetMinimumEthereumEventsForNewValidator() (int, error)

func (*NetworkParams) GetMinimumValidatorStake

func (p *NetworkParams) GetMinimumValidatorStake() (*Amount, error)

func (*NetworkParams) PrimaryEthereumConfig added in v0.76.8

func (p *NetworkParams) PrimaryEthereumConfig() (*vega.EthereumConfig, error)

Jump to

Keyboard shortcuts

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