AccountFactory

OP Sepolia Testnet
opscout

Integrate your account factory

import { defineChain } from "thirdweb"; import { inAppWallet, smartWallet } from "thirdweb/wallets"; const chain = defineChain(11155420); // First, connect the personal wallet, which can be any wallet (metamask, in-app, etc.) const personalWallet = inAppWallet(); const personalAccount = await personalWallet.connect({ client, chain, strategy: "google", }); // Then, connect the Smart Account const wallet = smartWallet({ chain, // the chain where your account will be or is deployed factoryAddress: "0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00", // your own deployed account factory address gasless: true, // enable or disable gasless transactions }); const smartAccount = await wallet.connect({ client, personalWallet, });

Direct contract interaction (advanced)

No SDK install required for API/cURL. Call the HTTP endpoints directly. Keep your secret key server-side; use client IDs in frontends.

Initialize the SDK and contract on your project:

import { createThirdwebClient, getContract } from "thirdweb"; import { defineChain } from "thirdweb/chains"; // create the client with your clientId, or secretKey if in a server environment const client = createThirdwebClient({ clientId: "YOUR_CLIENT_ID" }); // connect to your contract const contract = getContract({ client, chain: defineChain(11155420), address: "0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00" });

You will need to pass a client ID/secret key to use thirdweb's infrastructure services. If you don't have any API keys yet you can create one by creating a project for free from the dashboard.

All Functions & Events

const response = await fetch('https://api.thirdweb.com/v1/contracts/write', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-secret-key': '<YOUR_SECRET_KEY>' }, body: JSON.stringify({ calls: [ { contractAddress: "0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00", method: "function createAccount(address _admin, bytes _data) returns (address)", params: [_admin, _data] } ], chainId: 11155420, from: "<YOUR_WALLET_ADDRESS>" }) }); const data = await response.json();