Skip to main content
This tutorial shows you how to integrate Dynamic as an Externally Owned Account (EOA) signer for Circle Smart Accounts using the modular wallets SDK. You’ll learn how to connect Dynamic’s authentication system with Circle’s Smart Accounts. You’ll also send USDC as a user operation using the viem account abstraction utilities, enabled by the modular wallets SDK.

Prerequisites

Before you begin, make sure you have:
  • A Circle Developer Console account.
  • A Dynamic Dashboard account.
  • Node.js installed for local testing. Circle recommends Node 16 or higher.
  • Testnet funds in your wallet:
    • Testnet USDC: Use the Circle Faucet to mint USDC on supported testnets (for example, USDC on Polygon Amoy).
    • Native testnet tokens: Use a Public Faucet to get native testnet tokens (for example, MATIC for Polygon Amoy). You’ll need these to pay for transaction fees when gas sponsorship isn’t available.

Configure your Circle and Dynamic credentials

  1. In the Circle Developer Console, complete the setup below by following the steps in the Modular Wallets Console Setup section:
    • Create a Client Key for the modular wallets SDK.
    • Retrieve the Client URL.
  2. In the Dynamic Dashboard, do the following:
    • Obtain your Environment ID and store it in the project’s .env file along with other credentials, to be accessed later using import.meta.env.
    • Set the default network to one of Circle’s supported networks. In this example, we use Polygon Amoy.
    • Alternatively, configure a custom list of supported networks using Dynamic’s network overrides.
    Here’s how to override the default EVM networks in Dynamic:
    Web

Tutorial Steps

Follow the steps below to integrate Dynamic as an EOA signer for Circle Smart Accounts. You’ll start by installing the necessary dependencies, then configure your application to wrap Dynamic’s context, create a Circle Smart Account, and send a user operation.

Step 1: Install dependencies

Install the required Dynamic SDK packages, depending on your package manager:

Step 2: Wrap your app in the Dynamic context provider

Wrap your app with DynamicContextProvider from the Dynamic SDK to enable wallet authentication and connection.
Web

Step 3: Create a Circle Smart Account using Dynamic provider

Use the Dynamic context and Circle’s modular wallets SDK to create a Smart Account. Here’s the full working example:
Web
To access the current wallet, use the useDynamicContext() hook provided by DynamicContextProvider and get the primaryWallet. You can then convert it to a local account and use it to generate a Circle Smart Account.
Web
In the above code, if the primaryWallet is not null or undefined, you can transform it into a wallet client, convert it to a local account, and then pass it to toCircleSmartAccount() to create a Circle Smart Account. This account can then be used to send user operations.

Step 4: Run the app

Start your app, click Login or Sign Up using Dynamic, and you’ll be connected to the blockchain through Circle’s modular wallets SDK. Once logged in, you’ll see the UI for sending a user operation:

Summary

In this tutorial, you integrated Dynamic as an EOA signer for Circle Smart Accounts using the modular wallets SDK. You:
  • Set up credentials in both Circle and Dynamic.
  • Installed required dependencies.
  • Wrapped your app with DynamicContextProvider.
  • Created a smart account using toCircleSmartAccount().
  • Sent a user operation using viem bundler client.
This integration enables a seamless, passwordless Web3 onboarding experience and allows you to build advanced features like gas sponsorship and session keys using Circle’s modular wallets framework.