Skip to content

A minimalistic wrapper for the ETH API service.

License

Notifications You must be signed in to change notification settings

eidoo/ethapi-lib

Repository files navigation

Eidoo ETH API lib

Eidoo ETH API service wrapper.

CircleCI

Eidoo ETH API is an Ethereum node gateway that can be used to read or submit changes of the Ethereum network state.

For release notes, please see the CHANGELOG.

Installation

If you want you can install it with npm:

npm install --save eidoo/ethapi-lib

or if you prefer using yarn:

yarn add eidoo/ethapi-lib

Then within your application, you can reference to the lib with the following:

const { EidooEthApiLib } = require('@eidoo/ethapi-lib')
const ethApiConfig = {
  host: 'eidoo-api-1.eidoo.io',
  port: 443,
  useTLS: true,
}
const ethApiLibClient = new EidooEthApiLib(ethApiConfig)

Available APIs

Get nonce

const { nonce } = await ethApiLibClient.getAddressNonceAsync(EOA)

Get ethereum account transactions details

const { transactions } = await ethApiLibClient.getAccountTxsDetailsAsync(EOAorSCaddress)

Get gas estimation

const { gas, gasPrices } = await ethApiLibClient.getEstimateGasAsync(transactionObject)

Transaction call

const transactionCall = await ethApiLibClient.transactionCallAsync(transactionObject)

Send raw transaction

const { hash } = await ethApiLibClient.sendRawTransactionAsync(signedTransactionData)

Development

yarn install

Tests

Install the dependencies, then run yarn test:

yarn install
yarn test

You can run unit tests only using yarn test:unit.

About

A minimalistic wrapper for the ETH API service.

Resources

License

Stars

Watchers

Forks

Packages

No packages published