Skip to main content

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)
Returns: Promise<string> - The predicted account address

Example

Usage in Application

The predicted address is used throughout the application for:
  1. Balance queries - Fetch user token balances before any transactions
  2. Quote requests - Include the account address in swap/transfer quotes
  3. Transaction execution - Sign and execute transactions with the predicted address

Integration with useQuotes Hook

API Endpoint

POST /account/predict-address Request Body:
Response:

Error Handling