stores

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stores

type Stores interface {
	// CreateWallet creates a wallet store
	CreateWallet(_ context.Context, name string, allowedTenants []string, userInfo *auth.UserInfo) error

	// ImportWallets import wallets from the vault into a wallet store
	ImportWallets(ctx context.Context, name string, userInfo *auth.UserInfo) error

	// Wallet get wallets store by name
	Wallet(ctx context.Context, storeName string, userInfo *auth.UserInfo) (WalletStore, error)

	// List stores
	List(ctx context.Context, storeType string, userInfo *auth.UserInfo) ([]string, error)

	// ListAllWallets list all wallets from all stores
	ListAllWallets(ctx context.Context, userInfo *auth.UserInfo) ([]string, error)
}

type WalletStore

type WalletStore interface {
	// Create creates a wallet
	Create(ctx context.Context, id string, attr *entities.Attributes) (*entities.Wallet, error)

	Import(ctx context.Context, id string, privKey []byte, attr *entities.Attributes) (*entities.Wallet, error)

	// Get gets a wallet
	Get(ctx context.Context, pubkey string) (*entities.Wallet, error)

	// List lists all wallet addresses
	List(ctx context.Context, limit, offset uint64) ([]string, error)

	// Update updates wallet attributes
	Update(ctx context.Context, pubkey string, attr *entities.Attributes) (*entities.Wallet, error)

	// Delete deletes an account temporarily, by using Restore the account can be restored
	Delete(ctx context.Context, pubkey string) error

	// GetDeleted Gets a deleted wallets
	GetDeleted(ctx context.Context, pubkey string) (*entities.Wallet, error)

	// ListDeleted lists all deleted wallets
	ListDeleted(ctx context.Context, limit, offset uint64) ([]string, error)

	// Restore restores a previously deleted wallet
	Restore(ctx context.Context, pubkey string) error

	// Destroy destroys (purges) a wallet permanently
	Destroy(ctx context.Context, pubkey string) error

	// Sign signs data using the specified wallet (not exposed in the API)
	Sign(ctx context.Context, pubkey, typeSign string, data []byte) ([]byte, error)
}

Directories

Path Synopsis
api
connectors
store

Jump to

Keyboard shortcuts

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