### InitResult Schema Source: https://believe.mintlify.app/api-reference/endpoint/flywheel/batch-current Details about the structure and properties of the InitResult schema, used to describe the outcome of setup transactions. ```APIDOC ## InitResult Schema ### Description Represents the outcome of setup transactions, including counts of total, successful, and failed transactions, along with details of successful executions and the batch index. ### Properties - **total** (number) - Total number of setup transactions processed. - **totalSuccessful** (number) - Number of setup transactions that succeeded. - **totalFailed** (number) - Number of setup transactions that failed. - **successfulExecutions** (array) - Array of successful bundle executions during setup. Each item is of type `SuccessfulExecution`. - **failedTxMsg** (string) - Error message if setup failed (optional). - **batchIndex** (number) - The batch index used in the multisig. ### Example Response ```json { "total": 10, "totalSuccessful": 10, "totalFailed": 0, "successfulExecutions": [ { "bundleId": "0xabcdef1234567890", "txHashes": [ "setup_tx1", "setup_tx2" ] } ], "batchIndex": 5 } ``` ``` -------------------------------- ### Initialize Pipeline Batch Source: https://believe.mintlify.app/api-reference/endpoint/flywheel/batch-status Initializes a new batch for a pipeline. This endpoint is used to start the setup process for a set of transactions within a pipeline. ```APIDOC ## POST /pipelines/{pipelineId}/batches ### Description Initializes a new batch for a pipeline, processing setup transactions. ### Method POST ### Endpoint /pipelines/{pipelineId}/batches ### Parameters #### Path Parameters - **pipelineId** (string) - Required - The ID of the pipeline. ### Request Body - **transactions** (array) - Required - Array of transactions to be processed in the batch. - **type** (string) - Required - Type of the transaction (e.g., 'SETUP'). - **data** (object) - Required - Transaction specific data. ### Request Example ```json { "transactions": [ { "type": "SETUP", "data": { "multisigAddress": "someAddress", "batchIndex": 1 } } ] } ``` ### Response #### Success Response (200) - **total** (number) - Total number of setup transactions processed. - **totalSuccessful** (number) - Number of setup transactions that succeeded. - **totalFailed** (number) - Number of setup transactions that failed. - **successfulExecutions** (array) - Array of successful bundle executions during setup. - **bundleId** (string) - Jito bundle ID (hex string) for this group of transactions. - **txHashes** (array) - Array of Solana transaction signatures (base58 strings) for executed transactions. - **failedTxMsg** (string) - Optional - Error message if setup failed. - **batchIndex** (number) - The batch index used in the multisig. #### Response Example ```json { "total": 10, "totalSuccessful": 10, "totalFailed": 0, "successfulExecutions": [ { "bundleId": "0xabcdef1234567890", "txHashes": [ "txHash1", "txHash2" ] } ], "batchIndex": 1 } ``` ``` -------------------------------- ### Example Proof Data Structure Source: https://believe.mintlify.app/api-reference/glossary Demonstrates the structure of proof data, which is verifiable data justifying why a flywheel action should occur. This data is recorded on-chain for transparency. ```json { "orderId": "12345", "amount": 99.99, "customerId": "user123" } ``` -------------------------------- ### E-commerce Token Utility with Burn and Airdrop (JavaScript) Source: https://believe.mintlify.app/api-reference/use-cases This JavaScript example demonstrates how to integrate token utility into an e-commerce store. It automatically burns tokens to reduce supply and airdrops loyalty tokens to customers based on purchase value. The implementation handles both individual and bulk orders, with distinct reward rates for each. Dependencies include a backend service or SDK to execute the 'executePipeline' function. ```javascript // Register flywheel (one-time setup via web app) // Configuration done at https://believe.app/projects: // - Token: ecommerce_token_123 // - Wallet: store_owner_wallet_address // - Daily Burn Limit: 50,000 tokens // - Daily Airdrop Limit: 25,000 tokens // - Scopes: burn, airdrop // - Proof Types: PRODUCT_PURCHASE, BULK_ORDER // After registration, you'll receive: const flywheelApiKey = "your_api_key_from_web_app"; const vaultAddress = "your_vault_address_from_web_app"; // Handle individual purchase async function processPurchase(order) { const burnAmount = Math.floor(order.total * 10); // 10 tokens per $1 const rewardAmount = Math.floor(order.total * 5); // 5 tokens reward per $1 const pipeline = { type: "PRODUCT_PURCHASE", payload: JSON.stringify({ orderId: order.id, customerId: order.customerId, total: order.total, products: order.items.map((item) => ({ id: item.productId, quantity: item.quantity, price: item.price, })), timestamp: new Date().toISOString(), }), actions: [ { action: "BURN", amount: burnAmount }, { action: "AIRDROP", toAddress: order.customerWallet, amount: rewardAmount, }, ], }; return await executePipeline(pipeline); } // Handle bulk orders with higher rewards async function processBulkOrder(order) { if (order.total < 1000) return processPurchase(order); // Use regular flow const burnAmount = Math.floor(order.total * 12); // Higher burn rate const rewardAmount = Math.floor(order.total * 8); // Higher reward rate const pipeline = { type: "BULK_ORDER", payload: JSON.stringify({ orderId: order.id, customerId: order.customerId, total: order.total, bulkDiscount: order.discount, timestamp: new Date().toISOString(), }), actions: [ { action: "BURN", amount: burnAmount }, { action: "AIRDROP", toAddress: order.customerWallet, amount: rewardAmount, }, { action: "MEMO", message: `Bulk order bonus: ${order.total}` }, ], }; return await executePipeline(pipeline); } ``` -------------------------------- ### Fund Vault with SOL and Project Tokens (JavaScript) Source: https://believe.mintlify.app/api-reference/getting-started This example illustrates the process of funding your flywheel's vault address with the necessary SOL for transaction fees and your project's tokens for operations like burns and airdrops. Ensure sufficient funds are deposited before executing actions. ```javascript // Send SOL for transaction fees await sendSol(vaultAddress, 10); // 10 SOL // Send your project tokens await sendTokens(vaultAddress, 1000000); // 1M tokens ``` -------------------------------- ### POST /v1/tokenomics/burn API Request Example (OpenAPI) Source: https://believe.mintlify.app/api-reference/endpoint/tokenomics/burn This snippet shows an example of a POST request to the /v1/tokenomics/burn endpoint. It includes the necessary headers, request body structure with type, proof, burnAmount, and persistOnchain parameters. This endpoint is used for burning tokens and optionally persisting the proof hash on the blockchain. ```yaml paths: /v1/tokenomics/burn: post: servers: - url: https://public.believe.app request: security: - title: apiKeyAuth parameters: header: x-believe-api-key: type: apiKey parameters: header: x-idempotency-key: schema: type: string required: true description: >- A unique key generated by the client to ensure a request is processed at most once. This is used to prevent accidental duplicate operations if a request is retried (e.g., due to a network error). format: uuid body: application/json: schemaArray: - type: object properties: type: allOf: - type: string description: >- A string identifier for the type of proof being submitted (e.g., "PRODUCT_BUY"). proof: allOf: - type: object description: A JSON object containing the actual proof data. additionalProperties: true burnAmount: allOf: - type: number format: double positive: true description: The quantity of tokens to burn. Must be a positive number. persistOnchain: allOf: - type: boolean description: >- A boolean flag indicating whether the hash of the proof should be recorded on the blockchain. requiredProperties: - type - proof - burnAmount - persistOnchain examples: example: value: type: proof: {} burnAmount: 123 persistOnchain: true description: Details for the token burn operation. response: '200': application/json: schemaArray: - type: object properties: result: allOf: - type: string description: Indicates the outcome of the operation (e.g., "SUCCESS"). hash: allOf: - type: string description: A SHA256 hash of the provided proof object. txHash: allOf: - type: string description: >- The on-chain transaction hash for the token burn, if successful. type: allOf: - type: string description: The type of proof that was processed. dateBurned: allOf: - type: string format: date-time description: >- An ISO 8601 timestamp indicating when the burn was processed. requiredProperties: - result - hash - type - txHash - dateBurned examples: example: value: result: hash: txHash: type: dateBurned: '2023-11-07T05:31:56Z' description: Successful token burn. '400': application/json: schemaArray: - type: object properties: error: allOf: - type: integer format: int32 message: allOf: - type: string requiredProperties: - error - message examples: example: value: error: 123 message: description: Bad Request - Invalid input or error during processing. '401': application/json: schemaArray: - type: object properties: error: allOf: - type: integer format: int32 message: allOf: - type: string requiredProperties: - error - message examples: example: value: error: 123 message: ``` -------------------------------- ### OpenAPI Specification for Market Summary Source: https://believe.mintlify.app/api-reference/endpoint/tokenomics/market-summary This OpenAPI specification defines the GET /v1/tokenomics/market-summary/{address} endpoint. It includes details on request parameters (token address, idempotency key), security (API key authentication), and the response structure for a successful market summary (market cap, liquidity, price, supply information) and error responses (401 Unauthorized, 404 Not Found). ```yaml GET /v1/tokenomics/market-summary/{address} paths: path: /v1/tokenomics/market-summary/{address} method: get servers: - url: https://public.believe.app request: security: - title: apiKeyAuth parameters: query: {} header: x-believe-api-key: type: apiKey cookie: {} parameters: path: address: schema: - type: string required: true description: The token address for which to retrieve market summary data. query: {} header: x-idempotency-key: schema: - type: string required: true description: >- A unique key generated by the client to ensure a request is processed at most once. format: uuid cookie: {} body: {} response: '200': application/json: schemaArray: - type: object properties: marketCap: allOf: - type: number description: The total market capitalization of the token. liquidity: allOf: - type: number description: The current liquidity available for the token. price: allOf: - type: number description: The current price of the token. totalSupply: allOf: - type: number description: The total supply of tokens that have been created. circulatingSupply: allOf: - type: number description: The number of tokens that are currently in circulation. address: allOf: - type: string description: The token address that was queried. holder: allOf: - type: number description: The total number of holders of this token. refIdentifier: '#/components/schemas/MarketSummaryResponse' requiredProperties: - marketCap - liquidity - price - totalSupply - circulatingSupply - address - holder examples: example: value: marketCap: 123 liquidity: 123 price: 123 totalSupply: 123 circulatingSupply: 123 address: holder: 123 description: Successful market summary retrieval. '401': application/json: schemaArray: - type: object properties: error: allOf: - &ref_0 type: integer format: int32 message: allOf: - &ref_1 type: string refIdentifier: '#/components/schemas/Error' requiredProperties: &ref_2 - error - message examples: example: value: error: 123 message: description: Unauthorized - API key is missing or invalid. '404': application/json: schemaArray: - type: object properties: error: allOf: - *ref_0 message: allOf: - *ref_1 refIdentifier: '#/components/schemas/Error' requiredProperties: *ref_2 examples: example: value: error: 123 message: description: Not Found - Token address not found or market data not available. deprecated: false type: path components: schemas: {} ``` -------------------------------- ### API Error Response JSON Example Source: https://believe.mintlify.app/api-reference/error-codes This JSON object demonstrates the structure of an API response when an authentication or flywheel error occurs. It includes a specific error code and a human-readable message explaining the issue. ```json { "error": "ERR_KEY_SCOPES_UNAUTHORIZED", "message": "The provided API key doesn't have the required 'burn' scope to access this endpoint" } ``` ```json { "error": "ERR_FLYWHEEL_PIPELINE_TOO_BIG", "message": "Pipeline contains too many actions to fit in a single transaction" } ``` -------------------------------- ### Construct Pipeline with Proof Data for Flywheel API Source: https://believe.mintlify.app/api-reference/proof-schema This JSON example illustrates how to structure data for a pipeline action within the Flywheel API. It includes the 'type' of proof, a 'payload' containing specific event details as a JSON string, and a list of 'actions' to be performed. ```json { "type": "WATCH_AD", "payload": "{\"adId\":\"123\",\"adProvider\":\"google\",\"platform\":\"ios\",\"userId\":\"user456\",\"completionTime\":\"2025-01-27T12:00:00Z\"}", "actions": [ { "action": "BURN", "amount": 100 }, { "action": "AIRDROP", "toAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "amount": 50 } ] } ``` -------------------------------- ### Subscription Service Flywheel Implementation in JavaScript Source: https://believe.mintlify.app/api-reference/use-cases Manages token utility for subscription services, converting payments into rewards and token value. It handles actions for subscription renewals, plan upgrades, and successful referrals by burning tokens for service value and airdropping loyalty rewards. Configuration is managed via a web app. ```javascript // Subscription flywheel (configured via web app) // Setup at https://believe.app/projects: // - Token: subscription_token_101 // - Daily Burn Limit: 30,000 tokens (monthly cycles) // - Daily Airdrop Limit: 20,000 tokens // - Proof Types: SUBSCRIPTION_RENEWAL, PLAN_UPGRADE, REFERRAL_SUCCESS // From web app registration: const subscriptionApiKey = "your_subscription_api_key"; const subscriptionVaultAddress = "your_subscription_vault_address"; async function handleSubscriptionRenewal( subscriptionId, customerId, plan, monthsRenewed ) { const burnAmount = plan.monthlyPrice * monthsRenewed * 10; const loyaltyReward = monthsRenewed * 100; // Bonus for longer commitments const pipeline = { type: "SUBSCRIPTION_RENEWAL", payload: JSON.stringify({ subscriptionId, customerId, plan: { name: plan.name, monthlyPrice: plan.monthlyPrice, features: plan.features, }, monthsRenewed, totalValue: plan.monthlyPrice * monthsRenewed, timestamp: new Date().toISOString(), }), actions: [ { action: "BURN", amount: burnAmount }, { action: "AIRDROP", toAddress: await getCustomerWallet(customerId), amount: loyaltyReward, }, ], }; return await executePipeline(pipeline); } ``` -------------------------------- ### Example Base58 Encoding Source: https://believe.mintlify.app/api-reference/glossary Illustrates the Base58 encoding format commonly used for Solana transaction signatures and addresses. This format is a character set chosen to avoid ambiguous characters. ```text 27FG487NDUAnrs79xRaycwtW3pCPb4G4664P2nFfmZkH1EEVJqmRoFEEHzXS6A6V2HsZ2bBU6QgP1JgfRx9cRPKh ``` -------------------------------- ### Social Platform Flywheel Implementation in JavaScript Source: https://believe.mintlify.app/api-reference/use-cases Handles reward distribution for social platform activities like viral posts, content creation, and engagement milestones. It uses a pipeline system to execute actions such as burning tokens and airdropping rewards based on user interactions and content quality. Configuration is managed via a web app. ```javascript // Social platform flywheel (configured via web app) // Setup at https://believe.app/projects: // - Token: social_token_789 // - Daily Burn Limit: 200,000 tokens (high engagement platform) // - Daily Airdrop Limit: 150,000 tokens // - Proof Types: POST_VIRAL, CONTENT_CREATED, ENGAGEMENT_MILESTONE // From web app registration: const socialApiKey = "your_social_api_key"; const socialVaultAddress = "your_social_vault_address"; // Handle viral content async function handleViralPost(postId, creatorId, interactions) { const burnAmount = interactions * 2; // Burn based on engagement const creatorReward = interactions * 5; // Higher reward for creator const pipeline = { type: "POST_VIRAL", payload: JSON.stringify({ postId, creatorId, interactions: { likes: interactions.likes, shares: interactions.shares, comments: interactions.comments, }, totalEngagement: interactions.total, viralThreshold: 1000, timestamp: new Date().toISOString(), }), actions: [ { action: "BURN", amount: burnAmount }, { action: "AIRDROP", toAddress: await getUserWallet(creatorId), amount: creatorReward, }, { action: "MEMO", message: `Viral content reward: ${postId}` }, ], }; return await executePipeline(pipeline); } // Handle content creation async function handleContentCreation(creatorId, contentType, quality) { const baseReward = 50; const qualityMultiplier = quality > 0.8 ? 2 : 1; // High quality bonus const rewardAmount = baseReward * qualityMultiplier; const pipeline = { type: "CONTENT_CREATED", payload: JSON.stringify({ creatorId, contentType, qualityScore: quality, timestamp: new Date().toISOString(), }), actions: [ { action: "AIRDROP", toAddress: await getUserWallet(creatorId), amount: rewardAmount, }, ], }; return await executePipeline(pipeline); } // Batch multiple engagement actions async function handleEngagementBatch(engagements) { const pipelines = engagements.map((engagement) => ({ type: "ENGAGEMENT_MILESTONE", payload: JSON.stringify({ userId: engagement.userId, milestoneType: engagement.type, value: engagement.value, timestamp: new Date().toISOString(), }), actions: [ { action: "AIRDROP", toAddress: engagement.userWallet, amount: engagement.reward, }, ], })); // Execute multiple pipelines in a single batch return await executeBatch(pipelines); } ``` -------------------------------- ### Transparent Vault Funding with JavaScript Source: https://believe.mintlify.app/api-reference/use-cases Allows anyone to contribute tokens to a project's vault and retrieve the current funding status. It requires functions like sendTokens, getTokenBalance, getSolBalance, and getCommunityContributions. The output includes token balance, SOL balance, estimated operations remaining, and community contributions. ```javascript // Anyone can contribute to power the flywheel const vaultAddress = "flywheel_vault_address_here"; // Community members can send tokens await sendTokens(vaultAddress, amount); // Project updates on funding status async function getFundingStatus() { const balance = await getTokenBalance(vaultAddress); const solBalance = await getSolBalance(vaultAddress); return { tokenBalance: balance, solBalance: solBalance, estimatedOperationsRemaining: balance / averageDailyUsage, communityContributions: await getCommunityContributions(), }; } ``` -------------------------------- ### POST /v1/flywheel/batch/init - OpenAPI Specification Source: https://believe.mintlify.app/api-reference/endpoint/flywheel/batch-init This OpenAPI specification defines the POST /v1/flywheel/batch/init endpoint. It includes details on server URL, request security (apiKeyAuth), required headers (x-idempotency-key), request body schema for batch initialization, and various response codes (200, 400, 401, 404, 500) with their respective schemas and descriptions. ```yaml paths: path: /v1/flywheel/batch/init method: post servers: - url: https://public.believe.app request: security: - title: apiKeyAuth parameters: query: {} header: x-believe-api-key: type: apiKey cookie: {} parameters: path: {} query: {} header: x-idempotency-key: schema: - type: string required: true description: >- A unique key generated by the client to ensure a request is processed at most once. format: uuid cookie: {} body: application/json: schemaArray: - type: object properties: pipelines: allOf: - type: array description: Array of pipeline objects containing actions to execute. items: $ref: '#/components/schemas/Pipeline' required: true refIdentifier: '#/components/schemas/BatchInitRequest' requiredProperties: - pipelines examples: example: value: pipelines: - type: payload: actions: - action: BURN amount: 123 description: Array of flywheel pipelines to compile into batch transaction. response: '200': application/json: schemaArray: - type: object properties: proposalApproveTx: allOf: - type: string description: >- Base64-encoded serialized transaction that must be signed with your registered wallet address. batch: allOf: - $ref: '#/components/schemas/BatchObject' refIdentifier: '#/components/schemas/BatchInitResponse' requiredProperties: - proposalApproveTx - batch examples: example: value: proposalApproveTx: batch: id: flywheelId: status: AVAILABLE_TO_QUEUE pipelines: - type: payload: actions: - action: BURN amount: 123 instructions: - dateCreated: '2023-11-07T05:31:56Z' description: Successful batch initialization. '400': application/json: schemaArray: - type: object properties: error: allOf: - type: integer format: int32 message: allOf: - type: string refIdentifier: '#/components/schemas/Error' requiredProperties: - error - message examples: example: value: error: 123 message: description: Bad Request - Invalid input or compilation error. '401': application/json: schemaArray: - type: object properties: error: allOf: - type: integer format: int32 message: allOf: - type: string refIdentifier: '#/components/schemas/Error' requiredProperties: - error - message examples: example: value: error: 123 message: description: Unauthorized - API key is missing or invalid. '404': application/json: schemaArray: - type: object properties: error: allOf: - type: integer format: int32 message: allOf: - type: string refIdentifier: '#/components/schemas/Error' requiredProperties: - error - message examples: example: value: error: 123 message: description: Not Found - Token or flywheel not found. '500': application/json: schemaArray: - type: object properties: error: allOf: - type: integer format: int32 message: allOf: - type: string refIdentifier: '#/components/schemas/Error' requiredProperties: - error - message examples: example: value: error: 123 message: ``` -------------------------------- ### GET /v1/tokenomics/market-summary/{address} Source: https://believe.mintlify.app/api-reference/endpoint/tokenomics/market-summary Retrieves comprehensive market data for a specified token address, including market cap, liquidity, price, and supply information. ```APIDOC ## GET /v1/tokenomics/market-summary/{address} ### Description Retrieves comprehensive market data for a specified token address, including market cap, liquidity, price, and supply information. ### Method GET ### Endpoint https://public.believe.app/v1/tokenomics/market-summary/{address} ### Parameters #### Path Parameters - **address** (string) - Required - The token address for which to retrieve market summary data. #### Query Parameters None #### Header Parameters - **x-believe-api-key** (apiKey) - Required - Your Believe API key. - **x-idempotency-key** (string) - Required - A unique key generated by the client to ensure a request is processed at most once. (Format: uuid) ### Request Body None ### Response #### Success Response (200) - **marketCap** (number) - The total market capitalization of the token. - **liquidity** (number) - The current liquidity available for the token. - **price** (number) - The current price of the token. - **totalSupply** (number) - The total supply of tokens that have been created. - **circulatingSupply** (number) - The number of tokens that are currently in circulation. - **address** (string) - The token address that was queried. - **holder** (number) - The total number of holders of this token. #### Response Example (200) ```json { "marketCap": 123, "liquidity": 123, "price": 123, "totalSupply": 123, "circulatingSupply": 123, "address": "", "holder": 123 } ``` #### Error Response (401) - **error** (integer) - Error code. - **message** (string) - Error message. #### Response Example (401) ```json { "error": 123, "message": "" } ``` #### Error Response (404) - **error** (integer) - Error code. - **message** (string) - Error message. #### Response Example (404) ```json { "error": 123, "message": "" } ``` ``` -------------------------------- ### API Workflow Source: https://believe.mintlify.app/index The step-by-step process for interacting with the Believe API, from registration to monitoring execution results. ```APIDOC ## API Workflow 1. **Register**: Set up your flywheel via the Believe web app with token details, wallet addresses, daily limits, and proof schemas. 2. **Initialize**: Create batch transactions with your desired pipeline actions. 3. **Approve**: Sign the proposal transaction with your registered wallet. 4. **Execute**: Process the approved batch and receive detailed execution results. 5. **Monitor**: Track batch status and retrieve transaction details. ``` -------------------------------- ### GET /v1/flywheel/batch/{batchId} Source: https://believe.mintlify.app/api-reference/endpoint/flywheel/batch-status Retrieves the status of a specific batch identified by its UUID. ```APIDOC ## GET /v1/flywheel/batch/{batchId} ### Description Retrieves the status of a specific batch identified by its UUID. ### Method GET ### Endpoint https://public.believe.app/v1/flywheel/batch/{batchId} ### Parameters #### Path Parameters - **batchId** (string) - Required - The UUID of the batch to retrieve status for. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **id** (string) - The unique batch identifier (UUID). - **flywheelId** (string) - The flywheel this batch belongs to. - **tokenId** (string) - The token ID associated with this batch. - **mintAddress** (string) - The Solana mint address for the token. - **status** (string) - Current batch status. Enum: AVAILABLE_TO_QUEUE, FINALIZED, EXECUTED, FAILED. - **batchIndex** (string) - The multisig batch index used for execution. - **vaultIndex** (string) - The vault index within the multisig. - **multisig** (string) - The multisig wallet address. - **vaultAddress** (string) - The vault address for token operations. - **initResult** (object) - Results from the batch initialization process (optional). - **executeResult** (object) - Results from the batch execution process (optional). - **dateCreated** (string) - ISO 8601 timestamp when the batch was created. - **dateUpdated** (string) - ISO 8601 timestamp when the batch was last updated. #### Response Example ```json { "id": "", "flywheelId": "", "tokenId": "", "mintAddress": "", "status": "AVAILABLE_TO_QUEUE", "batchIndex": "", "vaultIndex": "", "multisig": "", "vaultAddress": "", "initResult": { "total": 123, "totalSuccessful": 123, "totalFailed": 123, "successfulExecutions": [ { "bundleId": "", "txHashes": [ "" ] } ], "failedTxMsg": "", "batchIndex": 123 }, "executeResult": { "total": 123, "totalSuccessful": 123, "totalFailed": 123, "successfulExecutions": [ { "bundleId": "", "txHashes": [ "" ] } ], "failedOnTransactionIndex": 123, "failedStartTransactionIndex": 123, "failedTxMsg": "" }, "dateCreated": "2023-11-07T05:31:56Z", "dateUpdated": "2023-11-07T05:31:56Z" } ``` #### Error Response (401) - **error** (integer) - Error code. - **message** (string) - Error message. ``` -------------------------------- ### Initialize Batch Source: https://believe.mintlify.app/api-reference/getting-started Initializes a batch transaction for executing multiple flywheel actions. This step compiles your pipelines and generates an approval transaction. ```APIDOC ## POST /flywheel/batch/init ### Description Initializes a batch transaction for executing flywheel actions. Compiles pipelines and generates an approval transaction for validation. ### Method POST ### Endpoint `https://public.believe.app/v1/flywheel/batch/init` ### Parameters #### Query Parameters * **apiKey** (string) - Required - Your generated API key for authentication. #### Request Body * **pipelines** (array) - Required - An array of pipeline configurations to be included in the batch. * Example: `[{"action": "burn", "amount": 10, "proof": {"type": "purchase", "details": {"orderId": "12345"}}}]` ### Request Example ```json { "pipelines": [ { "action": "burn", "amount": 10, "proof": { "type": "purchase", "details": {"orderId": "12345"} } } ] } ``` ### Response #### Success Response (200) - **batchId** (string) - The unique identifier for the initialized batch. - **approvalTransaction** (string) - The transaction data that needs to be signed for approval. #### Response Example ```json { "batchId": "b7a1c3d9-e5f8-4a0b-8c1d-2e3f4a9b8c7d", "approvalTransaction": "0x...signed_transaction_data..." } ``` ``` -------------------------------- ### Initialize Flywheel Batch Source: https://context7.com/context7/believe_mintlify_app/llms.txt Creates a batch transaction containing one or more pipelines with token actions, compiling them into Solana transaction instructions and returning an approval transaction to sign. ```APIDOC ## POST /v1/flywheel/batch/init ### Description Creates a batch transaction containing one or more pipelines with token actions, compiling them into Solana transaction instructions and returning an approval transaction to sign. ### Method POST ### Endpoint https://public.believe.app/v1/flywheel/batch/init ### Parameters #### Headers - **x-believe-api-key** (string) - Required - Your API key. - **x-idempotency-key** (string) - Required - An idempotency key to prevent duplicate requests. #### Request Body - **pipelines** (array) - Required - An array of pipeline configurations. - **type** (string) - Required - The type of pipeline (e.g., "PRODUCT_PURCHASE"). - **payload** (string) - Required - A JSON string containing payload data for the pipeline. - **actions** (array) - Required - An array of token actions to perform. - **action** (string) - Required - The type of action (e.g., "BURN", "AIRDROP"). - **amount** (integer) - Required - The amount of tokens to act upon. - **toAddress** (string) - Optional - The recipient address for airdrop actions. ### Request Example ```json { "pipelines": [ { "type": "PRODUCT_PURCHASE", "payload": "{\"orderId\":\"order_12345\",\"customerId\":\"user_789\",\"amount\":99.99,\"timestamp\":\"2025-10-08T12:00:00Z\"}", "actions": [ { "action": "BURN", "amount": 1000 }, { "action": "AIRDROP", "toAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "amount": 500 } ] } ] } ``` ### Response #### Success Response (200) - **proposalApproveTx** (string) - The transaction to approve for the batch. - **batch** (object) - Details about the created batch. - **id** (string) - The unique identifier for the batch. - **flywheelId** (string) - The identifier of the associated flywheel. - **status** (string) - The current status of the batch (e.g., "AVAILABLE_TO_QUEUE"). - **pipelines** (array) - The pipelines included in the batch. - **dateCreated** (string) - The timestamp when the batch was created. #### Response Example ```json { "proposalApproveTx": "AQAAAAAAAAAAAAABAAEDAQIDBAUGBwgJ...", "batch": { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "flywheelId": "flywheel_abc123", "status": "AVAILABLE_TO_QUEUE", "pipelines": [...], "dateCreated": "2025-10-08T12:00:00Z" } } ``` ``` -------------------------------- ### POST /v1/flywheel/batch/init Source: https://believe.mintlify.app/api-reference/endpoint/flywheel/batch-init Initializes a batch of flywheel pipelines into a transaction. This endpoint requires an API key for authentication and an idempotency key to ensure unique request processing. ```APIDOC ## POST /v1/flywheel/batch/init ### Description Initializes a batch of flywheel pipelines. Clients provide an array of pipeline objects, and the API returns a transaction to be approved and a batch object representing the initialized batch. ### Method POST ### Endpoint https://public.believe.app/v1/flywheel/batch/init ### Parameters #### Path Parameters None #### Query Parameters None #### Header Parameters - **x-idempotency-key** (string) - Required - A unique key generated by the client to ensure a request is processed at most once. Format: uuid - **x-believe-api-key** (apiKey) - Required - Your Believe API key for authentication. #### Request Body - **pipelines** (array) - Required - Array of pipeline objects containing actions to execute. - **type** (string) - Description for pipeline type. - **payload** (string) - Description for pipeline payload. - **actions** (array) - Array of actions to perform. - **action** (string) - Type of action (e.g., BURN). - **amount** (integer) - The amount for the action. ### Request Example ```json { "pipelines": [ { "type": "", "payload": "", "actions": [ { "action": "BURN", "amount": 123 } ] } ] } ``` ### Response #### Success Response (200) - **proposalApproveTx** (string) - Base64-encoded serialized transaction that must be signed with your registered wallet address. - **batch** (object) - A BatchObject containing details of the initialized batch. - **id** (string) - **flywheelId** (string) - **status** (string) - e.g., AVAILABLE_TO_QUEUE - **pipelines** (array) - Array of pipeline objects. - **dateCreated** (string) - ISO 8601 format date string. #### Response Example (200) ```json { "proposalApproveTx": "", "batch": { "id": "", "flywheelId": "", "status": "AVAILABLE_TO_QUEUE", "pipelines": [ { "type": "", "payload": "", "actions": [ { "action": "BURN", "amount": 123 } ], "instructions": [ "" ] } ], "dateCreated": "2023-11-07T05:31:56Z" } } ``` #### Error Responses - **400 Bad Request**: Invalid input or compilation error. - **401 Unauthorized**: API key is missing or invalid. - **404 Not Found**: Token or flywheel not found. - **500 Internal Server Error**: Server error. #### Error Response Example ```json { "error": 123, "message": "" } ``` ``` -------------------------------- ### Get Current Batch Source: https://believe.mintlify.app/api-reference/endpoint/flywheel/batch-current Retrieves the currently active flywheel batch for a specific token, if one exists. ```APIDOC ## GET /websites/believe_mintlify_app/current-batch ### Description This endpoint retrieves the currently active flywheel batch for a specific token, if one exists. ### Method GET ### Endpoint /websites/believe_mintlify_app/current-batch ### Parameters #### Query Parameters - **token** (string) - Required - The token to identify the flywheel batch. ### Response #### Success Response (200) - **batch_id** (string) - The ID of the active batch. - **status** (string) - The status of the active batch. ``` -------------------------------- ### Core API Concepts Source: https://believe.mintlify.app/index Overview of the Believe API's core concepts including Flywheel Mechanics, Actions, Batched Actions, Pipelines, and the Proof Mechanism. ```APIDOC ## Flywheel Mechanics A flywheel is a self-reinforcing cycle where certain triggers or developments in a crypto project lead to further positive developments, creating a positive feedback loop. The Believe Flywheel API can be triggered by projects over pre-configured events, with base coins powering API invocations. ### Security Architecture **Multi-Signature Protection**: Base coins are secured within a multisignature wallet requiring signatures from both Believe’s approver wallet and Your project’s approver wallet. This dual-approval mechanism prevents exploitation of flywheel actions and ensures secure coin operations. **Daily Limits**: Configurable daily maximum caps regulate the amount of base coins impacted by flywheel actions, providing additional protection against misuse. **Public Transparency**: The vault address is publicly exposed, allowing community participation in powering your project’s flywheel. ## Flywheel Components ### Actions Individual operations that can be executed using base coins: * **Burn**: Permanently remove coins from circulation * **Airdrop**: Distribute coins to specified addresses * **Buyback** _(Coming Soon)_: Repurchase coins from the market * **Lock** _(Coming Soon)_: Secure coins with vesting parameters * **Unlock** _(Coming Soon)_: Release previously locked coins * **Memo**: Attach proof data to transactions ### Batched Actions Execute multiple actions of the same type together as a single batch operation for efficiency and cost optimization. ### Pipelines Chain multiple different actions together (e.g., Buyback → Burn → Airdrop) in a single atomic operation, enabling sophisticated tokenomic strategies. ### Proof Mechanism Every flywheel action includes a memo containing JSON proof data from your application, providing auditability, transparency, and compliance. ```