Get Is Whitelisted (WebSocket)
Check if a wallet address is whitelisted for trading operations through the WebSocket connection. This is a public endpoint that returns whitelist status without requiring authentication.
Endpoint
ws.send() wss://api.synthetix.io/v1/ws/infoRequest
Request Format
{
"id": "whitelist-1",
"method": "post",
"params": {
"action": "getIsWhitelisted",
"walletAddress": "0x1234567890123456789012345678901234567890"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Client-generated unique request identifier |
method | string | Yes | Must be "post" |
params | object | Yes | Request parameters wrapper |
params.action | string | Yes | Must be "getIsWhitelisted" |
params.walletAddress | string | Yes | Ethereum wallet address to check |
Response
Success Response
{
"id": "whitelist-1",
"status": 200,
"result": {
"response": true,
"status": "success"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
result.response | boolean | true if wallet is whitelisted and can place orders, false otherwise |
result.status | string | Always "success" for successful responses |
Error Response
{
"id": "whitelist-1",
"status": 400,
"result": null,
"error": {
"code": 400,
"message": "Invalid wallet address format"
}
}WebSocket Connection Example
const ws = new WebSocket('wss://papi.synthetix.io/v1/ws/info');
ws.onopen = () => {
// Check if wallet is whitelisted
ws.send(JSON.stringify({
id: 'whitelist-1',
method: 'post',
params: {
action: 'getIsWhitelisted',
walletAddress: '0x1234567890123456789012345678901234567890'
}
}));
};
ws.onmessage = (event) => {
const response = JSON.parse(event.data);
if (response.id === 'whitelist-1' && response.status === 200) {
const isWhitelisted = response.result.response;
console.log(`Wallet whitelisted: ${isWhitelisted}`);
if (isWhitelisted) {
console.log('✅ Wallet can place orders');
} else {
console.log('❌ Wallet cannot place orders');
}
}
};Examples
Check Whitelist Status
{
"id": "check-access",
"method": "post",
"params": {
"action": "getIsWhitelisted",
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}
}Validate Before Trading
async function checkTradingAccess(walletAddress) {
const ws = new WebSocket('wss://papi.synthetix.io/v1/ws/info');
return new Promise((resolve, reject) => {
ws.onopen = () => {
ws.send(JSON.stringify({
id: 'check-whitelist',
method: 'post',
params: {
action: 'getIsWhitelisted',
walletAddress: walletAddress
}
}));
};
ws.onmessage = (event) => {
const response = JSON.parse(event.data);
if (response.id === 'check-whitelist') {
ws.close();
if (response.status === 200) {
resolve(response.result.response);
} else {
reject(new Error(response.error?.message || 'Unknown error'));
}
}
};
ws.onerror = reject;
});
}
// Usage
try {
const canTrade = await checkTradingAccess('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb');
if (canTrade) {
// Proceed with trading operations
console.log('Access granted - can place orders');
} else {
// Show whitelist message to user
console.log('Access denied - wallet not whitelisted');
}
} catch (error) {
console.error('Failed to check whitelist status:', error);
}Implementation Notes
- Public Data: No authentication required for this endpoint
- Wallet Address Required: Must provide a valid Ethereum address
- Boolean Response: Returns simple true/false value
- Case Insensitive: Wallet addresses are normalized (case doesn't matter)
- Real-time: Reflects current whitelist status
- Access Control: Used to enforce trading restrictions
Use Cases
Pre-Trade Validation
- Check access before attempting to place orders
- Show appropriate UI based on whitelist status
- Provide feedback to users about trading access
Access Management
- Verify wallet eligibility for trading
- Implement gated trading features
- Enforce compliance requirements
User Experience
- Display whitelist status in UI
- Show informative messages to non-whitelisted users
- Guide users through whitelist process
Whitelist System
What is Whitelisting?
The whitelist system controls which wallets can place orders on the platform. This may be used for:
- Regulatory compliance
- Phased rollouts
- Access control during testing
- Risk management
Whitelist Status
| Status | Can Place Orders | Can View Markets | Can Query Data |
|---|---|---|---|
| Whitelisted | ✅ Yes | ✅ Yes | ✅ Yes |
| Not Whitelisted | ❌ No | ✅ Yes | ✅ Yes |
Address Format Validation
Valid Formats
// Checksummed address (preferred)
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
// Lowercase
"0x742d35cc6634c0532925a3b844bc9e7595f0beb"
// Uppercase
"0x742D35CC6634C0532925A3B844BC9E7595F0BEB"Invalid Formats
// Missing 0x prefix
"742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
// Too short
"0x742d35Cc6634C0532925a3b844Bc9e7595"
// Invalid characters
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEg"Performance Considerations
- Low Latency: WebSocket connection provides faster response times than REST
- Persistent Connection: Reuse the same connection for multiple checks
- Lightweight: Returns only boolean value (minimal data transfer)
- Efficient: Fast whitelist lookup from arbitrator service
Validation Rules
- No authentication required (public Info WebSocket)
- Wallet address parameter is required
- Address must be a valid Ethereum hex address (0x + 40 hex characters)
- Invalid addresses will return a 400 error
Error Handling
| Error | Cause | Solution |
|---|---|---|
Invalid wallet address format | Address not a valid Ethereum address | Verify address format (0x + 40 hex chars) |
Invalid request body | Missing walletAddress parameter | Include walletAddress in params |
whitelist arbitrator unavailable | System error | Retry request or contact support |
Integration Example
class TradingClient {
async canPlaceOrders(walletAddress) {
const ws = new WebSocket('wss://papi.synthetix.io/v1/ws/info');
return new Promise((resolve, reject) => {
ws.onopen = () => {
ws.send(JSON.stringify({
id: 'whitelist-check',
method: 'post',
params: {
action: 'getIsWhitelisted',
walletAddress: walletAddress
}
}));
};
ws.onmessage = (event) => {
const response = JSON.parse(event.data);
if (response.id === 'whitelist-check') {
ws.close();
resolve(response.status === 200 && response.result.response === true);
}
};
ws.onerror = () => {
ws.close();
reject(new Error('WebSocket error'));
};
});
}
}
// Usage
const client = new TradingClient();
const isAllowed = await client.canPlaceOrders('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb');Related Endpoints
- Place Orders - Place trading orders (requires whitelist)
- Get SubAccount IDs - List wallet's subaccounts