Skip to main content

API Reference

Commands (Sent to Iframe)

ADD_WALLETS

Adds wallets to the whitelist.
interface AddWalletsMessage {
  type: 'ADD_WALLETS';
  wallets: (string | Wallet)[];
}
Wallet Formats:
  • String: "ABCD" or "ABCD:Label"
  • Object: { address: "ABCD", label: "Label" }
Example:
// Using string format
sendMessage({
  type: 'ADD_WALLETS',
  wallets: ['XYZ1:DeFi Protocol', 'XYZ2:Market Maker', 'XYZ3']
});

// Using object format
sendMessage({
  type: 'ADD_WALLETS',
  wallets: [
    { address: 'ABCD', label: 'Whale Trader' },
    { address: 'EFGH', label: 'Smart Money' },
    { address: '1234' }
  ]
});

CLEAR_WALLETS

Removes all iframe-added wallets from the whitelist.
interface ClearWalletsMessage {
  type: 'CLEAR_WALLETS';
}
Example:
sendMessage({ type: 'CLEAR_WALLETS' });

GET_WALLETS

Retrieves current whitelist.
interface GetWalletsMessage {
  type: 'GET_WALLETS';
}
Example:
sendMessage({ type: 'GET_WALLETS' });

Responses (Received from Iframe)

Response TypeDescription
IFRAME_READYSent when iframe is loaded and ready for communication
WALLETS_ADDEDConfirms wallets were added successfully
WALLETS_CLEAREDConfirms iframe wallets were cleared
CURRENT_WALLETSReturns current whitelist data
WHITELIST_TRADING_STATSReal-time trading statistics for whitelisted addresses
SOL_PRICE_UPDATEReal-time SOL price updates
WHITELIST_TRADEIndividual trade events from whitelisted addresses
TOKEN_PRICE_UPDATEToken price updates from all trading activity