@crypto-connect/ethereum
TypeScript icon, indicating that this package has built-in type declarations

0.0.2-alpha.55 • Public • Published

Ethereum

Install

Package NPM Yarn
Ethereum npm i @crypto-connect/ethereum yarn add @crypto-connect/ethereum
Web3 npm i Web3 yarn add Web3

Usage

import Web3 from "web3";
import ethereumConnect from "@crypto-connect/ethereum";

// Set up Web3
const httpProvider = new Web3.providers.HttpProvider("<ETH_NODE_URL>");
const web3 = new Web3(httpProvider);

// List of tokens to find balances for
const erc20Tokens = [
  {
    name: "BAT",
    contractAddress: "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
  },
];

// Authorise
const ethereum = ethereumConnect({ web3, erc20Tokens }).withWallet(
  "<WALLET_ADDRESS>",
);

// Get balances
const balances = await ethereum.getBalances();

Readme

Keywords

none

Package Sidebar

Install

npm i @crypto-connect/ethereum

Weekly Downloads

0

Version

0.0.2-alpha.55

License

ISC

Unpacked Size

17.7 kB

Total Files

14

Last publish

Collaborators

  • chrisdrifter_