Skip to content

MarketplaceUpload

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

public static class MarketplaceUpload

The whole marketplace upload in one call: art first, then metadata that points at it.

Remarks

The order is forced by the links. The metadata carries the art's address, so the art is uploaded first, its CID becomes ExportOptions.ImageBaseUri (and the models' ExportOptions.ModelBaseUri), and only then is the metadata written and uploaded. This is the two-step "Art only" path the export dialog describes, done for the author.

One export path, three calls. Every file is written by SetExporter: the art to a temporary folder, the metadata to another, and finally the whole export to the author's folder with the real addresses - so the local copy of every pinned folder is byte-for-byte what was pinned.

collection.json is pinned beside the token files, so contractURI = ipfs://<metadata CID>/collection.json; a contract's baseURI + tokenId never asks for that name. In the local export it stays at the root, where every export puts it.

Refused up front when the service cannot be reached, before anything is written.

Methods

Problem(ExportOptions)

public static string? Problem(ExportOptions options);

Why these options cannot be uploaded, or null when they can. One sentence, shared by the CLI and the export dialog.

Parameters

  • options (ExportOptions) - What the export would contain.

Returns. The sentence, or null.

RunAsync(string, string, ExportOptions, IPinningService, string?, IProgress<UploadProgress>?, CancellationToken, Parallelism?)

public static Task<UploadResult> RunAsync(string setPath, string outDir, ExportOptions options, IPinningService pinning, string? cookBookPath = null, IProgress<UploadProgress>? progress = null, CancellationToken cancellationToken = default, Parallelism? parallelism = null);

Uploads a Set's art and metadata and writes the export with the real addresses.

Parameters

  • setPath (string) - The Set: a folder or a .set.
  • outDir (string) - Where the final export is written.
  • options (ExportOptions) - What to export; the base URIs are replaced by the uploaded ones.
  • pinning (IPinningService) - Where to upload.
  • cookBookPath (string?) - The .cbk to ship in the local export, when the options include it.
  • progress (IProgress<UploadProgress>?) - How far the run has got.
  • cancellationToken (CancellationToken) - Stops the run. Folders a service already pinned stay pinned.
  • parallelism (Parallelism?) - Passed to every export.

Returns. The CIDs, the contract addresses and the local export.

Exceptions