
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
@covalenthq/web3-components
Advanced tools
This web3 library is powered by the [Covalent Unified API](https://www.covalenthq.com/?utm_source=web3_components&utm_medium=docs) and consists of useful React components to fetch any on-chain data across any of the 30+ Covalent supported blockchain netwo
This web3 library is powered by the Covalent Unified API and consists of useful React components to fetch any on-chain data across any of the 30+ Covalent supported blockchain networks.
These components do not require an active web3 provider since data is hosted, indexed and queried from the Covalent Network. However, an API Key is required to use them.
Please refer to the Covalent API reference for documentation on how the API works.
Install with npm: npm install @covalenthq/web3-components
or install with yarn: yarn install @covalenthq/web3-components
Create an .env
file and set the variable: REACT_APP_COVALENT_API_KEY=
Your Covalent API Key
This components folder comes with a sample create-react-app
called demo-app
which uses @covalenthq/web3-components
. You can use the demo-app
to test any changes or customizations made to the components.
To run the demo app:
cd demo-app
.env
file and set the variable: REACT_APP_COVALENT_API_KEY=
Your Covalent API Keynpm i && npm start
The demo app will run at http://localhost:3000/
with each tab demonstrating a component:
<TokenBalances />
Demo Wallet Dashboard: https://covalenthq.github.io/Wallet-Dashboard-Demo/
The <TokenBalances />
component provides a complete and paginated balances table with all the ERC20 tokens and NFTs for a given wallet address
and chainId
.
address
chainId
import { TokenBalances } from '@covalenthq/web3-components';
function App() {
return(
<div className="TokenBalances">
<TokenBalances
address="demo.eth"
chainId="1"
/>
</div>
)
}
export default App;
<ERC20Transfers />
Demo ERC20Transfers page:: https://covalenthq.github.io/erc20Transfers/
The ERC20Transfers component returns a paginated list of all the ERC20 token transfers of a wallet address on a particular chain. It takes an address
and chainId
as inputs and uses the Get Transactions for Address
endpoint.
address
chainId
import { useState } from 'react'
import { ERC20Transfers } from '@covalenthq/web3-components'
import { Input } from 'antd'
const { Search } = Input
const FormControls = ({onSubmit}) => {
return (
<Search placeholder='Enter Wallet Address or ENS' onSearch={onSubmit} enterButton
style={{
width: 500,
}}/>
)
}
function App() {
const [walletAddress, setWalletAddress] = useState(null)
const onSubmit = (values) => {
setWalletAddress(values)
}
if (walletAddress) {
return (
<>
<div style={{width: '80%', margin: 'auto'}}>
<FormControls onSubmit={onSubmit}/>
<ERC20Transfers address={walletAddress} chainId={1}/>
</div>
</>
)
} else {
return (
<>
<div style={{width: '80%', margin: 'auto'}}>
<FormControls onSubmit={onSubmit}/>
</div>
</>
)
}
}
export default App;
<TokenHolders />
The <TokenHolders />
component provides a complete and paginated token holders table with all the wallet addresses and balances/token IDs for a given ERC20 token or NFT collection tokenAddress
and chainId
.
tokenAddress
chainId
blockHeight
- (optional, defaults to: latest
)pageSize
- (optional, defaults to: 99999
)import { TokenHolders } from '@covalenthq/web3-components';
function App() {
return(
<div className="TokenHolders">
<TokenHolders
tokenAddress="0xD417144312DbF50465b1C641d016962017Ef6240"
chainId="1"
/>
</div>
)
}
export default App;
FAQs
**Live Demo:** https://covalenthq.github.io/Web3-Components-Demo
We found that @covalenthq/web3-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.