This endpoint compiles flywheel pipelines into Solana transaction instructions and creates a batch transaction for approval.
burn or airdrop scopes.
To authenticate, provide your API key in the x-believe-api-key request header.
Example:
| Field | Type | Required | Description |
|---|---|---|---|
pipelines | Array | Yes | Array of pipeline objects containing actions to execute. |
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | The type identifier for this pipeline (e.g., “WATCH_AD”, “PRODUCT_PURCHASE”). |
payload | string | Yes | JSON string containing the proof data for this pipeline. |
actions | Array | Yes | Array of action objects to execute in this pipeline. |
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be “BURN” |
amount | number | Yes | Amount of tokens to burn (in whole tokens) |
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be “AIRDROP” |
toAddress | string | Yes | Solana wallet address to send tokens to |
amount | number | Yes | Amount of tokens to airdrop (in whole tokens) |
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be “BUYBACK” |
amount | number | Yes | Amount of tokens to buyback (in whole tokens) |
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be “LOCK” |
amount | number | Yes | Amount of tokens to lock (in whole tokens) |
vesting | Object | Yes | Vesting parameters for the locked tokens |
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be “UNLOCK” |
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Must be “MEMO” |
message | string | Yes | The memo message to attach |
| Field | Type | Description |
|---|---|---|
proposalApproveTx | string | Base64-encoded serialized transaction that must be signed with your registered wallet address (the one used during flywheel registration) |
batch | Object | The batch object containing details about the compiled pipelines |
proposalApproveTx must be signed with your registered wallet address (the wallet address you provided during flywheel registration). This transaction requires approval from both the company approver and your project approver wallet before execution.
BURN, AIRDROP, and MEMO actions are fully implemented. BUYBACK, LOCK, and UNLOCK actions are coming soon.
AIRDROP actions, the endpoint automatically creates associated token accounts for recipients if they don’t exist.
| Error Code | Status | Description |
|---|---|---|
ERR_TOKEN_NOT_FOUND | 404 | The token associated with the API key could not be found. |
ERR_KEY_NOT_FOUND | 404 | The API key could not be found or is invalid. |
ERR_FLYWHEEL_NOT_FOUND | 404 | No flywheel is associated with the provided API key. |
ERR_BATCH_INIT_FAILED | 500 | Failed to compile pipelines or initialize the batch transaction. |
ERR_FLYWHEEL_ACTIONS_EMPTY | 400 | One or more pipelines contain no actions. |
ERR_FLYWHEEL_INVALID_ACTION | 400 | One or more actions in the pipelines are invalid or unsupported. |
ERR_FLYWHEEL_NO_INSTRUCTIONS | 400 | Pipeline compilation resulted in no transaction instructions. |
ERR_FLYWHEEL_PIPELINE_TOO_BIG | 400 | Pipeline contains too many actions to fit in a single Solana transaction. |
A unique key generated by the client to ensure a request is processed at most once.
Array of flywheel pipelines to compile into batch transaction.
Array of pipeline objects containing actions to execute.