- When creating the CPN quote, you must set the
transactionVersionparameter toVERSION_2. - Gas fees are not charged in native tokens, but in USDC. They are determined at
quote creation instead of transaction creation in the quote
feesfield. The gas fee is collected by Circle’s payment settlement smart contract during onchain transaction processing. - There are separate API endpoints for creating and submitting transactions.
- EVM chains
- Solana
- Before initiating a transaction, the sender wallet must grant the
Permit2contract a USDC allowance. - When signing the transaction, you no longer need to compose and sign the raw
EVM transaction; you only need to sign the EIP-712 typed data provided to you
in the
messageToBeSignedfield and submit the signature. - CPN handles the auto-acceleration of the transaction. You no longer need to monitor transaction broadcast status or submit acceleration transactions.
Prerequisites
Before you begin, ensure that you have:- Obtained an API key for CPN from Circle
- USDC in your sender wallet
- cURL installed on your development machine
- (EVM chains only) Granted a USDC allowance to the
Permit2contract. See How-to: Grant USDC Allowance to Permit2 for more information.
Note: This guide provides API requests in cURL format, along with example responses.
Steps
Use the following steps to create an onchain transaction using Transactions V2.Step 1. Create a quote
Use the create a quote endpoint to create a quote with thetransactionVersion parameter set to VERSION_2.
Note: The quote returned from this step must follow the Transactions V2 workflow, you can’t switch from V2 back to V1 without first recreating the quote.
Step 2. Create a V2 transaction
You would then follow the same payment API workflow as before, create a payment from the create a payment endpoint. After your payment is in theCRYPTO_FUNDS_PENDING state, initiate
the transaction using the
create a transaction V2
endpoint.
Step 3. Sign and submit the transaction
From the response in the previous step, extract themessageToBeSigned field.
You must sign this data using EIP-712
typed data signing from your sender wallet. Once signed, you should submit it to
the
submit transaction V2
endpoint. The following is an example request:
Note: For Solana, follow the steps in How-to: Create an Onchain
Transaction to sign the transaction. You
would submit the signed transaction in the same way as for EVM.