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

# Confirm Lender Role

> Record a mined adoption and read what the handover left outstanding

Records a mined `acceptCuratorRole` transaction on this instance. The call verifies the receipt against the lending factory and checks that the factory now names the signing wallet as lender of record. It then writes the market onto this instance with the parties the factory recorded. It returns `201` with the recorded market, the satellite handover state and the asset data approval the receipt carries.

Call it after broadcasting the transaction from [Accept Lender Role](/endpoints/lending/accept-lender-role). The returned `market.id` is this instance's ID for the market: every `/markets/{marketId}` endpoint takes it from here on. Confirming the same hash again is safe and converges on the same records.

This call records the adoption on the adopting instance only. The deploying instance learns of it when it reads the market with [Get Market](/endpoints/lending/get-market) or [Get Operator](/endpoints/lending/get-operator), which reconcile its record with the factory.

## Path Parameters

<ParamField path="marketAddress" type="string" required>
  Market contract address, `0x` followed by 40 hex characters. It must match the market the transaction adopted.
</ParamField>

## Body Parameters

<ParamField body="txHash" type="string" required>
  Hash of the mined `acceptCuratorRole` transaction, signed by one of this instance's verified wallets.
</ParamField>

## Handover

On a market deployed through the current factory, adoption hands the price oracle, the interest rate model and the insurance fund to their named owners inside the same transaction. `handover.complete` then reads `true` and `acceptOwnershipCalldata` is empty.

A market from an earlier generation hands them over in two steps. Until each named owner calls `acceptOwnership`, the market itself, or the factory on the oldest markets, remains their owner of record and the lender of record cannot govern them. `acceptOwnershipCalldata` lists each outstanding leg with the wallet that must sign it. [Get Handover](/endpoints/lending/get-handover) reads the same state later.

## Standing policy terms

When this instance holds a standing policy that matches the market's deployer or collateral token and names a terms template, the confirm publishes terms of use from that template. It does so only while the market has no published terms. `termsApplied` reports the result. A failure there does not undo the adoption: it is reported in `termsApplyError`, and terms can be saved afterwards with [Save Terms](/endpoints/lending/save-terms).

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="market" type="object">The market as this instance now records it. It carries `id`, the contract addresses, `curator`, `seekingCurator` (`false`), `realizationMode` and `liquidityCommitment` in the borrow asset's smallest unit. It also carries `saleRecipient`, `collateralAgent`, `liquidationOperator`, `operatorShare`, `curatorAcceptedAt` (the adoption's block time) and `curatorAcceptTxHash`. A market this instance did not record before carries `curatorImported: true`.</ResponseField>
    <ResponseField name="txHash" type="string">The adoption transaction hash.</ResponseField>
    <ResponseField name="curator" type="string">The wallet that signed the adoption and now holds the lender-of-record role, lowercased.</ResponseField>

    <ResponseField name="handover" type="object">
      The satellite ownership state after adoption, or `null` when it could not be read.

      <Expandable>
        <ResponseField name="readable" type="boolean">`false` when the factory could not be read. No other field is present then.</ResponseField>
        <ResponseField name="stage" type="string">`COMPLETE`, `PENDING`, `NOT_STARTED` or `UNKNOWN`.</ResponseField>
        <ResponseField name="complete" type="boolean">`true` when every satellite is held by an owner the lender of record named.</ResponseField>
        <ResponseField name="surrendered" type="boolean">Whether the factory recorded the handover decision.</ResponseField>
        <ResponseField name="oraclePending" type="boolean">The oracle still waits for its named owner.</ResponseField>
        <ResponseField name="interestModelPending" type="boolean">The interest rate model still waits for its named owner.</ResponseField>
        <ResponseField name="insuranceFundPending" type="boolean">The insurance fund still waits for its named owner.</ResponseField>
        <ResponseField name="nothingPending" type="boolean">None of the three is pending.</ResponseField>
        <ResponseField name="satellites" type="object">`oracle`, `interestModel` and `insuranceFund`, each `{ address, owner, pendingOwner, heldBy, pending }`. `heldBy` is `factory`, `market`, `owner` or `null`.</ResponseField>
        <ResponseField name="acceptOwnershipCalldata" type="array">Outstanding `acceptOwnership` legs, each `{ key, to, data, signer, description }` plus the chain binding. Empty when nothing is outstanding.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="assetData" type="object">The acknowledgement the receipt carries, `{ contentHash, version, curator }`. `null` when the adoption approved no asset data version.</ResponseField>
    <ResponseField name="standingPolicy" type="object">The standing policy of this instance that matches the market, or `null`.</ResponseField>
    <ResponseField name="termsApplied" type="object">`{ templateId, templateVersion, version, contentHash }` when the confirm published terms from the policy's template. `null` otherwise.</ResponseField>
    <ResponseField name="termsApplyError" type="object">`{ code, message }` when publishing those terms failed. `null` otherwise.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/queued/0x1c74f9a2b0e63d581a47c02f9b8de3517a604c2b/confirm-accept" \
    -H "X-API-Key: trusset_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{ "txHash": "0x5d8e2a41c7b93f06e1d4a8c25b7f90e3d6a1c48b2e5f7093a4d6c81b5e2f7a90" }'
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/lending-external-securities-v2/api/markets/queued/${marketAddress}/confirm-accept`,
    {
      method: 'POST',
      headers: {
        'X-API-Key': 'trusset_your_key_here',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ txHash: tx.hash })
    }
  );
  const { data } = await res.json();
  const marketId = data.market.id;
  const outstanding = data.handover?.acceptOwnershipCalldata ?? [];
  ```
