### JavaScript Module for Ordinal Bootstrapping Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Introduction.md This JavaScript code provides an example of an inscribed module for an ordinal. It exports a `bootstrap` function that accepts options, data, resources, and Open Ordinal Modules as arguments. This function is intended to contain the initialization and setup logic for a dynamic ordinal, demonstrating how to access and use the provided data. ```javascript module.exports = { // This function is called by the bootstrap bootstrap: (options, data, resources, ooModules) => { // `options` contain the `options` used when bootstraping // `data` contain the `data` for bootstrapping // `resources` contain an array of resources that was loaded by the bootstrapper // `ooModules` contain an object with Open Ordinal Modules if they are set in the options // Do the init and setup of the dynamic ordinal here. let message = data.text; // message now contains "Hello world!" document.getElementById("message").innerHTML = message; } }; ``` -------------------------------- ### Bootstrap Ordinal with Module Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/index.html Example of how to import and use the Open Ordinal Bootstrap module to initialize a dynamic ordinal with custom data. ```javascript Ordinal
``` -------------------------------- ### HTML Bootstrap Example for Ordinals Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Introduction.md This HTML snippet demonstrates how to use the Open Ordinal Bootstrap to load and execute a module inscribed on a sat. It imports the bootstrap functionality and calls the bootstrap method with specific options, including the mode and sat identifier. The script expects a `` and a `` to be replaced with actual values. ```html Ordinal
``` -------------------------------- ### Bootstrap by Metadata with JSON Configuration Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/src/docs/Modes.md Provides a JSON configuration for bootstrapping, specifying the mode, SAT, and data. This is an example of how metadata options are structured for mode 4. ```json { "bootstrap": { "mode": 4, "sat": 156280470238361, // Sat where your module is "data": {} } } ``` -------------------------------- ### Ordinal Module Export Function Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/index.html Example of an inscribed module for an ordinal, exporting a 'bootstrap' function that handles initialization logic. ```javascript module.exports = { // This function is called by the bootstrap bootstrap: (options, data, resources, ooModules) => { // `options` contain the `options` used when bootstraping // `data` contain the `data` for bootstrapping // `resources` contain an array of resources that was loaded by the bootstrapper // `ooModules` contain an object with Open Ordinal Modules if they are set in the options // Do the init and setup of the dynamic ordinal here. let message = data.text; // message now contains "Hello world!" document.getElementById("message").innerHTML = message; } }; ``` -------------------------------- ### Bootstrap Function Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/functions/OOBS.bootstrap.html Initializes the bootstrapper with provided options. This function is asynchronous and returns a promise that resolves when bootstrapping is complete. ```APIDOC ## bootstrap ### Description Initializes the bootstrapper with provided options. This function is asynchronous and returns a promise that resolves when bootstrapping is complete. ### Method POST ### Endpoint /bootstrap ### Parameters #### Request Body - **options** (IBootstrapOptions) - Required - Options for bootstrap ### Request Example ```json { "options": { "theme": "os" } } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful bootstrapping. #### Response Example ```json { "message": "Bootstrapping complete." } ``` ``` -------------------------------- ### Bootstrap Initialization Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/functions/bootstrap.md Initializes the bootstrapper with the provided options. This function is asynchronous and returns a promise. ```APIDOC ## bootstrap() ### Description Initializes the bootstrapper. ### Method `POST` (Assumed based on initialization pattern, actual method not specified) ### Endpoint `/open-ordinal/open-ordinal-bootstrap/bootstrap` ### Parameters #### Request Body - **options** (IBootstrapOptions) - Required - Options for bootstrap ### Request Example ```json { "options": { "setting1": "value1", "setting2": 123 } } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful initialization #### Response Example ```json { "message": "Bootstrap process completed successfully." } ``` ``` -------------------------------- ### Initialize Open Ordinal Bootstrap Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/functions/bootstrap.md Initializes the Open Ordinal Bootstrap process. This function takes an options object conforming to the IBootstrapOptions interface and returns a Promise that resolves upon completion. It's the fundamental step for setting up the bootstrap environment. ```typescript bootstrap(options: IBootstrapOptions): Promise ``` -------------------------------- ### BootstrapOptions Constructor Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/classes/BootstrapOptions.md Initializes a new instance of the BootstrapOptions class with the specified options. ```APIDOC ## new BootstrapOptions() ### Description Initializes a new instance of the BootstrapOptions class. ### Method CONSTRUCTOR ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * **options** (IBootstrapOptions) - Required - The bootstrap options to configure the instance. ### Request Example ```json { "options": {} } ``` ### Response #### Success Response (200) * **BootstrapOptions** - An instance of the BootstrapOptions class. #### Response Example ```json { "__type": "BootstrapOptions" } ``` #### Defined in [models/Options.ts:101](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L101) ``` -------------------------------- ### Bootstrap Function Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/functions/OOBS.bootstrap.html The main bootstrap function initializes the Open Ordinal Bootstrap application. It takes an options object and returns a promise that resolves when bootstrapping is complete. ```typescript bootstrap(options): Promise[] ``` -------------------------------- ### BootstrapResource Constructor - TypeScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/classes/BootstrapResource.md Demonstrates the constructor for the BootstrapResource class. It accepts an options object conforming to the IBootstrapResource interface and returns an instance of BootstrapResource. This is defined in the Options.ts file. ```typescript new BootstrapResource(options: IBootstrapResource): BootstrapResource ``` -------------------------------- ### BootstrapOptions Class Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Documentation for the BootstrapOptions class, which defines the configuration options for bootstrapping an Open Ordinal application. ```APIDOC ## Class BootstrapOptions ### Description Options class for bootstrapping. ### Constructor #### `new BootstrapOptions(options?: IBootstrapOptions)` * **options** (IBootstrapOptions) - Optional. Configuration options for bootstrapping. * **Returns** BootstrapOptions ### Properties * **mode** (BootstrapMode) - The mode for bootstrapping. Defaults to `BootstrapMode.LoadByMetadataOptionsAndBoot`. * **id** (number) - Optional. The inscription ID to bootstrap. * **sat** (number) - Optional. The sat ID to bootstrap. * **index** (number) - Optional. Index on sat to bootstrap. Defaults to -1. * **data** (any) - Optional. Data to pass into the bootstrap. * **res** ({ [key: string]: BootstrapResource }) - Optional. Additional inscriptions to load and pass into `bootstrap()`. * **oo** (BootstrapOpenOrdinalModules) - Optional. Additional Open Ordinal modules to load. * **dev** (string) - Optional. Relative path to module to boot. This is used during development and should never be present in actual inscribed ordinal. ``` -------------------------------- ### Set Theme from Local Storage and Show Page (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/ChangeLog.html This script sets the theme based on local storage or OS preference and then displays the application page after a short delay. It's designed to initialize the UI theme and manage page visibility. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Load Open Ordinal Modules via BootstrapOptions (HTML) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Extensions.md Shows how to load additional Open Ordinal modules during the bootstrap process using the `oo` property in `BootstrapOptions`. This ensures required modules are available before the main bootstrap logic executes. ```html ``` -------------------------------- ### Google Analytics Initialization (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/modules/OOBS.html Initializes the Google Analytics data layer and configures tracking for the 'G-XHBQC2GFXJ' measurement ID. ```javascript window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### Instantiate BootstrapOptions in TypeScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/classes/BootstrapOptions.md Demonstrates how to create a new instance of the BootstrapOptions class, optionally passing an IBootstrapOptions object for configuration. This is a fundamental step for setting up bootstrapping parameters. ```typescript import { BootstrapOptions } from "../models/Options"; // Example usage: const options = new BootstrapOptions(); // Creates an instance with default options const customOptions = new BootstrapOptions({ mode: BootstrapMode.LoadByMetadataOptionsAndBoot, id: 12345, sat: 67890, index: 1, data: { key: "value" }, res: { "resourceName": { inscriptionId: 54321 } }, oo: { modules: [] }, dev: "./dev-module.js" }); ``` -------------------------------- ### Load Resources via BootstrapOptions (HTML) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Extensions.md Demonstrates how to specify additional resources (inscriptions) to be loaded automatically by the Open Ordinal Bootstrap using the `res` property within `BootstrapOptions`. This allows pre-loading assets like images or scripts. ```html ``` -------------------------------- ### BootstrapOpenOrdinalModules Constructor Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOpenOrdinalModules.html Initializes a new instance of the BootstrapOpenOrdinalModules class. It accepts an optional options object for configuration. ```typescript new BootstrapOpenOrdinalModules(options?) ``` -------------------------------- ### IBootstrapOptions Interface Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/interfaces/OOBS.IBootstrapOptions.html Details the configuration options available for bootstrapping Open Ordinal applications. This interface defines various properties that can be set to customize the bootstrap process, including mode, IDs, data, and external resources. ```APIDOC ## Interface IBootstrapOptions ### Description Options class for bootstrapping Open Ordinal applications. ### Properties * **mode** (BootstrapMode) - Required - The mode for bootstrapping. * **id** (number) - Optional - The inscription Id to bootstrap. * **sat** (number) - Optional - The sat Id to bootstrap. * **index** (number) - Optional - Index on sat to bootstrap. * **data** (any) - Optional - Data to pass into the bootstrap. * **res** (object) - Optional - Additional inscriptions to load and pass into `bootstrap()`. The keys are strings and values are `IBootstrapResource`. * **oo** (IBootstrapOpenOrdinalModules) - Optional - Additional Open Ordinal modules to load. * **dev** (string) - Optional - Relative path to module to boot. This is used during development and should never be present in actual inscribed ordinal. ``` -------------------------------- ### Google Analytics Initialization Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/FAQ.html This JavaScript code initializes Google Analytics by configuring the dataLayer and setting up the gtag function. It ensures that analytics events are tracked correctly. ```javascript window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### Load Resources via BootstrapOptions (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/Extensions.html Demonstrates how to specify resources like images and scripts to be loaded automatically during the Open Ordinal Bootstrap process using the `res` property in `BootstrapOptions`. It shows loading by Inscription ID, Sat ID and Index, and latest by Sat ID. The loaded resources are then available in the `resources` object within the `bootstrap` function. ```javascript await ooBS.bootstrap({ ... res: { // Load by Inscription Id image: { id: "" }, model: { id: "" }, // Load Sat Id and Index javascriptA: { sat: "", index: 2 } // Load latest by Sat Id javascriptB: { sat: "" } } ... }); ``` ```javascript export async function bootstrap(options, data, resources, ooModules) { // Based on the code above resources will contain: // { // image: "data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAA..." // model: "data:model/gltf-binary;base64,Z2xURgIAAADIIQEAeBQ..." // javascriptA: "data:text/javascript;base64,ZXhwb3J0IGFzeW5jIGZ1bm..." // javascriptB: "data:text/javascript;base64,ZXhwb3J0IGFzeW5jIGZ1bm..." // } ``` -------------------------------- ### Google Analytics Configuration (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/interfaces/OOBS.IBootstrapOpenOrdinalModules.html Configures Google Analytics by initializing dataLayer and defining the gtag function to send events. This is a standard pattern for integrating Google Analytics into web pages. ```javascript window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### Load Resources via BootstrapOptions (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Extensions.md Illustrates the structure of the `resources` object passed to the `bootstrap` function when using the `res` property in `BootstrapOptions`. This object contains data-URLs for the loaded inscriptions. ```js export async function bootstrap(options, data, resources, ooModules) { // Based on the code above resources will contain: // { // image: "data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAA..." // model: "data:model/gltf-binary;base64,Z2xURgIAAADIIQEAeBQ..." // javascriptA: "data:text/javascript;base64,ZXhwb3J0IGFzeW5jIGZ1bm..." // javascriptB: "data:text/javascript;base64,ZXhwb3J0IGFzeW5jIGZ1bm..." // } ``` -------------------------------- ### Bootstrap by Index and Sat (Mode 3) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Modes.md Mode 3 loads a specific sat for an inscription, then boots the ordinal with the ES-Module/JavaScript at that index on the sat, passing along the provided data. ```html ``` -------------------------------- ### BootstrapResource Constructor (TypeScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapResource.html The constructor for the BootstrapResource class. It accepts an options object conforming to the IBootstrapResource interface to configure the resource. The class is defined in models/Options.ts. ```typescript new BootstrapResource(options: IBootstrapResource) ``` -------------------------------- ### Bootstrap by SAT and Index (Mode 3) | JavaScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/Modes.html Loads a specific inscription at a given SAT and index. It then boots the ordinal with the ES-Module/JavaScript found at that index and passes in the provided 'data'. ```javascript ``` -------------------------------- ### Load Resources with Open Ordinal Bootstrap (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/src/docs/Extensions.md Demonstrates how to use the `res` property within `BootstrapOptions` to automatically load additional resources like images or scripts during the Open Ordinal Bootstrap process. These resources are then passed to the `bootstrap` function as data-URLs. ```html ``` ```js export async function bootstrap(options, data, resources, ooModules) { // Based on the code above resources will contain: // { // image: "data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAA..." // model: "data:model/gltf-binary;base64,Z2xURgIAAADIIQEAeBQ..." // javascriptA: "data:text/javascript;base64,ZXhwb3J0IGFzeW5jIGZ1bm..." // javascriptB: "data:text/javascript;base64,ZXhwb3J0IGFzeW5jIGZ1bm..." // } } ``` -------------------------------- ### Load Open Ordinal Modules via BootstrapOptions (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/Extensions.html Illustrates how to load other Open Ordinal modules, such as the API module, during the bootstrap process using the `oo` property in `BootstrapOptions`. The module loader automatically fetches the latest version. Loaded modules are accessible within the `ooModules` object in the `bootstrap` function. ```javascript await ooBS.bootstrap({ ... oo: { // Load Open Ordinal API module api: true } ... }); ``` ```javascript export async function bootstrap(options, data, resources, ooModules) { // Based on the code above ooModules will contain: // { // ooAPI: {Object} // }} ``` -------------------------------- ### Construct BootstrapOpenOrdinalModules - TypeScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/classes/BootstrapOpenOrdinalModules.md Initializes a new instance of the BootstrapOpenOrdinalModules class. It accepts an optional configuration object for bootstrapping Open Ordinal Modules. ```typescript new BootstrapOpenOrdinalModules(options) ``` -------------------------------- ### Load Open Ordinal Modules with Bootstrap (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/src/docs/Extensions.md Illustrates how to use the `oo` property in `BootstrapOptions` to automatically load other Open Ordinal modules during the bootstrap process. The bootrapper fetches the latest versions of specified modules, making them available in the `ooModules` object passed to the `bootstrap` function. ```html ``` ```js export async function bootstrap(options, data, resources, ooModules) { // Based on the code above ooModules will contain: // { // ooAPI: {Object} // } } ``` -------------------------------- ### Bootstrap by Metadata (Mode 0) with JavaScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/src/docs/Modes.md Loads inscription metadata to pass options to the bootstrapper. Used when options are in metadata and not inline. No action if no options protocol is available in metadata. ```html ``` -------------------------------- ### Bootstrap Ordinal with Latest Module (HTML/JS) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/README.md This snippet demonstrates how to bootstrap an ordinal using mode 4, which loads the latest inscribed module on a given sat. It includes importing the bootstrap module and calling the bootstrap function with options and data. The module itself needs to export a 'bootstrap' function. ```html Ordinal
``` ```javascript module.exports = { // This function is called by the bootstrap bootstrap: (options, data, resources, ooModules) => { // `options` contain the `options` used when bootstraping // `data` contain the `data` for bootstrapping // `resources` contain an array of resources that was loaded by the bootstrapper // `ooModules` contain an object with Open Ordinal Modules if they are set in the options // Do the init and setup of the dynamic ordinal here. let message = data.text; // message now contains "Hello world!" document.getElementById("message").innerHTML = message; } }; ``` -------------------------------- ### Bootstrap with Metadata Options (Mode 0) | JavaScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/Modes.html Boots an ordinal by reading metadata for inscription options. Requires a 'Metadata' object with a 'bootstrap' property containing 'mode', 'sat', and 'data'. If no 'Options' protocol is found in metadata, this mode will not perform any action. ```javascript ``` ```json { "bootstrap": { "mode": 4, "sat": 156280470238361, // Sat where your module is "data": {} } } ``` -------------------------------- ### IBootstrapOptions Interface Definition (TypeScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/interfaces/OOBS.IBootstrapOptions.html Defines the structure for options used during the Open Ordinal bootstrapping process. It includes properties for mode, ID, SAT, index, custom data, additional resources, and development-specific paths. ```typescript interface IBootstrapOptions { [mode](OOBS.IBootstrapOptions.html#mode): [BootstrapMode](../enums/OOBS.BootstrapMode.html); [id](OOBS.IBootstrapOptions.html#id)?: number; [sat](OOBS.IBootstrapOptions.html#sat)?: number; [index](OOBS.IBootstrapOptions.html#index)?: number; [data](OOBS.IBootstrapOptions.html#data)?: any; [res](OOBS.IBootstrapOptions.html#res)?: { [_: string]: [IBootstrapResource](OOBS.IBootstrapResource.html); }; [oo](OOBS.IBootstrapOptions.html#oo)?: [IBootstrapOpenOrdinalModules](OOBS.IBootstrapOpenOrdinalModules.html); [dev](OOBS.IBootstrapOptions.html#dev)?: string; } ``` -------------------------------- ### IBootstrapResource Interface Definition (TypeScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/interfaces/OOBS.IBootstrapResource.html Defines the IBootstrapResource interface used for bootstrapping ordinal resources. It includes optional properties for ID, SAT, and index, specifying their types and purposes. ```typescript interface IBootstrapResource { [id](OOBS.IBootstrapResource.html#id)?: string; [sat](OOBS.IBootstrapResource.html#sat)?: number; [index](OOBS.IBootstrapResource.html#index)?: number; } ``` -------------------------------- ### BootstrapOptions Constructor Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the constructor for the BootstrapOptions class. It accepts an optional IBootstrapOptions object to initialize the properties. ```typescript new BootstrapOptions(options?) ``` -------------------------------- ### BootstrapOptions Properties Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/classes/BootstrapOptions.md Details of the properties available on the BootstrapOptions class. ```APIDOC ## BootstrapOptions Properties ### mode * **mode** (BootstrapMode) - Required - The mode for bootstrapping. Defaults to `BootstrapMode.LoadByMetadataOptionsAndBoot`. #### Defined in [models/Options.ts:70](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L70) *** ### id * **id** (number) - Optional - The inscription Id to bootstrap. #### Defined in [models/Options.ts:74](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L74) *** ### sat * **sat** (number) - Optional - The sat Id to bootstrap. #### Defined in [models/Options.ts:78](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L78) *** ### index * **index** (number) - Optional - Index on sat to bootstrap. Defaults to -1. #### Defined in [models/Options.ts:82](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L82) *** ### data * **data** (any) - Optional - Data to pass into the bootstrap. #### Defined in [models/Options.ts:86](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L86) *** ### res * **res** (object) - Optional - Additional inscriptions to load and pass into `bootstrap()`. * **Index Signature**: `[_: string]` (BootstrapResource) #### Defined in [models/Options.ts:90](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L90) *** ### oo * **oo** (BootstrapOpenOrdinalModules) - Optional - Additional Open Ordinal modules to load. #### Defined in [models/Options.ts:94](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L94) *** ### dev * **dev** (string) - Optional - Relative path to module to boot. This is used during development and should never be present in actual inscribed ordinal. #### Defined in [models/Options.ts:99](https://github.com/open-ordinal/open-ordinal-bootstrap/blob/016feec9b8b1e9113d46e85545127ab92a2172b6/src/models/Options.ts#L99) ``` -------------------------------- ### BootstrapMode Enumeration Members (TypeScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/enumerations/BootstrapMode.md Defines the different modes for bootstrapping inscriptions in the Open Ordinal Bootstrap project. These modes specify how inscription data is loaded (e.g., by metadata, by ID, by SAT) and whether to boot using provided options or fetch the latest inscription. ```TypeScript export enum BootstrapMode { LoadByMetadataOptionsAndBoot = 0, LoadByInscriptionIdAndBoot = 1, LoadLatestByInscriptionIdAndBoot = 2, LoadIndexBySatAndBoot = 3, LoadLatestBySatAndBoot = 4 } ``` -------------------------------- ### Bootstrap by Metadata (Mode 0) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Modes.md This mode (0) reads inscription metadata to find bootstrapper options. It's used when options are in metadata, not inline. If no Options protocol is found in metadata, it does nothing. Other modes also support metadata. ```html ``` ```json { "bootstrap": { "mode": 4, "sat": 156280470238361, // Sat where your module is "data": {} } } ``` -------------------------------- ### Bootstrap Latest by Sat (Mode 4) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Modes.md Mode 4 loads the latest inscription for a given sat, then boots the ordinal with that ES-Module/JavaScript, and passes the provided data. ```html ``` -------------------------------- ### BootstrapOptions Optional Development Path Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the optional 'dev' property for BootstrapOptions, used in development to specify a relative path to a module to boot. This should not be used in production. ```typescript dev?: string ``` -------------------------------- ### Load Open Ordinal Modules via BootstrapOptions (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Extensions.md Details the `ooModules` object passed to the `bootstrap` function when using the `oo` property in `BootstrapOptions`. This object provides access to loaded Open Ordinal modules, such as the API. ```js export async function bootstrap(options, data, resources, ooModules) { // Based on the code above ooModules will contain: // { // ooAPI: {Object} // } ``` -------------------------------- ### Google Analytics Configuration (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/ChangeLog.html This snippet configures Google Analytics (gtag.js) for tracking. It initializes the dataLayer and sets up the gtag function to send data to a specific measurement ID. ```javascript window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtcc('js', new Date()); gtcc('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### Bootstrap Latest by Inscription ID (Mode 2) | JavaScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/Modes.html Loads the latest inscription for a given inscription ID. It resolves the inscription ID to a SAT value and then boots the ordinal with the latest ES-Module/JavaScript, passing in the provided 'data'. ```javascript ``` -------------------------------- ### Bootstrap Latest by SAT (Mode 4) | JavaScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/Modes.html Loads the latest inscription associated with a given SAT value. It then boots the ordinal with the ES-Module/JavaScript from that latest inscription, passing in the provided 'data'. ```javascript ``` -------------------------------- ### BootstrapResource Properties - TypeScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/OOBS/classes/BootstrapResource.md Details the optional properties of the BootstrapResource class. These include 'id' for inscription ID, 'sat' for sat ID, and 'index' for the index on sat, with a default value of -1 for index. All are defined in the Options.ts file. ```typescript id?: string sat?: number index?: number = -1 ``` -------------------------------- ### Bootstrap Latest by Inscription ID (Mode 2) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Modes.md Mode 2 loads a specific inscription ID, resolves it to a sat, finds the latest inscription for that sat, and boots it with the provided ES-Module/JavaScript and data. ```html ``` -------------------------------- ### BootstrapOptions Optional Resources Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the optional 'res' property for BootstrapOptions, allowing additional inscriptions to be loaded and passed to the bootstrap function. ```typescript res?: { \n [_: string]: BootstrapResource;\n} ``` -------------------------------- ### Bootstrap by Inscription ID (Mode 1) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/markdown/documents/Modes.md Mode 1 loads a specific ES-Module/JavaScript from a hardcoded inscription ID and passes data to the ordinal. It does not dynamically resolve which module to load. ```html ``` -------------------------------- ### Bootstrap by Inscription ID (Mode 1) | JavaScript Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/documents/Modes.html Loads an ES-Module or JavaScript file directly using a hardcoded inscription ID. It passes provided 'data' to the ordinal but does not dynamically resolve the module. ```javascript ``` -------------------------------- ### BootstrapOptions Optional Open Ordinal Modules Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the optional 'oo' property for BootstrapOptions, which can include additional Open Ordinal modules to load. ```typescript oo?: BootstrapOpenOrdinalModules ``` -------------------------------- ### BootstrapResource Properties (TypeScript) Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapResource.html Defines optional properties for the BootstrapResource class: 'id' (string) for inscription ID, 'sat' (number) for sat ID, and 'index' (number) for the bootstrap index on the sat. These properties are defined in models/Options.ts. ```typescript id?: string sat?: number index?: number = -1 ``` -------------------------------- ### BootstrapOptions Optional Index Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the optional 'index' property for BootstrapOptions, specifying the index on the SAT to bootstrap. Defaults to -1. ```typescript index?: number = -1 ``` -------------------------------- ### BootstrapOpenOrdinalModules API Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOpenOrdinalModules.html An optional boolean property for the BootstrapOpenOrdinalModules class that indicates whether to load the Open Ordinal API. ```typescript api?: boolean ``` -------------------------------- ### BootstrapOptions Mode Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the 'mode' property for BootstrapOptions. This property determines the bootstrapping strategy and defaults to BootstrapMode.LoadByMetadataOptionsAndBoot. ```typescript mode: BootstrapMode = BootstrapMode.LoadByMetadataOptionsAndBoot ``` -------------------------------- ### BootstrapOptions Optional Data Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the optional 'data' property for BootstrapOptions, which can hold arbitrary data to be passed into the bootstrap process. ```typescript data?: any ``` -------------------------------- ### BootstrapOptions Optional SAT Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the optional 'sat' property for BootstrapOptions, representing the SAT ID to bootstrap. ```typescript sat?: number ``` -------------------------------- ### BootstrapOptions Optional ID Property Source: https://github.com/open-ordinal/open-ordinal-bootstrap/blob/develop/docs/html/classes/OOBS.BootstrapOptions.html Defines the optional 'id' property for BootstrapOptions, representing the inscription ID to bootstrap. ```typescript id?: number ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.