Caelus3,462 checksGitHubv0.25.0MIT
API Reference / loadMintedBody · function

Function: loadMintedBody()

function loadMintedBody(
   engine, 
   certificateFile, 
fetchFile): Promise<MintCertificate>;

Fetch a certificate and the pack it names, verify, and register the body. fetchFile is called twice: with the certificate's file name and with the pack's, which must be a plain file name beside it.

Parameters

ParameterTypeDescription
engineEngineThe engine to register on.
certificateFilestringThe certificate's file name, such as "eros.cert.json".
fetchFileMintFetchReturns the contents of a file in the directory the certificate is published in.

Returns

Promise<MintCertificate>

The certificate.

Example

const base = "https://example.org/minted/";
const cert = await loadMintedBody(engine, "eros.cert.json",
  async (file) => (await fetch(base + file)).arrayBuffer());

Start building

Quickstart →