account

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WalletAccount

type WalletAccount interface {
	// The account configuration
	AccountConfig() *v1.AccountConfig

	// Bip32Derive derives a new account from a BIP32 path
	Bip32Derive(accName string, idx uint32, addrPrefix string, network string) (WalletAccount, error)

	// GetAssertionMethod returns the verification method for the account
	GetAssertionMethod() *types.VerificationMethod

	// Info returns the account information
	Info() *v1.AccountInfo

	// IsPrimary returns true if the account is the primary account
	IsPrimary() bool

	// ListConfigs returns the list of all the configurations that are needed to
	// sign a transaction.
	ListConfigs() ([]*cmp.Config, error)

	// PubKey returns secp256k1 public key
	PubKey() (*secp256k1.PubKey, error)

	// Signs a transaction
	Sign(bz []byte) ([]byte, error)

	// Verifies a signature
	Verify(bz []byte, sig []byte) (bool, error)
}

`WalletAccount` is an interface that defines the methods that a wallet account must implement. @property AccountConfig - The account configuration @property Bip32Derive - This is a method that derives a new account from a BIP32 path. @property GetAssertionMethod - returns the verification method for the account. @property {bool} IsPrimary - returns true if the account is the primary account @property ListConfigs - This is a list of all the configurations that are needed to sign a transaction. @property Sign - This is the function that signs a transaction. @property Verify - Verifies a signature

func NewAccount

func NewAccount(accName string, addrPrefix string, networkName string) (WalletAccount, error)

It creates a new account with the given name, address prefix, and network name

func NewAccountFromConfig

func NewAccountFromConfig(accConf *v1.AccountConfig) (WalletAccount, error)

> This function creates a new wallet account from the given account configuration

Directories

Path Synopsis
internal
mpc

Jump to

Keyboard shortcuts

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