> For the complete documentation index, see [llms.txt](https://docs.opinion.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opinion.trade/developer-guide/opinion-clob-typescript-sdk/builder-mode/get-user.md).

# Get User

> Query user information or regenerate API credentials.

## Get User

```typescript
import { BuilderClient } from '@opinion-labs/opinion-clob-sdk';

const builder = new BuilderClient({
  host: 'https://openapi.opinion.trade/openapi',
  builderApiKey: 'YOUR_BUILDER_KEY',
  chainId: 56,
});

const user = await builder.getUser('0xUserWalletAddress...');

console.log(user.walletAddress);    // User's login wallet address
console.log(user.multiSigWallet);   // User's Gnosis Safe wallet address
console.log(user.builderName);      // Builder name
console.log(user.enableTrading);    // Whether trading is enabled
```

### Parameters

| Parameter       | Type   | Required | Description                             |
| --------------- | ------ | -------- | --------------------------------------- |
| `walletAddress` | string | Yes      | User's EOA wallet address (0x-prefixed) |

### Response

Returns `UserInfo` without `apikey` or `walletCreationTxHash` (omitted for security).

```typescript
{
  walletAddress: string;
  multiSigWallet: string;
  builderName: string;
  enableTrading: boolean;
}
```

## Regenerate API Key

Invalidate the old API key and generate a new one.

```typescript
const result = await builder.regenerateUserApiKey('0xUserWalletAddress...');

console.log(result.apikey);  // New API key - SAVE THIS!
```

### Parameters

| Parameter       | Type   | Required | Description                             |
| --------------- | ------ | -------- | --------------------------------------- |
| `walletAddress` | string | Yes      | User's EOA wallet address (0x-prefixed) |

### Response

Returns full `UserInfo` including the new `apikey`.

## Notes

* `getUser()` does **not** return the API key for security reasons.
* The new API key from `regenerateUserApiKey()` is returned only once. Store it securely.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.opinion.trade/developer-guide/opinion-clob-typescript-sdk/builder-mode/get-user.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.
