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

# Get active Canton contracts

> Reads the active contracts of a vault account's Canton wallet. The body mirrors Canton's `POST /v2/state/active-contracts` `eventFormat`, see https://cantonfoundation.mintlify.app/reference/json-api-reference/post-v2stateactive-contracts

- `filtersByParty` must hold exactly one key, and it must be the vault account's own Canton party. Get it from the vault's Canton deposit address. `filtersForAnyParty`, `activeAtOffset` and paging are not supported.
- `cumulative` holds 1 to 20 filters.
- Template and interface ids are in package-name form, `#package-name:Module:Entity`.
- The read is at the current ledger end. No ledger offset, `hasMore` or page token is returned.
- At most 1000 contracts, about 3 MiB in total, are returned. There is no paging yet. When more than 1000 contracts match, or the matching contracts are larger than about 3 MiB in total, the answer is 400: narrow the filter.
- A filter that names a template or interface id the ledger does not know is a 400: check the ids.
- `createArgument` is free-form and depends on the template.



## OpenAPI

````yaml https://swagger.fireblocks.com/openapi.docs.yaml post /operations/canton/active_contracts
openapi: 3.0.0
info:
  title: Fireblocks API
  description: >
    Fireblocks provides a suite of applications to manage digital asset
    operations and a complete development platform to build your business on the
    blockchain.


    - Visit our website for more information: [Fireblocks
    Website](https://fireblocks.com)

    - Visit our developer docs: [Fireblocks
    DevPortal](https://developers.fireblocks.com)
  version: 1.6.2
  contact:
    email: developers@fireblocks.com
servers:
  - url: https://api.fireblocks.io/v1
    description: Fireblocks Production Environment Base URL
  - url: https://sandbox-api.fireblocks.io/v1
    description: Fireblocks Sandbox Environment Base URL
security: []
paths:
  /operations/canton/active_contracts:
    post:
      tags:
        - Canton (Beta)
      summary: Get active Canton contracts
      description: >-
        Reads the active contracts of a vault account's Canton wallet. The body
        mirrors Canton's `POST /v2/state/active-contracts` `eventFormat`, see
        https://cantonfoundation.mintlify.app/reference/json-api-reference/post-v2stateactive-contracts


        - `filtersByParty` must hold exactly one key, and it must be the vault
        account's own Canton party. Get it from the vault's Canton deposit
        address. `filtersForAnyParty`, `activeAtOffset` and paging are not
        supported.

        - `cumulative` holds 1 to 20 filters.

        - Template and interface ids are in package-name form,
        `#package-name:Module:Entity`.

        - The read is at the current ledger end. No ledger offset, `hasMore` or
        page token is returned.

        - At most 1000 contracts, about 3 MiB in total, are returned. There is
        no paging yet. When more than 1000 contracts match, or the matching
        contracts are larger than about 3 MiB in total, the answer is 400:
        narrow the filter.

        - A filter that names a template or interface id the ledger does not
        know is a 400: check the ids.

        - `createArgument` is free-form and depends on the template.
      operationId: getCantonActiveContracts
      parameters:
        - $ref: '#/components/parameters/X-Idempotency-Key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActiveContractsRequest'
      responses:
        '200':
          description: The active contracts at the current ledger end.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveContractsResponse'
        '400':
          description: >-
            The request was rejected. This happens when the body is invalid, the
            filter names a party other than the vault account's own, a filter
            names a template or interface id the ledger does not know, more than
            1000 contracts match, or the matching contracts are larger than
            about 3 MiB in total. There is no paging yet: narrow the filter, or
            check the template and interface ids.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '403':
          description: >-
            Canton is not enabled for this workspace and the response has no
            body. The upstream Canton call service also answers 403 when generic
            calls are not enabled for the workspace.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '404':
          description: No Canton wallet for this vault account and blockchainId.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '503':
          description: >-
            The active contracts could not be read right now, because the Canton
            node or the upstream Canton service is unavailable. Retry later.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        default:
          $ref: '#/components/responses/Error'
      x-codeSamples:
        - lang: TypeScript
          source: >-
            const response: Promise<FireblocksResponse<ActiveContractsResponse>>
            =
            fireblocks.cantonBeta.getCantonActiveContracts(cantonBetaApiGetCantonActiveContractsRequest);
        - lang: Java
          source: >-
            CompletableFuture<ApiResponse<ActiveContractsResponse>> response =
            fireblocks.cantonBeta().getCantonActiveContracts(activeContractsRequest,
            idempotencyKey);
        - lang: Python
          source: >-
            response =
            fireblocks.canton_beta.get_canton_active_contracts(active_contracts_request,
            idempotency_key);
components:
  parameters:
    X-Idempotency-Key:
      name: Idempotency-Key
      in: header
      description: >-
        A unique identifier for the request. If the request is sent multiple
        times with the same idempotency key, the server will return the same
        response as the first request. The idempotency key is valid for 24
        hours.
      required: false
      schema:
        type: string
  schemas:
    ActiveContractsRequest:
      type: object
      description: >-
        Which vault account and blockchain to read, and the Canton filter to
        apply.
      properties:
        vaultAccountId:
          type: string
          pattern: ^[0-9]+$
          example: '12'
          description: The vault account whose Canton wallet is read.
        blockchainId:
          type: string
          enum:
            - CANTON
            - CANTON_TEST
          example: CANTON
          description: The blockchain the vault account's Canton party is connected to.
        payload:
          $ref: '#/components/schemas/ActiveContractsRequestPayload'
      required:
        - vaultAccountId
        - blockchainId
        - payload
    ActiveContractsResponse:
      type: object
      description: >-
        The active contracts at the current ledger end. Not paged, and no ledger
        offset is returned.
      properties:
        activeContracts:
          type: array
          example: []
          description: >-
            The active contracts that match the filter, at most 1000 and about 3
            MiB in total. Empty when nothing matched. When more match, the
            request is a 400 instead: narrow the filter.
          items:
            $ref: '#/components/schemas/ActiveContractEntry'
      required:
        - activeContracts
    ErrorSchema:
      type: object
      properties:
        message:
          type: string
        code:
          type: number
    ActiveContractsRequestPayload:
      type: object
      description: The Canton read request. Only `eventFormat` is supported.
      properties:
        eventFormat:
          $ref: '#/components/schemas/ActiveContractsEventFormat'
      required:
        - eventFormat
    ActiveContractEntry:
      type: object
      description: One entry of the Canton active contract set.
      properties:
        workflowId:
          type: string
          description: >-
            The workflow id of the transaction that created the contract, when
            set.
          example: placeholder-workflow
        contractEntry:
          $ref: '#/components/schemas/ActiveContractEntryBody'
      required:
        - contractEntry
    ActiveContractsEventFormat:
      type: object
      description: >-
        Canton's `eventFormat`. `filtersForAnyParty` and `verbose` are not
        supported. `filtersByParty` must hold exactly one key.
      properties:
        filtersByParty:
          $ref: '#/components/schemas/ActiveContractsFiltersByParty'
      required:
        - filtersByParty
    ActiveContractEntryBody:
      type: object
      description: The contract entry. The key is the Canton entry kind.
      properties:
        JsActiveContract:
          $ref: '#/components/schemas/JsActiveContract'
      required:
        - JsActiveContract
    ActiveContractsFiltersByParty:
      type: object
      description: >-
        Filters keyed by Canton party id. Exactly one key, and it must be the
        vault account's own Canton party, which is the party of the vault's
        Canton deposit address.
      minProperties: 1
      maxProperties: 1
      additionalProperties:
        $ref: '#/components/schemas/ActiveContractsPartyFilter'
      example:
        placeholder-vault-party:
          cumulative:
            - identifierFilter:
                TemplateFilter:
                  value:
                    templateId: '#my-package:MyModule:MyTemplate'
                    includeCreatedEventBlob: false
    JsActiveContract:
      type: object
      properties:
        createdEvent:
          $ref: '#/components/schemas/ActiveContractCreatedEvent'
        synchronizerId:
          type: string
          description: The synchronizer the contract is assigned to.
          example: placeholder-synchronizer::1220
      required:
        - createdEvent
        - synchronizerId
    ActiveContractsPartyFilter:
      type: object
      description: The filters that apply to one party.
      properties:
        cumulative:
          type: array
          minItems: 1
          maxItems: 20
          description: >-
            Between 1 and 20 filters. A contract is returned when it matches any
            of them.
          items:
            $ref: '#/components/schemas/ActiveContractsCumulativeFilter'
          example:
            - identifierFilter:
                WildcardFilter:
                  value: {}
      required:
        - cumulative
    ActiveContractCreatedEvent:
      type: object
      description: The event that created the contract.
      properties:
        contractId:
          type: string
          example: 00a1b2c3-placeholder-contract-id
          description: The Canton contract id.
        templateId:
          type: string
          description: >-
            The template of the contract, in package-id form as the ledger
            reports it.
          example: 00placeholderpackageid:MyModule:MyTemplate
        packageName:
          type: string
          description: The package name of the template.
          example: my-package
        createArgument:
          $ref: '#/components/schemas/ActiveContractCreateArgument'
        signatories:
          type: array
          items:
            type: string
          description: The signatory parties of the contract.
          example:
            - placeholder-vault-party
        observers:
          type: array
          items:
            type: string
          description: The observer parties of the contract.
          example: []
        witnessParties:
          type: array
          items:
            type: string
          description: The parties that see the contract.
          example:
            - placeholder-vault-party
        createdAt:
          type: string
          description: When the contract was created.
          example: '2026-01-01T00:00:00.000000Z'
        createdEventBlob:
          type: string
          description: >-
            Base64 blob for disclosing the contract. Only present when
            `includeCreatedEventBlob` is true on the matching filter.
          example: cGxhY2Vob2xkZXI=
        interfaceViews:
          type: array
          description: >-
            Interface views. Only present for an `InterfaceFilter` with
            `includeInterfaceView`.
          items:
            $ref: '#/components/schemas/ActiveContractInterfaceView'
          example: []
      required:
        - contractId
        - templateId
        - packageName
        - createArgument
        - signatories
        - observers
        - witnessParties
        - createdAt
    ActiveContractsCumulativeFilter:
      type: object
      description: One filter entry.
      properties:
        identifierFilter:
          description: Exactly one of a template, an interface or a wildcard filter.
          oneOf:
            - $ref: '#/components/schemas/ActiveContractsTemplateFilter'
            - $ref: '#/components/schemas/ActiveContractsInterfaceFilter'
            - $ref: '#/components/schemas/ActiveContractsWildcardFilter'
          example:
            WildcardFilter:
              value: {}
      required:
        - identifierFilter
    ActiveContractCreateArgument:
      type: object
      additionalProperties: true
      description: Free-form contract create arguments. The shape depends on the template.
      example:
        owner: placeholder-party
        amount: '1000000.0000000001'
    ActiveContractInterfaceView:
      type: object
      additionalProperties: true
      description: A free-form interface view.
      example:
        interfaceId: '#my-package:MyModule:MyInterface'
    ActiveContractsTemplateFilter:
      type: object
      additionalProperties: false
      description: Match one template. The key is the Canton filter name.
      properties:
        TemplateFilter:
          $ref: '#/components/schemas/ActiveContractsTemplateFilterBody'
      required:
        - TemplateFilter
    ActiveContractsInterfaceFilter:
      type: object
      additionalProperties: false
      description: Match one interface. The key is the Canton filter name.
      properties:
        InterfaceFilter:
          $ref: '#/components/schemas/ActiveContractsInterfaceFilterBody'
      required:
        - InterfaceFilter
    ActiveContractsWildcardFilter:
      type: object
      additionalProperties: false
      description: >-
        Match every contract the party can see. The key is the Canton filter
        name.
      properties:
        WildcardFilter:
          $ref: '#/components/schemas/ActiveContractsWildcardFilterBody'
      required:
        - WildcardFilter
    ActiveContractsTemplateFilterBody:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/ActiveContractsTemplateFilterValue'
      required:
        - value
    ActiveContractsInterfaceFilterBody:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/ActiveContractsInterfaceFilterValue'
      required:
        - value
    ActiveContractsWildcardFilterBody:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/ActiveContractsWildcardFilterValue'
      required:
        - value
    ActiveContractsTemplateFilterValue:
      type: object
      properties:
        templateId:
          type: string
          minLength: 1
          example: '#my-package:MyModule:MyTemplate'
          description: The template, as `#package-name:Module:Entity`.
        includeCreatedEventBlob:
          type: boolean
          default: false
          description: Return `createdEventBlob` on each contract.
          example: false
      required:
        - templateId
    ActiveContractsInterfaceFilterValue:
      type: object
      properties:
        interfaceId:
          type: string
          minLength: 1
          example: '#my-package:MyModule:MyInterface'
          description: The interface, as `#package-name:Module:Entity`.
        includeInterfaceView:
          type: boolean
          default: false
          description: Return `interfaceViews` on each contract.
          example: false
        includeCreatedEventBlob:
          type: boolean
          default: false
          description: Return `createdEventBlob` on each contract.
          example: false
      required:
        - interfaceId
    ActiveContractsWildcardFilterValue:
      type: object
      properties:
        includeCreatedEventBlob:
          type: boolean
          default: false
          description: Return `createdEventBlob` on each contract.
          example: false
  headers:
    X-Request-ID:
      schema:
        type: string
      description: >-
        Unique ID correlated to the API request. Please provide it in any
        support ticket you create or on Github issues related to Fireblocks SDKs
  responses:
    Error:
      description: Error Response
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSchema'

````