Signing APIs let you build a transaction in your application and have Circle
sign it. You then broadcast the signed transaction using your own node provider.
Use this flow when Circle doesn’t provide full
blockchain infrastructure for your
blockchain, or when you prefer to manage broadcasting yourself. For an overview,
see How signing APIs work.
Prerequisites
Before you begin, make sure you have:
Only EOA wallets are supported for this signing flow.
Step 1. Set up your project
1.1. Create the project and install dependencies
This step is optional. It helps prevent missing types in your IDE or editor.
Create a tsconfig.json file:Then, update the tsconfig.json file:1.3. Set environment variables
Create a .env file in the project directory:
CIRCLE_API_KEY is your Circle Developer API key.
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.
The npm run start command loads variables from .env using Node.js native
env-file support.Step 2. Create a signing wallet
Use count to create up to 200 wallets per request.
If you already created a native wallet on Ethereum, Polygon, Avalanche,
Arbitrum, or another EVM-compatible chain, a generic EVM wallet under the same
wallet set maps to the same address. Do not use the generic EVM wallet in
place of the native wallet on those chains, or transactions may become stuck.Step 3. Build and sign a transaction
The transaction object must match the Ethereum JSON-RPC transaction shape. Use
your own tooling to prepare it before calling signTransaction(). Include the
correct chainId for your network. For supported EVM-TESTNET chains, see
Chain IDs for Signing Transactions. When building
EIP-1559 transactions, include both maxFeePerGas and maxPriorityFeePerGas.Step 4. Review the response
The signing response includes:
signature
signedTransaction
txHash
You can use signedTransaction with your own broadcast flow or chain tooling.Step 1. Set up your project
1.1. Create the project and install dependencies
This step is optional. It helps prevent missing types in your IDE or editor.
Create a tsconfig.json file:Then, update the tsconfig.json file:1.3. Set environment variables
Create a .env file in the project directory:
CIRCLE_API_KEY is your Circle Developer API key.
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.
The npm run command in this tutorial loads variables from .env using Node.js
native env-file support.Step 2. Create a signing wallet
Use count to create up to 200 wallets per request.
Fund the SOL-DEVNET wallet with devnet SOL before broadcasting signed
transactions, or the account will not have the balance needed to pay fees
onchain.Step 3. Build and sign a transaction
Base64 encode the raw transaction before you send it to signTransaction(). The
signing request can succeed before the account is funded, but the broadcast step
can still fail if the wallet has not received devnet SOL.Step 4. Review the response
The signing response includes:
signature
signedTransaction
If you broadcast the signed payload in the same script, you should also see the
broadcast transaction ID.Step 1. Set up your project
1.1. Create the project and install dependencies
This step is optional. It helps prevent missing types in your IDE or editor.
Create a tsconfig.json file:Then, update the tsconfig.json file:1.3. Set environment variables
Create a .env file in the project directory:
CIRCLE_API_KEY is your Circle Developer API key.
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.
The npm run command in this tutorial loads variables from .env using Node.js
native env-file support.Step 2. Create a signing wallet
Use count to create up to 200 wallets per request.
Fund the senderAccount NEAR testnet account before broadcasting signed
transactions, or the account will not have enough NEAR to pay network fees.Use these values from the wallet creation response in the next step:
walletId = the wallet id
walletPublicKey = the wallet initialPublicKey
address = the wallet’s implicit account ID onchain
For the signing script, senderAccount is the NEAR testnet account where you
added the wallet initialPublicKey as a full-access key. It is not the Circle
wallet address unless you specifically set up and fund that implicit account
for signing.Before you continue, either create or use an existing NEAR testnet account and
add the wallet initialPublicKey as an access key on that account. Then use
that account ID as senderAccount in the signing step. For setup guidance, see
Create an Account and
NEAR CLI.Step 3. Build and sign a transaction
Base64 encode the raw transaction before you send it to signTransaction().For example, if the create-wallet response includes:and you add initialPublicKey to my-circle-signer.testnet, then set:Step 4. Review the response
The signing response includes:
signature
signedTransaction
txHash
Broadcast that signed payload through your own RPC or node provider.