{"_id":"@cardano-ogmios/mdk","_rev":"3-0fcb97d79278aac0d065f2ff6eb355e9","name":"@cardano-ogmios/mdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@cardano-ogmios/mdk","version":"1.0.0","keywords":["cardano","ogmios","sdk","rpc"],"author":{"name":"KtorZ","email":"matthias.benkort@gmail.com"},"license":"Apache-2.0","_id":"@cardano-ogmios/mdk@1.0.0","maintainers":[{"name":"rhyslbw","email":"rhyslbw@gmail.com"},{"name":"ktorz","email":"matthias.benkort@gmail.com"}],"homepage":"https://github.com/cardanosolutions/ogmios-js#readme","bugs":{"url":"https://github.com/cardanosolutions/ogmios-js/issues"},"ava":{"files":["tests/**","!tests/**/{helpers}/**"]},"dist":{"shasum":"488eab2083baadbaad99d01ea5aacb19e54d84e9","tarball":"https://registry.npmjs.org/@cardano-ogmios/mdk/-/mdk-1.0.0.tgz","fileCount":7,"integrity":"sha512-jodz4sPqjmvWVsX+rEDGc9NXIOq7a/Q719Yai4Dhjpb9OvqN591M0KspBF+Dj4FE/jWUh740IgLNnhaEdtLspQ==","signatures":[{"sig":"MEQCICOaQkLJj9pS8PmjGzxHYXqkoDe0KIkINcByuONKaYF9AiB2VCPImGKIG46HS7M3vtJcoi7HyzbTSH5Hezw9N5E5RA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70545},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"2adf1d4a499e34dac24c68668ebb567b66f41a17","private":false,"scripts":{"doc":"yarn docs","docs":"jsdoc --readme ./README.md -c .jsdoc.json -d docs","test":"c8 ava","build":"tsup lib/index.mjs --format esm,cjs --dts","format":"prettier --write **/*.mjs"},"_npmUser":{"name":"ktorz","email":"matthias.benkort@gmail.com"},"tsconfig":{"$schema":"https://json.schemastore.org/tsconfig","display":"Default","exclude":["dist","node_modules"],"include":["lib/**/*"],"compilerOptions":{"lib":["ES2020","DOM","DOM.Iterable"],"module":"ESNext","outDir":"dist","strict":true,"target":"ESNext","allowJs":true,"sourceMap":true,"declaration":true,"incremental":false,"skipLibCheck":true,"declarationMap":true,"noUnusedLocals":false,"esModuleInterop":true,"isolatedModules":true,"moduleDetection":"force","moduleResolution":"node","resolveJsonModule":true,"noUncheckedIndexedAccess":true,"allowSyntheticDefaultImports":true}},"repository":{"url":"git+https://github.com/cardanosolutions/ogmios-js.git","type":"git"},"_npmVersion":"10.5.2","description":"A minimalist development kit for Ogmios.","directories":{},"_nodeVersion":"20.13.1","dependencies":{"isomorphic-ws":"^5.0.0","@cardanosolutions/json-bigint":"^1.0.1"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","ava":"^6.2.0","tsup":"^8.4.0","jsdoc":"^4.0.4","minami":"^1.2.3","taffydb":"^2.7.3","prettier":"^3.5.3","typescript":"^5.8.2"},"_npmOperationalInternal":{"tmp":"tmp/mdk_1.0.0_1741963041956_0.46541764888579196","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@cardano-ogmios/mdk","version":"1.0.1","keywords":["cardano","ogmios","sdk","rpc"],"author":{"name":"KtorZ","email":"matthias.benkort@gmail.com"},"license":"Apache-2.0","_id":"@cardano-ogmios/mdk@1.0.1","maintainers":[{"name":"rhyslbw","email":"rhyslbw@gmail.com"},{"name":"ktorz","email":"matthias.benkort@gmail.com"}],"homepage":"https://cardanosolutions.github.io/ogmios-mdk/","bugs":{"url":"https://github.com/cardanosolutions/ogmios-mdk/issues"},"ava":{"files":["tests/**","!tests/**/{helpers}/**"]},"dist":{"shasum":"21d43e16b06ef1329bfb9b4dd66dc37d23a51053","tarball":"https://registry.npmjs.org/@cardano-ogmios/mdk/-/mdk-1.0.1.tgz","fileCount":7,"integrity":"sha512-AAj/926wACEmPdVkeXtVPVnte7Ips0dhr8Gi5ngeA93IrkDz7Z2+Y8xr/g7Wh+fXE1763G2p+2ma05Jh9oRbaQ==","signatures":[{"sig":"MEQCIGEK8Ns1RTUkEA5oZ/fsy8KYKUuFb/Sv8FHNK0e0RCMcAiAayI36b3z/+jNxVHJ/5GJs8vTwhDk69K25Y9RuOOkcEQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70710},"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"0a1c0db586c9954e95f94f9ab29d85e0d4299175","private":false,"scripts":{"doc":"yarn docs","docs":"jsdoc --readme ./README.md -c .jsdoc.json -d docs","test":"c8 ava","build":"tsup lib/index.mjs --format esm,cjs --dts","format":"prettier --write **/*.mjs"},"_npmUser":{"name":"ktorz","email":"matthias.benkort@gmail.com"},"tsconfig":{"$schema":"https://json.schemastore.org/tsconfig","display":"Default","exclude":["dist","node_modules"],"include":["lib/**/*"],"compilerOptions":{"lib":["ES2020","DOM","DOM.Iterable"],"module":"ESNext","outDir":"dist","strict":true,"target":"ESNext","allowJs":true,"sourceMap":true,"declaration":true,"incremental":false,"skipLibCheck":true,"declarationMap":true,"noUnusedLocals":false,"esModuleInterop":true,"isolatedModules":true,"moduleDetection":"force","moduleResolution":"node","resolveJsonModule":true,"noUncheckedIndexedAccess":true,"allowSyntheticDefaultImports":true}},"repository":{"url":"git+https://github.com/cardanosolutions/ogmios-mdk.git","type":"git"},"_npmVersion":"10.9.3","description":"A minimalist development kit for Ogmios.","directories":{},"_nodeVersion":"22.20.0","dependencies":{"isomorphic-ws":"^5.0.0","@cardanosolutions/json-bigint":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","ava":"^6.2.0","tsup":"^8.4.0","jsdoc":"^4.0.4","minami":"^1.2.3","taffydb":"^2.7.3","prettier":"^3.5.3","typescript":"^5.8.2"},"_npmOperationalInternal":{"tmp":"tmp/mdk_1.0.1_1765983587034_0.8048775256783376","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-03-14T14:37:21.861Z","modified":"2026-06-20T19:23:47.240Z","1.0.0":"2025-03-14T14:37:22.128Z","1.0.1":"2025-12-17T14:59:47.178Z"},"bugs":{"url":"https://github.com/cardanosolutions/ogmios-mdk/issues"},"author":{"name":"KtorZ","email":"matthias.benkort@gmail.com"},"license":"Apache-2.0","homepage":"https://cardanosolutions.github.io/ogmios-mdk/","keywords":["cardano","ogmios","sdk","rpc"],"repository":{"url":"git+https://github.com/cardanosolutions/ogmios-mdk.git","type":"git"},"description":"A minimalist development kit for Ogmios.","maintainers":[{"email":"matthias.benkort@gmail.com","name":"ktorz"}],"readme":"# Ogmios - Minimal Development Kit\n\n[![Licence](https://img.shields.io/github/license/CardanoSolutions/ogmios-mdk?style=for-the-badge)](https://github.com/CardanoSolutions/ogmios-mdk/blob/main/LICENSE)\n[![NPM](https://img.shields.io/npm/v/%40cardano-ogmios%2Fmdk?style=for-the-badge)](https://www.npmjs.com/package/@cardano-ogmios/mdk)\n\nA minimalist development kit in JavaScript for Ogmios.\n\n## Installation\n\n```\nyarn add @cardano-ogmios/mdk\n```\n\n## Usage\n\n### General usage\n\n```js\nimport { ogmios, Json } from \"@cardano-ogmios/mdk\";\n\nconst tip = await ogmios((ws, done) => {\n  ws.once(\"message\", (data) => {\n    done(Json.parse(data).result.tip)\n  });\n\n  ws.rpc(\"findIntersection\", { points: [ \"origin\" ] });\n});\n\nconsole.log(tip);\n```\n\n### Simple state-query\n\n```js\nimport { ogmios, Json } from \"@cardano-ogmios/mdk\";\n\nconst result = await ogmios((ws, done) => {\n  ws.queryLedgerState(\"tip\").then(done);\n});\n\nconsole.log(Json.stringify(result));\n```\n\n### Get a particular block child\n\n```js\nimport { ogmios, Json } from \"@cardano-ogmios/mdk\";\n\nawait ogmios(async (ws, done) => {\n  const chainFollower = await ws.newChainFollower(\n    [\n      {\n        id: \"3d6f139f9f019668fe0412cacfaeb9e0be42e7b0f6ab21d6bddbc12d771ec18a\",\n        slot: 86268539,\n      },\n    ],\n    1\n  );\n\n  for await (const { block } of chainFollower()) {\n    console.log(block);\n  }\n\n  done();\n});\n```\n\n### Follow the chain from the tip\n\n```js\nimport { ogmios, Json } from \"@cardano-ogmios/mdk\";\n\nawait ogmios(async (ws, done) => {\n  const chainFollower = await ws.newChainFollower();\n\n  for await (const { block } of chainFollower()) {\n    console.log(block);\n  }\n\n  done();\n});\n```\n\n","readmeFilename":"README.md"}