Closed manuelbarbas closed 5 months ago
Set of Javascript libraries enabling interaction with a local or remote Ethereum node through HTTP, IPC, or WebSocket protocols.
Some of the features are:
For more information check the Web3.js documentation.
Package install
npm install web3
Function Call Contract
import Web3 from "web3"; import {contract_abi,contract_adress} from "./contract"; var web3 = new Web3("https://staging-v3.skalenodes.com/v1/staging-fast-active-bellatrix"); const pk = "wallet pk"; const accountAddress = "wallet address"; const contract = new web3.eth.Contract(contract_abi, contract_adress); const functionData = contract.methods._mintTest(accountAddress).encodeABI(); async function callMintFunction() { web3.eth.accounts.signTransaction( { from: accountAddress, to: contract_adress, gas: 500000, gasPrice: 100000, data: functionData, }, pk) .then((signedTransaction) => { return web3.eth.sendSignedTransaction(signedTransaction.rawTransaction || ""); }) .then((receipt) => { console.log("Transaction receipt:", receipt); }) .catch((error) => { console.error("Error sending transaction:", error); }); } callMintFunction();
What is: Library Language: Javascript, Typescript Target: Web
Web3.js
Set of Javascript libraries enabling interaction with a local or remote Ethereum node through HTTP, IPC, or WebSocket protocols.
Some of the features are:
For more information check the Web3.js documentation.
Implementation Example
Package install
Function Call Contract