Table of Contents

Class Packet

Namespace
NArk.Core.Assets
Assembly
NArk.Core.dll

A collection of AssetGroups representing the asset packet (type 0x00) inside an Extension. Raw wire format: varint(groupCount) + AssetGroup...

public class Packet : IExtensionPacket
Inheritance
Packet
Implements
Inherited Members

Fields

PacketTypeId

public const byte PacketTypeId = 0

Field Value

byte

Properties

Groups

public IReadOnlyList<AssetGroup> Groups { get; }

Property Value

IReadOnlyList<AssetGroup>

Methods

Create(IReadOnlyList<AssetGroup>)

public static Packet Create(IReadOnlyList<AssetGroup> groups)

Parameters

groups IReadOnlyList<AssetGroup>

Returns

Packet

FromBytes(byte[])

Parses a Packet from raw bytes (varint groupCount + groups). No OP_RETURN/magic/marker prefix expected.

public static Packet FromBytes(byte[] data)

Parameters

data byte[]

Returns

Packet

FromScript(Script)

Parses a Packet from an OP_RETURN script by delegating to Extension.

public static Packet FromScript(Script script)

Parameters

script Script

Returns

Packet

FromString(string)

Parses a Packet from a hex-encoded string of raw packet bytes.

public static Packet FromString(string hex)

Parameters

hex string

Returns

Packet

LeafTxPacket(byte[])

Converts this packet into a batch leaf packet by replacing all group inputs with a single Intent input referencing the given intent txid.

public Packet LeafTxPacket(byte[] intentTxid)

Parameters

intentTxid byte[]

Returns

Packet

Serialize()

Returns the full OP_RETURN script bytes (wrapped in an Extension).

public byte[] Serialize()

Returns

byte[]

SerializePacketData()

Serializes the raw packet data (varint groupCount + groups). No wrapper.

public byte[] SerializePacketData()

Returns

byte[]

ToString()

Returns the hex-encoded representation of the raw packet data.

public override string ToString()

Returns

string

ToTxOut()

Returns an OP_RETURN TxOut with amount=0 (wrapped in an Extension).

public TxOut ToTxOut()

Returns

TxOut

Validate()

public void Validate()