Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultNodeKeyPath = "m/44'/60'/0'/0/%d" LedgerLiveNodeKeyPath = "m/44'/60'/%d/0/0" MyEtherWalletNodeKeyPath = "m/44'/60'/0'/%d" )
Variables ¶
This section is empty.
Functions ¶
func GetDerivationPath ¶ added in v0.3.0
func GetDerivationPath(pathType DerivationPath) (string, error)
Convert a derivation path type to an actual path value
func IsWalletReady ¶
func IsWalletReady(status WalletStatus) bool
Check if the node wallet is ready for transacting
Types ¶
type DerivationPath ¶
type DerivationPath string
const ( DerivationPath_Default DerivationPath = "" DerivationPath_LedgerLive DerivationPath = "ledger-live" DerivationPath_Mew DerivationPath = "mew" )
type LocalWalletData ¶
type LocalWalletData struct {
// Encrypted seed information
Crypto map[string]any `json:"crypto"`
// Name of the encryptor used to generate the keystore
Name string `json:"name"`
// Version of the encryptor used to generate the keystore
Version uint `json:"version"`
// Unique ID for this keystore
UUID uuid.UUID `json:"uuid"`
// The path that should be used to derive the target key; assumes there's only one index that can be iterated on
DerivationPath string `json:"derivationPath,omitempty"`
// The index of the target wallet, used to format DerivationPath
WalletIndex uint `json:"walletIndex,omitempty"`
}
Keystore for local node wallets - note that this is NOT an EIP-2335 keystore.
type WalletData ¶
type WalletData struct {
// The type of wallet
Type WalletType `json:"type"`
// Data about a local wallet
LocalData LocalWalletData `json:"localData"`
// Data about a hardware wallet
HardwareData HardwareWalletData `json:"hardwareData"`
}
Data storage for node wallets
type WalletStatus ¶
type WalletStatus struct {
Address struct {
NodeAddress common.Address `json:"nodeAddress"`
HasAddress bool `json:"hasAddress"`
} `json:"address"`
Wallet struct {
Type WalletType `json:"type"`
IsLoaded bool `json:"isLoaded"`
IsOnDisk bool `json:"isOnDisk"`
WalletAddress common.Address `json:"walletAddress"`
} `json:"wallet"`
Password struct {
IsPasswordSaved bool `json:"isPasswordSaved"`
} `json:"password"`
}
type WalletType ¶
type WalletType string
An enum describing the type of wallet used by the node
const ( // Unset wallet type WalletType_Unknown WalletType = "" // Indicator for local wallets that have encrypted keystores saved to disk WalletType_Local WalletType = "local" // Indicator for hardware wallets that store the private key offline WalletType_Hardware WalletType = "hardware" )
Click to show internal directories.
Click to hide internal directories.