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

# Contracts a user's own deposit or withdraw of a collateral asset must disclose

> `DepositIntoFundingAsset` and `WithdrawFromFunding` are submitted by the user alone, who cannot
see the collateral registry or the asset's fee config. A deposit passes both in
`disclosedContracts`, with their contract ids as `collateralRegistryCid` and
`fundingFeeConfigCid`; a withdraw passes the fee config alone. The registry is replaced on
every registry change, so fetch this right before submitting. Every listed asset
is served whatever its status, since a ReduceOnly or Disabled asset can still be withdrawn;
only an Active asset takes deposits. `fees` are the config's own, in whole tokens of the asset:
a deposit's CIP-56 transfer is `amount + fees.deposit`, and a withdrawal needs
`amount + fees.withdraw` unlocked.



## OpenAPI

````yaml /v2/api-reference/openapi.json get /api/v1/collateral/assets/{asset_id}/disclosures
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.dev.ekiden.fi/
    description: Production (Canton Mainnet)
security: []
paths:
  /api/v1/collateral/assets/{asset_id}/disclosures:
    get:
      tags:
        - Collateral
      summary: >-
        Contracts a user's own deposit or withdraw of a collateral asset must
        disclose
      description: >-
        `DepositIntoFundingAsset` and `WithdrawFromFunding` are submitted by the
        user alone, who cannot

        see the collateral registry or the asset's fee config. A deposit passes
        both in

        `disclosedContracts`, with their contract ids as `collateralRegistryCid`
        and

        `fundingFeeConfigCid`; a withdraw passes the fee config alone. The
        registry is replaced on

        every registry change, so fetch this right before submitting. Every
        listed asset

        is served whatever its status, since a ReduceOnly or Disabled asset can
        still be withdrawn;

        only an Active asset takes deposits. `fees` are the config's own, in
        whole tokens of the asset:

        a deposit's CIP-56 transfer is `amount + fees.deposit`, and a withdrawal
        needs

        `amount + fees.withdraw` unlocked.
      operationId: get_collateral_disclosures
      parameters:
        - name: asset_id
          in: path
          description: Collateral asset id
          required: true
          schema:
            type: integer
            format: int32
            minimum: 0
      responses:
        '200':
          description: The contracts to disclose
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCollateralDisclosuresResponse'
        '404':
          description: Unknown collateral asset
        '503':
          description: The contracts cannot be read from the ledger projection
components:
  schemas:
    GetCollateralDisclosuresResponse:
      type: object
      description: >-
        What a user's own deposit or withdraw of one collateral asset must
        disclose.
      required:
        - asset_id
        - status
        - collateral_registry
        - funding_fee_config
        - fees
      properties:
        asset_id:
          type: integer
          format: int32
          minimum: 0
        collateral_registry:
          $ref: '#/components/schemas/DisclosedContract'
          description: >-
            The live registry, `collateralRegistryCid` of
            `DepositIntoFundingAsset`. It is replaced on

            every registry change, so fetch it right before submitting.
        fees:
          $ref: '#/components/schemas/CollateralFundingFees'
          description: >-
            The fees `funding_fee_config` charges. The ledger charges what that
            contract holds, so

            size a submission from the fees and the config of the same response.
        funding_fee_config:
          $ref: '#/components/schemas/DisclosedContract'
          description: >-
            The asset's own fee config, `fundingFeeConfigCid` of its deposit and
            withdraw.
        status:
          $ref: '#/components/schemas/CollateralAssetStatus'
          description: Only an Active asset takes deposits; any status can be withdrawn.
    DisclosedContract:
      type: object
      description: >-
        A contract a submission discloses, in the shape the Canton ledger API's
        `disclosedContracts`

        takes.
      required:
        - templateId
        - contractId
        - createdEventBlob
        - synchronizerId
      properties:
        contractId:
          type: string
        createdEventBlob:
          type: string
          description: Base64.
        synchronizerId:
          type: string
        templateId:
          type: string
          description: '`{package_id}:{module}:{entity}`.'
    CollateralFundingFees:
      type: object
      description: >-
        A fee config's flat fees, in whole tokens of its asset, exactly as the
        ledger charges them: the

        config's exact `depositFee`/`withdrawFee` when set (e.g. `"0.0005"`),
        otherwise its cents over

        100 (e.g. `"1.50"`, `"0.00"` when there is no fee).
      required:
        - deposit
        - withdraw
      properties:
        deposit:
          type: string
          description: |-
            A deposit of `amount` transfers `amount + deposit` from the
            user's holdings and credits the funding vault `amount`.
        withdraw:
          type: string
          description: |-
            A withdrawal of `amount` needs `amount + withdraw` unlocked in
            the funding vault, debits that, and transfers the user `amount`.
    CollateralAssetStatus:
      type: string
      enum:
        - active
        - reduce_only
        - disabled

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.