Documentation
¶
Index ¶
Constants ¶
View Source
const ( PriKeyType = byte(0x0) // Serialize wallet account key into string with only PRIVATE KEY of account keyset PaymentAddressType = byte(0x1) // Serialize wallet account key into string with only PAYMENT ADDRESS of account keyset ReadonlyKeyType = byte(0x2) // Serialize wallet account key into string with only READONLY KEY of account keyset )
Variables ¶
This section is empty.
Functions ¶
func CreateImportMasterAccount ¶
func CreateImportMasterAccount(mnemonic, passPhrase string) (*Wallet, *KeySerializedData, error)
func NewWordList ¶
Types ¶
type AccountWallet ¶
type AccountWallet struct { Name string Key KeyWallet Child []AccountWallet IsImported bool }
func CreateNewAccount ¶
func CreateNewAccount() (*AccountWallet, error)
func CreateNewAccountByShardId ¶
func CreateNewAccountByShardId(shardId int) (*AccountWallet, error)
func ImportAccount ¶
func ImportAccount(privateKeyStr string, accountName string) (*AccountWallet, error)
type KeySerializedData ¶
type KeySerializedData struct { PrivateKey string `json:"PrivateKey"` PaymentAddress string `json:"PaymentAddress"` Pubkey string `json:"Pubkey"` // in hex encode string ReadonlyKey string `json:"ReadonlyKey"` ValidatorKey string `json:"ValidatorKey"` // in base58check encode string ShardId int `json:"ShardId"` }
type KeyWallet ¶
type KeyWallet struct { Depth byte // 1 bytes ChildNumber []byte // 4 bytes ChainCode []byte // 32 bytes KeySet incognitokey.KeySet }
KeyWallet represents with bip32 standard
func Base58CheckDeserialize ¶
Base58CheckDeserialize deserializes a KeySet encoded in base58 encoding because data contains keyType and serialized data of corresponding key it returns KeySet just contain corresponding key
func NewMasterKey ¶
NewMasterKey creates a new master extended PubKey from a Seed Seed is a bytes array which any size
func (*KeyWallet) Base58CheckSerialize ¶
Base58CheckSerialize encodes the key corresponding to keyType in KeySet in the standard Incognito base58 encoding It returns the encoding string of the key
func (*KeyWallet) NewChildKey ¶
NewChildKey derives a Child KeyWallet from a given parent as outlined by bip32 2 child keys is derived from one key and a same child index are the same
type MnemonicGenerator ¶
type MnemonicGenerator struct{}
Click to show internal directories.
Click to hide internal directories.