Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@vechain/dapp-kit-react
Advanced tools
The Vechain DApp Kit serves as a sophisticated layer built upon @vechain/connex, providing a simplified and efficient avenue for engaging with a multitude of Vechain wallets. This innovative toolkit enhances the ease of interaction, offering developers a
@vechain/dapp-kit-react
The Vechain DApp Kit serves as a sophisticated layer built upon @vechain/connex, providing a simplified and efficient avenue for engaging with a multitude of Vechain wallets. This innovative toolkit enhances the ease of interaction, offering developers a seamless bridge to connect with diverse Vechain wallet functionalities. For more information, please refer to the official Vechain Docs
yarn add @vechain/dapp-kit-react
import type { WalletConnectOptions } from '@vechain/dapp-kit';
const walletConnectOptions: WalletConnectOptions = {
// Create your project here: https://cloud.walletconnect.com/sign-up
projectId: '<PROJECT_ID>',
metadata: {
name: 'My dApp',
description: 'My dApp description',
// Your app URL
url: window.location.origin,
// Your app Icon
icons: [`${window.location.origin}/images/my-dapp-icon.png`],
},
};
DAppKitProvider
import { DAppKitProvider } from '@vechain/dapp-kit-react';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<DAppKitProvider
// REQUIRED: The URL of the node you want to connect to
nodeUrl={'https://testnet.vechain.org/'}
// OPTIONAL: Required if you're not connecting to the main net
genesis={'test'}
// OPTIONAL: Whether or not to persist state in local storage (account, wallet source)
usePersistence={true}
// OPTIONAL: Options to enable wallet connect
walletConnectOptions={walletConnectOptions}
// OPTIONAL: A log level for console logs
logLevel="DEBUG"
>
<App />
</DAppKitProvider>
</React.StrictMode>,
);
DAppKitProvider
import { useWallet, useConnex } from '@vechain/dapp-kit-react';
import type { WalletSource } from '@vechain/dapp-kit';
// type WalletSource = 'wallet-connect' | 'veworld' | 'sync2' | 'sync';
const mySource: WalletSource = 'veworld';
const { connect, setSource } = useWallet();
setSource(mySource);
const { account } = await connect();
//Start using Connex thor/ vendor
const { vendor, thor } = useConnex();
ConnectWalletButton
component to display a modal with the available walletsimport { WalletButton } from '@vechain/dapp-kit-react';
import { useWallet } from '@vechain/dapp-kit-react';
const MyComponent = (): JSX.Element => {
const { account } = useWallet();
useEffect(() => {
if (account) {
// account connected!!
}
}, [account]);
return (
<>
<WalletButton />
</>
);
};
ConnectWalletModal
component to display a modal with the available walletsimport { useWallet, useWalletModal } from '@vechain/dapp-kit-react';
export const MyComponent = (): JSX.Element => {
const { account } = useWallet();
const { open, close } = useWalletModal();
useEffect(() => {
if (account) {
// account connected!!
}
}, [account]);
return (
<>
<button onClick={open}>Connect Wallet</button>
</>
);
};
FAQs
The Vechain DApp Kit serves as a sophisticated layer built upon @vechain/connex, providing a simplified and efficient avenue for engaging with a multitude of Vechain wallets. This innovative toolkit enhances the ease of interaction, offering developers a
The npm package @vechain/dapp-kit-react receives a total of 419 weekly downloads. As such, @vechain/dapp-kit-react popularity was classified as not popular.
We found that @vechain/dapp-kit-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.