Socket
Socket
Sign inDemoInstall

anix-js

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    anix-js

Minimal and flexible JSON-RPC wrapper for Ethereum


Version published
Weekly downloads
0
Maintainers
1
Install size
483 kB
Created
Weekly downloads
 

Readme

Source

Anix

NPM Package

Image description

Minimal (< 1 Kb), dependency-free and flexible JSON-RPC client library for Ethereum.

The goal is to make it easy to work with RPC endpoints.

This library uses JavaScript Proxy object to allow arbitrary prototype method calls, the API offers an intuitive translation to the raw RPC methods, where eth_getLogs becomes eth.getLogs(), and so on.

Installation

$ npm i --save-dev anix-js

Basic usage:

main.mjs:

import {Anix} from 'anix-js'

const eth = new Anix('eth', <YOUR HTTP RPC ENDPOINT>)

console.dir(await eth.getBlockByNumber('latest', false))
$ node main.mjs

- or - 

$ bun run main.mjs

Can be used for arbitrary/custom RPC methods:

import {Anix} from 'anix-js'

const eth = new Anix('eth', <YOUR HTTP RPC ENDPOINT>)

await eth.sendBundle({…})

Read-Eval-Print-Loop

Anix has a built-in REPL script, making it easy to prototype.

$ npx anix-js http://my-rpc-url.xyz

Welcome to Anix 🪷⚘

> eth.getBlockByNumber('latest', false)
> {…}

Benefits of using Anix:

  • Works with any set of custom RPC methods, because of its native proxy object.
  • It resembles the Geth console JavaScript APIs.
  • It's incredibly portable, with a minimal footprint (less than 1kb minified).
  • It uses the native fetch method, implemented on top of Undici.
  • No dependencies attached: Anix is not prone to supply-chain attacks.

Check the examples directory for boilerplate code.

Questions?

Ping me on twitter.

Keywords

FAQs

Last updated on 29 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc