# HTTP — `GET /v1/funding`

Returns the 20 most recent deposit requests and the 20 most recent withdrawal
requests of the master account of the Para-authenticated wallet. It also
returns the 20 most recent transfers between any two accounts of the owner.
Requests and transfers are created through
[`POST /v1/exchange`](/api/exchange).

```http
GET /v1/funding
Authorization: Bearer <para-jwt>
X-Tessera-Wallet: 0x... # required when the JWT has multiple EVM wallets
```

An API key gets `401 unauthorized` with the detail `wallet_auth_required`.

```jsonc
{
  "status": "ok",
  "data": {
    "safeBlock": 123456789,
    "deposits": [
      {
        "id": "...",
        "amount": "50",
        "status": "pending",
        "statusDetail": "waiting_transfer",
        "walletAddress": "0x...",
        "chain": "arbitrum",
        "txHash": null,
        "blockNumber": null,
        "safeBlock": 123456789,
        "blocksUntilSafe": null,
        "createdAtMs": 1780000000100,
        "expiresAtMs": 1780003600100,
        "completedAtMs": null,
        "rejectedReason": null,
        "reviewReason": null,
        "rejectionKind": null
      }
    ],
    "withdrawals": [
      {
        "id": "...",
        "amount": "100",
        "status": "completed",
        "walletAddress": "0x...",
        "chain": "arbitrum",
        "payoutTxHash": "0x...",
        "createdAtMs": 1780000000100,
        "completedAtMs": 1780007200100,
        "rejectedReason": null
      }
    ],
    "transfers": [
      {
        "transferId": "8f1e3c2a-5f0b-4a3e-9c2d-1b7d1e6f0a11",
        "from": "0x0000000000000000000000000000000000000001",
        "to": "0x9f3c5d0e7a41b2c86f1d94e03a5b7c2d18e6f0a1",
        "amountUsdc": "250.5",
        "completedAtMs": 1780000000012
      }
    ]
  },
  "server_time_ms": 1780000000200
}
```

Each `amount` and `amountUsdc` is a decimal string without trailing zeros,
whatever digits the request had. A deposit requested as `"1.50"` lists
`"amount": "1.5"`.

## Deposits

`status` is `pending`, `completed`, `rejected`, or `review_required`.
`statusDetail` refines it:

| `statusDetail` | Meaning |
| --- | --- |
| `waiting_transfer` | No matching transfer observed yet. |
| `transfer_detected_waiting_safe` | Transfer observed, waiting for the safe block. Not currently returned. |
| `credited` | Credited to the account. |
| `review_required` | Needs manual review because the sender, amount, or timing did not match, or the transfer exceeded the automatic-credit limit. |
| `rejected` | Rejected; see `rejectedReason`. |

`safeBlock` is the latest Arbitrum block processed by Mosaiq. `safeBlock`,
`txHash`, `blockNumber`, and `blocksUntilSafe` are `null` until known. A
`review_required` request also carries the reason in `rejectedReason`.

`reviewReason` tells why a transfer went to manual review. It keeps its value
after the review ends. It is `null` for a request that never went to review.

| `reviewReason` | Meaning |
| --- | --- |
| `above_auto_credit_cap` | The transfer matched the request, and the amount is above the automatic-credit limit. |
| `unmatched_client_transfer` | The transfer came from the account wallet, and no open request matched it. The request did not exist, it expired, or its amount is different. |
| `unknown` | The request is older than this field, and Mosaiq does not know the cause. |

`rejectionKind` tells what a rejection means for the money. It is `null` when
`status` is not `rejected`.

| `rejectionKind` | Meaning |
| --- | --- |
| `no_transfer` | The request was rejected before a transfer matched it. It holds no money. |
| `refund_due` | Mosaiq refused a received transfer and owes the sender a refund. |
| `unknown` | The request is older than this field, and Mosaiq does not know the kind. |

The other values of these two fields, `unknown_sender` and `house_transfer`,
apply only to transfers that name no account, so this endpoint does not return
them.

## Withdrawals

`status` is `pending`, `completed`, or `rejected`. A completed request carries
`payoutTxHash` when a payout transaction hash is available. A rejected request
carries `rejectedReason`.

## Transfers

`transfers` lists completed [transfers](/api/exchange#transfer) between the
accounts of the owner, newest first. A refused transfer is not in the list.
`from` and `to` are account addresses. `amountUsdc` is a decimal string.
`data.transfers` is an empty array when the owner has never made a transfer.
