> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moca.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Flutter wallet operations

> Use AirService on Flutter to fetch accounts, balances, sign messages, and call smart contract methods from the embedded AIR Kit wallet.

After [initialization](/airkit/usage/initialization) and login, use `AirService` for embedded wallet operations. Method names match the [Reference](/airkit/usage/reference) Flutter tab.

## Prerequisites

* `await airService.initialize(...)` completed
* User authenticated (see [User login & sessions](/airkit/usage/user-authentication))
* Optional: `await airService.preloadWallet()` before first wallet UI or heavy RPC use

## Accounts and address

```dart theme={null}
final accounts = await airService.getAccounts();
final address = await airService.getAbstractAccountAddress();
```

## Balances

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

## Sign messages

```dart theme={null}
final signature = await airService.signMessage('Hello from AIR Kit');
```

## Contract reads (`call`)

```dart theme={null}
final result = await airService.call(
  '0xContractAddress',
  'balanceOf',
  [/* parameters */],
  erc20AbiJsonString,
);
```

## Transactions (`sendTransaction`)

Use `web3dart` `Transaction` / `Transaction.callContract` types as in your SDK version:

```dart theme={null}
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

```dart theme={null}
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](/airkit/flutter/ui-components).

## Error handling

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

## Next steps

* [Provider functions](/airkit/flutter/provider-functions) — raw JSON-RPC
* [Account Services](/airkit/usage/account/smart-account) — product concepts (web-centric sections may still apply conceptually)
* [Paymaster](/airkit/usage/account/paymaster) — gas sponsorship where supported
