{"id":30140326,"url":"https://github.com/froganbee/runestone_lib_bitcoin","last_synced_at":"2025-09-01T08:42:56.026Z","repository":{"id":252912663,"uuid":"841844908","full_name":"FroganBee/RuneStone_lib_Bitcoin","owner":"FroganBee","description":"This project is Typescript implementation of the Bitcoin Runestone protocol","archived":false,"fork":false,"pushed_at":"2024-08-13T07:40:22.000Z","size":109,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-18T19:33:59.042Z","etag":null,"topics":["protocal","reactjs","runestone","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FroganBee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-13T06:47:12.000Z","updated_at":"2024-12-19T14:17:39.000Z","dependencies_parsed_at":"2024-08-13T10:18:54.108Z","dependency_job_id":null,"html_url":"https://github.com/FroganBee/RuneStone_lib_Bitcoin","commit_stats":null,"previous_names":["tonny0831/runestone_lib_bitcoin","max-tonny8/runestone_lib_bitcoin","solpr0digy/runestone_lib_bitcoin","froganbee/runestone_lib_bitcoin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FroganBee/RuneStone_lib_Bitcoin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FroganBee%2FRuneStone_lib_Bitcoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FroganBee%2FRuneStone_lib_Bitcoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FroganBee%2FRuneStone_lib_Bitcoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FroganBee%2FRuneStone_lib_Bitcoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FroganBee","download_url":"https://codeload.github.com/FroganBee/RuneStone_lib_Bitcoin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FroganBee%2FRuneStone_lib_Bitcoin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269827161,"owners_count":24481483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["protocal","reactjs","runestone","typescript"],"created_at":"2025-08-11T03:36:41.894Z","updated_at":"2025-08-11T03:36:43.966Z","avatar_url":"https://github.com/FroganBee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# runestone-lib\n\nThis is a Typescript implementation of the Bitcoin Runestone protocol.\nTo see the original version, please go to the [Ordinals repo](https://github.com/ordinals/ord);\nyou can find various [data structures](https://github.com/ordinals/ord/tree/master/crates/ordinals/src) and\n[indexer implementation](https://github.com/ordinals/ord/blob/master/src/index/updater/rune_updater.rs) there.\nGeneral documentation of the runes protocol and how runestones are used can be found\n[here](https://docs.ordinals.com/runes.html).\n\n## Encode Runestone\n\nTo encode a runestone, use `encodeRunestone()` method, with an example below:\n\n```ts\nimport { encodeRunestone } from '@magiceden-oss/runestone-lib';\n\n// To deploy a new rune ticker\n// (this will require a commitment in an input script)\nconst etchingRunestone = encodeRunestone({\n  etching: {\n    runeName: 'THIS•IS•AN•EXAMPLE•RUNE',\n    divisibility: 0,\n    premine: 0,\n    symbol: '',\n    terms: {\n      cap: 69,\n      amount: 420,\n      offset: {\n        end: 9001,\n      },\n    },\n    turbo: true,\n  },\n});\n\n// To mint UNCOMMON•GOODS\nconst mintRunestone = encodeRunestone({\n  mint: {\n    block: 1n,\n    tx: 0,\n  },\n});\n\n// Transfer 10 UNCOMMON•GOODS to output 1\nconst edictRunestone = encodeRunestone({\n  edicts: [\n    {\n      id: {\n        block: 1n,\n        tx: 0,\n      },\n      amount: 10n,\n      output: 1,\n    },\n  ],\n});\n```\n\n## Decode Runestone\n\nDecoding a runestone within a transaction is as simple as passing in\nthe transaction data from Bitcoin Core RPC server.\n\n```ts\nimport {\n  tryDecodeRunestone,\n  isRunestoneArtifact,\n  RunestoneSpec,\n  Cenotaph\n} from '@magiceden-oss/runestone-lib';\n\n// transaction retrieved with getrawtransaction RPC call\nconst tx = ...;\n\nconst artifact = tryDecodeRunestone(tx);\n\nif (isRunestone(artifact)) {\n  const runestone: RunestoneSpec = artifact;\n  ...\n} else {\n  const cenotaph: Cenotaph = artifact;\n  ...\n}\n```\n\n## Indexing\n\nTo index, initialize a RunestoneIndexer, implement the interface arguments\nto RunestoneIndexer constructor. Then it is just a matter of start() to finish\ninitializing the indexer, and then controlling the rate of syncing indexing\nto latest state in RPC server.\n\n```ts\n// Initialize indexer\nconst indexer = new RunestoneIndexer(...);\n\n// Preps the indexer to be ready to run updateRuneUtxoBalances()\nawait indexer.start()\n\n// Example of a polling job running updateRuneUtxoBalances()\n// every minute, with stop cleanup handling\nlet stop = false;\n...\n\nconst intervalId = setInterval(async () =\u003e {\n  try {\n    await indexer.updateRuneUtxoBalances();\n  } catch (err) {\n    console.error('Error occurred while indexing runes', err);\n  }\n\n  if (stop) {\n    clearInterval(intervalId);\n    await indexer.stop();\n  }\n}, 60 * 1000 /* one minute */);\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffroganbee%2Frunestone_lib_bitcoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffroganbee%2Frunestone_lib_bitcoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffroganbee%2Frunestone_lib_bitcoin/lists"}