> ## 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.

# Working with Testnets

> Configure AbstractJS to work with testnet environments

## Staging MEE Node

By default, AbstractJS connects to the production MEE node which operates on mainnets. To work with testnets during development, you need to target the **staging MEE node** instead.

Use the `getDefaultMEENetworkUrl()` and `getDefaultMEENetworkApiKey()` helper functions with `true` to connect to the staging environment:

```typescript theme={null}
import { 
  createMeeClient, 
  toMultichainNexusAccount,
  getDefaultMEENetworkUrl,
  getDefaultMEENetworkApiKey,
  getMEEVersion,
  MEEVersion 
} from "@biconomy/abstractjs";
import { http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { sepolia, baseSepolia } from "viem/chains";

// 1. Create a signer
const signer = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);

// 2. Create multichain account with testnet chains
const account = await toMultichainNexusAccount({
  signer,
  chainConfigurations: [
    { chain: sepolia, transport: http(), version: getMEEVersion(MEEVersion.V2_1_0) },
    { chain: baseSepolia, transport: http(), version: getMEEVersion(MEEVersion.V2_1_0) }
  ]
});

// 3. Create MEE client targeting staging node
const meeClient = await createMeeClient({
  account,
  url: getDefaultMEENetworkUrl(true),    // isStaging = true
  apiKey: getDefaultMEENetworkApiKey(true)
});
```

The `isStaging` parameter (set to `true`) tells the SDK to:

* Connect to the staging MEE orchestrator URL
* Use the staging API key for authentication

<Info>
  **Production vs Staging**: When you're ready to deploy to mainnet, simply remove the `url` and `apiKey` parameters (or pass `false`) to use the production defaults.
</Info>

## Important Considerations

<Warning>
  **Limited Multichain Support on Testnets**

  Testnets have significant limitations for cross-chain operations:

  * **Bridges**: Most bridge protocols don't support testnets or have limited testnet deployments
  * **Solvers**: Liquidity solvers typically don't operate on testnets
  * **DEX Liquidity**: Testnet DEXes often lack the liquidity needed for realistic testing

  This means multichain orchestration features (cross-chain swaps, bridging, etc.) may not work reliably in testnet environments.
</Warning>

### What Works Well on Testnets

* Single-chain transactions and batching
* Gas estimation and simulation
* Smart account deployment and configuration
* Session key setup and validation
* Basic transaction flows

### What May Not Work on Testnets

* Cross-chain asset transfers via bridges
* Multi-chain swap routes
* Complex DeFi operations requiring solver infrastructure

## Recommended Testing Approach

For comprehensive testing of multichain features, consider:

1. **Use testnets for single-chain logic** — Test your transaction building, batching, and account setup
2. **Use mainnets with small amounts for multichain** — When testing cross-chain flows, use production with minimal funds
3. **Leverage simulation** — Use the quote and simulation endpoints to validate transactions before execution

```typescript theme={null}
// Example: Get a quote to simulate without executing
const quote = await meeClient.getQuote({
  instructions: [...],
  feeToken: {
    address: "0x...",
    chainId: baseSepolia.id
  }
});

// Inspect the quote before executing
console.log("Estimated gas:", quote.paymentInfo);
console.log("User operations:", quote.userOps);
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Estimate Gas" icon="calculator" href="/overview/abstractjs/estimating-gas">
    Learn how to estimate transaction costs
  </Card>

  <Card title="Gas Tokens" icon="coins" href="/overview/abstractjs/gas-tokens">
    Configure gas payment options
  </Card>
</CardGroup>
