Members on this page
Meshline.Sdk
Meshline.Models.Protocol
AccountRoute Class
Binds an account to its home relay at a signed, expiring revision.
public sealed record AccountRoute : Meshline.Models.Protocol.TypedProtocolModel, System.IEquatable<Meshline.Models.Protocol.AccountRoute>
Inheritance System.Object → ProtocolModel → TypedProtocolModel → AccountRoute
Implements System.IEquatable<AccountRoute>
Constructors
AccountRoute() Constructor
Binds an account to its home relay at a signed, expiring revision.
public AccountRoute();
Properties
AccountRoute.Account Property
The account's CAIP-10 identifier.
public string Account { get; init; }
Property Value
AccountRoute.AccountPublicKey Property
The public key used to verify the account's signature and identifier.
public System.Collections.Immutable.ImmutableArray<byte> AccountPublicKey { get; init; }
Property Value
System.Collections.Immutable.ImmutableArray<System.Byte>
AccountRoute.AccountSignature Property
The account signature over the model's account signing input.
public System.Collections.Immutable.ImmutableArray<byte> AccountSignature { get; init; }
Property Value
System.Collections.Immutable.ImmutableArray<System.Byte>
AccountRoute.ExpiresAt Property
The expiration time, in Unix seconds.
public long ExpiresAt { get; init; }
Property Value
AccountRoute.RelayId Property
The relay's lowercase Neo script hash, including the 0x prefix.
public string RelayId { get; init; }
Property Value
AccountRoute.RelaySignature Property
The relay signature over the model's relay signing input.
public System.Nullable<System.Collections.Immutable.ImmutableArray<byte>> RelaySignature { get; init; }
Property Value
System.Nullable<System.Collections.Immutable.ImmutableArray<System.Byte>>
AccountRoute.Revision Property
The monotonically increasing revision of the document.
public long Revision { get; init; }
Property Value
AccountRoute.UpdatedAt Property
The last update time, in Unix seconds.
public long UpdatedAt { get; init; }
Property Value
Methods
AccountRoute.CompareWith(AccountRoute) Method
Compares same-account routes by revision and, at equal revisions, by content excluding signatures.
public Meshline.Models.Protocol.RouteComparison CompareWith(Meshline.Models.Protocol.AccountRoute other);
Parameters
other AccountRoute
Another route belonging to the same account.
Returns
RouteComparison
The revision ordering, unsigned-content equivalence, or equal-revision conflict.
Exceptions
System.ArgumentException
The routes belong to different accounts.
System.Text.Json.JsonException
Either route cannot be serialized for the equal-revision unsigned-content comparison.
Remarks
Neither route is validated by this comparison. Equal revisions with different unsigned content are reported as a conflict rather than resolved by signature bytes.
AccountRoute.GetAccountSigningInput(NetworkContext) Method
Builds the canonical, network-bound bytes used to sign or verify this document.
public byte[] GetAccountSigningInput(Meshline.Models.NetworkContext context);
Parameters
context NetworkContext
The network context bound into identifiers or signing input.
Returns
System.Byte[]
The canonical UTF-8 signing input bound to the network context, with the applicable signature fields omitted.
Exceptions
System.Text.Json.JsonException
The signing payload cannot be represented as canonical protocol JSON, contains conflicting extension fields, or already contains a root $context property.
AccountRoute.GetNextRevision(Nullable<long>, long) Method
Selects a nonnegative safe-integer revision strictly greater than the known revision.
public static long GetNextRevision(System.Nullable<long> requested, long known);
Parameters
requested System.Nullable<System.Int64>
The explicitly requested revision, or null to increment the known revision.
known System.Int64
The highest known revision; use -1 when no revision is known.
Returns
System.Int64
The requested revision, or the known revision plus one when no revision was supplied.
Exceptions
System.ArgumentOutOfRangeException
The selected revision is negative, exceeds 2^53 - 1, or is not greater than the known revision.
AccountRoute.GetRelaySigningInput(NetworkContext) Method
Builds the canonical, network-bound bytes used to sign or verify this document.
public byte[] GetRelaySigningInput(Meshline.Models.NetworkContext context);
Parameters
context NetworkContext
The network context bound into identifiers or signing input.
Returns
System.Byte[]
The canonical UTF-8 signing input bound to the network context, with the applicable signature fields omitted.
Exceptions
System.Text.Json.JsonException
The signing payload cannot be represented as canonical protocol JSON, contains conflicting extension fields, or already contains a root $context property.
AccountRoute.Validate(NetworkContext) Method
Validates route identity, revision, validity window, size, and the account signature.
public override Meshline.Validation.ProtocolViolation? Validate(Meshline.Models.NetworkContext? context);
Parameters
context NetworkContext
The required network context for identity and signature validation.
Returns
ProtocolViolation
The first detected protocol violation, or null if the implemented checks pass.
Exceptions
System.ArgumentNullException
context is null.
System.Security.Cryptography.CryptographicException
The cryptographic provider cannot perform account or relay signature verification; ordinary invalid signatures are returned as protocol violations.
Remarks
The account signature is verified. A present relay signature is checked for length but must be verified separately against the hosting relay identity.