How It Works
The SDK automatically handles payment responses internally. When you pass a payment callback as the second parameter tostore(), the SDK:
- Attempts the store operation
- If the server requires payment, the SDK invokes your callback with the payment quote
- Your callback executes the payment and returns the result
- The SDK automatically retries the store operation with the payment proof
Store with Payment Callback
Wait for Confirmation
ThewaitForConfirmation option ensures data is confirmed on-chain before returning:
Payment Methods
OnDB supports multiple payment methods:Method 1: Payment Callback (Recommended)
Method 2: Auto-Pay (Agent Key)
Method 3: Pre-paid via Callback
Storage Model
OnDB uses an append-only storage model. See Immutability for details on how creates, updates, and deletes work under the hood, as well as data retention policies.Next Steps
Payment Flows
Deep dive into payment options
Query Builder
Query your stored data