keychain

package
v1.21.41 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Overview

Copyright (C) 2022-2025, Lux Industries, Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMutuallyExlusiveKeySource = errors.New("key source flags --key and --ledger/--ledger-addrs are mutually exclusive")
	// AllowInsecureKeysOnMainnet is a flag that allows use of software keys on mainnet
	// This should only be set to true for testing or if you understand the security risks
	AllowInsecureKeysOnMainnet = false
)

Functions

func WrapCryptoKeychain added in v1.9.4

func WrapCryptoKeychain(cryptoKC keychain.Keychain) wallkeychain.Keychain

WrapCryptoKeychain wraps a crypto keychain to implement wallet keychain interface

func WrapNodeToWalletKeychain added in v1.9.4

func WrapNodeToWalletKeychain(nodeKC nodekeychain.Keychain) walletkeychain.Keychain

WrapNodeToWalletKeychain wraps a node keychain to implement wallet keychain interface

func WrapSecp256k1fxKeychain added in v1.9.4

func WrapSecp256k1fxKeychain(secpKC *secp256k1fx.Keychain) nodekeychain.Keychain

WrapSecp256k1fxKeychain wraps a secp256k1fx keychain to implement node keychain interface

Types

type CryptoToWalletWrapper added in v1.9.4

type CryptoToWalletWrapper struct {
	// contains filtered or unexported fields
}

CryptoToWalletWrapper wraps a crypto keychain to implement wallet keychain interface

func (*CryptoToWalletWrapper) Addresses added in v1.9.4

func (w *CryptoToWalletWrapper) Addresses() set.Set[ids.ShortID]

Addresses returns the addresses managed by this keychain as a set

func (*CryptoToWalletWrapper) Get added in v1.9.4

Get returns the signer for the given address

type Keychain

type Keychain struct {
	Network       models.Network
	Keychain      keychain.Keychain
	Ledger        keychain.Ledger
	UsesLedger    bool
	LedgerIndices []uint32
}

func GetKeychain

func GetKeychain(
	app *application.Lux,
	useLocalKey bool,
	useLedger bool,
	ledgerAddresses []string,
	keyName string,
	network models.Network,
	requiredFunds uint64,
) (*Keychain, error)

func GetKeychainFromCmdLineFlags

func GetKeychainFromCmdLineFlags(
	app *application.Lux,
	keychainGoal string,
	network models.Network,
	keyName string,
	useLocalKey bool,
	useLedger bool,
	ledgerAddresses []string,
	requiredFunds uint64,
) (*Keychain, error)

func NewKeychain

func NewKeychain(network models.Network, keychain keychain.Keychain, ledger keychain.Ledger, ledgerIndices []uint32) *Keychain

func (*Keychain) AddAddresses

func (kc *Keychain) AddAddresses(addresses []string) error

func (*Keychain) Addresses

func (kc *Keychain) Addresses() set.Set[ids.ShortID]

func (*Keychain) HasOnlyOneKey

func (kc *Keychain) HasOnlyOneKey() bool

func (*Keychain) PChainFormattedStrAddresses

func (kc *Keychain) PChainFormattedStrAddresses() ([]string, error)

type NodeToLedgerWrapper added in v1.9.4

type NodeToLedgerWrapper struct {
	// contains filtered or unexported fields
}

NodeToLedgerWrapper wraps a node keychain to implement ledger keychain interface

func WrapNodeKeychain added in v1.9.4

func WrapNodeKeychain(nodeKC nodekeychain.Keychain) *NodeToLedgerWrapper

WrapNodeKeychain wraps a node keychain to implement ledger keychain interface

func (*NodeToLedgerWrapper) Addresses added in v1.9.4

func (w *NodeToLedgerWrapper) Addresses() set.Set[ids.ShortID]

Addresses returns the addresses managed by this keychain as a set

func (*NodeToLedgerWrapper) Get added in v1.9.4

Get returns the signer for the given address

type NodeToWalletWrapper added in v1.9.4

type NodeToWalletWrapper struct {
	// contains filtered or unexported fields
}

NodeToWalletWrapper wraps a node keychain to implement wallet keychain interface

func (*NodeToWalletWrapper) Addresses added in v1.9.4

func (w *NodeToWalletWrapper) Addresses() set.Set[ids.ShortID]

Addresses returns the addresses managed by this keychain as a set

func (*NodeToWalletWrapper) Get added in v1.9.4

Get returns the signer for the given address

type Secp256k1fxToNodeWrapper added in v1.9.4

type Secp256k1fxToNodeWrapper struct {
	// contains filtered or unexported fields
}

Secp256k1fxToNodeWrapper wraps a secp256k1fx keychain to implement node keychain interface

func (*Secp256k1fxToNodeWrapper) Addresses added in v1.9.4

func (w *Secp256k1fxToNodeWrapper) Addresses() set.Set[ids.ShortID]

Addresses returns the addresses managed by this keychain

func (*Secp256k1fxToNodeWrapper) Get added in v1.9.4

Get returns the signer for the given address

Jump to

Keyboard shortcuts

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