How to connect Dapp UI to Venom
Project Setup
Make sure you have:
1. The Venom wallet extension 2. Node.js and NPM Downloaded and Installed
Install Dependencies
Open a terminal inside the base directory of your project. Inside the folder, follow the command
npm i everscale-inpage-provider --saveConnecting 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';
const ever = new ProviderRpcClient();
async function myApp() {
if (!(await ever.hasProvider())) {
/**
* Handle this case by showing the user a link to the Venom extension
*/
throw new Error('Extension is not installed');
}
//...
}and check if it is connected
Next, we need to request permission to get account info and interaction with it
We've connected to Venom wallet, and now we can interact with blockchain: transfer funds, call contract methods, and read their state.
How to call smart contracts from code
First, you need to initialize an instance of a contract by its ABI, and address
Contract is an abstraction that makes it easy to interact with smart contracts on the Venom network.
Last updated