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

Importing Metamask

// 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 = "<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