Documentation
¶
Index ¶
- func SupportedTokenFormat(precision uint64) (token2.Format, error)
- type AuditorService
- type IssueService
- func (s *IssueService) DeserializeIssueAction(raw []byte) (driver.IssueAction, error)
- func (s *IssueService) Issue(ctx context.Context, issuerIdentity driver.Identity, tokenType token2.Type, ...) (driver.IssueAction, *driver.IssueMetadata, error)
- func (s *IssueService) VerifyIssue(tr driver.IssueAction, metadata []*driver.IssueOutputMetadata) error
- type Service
- type TokenLoader
- type TokensService
- func (s *TokensService) Deobfuscate(output driver.TokenOutput, outputMetadata driver.TokenOutputMetadata) (*token2.Token, driver.Identity, []driver.Identity, token2.Format, error)
- func (s *TokensService) Recipients(output driver.TokenOutput) ([]driver.Identity, error)
- func (s *TokensService) SupportedTokenFormats() []token2.Format
- type TokensUpgradeService
- func (s *TokensUpgradeService) CheckUpgradeProof(ch driver.TokensUpgradeChallenge, proof driver.TokensUpgradeProof, ...) (bool, error)
- func (s *TokensUpgradeService) GenUpgradeProof(ch driver.TokensUpgradeChallenge, tokens []token2.LedgerToken, ...) (driver.TokensUpgradeProof, error)
- func (s *TokensUpgradeService) NewUpgradeChallenge() (driver.TokensUpgradeChallenge, error)
- type TransferService
- func (s *TransferService) DeserializeTransferAction(raw []byte) (driver.TransferAction, error)
- func (s *TransferService) Transfer(ctx context.Context, anchor driver.TokenRequestAnchor, ...) (driver.TransferAction, *driver.TransferMetadata, error)
- func (s *TransferService) VerifyTransfer(ctx context.Context, tr driver.TransferAction, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuditorService ¶
type AuditorService struct{}
func NewAuditorService ¶
func NewAuditorService() *AuditorService
func (*AuditorService) AuditorCheck ¶
func (s *AuditorService) AuditorCheck(ctx context.Context, request *driver.TokenRequest, metadata *driver.TokenRequestMetadata, anchor driver.TokenRequestAnchor) error
AuditorCheck verifies if the passed tokenRequest matches the tokenRequestMetadata fabtoken does not make use of AuditorCheck as the token request contains token information in the clear
type IssueService ¶
type IssueService struct { PublicParamsManager driver.PublicParamsManager WalletService driver.WalletService Deserializer driver.Deserializer }
func NewIssueService ¶
func NewIssueService(publicParamsManager driver.PublicParamsManager, walletService driver.WalletService, deserializer driver.Deserializer) *IssueService
func (*IssueService) DeserializeIssueAction ¶
func (s *IssueService) DeserializeIssueAction(raw []byte) (driver.IssueAction, error)
DeserializeIssueAction un-marshals the passed bytes into an IssueAction If unmarshalling fails, then DeserializeIssueAction returns an error
func (*IssueService) Issue ¶
func (s *IssueService) Issue(ctx context.Context, issuerIdentity driver.Identity, tokenType token2.Type, values []uint64, owners [][]byte, opts *driver.IssueOptions) (driver.IssueAction, *driver.IssueMetadata, error)
Issue returns an IssueAction as a function of the passed arguments Issue also returns a serialization OutputMetadata associated with issued tokens and the identity of the issuer
func (*IssueService) VerifyIssue ¶
func (s *IssueService) VerifyIssue(tr driver.IssueAction, metadata []*driver.IssueOutputMetadata) error
VerifyIssue checks if the outputs of an IssueAction match the passed tokenInfos
type Service ¶
type Service struct { *common.Service[*setup.PublicParams] }
func NewService ¶
func NewService( logger logging.Logger, ws *wallet.Service, ppm common.PublicParametersManager[*setup.PublicParams], identityProvider driver.IdentityProvider, deserializer driver.Deserializer, configuration driver.Configuration, issueService driver.IssueService, transferService driver.TransferService, auditorService driver.AuditorService, tokensService driver.TokensService, tokensUpgradeService driver.TokensUpgradeService, authorization driver.Authorization, ) (*Service, error)
type TokenLoader ¶
type TokensService ¶
type TokensService struct { IdentityDeserializer driver.Deserializer OutputTokenFormat token2.Format }
func NewTokensService ¶
func NewTokensService(pp *setup.PublicParams, identityDeserializer driver.Deserializer) (*TokensService, error)
func (*TokensService) Deobfuscate ¶
func (s *TokensService) Deobfuscate(output driver.TokenOutput, outputMetadata driver.TokenOutputMetadata) (*token2.Token, driver.Identity, []driver.Identity, token2.Format, error)
Deobfuscate returns a deserialized token and the identity of its issuer
func (*TokensService) Recipients ¶
func (s *TokensService) Recipients(output driver.TokenOutput) ([]driver.Identity, error)
func (*TokensService) SupportedTokenFormats ¶
func (s *TokensService) SupportedTokenFormats() []token2.Format
type TokensUpgradeService ¶
type TokensUpgradeService struct{}
func (*TokensUpgradeService) CheckUpgradeProof ¶
func (s *TokensUpgradeService) CheckUpgradeProof(ch driver.TokensUpgradeChallenge, proof driver.TokensUpgradeProof, tokens []token2.LedgerToken) (bool, error)
func (*TokensUpgradeService) GenUpgradeProof ¶
func (s *TokensUpgradeService) GenUpgradeProof(ch driver.TokensUpgradeChallenge, tokens []token2.LedgerToken, witness driver.TokensUpgradeWitness) (driver.TokensUpgradeProof, error)
func (*TokensUpgradeService) NewUpgradeChallenge ¶
func (s *TokensUpgradeService) NewUpgradeChallenge() (driver.TokensUpgradeChallenge, error)
type TransferService ¶
type TransferService struct { Logger logging.Logger PublicParametersManager common.PublicParametersManager[*setup.PublicParams] WalletService driver.WalletService TokenLoader TokenLoader Deserializer driver.Deserializer }
func NewTransferService ¶
func NewTransferService( logger logging.Logger, publicParametersManager common.PublicParametersManager[*setup.PublicParams], walletService driver.WalletService, tokenLoader TokenLoader, deserializer driver.Deserializer, ) *TransferService
func (*TransferService) DeserializeTransferAction ¶
func (s *TransferService) DeserializeTransferAction(raw []byte) (driver.TransferAction, error)
DeserializeTransferAction un-marshals a TransferAction from the passed array of bytes. DeserializeTransferAction returns an error, if the un-marshalling fails.
func (*TransferService) Transfer ¶
func (s *TransferService) Transfer(ctx context.Context, anchor driver.TokenRequestAnchor, wallet driver.OwnerWallet, ids []*token.ID, outputs []*token.Token, opts *driver.TransferOptions) (driver.TransferAction, *driver.TransferMetadata, error)
Transfer returns a TransferAction as a function of the passed arguments It also returns the corresponding TransferMetadata
func (*TransferService) VerifyTransfer ¶
func (s *TransferService) VerifyTransfer(ctx context.Context, tr driver.TransferAction, outputMetadata []*driver.TransferOutputMetadata) error
VerifyTransfer checks the outputs in the TransferAction against the passed tokenInfos