# 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");
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://city-protocol.gitbook.io/docs/software-development-kit/aml/core-analysis-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
