Endpoint
wss://[mainnet-ws/devnet-ws].carpool.dev
Subscribing to Data
In order to start receiving data, you must send a subscribe message with the following format:
{
"apiKey": "YOUR_API_KEY",
"programId": "PROGRAM_ID",
"level": "<processed | confirmed>",
"type": "<account | instruction>",
"entityName": "ENTITY_NAME",
"chain": "solana"
}
This request will determine what kind data you receive. Note that the entityName field corresponds to the instruction name (if type is “instruction”) or the name of the account type (if type is “account”). You can use * to receive all accounts or instructions.
Listen for a connected event which should immediately emit true when you send a valid subscribe call. If your request is malformed, you will receive and error message with details.
The data that you’ve subscribed to will be emitted as data events.
Data Formats
Instruction Data
{
slot: number;
signature: string;
programId: string;
instructionName: string;
args: any;
ixAccounts: Record<string, string>;
cpiInvoker: string; // Empty string if null
isFailure: boolean;
}
Account Data
{
programId: string;
accountName: string;
pubkey: string;
slot: number;
writeVersion: number;
status: "UPDATED" | "DELETED"
data?: any;
lamports: number;
}