Create User
Register a new user sub-account under your builder and get their API key.
Usage
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 result = await builder.createUser('0xUserWalletAddress...');
console.log(result.walletAddress); // User's login wallet address
console.log(result.multiSigWallet); // User's Gnosis Safe wallet address
console.log(result.apikey); // User's API key - SAVE THIS!
console.log(result.builderName); // Builder name
console.log(result.enableTrading); // Whether trading is enabledParameters
Parameter
Type
Required
Description
walletAddress
string
Yes
User's EOA wallet address (0x-prefixed)
Response
Notes
The API key is returned only once during creation. Store it securely in your database.
The Gnosis Safe wallet is created asynchronously (1-10 minutes). Poll
getUser()untilmultiSigWalletis non-empty.If the user already exists, the API will return an error. Use
getUser()to retrieve existing user info.
Polling for Safe Wallet
Last updated