Documentation ¶
Overview ¶
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- func CompileListTokensOption(opts ...ListTokensOption) (*driver.ListTokensOptions, error)
- func NewServicesFromPublicParams(params []byte) (*PublicParametersManager, *Validator, error)
- type AuditRecord
- type AuditorWallet
- type CertificationClient
- type CertificationClientProvider
- type CertificationManager
- func (c *CertificationManager) Certify(wallet *CertifierWallet, ids []*token2.ID, tokens [][]byte, request []byte) ([][]byte, error)
- func (c *CertificationManager) NewCertificationRequest(ids []*token2.ID) ([]byte, error)
- func (c *CertificationManager) VerifyCertifications(ids []*token2.ID, certifications [][]byte) error
- type CertifierWallet
- type ConfigManager
- type Input
- type InputStream
- func (is *InputStream) At(i int) *Input
- func (is *InputStream) ByEnrollmentID(id string) *InputStream
- func (is *InputStream) ByType(tokenType string) *InputStream
- func (is *InputStream) Count() int
- func (is *InputStream) EnrollmentIDs() []string
- func (is *InputStream) Filter(f func(t *Input) bool) *InputStream
- func (is *InputStream) IDs() []*token2.ID
- func (is *InputStream) IsAnyMine() bool
- func (is *InputStream) Owners() *OwnerStream
- func (is *InputStream) String() string
- func (is *InputStream) Sum() *big.Int
- func (is *InputStream) TokenTypes() []string
- type Issue
- type IssueAction
- type IssueMetadata
- type IssueOption
- type IssueOptions
- type IssuerWallet
- type Ledger
- type ListTokensOption
- type ListTokensOptions
- type ManagementService
- func (t *ManagementService) CertificationClient() *CertificationClient
- func (t *ManagementService) CertificationManager() *CertificationManager
- func (t *ManagementService) Channel() string
- func (t *ManagementService) ConfigManager() *ConfigManager
- func (t *ManagementService) ID() TMSID
- func (t *ManagementService) Namespace() string
- func (t *ManagementService) Network() string
- func (t *ManagementService) NewMetadataFromBytes(raw []byte) (*Metadata, error)
- func (t *ManagementService) NewRequest(id string) (*Request, error)
- func (t *ManagementService) NewRequestFromBytes(anchor string, actions []byte, meta []byte) (*Request, error)
- func (t *ManagementService) PublicParametersManager() *PublicParametersManager
- func (t *ManagementService) SelectorManager() SelectorManager
- func (t *ManagementService) SigService() *SignatureService
- func (t *ManagementService) String() string
- func (t *ManagementService) Validator() *Validator
- func (t *ManagementService) Vault() *Vault
- func (t *ManagementService) WalletManager() *WalletManager
- type ManagementServiceProvider
- type Metadata
- func (m *Metadata) FilterBy(eIDs ...string) (*Metadata, error)
- func (m *Metadata) GetToken(raw []byte) (*token.Token, view.Identity, []byte, error)
- func (m *Metadata) Issue(i int) (*IssueMetadata, error)
- func (m *Metadata) SpentTokenID() []*token.ID
- func (m *Metadata) Transfer(i int) (*TransferMetadata, error)
- type Normalizer
- type Output
- type OutputStream
- func (o *OutputStream) At(i int) *Output
- func (o *OutputStream) ByEnrollmentID(id string) *OutputStream
- func (o *OutputStream) ByRecipient(id view.Identity) *OutputStream
- func (o *OutputStream) ByType(typ string) *OutputStream
- func (o *OutputStream) Count() int
- func (o *OutputStream) EnrollmentIDs() []string
- func (o *OutputStream) Filter(f func(t *Output) bool) *OutputStream
- func (o *OutputStream) Outputs() []*Output
- func (o *OutputStream) Sum() *big.Int
- func (o *OutputStream) TokenTypes() []string
- type OwnerFilter
- type OwnerStream
- type OwnerWallet
- func (o *OwnerWallet) EnrollmentID() string
- func (o *OwnerWallet) GetAuditInfo(id view.Identity) ([]byte, error)
- func (o *OwnerWallet) GetRecipientIdentity() (view.Identity, error)
- func (o *OwnerWallet) GetSigner(identity view.Identity) (driver.Signer, error)
- func (o *OwnerWallet) GetTokenMetadata(token []byte) ([]byte, error)
- func (o *OwnerWallet) ListUnspentTokens(opts ...ListTokensOption) (*token.UnspentTokens, error)
- func (o *OwnerWallet) ListUnspentTokensIterator(opts ...ListTokensOption) (*UnspentTokensIterator, error)
- type PublicParametersManager
- func (c *PublicParametersManager) Auditors() []view.Identity
- func (c *PublicParametersManager) CertificationDriver() string
- func (c *PublicParametersManager) Fetch() ([]byte, error)
- func (c *PublicParametersManager) GraphHiding() bool
- func (c *PublicParametersManager) Identifier() string
- func (c *PublicParametersManager) MaxTokenValue() uint64
- func (c *PublicParametersManager) Precision() uint64
- func (c *PublicParametersManager) SerializePublicParameters() ([]byte, error)
- func (c *PublicParametersManager) TokenDataHiding() bool
- func (c *PublicParametersManager) Update() error
- func (c *PublicParametersManager) Validate() error
- type PublicParamsFetcher
- type QueryEngine
- func (q *QueryEngine) GetTokens(inputs ...*token2.ID) ([]*token2.Token, error)
- func (q *QueryEngine) IsMine(id *token2.ID) (bool, error)
- func (q *QueryEngine) ListAuditTokens(ids ...*token2.ID) ([]*token2.Token, error)
- func (q *QueryEngine) ListHistoryIssuedTokens() (*token2.IssuedTokens, error)
- func (q *QueryEngine) ListUnspentTokens() (*token2.UnspentTokens, error)
- func (q *QueryEngine) PublicParams() ([]byte, error)
- func (q *QueryEngine) UnspentTokensIterator() (*UnspentTokensIterator, error)
- func (q *QueryEngine) UnspentTokensIteratorBy(walletID, tokenType string) (*UnspentTokensIterator, error)
- type QueryService
- type Request
- func (r *Request) AddAuditorSignature(sigma []byte)
- func (r *Request) AppendSignature(sigma []byte)
- func (r *Request) ApplicationMetadata(k string) []byte
- func (r *Request) AuditCheck() error
- func (r *Request) AuditInputs() (*InputStream, error)
- func (r *Request) AuditOutputs() (*OutputStream, error)
- func (r *Request) AuditRecord() (*AuditRecord, error)
- func (r *Request) BindTo(sp view2.ServiceProvider, party view.Identity) error
- func (r *Request) Bytes() ([]byte, error)
- func (r *Request) FilterMetadataBy(eIDs ...string) (*Request, error)
- func (r *Request) FromBytes(request []byte) error
- func (r *Request) GetMetadata() (*Metadata, error)
- func (r *Request) ID() string
- func (r *Request) Import(request *Request) error
- func (r *Request) Inputs() (*InputStream, error)
- func (r *Request) IsValid() error
- func (r *Request) Issue(wallet *IssuerWallet, receiver view.Identity, typ string, q uint64, ...) (*IssueAction, error)
- func (r *Request) Issues() []*Issue
- func (r *Request) MarshalToAudit() ([]byte, error)
- func (r *Request) MarshalToSign() ([]byte, error)
- func (r *Request) MetadataToBytes() ([]byte, error)
- func (r *Request) Outputs() (*OutputStream, error)
- func (r *Request) Redeem(wallet *OwnerWallet, typ string, value uint64, opts ...TransferOption) error
- func (r *Request) RequestToBytes() ([]byte, error)
- func (r *Request) SetApplicationMetadata(k string, v []byte)
- func (r *Request) SetTokenService(service *ManagementService)
- func (r *Request) Transfer(wallet *OwnerWallet, typ string, values []uint64, owners []view.Identity, ...) (*TransferAction, error)
- func (r *Request) Transfers() []*Transfer
- type Selector
- type SelectorManager
- type SelectorManagerProvider
- type ServiceOption
- func WithChannel(channel string) ServiceOption
- func WithNamespace(namespace string) ServiceOption
- func WithNetwork(network string) ServiceOption
- func WithPublicParameterFetcher(ppFetcher PublicParamsFetcher) ServiceOption
- func WithTMS(network, channel, namespace string) ServiceOption
- func WithTMSID(id TMSID) ServiceOption
- type ServiceOptions
- type ServiceProvider
- type SignatureService
- func (s *SignatureService) AuditorVerifier(id view.Identity) (Verifier, error)
- func (s *SignatureService) GetSigner(id view.Identity) (Signer, error)
- func (s *SignatureService) IsMe(party view.Identity) bool
- func (s *SignatureService) IssuerVerifier(id view.Identity) (Verifier, error)
- func (s *SignatureService) OwnerVerifier(id view.Identity) (Verifier, error)
- func (s *SignatureService) RegisterSigner(identity view.Identity, signer Signer, verifier Verifier) error
- type Signer
- type TMS
- type TMSID
- type Transfer
- type TransferAction
- func (t *TransferAction) GetInputs() ([]string, error)
- func (t *TransferAction) GetSerializedOutputs() ([][]byte, error)
- func (t *TransferAction) IsGraphHiding() bool
- func (t *TransferAction) IsRedeemAt(i int) bool
- func (t *TransferAction) NumOutputs() int
- func (t *TransferAction) Serialize() ([]byte, error)
- func (t *TransferAction) SerializeOutputAt(i int) ([]byte, error)
- type TransferMetadata
- type TransferOption
- type TransferOptions
- type UnspentTokensIterator
- type Validator
- type Vault
- type VaultProvider
- type Verifier
- type Wallet
- type WalletManager
- func (wm *WalletManager) AuditorWallet(id string) *AuditorWallet
- func (wm *WalletManager) AuditorWalletByIdentity(id view.Identity) *AuditorWallet
- func (wm *WalletManager) CertifierWallet(id string) *CertifierWallet
- func (wm *WalletManager) CertifierWalletByIdentity(identity view.Identity) *CertifierWallet
- func (wm *WalletManager) GetEnrollmentID(identity view.Identity) (string, error)
- func (wm *WalletManager) IsMe(id view.Identity) bool
- func (wm *WalletManager) IssuerWallet(id string) *IssuerWallet
- func (wm *WalletManager) IssuerWalletByIdentity(identity view.Identity) *IssuerWallet
- func (wm *WalletManager) OwnerWallet(id string) *OwnerWallet
- func (wm *WalletManager) OwnerWalletByIdentity(identity view.Identity) *OwnerWallet
- func (wm *WalletManager) RegisterIssuerWallet(id string, path string) error
- func (wm *WalletManager) RegisterOwnerWallet(id string, path string) error
- func (wm *WalletManager) RegisterRecipientIdentity(id view.Identity, auditInfo []byte, metadata []byte) error
- func (wm *WalletManager) SpentIDs(ids []*token.ID) ([]string, error)
- func (wm *WalletManager) Wallet(identity view.Identity) *Wallet
Constants ¶
const (
TransferMetadataPrefix = "TransferMetadataPrefix"
)
Variables ¶
var ( // SelectorInsufficientFunds is returned when funds are not sufficient to cover the request SelectorInsufficientFunds = errors.New("insufficient funds") // SelectorSufficientButLockedFunds is returned when funds are sufficient to cover the request, but some tokens are locked // by other transactions SelectorSufficientButLockedFunds = errors.New("sufficient but partially locked funds") // SelectorSufficientButNotCertifiedFunds is returned when funds are sufficient to cover the request, but some tokens // are not yet certified and therefore cannot be used. SelectorSufficientButNotCertifiedFunds = errors.New("sufficient but partially not certified") // SelectorSufficientFundsButConcurrencyIssue is returned when funds are sufficient to cover the request, but // concurrency issues does not make some of the selected tokens available. SelectorSufficientFundsButConcurrencyIssue = errors.New("sufficient funds but concurrency issue") )
Functions ¶
func CompileListTokensOption ¶
func CompileListTokensOption(opts ...ListTokensOption) (*driver.ListTokensOptions, error)
func NewServicesFromPublicParams ¶
func NewServicesFromPublicParams(params []byte) (*PublicParametersManager, *Validator, error)
NewServicesFromPublicParams uses the passed marshalled public parameters to create an instance of PublicParametersManager and a new instance of Validator.
Types ¶
type AuditRecord ¶
type AuditRecord struct { Anchor string Inputs *InputStream Outputs *OutputStream }
AuditRecord models the audit record returned by the audit command It contains the token request's anchor, inputs (with Type and Quantity), and outputs
type AuditorWallet ¶
type AuditorWallet struct { *Wallet // contains filtered or unexported fields }
AuditorWallet models the wallet of an auditor
func (*AuditorWallet) GetAuditorIdentity ¶
func (a *AuditorWallet) GetAuditorIdentity() (view.Identity, error)
GetAuditorIdentity returns the auditor identity. This can be a long term identity or a pseudonym depending on the underlying token driver.
type CertificationClient ¶
type CertificationClient struct {
// contains filtered or unexported fields
}
CertificationClient is the client side of the certification process
func (*CertificationClient) IsCertified ¶
func (c *CertificationClient) IsCertified(id *token2.ID) bool
IsCertified returns true if the passed token id has been already certified, otherwise false
func (*CertificationClient) RequestCertification ¶
func (c *CertificationClient) RequestCertification(ids ...*token2.ID) error
RequestCertification requests the certification of the passed token ids
type CertificationClientProvider ¶
type CertificationClientProvider interface { // New returns a new CertificationClient instance for the passed inputs New(network string, channel string, namespace string, driver string) (driver.CertificationClient, error) }
CertificationClientProvider provides instances of CertificationClient
type CertificationManager ¶
type CertificationManager struct {
// contains filtered or unexported fields
}
CertificationManager manages token certifications as described by the paper [`Privacy-preserving auditable token payments in a permissioned blockchain system`]('https://eprint.iacr.org/2019/1058.pdf')
func (*CertificationManager) Certify ¶
func (c *CertificationManager) Certify(wallet *CertifierWallet, ids []*token2.ID, tokens [][]byte, request []byte) ([][]byte, error)
Certify uses the passed wallet to certify the passed token ids. Certify takes in input the certification request and the token representations as available on the ledger.
func (*CertificationManager) NewCertificationRequest ¶
func (c *CertificationManager) NewCertificationRequest(ids []*token2.ID) ([]byte, error)
NewCertificationRequest creates a new certification request for the passed token ids
func (*CertificationManager) VerifyCertifications ¶
func (c *CertificationManager) VerifyCertifications(ids []*token2.ID, certifications [][]byte) error
VerifyCertifications verfiies the certification of the passed token ids.
type CertifierWallet ¶
type CertifierWallet struct { *Wallet // contains filtered or unexported fields }
CertifierWallet models the wallet of a certifier
func (*CertifierWallet) GetCertifierIdentity ¶
func (a *CertifierWallet) GetCertifierIdentity() (view.Identity, error)
GetCertifierIdentity returns the certifier identity. This can be a long term identity or a pseudonym depending on the underlying token driver.
type ConfigManager ¶
type ConfigManager struct {
// contains filtered or unexported fields
}
ConfigManager manages the configuration of the token-sdk
func (*ConfigManager) Certifiers ¶
func (m *ConfigManager) Certifiers() []string
Certifiers returns the list of certifier ids.
type Input ¶
type Input struct { ActionIndex int Id *token2.ID Owner view.Identity OwnerAuditInfo []byte EnrollmentID string Type string Quantity token2.Quantity }
Input models an input of a token action
type InputStream ¶
type InputStream struct {
// contains filtered or unexported fields
}
InputStream models a stream over a set of inputs (Input).
func NewInputStream ¶
func NewInputStream(qs QueryService, inputs []*Input, precision uint64) *InputStream
NewInputStream creates a new InputStream for the passed inputs and query service.
func (*InputStream) At ¶
func (is *InputStream) At(i int) *Input
At returns the input at the given index.
func (*InputStream) ByEnrollmentID ¶
func (is *InputStream) ByEnrollmentID(id string) *InputStream
ByEnrollmentID filters by enrollment ID.
func (*InputStream) ByType ¶
func (is *InputStream) ByType(tokenType string) *InputStream
ByType filters by token type.
func (*InputStream) Count ¶
func (is *InputStream) Count() int
Count returns the number of inputs in the stream
func (*InputStream) EnrollmentIDs ¶
func (is *InputStream) EnrollmentIDs() []string
EnrollmentIDs returns the enrollment IDs of the owners of the inputs. It might be empty, if not available.
func (*InputStream) Filter ¶
func (is *InputStream) Filter(f func(t *Input) bool) *InputStream
Filter returns a new InputStream with only the inputs that satisfy the predicate
func (*InputStream) IDs ¶
func (is *InputStream) IDs() []*token2.ID
IDs returns the IDs of the inputs.
func (*InputStream) IsAnyMine ¶
func (is *InputStream) IsAnyMine() bool
IsAnyMine returns true if any of the inputs are mine
func (*InputStream) Owners ¶
func (is *InputStream) Owners() *OwnerStream
Owners returns a list of identities that own the tokens in the stream
func (*InputStream) String ¶
func (is *InputStream) String() string
String returns a string representation of the input stream
func (*InputStream) Sum ¶
func (is *InputStream) Sum() *big.Int
Sum returns the sum of the quantities of the inputs.
func (*InputStream) TokenTypes ¶
func (is *InputStream) TokenTypes() []string
TokenTypes returns the token types of the inputs.
type Issue ¶
Issue contains information about an issue operation. In particular, it carries the identities of the issuer and the receivers
type IssueAction ¶
type IssueAction struct {
// contains filtered or unexported fields
}
IssueAction represents an action that issues tokens.
func (*IssueAction) GetIssuer ¶
func (i *IssueAction) GetIssuer() []byte
GetIssuer returns the issuer of the action.
func (*IssueAction) GetMetadata ¶
func (i *IssueAction) GetMetadata() map[string][]byte
GetMetadata returns the metadata of the action.
func (*IssueAction) GetSerializedOutputs ¶
func (i *IssueAction) GetSerializedOutputs() ([][]byte, error)
GetSerializedOutputs returns the serialized outputs of the action.
func (*IssueAction) IsAnonymous ¶
func (i *IssueAction) IsAnonymous() bool
IsAnonymous returns true if the action is an anonymous action.
func (*IssueAction) NumOutputs ¶
func (i *IssueAction) NumOutputs() int
NumOutputs returns the number of outputs in the action.
func (*IssueAction) Serialize ¶
func (i *IssueAction) Serialize() ([]byte, error)
Serialize returns the byte representation of the action.
type IssueMetadata ¶
type IssueMetadata struct {
*driver.IssueMetadata
}
IssueMetadata contains the metadata of an issue action
func (*IssueMetadata) IsOutputAbsent ¶
func (m *IssueMetadata) IsOutputAbsent(j int) bool
IsOutputAbsent returns true if the given output's metadata is absent
func (*IssueMetadata) Match ¶
func (m *IssueMetadata) Match(action *IssueAction) error
Match returns true if the given action matches this metadata
type IssueOption ¶
type IssueOption func(*IssueOptions) error
IssueOption is a function that modify IssueOptions
func WithIssueAttribute ¶
func WithIssueAttribute(attr, value interface{}) IssueOption
WithIssueAttribute sets an attribute to be used to customize the issue command
type IssueOptions ¶
type IssueOptions struct {
// Attributes is a container of generic options that might be driver specific
Attributes map[interface{}]interface{}
}
IssueOptions models the options that can be passed to the issue command
type IssuerWallet ¶
type IssuerWallet struct { *Wallet // contains filtered or unexported fields }
IssuerWallet models the wallet of an issuer
func (*IssuerWallet) GetIssuerIdentity ¶
func (i *IssuerWallet) GetIssuerIdentity(tokenType string) (view.Identity, error)
GetIssuerIdentity returns the issuer identity. This can be a long term identity or a pseudonym depending on the underlying token driver.
func (*IssuerWallet) GetSigner ¶
func (i *IssuerWallet) GetSigner(identity view.Identity) (Signer, error)
GetSigner returns the signer bound to the passed issuer identity.
func (*IssuerWallet) ListIssuedTokens ¶
func (i *IssuerWallet) ListIssuedTokens(opts ...ListTokensOption) (*token.IssuedTokens, error)
ListIssuedTokens returns the list of tokens issued by identities in this wallet and filter by the passed options. Options: WithType
type ListTokensOption ¶
type ListTokensOption func(*ListTokensOptions) error
ListTokensOption is a function that configures a ListTokensOptions
func WithType ¶
func WithType(tokenType string) ListTokensOption
WithType returns a list token option that filter by the passed token type. If the passed token type is the empty string, all token types are selected.
type ListTokensOptions ¶
type ListTokensOptions struct {
TokenType string
}
ListTokensOptions options for listing tokens
type ManagementService ¶
type ManagementService struct {
// contains filtered or unexported fields
}
ManagementService (TMS, for short) is the entry point for the Token API. A TMS is uniquely identified by a network, channel, namespace, and public parameters. The TMS gives access, among other things, to the wallet manager, the public paramenters, the token selector, and so on.
func GetManagementService ¶
func GetManagementService(sp ServiceProvider, opts ...ServiceOption) *ManagementService
GetManagementService returns the management service for the passed options. If no options are passed, the default management service is returned. Options: WithNetwork, WithChannel, WithNamespace, WithPublicParameterFetcher, WithTMS, WithTMSID
func (*ManagementService) CertificationClient ¶
func (t *ManagementService) CertificationClient() *CertificationClient
CertificationClient returns the certification client for this TMS
func (*ManagementService) CertificationManager ¶
func (t *ManagementService) CertificationManager() *CertificationManager
CertificationManager returns the certification manager for this TMS
func (*ManagementService) Channel ¶
func (t *ManagementService) Channel() string
Channel returns the channel identifier
func (*ManagementService) ConfigManager ¶
func (t *ManagementService) ConfigManager() *ConfigManager
ConfigManager returns the configuration manager for this TMS
func (*ManagementService) Namespace ¶
func (t *ManagementService) Namespace() string
Namespace returns the namespace identifier, empty if not defined
func (*ManagementService) Network ¶
func (t *ManagementService) Network() string
Network returns the network identifier
func (*ManagementService) NewMetadataFromBytes ¶
func (t *ManagementService) NewMetadataFromBytes(raw []byte) (*Metadata, error)
NewMetadataFromBytes unmarshals the passed bytes into a Metadata object
func (*ManagementService) NewRequest ¶
func (t *ManagementService) NewRequest(id string) (*Request, error)
NewRequest returns a new Token Request whose anchor is the passed id
func (*ManagementService) NewRequestFromBytes ¶
func (t *ManagementService) NewRequestFromBytes(anchor string, actions []byte, meta []byte) (*Request, error)
NewRequestFromBytes returns a new Token Request for the passed anchor, and whose actions and metadata are unmarshalled from the passed bytes
func (*ManagementService) PublicParametersManager ¶
func (t *ManagementService) PublicParametersManager() *PublicParametersManager
PublicParametersManager returns a manager that gives access to the public parameters governing this TMS.
func (*ManagementService) SelectorManager ¶
func (t *ManagementService) SelectorManager() SelectorManager
SelectorManager returns a manager that gives access to the token selectors
func (*ManagementService) SigService ¶
func (t *ManagementService) SigService() *SignatureService
SigService returns the signature service for this TMS
func (*ManagementService) String ¶
func (t *ManagementService) String() string
String returns a string representation of the TMS
func (*ManagementService) Validator ¶
func (t *ManagementService) Validator() *Validator
Validator returns a new token validator for this TMS
func (*ManagementService) Vault ¶
func (t *ManagementService) Vault() *Vault
Vault returns the Token Vault for this TMS
func (*ManagementService) WalletManager ¶
func (t *ManagementService) WalletManager() *WalletManager
WalletManager returns the wallet manager for this TMS
type ManagementServiceProvider ¶
type ManagementServiceProvider struct {
// contains filtered or unexported fields
}
ManagementServiceProvider provides instances of the management service
func GetManagementServiceProvider ¶
func GetManagementServiceProvider(sp ServiceProvider) *ManagementServiceProvider
GetManagementServiceProvider returns the management service provider from the passed service provider
func NewManagementServiceProvider ¶
func NewManagementServiceProvider( sp ServiceProvider, tmsProvider driver.TokenManagerServiceProvider, normalizer Normalizer, vaultProvider VaultProvider, certificationClientProvider CertificationClientProvider, selectorManagerProvider SelectorManagerProvider, ) *ManagementServiceProvider
NewManagementServiceProvider returns a new instance of ManagementServiceProvider
func (*ManagementServiceProvider) GetManagementService ¶
func (p *ManagementServiceProvider) GetManagementService(opts ...ServiceOption) *ManagementService
GetManagementService returns an instance of the management service for the passed options. If the management service has not been created yet, it will be created.
type Metadata ¶
type Metadata struct { TMS TMS TokenRequestMetadata *driver.TokenRequestMetadata }
Metadata contains the metadata of a Token Request
func (*Metadata) FilterBy ¶
FilterBy returns a new Metadata containing only the metadata that matches the given enrollment IDs. For Issue actions, for each issue: - The sender; - The returned metadata will contain only the outputs whose owner has the given enrollment IDs. For Transfer actions, for each action: - The list of token IDs will be empty; - The returned metadata will contain only the outputs whose owner has the given enrollment IDs; - The senders are included if and only if there is at least one output whose owner has the given enrollment IDs. Application metadata is always included
func (*Metadata) GetToken ¶
GetToken unmarshals the given bytes to extract the token and its issuer (if any).
func (*Metadata) Issue ¶
func (m *Metadata) Issue(i int) (*IssueMetadata, error)
Issue returns the i-th issue metadata, if present
func (*Metadata) SpentTokenID ¶
SpentTokenID returns the token IDs of the tokens that were spent by the Token Request this metadata is associated with.
type Normalizer ¶
type Normalizer interface { // Normalize normalizes the given ServiceOptions struct. Normalize(opt *ServiceOptions) *ServiceOptions }
Normalizer is used to set default values of ServiceOptions struct, if needed.
type Output ¶
type Output struct { // ActionIndex is the index of the action that created this output ActionIndex int // Index is the absolute position of this output in the token request Index uint64 // Owner is the identity of the owner of this output Owner view.Identity // OwnerAuditInfo contains the audit information of the output's owner OwnerAuditInfo []byte // EnrollmentID is the enrollment ID of the owner of this output EnrollmentID string // Type is the type of token Type string // Quantity is the quantity of tokens Quantity token2.Quantity }
Output models the output of a token action
type OutputStream ¶
type OutputStream struct { Precision uint64 // contains filtered or unexported fields }
OutputStream models a stream over a set of outputs (Output).
func NewOutputStream ¶
func NewOutputStream(outputs []*Output, precision uint64) *OutputStream
NewOutputStream creates a new OutputStream for the passed outputs and Precision.
func (*OutputStream) At ¶
func (o *OutputStream) At(i int) *Output
At returns the output at the passed index.
func (*OutputStream) ByEnrollmentID ¶
func (o *OutputStream) ByEnrollmentID(id string) *OutputStream
ByEnrollmentID filters to only include outputs that match the passed enrollment ID.
func (*OutputStream) ByRecipient ¶
func (o *OutputStream) ByRecipient(id view.Identity) *OutputStream
ByRecipient filters the OutputStream to only include outputs that match the passed recipient.
func (*OutputStream) ByType ¶
func (o *OutputStream) ByType(typ string) *OutputStream
ByType filters the OutputStream to only include outputs that match the passed type.
func (*OutputStream) Count ¶
func (o *OutputStream) Count() int
Count returns the number of outputs in the OutputStream.
func (*OutputStream) EnrollmentIDs ¶
func (o *OutputStream) EnrollmentIDs() []string
EnrollmentIDs returns the enrollment IDs of the outputs in the OutputStream.
func (*OutputStream) Filter ¶
func (o *OutputStream) Filter(f func(t *Output) bool) *OutputStream
Filter filters the OutputStream to only include outputs that match the passed predicate.
func (*OutputStream) Outputs ¶
func (o *OutputStream) Outputs() []*Output
Outputs returns the outputs of the OutputStream.
func (*OutputStream) Sum ¶
func (o *OutputStream) Sum() *big.Int
Sum returns the sum of the quantity of all outputs in the OutputStream.
func (*OutputStream) TokenTypes ¶
func (o *OutputStream) TokenTypes() []string
TokenTypes returns the token types of the outputs in the OutputStream.
type OwnerFilter ¶
type OwnerFilter interface { // ID is the wallet identifier of the owner ID() string // ContainsToken returns true if the passed token is recognized, false otherwise. ContainsToken(token *token2.UnspentToken) bool }
OwnerFilter tells if a passed identity is recognized
type OwnerStream ¶
type OwnerStream struct {
// contains filtered or unexported fields
}
func NewOwnerStream ¶
func NewOwnerStream(owners []string) *OwnerStream
func (*OwnerStream) Count ¶
func (s *OwnerStream) Count() int
type OwnerWallet ¶
type OwnerWallet struct { *Wallet // contains filtered or unexported fields }
OwnerWallet models the wallet of an owner
func (*OwnerWallet) EnrollmentID ¶
func (o *OwnerWallet) EnrollmentID() string
func (*OwnerWallet) GetAuditInfo ¶
func (o *OwnerWallet) GetAuditInfo(id view.Identity) ([]byte, error)
GetAuditInfo returns the audit info bound to the passed owner identity.
func (*OwnerWallet) GetRecipientIdentity ¶
func (o *OwnerWallet) GetRecipientIdentity() (view.Identity, error)
GetRecipientIdentity returns the owner identity. This can be a long term identity or a pseudonym depending on the underlying token driver.
func (*OwnerWallet) GetTokenMetadata ¶
func (o *OwnerWallet) GetTokenMetadata(token []byte) ([]byte, error)
GetTokenMetadata returns the token metadata bound to the passed owner identity.
func (*OwnerWallet) ListUnspentTokens ¶
func (o *OwnerWallet) ListUnspentTokens(opts ...ListTokensOption) (*token.UnspentTokens, error)
ListUnspentTokens returns a list of unspent tokens owned by identities in this wallet and filtered by the passed options. Options: WithType
func (*OwnerWallet) ListUnspentTokensIterator ¶
func (o *OwnerWallet) ListUnspentTokensIterator(opts ...ListTokensOption) (*UnspentTokensIterator, error)
ListUnspentTokensIterator returns an iterator of unspent tokens owned by identities in this wallet and filtered by the passed options. Options: WithType
type PublicParametersManager ¶
type PublicParametersManager struct {
// contains filtered or unexported fields
}
PublicParametersManager exposes methods to manage the public parameters
func NewPublicParametersManagerFromPublicParams ¶
func NewPublicParametersManagerFromPublicParams(params []byte) (*PublicParametersManager, error)
func (*PublicParametersManager) Auditors ¶
func (c *PublicParametersManager) Auditors() []view.Identity
Auditors returns the list of auditors' identities
func (*PublicParametersManager) CertificationDriver ¶
func (c *PublicParametersManager) CertificationDriver() string
CertificationDriver return the certification driver used to certify that tokens exist
func (*PublicParametersManager) Fetch ¶
func (c *PublicParametersManager) Fetch() ([]byte, error)
Fetch fetches the public parameters from the backend
func (*PublicParametersManager) GraphHiding ¶
func (c *PublicParametersManager) GraphHiding() bool
GraphHiding returns true if graph hiding is enabled
func (*PublicParametersManager) Identifier ¶
func (c *PublicParametersManager) Identifier() string
Identifier returns the identifier of the public parameters
func (*PublicParametersManager) MaxTokenValue ¶
func (c *PublicParametersManager) MaxTokenValue() uint64
MaxTokenValue returns the maximum value a token can contain
func (*PublicParametersManager) Precision ¶
func (c *PublicParametersManager) Precision() uint64
Precision returns the precision used to represent the token quantity
func (*PublicParametersManager) SerializePublicParameters ¶
func (c *PublicParametersManager) SerializePublicParameters() ([]byte, error)
SerializePublicParameters returns the public parameters in their serialized form
func (*PublicParametersManager) TokenDataHiding ¶
func (c *PublicParametersManager) TokenDataHiding() bool
TokenDataHiding returns true if data hiding is enabled
func (*PublicParametersManager) Update ¶
func (c *PublicParametersManager) Update() error
Update fetches the public parameters from the backend and update the local one accordingly
func (*PublicParametersManager) Validate ¶
func (c *PublicParametersManager) Validate() error
Validate validates the public parameters
type PublicParamsFetcher ¶
type PublicParamsFetcher interface { // Fetch fetches the public parameters from the backend Fetch() ([]byte, error) }
PublicParamsFetcher models the public parameters fetcher
type QueryEngine ¶
type QueryEngine struct {
// contains filtered or unexported fields
}
QueryEngine models a token query engine
func (*QueryEngine) GetTokens ¶
GetTokens returns the tokens stored in the vault matching the given ids
func (*QueryEngine) IsMine ¶
func (q *QueryEngine) IsMine(id *token2.ID) (bool, error)
IsMine returns true is the given token is in this vault and therefore owned by this client
func (*QueryEngine) ListAuditTokens ¶
func (*QueryEngine) ListHistoryIssuedTokens ¶
func (q *QueryEngine) ListHistoryIssuedTokens() (*token2.IssuedTokens, error)
func (*QueryEngine) ListUnspentTokens ¶
func (q *QueryEngine) ListUnspentTokens() (*token2.UnspentTokens, error)
ListUnspentTokens returns a list of all unspent tokens stored in the vault
func (*QueryEngine) PublicParams ¶
func (q *QueryEngine) PublicParams() ([]byte, error)
PublicParams returns the public parameters stored in the vault
func (*QueryEngine) UnspentTokensIterator ¶
func (q *QueryEngine) UnspentTokensIterator() (*UnspentTokensIterator, error)
UnspentTokensIterator returns an iterator over all unspent tokens stored in the vault
func (*QueryEngine) UnspentTokensIteratorBy ¶
func (q *QueryEngine) UnspentTokensIteratorBy(walletID, tokenType string) (*UnspentTokensIterator, error)
UnspentTokensIteratorBy is an iterator over all unspent tokens in this vault owned by passed wallet id and whose token type matches the passed token type
type Request ¶
type Request struct { // Anchor is used to bind the Actions to a given Transaction Anchor string // Actions contains the token operations. Actions *driver.TokenRequest // Metadata contains the actions' metadata used to unscramble the content of the actions, if the // underlying token driver requires that Metadata *driver.TokenRequestMetadata // TokenService this request refers to TokenService *ManagementService `json:"-"` }
Request aggregates token operations that must be performed atomically. Operations are represented in a backend agnostic way but driver specific.
func NewRequest ¶
func NewRequest(tokenService *ManagementService, anchor string) *Request
NewRequest creates a new empty request for the given token service and anchor
func NewRequestFromBytes ¶
func NewRequestFromBytes(tokenService *ManagementService, anchor string, actions []byte, trmRaw []byte) (*Request, error)
NewRequestFromBytes creates a new request from the given anchor, and whose actions and metadata are unmarshalled from the given bytes
func (*Request) AddAuditorSignature ¶
AddAuditorSignature adds an auditor signature to the request.
func (*Request) AppendSignature ¶
AppendSignature appends a signature to the request.
func (*Request) ApplicationMetadata ¶
ApplicationMetadata returns the application metadata corresponding to the given key
func (*Request) AuditCheck ¶
AuditCheck performs the audit check of the request in addition to the checks of the token request itself via IsValid.
func (*Request) AuditInputs ¶
func (r *Request) AuditInputs() (*InputStream, error)
AuditInputs is like Inputs but in addition Type and Quantity are included.
func (*Request) AuditOutputs ¶
func (r *Request) AuditOutputs() (*OutputStream, error)
AuditOutputs returns a stream over all the outputs in the token request
func (*Request) AuditRecord ¶
func (r *Request) AuditRecord() (*AuditRecord, error)
AuditRecord return the audit record of the request. The audit record contains: The anchor, the audit inputs and outputs
func (*Request) BindTo ¶
BindTo binds transfers' senders and receivers, that are senders, that are not me to the passed identity
func (*Request) Bytes ¶
Bytes marshals the request to bytes. It includes: Anchor (or ID), actions, and metadata.
func (*Request) FilterMetadataBy ¶
FilterMetadataBy returns a new Request with the metadata filtered by the given enrollment IDs.
func (*Request) FromBytes ¶
FromBytes unmarshalls the request from bytes overriding the content of the current request.
func (*Request) GetMetadata ¶
GetMetadata returns the metadata of the request.
func (*Request) Import ¶
Import imports the actions and metadata from the passed request. TODO: check that the anchor is the same.
func (*Request) Inputs ¶
func (r *Request) Inputs() (*InputStream, error)
Inputs returns the sequence of inputs of the request supporting sequential and parallel aggregate operations. Notice that the inputs do not carry Type and Quantity because this information might be available to all parties. If you are an auditor, you can use the AuditInputs method to get everything.
func (*Request) Issue ¶
func (r *Request) Issue(wallet *IssuerWallet, receiver view.Identity, typ string, q uint64, opts ...IssueOption) (*IssueAction, error)
Issue appends an issue action to the request. The action will be prepared using the provided issuer wallet. The action issues to the receiver a token of the passed type and quantity. Additional options can be passed to customize the action.
func (*Request) MarshalToAudit ¶
MarshalToAudit marshals the request to a message suitable for audit signature. In particular, metadata is not included.
func (*Request) MarshalToSign ¶
MarshalToSign marshals the request to a message suitable for signing.
func (*Request) MetadataToBytes ¶
MetadataToBytes marshals the request's metadata to bytes.
func (*Request) Outputs ¶
func (r *Request) Outputs() (*OutputStream, error)
Outputs returns the sequence of outputs of the request supporting sequential and parallel aggregate operations.
func (*Request) Redeem ¶
func (r *Request) Redeem(wallet *OwnerWallet, typ string, value uint64, opts ...TransferOption) error
Redeem appends a redeem action to the request. The action will be prepared using the provided owner wallet. The action redeems tokens of the passed type for a total amount matching the passed value. Additional options can be passed to customize the action.
func (*Request) RequestToBytes ¶
RequestToBytes marshals the request's actions to bytes.
func (*Request) SetApplicationMetadata ¶
SetApplicationMetadata sets application metadata in terms of key-value pairs. The Token-SDK does not control the format of the metadata.
func (*Request) SetTokenService ¶
func (r *Request) SetTokenService(service *ManagementService)
SetTokenService sets the token service.
func (*Request) Transfer ¶
func (r *Request) Transfer(wallet *OwnerWallet, typ string, values []uint64, owners []view.Identity, opts ...TransferOption) (*TransferAction, error)
Transfer appends a transfer action to the request. The action will be prepared using the provided owner wallet. The action transfers tokens of the passed types to the receivers for the passed quantities. In other words, owners[0] will receives values[0], and so on. Additional options can be passed to customize the action.
type Selector ¶
type Selector interface { // Select returns the list of token identifiers where // 1. The owner match the passed owner filter. // 2. The type is equal to the passed token type. // 3. The sum of amount in each token is at least the passed quantity. // Quantity is a string in decimal format // Notice that, the quantity selected might exceed the quantity requested due to the amounts // stored in each token. Select(ownerFilter OwnerFilter, q, tokenType string) ([]*token2.ID, token2.Quantity, error) }
Selector is the interface of token selectors
type SelectorManager ¶
type SelectorManager interface { // NewSelector returns a new Selector instance bound the passed id. NewSelector(id string) (Selector, error) // Unlock unlocks the tokens bound to the passed id, if any Unlock(id string) error }
SelectorManager handles token selection operations
type SelectorManagerProvider ¶
type SelectorManagerProvider interface { // SelectorManager returns a SelectorManager instance for the passed inputs. SelectorManager(network string, channel string, namespace string) SelectorManager }
SelectorManagerProvider provides instances of SelectorManager
type ServiceOption ¶
type ServiceOption func(*ServiceOptions) error
ServiceOption is a function that configures a ServiceOptions
func WithNamespace ¶
func WithNamespace(namespace string) ServiceOption
WithNamespace sets the namespace for the service
func WithPublicParameterFetcher ¶
func WithPublicParameterFetcher(ppFetcher PublicParamsFetcher) ServiceOption
WithPublicParameterFetcher sets the public parameter fetcher
func WithTMS ¶
func WithTMS(network, channel, namespace string) ServiceOption
WithTMS filters by network, channel and namespace. Each of them can be empty
type ServiceOptions ¶
type ServiceOptions struct { // Network is the name of the network Network string // Channel is the name of the channel, if meaningful for the underlying backend Channel string // Namespace is the namespace of the token Namespace string // PublicParamsFetcher is used to fetch the public parameters PublicParamsFetcher PublicParamsFetcher // Params is used to store any application specific parameter Params map[string]interface{} }
ServiceOptions is used to configure the service
func CompileServiceOptions ¶
func CompileServiceOptions(opts ...ServiceOption) (*ServiceOptions, error)
CompileServiceOptions compiles the given list of ServiceOption
func (ServiceOptions) ParamAsString ¶
func (o ServiceOptions) ParamAsString(key string) (string, error)
ParamAsString returns the value bound to the passed key. If the key is not found, it returns the empty string. if the value bound to the passed key is not a string, it returns an error.
func (ServiceOptions) TMSID ¶
func (o ServiceOptions) TMSID() TMSID
TMSID returns the TMSID for the given ServiceOptions
type ServiceProvider ¶
type ServiceProvider interface { // GetService returns an instance of the given type GetService(v interface{}) (interface{}, error) }
ServiceProvider is used to return instances of a given type
type SignatureService ¶
type SignatureService struct {
// contains filtered or unexported fields
}
SignatureService gives access to signature verifiers and signers bound to identities known by this service
func (*SignatureService) AuditorVerifier ¶
func (s *SignatureService) AuditorVerifier(id view.Identity) (Verifier, error)
AuditorVerifier returns a signature verifier for the given auditor identity
func (*SignatureService) GetSigner ¶
func (s *SignatureService) GetSigner(id view.Identity) (Signer, error)
GetSigner returns a signer bound to the given identity
func (*SignatureService) IsMe ¶
func (s *SignatureService) IsMe(party view.Identity) bool
IsMe returns true if for the given identity there is a signer registered
func (*SignatureService) IssuerVerifier ¶
func (s *SignatureService) IssuerVerifier(id view.Identity) (Verifier, error)
IssuerVerifier returns a signature verifier for the given issuer identity
func (*SignatureService) OwnerVerifier ¶
func (s *SignatureService) OwnerVerifier(id view.Identity) (Verifier, error)
OwnerVerifier returns a signature verifier for the given owner identity
func (*SignatureService) RegisterSigner ¶
func (s *SignatureService) RegisterSigner(identity view.Identity, signer Signer, verifier Verifier) error
RegisterSigner registers the pair (signer, verifier) bound to the given identity
type Signer ¶
type Signer interface { // Sign signs message bytes and returns the signature or an error on failure. Sign(message []byte) ([]byte, error) }
Signer models a signature signer
type TMS ¶
type TMS interface { // DeserializeToken returns the token and its issuer (if any). DeserializeToken(outputRaw []byte, tokenInfoRaw []byte) (*token.Token, view.Identity, error) // GetEnrollmentID extracts the enrollment id from the passed audit information GetEnrollmentID(bytes []byte) (string, error) }
type Transfer ¶
type Transfer struct { // Senders is the list of identities of the senders Senders []view.Identity // Receivers is the list of identities of the receivers Receivers []view.Identity // ExtraSigners is the list of extra identities that must sign the token request to make it valid. // This field is to be used by the token drivers to list any additional identities that must // sign the token request. ExtraSigners []view.Identity }
Transfer contains information about a transfer operation. In particular, it carries the identities of the senders and the receivers
type TransferAction ¶
type TransferAction struct {
// contains filtered or unexported fields
}
TransferAction represents an action that transfers tokens.
func (*TransferAction) GetInputs ¶
func (t *TransferAction) GetInputs() ([]string, error)
GetInputs returns the input ids used in the action.
func (*TransferAction) GetSerializedOutputs ¶
func (t *TransferAction) GetSerializedOutputs() ([][]byte, error)
GetSerializedOutputs returns the serialized outputs of the action.
func (*TransferAction) IsGraphHiding ¶
func (t *TransferAction) IsGraphHiding() bool
IsGraphHiding returns true if the action supports graph hiding.
func (*TransferAction) IsRedeemAt ¶
func (t *TransferAction) IsRedeemAt(i int) bool
IsRedeemAt returns true if the i-th output redeems.
func (*TransferAction) NumOutputs ¶
func (t *TransferAction) NumOutputs() int
NumOutputs returns the number of outputs in the action.
func (*TransferAction) Serialize ¶
func (t *TransferAction) Serialize() ([]byte, error)
Serialize returns the byte representation of the action.
func (*TransferAction) SerializeOutputAt ¶
func (t *TransferAction) SerializeOutputAt(i int) ([]byte, error)
SerializeOutputAt returns the serialized output at the i-th position.
type TransferMetadata ¶
type TransferMetadata struct {
*driver.TransferMetadata
}
TransferMetadata contains the metadata of a transfer action
func (*TransferMetadata) IsInputAbsent ¶
func (m *TransferMetadata) IsInputAbsent(j int) bool
IsInputAbsent returns true if the given input's metadata is absent
func (*TransferMetadata) IsOutputAbsent ¶
func (m *TransferMetadata) IsOutputAbsent(j int) bool
IsOutputAbsent returns true if the given output's metadata is absent
func (*TransferMetadata) Match ¶
func (m *TransferMetadata) Match(action *TransferAction) error
Match returns true if the given action matches this metadata
type TransferOption ¶
type TransferOption func(*TransferOptions) error
TransferOption is a function that modify TransferOptions
func WithTokenIDs ¶
func WithTokenIDs(ids ...*token.ID) TransferOption
WithTokenIDs sets the tokens ids to transfer
func WithTokenSelector ¶
func WithTokenSelector(selector Selector) TransferOption
WithTokenSelector sets the passed token selector
func WithTransferAttribute ¶
func WithTransferAttribute(attr, value interface{}) TransferOption
WithTransferAttribute sets an attribute to be used to customize the transfer command
func WithTransferMetadata ¶
func WithTransferMetadata(key string, value []byte) TransferOption
WithTransferMetadata sets transfer action metadata
type TransferOptions ¶
type TransferOptions struct { // Attributes is a container of generic options that might be driver specific Attributes map[interface{}]interface{} // Selector is the custom token selector to use. If nil, the default will be used. Selector Selector // TokenIDs to transfer. If empty, the tokens will be selected. TokenIDs []*token.ID }
TransferOptions models the options that can be passed to the transfer command
type UnspentTokensIterator ¶
type UnspentTokensIterator struct {
driver.UnspentTokensIterator
}
UnspentTokensIterator models an iterator over all unspent tokens stored in the vault
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates a token request
func (*Validator) UnmarshalActions ¶
UnmarshalActions returns the actions contained in the serialized token request
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault models a token vault
func (*Vault) NewQueryEngine ¶
func (v *Vault) NewQueryEngine() *QueryEngine
NewQueryEngine returns a new query engine
type VaultProvider ¶
type VaultProvider interface { // Vault returns a token vault instance for the passed inputs Vault(network string, channel string, namespace string) driver.Vault }
VaultProvider provides token vault instances
type Verifier ¶
type Verifier interface { // Verify verifies the signature of a given message Verify(message, sigma []byte) error }
Verifier models a signature verifier
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet models a generic wallet that has an identifier and contains one or mode identities. These identities own tokens.
func (*Wallet) ContainsToken ¶
func (w *Wallet) ContainsToken(token *token.UnspentToken) bool
ContainsToken returns true if the wallet contains an identity that owns the passed token.
func (*Wallet) TMS ¶
func (w *Wallet) TMS() *ManagementService
TMS returns the token management service.
type WalletManager ¶
type WalletManager struct {
// contains filtered or unexported fields
}
WalletManager defines the interface for managing wallets.
func (*WalletManager) AuditorWallet ¶
func (wm *WalletManager) AuditorWallet(id string) *AuditorWallet
AuditorWallet returns the auditor wallet bound to the passed identifier, if any is available. The identifier can be a label, as defined in the configuration file, an identity or a wallet ID. If no wallet is found, it returns nil.
func (*WalletManager) AuditorWalletByIdentity ¶
func (wm *WalletManager) AuditorWalletByIdentity(id view.Identity) *AuditorWallet
func (*WalletManager) CertifierWallet ¶
func (wm *WalletManager) CertifierWallet(id string) *CertifierWallet
CertifierWallet returns the certifier wallet bound to the passed identifier, if any is available. The identifier can be a label, as defined in the configuration file, an identity or a wallet ID. If no wallet is found, it returns nil.
func (*WalletManager) CertifierWalletByIdentity ¶
func (wm *WalletManager) CertifierWalletByIdentity(identity view.Identity) *CertifierWallet
CertifierWalletByIdentity returns the certifier wallet bound to the passed identity, if any is available. If no wallet is found, it returns nil.
func (*WalletManager) GetEnrollmentID ¶
func (wm *WalletManager) GetEnrollmentID(identity view.Identity) (string, error)
GetEnrollmentID returns the enrollment ID of passed identity
func (*WalletManager) IssuerWallet ¶
func (wm *WalletManager) IssuerWallet(id string) *IssuerWallet
IssuerWallet returns the issuer wallet bound to the passed identifier, if any is available. The identifier can be a label, as defined in the configuration file, an identity or a wallet ID. If no wallet is found, it returns nil.
func (*WalletManager) IssuerWalletByIdentity ¶
func (wm *WalletManager) IssuerWalletByIdentity(identity view.Identity) *IssuerWallet
IssuerWalletByIdentity returns the issuer wallet bound to the passed identity, if any is available. If no wallet is found, it returns nil.
func (*WalletManager) OwnerWallet ¶
func (wm *WalletManager) OwnerWallet(id string) *OwnerWallet
OwnerWallet returns the owner wallet bound to the passed identifier, if any is available. The identifier can be a label, as defined in the configuration file, an identity or a wallet ID. If no wallet is found, it returns nil.
func (*WalletManager) OwnerWalletByIdentity ¶
func (wm *WalletManager) OwnerWalletByIdentity(identity view.Identity) *OwnerWallet
OwnerWalletByIdentity returns the owner wallet bound to the passed identity, if any is available. If no wallet is found, it returns nil.
func (*WalletManager) RegisterIssuerWallet ¶
func (wm *WalletManager) RegisterIssuerWallet(id string, path string) error
RegisterIssuerWallet registers a new issuer wallet with the passed id
func (*WalletManager) RegisterOwnerWallet ¶
func (wm *WalletManager) RegisterOwnerWallet(id string, path string) error
RegisterOwnerWallet registers a new owner wallet with the passed id
func (*WalletManager) RegisterRecipientIdentity ¶
func (wm *WalletManager) RegisterRecipientIdentity(id view.Identity, auditInfo []byte, metadata []byte) error
RegisterRecipientIdentity registers a new recipient identity
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
zkatdlog/crypto/audit/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
zkatdlog/crypto/issue/nonanonym/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
zkatdlog/crypto/transfer/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
zkatdlog/crypto/validator/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
services
|
|
network/fabric/tcc/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
vault/translator/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |