{"id":15428958,"url":"https://github.com/njokuscript/blowfishjs","last_synced_at":"2025-04-19T16:37:55.754Z","repository":{"id":65070926,"uuid":"580855363","full_name":"njokuScript/blowfishjs","owner":"njokuScript","description":"A Typescript/Javascript library for interacting with the Blowfish APIs","archived":false,"fork":false,"pushed_at":"2023-01-01T03:32:10.000Z","size":545,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T12:33:42.678Z","etag":null,"topics":["javascript","security","solana","web3"],"latest_commit_sha":null,"homepage":"https://blowfish.xyz/","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/njokuScript.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}},"created_at":"2022-12-21T16:10:40.000Z","updated_at":"2023-06-27T05:53:05.000Z","dependencies_parsed_at":"2023-01-09T12:58:30.188Z","dependency_job_id":null,"html_url":"https://github.com/njokuScript/blowfishjs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njokuScript%2Fblowfishjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njokuScript%2Fblowfishjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njokuScript%2Fblowfishjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/njokuScript%2Fblowfishjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/njokuScript","download_url":"https://codeload.github.com/njokuScript/blowfishjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249739354,"owners_count":21318555,"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":["javascript","security","solana","web3"],"created_at":"2024-10-01T18:08:12.178Z","updated_at":"2025-04-19T16:37:55.711Z","avatar_url":"https://github.com/njokuScript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n\u003cimg title=\"Blowfish\" src= \"https://res.cloudinary.com/njokuscript/image/upload/v1671695941/blowfish_x9tug4.svg\" width=\"300px\"/\u003e\n\u003c/p\u003e\n\n\nThe Blowfish javascript library compatible with browsers and Node.js backends\n\n\n## Installation\n\nTo get started, install the Blowfish JS package from npm.\n\n```sh\nnpm install @njoku/blowfishjs\n```\nFor browsers, via jsDelivr CDN:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@njoku/blowfishjs@1.0.4/dist/index.bundle.min.js\"\u003e\u003c/script\u003e\n```\n\n## Getting Started\n\nTo create a new Blowfish instance, you have to pass in your blowfish API key in the constructor.\n\n```js\n// in browser\nconst blowfish = new Blowfish(BLOWFISF_API_KEY);\n\n// in nodejs\nconst Blowfish = require('@njoku/blowfishjs');\nconst blowfish = new Blowfish(BLOWFISF_API_KEY);\n```\n\n## Scanning a transaction\nScan transactions in order to receive recommended actions, tailored warnings and human-readable simulation results explaining what the transaction will do.\n\n```js\n\nconst params = {\n    chain: 'solana',\n    chainId: 101,\n    transactions: [\n    'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIFRcely+GNw4HsXvDZ2vi8ZHSvnfYAbuGTK5XjxGyUJ60JrJ+YHtCWDBeA0FSzvcigxpHxRg4haKu4qFquf9nwtxDLqeLGT1Y9D3jvRn8BJWyEq8LHFGZpD+vfskCcD4EGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGp9UXGSxWjuCKhF9z0peIzwNcMUWyGrNE2AYuqUAAAD1D6qTjIhI3IvLaoY+jcKrCp7I8+Di2XK6tV2y4c2liAgMDAgQABAQAAAADAgABDAIAAAAA4fUFAAAAAA==',\n    ],\n    userAccount: '5hPhdbH8bVXNrx2Cy9bM6bXkZhNUGAUizq9QQW7zMguz',\n    dappUrl: 'https://scammer.com',\n}\n\nconst evaluationResult = await blowfish.scanTransaction(params);\n\n```\n\n| **Parameter** | **Type**        | **Description**                                                                                                                                                                |\n| ------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `chain`    | *string* | Blockchain to perform the transaction scanning on. See the list of supported blockchains here  |\n| `chainId`      | *number*  | Network identifier of the blockchain .                                                                                      |\n| `transactions`   | *array/object*       | For the Solana chain, transactions is an array of base58 or base64 encoded Solana transactions. For the Ethereum and Polygon chain, the transaction is an object containing the *from*, *to*, *value* and *data* properties. |\n| `userAccount`        | *string*       | A hex-representation of the user account who is being asked to sign the supplied transaction addresses.      |\n| `dappUrl`       | *string* | DApp domain proposing these transactions |\n\n## Supported Chains\n* ### Solana\n    * Devnet\n    * Testnet\n    * Mainnet\n\n* ### Ethereum/Polygon\n  - Ethereum Mainnet\n  - Goerli Testnet\n  - Polygon Mainnet\n\n### Ethereum and Polygon are equivalent when it comes to functionality as well as request and response formats.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjokuscript%2Fblowfishjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnjokuscript%2Fblowfishjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnjokuscript%2Fblowfishjs/lists"}