Created
September 18, 2022 22:06
-
-
Save AmanRaj1608/367ba7d242bb801cd734837f06e7be5a to your computer and use it in GitHub Desktop.
biconomy sdk backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Web3 from "web3"; | |
import HDWalletProvider from "@truffle/hdwallet-provider"; | |
import { Biconomy } from "@biconomy/mexa"; | |
const infura = "https://goerli.infura.io/v3/f0493a02561f4419be93dde46cc584c6"; | |
const pkey = ""; | |
const main = async () => { | |
console.log("start"); | |
let provider = new HDWalletProvider(pkey, infura); | |
var web3 = new Web3(provider); | |
let account = (await web3.eth.getAccounts())[0]; | |
console.log("account", account); | |
const biconomy = new Biconomy(provider, { | |
apiKey: "PxLkcX2mx.b90c27cc-3659-4c3d-9246-20a206e5bc13", | |
debug: true, | |
contractAddresses: ["0x6025735facb2e77eabb5f3bc9d80b7587e2df9f9"], | |
}); | |
await biconomy.init(); | |
// console.log("biconomy object", biconomy.interfaceMap); | |
}; | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Creating new private key on the fly then using it with HDwallet to pass provider to biconomy