Overview
The Account API provides operations for managing user accounts and predicting account addresses. This is essential for getting the smart contract wallet address before any transactions are made.Import
Functions
predictAddress
Predicts the smart contract wallet address for a given session and admin address.string
required
The session address from the embedded wallet
string
required
The admin address (typically the same as session address for most users)
Promise<string> - The predicted account address
Example
Usage in Application
The predicted address is used throughout the application for:- Balance queries - Fetch user token balances before any transactions
- Quote requests - Include the account address in swap/transfer quotes
- Transaction execution - Sign and execute transactions with the predicted address
Integration with useQuotes Hook
API Endpoint
POST/account/predict-address
Request Body:
Error Handling
Related APIs
- Quotes API - Uses predicted address for quote requests
- Balances API - Queries balances for predicted address
- useQuotes Hook - Integrates address prediction