# ethgate

> Ethgate is a library for making batched calls to Ethereum compatible chains.

Latest version **0.5.0** (published 2021-08-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install ethgate
pnpm add ethgate
yarn add ethgate
bun add ethgate
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2021-08-30 |
| First published | 2021-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 456 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Alican Çubukçuoğlu |
| Maintainers | alicanc |

## Links

- npm: https://www.npmjs.com/package/ethgate
- Repository: https://github.com/cardpunks/ethgate
- Homepage: https://github.com/cardpunks/ethgate#readme
- Issues: https://github.com/cardpunks/ethgate/issues
- npm.io page: https://npm.io/package/ethgate

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [dataloader](https://npm.io/package/dataloader.md) ^2.0.0
- [@ethersproject/abi](https://npm.io/package/@ethersproject/abi.md) ^5.4.1

## Recent versions

- 0.5.0 (latest) — 2021-08-30
- 0.4.0 — 2021-08-30
- 0.1.0 — 2021-08-28

## README

# Ethgate

Ethgate is a library for making batched calls to Ethereum compatible chains.

API Reference: https://cardpunks.github.io/ethgate/

This library is very experimental. Even documented features might not work.

## Usage

```ts
import { Contract as EthersContract } from '@ethersproject/contracts';
import { InfuraProvider as EthersInfuraProvider } from '@ethersproject/providers';
import { EthgateChain } from 'ethgate';

const ethersMainnetProvider = new EthersInfuraProvider('homestead');

const mainnet = new EthgateChain(ethersMainnetProvider, 1);

const ensRegistryContract = new EthersContract(
  '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
  ensRegistryContractInterface,
);

const names = ['resolver.eth', 'cardpunks.eth', 'alicanc.eth'];

const results = await Promise.all(
  names.map(async (name) => {
    const namehash = hashEnsName(name);

    const [recordExists, owner, resolver] = await Promise.all([
      mainnet.call(ensRegistryContract, 'recordExists(bytes32)', [namehash]),
      mainnet.call(ensRegistryContract, 'owner(bytes32)', [namehash]),
      mainnet.call(ensRegistryContract, 'resolver(bytes32)', [namehash]),
    ]);

    return { recordExists, owner, resolver };
  }),
);

// You now have the results and only one RPC call has been made!
```

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