nftfx

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: BSD-3-Clause Imports: 12 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// MaxPayloadSize is the maximum size that can be placed into a payload
	MaxPayloadSize = constants.KiB
)
View Source
const Name = "nftfx"
View Source
const TypeKind = wire.TypeKindNFT

TypeKind is the wire-level discriminator for every nftfx primitive's wire envelope. nftfx is an application fx built on secp256k1 credentials; the TypeKind names the fx family, not the curve.

Variables

View Source
var (

	// ID that this Fx uses when labeled
	ID = ids.ID{'n', 'f', 't', 'f', 'x'}
)

Functions

This section is empty.

Types

type Credential

type Credential struct {
	secp256k1fx.Credential `serialize:"true"`
}

func WrapCredential added in v0.5.1

func WrapCredential(b []byte) (*Credential, error)

WrapCredential parses a wire envelope into a fresh Credential. Envelope TypeKind must be TypeKindNFT.

func (*Credential) Bytes added in v0.5.1

func (cr *Credential) Bytes() []byte

Bytes returns the ZAP-native wire envelope for this Credential. Envelope = (TypeKindNFT, ShapeKindCredential, ZAP message) — the signatures are secp256k1 (nftfx is built on secp256k1 credentials); the TypeKind names the owning fx.

type Factory

type Factory struct{}

func (*Factory) New

func (*Factory) New() any

type Fx

type Fx struct{ secp256k1fx.Fx }

func (*Fx) Initialize

func (fx *Fx) Initialize(vmIntf interface{}) error

func (*Fx) VerifyMintOperation

func (fx *Fx) VerifyMintOperation(tx secp256k1fx.UnsignedTx, op *MintOperation, cred *Credential, utxoIntf interface{}) error

func (*Fx) VerifyOperation

func (fx *Fx) VerifyOperation(txIntf, opIntf, credIntf interface{}, utxosIntf []interface{}) error

func (*Fx) VerifyTransfer

func (*Fx) VerifyTransfer(_, _, _, _ interface{}) error

func (*Fx) VerifyTransferOperation

func (fx *Fx) VerifyTransferOperation(tx secp256k1fx.UnsignedTx, op *TransferOperation, cred *Credential, utxoIntf interface{}) error

type MintOperation

type MintOperation struct {
	MintInput secp256k1fx.Input           `serialize:"true" json:"mintInput"`
	GroupID   uint32                      `serialize:"true" json:"groupID"`
	Payload   types.JSONByteSlice         `serialize:"true" json:"payload"`
	Outputs   []*secp256k1fx.OutputOwners `serialize:"true" json:"outputs"`
}

func WrapMintOperation added in v0.5.1

func WrapMintOperation(b []byte) (*MintOperation, error)

WrapMintOperation parses a wire envelope into a fresh MintOperation. Envelope TypeKind must be TypeKindNFT.

func (*MintOperation) Bytes added in v0.5.1

func (op *MintOperation) Bytes() []byte

Bytes returns the ZAP-native wire envelope for this MintOperation. Each minted-to owner group is a nested OutputOwners envelope.

func (*MintOperation) Cost

func (op *MintOperation) Cost() (uint64, error)

func (*MintOperation) InitRuntime

func (op *MintOperation) InitRuntime(rt *runtime.Runtime)

func (*MintOperation) InitializeRuntime

func (op *MintOperation) InitializeRuntime(rt *runtime.Runtime) error

func (*MintOperation) Outs

func (op *MintOperation) Outs() []verify.State

Outs Returns []TransferOutput as []verify.State

func (*MintOperation) Verify

func (op *MintOperation) Verify() error

type MintOutput

type MintOutput struct {
	verify.IsState `serialize:"-" json:"-"`

	GroupID                  uint32 `serialize:"true" json:"groupID"`
	secp256k1fx.OutputOwners `serialize:"true"`
}

func WrapMintOutput added in v0.5.1

func WrapMintOutput(b []byte) (*MintOutput, error)

WrapMintOutput parses a wire envelope into a fresh MintOutput. Envelope TypeKind must be TypeKindNFT.

func (*MintOutput) Bytes added in v0.5.1

func (out *MintOutput) Bytes() []byte

Bytes returns the ZAP-native wire envelope for this MintOutput. Envelope = (TypeKindNFT, ShapeKindNFTMintOutput, ZAP message).

func (*MintOutput) MarshalJSON

func (out *MintOutput) MarshalJSON() ([]byte, error)

MarshalJSON marshals Amt and the embedded OutputOwners struct into a JSON readable format If OutputOwners cannot be serialized then this will return error

type TransferOperation

type TransferOperation struct {
	Input  secp256k1fx.Input `serialize:"true" json:"input"`
	Output TransferOutput    `serialize:"true" json:"output"`
}

func WrapTransferOperation added in v0.5.1

func WrapTransferOperation(b []byte) (*TransferOperation, error)

WrapTransferOperation parses a wire envelope into a fresh TransferOperation. Envelope TypeKind must be TypeKindNFT.

func (*TransferOperation) Bytes added in v0.5.1

func (op *TransferOperation) Bytes() []byte

Bytes returns the ZAP-native wire envelope for this TransferOperation.

func (*TransferOperation) Cost

func (op *TransferOperation) Cost() (uint64, error)

func (*TransferOperation) InitRuntime

func (op *TransferOperation) InitRuntime(rt *runtime.Runtime)

func (*TransferOperation) InitializeRuntime

func (op *TransferOperation) InitializeRuntime(rt *runtime.Runtime) error

func (*TransferOperation) Outs

func (op *TransferOperation) Outs() []verify.State

func (*TransferOperation) Verify

func (op *TransferOperation) Verify() error

type TransferOutput

type TransferOutput struct {
	verify.IsState `serialize:"-" json:"-"`

	GroupID                  uint32              `serialize:"true" json:"groupID"`
	Payload                  types.JSONByteSlice `serialize:"true" json:"payload"`
	secp256k1fx.OutputOwners `serialize:"true"`
}

func WrapTransferOutput added in v0.5.1

func WrapTransferOutput(b []byte) (*TransferOutput, error)

WrapTransferOutput parses a wire envelope into a fresh TransferOutput. Envelope TypeKind must be TypeKindNFT.

func (*TransferOutput) Bytes added in v0.5.1

func (out *TransferOutput) Bytes() []byte

Bytes returns the ZAP-native wire envelope for this TransferOutput. Envelope = (TypeKindNFT, ShapeKindNFTTransferOutput, ZAP message).

func (*TransferOutput) MarshalJSON

func (out *TransferOutput) MarshalJSON() ([]byte, error)

MarshalJSON marshals Amt and the embedded OutputOwners struct into a JSON readable format If OutputOwners cannot be serialized then this will return error

func (*TransferOutput) Verify

func (out *TransferOutput) Verify() error

Jump to

Keyboard shortcuts

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