> For the complete documentation index, see [llms.txt](https://city-protocol.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://city-protocol.gitbook.io/docs/software-development-kit/aml/core-analysis-methods.md).

# Core Analysis Methods

#### analyzeWallet

Submits a wallet address for exposure analysis. The provider evaluates the address against known risk entities, sanctions lists, and behavioral heuristics. The `type` field specifies the analysis mode — `"wallet_exposure"` performs a holistic inbound/outbound exposure breakdown.

```
const analysis = await amlClient.analyzeWallet({
  type: "wallet_exposure",
  subject: {
    type: "address",
    asset: "holistic",
    address: "0x00000000000000000000000000000000000000aa",
  },
});
```

Setting `asset` to `"holistic"` tells the provider to evaluate across all supported assets rather than scoping to a single chain or token.

#### getWalletAnalysis

Retrieves a previously submitted wallet analysis by its ID. This is useful when analysis is performed asynchronously — you submit with `analyzeWallet`, store the returned ID, and poll or fetch results later once processing has completed.

```
const analysisById = await amlClient.getWalletAnalysis("wallet-analysis-id");
```

#### analyzeTransaction

Submits a transaction hash for source-of-funds analysis. The `customer_reference` field is a free-form string that allows you to correlate the analysis with your own internal records (e.g., a user ID and deposit event). Like wallet analysis, set `asset` to `"holistic"` for a cross-asset evaluation.

```
const analysis = await amlClient.analyzeTransaction({
  type: "source_of_funds",
  customer_reference: "user-123:deposit-456",
  subject: {
    type: "transaction",
    asset: "holistic",
    hash: "0xabc123",
  },
});
```

**Note:** The `customer_reference` is stored alongside the analysis on the provider side. Use a consistent, deterministic format so that your compliance team can trace any flagged analysis back to the originating action.

#### getTransactionAnalysis

Retrieves a previously submitted transaction analysis by its ID. Follows the same async fetch pattern as `getWalletAnalysis`.

```
const analysisById = await amlClient.getTransactionAnalysis("analysis-id");
```
