namespace PepperDash.Core.Intersystem.Tokens
{
///
/// Represents the base class for all XSig datatypes.
///
public abstract class XSigToken
{
private readonly int _index;
///
/// Constructs an XSigToken with the specified index.
///
/// Index for the data.
protected XSigToken(int index)
{
_index = index;
}
///
/// XSig 1-based index.
///
public int Index
{
get { return _index; }
}
///
/// XSigToken type.
///
public abstract XSigTokenType TokenType { get; }
///
/// Generates the XSig bytes for the corresponding token.
///
/// XSig byte array.
public abstract byte[] GetBytes();
///
/// Returns a new token if necessary with an updated index based on the specified offset.
///
/// Offset to adjust the index with.
/// XSigToken
public abstract XSigToken GetTokenWithOffset(int offset);
}
}