Initialize Batch Transaction
Flywheel V1
Initialize Batch Transaction
This endpoint compiles flywheel pipelines into Solana transaction instructions and creates a batch transaction for approval.
POST
Initialize Batch Transaction
Overview
The Initialize Batch Transaction endpoint compiles an array of flywheel pipelines into Solana transaction instructions and creates a batch transaction that requires approval from both company and project approvers. This endpoint is used to prepare complex multi-action operations that can include token burns, airdrops, buybacks, locks, unlocks, and memo attachments. Each pipeline automatically gets a proof memo prepended to verify the authenticity of the operation based on the provided type and payload.Authentication
This endpoint requires API key authentication. The API key must have eitherburn or airdrop scopes.
To authenticate, provide your API key in the x-believe-api-key request header.
Example:
Rate Limiting
Requests to this endpoint are rate-limited to 10 requests per minute per API key.Request Body
Pipeline Object
Action Types
BURN Action
Burns a specified amount of tokens.AIRDROP Action
Sends tokens to a specified wallet address.BUYBACK Action (Coming Soon)
Executes a token buyback operation.
Note: BUYBACK action is not yet implemented.
LOCK Action (Coming Soon)
Locks tokens with vesting parameters.
Note: LOCK action is not yet implemented.
UNLOCK Action (Coming Soon)
Unlocks previously locked tokens.
Note: UNLOCK action is not yet implemented.
MEMO Action
Adds a memo message to the transaction.Example Request
Response Body
On success, the API returns a JSON object with the following fields:Example Response (Success)
Important Notes
- Proof Memos: Each pipeline automatically gets a proof memo prepended to its actions. This memo contains a hash of the type and payload for verification purposes.
- Transaction Size Limits: Each pipeline must fit within a single Solana transaction (max ~900 bytes of instruction data). Pipelines that are too large will be rejected.
-
Approval Required: The returned
proposalApproveTxmust 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. -
Action Limitations: Currently, only
BURN,AIRDROP, andMEMOactions are fully implemented.BUYBACK,LOCK, andUNLOCKactions are coming soon. -
Associated Token Accounts: For
AIRDROPactions, the endpoint automatically creates associated token accounts for recipients if they don’t exist.
Error Codes
The batch init endpoint can return specific error codes related to the compilation and validation process.Example Error Response
Authorizations
Headers
A unique key generated by the client to ensure a request is processed at most once.
Body
application/json
Array of flywheel pipelines to compile into batch transaction.
Array of pipeline objects containing actions to execute.