Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@web3-ui/core
Advanced tools
A set of React components and hooks made for web3-specific use cases. Fully compatible with and built on top of ChakraUI.
This package is an opinionated combination of @web3-ui/components
and @web3-ui/hooks
.
yarn add @web3-ui/core
At the root of your React app, wrap your app in the <Provider>
component:
// _app.tsx (or the root of your app)
import { Provider, NETWORKS } from '@web3-ui/core';
function MyApp({ Component, pageProps }) {
return (
<Provider network={NETWORKS.rinkeby}>
<Component {...pageProps} />
</Provider>
);
}
This is the list of components the package currently provides:
The Provider component is a parent provider, wrapping the ComponentsProvider
and the HooksProvider
. You need to wrap this component around your entire App.
See Getting Started for an example.
ConnectWallet
is a Button
based component with the following behaviour:
When wallet is connected,
When wallet is not connected,
import { ConnectWallet } from '@web3-ui/core';
<ConnectWallet />;
TokenGate
lets you conditionally render some content depending on whether the current connected user has enough amount of a specific token. The component only supports ERC20 tokens at the moment but support for other standards is coming soon.
import { TokenGate } from '@web3-ui/core';
<TokenGate
tokenContractAddress="0x08149745590e9025b52b6801e9dd3E752e60F3A2"
requiredQuantity={+ethers.utils.parseEther('1')} // the component expects the amount in wei.
deniedContent={
<p>This message will show up if the user doesn't have enough tokens.</p>
}
>
<h1>This message will be visible if the user has enough tokens.</h1>
</TokenGate>;
This package exports all the hooks provided by the @web3-ui/hooks
package.
// Example
import { useWallet } from '@web3-ui/core';
const { connectWallet } = useWallet();
FAQs
React UI components for web3
We found that @web3-ui/core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.