Documentation
¶
Index ¶
- Constants
- type IssueAction
- func (i *IssueAction) Deserialize(raw []byte) error
- func (i *IssueAction) ExtraSigners() []driver.Identity
- func (i *IssueAction) GetInputs() []*token.ID
- func (i *IssueAction) GetIssuer() []byte
- func (i *IssueAction) GetMetadata() map[string][]byte
- func (i *IssueAction) GetOutputs() []driver.Output
- func (i *IssueAction) GetSerialNumbers() []string
- func (i *IssueAction) GetSerializedInputs() ([][]byte, error)
- func (i *IssueAction) GetSerializedOutputs() ([][]byte, error)
- func (i *IssueAction) IsAnonymous() bool
- func (i *IssueAction) IsGraphHiding() bool
- func (i *IssueAction) NumInputs() int
- func (i *IssueAction) NumOutputs() int
- func (i *IssueAction) Serialize() ([]byte, error)
- func (i *IssueAction) Validate() error
- type Output
- type OutputMetadata
- type TransferAction
- func (t *TransferAction) Deserialize(raw []byte) error
- func (t *TransferAction) ExtraSigners() []driver.Identity
- func (t *TransferAction) GetInputs() []*token.ID
- func (t *TransferAction) GetIssuer() driver.Identity
- func (t *TransferAction) GetMetadata() map[string][]byte
- func (t *TransferAction) GetOutputs() []driver.Output
- func (t *TransferAction) GetSerialNumbers() []string
- func (t *TransferAction) GetSerializedInputs() ([][]byte, error)
- func (t *TransferAction) GetSerializedOutputs() ([][]byte, error)
- func (t *TransferAction) IsGraphHiding() bool
- func (t *TransferAction) IsRedeem() bool
- func (t *TransferAction) IsRedeemAt(index int) bool
- func (t *TransferAction) NumInputs() int
- func (t *TransferAction) NumOutputs() int
- func (t *TransferAction) Serialize() ([]byte, error)
- func (t *TransferAction) SerializeOutputAt(index int) ([]byte, error)
- func (t *TransferAction) Validate() error
- type TransferActionInput
Constants ¶
const ProtocolV1 = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IssueAction ¶
type IssueAction struct { // issuer's public key Issuer driver.Identity // new tokens to be issued Outputs []*Output // metadata of the issue action Metadata map[string][]byte }
IssueAction encodes a fabtoken Issue
func (*IssueAction) Deserialize ¶
func (i *IssueAction) Deserialize(raw []byte) error
Deserialize un-marshals IssueAction
func (*IssueAction) ExtraSigners ¶
func (i *IssueAction) ExtraSigners() []driver.Identity
func (*IssueAction) GetInputs ¶
func (i *IssueAction) GetInputs() []*token.ID
func (*IssueAction) GetIssuer ¶
func (i *IssueAction) GetIssuer() []byte
GetIssuer returns the issuer encoded in IssueAction
func (*IssueAction) GetMetadata ¶
func (i *IssueAction) GetMetadata() map[string][]byte
GetMetadata returns the IssueAction metadata
func (*IssueAction) GetOutputs ¶
func (i *IssueAction) GetOutputs() []driver.Output
GetOutputs returns the outputs in an IssueAction
func (*IssueAction) GetSerialNumbers ¶
func (i *IssueAction) GetSerialNumbers() []string
func (*IssueAction) GetSerializedInputs ¶
func (i *IssueAction) GetSerializedInputs() ([][]byte, error)
func (*IssueAction) GetSerializedOutputs ¶
func (i *IssueAction) GetSerializedOutputs() ([][]byte, error)
GetSerializedOutputs returns the serialization of the outputs in an IssueAction
func (*IssueAction) IsAnonymous ¶
func (i *IssueAction) IsAnonymous() bool
IsAnonymous returns false, indicating that the identity of issuers in fabtoken is revealed during issue
func (*IssueAction) IsGraphHiding ¶
func (i *IssueAction) IsGraphHiding() bool
IsGraphHiding returns false, indicating that fabtoken does not hide the transaction graph
func (*IssueAction) NumInputs ¶
func (i *IssueAction) NumInputs() int
func (*IssueAction) NumOutputs ¶
func (i *IssueAction) NumOutputs() int
NumOutputs returns the number of outputs in an IssueAction
func (*IssueAction) Serialize ¶
func (i *IssueAction) Serialize() ([]byte, error)
Serialize marshal IssueAction
func (*IssueAction) Validate ¶
func (i *IssueAction) Validate() error
type Output ¶
Output carries the output of an action
func (*Output) Deserialize ¶
Deserialize unmarshals Token
type OutputMetadata ¶
OutputMetadata contains a serialization of the issuer of the token. type, value and owner of token can be derived from the token itself.
func (*OutputMetadata) Deserialize ¶
func (m *OutputMetadata) Deserialize(b []byte) error
Deserialize un-marshals Metadata
func (*OutputMetadata) Serialize ¶
func (m *OutputMetadata) Serialize() ([]byte, error)
Serialize un-marshals Metadata
type TransferAction ¶
type TransferAction struct { Inputs []*TransferActionInput // outputs to be created as a result of the transfer Outputs []*Output // Metadata contains the transfer action's metadata Metadata map[string][]byte // Issuer contains the identity of the issuer to sign the transfer action Issuer driver.Identity }
TransferAction encodes a fabtoken transfer
func (*TransferAction) Deserialize ¶
func (t *TransferAction) Deserialize(raw []byte) error
Deserialize un-marshals TransferAction
func (*TransferAction) ExtraSigners ¶
func (t *TransferAction) ExtraSigners() []driver.Identity
func (*TransferAction) GetInputs ¶
func (t *TransferAction) GetInputs() []*token.ID
GetInputs returns inputs of the TransferAction
func (*TransferAction) GetIssuer ¶
func (t *TransferAction) GetIssuer() driver.Identity
GetIssuer returns the issuer to sign the transaction
func (*TransferAction) GetMetadata ¶
func (t *TransferAction) GetMetadata() map[string][]byte
GetMetadata returns the transfer action's metadata
func (*TransferAction) GetOutputs ¶
func (t *TransferAction) GetOutputs() []driver.Output
GetOutputs returns the outputs in a TransferAction
func (*TransferAction) GetSerialNumbers ¶
func (t *TransferAction) GetSerialNumbers() []string
func (*TransferAction) GetSerializedInputs ¶
func (t *TransferAction) GetSerializedInputs() ([][]byte, error)
func (*TransferAction) GetSerializedOutputs ¶
func (t *TransferAction) GetSerializedOutputs() ([][]byte, error)
GetSerializedOutputs returns the serialization of the outputs in a TransferAction
func (*TransferAction) IsGraphHiding ¶
func (t *TransferAction) IsGraphHiding() bool
IsGraphHiding returns false, indicating that fabtoken does not hide the transaction graph
func (*TransferAction) IsRedeem ¶
func (t *TransferAction) IsRedeem() bool
IsRedeem checks if this action is a Redeem Transfer
func (*TransferAction) IsRedeemAt ¶
func (t *TransferAction) IsRedeemAt(index int) bool
IsRedeemAt returns true if the output at the specified index is a redeemed output todo update interface to account for nil t.outputs[index]
func (*TransferAction) NumInputs ¶
func (t *TransferAction) NumInputs() int
func (*TransferAction) NumOutputs ¶
func (t *TransferAction) NumOutputs() int
NumOutputs returns the number of outputs in an TransferAction
func (*TransferAction) Serialize ¶
func (t *TransferAction) Serialize() ([]byte, error)
Serialize marshals TransferAction
func (*TransferAction) SerializeOutputAt ¶
func (t *TransferAction) SerializeOutputAt(index int) ([]byte, error)
SerializeOutputAt marshals the output at the specified index in TransferAction
func (*TransferAction) Validate ¶
func (t *TransferAction) Validate() error
type TransferActionInput ¶
type TransferActionInput struct { // identifier of token to be transferred ID *token.ID // Output is the input transferred Input *Output }
func (*TransferActionInput) FromProtos ¶
func (a *TransferActionInput) FromProtos(input *actions.TransferActionInput) error
func (*TransferActionInput) ToProtos ¶
func (a *TransferActionInput) ToProtos() (*actions.TransferActionInput, error)