Skip to main content
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 either burn 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

  1. 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.
  2. 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.
  3. Approval Required: The returned 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.
  4. Action Limitations: Currently, only BURN, AIRDROP, and MEMO actions are fully implemented. BUYBACK, LOCK, and UNLOCK actions are coming soon.
  5. Associated Token Accounts: For AIRDROP actions, 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

x-believe-api-key
string
header
required

Headers

x-idempotency-key
string<uuid>
required

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.

pipelines
object[]
required

Array of pipeline objects containing actions to execute.

Response

Successful batch initialization.

proposalApproveTx
string
required

Base64-encoded serialized transaction that must be signed with your registered wallet address.

batch
object
required