v1

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportedTokenFormat

func SupportedTokenFormat(precision uint64) (token2.Format, error)

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)

func (*Service) Validator

func (s *Service) Validator() (driver.Validator, error)

type TokenLoader

type TokenLoader interface {
	GetTokens(ctx context.Context, ids []*token.ID) ([]*token.Token, error)
}

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

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 (*TokensUpgradeService) GenUpgradeProof

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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