Get User

Query user information or regenerate API credentials.

Get User

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).

Regenerate API Key

Invalidate the old API key and generate a new one.

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.

  • regenerateUserApiKey() is currently disabled on the backend. Contact support if you need a new API key.

  • The new API key from regenerateUserApiKey() is returned only once. Store it securely.