Open a terminal inside the base directory of your project. Inside the folder, follow the command
npm i everscale-inpage-provider --save
Connecting to the Venom Wallet
The first thing we need to do is make sure that the wallet is installed in a browser
import { ProviderRpcClient } from'everscale-inpage-provider';constever=newProviderRpcClient();asyncfunctionmyApp() {if (!(awaitever.hasProvider())) {/** * Handle this case by showing the user a link to the Venom extension */thrownewError('Extension is not installed'); }//...}
and check if it is connected
//...constever=newProviderRpcClient({/** * Fallback function which will be called if injected provider was not found. */fallback: () => {}});asyncfunctionmyApp() {//.../** * Waits until provider API will be available. * Calls `fallback` if no provider was found * @throws ProviderNotFoundException when no provider is found */awaitever.ensureInitialized();//...}
Next, we need to request permission to get account info and interaction with it