# abi-tool

> Get the contract's abi through the blockchain browser

Latest version **1.1.0** (published 2022-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install abi-tool
pnpm add abi-tool
yarn add abi-tool
bun add abi-tool
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-03-03 |
| First published | 2022-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 22.4 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | pleurer |
| Maintainers | pleurer |
| Keywords | abi, abi-tool |

## Links

- npm: https://www.npmjs.com/package/abi-tool
- npm.io page: https://npm.io/package/abi-tool

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.26.0
- [assert](https://npm.io/package/assert.md) ^2.0.0
- [ethers](https://npm.io/package/ethers.md) ^5.5.4
- [events](https://npm.io/package/events.md) ^3.3.0

## Recent versions

- 1.1.0 (latest) — 2022-03-03
- 1.0.9 — 2022-03-03
- 1.0.7 — 2022-03-01
- 1.0.6 — 2022-03-01
- 1.0.5 — 2022-03-01
- 1.0.4 — 2022-02-28
- 1.0.3 — 2022-02-28
- 1.0.2 — 2022-02-23
- 1.0.1 — 2022-02-18
- 1.0.0 — 2022-02-17

## README

## Installation
We recommend switching to Node.js version 12.0.1 to make sure common crypto dependencies work. Execute nvm use, if you have Node Version Manager.

```bash
npm install --save abi-tool
```
Install ethers、axios too if you haven't already.
## Getting Started
##### 1.getAbiJson
The abi jsonof supporting contract acquisition from some blockchain browsers is that the contract has been open sourced, now support eth、bsc、polygon

for examble:
```bash
const {AbiTool, CHAIN_APIS} = require('../abi-tool');

let data = await AbiTool.getContractAbi(
	"0xdac17f958d2ee523a2206206994597c13d831ec7 ", 
	CHAIN_APIS.ETH
)
console.log(data)
```

##### 2.batchCallContract
If you know the abi of the contract, you can import private keys in batches and execute a certain method of the same contract at the same time, this does not limit the network

```bash
const {AbiTool, CHAIN_APIS} = require('../abi-tool');

const pks = [
        "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    ]
const abi = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const chainRpc = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
const chainId = "xxxxxx"
const contractAddress = "xxxxxxxxxxxxxxxxxxxxx"
let abiTool = new AbiTool(chainRpc , chainId )

//start listen event,this function emit name `batchCallContract`
abiTool.emitter.on("batchCallContract", function (arg) {
	console.log("arg", arg)
})
await abiTool.batchCallContract(
  contractAddress, 
  abi, 
  pks, 
  methodName, 
  args,
  {
    gasPrice:"xxxxxxxxxx",
    gasPrice:"xxxxxxxxxx"
  }
)
```

---
_Source: https://npm.io/package/abi-tool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
