EVM Compatible Blockchain Provider
This package is part of IQ Protocol JS SDK.
:exclamation: The package is in development and breaking changes should be expected. Use at your own risk! |
---|
The package includes Blockchain Provider Interface implementation which allows interacting with IQ Protocol smart contracts deployed to EVM powered blockchain.
Whereas there are many EVM powered blockchains, IQ protocol smart contracts can be deployed to any EVM-compatible blockchain and this package can be used to interact with them.
The package name comes from EIP-155 which was the first adopted proposal which allowed to uniquely identify EVM-compatible blockchains and networks.
Use this package when you want to communicate with IQ Protocol smart contracts deployed to EVM-based blockchains (e.g. Ethereum, Binance Smart Chain).
Installation
This package requires ethers.js peer dependency, so it needs to be installed too.
yarn add @iqprotocol/eip155 ethers
Usage
You need to provide a Signer which suits your use-case. For example, VoidSigner
is enough for reading data.
import { EIP155BlockchainProvider } from '@iqprotocol/eip155';
import { VoidSigner } from 'ethers';
const clientAddress = '0x...';
const blockchain = new EIP155BlockchainProvider({
signer: new VoidSigner(clientAddress),
});
const enterpriseAddress = '0x...';
const serviceAddress = '0x...';
const enterpriseInfo = await blockchain.enterprise(enterpriseAddress).getInfo();
const serviceInfo = await blockchain.service(serviceAddress).getInfo();