{"id":15631818,"url":"https://github.com/miguelaeh/cardanocli-js","last_synced_at":"2025-04-05T00:06:43.997Z","repository":{"id":40400742,"uuid":"324862317","full_name":"miguelaeh/cardanocli-js","owner":"miguelaeh","description":"Wrapping the cardano-cli inside JavaScript","archived":false,"fork":false,"pushed_at":"2024-05-26T14:58:49.000Z","size":193,"stargazers_count":179,"open_issues_count":1,"forks_count":84,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-28T23:07:58.959Z","etag":null,"topics":["cardano","cardano-cli","cardano-node","javascript","keys","management","pool","script","stake","stakepool","wallet","wrapper"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miguelaeh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-12-27T22:43:12.000Z","updated_at":"2025-03-07T12:51:32.000Z","dependencies_parsed_at":"2024-06-12T15:10:35.956Z","dependency_job_id":"22763dad-4ca2-444c-97ca-d025c1796df1","html_url":"https://github.com/miguelaeh/cardanocli-js","commit_stats":{"total_commits":114,"total_committers":22,"mean_commits":5.181818181818182,"dds":"0.39473684210526316","last_synced_commit":"f6809f9f9af287e01becf312969665aa78fbcc81"},"previous_names":["berry-pool/cardanocli-js","shareslake/cardanocli-js"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelaeh%2Fcardanocli-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelaeh%2Fcardanocli-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelaeh%2Fcardanocli-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miguelaeh%2Fcardanocli-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miguelaeh","download_url":"https://codeload.github.com/miguelaeh/cardanocli-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266563,"owners_count":20910836,"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":["cardano","cardano-cli","cardano-node","javascript","keys","management","pool","script","stake","stakepool","wallet","wrapper"],"created_at":"2024-10-03T10:41:39.261Z","updated_at":"2025-04-05T00:06:43.983Z","avatar_url":"https://github.com/miguelaeh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cardanocli-js\n\n## Overview\n\nThis is a library wrapping the cardano-cli with TypeScript (can also be used in Javascript projects) which makes it possible to interact with the cardano CLI much faster and more efficient.\n\n## Prerequisites\n\nYou need access to a Cardano Node socket. If you have a remote node you can create a ssh tunnel with the socket file as follows:\n\n```\nssh -nNT -L /tmp/forwarded.socket:/path/to/remote/node.socket remote-machine-user@remote-machine-ip\n```\n\n## Install\n\n#### NPM\n\n```bash\nnpm install cardanocli-js\n```\n\n#### From source\n\n```bash\ngit clone https://github.com/miguelaeh/cardanocli-js.git\ncd cardanocli-js\nnpm install\n```\n\n## Getting started\n\n```javascript\nconst { CardanoCliJs, CardanoCliJsOptions } = require(\"cardanocli-js\");\nconst shelleyGenesisPath = \"/home/ada/mainnet-shelley-genesis.json\"; // Update this path to the actual path\nconst options = new CardanoCliJsOptions({\n    shelleyGenesisPath: '/home/miguelaeh/projects/cardano-cli-agent/cardanocli-js/tests/assets/shelley-genesis.json'\n    // network: 4, // Uncomment this line to use a testnet by adding the testnet magic\n});\nconst cardanocliJs = new CardanocliJs(options);\n\nconst createWallet = (account) =\u003e {\n  const payment = cardanocliJs.address.keyGen(account);\n  const stake = cardanocliJs.stake_address.keyGen(account);\n  cardanocliJs.stake_address.build(account);\n  const addr = cardanocliJs.address.build(account, {\n    paymentVkey: payment.vkey,\n    stakeVkey: stake.vkey,\n  });\n  return addr;\n};\n\nconst walletAddr = createWallet(\"my-wallet-name\");\n\nconsole.log(\"My wallet address:\", walletAddr);\n```\n\nCheck `/examples` for more use cases. If you have doubts on how to use a specific command you can also check the `tests` folder, where all the commands are tested.\n\n## Tests\n\nInstall npm dev dependencies using `npm install --also=dev`.\n\nTests are using Jest framework and can be run by using `npm run-script test` command.\n\nTests are configured to run with the Sancho network. You may need to update your `cardano-cli` binary to the sancho one in order to run the tests.\n\n## Major changes\n\n### 5.0.0\n\nStarting on version `4.0.0` the HTTP provider has been removed. There are better options for that as of today. For example, the blockfrost API.\nThis means than to use this library you need a fully synced node. And it is, as its name states, a wrapper over the CLI to make your life easier when creating scripts.\nIf you need to connect to your own remote cardano nodes you can forward the socket via an SSH tunnel:\n\n```\nssh -nNT -L /tmp/forwarded.socket:/path/to/remote/node.socket remote-machine-user@remote-machine-ip\n```\n\nFor better maintencane, the library has been moved to TypesScript and its internal structure changed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelaeh%2Fcardanocli-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelaeh%2Fcardanocli-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelaeh%2Fcardanocli-js/lists"}