Get started with developer-controlled wallets by creating a wallet set and a wallet within it.
A wallet set is a container that groups your developer-controlled wallets under
a single entity secret. All
wallets in a set share the same entity secret, and EVM wallets in the same set
share the same address. After
completing this tutorial, you’ll have a wallet set and a developer-controlled
wallet. The examples use an
externally owned account (EOA)
on Arc Testnet, but you can create a
smart contract account (SCA)
or use any supported blockchain.
Create a new directory and install the SDK for the path you want to use.
# Create the project directory and initialize Node.jsmkdir dev-controlled-projectscd dev-controlled-projectsnpm init -y# Set up module type and a start commandnpm pkg set type=modulenpm pkg set scripts.create-wallet="tsx --env-file=.env create-wallet.ts"# Install runtime dependenciesnpm install @circle-fin/developer-controlled-wallets# Install dev dependenciesnpm install --save-dev tsx typescript @types/node
CIRCLE_ENTITY_SECRET is your registered entity secret.
Open .env in your editor rather than writing values with shell commands, and
add .env to your .gitignore. This prevents credentials from leaking into
your shell history or version control.
Create a create-wallet.ts (or create_wallet.py) file and add the following
code. This code creates a wallet set first, and then creates a wallet within it:
import { initiateDeveloperControlledWalletsClient } from "@circle-fin/developer-controlled-wallets";const client = initiateDeveloperControlledWalletsClient({ apiKey: process.env.CIRCLE_API_KEY!, entitySecret: process.env.CIRCLE_ENTITY_SECRET!,});async function main() { const walletSetResponse = await client.createWalletSet({ name: "My First Dev-Controlled Wallet Set", }); const walletSet = walletSetResponse.data?.walletSet; if (!walletSet?.id) { throw new Error("Wallet set creation failed: no ID returned"); } const walletResponse = await client.createWallets({ walletSetId: walletSet.id, blockchains: ["ARC-TESTNET"], // Can be any supported blockchain count: 1, accountType: "EOA", // Can be EOA or SCA }); console.log("Wallet set response:", walletSetResponse.data); console.log("Wallet response:", walletResponse.data);}main().catch((err) => { console.error("Error:", err.message || err); process.exit(1);});
If you are calling the API directly instead of using the SDK, you need two
requests: one to create the wallet
set
and one to create the
wallet.
Replace the entity secret ciphertext and idempotency key in your request. The
SDKs handle this automatically.
Build payment workflows with Arc App Kit:
Use the
Circle Wallets adapter
to add token transfers, swaps, bridging, and chain-agnostic unified balances
to your app without building each integration yourself.