{"id":13834626,"url":"https://github.com/stjet/banani","last_synced_at":"2025-07-10T07:30:46.848Z","repository":{"id":243019469,"uuid":"811254642","full_name":"stjet/banani","owner":"stjet","description":"banano library for javascript/typescript","archived":false,"fork":false,"pushed_at":"2025-02-21T02:41:02.000Z","size":674,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T22:38:19.193Z","etag":null,"topics":["banano","cryptocurrency","javascript","nodejs","typescript","web"],"latest_commit_sha":null,"homepage":"http://banani.prussia.dev/","language":"JavaScript","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/stjet.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-06-06T08:39:00.000Z","updated_at":"2025-03-20T17:04:58.000Z","dependencies_parsed_at":"2024-06-06T09:15:38.650Z","dependency_job_id":"d968365a-b33f-42c2-9b6b-6b7aa34a71b2","html_url":"https://github.com/stjet/banani","commit_stats":null,"previous_names":["stjet/banani"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stjet/banani","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjet%2Fbanani","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjet%2Fbanani/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjet%2Fbanani/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjet%2Fbanani/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stjet","download_url":"https://codeload.github.com/stjet/banani/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stjet%2Fbanani/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264545157,"owners_count":23625403,"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":["banano","cryptocurrency","javascript","nodejs","typescript","web"],"created_at":"2024-08-04T14:00:48.537Z","updated_at":"2025-07-10T07:30:46.839Z","avatar_url":"https://github.com/stjet.png","language":"JavaScript","funding_links":[],"categories":["Client Libraries"],"sub_categories":["JavaScript"],"readme":"# Banani\n\n\u003e ~~how to buy banani from beatrice~~\n\u003e how to install banani on react.js\n\nBanani is a library for the Banano cryptocurrency that will support sending, receiving, changing rep, RPC calls, message signing, wallet management, etc. It aims to be a more powerful and sensible version of @bananocoin/bananojs. Banani takes heavy inspiration from the Python [bananopie](https://github.com/stjet/bananopie) (which I also wrote), which in turn takes some inspiration from my experiences with ethers.js.\n\n**Please report any bugs or request features by opening an Github issue.** You can ask for help or ask questions in the #frankensteins-lab channel of the Banano discord and people will be typically be eager to assist if they can.\n\n## Installing\n\n```\nnpm install banani\n```\n\nEmbedding in the browser is easy to - just download and add `banani-browser.js` to your website:\n\n```html\n\u003cscript src=\"/path/to/banani-browser.js\"\u003e\u003c/script\u003e\n```\n\nTake a look in `browser_test/index.html` for an example.\n\n## Documentation\n\nThe docs are hosted at https://banani.prussia.dev (can also be accessed at https://stjet.github.io/banani/).\n\n## Examples\n\nBanani allows you to send, receive, and change representative. If you are using Banani on the web, replace `banani` with `window.banani`.\n\n```js\nconst rpc = new banani.RPC(\"https://kaliumapi.appditto.com/api\");\n\nconsole.log(await rpc.get_block_count());\n\nconst wallet = new banani.Wallet(rpc, process.env.seed);\n\nconst zero_index_address = wallet.address;\n\nwallet.index = 1;\n\nconst send_hash = await wallet.send(zero_index_address, \"1\"); //send 1 banano\n\nwallet.index = 0;\n\nawait wallet.receive(send_hash); //receive the bananos we just send (can also do `await wallet.receive_all()`)\n\nawait wallet.change_rep(\"placeholder\");\n```\n\nBanani also comes with some useful utilities, and message signing:\n\n```js\nconst rpc = new banani.RPC(\"https://kaliumapi.appditto.com/api\");\nconst random_wallet = banani.Wallet.gen_random_wallet(rpc);\n\nconsole.log(banani.whole_to_raw(\"4.20069\") === 420069000000000000000000000000n);\nconsole.log(random_wallet.sign_message(\"test message\\ntest test\"));\n```\n\n## Contributing\n\n```\ngit clone https://github.com/stjet/banani.git\ncd banani\n...\n\u003cmake your changes with your favourite editor\u003e\n...\nnpm run build\n```\n\nThen commit and push your changes.\n\nIn most cases, you will only need to touch the typescript (`.ts`) files.\n\n## Work Generation\n\nThough Kalium's public work will generate work for you, it is suggested that you generate your own work for the following reasons:\n\n- it is relatively \"easy\" (in terms of computation) to do\n- if Boompow goes offline (as it has done in the past), many Banano services will go down, which is not great for users and is not a very decentralized or resilient way to make your thing\n\nUnrelated, do remember that Nano has harder work thresholds than Banano.\n\n## Using for Nano instead of Banano\n\nThe main differences between Nano and Banano; or at least those relevant to a library like this, are the different amount of decimals. So, when creating a `Wallet` with banani, make sure to do `rpc.DECIMALS = banani.NANO_DECIMALS` otherwise your sends will be off by one magnitude which is bad.\n\nAlso, a different preamble should be used for message signing.\n\n## Dependencies\n\nBanani has two external dependencies, tweetnacl and blake2b. Blake2b probably has its own dependencies, but I haven't checked.\n\nTweetnacl is not listed as a dependency in the package.json because it has been modified to use blake2b for the hashing algorithm. So, a modified version of it is distributed directly along with the package (see `tweetnacl_mod.js`). Clone the repo and run `npm run cryptodiff` to see the changes made from regular tweetnacl.\n\nBanani also has many dev dependencies for contributing/developing the package (see the \"Contributing\" section), but they are not needed for regular users of the package.\n\n## Todo\n\n- More extensive testing\n- Example work generating function\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstjet%2Fbanani","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstjet%2Fbanani","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstjet%2Fbanani/lists"}