Skip to main content
After initialization and login, use AirService for embedded wallet operations. Method names match the Reference Flutter tab.

Prerequisites

  • await airService.initialize(...) completed
  • User authenticated (see User login & sessions)
  • Optional: await airService.preloadWallet() before first wallet UI or heavy RPC use

Accounts and address

final accounts = await airService.getAccounts();
final address = await airService.getAbstractAccountAddress();

Balances

final address = await airService.getAbstractAccountAddress();
if (address != null) {
  final balanceWei = await airService.getBalance(address);
  // Format for display (example: 18 decimals)
}

Sign messages

final signature = await airService.signMessage('Hello from AIR Kit');

Contract reads (call)

final result = await airService.call(
  '0xContractAddress',
  'balanceOf',
  [/* parameters */],
  erc20AbiJsonString,
);

Transactions (sendTransaction)

Use web3dart Transaction / Transaction.callContract types as in your SDK version:
import 'package:web3dart/web3dart.dart';

// Example shape — adjust gas, chain, and contract types to your app
final txHash = await airService.sendTransaction(transaction);

Smart account deployment

final deployed = await airService.isSmartAccountDeployed();
if (!deployed) {
  final txHash = await airService.deploySmartAccount();
}

Built-in wallet UI

  • Swap: await airService.showSwapUi();
  • On-ramp: await airService.showOnRampUi(displayCurrencyCode: 'USD');
See UI components.

Error handling

Catch AirKitException and inspect type (client, sdk, server, unknown) for logging and user messaging.

Next steps