Versions in this module Expand all Collapse all v0 v0.4.0 Jan 7, 2025 Changes in this version + const Confirmed + const Deleted + const Pending + const Unknown + var ErrTokenDoesNotExist = errors.New("token does not exist") + var ErrTokenRequestDoesNotExist = errors.New("token request does not exist") + var TxStatusMessage = map[TxStatus]string + type ActionType int + const Issue + const Redeem + const Transfer + type AtomicWrite interface + AddMovement func(record *MovementRecord) error + AddTokenRequest func(txID string, tr []byte, applicationMetadata map[string][]byte, ...) error + AddTransaction func(record *TransactionRecord) error + AddValidationRecord func(txID string, meta map[string][]byte) error + Commit func() error + Rollback func() + type AuditDBDriver interface + Open func(cp ConfigProvider, tmsID token.TMSID) (AuditTransactionDB, error) + type AuditTransactionDB interface + BeginAtomicWrite func() (AtomicWrite, error) + Close func() error + GetStatus func(txID string) (TxStatus, string, error) + GetTokenRequest func(txID string) ([]byte, error) + QueryMovements func(params QueryMovementsParams) ([]*MovementRecord, error) + QueryTokenRequests func(params QueryTokenRequestsParams) (TokenRequestIterator, error) + QueryTransactions func(params QueryTransactionsParams) (TransactionIterator, error) + QueryValidations func(params QueryValidationRecordsParams) (ValidationRecordsIterator, error) + SetStatus func(ctx context.Context, txID string, status TxStatus, message string) error + type CertificationDB interface + ExistsCertification func(id *token.ID) bool + GetCertifications func(ids []*token.ID) ([][]byte, error) + StoreCertifications func(certifications map[*token.ID][]byte) error + type ConfigProvider interface + GetBool func(key string) bool + GetString func(key string) string + IsSet func(key string) bool + TranslatePath func(path string) string + UnmarshalKey func(key string, rawVal interface{}) error + type IdentityConfiguration struct + Config []byte + ID string + Raw []byte + Type string + URL string + type IdentityDB interface + AddConfiguration func(wp IdentityConfiguration) error + ConfigurationExists func(id, typ string) (bool, error) + GetAuditInfo func(id []byte) ([]byte, error) + GetSignerInfo func(id []byte) ([]byte, error) + GetTokenInfo func(id []byte) ([]byte, []byte, error) + IteratorConfigurations func(configurationType string) (Iterator[IdentityConfiguration], error) + SignerInfoExists func(id []byte) (bool, error) + StoreIdentityData func(id []byte, identityAudit []byte, tokenMetadata []byte, ...) error + StoreSignerInfo func(id, info []byte) error + type IdentityDBDriver interface + OpenIdentityDB func(cp ConfigProvider, tmsID token.TMSID) (IdentityDB, error) + OpenWalletDB func(cp ConfigProvider, tmsID token.TMSID) (WalletDB, error) + type Iterator interface + Close func() error + HasNext func() bool + Next func() (T, error) + type MovementDirection int + const All + const Received + const Sent + type MovementRecord struct + Amount *big.Int + EnrollmentID string + Status TxStatus + Timestamp time.Time + TokenType token2.Type + TxID string + type QueryMovementsParams struct + EnrollmentIDs []string + MovementDirection MovementDirection + NumRecords int + SearchDirection SearchDirection + TokenTypes []token2.Type + TxStatuses []TxStatus + type QueryTokenDetailsParams struct + IDs []*token.ID + IncludeDeleted bool + LedgerTokenFormats []token.Format + OwnerType string + Spendable SpendableFilter + TokenType token.Type + TransactionIDs []string + WalletID string + type QueryTokenRequestsParams struct + Statuses []TxStatus + type QueryTransactionsParams struct + ActionTypes []ActionType + ExcludeToSelf bool + From *time.Time + IDs []string + RecipientWallet string + SenderWallet string + Statuses []TxStatus + To *time.Time + type QueryValidationRecordsParams struct + Filter func(record *ValidationRecord) bool + From *time.Time + Statuses []TxStatus + To *time.Time + type SearchDirection int + const FromBeginning + const FromLast + type SpendableFilter int + const Any + const NonSpendableOnly + const SpendableOnly + type TTXDBDriver interface + Open func(cp ConfigProvider, tmsID token.TMSID) (TokenTransactionDB, error) + type TokenDB interface + Balance func(ownerEID string, typ token.Type) (uint64, error) + DeleteTokens func(deletedBy string, toDelete ...*token.ID) error + GetTokenMetadata func(ids []*token.ID) ([][]byte, error) + GetTokenOutputs func(ids []*token.ID, callback driver.QueryCallbackFunc) error + GetTokenOutputsAndMeta func(ctx context.Context, ids []*token.ID) ([][]byte, [][]byte, []token.Format, error) + GetTokens func(inputs ...*token.ID) ([]*token.Token, error) + IsMine func(txID string, index uint64) (bool, error) + ListAuditTokens func(ids ...*token.ID) ([]*token.Token, error) + ListHistoryIssuedTokens func() (*token.IssuedTokens, error) + ListUnspentTokens func() (*token.UnspentTokens, error) + ListUnspentTokensBy func(walletID string, typ token.Type) (*token.UnspentTokens, error) + NewTokenDBTransaction func() (TokenDBTransaction, error) + PublicParams func() ([]byte, error) + PublicParamsByHash func(rawHash driver.PPHash) ([]byte, error) + QueryTokenDetails func(params QueryTokenDetailsParams) ([]TokenDetails, error) + SetSupportedTokenFormats func(formats []token.Format) error + SpendableTokensIteratorBy func(ctx context.Context, walletID string, typ token.Type) (driver.SpendableTokensIterator, error) + StorePublicParams func(raw []byte) error + TransactionExists func(ctx context.Context, id string) (bool, error) + UnspentTokensIterator func() (driver.UnspentTokensIterator, error) + UnspentTokensIteratorBy func(ctx context.Context, walletID string, tokenType token.Type) (driver.UnspentTokensIterator, error) + WhoDeletedTokens func(inputs ...*token.ID) ([]string, []bool, error) + type TokenDBDriver interface + Open func(cp ConfigProvider, tmsID token2.TMSID) (TokenDB, error) + type TokenDBTransaction interface + Commit func() error + Delete func(ctx context.Context, tokenID token.ID, deletedBy string) error + GetToken func(ctx context.Context, tokenID token.ID, includeDeleted bool) (*token.Token, []string, error) + Rollback func() error + SetSpendable func(ctx context.Context, tokenID token.ID, spendable bool) error + SetSpendableBySupportedTokenFormats func(ctx context.Context, formats []token.Format) error + StoreToken func(ctx context.Context, tr TokenRecord, owners []string) error + type TokenDetails struct + Amount uint64 + Index uint64 + IsSpent bool + OwnerEnrollment string + OwnerIdentity []byte + OwnerType string + SpentBy string + StoredAt time.Time + TxID string + Type string + type TokenLockDB interface + Cleanup func(leaseExpiry time.Duration) error + Close func() error + Lock func(tokenID *token.ID, consumerTxID transaction.ID) error + UnlockByTxID func(consumerTxID transaction.ID) error + type TokenLockDBDriver interface + Open func(cp ConfigProvider, tmsID token2.TMSID) (TokenLockDB, error) + type TokenNotifier driver2.Notifier + type TokenNotifierDriver interface + Open func(cp ConfigProvider, tmsID token2.TMSID) (TokenNotifier, error) + type TokenRecord struct + Amount uint64 + Auditor bool + Index uint64 + Issuer bool + IssuerRaw []byte + Ledger []byte + LedgerFormat token.Format + LedgerMetadata []byte + Owner bool + OwnerIdentity []byte + OwnerRaw []byte + OwnerType string + OwnerWalletID string + Quantity string + TxID string + Type token.Type + type TokenRequestIterator = collections.Iterator[*TokenRequestRecord] + type TokenRequestRecord struct + Status TxStatus + TokenRequest []byte + TxID string + type TokenTransactionDB interface + type TransactionDB interface + BeginAtomicWrite func() (AtomicWrite, error) + Close func() error + GetStatus func(txID string) (TxStatus, string, error) + GetTokenRequest func(txID string) ([]byte, error) + QueryMovements func(params QueryMovementsParams) ([]*MovementRecord, error) + QueryTokenRequests func(params QueryTokenRequestsParams) (TokenRequestIterator, error) + QueryTransactions func(params QueryTransactionsParams) (TransactionIterator, error) + QueryValidations func(params QueryValidationRecordsParams) (ValidationRecordsIterator, error) + SetStatus func(ctx context.Context, txID string, status TxStatus, message string) error + type TransactionEndorsementAckDB interface + AddTransactionEndorsementAck func(txID string, endorser token.Identity, sigma []byte) error + GetTransactionEndorsementAcks func(txID string) (map[string][]byte, error) + type TransactionIterator = collections.Iterator[*TransactionRecord] + type TransactionRecord struct + ActionType ActionType + Amount *big.Int + ApplicationMetadata map[string][]byte + RecipientEID string + SenderEID string + Status TxStatus + Timestamp time.Time + TokenType token2.Type + TxID string + func (t *TransactionRecord) String() string + type TxStatus = driver2.TxStatus + type ValidationRecord struct + Metadata map[string][]byte + Status TxStatus + Timestamp time.Time + TokenRequest []byte + TxID string + type ValidationRecordsIterator = collections.Iterator[*ValidationRecord] + type WalletDB interface + GetWalletID func(identity token.Identity, roleID int) (WalletID, error) + GetWalletIDs func(roleID int) ([]WalletID, error) + IdentityExists func(identity token.Identity, wID WalletID, roleID int) bool + LoadMeta func(identity token.Identity, wID WalletID, roleID int) ([]byte, error) + StoreIdentity func(identity token.Identity, eID string, wID WalletID, roleID int, meta []byte) error + type WalletID = string