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

# Quick Start

> Make your first cross-chain transfer in 5 minutes

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @sw4p/bridge
  ```

  ```bash pnpm theme={null}
  pnpm add @sw4p/bridge
  ```

  ```toml Rust theme={null}
  [dependencies]
  sw4p-bridge = "0.1"
  ```
</CodeGroup>

## Get an API Key

<Steps>
  <Step title="Visit Developer Console">
    Go to [console.sw4p.io](https://console.sw4p.io)
  </Step>

  <Step title="Connect Wallet">
    Connect your EVM or Solana wallet to authenticate
  </Step>

  <Step title="Create API Key">
    Open **API Keys** → Click **+ Create New Key** → Name your key
  </Step>

  <Step title="Copy Key">
    Copy your `sk_555_live_...` key immediately (shown only once)
  </Step>
</Steps>

<Warning>
  Store your API key securely. It cannot be retrieved after you close the modal.
</Warning>

## Your First Transfer

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { Sw4pBridge } from '@sw4p/bridge'

  const bridge = new Sw4pBridge({ apiKey: 'sk_...' })

  // 1. Estimate fees
  const estimate = await bridge.estimateFee({
    from: 'BASE',
    to: 'SOLANA',
    amount: '100.00'
  })
  console.log(`Fee: $${estimate.fee.total}`)
  console.log(`You receive: $${estimate.netReceive}`)

  // 2. Execute transfer
  const result = await bridge.transfer({
    from: 'BASE',
    to: 'SOLANA',
    amount: '100.00',
    recipient: '5abc123...', // Solana address
    permit: signedPermit      // ERC-2612 permit
  })
  console.log(`Intent ID: ${result.intentId}`)

  // 3. Track status
  const status = await bridge.getStatus(result.intentId)
  console.log(`Status: ${status.status}`)
  ```

  ```rust Rust theme={null}
  use sw4p_bridge::{Sw4pBridge, Chain};

  #[tokio::main]
  async fn main() -> Result<(), sw4p_bridge::Error> {
      let bridge = Sw4pBridge::new("sk_...");

      // 1. Estimate fees
      let estimate = bridge.estimate_fee(
          Chain::Base,
          Chain::Solana,
          "100.00"
      ).await?;
      println!("Fee: ${}", estimate.fee.total);

      // 2. Execute transfer
      let result = bridge.transfer(TransferParams {
          from: Chain::Base,
          to: Chain::Solana,
          amount: "100.00".into(),
          recipient: "5abc123...".into(),
          permit: Some(permit),
          ..Default::default()
      }).await?;

      println!("Intent ID: {}", result.intent_id);
      Ok(())
  }
  ```
</CodeGroup>

## Transfer Status

Transfers progress through these phases:

| Phase      | Description                                  |
| ---------- | -------------------------------------------- |
| `pending`  | Transaction submitted, awaiting confirmation |
| `detected` | Burn confirmed on source chain               |
| `attested` | Attestation received                         |
| `minted`   | Tokens minted on destination chain           |
| `complete` | Transfer fully complete                      |
| `failed`   | Transfer failed                              |

## Next Steps

<CardGroup cols={2}>
  <Card title="EVM → Solana" icon="arrow-right" href="/guides/evm-to-solana">
    Transfer from any EVM chain to Solana
  </Card>

  <Card title="Solana → EVM" icon="arrow-left" href="/guides/solana-to-evm">
    Transfer from Solana to any EVM chain
  </Card>
</CardGroup>
