Skip to content

MarketplaceRules

Namespace Nfty.Core.Publish in assembly Nfty.Core.

public static class MarketplaceRules

The rules for the marketplace fields of ExportOptions, stated once.

Remarks

Every method returns the sentence to show (or null when the value is fine) instead of throwing, so the export dialog can put the reason beside the field as the user types, the CLI can refuse with it, and SetExporter can refuse the same value with the same words. Nothing here guesses: a base URI missing its trailing slash is an error, not a slash added for the author.

Methods

BaseUriProblem(string?, string)

public static string? BaseUriProblem(string? value, string what = "Base URI");

Why a base URI is unusable, or null when it is fine (or empty, meaning "none").

Parameters

  • value (string?) - The text.
  • what (string) - What the address is, for the message (for example Image base URI).

Returns. The reason, naming the rule.

BasisPoints(double)

public static int BasisPoints(double percent);

The royalty as OpenSea's whole basis points: 2.5% is 250.

Parameters

Returns. Basis points.

FeeRecipientProblem(string?)

public static string? FeeRecipientProblem(string? value);

Why a fee recipient is unusable, or null.

Parameters

  • value (string?) - The text.

Returns. The reason, naming the rule.

ImageUriProblem(string?)

public static string? ImageUriProblem(string? value);

Why a collection image link is unusable, or null.

Parameters

  • value (string?) - The text.

Returns. The reason, naming the rule.

RoyaltyProblem(double?)

public static string? RoyaltyProblem(double? percent);

Why a royalty percentage is unusable, or null.

Parameters

  • percent (double?) - The percentage, or null for none.

Returns. The reason, naming the rule.

TokenStartProblem(int)

public static string? TokenStartProblem(int start);

Why a token start is unusable, or null.

Parameters

  • start (int) - The first token id.

Returns. The reason.

TryParseRoyalty(string?, double?)

public static string? TryParseRoyalty(string? text, out double? percent);

Reads a royalty typed as text, always with . as the decimal point.

Parameters

  • text (string?) - The text; empty means none.
  • percent (double?) - The value, or null for none.

Returns. Null when it parsed (or was empty); otherwise the reason it did not.

WebUrlProblem(string?, string)

public static string? WebUrlProblem(string? value, string what);

Why a web address is unusable, or null.

Parameters

  • value (string?) - The text.
  • what (string) - What the address is, for the message.

Returns. The reason, naming the rule.