Documentation ¶
Index ¶
- Constants
- type Account
- type Ed25519Account
- type KeyManager
- func (k *KeyManager) Address(addressType iotago.AddressType, index ...uint32) iotago.DirectUnlockableAddress
- func (k *KeyManager) AddressSigner(indexes ...uint32) iotago.AddressSigner
- func (k *KeyManager) KeyPair(index ...uint32) (ed25519.PrivateKey, ed25519.PublicKey)
- func (k *KeyManager) Mnemonic() bip39.Mnemonic
- func (k *KeyManager) Path(index ...uint32) bip32path.Path
Constants ¶
const ( DefaultIOTAPath = "m/44'/4218'/0'/0'/0'" DefaultShimmerPath = "m/44'/4219'/0'/0'/0'" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account interface { // ID returns the accountID. ID() iotago.AccountID // Address returns the account address. Address() *iotago.AccountAddress // OwnerAddress returns the account owner address. OwnerAddress() iotago.Address // PrivateKey returns the account private key for signing. PrivateKey() ed25519.PrivateKey }
Account represents an account.
type Ed25519Account ¶
type Ed25519Account struct {
// contains filtered or unexported fields
}
Ed25519Account is an account that uses an Ed25519 key pair.
func NewEd25519Account ¶
func NewEd25519Account(accountID iotago.AccountID, privateKey ed25519.PrivateKey) *Ed25519Account
NewEd25519Account creates a new Ed25519Account.
func (*Ed25519Account) Address ¶
func (e *Ed25519Account) Address() *iotago.AccountAddress
func (*Ed25519Account) ID ¶
func (e *Ed25519Account) ID() iotago.AccountID
ID returns the accountID.
func (*Ed25519Account) OwnerAddress ¶
func (e *Ed25519Account) OwnerAddress() iotago.Address
func (*Ed25519Account) PrivateKey ¶
func (e *Ed25519Account) PrivateKey() ed25519.PrivateKey
PrivateKey returns the account private key for signing.
type KeyManager ¶
type KeyManager struct {
// contains filtered or unexported fields
}
KeyManager is a hierarchical deterministic key manager. NOTE: The seed is stored in memory and is not protected against memory dumps.
func NewKeyManager ¶
func NewKeyManager(seed []byte, path string) (*KeyManager, error)
NewKeyManager creates a new key manager.
func NewKeyManagerFromMnemonic ¶
func NewKeyManagerFromMnemonic(mnemonic string, path string) (*KeyManager, error)
NewKeyManagerFromMnemonic creates a new key manager from a mnemonic.
func NewKeyManagerFromRandom ¶
func NewKeyManagerFromRandom(path string) (*KeyManager, error)
NewKeyManagerFromRandom creates a new key manager from random entropy.
func (*KeyManager) Address ¶
func (k *KeyManager) Address(addressType iotago.AddressType, index ...uint32) iotago.DirectUnlockableAddress
Address calculates an address of the specified type.
func (*KeyManager) AddressSigner ¶
func (k *KeyManager) AddressSigner(indexes ...uint32) iotago.AddressSigner
AddressSigner returns an address signer.
func (*KeyManager) KeyPair ¶
func (k *KeyManager) KeyPair(index ...uint32) (ed25519.PrivateKey, ed25519.PublicKey)
KeyPair calculates an ed25519 key pair by using slip10.
func (*KeyManager) Mnemonic ¶
func (k *KeyManager) Mnemonic() bip39.Mnemonic
Mnemonic returns the mnemonic of the key manager.