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

# Quick Start Guide

> Get up and running with the Mainframe SDK in under 5 minutes

## Prerequisites

Before you begin, make sure you have:

<CardGroup cols={2}>
  <Card title="Node.js" icon="node-js">
    **Version 18 or higher** Download from [nodejs.org](https://nodejs.org/)
  </Card>

  <Card title="Solana Wallet" icon="wallet">
    **Phantom or Solflare** You need a wallet with some SOL for transaction fees
  </Card>

  <Card title="Verified NFT" icon="image">
    **Any Verified Collection** An NFT from any verified Solana collection to
    transform into an agent
  </Card>
</CardGroup>

## Step 1: Installation

Choose your preferred package manager:

<CodeGroup>
  ```bash npm theme={null}
  npm install @maikers/mainframe-sdk @solana/web3.js
  ```

  ```bash pnpm theme={null}
  pnpm add @maikers/mainframe-sdk @solana/web3.js
  ```

  ```bash yarn theme={null}
  yarn add @maikers/mainframe-sdk @solana/web3.js
  ```
</CodeGroup>

## Step 2: Initialize the SDK

The SDK provides helper methods for common environments.

### Browser / React (Wallet Adapter)

```typescript theme={null}
import { QuickStartIntegrations } from "@maikers/mainframe-sdk";
import { useWallet, useConnection } from "@solana/wallet-adapter-react";

function MyComponent() {
  const { wallet } = useWallet();
  const { connection } = useConnection();

  const initSdk = async () => {
    if (!wallet || !wallet.adapter) return;

    // Auto-configured for Mainnet
    const sdk = QuickStartIntegrations.walletAdapter(
      wallet.adapter,
      connection,
    );
    return sdk;
  };
}
```

### Node.js / Backend

```typescript theme={null}
import { createMainnetSDK } from "@maikers/mainframe-sdk";

const sdk = createMainnetSDK({
  storage: {
    arweave: { gateway: "https://arweave.net" },
  },
});

// You'll need to initialize with a wallet adapter or keypair for write operations
// await sdk.initialize(walletAdapter);
```

## Step 3: Create Your First Agent

Transform a verified NFT into an AI agent. This operation costs **0.05 SOL** (Standard) but is **FREE** for Genesis collections.

```typescript theme={null}
import { PublicKey } from "@solana/web3.js";

async function createMyAgent(sdk, nftMintAddress) {
  try {
    const nftMint = new PublicKey(nftMintAddress);

    const result = await sdk.createAgent(nftMint, {
      name: "Trading Bot Alpha",
      description: "My first automated trading agent",
      framework: "FrameClaw",
      capabilities: [
        {
          type: "defi",
          plugins: ["jupiter-swap", "birdeye-data"],
        },
      ],
    });

    console.log("✅ Agent created successfully!");
    console.log("Agent PDA:", result.agentPda.toString());
  } catch (error) {
    console.error("❌ Failed to create agent:", error);
  }
}
```

## Step 4: Add Affiliate Revenue (Optional)

Monetize your integration by adding your wallet as an affiliate. You earn **15-50% commission** on the creation fee.

```typescript theme={null}
const result = await sdk.createAgent(nftMint, agentConfig, {
  affiliate: "YOUR_WALLET_ADDRESS_HERE",
  // Optional: Split 5% of your earnings with a referrer
  referrer: "REFERRER_WALLET_ADDRESS",
});
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Explore Examples" icon="lightbulb" href="/sdk/examples">
    Check out real-world examples and use cases
  </Card>

  <Card title="API Reference" icon="code" href="/sdk/api-reference">
    Dive into the complete API documentation
  </Card>

  <Card title="Security Model" icon="shield" href="/core/security">
    Understand the zero-knowledge architecture
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Creation Failed: Unauthorized">
    **Common Cause:** The NFT collection is not verified on-chain.
    **Solution:** Ensure the NFT belongs to a collection where `Collection.verified = true`. Mainframe requires this for security.
  </Accordion>

  <Accordion title="Transaction Error: Insufficient Funds">
    **Common Cause:** Not enough SOL for the creation fee (0.05 SOL) + rent.
    **Solution:** Ensure your wallet has at least 0.06 SOL.
  </Accordion>
</AccordionGroup>