</RequestExample>

<ResponseExample>
  ```json Confirmed Response theme={null}
  {
    "success": true,
    "data": {
      "market": {
        "id": "clx_secmarket_207",
        "marketAddress": "0x1c74f9a2b0e63d581a47c02f9b8de3517a604c2b",
        "collateralTokenAddress": "0x9f8c1d4b2e7a3056c1b8f4d29e0a7c3518b6d24f",
        "collateralMode": "FREEZE",
        "priceSource": "NAV",
        "curator": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
        "seekingCurator": false,
        "realizationMode": "ISSUER_REDEMPTION",
        "liquidityCommitment": "250000000000",
        "saleRecipient": "0x2f6a0d83c5e19b47d2a8c6f1e03b95d74a2c8e16",
        "collateralAgent": "0x8b17e4d90c3a25f6e1d09b7c4a3f52e86d1c0b94",
        "liquidationOperator": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
        "operatorShare": "800",
        "curatorAcceptedAt": "2026-09-26T10:41:12.000Z",
        "curatorAcceptTxHash": "0x5d8e2a41c7b93f06e1d4a8c25b7f90e3d6a1c48b2e5f7093a4d6c81b5e2f7a90",
        "curatorImported": true,
        "active": true
      },
      "txHash": "0x5d8e2a41c7b93f06e1d4a8c25b7f90e3d6a1c48b2e5f7093a4d6c81b5e2f7a90",
      "curator": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93",
      "handover": {
        "readable": true,
        "surrendered": true,
        "oraclePending": false,
        "interestModelPending": false,
        "insuranceFundPending": false,
        "nothingPending": true,
        "stage": "COMPLETE",
        "complete": true,
        "satellites": {
          "oracle": {
            "address": "0x3b25752c1459c5cf1b0bfcfdf0d56883c8047423",
            "owner": "0x5a3c9e71b0d24f86a1c7e5039b2d84f6c1a0e7d3",
            "pendingOwner": null,
            "heldBy": "owner",
            "pending": false
          },
          "interestModel": {
            "address": "0xd410b8e35297af6d0c1745be82a37f09b6534ce1",
            "owner": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52",
            "pendingOwner": null,
            "heldBy": "owner",
            "pending": false
          },
          "insuranceFund": {
            "address": "0x8f1a6b30c7d24e95f0a3b81d6c47e2905fa3b9c2",
            "owner": "0x5a3c9e71b0d24f86a1c7e5039b2d84f6c1a0e7d3",
            "pendingOwner": null,
            "heldBy": "owner",
            "pending": false
          }
        },
        "acceptOwnershipCalldata": []
      },
      "assetData": {
        "contentHash": "0xa93f4d51d67f4f88cb447fd06bccff45483fb5a9f04fa67dd1c8cdcd1127ae90",
        "version": 1,
        "curator": "0x4e91a7c05d3b62f18a0c94e7db2358f1c60a4e93"
      },
      "standingPolicy": null,
      "termsApplied": null,
      "termsApplyError": null
    }
  }
  ```

  ```json Error - Not Instance Bound theme={null}
  {
    "success": false,
    "error": {
      "code": "ACCEPT_NOT_INSTANCE_BOUND",
      "message": "The adoption was signed by a wallet that is not verified for this instance"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                              | HTTP  | Cause                                                                                              |
| --------------------------------- | ----- | -------------------------------------------------------------------------------------------------- |
| `VALIDATION_ERROR`                | `400` | `marketAddress` or `txHash` is malformed                                                           |
| `TX_WRONG_ARGS`                   | `400` | The transaction adopted a different market                                                         |
| `CONFIRM_ACCEPT_FAILED`           | `400` | The adoption could not be recorded for a reason that carries no code of its own                    |
| `CURATOR_NOT_APPROVED`            | `403` | Trusset has not approved this account to act as a lender of record                                 |
| `ACCEPT_NOT_INSTANCE_BOUND`       | `403` | The adoption was signed by a wallet that is not verified for this instance                         |
| `MARKET_NOT_V2`                   | `404` | The address is not a market of the v2 lending factory this instance deploys to                     |
| `ADOPTION_NOT_RECORDED`           | `409` | The factory reports no lender of record for the market, or a different one than the signing wallet |
| `MARKET_VERIFICATION_UNAVAILABLE` | `503` | The address could not be checked against the v2 factory. Retry shortly                             |
| `DEPLOYMENT_UNREADABLE`           | `503` | The market could not be read from the factory after adoption. Retry shortly                        |
| `FACTORY_READ_FAILED`             | `503` | The factory could not be reached. Retry shortly                                                    |

Confirming can also return any [transaction verification error](/endpoints/introduction#confirm-a-transaction).
