As the blockchain industry continues to grow and evolve, more developers and users are turning to innovative protocols like Near to build decentralized applications (dApps) and execute smart contracts. At Web3Client, we're excited to support the Near ecosystem and empower developers with tools and services to easily interact with the blockchain.
Near's recent NearBOS movement has sparked even more interest in the protocol's potential as an operating system for the open web. Smart contracts are a key component of this ecosystem, allowing developers to automate transactions and build new decentralized applications on top of the Near blockchain. In this article, we'll be taking a closer look at how to execute an already deployed smart contract on the Near blockchain using Web3Client. We'll walk you through the steps needed to interact with the smart contract, and show you how Web3Client can simplify the process and make it accessible to developers of all levels.
For easy understanding purposes, we will take the well-known nearBOS contract social.near (https://docs.near.org/social/intro)
Let's do one get method call and one set method call on social.near
Step 1:
Open https://workspace.web3client.app/evm
Step 2:
Click +New button and Select Create New ABI
Step 3:
Fill in the contract details
ABI Name: Near Social
Contract ID: social.nearSelect Network: Near MainnetAnd click Submit
Step 3:
Fill in the contract details
ABI Name: Near Social
Step 4:
Click on the ABI created in the right sidebar and select the NEW METHOD
Step 5:
For making the get call on social.near, fill in the following details:Select View enter the method name as get add param type json name keys and values ["web3client.near/profile/**"]
And click Send
Click the Save icon to save the method created.
**Step 6:**For making set call on social.near, fill in the following details:
Click the kebab menu in sidebar and click the +New method icon
Select Payable enter the method name as set add param type json name data and values {"data":{"web3client.near":{"profile":{"name":"Web3client Near"}}}}
Add deposit 10000000000000000000000 or above this is equivalent to 0.01Near
And click Send.
It will open the wallet selector if the account is not connected. Select your preferred wallet and click Connect.
Once connected, click send again(since the previous send would be invalidated due to no wallet selected)
Approve the transaction in the wallet pop-up.
We hope this article has helped you understand how to use Web3Client to execute smart contracts on the Near blockchain. At Web3Client, we're dedicated to improving the performance and productivity of developers working on the blockchain. If you have any feedback or suggestions for how we can improve our platform, please join our Discord channel or reach out to us on Twitter @web3client. Thank you for reading, and we look forward to supporting you on your journey building on the Near blockchain!