thirdweb

AccountFactory

Ethereum
etherscanblockscout

Integrate your account factory

import { defineChain } from "thirdweb"; import { inAppWallet, smartWallet } from "thirdweb/wallets"; const chain = defineChain(1); // First, connect the personal wallet, which can be any wallet (metamask, in-app, etc.) const personalWallet = inAppWallet(); const peronalAccount = 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)

Choose a language:

Install the latest version of the SDK:

npm i thirdweb

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(1), 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

import { prepareContractCall, sendTransaction } from "thirdweb"; const transaction = await prepareContractCall({ contract, method: "function createAccount(address _admin, bytes _data) returns (address)", params: [_admin, _data] }); const { transactionHash } = await sendTransaction({ transaction, account });