Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TestKeyringPairAlice = KeyringPair{ URI: "//Alice", PublicKey: []byte{0xd4, 0x35, 0x93, 0xc7, 0x15, 0xfd, 0xd3, 0x1c, 0x61, 0x14, 0x1a, 0xbd, 0x4, 0xa9, 0x9f, 0xd6, 0x82, 0x2c, 0x85, 0x58, 0x85, 0x4c, 0xcd, 0xe3, 0x9a, 0x56, 0x84, 0xe7, 0xa5, 0x6d, 0xa2, 0x7d}, Address: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", }
Functions ¶
Types ¶
type InspectKeyInfo ¶ added in v1.0.1
type InspectKeyInfo struct { AccountID string `json:"accountId"` PublicKey string `json:"publicKey"` SecretPhrase string `json:"secretPhrase"` SecretSeed string `json:"secretSeed"` SS58Address string `json:"ss58Address"` }
InspectKeyInfo type is used as target from `subkey` inspect JSON output
type KeyringPair ¶
type KeyringPair struct { // URI is the derivation path for the private key in subkey URI string // Address is an SS58 address Address string // PublicKey PublicKey []byte }
func KeyringPairFromSecret ¶
func KeyringPairFromSecret(seedOrPhrase, network string) (KeyringPair, error)
KeyringPairFromSecret creates KeyPair based on seed/phrase and network Leave network empty for default behavior
func LoadKeyringPairFromEnv ¶
func LoadKeyringPairFromEnv() (kp KeyringPair, ok bool)
LoadKeyringPairFromEnv looks up whether the env variable TEST_PRIV_KEY is set and is not empty and tries to use its content as a private phrase, seed or URI to derive a key ring pair. Panics if the private phrase, seed or URI is not valid or the keyring pair cannot be derived Loads Network from TEST_NETWORK variable Leave TEST_NETWORK empty or unset for default
Click to show internal directories.
Click to hide internal directories.