sporkins

package module
v0.0.0-...-bcc62cc Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RvnMainNetParams = chaincfg.Params{
	PubKeyHashAddrID: 0x3c,
	HDPrivateKeyID:   [4]byte{0x04, 0x88, 0xad, 0xe4},
	HDPublicKeyID:    [4]byte{0x04, 0x88, 0xb2, 0x1e},
	HDCoinType:       175,
}

RvnMainNetParams rvn mainnet params

Functions

func JSON

func JSON(k interface{}) []byte

JSON convert to JSON

func NetworkParams

func NetworkParams(coin int) *chaincfg.Params

NetworkParams get network params

Types

type Account

type Account struct {
	Mnemonic   string
	Seed       []byte
	MasterKey  *hdkeychain.ExtendedKey
	AccountKey *hdkeychain.ExtendedKey
	Coin       uint32
	Account    uint32
	Net        *chaincfg.Params
}

Account account

func Generate

func Generate(password string, account int, coin int) Account

Generate generate account with random mnemonic for account and coin

func GenerateFromMnemonic

func GenerateFromMnemonic(password string, mnemonicInput string, account int, coin int) Account

GenerateFromMnemonic generate account from mnenomicInput for account and coin

func (Account) AccountJSON

func (a Account) AccountJSON() AccountJSON

AccountJSON convert to JSON

func (Account) AccountPK

func (a Account) AccountPK() string

AccountPK return the account extended public key

func (Account) AccountSK

func (a Account) AccountSK() string

AccountSK return the account extended private key

func (Account) Derive

func (a Account) Derive(change uint32, index uint32) DerivedKey

Derive derive change/index path

func (Account) PrintDerived

func (a Account) PrintDerived(change uint32, count int)

PrintDerived derive accounts

type AccountJSON

type AccountJSON struct {
	Mnemonic  string `json:"mnemonic"`
	Seed      string `json:"seed"`
	RootSK    string `json:"rootsk"`
	AccountSK string `json:"accountsk"`
	AccountPK string `json:"accountpk"`
}

AccountJSON json of data

type DerivedKey

type DerivedKey struct {
	Account Account
	Change  uint32
	Index   uint32
	Address string
	Derived *hdkeychain.ExtendedKey
}

DerivedKey derived key

Directories

Path Synopsis
cmd
hdw

Jump to

Keyboard shortcuts

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