Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account interface { // Address returns the address of the account based on the coin type Address() string // CoinType returns the coin type of the account CoinType() crypto.CoinType // DID returns the DID of the account DID() string ListKeyshares() ([]KeyShare, error) // Name returns the name of the account Name() string // Path returns the path of the account Path() string // PartyIDs returns the party IDs of the account PartyIDs() []crypto.PartyID // PubKey returns secp256k1 public key PubKey() *crypto.PubKey // Rename renames the account Rename(name string) error // Signs a message Sign(bz []byte) ([]byte, error) // Type returns the type of the account Type() string // Verifies a signature Verify(bz []byte, sig []byte) (bool, error) }
Account is an interface for an account in the wallet
func NewWalletAccount ¶ added in v0.4.3
NewWalletAccount loads an accound directory and returns a WalletAccount
type FileStore ¶ added in v0.4.3
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶ added in v0.4.3
func (*FileStore) ListAccounts ¶ added in v0.4.3
GetAccountNames returns a list of all account names for each supported coin in the BIP32 file system.
func (*FileStore) ListAccountsForToken ¶ added in v0.4.3
ListAccountNames returns a list of all account names in the BIP32 file system.
type KeyShare ¶ added in v0.4.3
type KeyShare interface { string Config() *cmp.Config CoinType() crypto.CoinType AccountName() string }Path()
KeyShare is a type that interacts with a cmp.Config file located on disk.
func NewKeyshare ¶ added in v0.4.3
NewKeyshare creates a new KeyShare.
type Wallet ¶ added in v0.4.3
type Wallet interface { // Get the wallet's controller Controller() string // CreateAccount creates a new account for the given coin type CreateAccount(coin crypto.CoinType) (Account, error) // ListAllocatedCoins returns a list of coins that this currently has accounts for ListCoins() ([]crypto.CoinType, error) // ListAccounts returns a list of accounts for the given coin type ListAccounts() (map[crypto.CoinType][]Account, error) // ListAccountsForCoin returns a list of accounts for the given coin type ListAccountsForCoin(coin crypto.CoinType) ([]Account, error) // GetAccount returns the account for the given coin type and account name GetAccount(coin crypto.CoinType, name string) (Account, error) // GetAccountByAddress returns the account for the given address and parses the coin type from the address GetAccountByAddress(address string) (Account, error) // GetAccountByDID returns the account for the given DID and parses the coin type from the DID GetAccountByDID(did string) (Account, error) // GetAccountByPublicKey returns the account for the given public key and parses the coin type from the public key GetAccountByPublicKey(key string) (Account, error) }
Click to show internal directories.
Click to hide internal directories.