TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

The Blowfish javascript library compatible with browsers and Node.js backends


To get started, install the Blowfish JS package from npm.

npm install @njoku/blowfishjs

For browsers, via jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/blowfishjs@latest/dist/index.bundle.min.js"></script>

Getting Started

To create a new Blowfish instance, you have to pass in your blowfish API key in the constructor.

// in browser
const blowfish = new Blowfish(BLOWFISF_API_KEY);

// in nodejs
const Blowfish = require('@njoku/blowfishjs');
const blowfish = new Blowfish(BLOWFISF_API_KEY);

Scanning a transaction

Scan transactions in order to receive recommended actions, tailored warnings and human-readable simulation results explaining what the transaction will do.

const params = {
    chain: 'solana',
    chainId: 101,
    transactions: [
    userAccount: '5hPhdbH8bVXNrx2Cy9bM6bXkZhNUGAUizq9QQW7zMguz',
    dappUrl: 'https://scammer.com',

const evaluationResult = await blowfish.scanTransaction(params);
Parameter Type Description
chain string Blockchain to perform the transaction scanning on. See the list of supported blockchains here
chainId number Network identifier of the blockchain .
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.
userAccount string A hex-representation of the user account who is being asked to sign the supplied transaction addresses.
dappUrl string DApp domain proposing these transactions

Supported Chains

  • Solana

    • Devnet
    • Testnet
    • Mainnet
  • Ethereum/Polygon

    • Ethereum Mainnet
    • Goerli Testnet
    • Polygon Mainnet

Ethereum and Polygon are equivalent when it comes to functionality as well as request and response formats.


npm i @njoku/blowfishjs

DownloadsWeekly Downloads






Unpacked Size

38.2 kB

Total Files


Last publish


  • njoku