{"id":24968445,"url":"https://github.com/raphjaph/ordapi","last_synced_at":"2025-04-16T01:23:59.930Z","repository":{"id":274656852,"uuid":"923567772","full_name":"raphjaph/ordapi","owner":"raphjaph","description":"Typescript library for talking to the `ord` JSON API.","archived":false,"fork":false,"pushed_at":"2025-02-13T22:49:18.000Z","size":117,"stargazers_count":8,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T09:22:12.680Z","etag":null,"topics":["api-client","bitcoin","inscriptions","javascript","javascript-library","ordinals","runes","typescript"],"latest_commit_sha":null,"homepage":"https://raphjaph.github.io/ordapi/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphjaph.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2025-01-28T13:36:53.000Z","updated_at":"2025-03-11T12:40:52.000Z","dependencies_parsed_at":"2025-02-14T14:15:48.828Z","dependency_job_id":null,"html_url":"https://github.com/raphjaph/ordapi","commit_stats":null,"previous_names":["raphjaph/ordapi"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphjaph%2Fordapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphjaph%2Fordapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphjaph%2Fordapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphjaph%2Fordapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphjaph","download_url":"https://codeload.github.com/raphjaph/ordapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249179952,"owners_count":21225633,"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","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":["api-client","bitcoin","inscriptions","javascript","javascript-library","ordinals","runes","typescript"],"created_at":"2025-02-03T13:18:46.921Z","updated_at":"2025-04-16T01:23:59.912Z","avatar_url":"https://github.com/raphjaph.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Ord API\n\nSimple TypeScript client for `ord` API.\nSee the [docs](https://docs.ordinals.com/guides/api).\n\n[![npm version](https://img.shields.io/npm/v/ordapi.svg)](https://www.npmjs.com/package/ordapi)\n[![npm downloads](https://img.shields.io/npm/dm/ordapi.svg)](https://www.npmjs.com/package/ordapi)\n[![License](https://img.shields.io/npm/l/ordapi.svg)](https://github.com/raphjaph/ordapi/blob/master/LICENSE)\n[![CI Status](https://github.com/raphjaph/ordapi/workflows/CI/badge.svg)](https://github.com/raphjaph/ordapi/actions)\n\n\u003c/div\u003e\n\n## Installation\n\nUsing npm:\n\n```bash\n$ npm install ordapi\n```\n\nUsing yarn:\n\n```bash\n$ yarn add ordapi\n```\n\nUsing pnpm:\n\n```bash\n$ pnpm add ordapi\n```\n\nUsing bun:\n\n```bash\n$ bun add ordapi\n```\n\n## Import\n\nImport the client and types depending on your needs:\n\n```typescript\n// Using default import\nimport OrdClient from 'ordapi';\n\nconst client = new OrdClient('https://ord-server.com');\nconst block = await client.getBlock(0);\n```\n\n```typescript\n// Using both client and types\nimport OrdClient, { Inscription } from 'ordapi';\n\nasync function getInscription(id: string): Promise\u003cInscription\u003e {\n  const client = new OrdClient('https://ord-server.com');\n  return await client.getInscription(id);\n}\n```\n\n## Usage\n\n```typescript\nimport OrdClient, { Block } from 'ordapi';\n\nfunction App() {\n  const [blockInfo, setBlockInfo] = useState\u003cBlock | null\u003e(null);\n\n  useEffect(() =\u003e {\n    // Create client instance\n    const client = new OrdClient('https://ord-server.xyz');\n\n    // Fetch genesis block info\n    async function fetchBlock() {\n      try {\n        const block = await client.getBlock(0);\n        setBlockInfo(block);\n      } catch (err) {\n        console.error('Failed to fetch block:', err);\n      }\n    }\n\n    fetchBlock();\n  }, []);\n\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003eGenesis Block\u003c/h1\u003e\n      {blockInfo \u0026\u0026 (\n        \u003c\u003e\n          \u003cp\u003eHeight: {blockInfo.height}\u003c/p\u003e\n          \u003cp\u003eHash: {blockInfo.hash}\u003c/p\u003e\n          \u003cp\u003eNumber of transactions: {blockInfo.transactions.length}\u003c/p\u003e\n        \u003c/\u003e\n      )}\n    \u003c/div\u003e\n  );\n}\n```\n\n### Publish release\n\n- update `package.json` version\n- update version in `docs/generateHtml.ts`\n- update all dependencies (`bun update`)\n- prepare the CHANGELOG\n- open release PR on github \n- `bun publish`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphjaph%2Fordapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphjaph%2Fordapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphjaph%2Fordapi/lists"}