staking

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Networks = map[string]beaconcommon.Version{
	"mainnet":  {0x00, 0x00, 0x00, 0x00},
	"prater":   {0x00, 0x00, 0x10, 0x20},
	"kintsugi": {0x60, 0x00, 0x10, 0x69},
	"kiln":     {0x70, 0x00, 0x00, 0x69},
}

Functions

func GenerateRandomMnemonics

func GenerateRandomMnemonics() (string, error)

func Seed

func Seed(mnemonic, mnemonicPassphrase string) ([]byte, error)

Types

type DepositData

type DepositData struct {
	*beaconcommon.DepositData

	Version beaconcommon.Version
}

func ComputeDepositData

func ComputeDepositData(
	vkey *ValidatorKey,
	withdrawalCredentials beaconcommon.Root,
	amount beaconcommon.Gwei,
	version beaconcommon.Version,
) (*DepositData, error)

func (*DepositData) MarshalJSON

func (data *DepositData) MarshalJSON() ([]byte, error)

type KeystoreManager

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

func NewKeystoreManager

func NewKeystoreManager() *KeystoreManager

func (*KeystoreManager) DecryptFromKeystore

func (mngr *KeystoreManager) DecryptFromKeystore(ks map[string]interface{}, pwd string) (*ValidatorKey, error)

func (*KeystoreManager) EncryptToPbkdf2Keystore

func (mngr *KeystoreManager) EncryptToPbkdf2Keystore(vKey *ValidatorKey, pwd string) (map[string]interface{}, error)

func (*KeystoreManager) EncryptToPrysmKeystore

func (mngr *KeystoreManager) EncryptToPrysmKeystore(vkeys []*ValidatorKey, pwd string) (map[string]interface{}, error)

func (*KeystoreManager) EncryptToScryptKeystore

func (mngr *KeystoreManager) EncryptToScryptKeystore(vKey *ValidatorKey, pwd string) (map[string]interface{}, error)

func (*KeystoreManager) GenerateValidatorKeys

func (mngr *KeystoreManager) GenerateValidatorKeys(mnemonic string, count int, storeMnemo bool, cb func(string) error) (keys []*ValidatorKey, err error)

type ValidatorKey

type ValidatorKey struct {
	UUID string

	PrivKey *e2types.BLSPrivateKey

	Pubkey             string
	MnemonicPassphrase string
	MnemonicPassword   string
	Path               string

	Desc string
}

func GenerateValidatorKey

func GenerateValidatorKey(seed []byte, path, desc string) (*ValidatorKey, error)

func GenerateValidatorKeys

func GenerateValidatorKeys(mnemonicPassphrase, mnemonicPassword string, count int, storeMnemo bool, cb func(string) error) (keys []*ValidatorKey, err error)

func ValidatorKeyFromBytes

func ValidatorKeyFromBytes(privkey []byte) (*ValidatorKey, error)

func ValidatorKeyFromString

func ValidatorKeyFromString(privkey string) (*ValidatorKey, error)

Jump to

Keyboard shortcuts

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