wallet

package
v0.0.0-...-d70dd78 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewWalletAndKeystore

func CreateNewWalletAndKeystore(filepath string, password string)

Public function that creates and saves a new wallet as a keystore file to filepath.

func LoadWallet

func LoadWallet(filepath string, password string) (module.Wallet, error)

Public function that loads a wallet from a keystore file.

func ReadAddressFromKeyStore

func ReadAddressFromKeyStore(data []byte) (module.Address, error)

returns the public key of the keystore file

func SHA3SumKeccak256

func SHA3SumKeccak256(data ...[]byte) []byte

Types

type AES128CTRParams

type AES128CTRParams struct {
	IV common.RawHexBytes `json:"iv"`
}

type CryptoData

type CryptoData struct {
	Cipher       string             `json:"cipher"`
	CipherParams json.RawMessage    `json:"cipherparams"`
	CipherText   common.RawHexBytes `json:"ciphertext"`
	KDF          string             `json:"kdf"`
	KDFParams    json.RawMessage    `json:"kdfparams"`
	MAC          common.RawHexBytes `json:"mac"`
}

type KeyStoreData

type KeyStoreData struct {
	Address  common.Address `json:"address"`
	ID       string         `json:"id"`
	Version  int            `json:"version"`
	CoinType string         `json:"coinType"`
	Crypto   CryptoData     `json:"crypto"`
}

type ScryptParams

type ScryptParams struct {
	DKLen int                `json:"dklen"`
	N     int                `json:"n"`
	R     int                `json:"r"`
	P     int                `json:"p"`
	Salt  common.RawHexBytes `json:"salt"`
}

func (*ScryptParams) Init

func (p *ScryptParams) Init() error

func (*ScryptParams) Key

func (p *ScryptParams) Key(pw []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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