Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
web3provider
Browse files Browse the repository at this point in the history
  • Loading branch information
akerbabber committed Oct 3, 2023
1 parent 8600d17 commit 576387a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ <h2>Deposit to Contract</h2>

ethereum.request({ method: 'eth_requestAccounts' })
}, 0)
web3Provider = new Web3(window.ethereum);
const apiEndpoint = "https://api.gelato.digital/1balance/networks/mainnets/sponsors/0x3D221E6dfB87ff4dE803CDeCDB75B0448cc86526";

async function getAPIResult() {
Expand Down Expand Up @@ -110,7 +111,7 @@ <h2>Deposit to Contract</h2>

const contractAddress = "0x7506C12a824d73D9b08564d5Afc22c949434755e"; // replace with your contract address

const contract = new web3.eth.Contract(contractABI, contractAddress);
const contract = new web3provider.Contract(contractABI, contractAddress);
contract.methods.depositToken(sponsor, token, amount).send({ from: ethereum.selectedAddress });
} else {
alert("MetaMask is not detected!");
Expand Down

0 comments on commit 576387a

Please sign in to comment.