Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 1.88 KB

INITIALISE_A_SMART_CONTRACT.md

File metadata and controls

23 lines (19 loc) · 1.88 KB
Key Description
signer This signer will be used for signing userOps for any transactions you build. Will accept ethers.JsonRpcSigner as well as a viemWallet
paymasterUrl You can pass in a paymasterUrl necessary for sponsoring transactions (retrieved from the biconomy dashboard)
bundlerUrl You can pass in a bundlerUrl (retrieved from the biconomy dashboard) for sending transactions
import { createSmartAccountClient } from "@biconomy/account";
import { createWalletClient, http, createPublicClient } from "viem";
import { privateKeyToAccount, generatePrivateKey } from "viem/accounts";
import { mainnet as chain } from "viem/chains";

const account = privateKeyToAccount(generatePrivateKey());
const signer = createWalletClient({ account, chain, transport: http() });

const smartAccount = await createSmartAccountClient({
  signer,
  bundlerUrl,
  paymasterUrl,
}); // Retrieve bundler and pymaster urls from dashboard