Documentation
¶
Index ¶
- Constants
- type Envelope
- type FinalityListener
- type GetFunc
- type Ledger
- type LocalMembership
- type Network
- func (n *Network) AddFinalityListener(namespace string, txID string, listener FinalityListener) error
- func (n *Network) AnonymousIdentity() (view.Identity, error)
- func (n *Network) AreTokensSpent(ctx context.Context, namespace string, tokenIDs []*token2.ID, meta []string) ([]bool, error)
- func (n *Network) Broadcast(ctx context.Context, blob interface{}) error
- func (n *Network) Channel() string
- func (n *Network) ComputeTxID(id *TxID) string
- func (n *Network) Connect(ns string) ([]token.ServiceOption, error)
- func (n *Network) FetchPublicParameters(namespace string) ([]byte, error)
- func (n *Network) Ledger() (*Ledger, error)
- func (n *Network) LocalMembership() *LocalMembership
- func (n *Network) LookupTransferMetadataKey(namespace, startingTxID, key string, timeout time.Duration, stopOnLastTx bool, ...) ([]byte, error)
- func (n *Network) Name() string
- func (n *Network) NewEnvelope() *Envelope
- func (n *Network) Normalize(opt *token.ServiceOptions) (*token.ServiceOptions, error)
- func (n *Network) QueryTokens(ctx context.Context, namespace string, IDs []*token2.ID) ([][]byte, error)
- func (n *Network) RemoveFinalityListener(id string, listener FinalityListener) error
- func (n *Network) RequestApproval(context view.Context, tms *token.ManagementService, requestRaw []byte, ...) (*Envelope, error)
- type Provider
- type TransientMap
- func (m TransientMap) Exists(key string) bool
- func (m TransientMap) Get(id string) []byte
- func (m TransientMap) GetState(key string, state interface{}) error
- func (m TransientMap) IsEmpty() bool
- func (m TransientMap) Set(key string, raw []byte) error
- func (m TransientMap) SetState(key string, state interface{}) error
- type TxID
- type ValidationCode
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct {
// contains filtered or unexported fields
}
func (*Envelope) MarshalJSON ¶
func (*Envelope) UnmarshalJSON ¶
type FinalityListener ¶ added in v0.4.0
type FinalityListener interface { // OnStatus is called when the status of a transaction changes OnStatus(ctx context.Context, txID string, status int, message string, tokenRequestHash []byte) }
FinalityListener is the interface that must be implemented to receive transaction status change notifications
type LocalMembership ¶
type LocalMembership struct {
// contains filtered or unexported fields
}
func (*LocalMembership) AnonymousIdentity ¶
func (l *LocalMembership) AnonymousIdentity() (view.Identity, error)
func (*LocalMembership) DefaultIdentity ¶
func (l *LocalMembership) DefaultIdentity() view.Identity
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network provides access to the remote network
func GetInstance ¶
func GetInstance(sp token.ServiceProvider, network, channel string) *Network
GetInstance returns a network instance for the given network and channel
func (*Network) AddFinalityListener ¶ added in v0.4.0
func (n *Network) AddFinalityListener(namespace string, txID string, listener FinalityListener) error
AddFinalityListener registers a listener for transaction status for the passed transaction id. If the status is already valid or invalid, the listener is called immediately. When the listener is invoked, then it is also removed. If the transaction id is empty, the listener will be called on status changes of any transaction. In this case, the listener is not removed
func (*Network) AnonymousIdentity ¶
AnonymousIdentity returns a fresh anonymous identity
func (*Network) AreTokensSpent ¶
func (n *Network) AreTokensSpent(ctx context.Context, namespace string, tokenIDs []*token2.ID, meta []string) ([]bool, error)
AreTokensSpent retrieves the spent flag for the passed ids
func (*Network) ComputeTxID ¶
ComputeTxID computes the transaction ID in the target network format for the given tx id
func (*Network) Connect ¶ added in v0.4.0
func (n *Network) Connect(ns string) ([]token.ServiceOption, error)
func (*Network) FetchPublicParameters ¶
FetchPublicParameters returns the public parameters for the given namespace
func (*Network) LocalMembership ¶
func (n *Network) LocalMembership() *LocalMembership
LocalMembership returns the local membership for this network
func (*Network) LookupTransferMetadataKey ¶
func (n *Network) LookupTransferMetadataKey(namespace, startingTxID, key string, timeout time.Duration, stopOnLastTx bool, opts ...token.ServiceOption) ([]byte, error)
LookupTransferMetadataKey searches for a transfer metadata key containing the passed sub-key starting from the passed transaction id in the given namespace. The operation gets canceled if the passed timeout gets reached or, if stopOnLastTx is true, when the last transaction in the vault is reached.
func (*Network) NewEnvelope ¶
NewEnvelope creates a new envelope
func (*Network) Normalize ¶ added in v0.4.0
func (n *Network) Normalize(opt *token.ServiceOptions) (*token.ServiceOptions, error)
func (*Network) QueryTokens ¶
func (n *Network) QueryTokens(ctx context.Context, namespace string, IDs []*token2.ID) ([][]byte, error)
QueryTokens returns the tokens corresponding to the given token ids int the given namespace
func (*Network) RemoveFinalityListener ¶ added in v0.4.0
func (n *Network) RemoveFinalityListener(id string, listener FinalityListener) error
RemoveFinalityListener unregisters the passed listener.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider returns an instance of network provider
func GetProvider ¶ added in v0.4.0
func GetProvider(sp token.ServiceProvider) *Provider
func NewProvider ¶
func NewProvider() *Provider
NewProvider returns a new instance of network provider
func (*Provider) GetNetwork ¶
GetNetwork returns a network instance for the given network and channel
func (*Provider) Normalize ¶ added in v0.4.0
func (np *Provider) Normalize(opt *token.ServiceOptions) (*token.ServiceOptions, error)
func (*Provider) RegisterDriver ¶ added in v0.4.0
type TransientMap ¶
func (TransientMap) Exists ¶
func (m TransientMap) Exists(key string) bool
func (TransientMap) Get ¶
func (m TransientMap) Get(id string) []byte
func (TransientMap) GetState ¶
func (m TransientMap) GetState(key string, state interface{}) error
func (TransientMap) IsEmpty ¶
func (m TransientMap) IsEmpty() bool
func (TransientMap) SetState ¶
func (m TransientMap) SetState(key string, state interface{}) error
type ValidationCode ¶
type ValidationCode = driver.ValidationCode
Directories
¶
Path | Synopsis |
---|---|
rws/translator/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
tcc/main
command
|
|
tcc/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
tcc/fabricv25
module
|