vault

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificationStorage

type CertificationStorage struct {
	*tokendb.StoreService
}

CertificationStorage manages token certifications in the database.

func (*CertificationStorage) Exists

func (t *CertificationStorage) Exists(ctx context.Context, id *token.ID) bool

Exists checks if a certification exists for the given token ID.

func (*CertificationStorage) Store

func (t *CertificationStorage) Store(ctx context.Context, certifications map[*token.ID][]byte) error

Store saves certifications for multiple tokens.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider creates and caches vault instances for TMS identifiers. It manages access to token, transaction, and audit storage services.

func NewVaultProvider

func NewVaultProvider(
	tokenStoreServiceManager tokendb.StoreServiceManager,
	ttxStoreServiceManager ttxdb.StoreServiceManager,
	auditStoreServiceManager auditdb.StoreServiceManager,
) *Provider

NewVaultProvider creates a vault provider with the given storage managers.

func (*Provider) Vault

func (v *Provider) Vault(network string, channel string, namespace string) (driver.Vault, error)

Vault returns a cached or newly created vault for the given TMS coordinates. It uses double-checked locking to ensure thread-safe cache access.

type PublicParamsStorage

type PublicParamsStorage struct {
	Provider *Provider
}

PublicParamsStorage retrieves public parameters from vault storage.

func (*PublicParamsStorage) PublicParams

func (p *PublicParamsStorage) PublicParams(ctx context.Context, networkID string, channel string, namespace string) ([]byte, error)

PublicParams returns the serialized public parameters for the given TMS coordinates.

type QueryEngine

type QueryEngine struct {
	*tokendb.StoreService
	// contains filtered or unexported fields
}

QueryEngine provides query operations across token, audit, and transaction databases.

func (*QueryEngine) GetStatus

func (q *QueryEngine) GetStatus(ctx context.Context, txID string) (driver.TxStatus, string, error)

GetStatus returns the transaction status, checking ttx database first, then audit database.

func (*QueryEngine) IsMine

func (q *QueryEngine) IsMine(ctx context.Context, id *token.ID) (bool, error)

IsMine checks if the token belongs to the current wallet.

func (*QueryEngine) IsPending

func (q *QueryEngine) IsPending(ctx context.Context, id *token.ID) (bool, error)

IsPending checks if the token's transaction is in pending status.

type Vault

type Vault struct {
	// contains filtered or unexported fields
}

Vault provides access to token storage, query engine, and certification storage.

func NewVault

func NewVault(tmsID token2.TMSID, auditdb *auditdb.StoreService, ttxdb *ttxdb.StoreService, tokenDB *tokendb.StoreService) (*Vault, error)

NewVault creates a vault with the given TMS ID and storage services.

func (*Vault) CertificationStorage

func (v *Vault) CertificationStorage() driver.CertificationStorage

CertificationStorage returns the vault's certification storage.

func (*Vault) DeleteTokens

func (v *Vault) DeleteTokens(ctx context.Context, ids ...*token.ID) error

DeleteTokens removes the specified tokens from storage.

func (*Vault) QueryEngine

func (v *Vault) QueryEngine() driver.QueryEngine

QueryEngine returns the vault's query engine for token and transaction queries.

Jump to

Keyboard shortcuts

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