### Getting Started - First API Call Source: https://docs.onebalance.io/guides/solana/overview A guide to making your first API call to OneBalance, including setup and basic usage. ```APIDOC ## POST /api/v1/send ### Description This guide walks you through making your first API call to the OneBalance platform. It covers the necessary setup and demonstrates a basic transaction request. ### Method POST ### Endpoint /api/v1/send ### Parameters #### Request Body - **chain** (string) - Required - The blockchain network to send the transaction to (e.g., 'ethereum', 'polygon'). - **to** (string) - Required - The recipient's address. - **value** (string) - Required - The amount to send (in wei for Ethereum-based chains). - **data** (string) - Optional - Additional data for the transaction (e.g., for smart contract interaction). ### Request Example ```json { "chain": "ethereum", "to": "0xrecipientaddress", "value": "1000000000000000000", "data": "0x" } ``` ### Response #### Success Response (200) - **transaction_hash** (string) - The hash of the submitted transaction. - **status** (string) - The status of the transaction submission (e.g., 'submitted'). #### Response Example ```json { "transaction_hash": "0xtransactionhash123", "status": "submitted" } ``` ``` -------------------------------- ### EIP-7702 Getting Started Guide - MDX Content Source: https://docs.onebalance.io/guides/eip-7702/getting-started Extracts MDX content for the 'Getting Started with EIP-7702' guide, focusing on implementing cross-chain contract calls. It includes details on prerequisites, account configuration, and a step-by-step process for preparing quotes, signing delegations, and executing calls. ```javascript const {jsx: _jsx} = arguments[0]; const {useMDXComponents: _provideComponents} = arguments[0]; function _createMdxContent(props) { const _components = { p: "p", ..._provideComponents(), ...props.components }; return _jsx(_components.p, { children: "Implement cross-chain contract calls using EIP-7702 delegation" }); } function MDXContent(props = {}) { const {wrapper: MDXLayout} = { ..._provideComponents(), ...props.components }; return MDXLayout ? _jsx(MDXLayout, { ...props, children: _jsx(_createMdxContent, { ...props }) }) : _createMdxContent(props); } return { default: MDXContent }; ``` -------------------------------- ### JavaScript: OneBalance Examples Link Source: https://docs.onebalance.io/guides/eip-7702/getting-started Provides a direct link to the OneBalance Examples repository on GitHub, specifically highlighting the EIP-7702 examples which include signature handling, multi-chain operations, and error recovery patterns. ```javascript OneBalance Examples - EIP-7702 ``` -------------------------------- ### Getting Started - Introduction Source: https://docs.onebalance.io/getting-started/introduction An introductory guide to using the OneBalance Toolkit for simplified onchain interactions, abstracting away complexity. ```APIDOC ## Getting Started - Introduction ### Description This guide introduces the OneBalance Toolkit, focusing on how to eliminate complexities like chains, bridges, and gas fees for seamless user experiences. ### Method GET ### Endpoint /getting-started/introduction ### Parameters No parameters are required. ### Request Example GET /getting-started/introduction ### Response #### Success Response (200) Provides an overview of the initial steps to get started with OneBalance. #### Response Example ```json { "title": "Introduction to OneBalance", "description": "Learn how to get started with the OneBalance Toolkit to begin removing onchain complexity like chains, bridges and gas in your app." } ``` ``` -------------------------------- ### Clone and Run Demo Repository (Shell) Source: https://docs.onebalance.io/getting-started/setup This script clones the OneBalance-Privy demo repository, installs dependencies using pnpm, copies environment variables, and starts the development server. It's a quick way to get started with the integration. ```shell # Clone the repository git clone https://github.com/OneBalance-io/onebalance-privy-demo.git cd onebalance-privy-demo # Install dependencies pnpm install # Copy environment variables cp .env.example .env # Start the development server pnpm dev ``` -------------------------------- ### Guides - Solana Getting Started Source: https://docs.onebalance.io/api-reference/status/get-tx-history-v3 Step-by-step instructions to get started with Solana integration. ```APIDOC ## Guides - Solana Getting Started ### Description Follow these steps to start integrating with the Solana blockchain using the OneBalance API. This guide covers setting up your environment and making your first Solana-related API calls. ### Prerequisites - An active OneBalance API key. - Basic understanding of Solana concepts. ### Steps 1. **Obtain API Key**: Ensure you have a valid API key. 2. **Identify Solana Chain ID**: Find the appropriate chain ID for Solana. 3. **Make your first API call**: Use an endpoint like `/api-reference/chains/list` to verify connectivity and retrieve chain information. ``` -------------------------------- ### Getting Started - Your First API Call Source: https://docs.onebalance.io/getting-started/introduction A guide to making your initial OneBalance API call, including setting up a smart contract account for chain-abstracted, gasless transactions. ```APIDOC ## Your First API Call ### Description Learn the process of making your first API call to OneBalance. This guide covers setting up a smart contract account for seamless, chain-abstracted, and gasless transactions. ### Method GET ### Endpoint /getting-started/first-api-call ### Parameters No parameters are required. ### Request Example GET /getting-started/first-api-call ### Response #### Success Response (200) Provides a tutorial for making the first API call. #### Response Example ```json { "title": "Your First API Call", "description": "Learn to make your first OneBalance API call by setting up a smart contract account for chain-abstracted, gasless, cross-chain transactions." } ``` ``` -------------------------------- ### Project Setup and Dependency Installation Source: https://context7_llms This script outlines the steps to set up a project locally. It involves cloning a Git repository, navigating into the project directory, and installing the necessary dependencies using the 'pnpm' package manager. This is a common workflow for starting new projects or setting up development environments. ```bash # Clone the repository git clone https://github.com/OneBalance-io/onebalance-privy-demo.git cd onebalance-privy-demo # Install dependencies pnpm install ``` -------------------------------- ### Install Dependencies and Run EIP-7702 Example Source: https://github.com/OneBalance-io/onebalance-examples/tree/main/eip-7702 This command sequence installs the necessary project dependencies using pnpm and then executes the EIP-7702 example. Ensure you have Node.js and pnpm installed to run these commands. ```shell # From root directory pnpm install pnpm run eip-7702 ``` -------------------------------- ### Getting Started - Set Up Your Environment Source: https://docs.onebalance.io/concepts/aggregated-assets Guide to setting up your development environment with OneBalance and Privy for an embedded wallet experience. ```APIDOC ## Set Up Your Environment ### Description Set up your development environment with OneBalance and Privy by configuring keys and settings for an enhanced embedded wallet experience. ### Endpoint /getting-started/setup ``` -------------------------------- ### Installing Dependencies and Starting Development Server Source: https://github.com/dzimiks/onebalance-chain-abstracted-swap These commands are used to manage project dependencies and run the development server. `pnpm install` installs all necessary packages, while `pnpm dev` starts the local development environment, allowing for real-time testing and iteration. ```shell pnpm install pnpm dev ``` -------------------------------- ### Solana Getting Started Example Source: https://docs.onebalance.io/guides/slippage/examples Get your first Solana cross-chain swap working in 5 minutes with this complete working example. ```Solana Get your first Solana cross-chain swap working in 5 minutes with this complete working example ``` -------------------------------- ### Clone and Run OneBalance Privy Demo Source: https://docs.onebalance.io/getting-started/setup This shell script demonstrates how to clone the OneBalance Privy demo repository, navigate into it, install dependencies using pnpm, and copy environment variables. It's a quick way to get started with the integrated solution. ```shellscript # Clone the repository git clone https://github.com/OneBalance-io/onebalance-privy-demo.git cd onebalance-privy-demo # Install dependencies pnpm install # Copy environment variables ``` -------------------------------- ### Getting Started - Introduction Source: https://docs.onebalance.io/concepts/aggregated-assets An introduction to getting started with the OneBalance Toolkit, focusing on removing blockchain complexity. ```APIDOC ## Getting Started - Introduction ### Description Learn how to get started with the OneBalance Toolkit to begin removing onchain complexity like chains, bridges and gas in your app. ### Endpoint /getting-started/introduction ``` -------------------------------- ### OneBalance API - Getting Started and Verification Source: https://docs.onebalance.io/guides/solana/troubleshooting This section details how to get started with the OneBalance API, including how to obtain and use public API keys for testing and how to verify enablement by checking balances. ```APIDOC ## OneBalance API - Getting Started and Verification ### Description This section outlines the initial steps for interacting with the OneBalance API. It covers contacting support for specific enablement, using a public API key for testing, and performing a basic balance check to verify integration. ### Contact Support For enablement or any support-related queries, please reach out via email to `support@onebalance.io`. Ensure you include your API key prefix (first 6 characters) and specify "Solana enablement" in your request. ### Public API Key for Testing Use the following public API key for development and testing purposes: ```shell x-api-key: 42bb629272001ee1163ca0dbbbc07bcbb0ef57a57baf16c4b1d4672db4562c11 ``` **Note:** This public key has rate limits and should not be used in production environments. ### Verify Enablement Confirm your integration by performing a simple balance check: ```shell curl -X GET 'https://be.onebalance.io/api/v3/balances/aggregated-balance?account=solana:J5CCzBULFax899tcirb6wMbenQUd8whbaetG7EfSick5&aggregatedAssetId=ob:sol' \ -H 'x-api-key: YOUR_API_KEY' ``` ### Common Operation Issues #### Insufficient Balance If you encounter an "Insufficient Balance" error, it indicates that the account making the request does not have enough funds for the requested operation. Review the account balance and ensure sufficient funds are available. ``` -------------------------------- ### Install Dependencies and Run Example (Shell) Source: https://github.com/OneBalance-io/onebalance-examples/tree/main/onebalance-calldata This snippet provides shell commands to install project dependencies using 'pnpm install' and then execute an example using 'pnpm calldata'. It's a common pattern for setting up and running Node.js projects managed with pnpm. ```shell # Install dependencies pnpm install # Run the example pnpm calldata ``` -------------------------------- ### Getting Started with Contract Calls Source: https://docs.onebalance.io/api-reference/chains/list Learn to execute smart contract calls with OneBalance by preparing call data, signing, and submitting transactions across different blockchains. This guide covers the initial steps. ```markdown ## How to Execute Smart Contract Calls Learn to execute smart contract calls with OneBalance by preparing call data, signing, and submitting transactions across chains. ``` -------------------------------- ### Run OneBalance Examples with PNPM Source: https://github.com/OneBalance-io/onebalance-examples Instructions to install dependencies and run OneBalance API examples using PNPM. Includes commands for running 'calldata' and 'eip-7702' examples. ```shell # Install dependencies pnpm install # Run the calldata example pnpm calldata # Run the EIP-7702 example pnpm eip-7702 ``` -------------------------------- ### Solana Cross-Chain Swap - Getting Started Source: https://docs.onebalance.io/api-reference/quotes/get-call-quote-v3 Get your first Solana cross-chain swap working in 5 minutes with this complete working example. This guide simplifies the initial setup for Solana integration. ```javascript console.log("// Solana cross-chain swap example\n// Refer to /guides/solana/getting-started for a complete working example."); ``` -------------------------------- ### Turnkey Integration Example Source: https://docs.onebalance.io/getting-started/setup Guidance on integrating the Turnkey platform with the OneBalance API for streamlined operations. ```text/plain https://github.com/OneBalance-io/integration-examples/tree/turnkey/turnkey ``` -------------------------------- ### API Reference - Introduction Source: https://docs.onebalance.io/getting-started/setup An introduction to the OneBalance API, detailing its capabilities and how to get started with integrating chain-abstracted transactions. ```APIDOC ## Introduction to OneBalance API ### Description Welcome to the OneBalance API Reference. This documentation will guide you through using our API to build chain-abstracted, cross-chain applications. You can leverage our platform to simplify complex blockchain interactions for your users. ### Key Features * **Chain Abstraction:** Interact with multiple blockchains seamlessly. * **Gas Abstraction:** Abstract away gas fees for a smoother user experience. * **Cross-Chain Transactions:** Facilitate transactions across different networks. ### Getting Started 1. **Obtain an API Key:** Refer to the 'Get API Key' documentation. 2. **Integrate SDKs:** Use our provided SDKs for your preferred programming language. 3. **Make your first API call:** Start by creating a smart contract account and executing a simple transaction. ``` -------------------------------- ### Call to Action Buttons: Get Started and View Components Source: https://ui.shadcn.com/ This code block renders two prominent call-to-action buttons: 'Get Started' and 'View Components'. 'Get Started' likely links to installation or setup instructions, while 'View Components' directs users to a library of available UI elements. ```JSX ["$","div",null,{ "className": "flex w-full items-center justify-center gap-2 pt-2 **:data-[slot=button]:shadow-none", "children": [ [ "$", "$La", null, { "href": "/docs/installation", "children": "Get Started", "data-slot": "button", "className": "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive bg-primary text-primary-foreground hover:bg-primary/90 h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5", "ref": null } ], [ "$", "$La", null, { "href": "/docs/components", "children": "View Components", "data-slot": "button", "className": "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5", "ref": null } ] ] }] ``` -------------------------------- ### Solana Cross-chain Swap Example Source: https://docs.onebalance.io/guides/contract-calls/examples A complete, working example to get your first Solana cross-chain swap operational within minutes using the OneBalance API. This guide simplifies the initial setup and execution. ```Example // Working code example for a Solana cross-chain swap // Covers setup and execution for a quick start. ``` -------------------------------- ### Getting Started - Set Up Your Environment Source: https://docs.onebalance.io/getting-started/introduction Instructions for setting up your development environment with OneBalance and Privy for an enhanced embedded wallet experience. ```APIDOC ## Set Up Your Environment ### Description Configure your development environment with OneBalance and Privy. This guide covers setting up keys and essential configurations for an optimal embedded wallet experience. ### Method GET ### Endpoint /getting-started/setup ### Parameters No parameters are required. ### Request Example GET /getting-started/setup ### Response #### Success Response (200) Provides setup instructions for the development environment. #### Response Example ```json { "title": "Set Up Your Environment", "description": "Set up your development environment with OneBalance and Privy by configuring keys and settings for an enhanced embedded wallet experience." } ``` ``` -------------------------------- ### Solana Cross-Chain Swap Example Source: https://docs.onebalance.io/getting-started/setup A complete, working example to get your first Solana cross-chain swap operational within minutes using the OneBalance API. ```text/plain /guides/solana/getting-started ``` -------------------------------- ### Solana Cross-Chain Swap Example Source: https://docs.onebalance.io/api-reference/quotes/prepare-call-quote Get your first Solana cross-chain swap working in 5 minutes with this complete working example. This guide simplifies the initial setup for Solana integration. ```text This guide provides a step-by-step walkthrough to quickly set up and execute a cross-chain swap involving Solana. It focuses on a practical, hands-on approach to get users started with OneBalance's Solana capabilities. ``` -------------------------------- ### Clone and Run Demo Repository Source: https://docs.onebalance.io/getting-started/setup This shell script provides instructions to clone the OneBalance-Privy demo repository, install dependencies, set up environment variables, and start the development server. It's a quick way to explore the integration. ```shellscript # Clone the repository git clone https://github.com/OneBalance-io/onebalance-privy-demo.git cd onebalance-privy-demo # Install dependencies pnpm install # Copy environment variables cp .env.example .env # Start the development server pnpm dev ``` -------------------------------- ### Executing Smart Contract Calls Cross-Chain Source: https://docs.onebalance.io/guides/quotes/examples This guide explains how to execute smart contract calls across different blockchains using the OneBalance Toolkit. It covers preparing call data, signing transactions, and submitting them. ```javascript async function executeContractCall(callData, chainId, wallet) { // Prepare transaction details const tx = { to: '0xContractAddress', data: callData, value: '0x0', gasLimit: '0x55940' }; // Sign and send transaction const txResponse = await wallet.sendTransaction(tx, chainId); console.log('Transaction sent:', txResponse.hash); return txResponse; } ``` -------------------------------- ### Overview - Onboarding Checklist Source: https://docs.onebalance.io/getting-started/introduction A step-by-step guide to help developers onboard with OneBalance, from initial setup to production deployment. ```APIDOC ## Onboarding Checklist ### Description Follow this checklist to ensure a smooth onboarding experience with OneBalance, covering everything from initial setup to deploying your application. ### Method GET ### Endpoint /overview/onboarding-checklist ### Parameters No parameters are required. ### Request Example GET /overview/onboarding-checklist ### Response #### Success Response (200) Provides a structured checklist for the OneBalance onboarding process. #### Response Example ```json { "title": "Onboarding Checklist", "description": "Step-by-step onboarding checklist for building with OneBalance, from your first API call to deploying an app in production." } ``` ``` -------------------------------- ### EIP-7702 Getting Started Guide Source: https://docs.onebalance.io/api-reference/status/get-transaction-history This guide demonstrates how to implement cross-chain contract calls using EIP-7702 delegation. It covers the necessary steps for setting up and executing these calls, which are crucial for cross-chain operations. ```markdown ## Getting Started with EIP-7702 This guide will walk you through the process of implementing cross-chain contract calls using EIP-7702 delegation. EIP-7702 allows your Externally Owned Accounts (EOAs) to delegate execution authority to smart contracts, enabling seamless cross-chain interactions. **Prerequisites:** * A basic understanding of Ethereum smart contracts and transactions. * The OneBalance SDK installed in your project. **Steps:** 1. **Prepare Call Data:** Construct the necessary data for your smart contract call. 2. **Sign Transaction:** Sign the transaction using your EOA, delegating execution to the target contract. 3. **Submit Transaction:** Submit the signed transaction to the blockchain network. **Example Snippet (Conceptual): ```javascript // Assuming you have initialized the OneBalance SDK const onebalance = new OneBalance(apiKey); async function executeCrossChainCall() { const contractAddress = "0x..."; // Address of the target smart contract const functionSignature = "myFunction(uint256)"; // Function to call const args = [123]; // Arguments for the function const targetChainId = 1; // Chain ID of the target network // Prepare the call data const callData = onebalance.utils.encodeFunctionCall(functionSignature, args); // Create the EIP-7702 transaction const tx = { to: contractAddress, data: callData, // Other EIP-7702 specific fields... }; // Sign and submit the transaction (details depend on SDK implementation) const receipt = await onebalance.sendTransaction(tx, { chainId: targetChainId }); console.log("Transaction receipt:", receipt); } executeCrossChainCall(); ``` **Note:** The actual implementation will depend on the specific methods provided by the OneBalance SDK. ``` -------------------------------- ### EIP-7702 Overview and Getting Started with Cross-Chain Operations Source: https://docs.onebalance.io/api-reference Learn about EIP-7702, which enables EOAs to delegate execution to smart contracts for cross-chain operations. Includes getting started guide for implementing cross-chain contract calls using EIP-7702 delegation. ```markdown ## EIP-7702 Overview Enable EOAs to delegate execution to smart contracts for cross-chain operations. ## Getting Started with EIP-7702 Implement cross-chain contract calls using EIP-7702 delegation. ``` -------------------------------- ### Display Next Steps Source: https://docs.onebalance.io/getting-started/setup Provides guidance to the user on the subsequent actions required after a changelog item has been successfully created. It lists steps like editing the new file and updating descriptions in the main changelog. ```javascript const showNextSteps = (filePath) => {\ console.log(`\ 🎉 Changelog item created successfully!`);\ console.log(`\ Next steps:`);\ console.log(`1. Edit ${filePath} to add your content`);\ console.log(`2. Update the brief description in ${MAIN_CHANGELOG_FILE}`);\ console.log(`3. Optionally update the image URL`);\ }; ``` -------------------------------- ### cURL: POST Request Example Source: https://docs.onebalance.io/guides/eip-7702/getting-started This is an example of a cURL command used to make a POST request. It specifies the HTTP method and the content type. ```shellscript curl -X POST \ -H "Content-Type: application/json" \ http://localhost:8000/v1/chat/completions ``` -------------------------------- ### API Reference Introduction Source: https://docs.onebalance.io/api-reference/quotes/get-quote General information and getting started guide for the OneBalance API. ```APIDOC ## API Reference ### Description This section provides the full API reference for OneBalance, covering all available endpoints and their functionalities. ### Endpoint https://docs.onebalance.io/api-reference/introduction ``` -------------------------------- ### Introduction Source: https://docs.privy.io/wallets/using-wallets/ethereum/sign-7702-authorization Getting started with the Privy REST API, including setup and basic usage. ```APIDOC ## Introduction to Privy REST API ### Description This section provides an overview of how to get started with the Privy REST API. It covers essential information for making your first API calls and understanding the core concepts. ### Endpoint /api-reference/introduction ``` -------------------------------- ### Start Development Server Source: https://docs.onebalance.io/getting-started/setup This script starts the development server for the OneBalance project using pnpm. It assumes a Node.js environment with pnpm installed. ```shell pnpm dev ``` -------------------------------- ### Solana Cross-Chain Swap Example Source: https://docs.onebalance.io/api-reference/quotes/get-call-quote Provides a complete, working example to get your first Solana cross-chain swap operational within 5 minutes. This guide focuses on practical implementation for Solana integration with OneBalance. ```bash # Example command for Solana cross-chain swap setup # (Actual code would be more complex and language-specific) solana config set-keypair ~/.config/solana/id.json solana program deploy path/to/your/program.so --url mainnet ``` -------------------------------- ### EIP-7702 vs. Role-Based Accounts Comparison Source: https://docs.onebalance.io/guides/eip-7702/getting-started Compares key aspects of Kernel v3.3 (EIP-7702) accounts against Role-Based accounts, highlighting differences in signing methods, address management, EntryPoint requirements, and delegation. ```html _jsxs(\_components.table, { children: [\n _jsx(\_components.thead, { children: _jsxs(\_components.tr, { children: [\n _jsx(\_components.th, { children: \"Aspect\" }), _jsx(\_components.th, { children: \"Kernel v3.3 (EIP-7702)\"}) , _jsx(\_components.th, { children: \"Role-Based\" })] }) }), _jsxs(\_components.tbody, { children: [\n _jsxs(\_components.tr, { children: [\n _jsx(\_components.td, { children: _jsx(\_components.strong, { children: \"Signing method\" }) }), _jsxs(\_components.td, { children: [\"UserOperation hash via \", _jsx(\_components.code, { children: \"signMessage()\" })] }), _jsxs(\_components.td, { children: [\"Typed data via \", _jsx(\_components.code, { children: \"signTypedData()\" })] })] }), _jsxs(\_components.tr, { children: [\n _jsx(\_components.td, { children: _jsx(\_components.strong, { children: \"Address\" }) }), _jsx(\_components.td, { children: \"Same as EOA\" }), _jsx(\_components.td, { children: \"Predicted new address\" })] }), _jsxs(\_components.tr, { children: [\n _jsx(\_components.td, { children: _jsx(\_components.strong, { children: \"EntryPoint\" }) }), _jsx(\_components.td, { children: \"Requires 0.7\" }), _jsx(\_components.td, { children: \"Not applicable\" })] }), _jsxs(\_components.tr, { children: [\n _jsx(\_components.td, { children: _jsx(\_components.strong, { children: \"Delegation\" }) }), _jsx(\_components.td, { children: \"Required on spending chains\" }), _jsx(\_components.td, { children: \"Not applicable\" })] })] })] })] ``` -------------------------------- ### Initial GET Request for Paginated Transactions Source: https://docs.onebalance.io/api-reference/pagination This example demonstrates an initial GET request to the `/api/status/get-tx-history` endpoint, specifying the user and a limit for the number of transactions to retrieve. It's the starting point for fetching paginated data. ```http GET /api/status/get-tx-history?user=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&limit=10 ``` -------------------------------- ### API Reference Introduction Source: https://docs.onebalance.io/ai/mcp-server-setup Introduction to the OneBalance API, including core concepts and overview. ```APIDOC ## Introduction to the OneBalance API ### Description This document provides an overview of the OneBalance API, its capabilities, and how to get started with integrating it into your applications. ### Endpoint /api-reference/introduction ``` -------------------------------- ### Get Key Quorum Source: https://docs.privy.io/guide/react/quickstart Fetches a key quorum configuration by its unique ID. This allows for viewing the details of existing quorum setups. ```openapi get /v1/key_quorums/{key_quorum_id} ``` -------------------------------- ### API Reference - Introduction, Authentication, Errors, Pagination, Rate Limits, CORS Source: https://docs.onebalance.io/guides/eip-7702/getting-started Core API reference documentation covering introduction, authentication methods, error handling, pagination, rate limits, and CORS policies. ```APIDOC ## API Reference Overview ### Description This section provides general information about the OneBalance API, including how to authenticate requests, understand error codes, implement pagination, manage rate limits, and configure CORS. ### Authentication Requests to the OneBalance API must be authenticated. Please refer to the `/api-reference/authentication` endpoint for detailed instructions on how to authenticate your requests, typically involving API keys or other secure methods. ### Errors Error responses from the API will include standard HTTP status codes and a JSON body containing error details. Refer to `/api-reference/errors` and `/api-reference/error-codes` for a comprehensive list of possible errors and their corresponding codes. ### Pagination For endpoints that return lists of items, pagination is supported to manage large datasets. Details on how to use pagination parameters (e.g., `limit`, `offset`, `nextCursor`) can be found at `/api-reference/pagination`. ### Rate Limits To ensure fair usage and service stability, the API enforces rate limits. Information regarding these limits, including request quotas and retry strategies, is available at `/api-reference/rate-limits`. ### CORS Cross-Origin Resource Sharing (CORS) is enabled for the API. Configuration details and any specific origins allowed can be found at `/api-reference/cors`. ``` -------------------------------- ### OneBalance Quote Examples for Transfers and Swaps Source: https://docs.onebalance.io/api-reference/status/get-transaction-history This guide provides examples of OneBalance API quote requests for cross-chain transfers and swaps. It illustrates how to structure API calls to obtain quotes, which are essential for estimating transaction costs and success rates. ```javascript // Example of requesting a quote for a token transfer async function getTransferQuote(fromChain, toChain, asset, amount, recipient) { const quoteRequest = { operation: "transfer", fromChain: fromChain, toChain: toChain, asset: asset, amount: amount, recipient: recipient }; try { const quote = await onebalance.getQuote(quoteRequest); console.log("Transfer Quote:", quote); return quote; } catch (error) { console.error("Error getting transfer quote:", error); throw error; } } // Example of requesting a quote for a token swap async function getSwapQuote(fromChain, toChain, fromAsset, toAsset, fromAmount) { const quoteRequest = { operation: "swap", fromChain: fromChain, toChain: toChain, fromAsset: fromAsset, toAsset: toAsset, fromAmount: fromAmount }; try { const quote = await onebalance.getQuote(quoteRequest); console.log("Swap Quote:", quote); return quote; } catch (error) { console.error("Error getting swap quote:", error); throw error; } } // Usage examples: // getTransferQuote("ethereum", "polygon", "USDC", "100", "0x..."); // getSwapQuote("ethereum", "bsc", "ETH", "BNB", "1"); ``` -------------------------------- ### MCP Tool Configuration Example Source: https://docs.onebalance.io/ai/mcp-server-setup An example of how to configure a generic tool for MCP compatibility. This includes the command to be executed, the arguments passed to it, and any necessary environment variables. ```text Command: npx Arguments: -y mcp-remote https://docs.onebalance.io/mcp Environment: None ``` -------------------------------- ### Getting Started - Chain-Abstracted Swap Source: https://docs.onebalance.io/getting-started/introduction A tutorial on performing cross-chain token swaps with OneBalance and Privy, eliminating the need for manual bridging and gas management. ```APIDOC ## Chain-Abstracted Swap ### Description This guide demonstrates how to execute a cross-chain token swap using OneBalance and Privy, abstracting away the complexities of bridging, gas fees, and network switching. ### Method GET ### Endpoint /getting-started/chain-abstracted-swap ### Parameters No parameters are required. ### Request Example GET /getting-started/chain-abstracted-swap ### Response #### Success Response (200) Provides a step-by-step guide for performing a chain-abstracted swap. #### Response Example ```json { "title": "Chain-Abstracted Swap", "description": "Learn how a cross-chain token swap works with OneBalance and Privy, eliminating manual bridging, gas fees, and network switching." } ``` ``` -------------------------------- ### Build a Chain-Abstracted Swap Interface Tutorial Source: https://docs.onebalance.io/guides/overview A popular tutorial that guides developers through building a chain-abstracted swap interface, ideal for getting started quickly with OneBalance. ```javascript ts.p, { children: "Jump into our most popular tutorial: building a chain-abstracted swap interface." }) }), ``` -------------------------------- ### Create User Source: https://docs.privy.io/guide/react/quickstart Creates a new user profile, optionally linking accounts and pre-generating embedded wallets. This is the entry point for user onboarding. ```openapi post /v1/users ``` -------------------------------- ### Get Started with EIP-7702 Source: https://docs.onebalance.io/api-reference/quotes/prepare-call-quote Learn how to implement cross-chain contract calls using EIP-7702 delegation. This guide helps you integrate EIP-7702 for advanced cross-chain operations. ```javascript { "title": "Getting Started with EIP-7702", "description": "Implement cross-chain contract calls using EIP-7702 delegation", "sidebarTitle": "Getting Started", "href": "/guides/eip-7702/getting-started" } ``` -------------------------------- ### Getting Started with EIP-7702 Source: https://docs.onebalance.io/api-reference/chains/list Implement cross-chain contract calls using EIP-7702 delegation. This guide explains the steps to set up and utilize EIP-7702 for your cross-chain interactions. ```markdown ## Getting Started with EIP-7702 Implement cross-chain contract calls using EIP-7702 delegation. ``` -------------------------------- ### API Reference - Introduction Source: https://docs.onebalance.io/getting-started/introduction General introduction to the OneBalance API, including key concepts and how to get started. ```APIDOC ## API Reference Introduction ### Description This section provides a general overview of the OneBalance API, its core functionalities, and essential information for developers looking to integrate with our platform. ### Endpoint /api-reference/introduction ```