npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@njoku/blowfishjs

v1.0.4

Published

A Typescript/Javascript library for interacting with the Blowfish APIs

Downloads

11

Readme

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

Installation

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: [
    'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIFRcely+GNw4HsXvDZ2vi8ZHSvnfYAbuGTK5XjxGyUJ60JrJ+YHtCWDBeA0FSzvcigxpHxRg4haKu4qFquf9nwtxDLqeLGT1Y9D3jvRn8BJWyEq8LHFGZpD+vfskCcD4EGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGp9UXGSxWjuCKhF9z0peIzwNcMUWyGrNE2AYuqUAAAD1D6qTjIhI3IvLaoY+jcKrCp7I8+Di2XK6tV2y4c2liAgMDAgQABAQAAAADAgABDAIAAAAA4fUFAAAAAA==',
    ],
    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.