Documentation ¶
Index ¶
- Variables
- func GenerateBytesUUID() []byte
- func GenerateUUID() string
- func GetIssuerWallet(sp view2.ServiceProvider, id string, opts ...token.ServiceOption) *token.IssuerWallet
- func GetIssuerWalletForChannel(sp view2.ServiceProvider, channel, id string, opts ...token.ServiceOption) *token.IssuerWallet
- func MyAuditorWallet(sp view2.ServiceProvider, opts ...token.ServiceOption) *token.AuditorWallet
- func MyIssuerWallet(context view.Context, opts ...token.ServiceOption) *token.IssuerWallet
- func NewAcceptView(tx *Transaction) view.View
- func NewCollectEndorsementsView(tx *Transaction) view.View
- func NewFilter(wallet string, service QueryService, precision uint64, ...) *filter
- func NewFinalityView(tx *Transaction) view.View
- func NewFinalityWithTimeoutView(tx *Transaction, timeout time.Duration) view.View
- func NewOrderingAndFinalityView(tx *Transaction) view.View
- func NewOrderingAndFinalityWithTimeoutView(tx *Transaction, timeout time.Duration) view.View
- func RequestRecipientIdentity(context view.Context, recipient view.Identity, opts ...token.ServiceOption) (view.Identity, error)
- func RespondRequestRecipientIdentity(context view.Context) (view.Identity, error)
- func WithType(tokenType string) token.ListTokensOption
- func WithUniqueID(uniqueID string) token.IssueOption
- type AutoLinearState
- type Filter
- type LinearState
- type MetricsAgent
- type OutputStream
- 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) Filter(f func(t *token.Output) bool) *OutputStream
- func (o *OutputStream) StateAt(index int, state interface{}) error
- func (o *OutputStream) Validate() error
- type OwnerWallet
- func GetWallet(sp view2.ServiceProvider, id string, opts ...token.ServiceOption) *OwnerWallet
- func GetWalletForChannel(sp view2.ServiceProvider, channel, id string, opts ...token.ServiceOption) *OwnerWallet
- func MyWallet(sp view2.ServiceProvider, opts ...token.ServiceOption) *OwnerWallet
- func MyWalletFromTx(sp view2.ServiceProvider, tx *Transaction) *OwnerWallet
- type QueryExecutor
- type QueryService
- type Transaction
- type TxOption
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoResults is returned when no results are found ErrNoResults = errors.New("no results found") )
Functions ¶
func GenerateBytesUUID ¶
func GenerateBytesUUID() []byte
GenerateBytesUUID returns a UUID based on RFC 4122 returning the generated bytes
func GetIssuerWallet ¶
func GetIssuerWallet(sp view2.ServiceProvider, id string, opts ...token.ServiceOption) *token.IssuerWallet
GetIssuerWallet returns the issuer wallet whose id is the passed id. If the passed id is empty, GetIssuerWallet has the same behaviour of MyIssuerWallet. It returns nil, if no wallet is found.
func GetIssuerWalletForChannel ¶
func GetIssuerWalletForChannel(sp view2.ServiceProvider, channel, id string, opts ...token.ServiceOption) *token.IssuerWallet
GetIssuerWalletForChannel returns the issuer wallet whose id is the passed id for the passed channel. If the passed id is empty, GetIssuerWalletForChannel has the same behaviour of MyIssuerWallet. It returns nil, if no wallet is found.
func MyAuditorWallet ¶
func MyAuditorWallet(sp view2.ServiceProvider, opts ...token.ServiceOption) *token.AuditorWallet
MyAuditorWallet returns the default auditor wallet, nil if not found.
func MyIssuerWallet ¶
func MyIssuerWallet(context view.Context, opts ...token.ServiceOption) *token.IssuerWallet
MyIssuerWallet returns the default issuer wallet, nil if not found
func NewAcceptView ¶
func NewAcceptView(tx *Transaction) view.View
func NewCollectEndorsementsView ¶
func NewCollectEndorsementsView(tx *Transaction) view.View
func NewFilter ¶
func NewFilter(wallet string, service QueryService, precision uint64, metricsAgent MetricsAgent) *filter
func NewFinalityView ¶
func NewFinalityView(tx *Transaction) view.View
func NewFinalityWithTimeoutView ¶
func NewFinalityWithTimeoutView(tx *Transaction, timeout time.Duration) view.View
func NewOrderingAndFinalityView ¶
func NewOrderingAndFinalityView(tx *Transaction) view.View
func NewOrderingAndFinalityWithTimeoutView ¶
func NewOrderingAndFinalityWithTimeoutView(tx *Transaction, timeout time.Duration) view.View
func WithType ¶
func WithType(tokenType string) token.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.
func WithUniqueID ¶
func WithUniqueID(uniqueID string) token.IssueOption
WithUniqueID sets the unique ID of the NFT
Types ¶
type AutoLinearState ¶
type Filter ¶
type Filter interface { // ContainsToken returns true if the passed token is recognized, false otherwise. ContainsToken(token *token2.UnspentToken) bool }
Filter is a filter for NFTCC
type LinearState ¶
type LinearState interface { // SetLinearID assigns the passed id to the state SetLinearID(id string) string }
LinearState models a state with a unique identifier that does not change through the evolution of the state.
type MetricsAgent ¶
type OutputStream ¶
type OutputStream struct {
*token.OutputStream
}
func (*OutputStream) ByEnrollmentID ¶
func (o *OutputStream) ByEnrollmentID(id string) *OutputStream
func (*OutputStream) ByRecipient ¶
func (o *OutputStream) ByRecipient(id view.Identity) *OutputStream
func (*OutputStream) ByType ¶
func (o *OutputStream) ByType(typ string) *OutputStream
func (*OutputStream) Filter ¶
func (o *OutputStream) Filter(f func(t *token.Output) bool) *OutputStream
Filter returns a stream of output filtered applying the passed filter
func (*OutputStream) StateAt ¶
func (o *OutputStream) StateAt(index int, state interface{}) error
func (*OutputStream) Validate ¶
func (o *OutputStream) Validate() error
type OwnerWallet ¶
type OwnerWallet struct { view2.ServiceProvider *token.OwnerWallet Precision uint64 }
func GetWallet ¶
func GetWallet(sp view2.ServiceProvider, id string, opts ...token.ServiceOption) *OwnerWallet
GetWallet returns the wallet whose id is the passed id. If the passed id is empty, GetWallet has the same behaviour of MyWallet. It returns nil, if no wallet is found.
func GetWalletForChannel ¶
func GetWalletForChannel(sp view2.ServiceProvider, channel, id string, opts ...token.ServiceOption) *OwnerWallet
GetWalletForChannel returns the wallet whose id is the passed id for the passed channel. If the passed id is empty, GetWalletForChannel has the same behaviour of MyWalletFromTx. It returns nil, if no wallet is found.
func MyWallet ¶
func MyWallet(sp view2.ServiceProvider, opts ...token.ServiceOption) *OwnerWallet
MyWallet returns the default wallet, nil if not found.
func MyWalletFromTx ¶
func MyWalletFromTx(sp view2.ServiceProvider, tx *Transaction) *OwnerWallet
MyWalletFromTx returns the default wallet for the tuple (network, channel, namespace) as identified by the passed transaction. Returns nil if no wallet is found.
func (*OwnerWallet) QueryByKey ¶
func (o *OwnerWallet) QueryByKey(state interface{}, key string, value string) error
type QueryExecutor ¶
type QueryExecutor struct {
// contains filtered or unexported fields
}
func NewQueryExecutor ¶
func NewQueryExecutor(sp view.ServiceProvider, wallet string, precision uint64, opts ...token.ServiceOption) (*QueryExecutor, error)
func (*QueryExecutor) QueryByKey ¶
func (s *QueryExecutor) QueryByKey(state interface{}, key string, value string) error
type QueryService ¶
type Transaction ¶
type Transaction struct {
*ttx.Transaction
}
func NewAnonymousTransaction ¶
func NewAnonymousTransaction(sp view.Context, opts ...TxOption) (*Transaction, error)
func ReceiveTransaction ¶
func ReceiveTransaction(context view.Context) (*Transaction, error)
func Wrap ¶
func Wrap(tx *ttx.Transaction) *Transaction
func (*Transaction) Issue ¶
func (t *Transaction) Issue(wallet *token.IssuerWallet, state interface{}, recipient view.Identity, opts ...token.IssueOption) error
func (*Transaction) Outputs ¶
func (t *Transaction) Outputs() (*OutputStream, error)
func (*Transaction) Transfer ¶
func (t *Transaction) Transfer(wallet *OwnerWallet, state interface{}, recipient view.Identity, opts ...token.TransferOption) error