> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compasslabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Complete USDC bridging

> Prepare a receiveMessage transaction to mint USDC to any Product Account on the
destination chain.

**How it works:**

This endpoint uses the `bridge_id` from `/burn` to:
1. Look up the bridge session
2. Check if Circle's attestation is ready
3. Depending on the status of the attestation return the following:
    - if attestation is still pending, return URLs for real-time updates
    - if attestation is ready, return a transaction to complete the bridging process
    - if the minting for a given `bridge_id` has been completed, informs with `completed` status

**Request parameters:**

- `bridge_id`: The bridge ID returned from `/burn`
- `burn_tx_hash`: The transaction hash of the burn transaction on the source chain

**Response codes:**

- **200 OK**: Attestation is ready, mint transaction is included
- **202 Accepted**: Attestation is pending, SSE URL for real-time updates is included (The real-time update endpoints are in progress)
- **404 Not found**: Bridge not found

**After receiving 202:**

Either:
- Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event (The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team)
- Poll this endpoint periodically until you get 200



## OpenAPI

````yaml /v2/combined_spec.json post /v2/cctp/mint
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v2/cctp/mint:
    post:
      tags:
        - Bridge
      summary: Complete USDC bridging
      description: >-
        Prepare a receiveMessage transaction to mint USDC to any Product Account
        on the

        destination chain.


        **How it works:**


        This endpoint uses the `bridge_id` from `/burn` to:

        1. Look up the bridge session

        2. Check if Circle's attestation is ready

        3. Depending on the status of the attestation return the following:
            - if attestation is still pending, return URLs for real-time updates
            - if attestation is ready, return a transaction to complete the bridging process
            - if the minting for a given `bridge_id` has been completed, informs with `completed` status

        **Request parameters:**


        - `bridge_id`: The bridge ID returned from `/burn`

        - `burn_tx_hash`: The transaction hash of the burn transaction on the
        source chain


        **Response codes:**


        - **200 OK**: Attestation is ready, mint transaction is included

        - **202 Accepted**: Attestation is pending, SSE URL for real-time
        updates is included (The real-time update endpoints are in progress)

        - **404 Not found**: Bridge not found


        **After receiving 202:**


        Either:

        - Connect to the SSE stream at `sse_url` and wait for
        `attestation_ready` event (The SSE stream and status endpoint are in
        progress. Keep an eye on the updates from our team)

        - Poll this endpoint periodically until you get 200
      operationId: v2_cctp_mint
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MintPrepareRequest'
        required: true
      responses:
        '200':
          description: Attestation ready with mint transaction, or bridge already completed
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/MintPrepareReadyResponse'
                  - $ref: '#/components/schemas/MintPrepareCompletedResponse'
                title: Response 200 V2 Cctp Mint
                discriminator:
                  propertyName: status
                  mapping:
                    ready:
                      $ref: '#/components/schemas/MintPrepareReadyResponse'
                    completed:
                      $ref: '#/components/schemas/MintPrepareCompletedResponse'
        '202':
          description: Attestation pending, SSE URL for updates included
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MintPreparePendingResponse'
        '404':
          description: Can't find bridge info by `bridge_id`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MintPrepareNotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.bridge.cctp_mint(bridge_id="br_cae305798062", burn_tx_hash="0x42c914b870eacc2c1734420f6ab183f95a5b0e0fdbb1c82247183848b76fc8ad", sender="0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B")

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.bridge.cctpMint({
                bridgeId: "br_cae305798062",
                burnTxHash: "0x42c914b870eacc2c1734420f6ab183f95a5b0e0fdbb1c82247183848b76fc8ad",
                sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    MintPrepareRequest:
      properties:
        bridge_id:
          type: string
          pattern: ^br_[a-f0-9]{12}$
          title: Bridge Id
          description: >-
            The bridge identifier returned from /burn endpoint. This is used to
            look up the bridge session.
          examples:
            - br_cae305798062
          default: br_cae305798062
        burn_tx_hash:
          type: string
          pattern: ^0x[a-fA-F0-9]{64}$
          title: Burn Tx Hash
          description: >-
            The transaction hash of the burn transaction on the source chain.
            This is used to find the DepositForBurn event and extract the CCTP
            message.
          examples:
            - '0x42c914b870eacc2c1734420f6ab183f95a5b0e0fdbb1c82247183848b76fc8ad'
          default: '0x42c914b870eacc2c1734420f6ab183f95a5b0e0fdbb1c82247183848b76fc8ad'
        sender:
          type: string
          title: Sender
          description: >-
            The wallet address that will sign and send the mint transaction.
            This can be any wallet, the receiver of the minted USDC is not
            determined by this sender.
          examples:
            - '0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B'
          default: '0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B'
      type: object
      required:
        - bridge_id
        - burn_tx_hash
        - sender
      title: MintPrepareRequest
      default:
        bridge_id: br_cae305798062
        burn_tx_hash: '0x42c914b870eacc2c1734420f6ab183f95a5b0e0fdbb1c82247183848b76fc8ad'
        sender: '0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B'
    MintPrepareReadyResponse:
      properties:
        status:
          type: string
          const: ready
          title: Status
          description: >-
            Indicates the attestation is ready and mint transaction is
            available.
          default: ready
        bridge_id:
          type: string
          title: Bridge Id
          description: The bridge identifier.
          examples:
            - br_a1b2c3d4e5f6
        transaction:
          $ref: '#/components/schemas/UnsignedTransaction'
          description: >-
            Unsigned transaction that calls receiveMessage on the
            MessageTransmitter contract. Sign and broadcast this to mint USDC on
            the destination chain.
      type: object
      required:
        - bridge_id
        - transaction
      title: MintPrepareReadyResponse
      description: >-
        Response when attestation is ready and mint transaction can be built.


        Returned with 200 OK status code. Contains an unsigned transaction that
        calls

        receiveMessage on the MessageTransmitter contract.
      example:
        bridge_id: br_a1b2c3d4e5f6
        status: ready
        transaction:
          chainId: '0x1'
          data: >-
            0x57ecfd28000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0
          from: '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
          gas: '0x7a120'
          maxFeePerGas: '0x59682f00'
          maxPriorityFeePerGas: '0x3b9aca00'
          nonce: '0x5'
          to: '0x0a992d191DEeC32aFe36203Ad87D7d289a738F81'
          value: '0x0'
    MintPrepareCompletedResponse:
      properties:
        status:
          type: string
          const: completed
          title: Status
          description: Indicates the bridge has already been completed and USDC minted.
          default: completed
        bridge_id:
          type: string
          title: Bridge Id
          description: The bridge identifier.
          examples:
            - br_a1b2c3d4e5f6
        message:
          type: string
          title: Message
          description: Human-readable message explaining the status.
          default: >-
            Bridge has already been completed. USDC has been minted on the
            destination chain.
      type: object
      required:
        - bridge_id
      title: MintPrepareCompletedResponse
      description: >-
        Response when the bridge has already been completed (minted).


        This means someone has already called receiveMessage on the destination
        chain to

        mint the USDC. No further action is required.
      example:
        bridge_id: br_a1b2c3d4e5f6
        message: >-
          Bridge has already been completed. USDC has been minted on the
          destination chain.
        status: completed
    MintPreparePendingResponse:
      properties:
        status:
          type: string
          const: pending
          title: Status
          description: Indicates the attestation is still being awaited.
          default: pending
        bridge_id:
          type: string
          title: Bridge Id
          description: The bridge identifier.
          examples:
            - br_a1b2c3d4e5f6
        message_hash:
          type: string
          title: Message Hash
          description: The CCTP message hash being polled for attestation.
          examples:
            - 0x1234567890abcdef...
        sse_url:
          type: string
          title: Sse Url
          description: SSE endpoint URL for real-time attestation updates.
          examples:
            - /v2/cctp/bridge/br_a1b2c3d4e5f6/events
        status_url:
          type: string
          title: Status Url
          description: HTTP endpoint URL for polling bridge status.
          examples:
            - /v2/cctp/bridge/br_a1b2c3d4e5f6/status
        estimated_wait_seconds:
          type: integer
          title: Estimated Wait Seconds
          description: >-
            Estimated wait time in seconds. Fast mode is typically ~30 seconds,
            standard mode is 15-19 minutes.
          examples:
            - 30
            - 900
      type: object
      required:
        - bridge_id
        - message_hash
        - sse_url
        - status_url
        - estimated_wait_seconds
      title: MintPreparePendingResponse
      description: |-
        Response when attestation is not yet ready.

        Returned with 202 Accepted status code. The client should either:
        - Connect to the SSE stream for real-time updates
        - Poll the status endpoint periodically
        - Call /mint/prepare again after some time
      example:
        bridge_id: br_a1b2c3d4e5f6
        estimated_wait_seconds: 900
        message_hash: '0x8f2a4c6b9d1e3f5a7c0b2d4e6f8a1c3d5e7f9b0d2e4f6a8c1d3e5f7a9b0c2d4'
        sse_url: /v2/cctp/bridge/br_a1b2c3d4e5f6/events
        status: pending
        status_url: /v2/cctp/bridge/br_a1b2c3d4e5f6/status
    MintPrepareNotFoundResponse:
      properties:
        status:
          type: string
          const: burn_not_found
          title: Status
          description: Indicates the burn event was not found on the source chain.
          default: burn_not_found
        bridge_id:
          type: string
          title: Bridge Id
          description: The bridge identifier.
          examples:
            - br_a1b2c3d4e5f6
        message:
          type: string
          title: Message
          description: Human-readable message explaining the status.
          examples:
            - >-
              Burn event not found. Please ensure the burn transaction has been
              broadcast and confirmed on the source chain.
      type: object
      required:
        - bridge_id
        - message
      title: MintPrepareNotFoundResponse
      description: >-
        Response when the burn event has not been found yet.


        This means the burn transaction hasn't been confirmed on-chain yet, or
        the user

        hasn't broadcast the burn transaction.
      example:
        bridge_id: br_a1b2c3d4e5f6
        message: >-
          Burn event not found. Please ensure the burn transaction has been
          broadcast and confirmed on the source chain.
        status: burn_not_found
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UnsignedTransaction:
      properties:
        chainId:
          type: string
          title: Chainid
          description: The chain id of the transaction
        data:
          type: string
          title: Data
          description: The data of the transaction
        from:
          type: string
          title: From
          description: The sender of the transaction
        gas:
          anyOf:
            - type: string
            - type: 'null'
          title: Gas
          description: The gas of the transaction
        to:
          type: string
          title: To
          description: The recipient of the transaction
        value:
          type: string
          title: Value
          description: The value of the transaction
        nonce:
          type: string
          title: Nonce
          description: The nonce of the address
        maxFeePerGas:
          type: string
          title: Maxfeepergas
          description: The max fee per gas of the transaction
        maxPriorityFeePerGas:
          type: string
          title: Maxpriorityfeepergas
          description: The max priority fee per gas of the transaction
      type: object
      required:
        - chainId
        - data
        - from
        - gas
        - to
        - value
        - nonce
        - maxFeePerGas
        - maxPriorityFeePerGas
      title: UnsignedTransaction
      example:
        chainId: '0x2105'
        data: >-
          0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000675f4a3d
        from: '0x4A83b4413CF41C3244027e1590E35a0F48403F0c'
        gas: '0x7a120'
        maxFeePerGas: '0x59682f00'
        maxPriorityFeePerGas: '0x3b9aca00'
        nonce: '0x5'
        to: '0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67'
        value: '0x0'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````