Setting up an EVM signer

You'll need access to a signer object to send a transaction to a Squid contract.

More about signers: official ethers documentation.

Setting up a signer in node https://docs.ethers.io/v5/api/signer/#Wallet

Importing Metamask https://docs.ethers.io/v5/getting-started/#getting-started--connecting

// example setting up a signer using Ethers (please check their documentation)
import { ethers } from "ethers";

// note: DO NOT push your private key to a git repository or anywhere public
const privateKey = "<YOUR_PRIVATE_KEY>"; 
const ethRpcEndPoint = "https://goerli.infura.io/v3/<YOUR_INFURA_PROJECT_ID>";

(async () => {
    const provider = new ethers.providers.JsonRpcProvider(ethRpcEndPoint);
    const signer = new ethers.Wallet(privateKey, provider);
    
    // rest of your code
})();

Last updated