API Reference / registerMintedBody · function
Function: registerMintedBody()
function registerMintedBody(
engine,
bytes,
certificate): Promise<MintCertificate>;
Verify a minted pack and register its body on an engine under the
certificate's id. The body then answers position, longitude, and
heliocentric inside the certificate's span and throws outside it, and
engineCapabilities reports it with that span.
Parameters
| Parameter | Type | Description |
|---|---|---|
engine | Engine | The engine to register on. |
bytes | Uint8Array | The pack's bytes. |
certificate | MintCertificate | The certificate published beside the pack. |
Returns
Promise<MintCertificate>
The certificate.
Example
const cert = await registerMintedBody(engine, bytes, certificate);
engine.position(cert.id, julianDay(2012, 1, 31)).lon;
cert.error.angle_bound_arcsec; // how far off that longitude can be