utils

package
v0.0.0-...-d73ec67 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bip39SuggestWords

func Bip39SuggestWords(v string) []string

func Eth2Wei

func Eth2Wei(eth *big.Float) *big.Int

Eth to Wei converts the provided number of eth to wei.

func GWei2Eth

func GWei2Eth(gwei *big.Float) *big.Float

GWei2Eth converts the provided number of gwei's to Eth

func GWei2Wei

func GWei2Wei(gwei *big.Float) *big.Int

GWei2Wei converts a value from Gwei to Wei.

gwei *big.Float *big.Int

func MustParseDerivationPath

func MustParseDerivationPath(path string) accounts.DerivationPath

MustParseDerivationPath parses the derivation path in string format into []uint32 but will panic if it can't parse it.

func NewEntropy

func NewEntropy(bits int) ([]byte, error)

NewEntropy returns a randomly generated entropy.

func NewMnemonic

func NewMnemonic(bits int) (string, error)

NewMnemonic returns a randomly generated BIP-39 mnemonic using 128-256 bits of entropy. bitSize has to be a multiple 32 and be within the inclusive range of {128, 256}

func NewMnemonicFromEntropy

func NewMnemonicFromEntropy(entropy []byte) (string, error)

NewMnemonicFromEntropy returns a BIP-39 menomonic from entropy.

func NewSeed

func NewSeed() ([]byte, error)

NewSeed returns a randomly generated BIP-39 seed.

func NewSeedFromMnemonic

func NewSeedFromMnemonic(mnemonic string, passOpt ...string) ([]byte, error)

NewSeedFromMnemonic returns a BIP-39 seed based on a BIP-39 mnemonic.

func ParseDerivationPath

func ParseDerivationPath(path string) (accounts.DerivationPath, error)

ParseDerivationPath parses the derivation path in string format into []uint32.

func Wei2Eth

func Wei2Eth(wei *big.Int) *big.Float

Wei2Eth converts the provided number of wei's to Eth

func Wei2GWei

func Wei2GWei(wei *big.Int) *big.Float

Types

This section is empty.

Jump to

Keyboard shortcuts

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