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

# AbstractJS SDK

> Type-safe SDK for account abstraction and cross-chain orchestration

AbstractJS is Biconomy's TypeScript SDK for building gas-abstracted, cross-chain applications. It provides a viem-inspired API for managing smart accounts and orchestrating transactions.

## When to Use AbstractJS

<CardGroup cols={2}>
  <Card title="Use AbstractJS when..." icon="check">
    * You need fine-grained control over transactions
    * Building with TypeScript/JavaScript
    * Want to compose custom DeFi flows
    * Need runtime parameter injection
  </Card>

  <Card title="Use Supertransaction API when..." icon="globe">
    * Rapid prototyping
    * Non-TypeScript environments
    * Pre-built DeFi integrations
    * Simpler use cases
  </Card>
</CardGroup>

## Core Concepts

### Multichain Nexus Account

A smart account that exists across multiple chains with the same address. Supports gas abstraction, batching, and cross-chain orchestration.

```typescript theme={null}
const account = await toMultichainNexusAccount({
  signer: wallet,
  chainConfigurations: [
    { chain: optimism, transport: http(), version: getMEEVersion(MEEVersion.V2_1_0) },
    { chain: base, transport: http(), version: getMEEVersion(MEEVersion.V2_1_0) },
    { chain: arbitrum, transport: http(), version: getMEEVersion(MEEVersion.V2_1_0) }
  ]
});
```

### MEE Client

Connects to the Modular Execution Environment—the network that executes your transactions gaslessly across chains.

```typescript theme={null}
const meeClient = await createMeeClient({ account });
```

### Instructions

Building blocks for transactions. Can be simple calls or composable operations with runtime values.

```typescript theme={null}
const instruction = await account.buildComposable({
  type: "default",
  data: { chainId, to, abi, functionName, args }
});
```

## What You Can Build

| Feature                  | Description                                           |
| ------------------------ | ----------------------------------------------------- |
| **Gasless Transactions** | Users pay in any ERC-20 token or you sponsor entirely |
| **Batch Operations**     | Multiple calls in one transaction                     |
| **Cross-Chain Flows**    | Bridge + swap + deposit with one signature            |
| **Runtime Injection**    | Use actual balances at execution time                 |
| **Smart Sessions**       | Delegate permissions to agents/bots                   |

## Quick Start

```bash theme={null}
npm install @biconomy/abstractjs viem
```

```typescript theme={null}
import { createMeeClient, toMultichainNexusAccount, getMEEVersion, MEEVersion } from "@biconomy/abstractjs";
import { http } from "viem";
import { optimism, base } from "viem/chains";

// 1. Create account
const account = await toMultichainNexusAccount({
  signer: wallet,
  chainConfigurations: [
    { chain: optimism, transport: http(), version: getMEEVersion(MEEVersion.V2_1_0) },
    { chain: base, transport: http(), version: getMEEVersion(MEEVersion.V2_1_0) }
  ]
});

// 2. Create client
const meeClient = await createMeeClient({ account });

// 3. Build and execute
const quote = await meeClient.getQuote({
  instructions: [/* your calls */],
  feeToken: { address: USDC, chainId: base.id }
});

const { hash } = await meeClient.executeQuote({ quote });
```

## Tutorials

<CardGroup cols={2}>
  <Card title="Setup" icon="rocket" href="/overview/abstractjs/setup">
    Install and configure AbstractJS
  </Card>

  <Card title="Pay Gas in Tokens" icon="coins" href="/overview/abstractjs/gas-tokens">
    Let users pay fees in ERC-20s
  </Card>

  <Card title="Sponsor Gas" icon="gift" href="/overview/abstractjs/sponsor-gas">
    Cover gas costs for users
  </Card>

  <Card title="Batch Calls" icon="layer-group" href="/overview/abstractjs/batch-calls">
    Composable single-chain batching
  </Card>

  <Card title="Cross-Chain" icon="globe" href="/overview/abstractjs/cross-chain">
    Multi-chain orchestration
  </Card>

  <Card title="Composable Batching" icon="syringe" href="/overview/abstractjs/composable-batching">
    Dynamic values at execution time
  </Card>
</CardGroup>
