{"id":36627787,"url":"https://github.com/cardano-foundation/cf-flat-decoder-ts","last_synced_at":"2026-01-12T09:34:00.198Z","repository":{"id":215446084,"uuid":"738856987","full_name":"cardano-foundation/cf-flat-decoder-ts","owner":"cardano-foundation","description":"This package aims to offer a simple and fast method for decoding flat binary-encoded data using TypeScript and plain JavaScript, suitable for both node.js and browser","archived":false,"fork":false,"pushed_at":"2024-03-11T02:34:16.000Z","size":396,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-02T09:14:02.915Z","etag":null,"topics":["binary","cardano","flat","plutus","smart-contract","typescript","uplc"],"latest_commit_sha":null,"homepage":"https://cardano-foundation.github.io/cf-flat-decoder-ts/","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/cardano-foundation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-04T07:52:22.000Z","updated_at":"2024-11-17T08:06:08.000Z","dependencies_parsed_at":"2024-02-02T04:37:11.271Z","dependency_job_id":null,"html_url":"https://github.com/cardano-foundation/cf-flat-decoder-ts","commit_stats":null,"previous_names":["cardano-foundation/cf-flat-decoder-ts"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cardano-foundation/cf-flat-decoder-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardano-foundation%2Fcf-flat-decoder-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardano-foundation%2Fcf-flat-decoder-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardano-foundation%2Fcf-flat-decoder-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardano-foundation%2Fcf-flat-decoder-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cardano-foundation","download_url":"https://codeload.github.com/cardano-foundation/cf-flat-decoder-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardano-foundation%2Fcf-flat-decoder-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binary","cardano","flat","plutus","smart-contract","typescript","uplc"],"created_at":"2026-01-12T09:34:00.124Z","updated_at":"2026-01-12T09:34:00.186Z","avatar_url":"https://github.com/cardano-foundation.png","language":"TypeScript","readme":"# Typescript Flat Decoder\n\n\u003cp align=\"left\"\u003e\n\u003cimg alt=\"Tests\" src=\"https://github.com/cardano-foundation/cf-flat-decoder-ts/actions/workflows/test.yml/badge.svg?branch=main\" /\u003e\n\u003cimg alt=\"Coverage\" src=\"https://cardano-foundation.github.io/cf-flat-decoder-ts/coverage-report/coverage-jest%20coverage.svg\" /\u003e\n\u003cimg alt=\"Release\" src=\"https://github.com/cardano-foundation/cf-flat-decoder-ts/actions/workflows/release.yml/badge.svg?branch=main\" /\u003e\n\u003cimg alt=\"Publish\" src=\"https://github.com/cardano-foundation/cf-flat-decoder-ts/actions/workflows/publish.yml/badge.svg?branch=main\" /\u003e\n\u003cimg alt=\"Bundle\" src=\"https://github.com/cardano-foundation/cf-flat-decoder-ts/actions/workflows/bundle.yml/badge.svg?branch=main\" /\u003e\n\u003ca href=\"https://conventionalcommits.org\"\u003e\u003cimg alt=\"conventionalcommits\" src=\"https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/4WVNHgQ7bP\"\u003e\u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/1022471509173882950\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis project aims to provide a [flat binary](https://github.com/Quid2/flat) decoder. It is written in Typescript and can be used in both NodeJS and the browser.\n\n## Getting Started\n\n```\nnpm i @cardano-foundation/cf-flat-decoder-ts\n```\n\n## Usage\n\nYou can use the decoder in node backend but also in the browser. This example shows how to use it in a React app.\n\n```typescript\nimport { useState } from 'react';\nimport { decodeFlatUplc, Term } from '@cardano-foundation/cf-flat-decoder-ts';\n\nfunction App() {\n  const [deserializeContract, setDeserializeContract] = useState(\n    '59050c010000333323232323232323232323232323232323232323232323222232222533301a3375e0049801018000132323232533301e323001222222333301b232333322323232533302c3370e9000001080d8a99981619b87480100084c068c0b80044cc8cc0748c888c00800cc0c8004dd48009bae302e001004302f00230240013754004605260500020064a66605066e1ccc070014dd59815001240042602c6eb0c8c8c8c8c8c8c8c8c8c8c8c8c8c803d4ccc0d000452616303500653330333370e90000010991919299981b29981419b87001480004cdc3800a40702646493299981b0008a4c2c606e0082c6e34004dd7000981a8008a99981999b87480080084c926533303200114985858c0d8008c0ac004dd500098188009817803299981699b87480000084c8c8c8c8c8c8c9265333032001149858c0cc0194ccc0c4cdc3a400000426464646464646493299981b0008a4c2c606e0066eb4004c0d8004c0d000ccc8c0c4894ccc0d000440c04cc0c4c00cc0dc004c008c0d80048c94ccc0d0cdc39b8d001480e0400858dd70009bac001303300116303400230290013754002605e0022a66605a66e1d20020021324994ccc0b0004526161630300023025001375400260560026eb0004405c4894004c09cc0a4c0a0c09cc0a400401094cc060ccc07d281191800911191980e91999980e9191118010019bab303200137520066eacc0bcc0b8c0c0c0bcc0b8c0c00048cc07c94ccc0bccdc4a40046eb4c0cc0044c010dd718148008a5000114a0006466e212000330200010043232233300100b003002375c0046604a44a666050002201026604a60560026004605400200e6050604e002266603e9408c8cdc49bad302a3029001333026222533302a00110021330033370000490011816000a4000664604e44a666054002204c264a66605860080022660500026006605a00426006605a004605a00266444660060020044604e44a666054002294054ccc0accdd798168008018a5113002302c00100637586054002605400260500022940c8c8c8c8c88cccccc00401801401000c038008dd59812181198118029bac30230043758604400a6eb0c084014dd598100010a4c2c64603e6036002603c0026032603a0026038002603a6038603a002266666030444a666038002244a0022a66603a6004603e002264446004006603e002266006004603c00246466ebc00401cc8c078c07c004c8c078c07c004c074c070c078004c8dd6180e980f000980e180e800924c2c6eb8008888c00800c894004888cc044894ccc050004489400454ccc054cdd79807980b80080209802980b80089801180b000800918071129998088008a5015330043003301400113002301300123300f00100214a2446666660060100246ea40080048ccc01c88cdc01bad301500200148000dd58008a40004444666600a6600c0080040024644460040066008002244a0024601244a666018002244a0022666006601e002444600400626004601c002444a66601866ebc008c00c004488c00800c489400488c020894ccc02c004400c4cc010c038004c008c034004888c8c8c94ccc034cdc3a4004004200c2600a601e0026020004600a0026ea800555cea5eb815d0118029802800919180111980100100091801119801001000aab9f5734ae895d0918011baa0015573c9810100004c011e581c9cae3d41ae05882f5f357f0042d71842f1cc8a8e5230411ddb4daf17004c0122d87a9f581cca925263da4c59bf675f3cc485c894575cfe9b2b50ae5c3a360a62cdff0001'\n  );\n  const [uplc, setUplc] = useState('');\n\n  const handleGetUplc = () =\u003e {\n    const uplc = decodeFlatUplc(deserializeContract);\n    setUplc(uplc);\n    Term.indent = 5; //Reset indent\n  };\n\n  return (\n    \u003c\u003e\n      \u003ch1\u003eFlat decoder\u003c/h1\u003e\n      \u003cdiv\u003e\n        \u003cinput\n          value={deserializeContract}\n          onChange={(e) =\u003e {\n            setDeserializeContract(e.target.value);\n          }}\n        /\u003e\n        \u003cbutton onClick={handleGetUplc}\u003eGet uplc\u003c/button\u003e\n      \u003c/div\u003e\n      \u003cdiv\n        style={{ margin: '10px 0', padding: 10, whiteSpace: 'nowrap' }}\n        dangerouslySetInnerHTML={{ __html: uplc }}\n      \u003e\u003c/div\u003e\n    \u003c/\u003e\n  );\n}\n\nexport default App;\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardano-foundation%2Fcf-flat-decoder-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardano-foundation%2Fcf-flat-decoder-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardano-foundation%2Fcf-flat-decoder-ts/lists"}