actions

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
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

type Output fabtoken.Token

Output carries the output of an action

func (*Output) Deserialize

func (t *Output) Deserialize(bytes []byte) error

Deserialize unmarshals Token

func (*Output) GetOwner

func (t *Output) GetOwner() []byte

func (*Output) IsRedeem

func (t *Output) IsRedeem() bool

IsRedeem returns true if the owner of a Token is empty todo update interface to account for nil t.Token.Owner and nil t.Token

func (*Output) Serialize

func (t *Output) Serialize() ([]byte, error)

Serialize marshals a Token

func (*Output) Validate

func (t *Output) Validate(checkOwner bool) error

type OutputMetadata

type OutputMetadata fabtoken.Metadata

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

Jump to

Keyboard shortcuts

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