npm install @web3-systems/multichain-database
yarn add @web3-systems/multichain-database
git clone https://github.com/web3-systems/multichain-database
import * as React from 'react';
import {
MultiChainProvider,
useInitializeDefaultCollections,
useGetAccountTransactions
} from '@web3-systems/react-multichain';
export const Transactions = () => {
const {
status,
data,
meta
} = useGetAccountTransactions('0x5ed8cee6b63b1c6afce3ad7c92f4fd7e1b8fad9f', 'from', 1);
return(
<div>
<TransactionsTable data={data} />
</div>
)
}
export const Contracts = () => {
const {
status,
data,
meta
} = useGetContractABI('0xb9a179DcA5a7bf5f8B9E088437B3A85ebB495eFe', 1);
return(
<div>
{status === 'LOADING' && return <span>Loading...</span>}
<ContractRender abi={data} />
</div>
)
}
const InnerProvider = ({children}) => {
const isReady = useInitializeDefaultCollections(1)
return(
<div>
{isReady && children}
{!isReady && <div>Loading...</div>}
</div>
)
}
export const Providers = () => {
const chains = [{
chainId: 1,
providerUrl: 'https://mainnet.infura.io/v3/INFURA_API_KEY',
scannerApiKey: 'ETHERSCAN_API_KEY'
}]
return (
<MultiChainProvider chains={chains}>
<InnerProvider>
<Transactions />
<Contracts />
</InnerProvider>
</MultiChainProvider>
);
};
### 📖 Overview
Coming soon...
### 🧩 Examples
Coming soon...
### 💻 Developer Experience
The package is setup using the [TSDX zero-config CLI](https://tsdx.io/) which includes:
- Typescript
- Rollup
- Jest
- Prettier
- ESLint