Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@ethernauta/erc

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ethernauta/erc

[![bundlejs](https://deno.bundlejs.com/badge?q=@ethernauta/erc&treeshake=[*])](https://deno.bundlejs.com/?q=@ethernauta/erc&treeshake=[*])

Source
npmnpm
Version
0.0.43
Version published
Weekly downloads
416
20.58%
Maintainers
1
Weekly downloads
 
Created
Source

bundlejs

What will you find here?

ERC method bindings ready to be used to read or write the blockchain. Each method is generated from the standard's reference ABI and is either a Callable<T> (view / pure) or a Signable<Bytes> (state-changing).

Philosophy

This module aims to be an un-opinionated representation of the defined:

Currently supports

  • Token Standard (ERC-20)
  • Standard Interface Detection (ERC-165)
  • Non-Fungible Token Standard (ERC-721)
  • Multi Token Standard (ERC-1155)
  • Tokenized Vault Standard (ERC-4626)

ERC-20 extensions

  • burnable, capped, flash-mint, mintable, pausable, permit, votes, wrapper

ERC-721 extensions

  • burnable, pausable, permit, royalty, votes

Want to see one added?

Please, if this is the case, ask for it in an issue.

Want to generate them yourself?

You can generate your own methods (ready to be used) if you provide a valid ABI in .json format. Check the CLI package.

Modules

API

Executing an ERC-20 state-changing method

import { transfer } from "@ethernauta/erc/20"
import { eth_sendRawTransaction } from "@ethernauta/eth"
import { number_to_hex } from "@ethernauta/utils"
import { signer, writer, SEPOLIA_CHAIN_ID } from "./resolvers"

const TOKEN_ADDRESS = "0x..."
const signed = await transfer([
  "0x636c0fcd6da2207abfa80427b556695a4ad0af94",
  number_to_hex(1),
])(signer({ chain_id: SEPOLIA_CHAIN_ID, to: TOKEN_ADDRESS }))

const hash = await eth_sendRawTransaction([signed])(
  writer({ chain_id: SEPOLIA_CHAIN_ID }),
)

Reading an ERC-20 view method

import { balanceOf } from "@ethernauta/erc/20"
import { contract, SEPOLIA_CHAIN_ID } from "./contract"

const TOKEN_ADDRESS = "0x..."
const balance = await balanceOf({ owner: account })(
  contract({ chain_id: SEPOLIA_CHAIN_ID, to: TOKEN_ADDRESS }),
)

Executing an ERC-721 state-changing method

import { approve } from "@ethernauta/erc/721"
import { eth_sendRawTransaction } from "@ethernauta/eth"
import { signer, writer, SEPOLIA_CHAIN_ID } from "./resolvers"

const NFT_ADDRESS = "0x..."
const signed = await approve([
  "0x636c0fcd6da2207abfa80427b556695a4ad0af94",
  "1",
])(signer({ chain_id: SEPOLIA_CHAIN_ID, to: NFT_ADDRESS }))

const hash = await eth_sendRawTransaction([signed])(
  writer({ chain_id: SEPOLIA_CHAIN_ID }),
)

Detecting interface support (ERC-165)

import { supportsInterface } from "@ethernauta/erc/165"
import { contract, SEPOLIA_CHAIN_ID } from "./contract"

const ERC721_INTERFACE_ID = "0x80ac58cd"
const supported = await supportsInterface({
  interfaceId: ERC721_INTERFACE_ID,
})(contract({ chain_id: SEPOLIA_CHAIN_ID, to: NFT_ADDRESS }))

FAQs

Package last updated on 19 May 2026

Did you know?

Socket

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