keychain

package
v1.16.16 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Overview

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

Copyright (C) 2024, 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, --ewoq, --ledger/--ledger-addrs are mutually exclusive")
	ErrEwoqKeyOnTestnetOrMainnet = errors.New("key source ewoq is not available for mainnet/testnet operations")
)

Functions

func WrapNodeKeychain added in v1.9.4

func WrapNodeKeychain(nodeKC nodekeychain.Keychain) ledgerkeychain.Keychain

WrapNodeKeychain wraps a node keychain to implement ledger 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 Keychain

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

func GetKeychain

func GetKeychain(
	app *application.Lux,
	useEwoq 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,
	useEwoq 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 (*NodeToLedgerWrapper) Addresses added in v1.9.4

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

Addresses returns the addresses managed by this keychain as a slice

func (*NodeToLedgerWrapper) 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 as a set

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