Recursive doginal library for Dogecoin. Inscribed once, importable by any future inscription.
Cross-marketplace: works on doginals.org, doggy.market, and any future indexer that serves inscription content.
RARlib.embed(id, container, opts?) — smart embed of any inscription in any containerRARlib.inscription(id) — fetch enriched inscription info (cached)RARlib.wallet.detect() — scan available wallet bridges (MyDoge, Spooky, etc.)RARlib.boot(config) — render a full showcase UI (the all-in-one showcase mode)RARlib.fetchInscription(id) — raw fetch by inscription IDRARlib.metadata(id) — raw API metadataRARlib.url(id) · RARlib.absoluteUrl(id) — URL helpersRARlib.version — semantic version stringLIB_ID with this inscription's ID.const LIB_ID = '<this_inscription_id>';
fetch('/content/' + LIB_ID)
.then(r => r.text())
.then(html => {
const m = html.match(/\/\* RARLIB_CODE_START \*\/([\s\S]*?)\/\* RARLIB_CODE_END \*\//);
if (!m) throw new Error('RARlib markers not found');
eval(m[1]);
main(); // RARlib is now available
});
function main() {
// your code here
}
<img>, <video>, <audio> or <iframe>.RARlib.embed('<inscription_id>', document.querySelector('#slot'));
const info = await RARlib.inscription('<inscription_id>');
console.log(info.owner, info.contentType, info.byteSize);
console.log(info.isImage, info.isHtml, info.isVideo);
window.* for available wallet bridges. Connect/sign methods coming in v0.3.const wallets = RARlib.wallet.detect();
if (wallets.length) {
console.log('Available:', wallets.map(w => w.name).join(', '));
}
RARlib.boot({
title: 'My Recursive Doginal',
rektumId: '<any_inscription_id>',
creator: 'me @myhandle',
brandless: false // set true to hide $RAR logo + RARlib mark
});
This file is itself a doginal — a Dogecoin inscription. Its content is permanent and addressable by its inscription ID. Any other inscription can fetch this file via the relative path /content/<libId> and execute its code.
The pattern enables on-chain code reuse: one library inscribed once, used by many.
Each consumer pays only for what's unique to it.
Recursive content embedding on Doge has been pioneered by Billy @thenoderunners, Heimdall @Heimdall_Bull, RoboAI @RoboAI_DRC420, Martin Seeger @MartinSeeger2, Booktoshi, and others. RARlib extends their work with the first JavaScript library pattern — code that registers reusable methods in the consumer's global scope.
v0.2 uses relative paths for inscription content. This means RARlib works regardless of which marketplace serves the consumer inscription: doginals.org, doggy.market, or any future indexer. The RARlib.metadata() and RARlib.inscription() methods use the doginals.org API explicitly (since it is the canonical indexer API at this time) and fall back gracefully if unreachable.
Thanks to the dev of Doggy Market for the relative-path tip that made this release possible.
All v0.x methods will keep their signatures across patch versions. New methods may be added; existing ones will not be changed or removed without a major version bump.
Future versions (v0.3, v0.4, …) will be inscribed as new doginals with new IDs. v0.1 and v0.2 remain on-chain forever and can always be loaded by consumers that reference their inscription IDs.
const LIB_ID = '<this_inscription_id>';
const html = await fetch('/content/' + LIB_ID).then(r => r.text());
const m = html.match(/\/\* RARLIB_CODE_START \*\/([\s\S]*?)\/\* RARLIB_CODE_END \*\//);
eval(m[1]);
// Now you can use any of the methods listed above.
RARlib.embed('<some_id>', document.body);