Class Packet
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
Properties
Groups
public IReadOnlyList<AssetGroup> Groups { get; }
Property Value
Methods
Create(IReadOnlyList<AssetGroup>)
public static Packet Create(IReadOnlyList<AssetGroup> groups)
Parameters
groupsIReadOnlyList<AssetGroup>
Returns
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
databyte[]
Returns
FromScript(Script)
Parses a Packet from an OP_RETURN script by delegating to Extension.
public static Packet FromScript(Script script)
Parameters
scriptScript
Returns
FromString(string)
Parses a Packet from a hex-encoded string of raw packet bytes.
public static Packet FromString(string hex)
Parameters
hexstring
Returns
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
intentTxidbyte[]
Returns
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
ToTxOut()
Returns an OP_RETURN TxOut with amount=0 (wrapped in an Extension).
public TxOut ToTxOut()
Returns
- TxOut
Validate()
public void Validate()