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

# 桥接到 Quai

> 通过 Symbiosis 桥接资产到 Quai Network 的技术细节和合约地址。

使用 [Symbiosis](https://app.symbiosis.finance/swap?amountIn\&chainIn=Base\&chainOut=Quai\&tokenIn=ETH\&tokenOut=QUAI) 跨链协议将资产桥接到 Quai Network。Symbiosis 支持 Quai 与其他主要网络（包括 Ethereum 和 Base）之间的无缝转账。

### 快速桥接链接

<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
  <a href="https://app.symbiosis.finance/bridge?chainIn=Base&chainOut=Quai&syntheticIn=1&syntheticOut=0&tokenIn=0x5c97D726bf5130AE15408cE32bc764e458320D2f&tokenOut=0x006C3e2AaAE5DB1bCd11A1a097cE572312EADdBB" target="_blank" rel="noopener noreferrer" style={{ padding: '10px 14px', borderRadius: 8, border: '1px solid #ddd', background: 'var(--secondary-bg)', color: 'var(--primary-text)', cursor: 'pointer', textDecoration: 'none', display: 'block', width: 'fit-content' }}>
    从 Base 桥接 WQUAI 到 Quai Network
  </a>

  <a href="https://app.symbiosis.finance/bridge?chainIn=Ethereum&chainOut=Quai&syntheticIn=1&syntheticOut=0&tokenIn=0x70b7f7044D2ca8E2F1E999B90EF16d7Cb7A0cDA1&tokenOut=0x006C3e2AaAE5DB1bCd11A1a097cE572312EADdBB" target="_blank" rel="noopener noreferrer" style={{ padding: '10px 14px', borderRadius: 8, border: '1px solid #ddd', background: 'var(--secondary-bg)', color: 'var(--primary-text)', cursor: 'pointer', textDecoration: 'none', display: 'block', width: 'fit-content' }}>
    从 Ethereum 桥接 WQUAI 到 Quai Network
  </a>

  <a href="https://app.symbiosis.finance/bridge?chainIn=Ethereum&chainOut=Quai&syntheticIn=0&syntheticOut=1&tokenIn=0xdAC17F958D2ee523a2206206994597C13D831ec7&tokenOut=0x0049F7cbCa3556C2DfaE62Aafa7015F99de1b8f5" target="_blank" rel="noopener noreferrer" style={{ padding: '10px 14px', borderRadius: 8, border: '1px solid #ddd', background: 'var(--secondary-bg)', color: 'var(--primary-text)', cursor: 'pointer', textDecoration: 'none', display: 'block', width: 'fit-content' }}>
    从 Ethereum 桥接 USDT 到 Quai Network
  </a>
</div>

注意：目前不支持从 Base 桥接 USDT 到 Quai。要桥接 USDT，请使用 Ethereum → Quai。

### 关键合约地址

桥接时请使用这些确切的地址，以避免与错误的代币交互。

| 网络       | 代币               | 地址                                           |
| :------- | :--------------- | :------------------------------------------- |
| Quai     | USDT             | `0x0049F7cbCa3556C2DfaE62Aafa7015F99de1b8f5` |
| Quai     | WQUAI            | `0x006C3e2AaAE5DB1bCd11A1a097cE572312EADdBB` |
| Base     | QUAI (Symbiosis) | `0x5c97D726bf5130AE15408cE32bc764e458320D2f` |
| Ethereum | QUAI (Symbiosis) | `0x70b7f7044D2ca8E2F1E999B90EF16d7Cb7A0cDA1` |

### 添加代币到钱包

使用下面的按钮将 QUAI 代币（Symbiosis 表示）添加到您在 Base 或 Ethereum 上的钱包。请确保已安装钱包（例如 MetaMask）。该按钮将切换到正确的网络并提示"添加代币"对话框。

<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap' }}>
  <button
    onClick={async () => {
  const tokenLogo = 'https://pbs.twimg.com/profile_images/1882168961061531648/fsmniyg7_400x400.jpg'
  const pickEvmProvider = () => {
    if (typeof window === 'undefined' || !window?.ethereum) return null
    const candidates = Array.isArray(window.ethereum.providers) && window.ethereum.providers.length
      ? window.ethereum.providers
      : [window.ethereum]

    const prioritized = candidates.find((provider) => provider?.isMetaMask || provider?.isCoinbaseWallet || provider?.isBraveWallet)
    return prioritized ?? candidates[0]
  }

  const provider = pickEvmProvider()

  if (!provider || typeof provider.request !== 'function') {
    alert('未检测到 EVM 钱包。请安装 MetaMask、Coinbase Wallet 或其他兼容 EVM 的钱包。')
    return
  }

  if (provider.__quaiAddTokenPending) {
    alert('请先完成已打开的钱包弹窗，然后重试。')
    return
  }

  try {
    provider.__quaiAddTokenPending = true
    await provider.request({ method: 'eth_requestAccounts' })

    try {
      await provider.request({
        method: 'wallet_switchEthereumChain',
        params: [{ chainId: '0x2105' }],
      })
    } catch (switchErr) {
      if (switchErr?.code === 4902) {
        await provider.request({
          method: 'wallet_addEthereumChain',
          params: [{
            chainId: '0x2105',
            chainName: 'Base',
            nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
            rpcUrls: ['https://mainnet.base.org'],
            blockExplorerUrls: ['https://basescan.org'],
          }],
        })
        await provider.request({
          method: 'wallet_switchEthereumChain',
          params: [{ chainId: '0x2105' }],
        })
      } else if (switchErr?.code === -32601) {
        throw new Error('您连接的钱包无法切换网络。请尝试 MetaMask 或其他 EVM 钱包，或手动添加代币。')
      } else if (switchErr?.code === 4001) {
        throw new Error('钱包中的网络切换被拒绝。')
      } else {
        throw switchErr
      }
    }

    await provider.request({
      method: 'wallet_watchAsset',
      params: {
        type: 'ERC20',
        options: {
          address: '0x5c97D726bf5130AE15408cE32bc764e458320D2f',
          symbol: 'QUAI',
          decimals: 18,
          image: tokenLogo,
        },
      },
    })

    alert('QUAI 已添加到您的钱包。')
  } catch (e) {
    console.error(e)
    alert(e?.message || '添加代币失败。请连接后重试或在钱包中手动添加。')
  } finally {
    provider.__quaiAddTokenPending = false
  }
}}
    style={{ padding: '10px 14px', borderRadius: 8, border: '1px solid #ddd', background: 'var(--secondary-bg)', color: 'var(--primary-text)', cursor: 'pointer' }}
  >
    将 Base 上的 QUAI 添加到 Base 钱包
  </button>

  <button
    onClick={async () => {
  const tokenLogo = 'https://pbs.twimg.com/profile_images/1882168961061531648/fsmniyg7_400x400.jpg'
  const pickEvmProvider = () => {
    if (typeof window === 'undefined' || !window?.ethereum) return null
    const candidates = Array.isArray(window.ethereum.providers) && window.ethereum.providers.length
      ? window.ethereum.providers
      : [window.ethereum]

    const prioritized = candidates.find((provider) => provider?.isMetaMask || provider?.isCoinbaseWallet || provider?.isBraveWallet)
    return prioritized ?? candidates[0]
  }

  const provider = pickEvmProvider()

  if (!provider || typeof provider.request !== 'function') {
    alert('未检测到 EVM 钱包。请安装 MetaMask、Coinbase Wallet 或其他兼容 EVM 的钱包。')
    return
  }

  if (provider.__quaiAddTokenPending) {
    alert('请先完成已打开的钱包弹窗，然后重试。')
    return
  }

  try {
    provider.__quaiAddTokenPending = true
    await provider.request({ method: 'eth_requestAccounts' })

    try {
      await provider.request({
        method: 'wallet_switchEthereumChain',
        params: [{ chainId: '0x1' }],
      })
    } catch (switchErr) {
      if (switchErr?.code === -32601) {
        throw new Error('您连接的钱包无法切换网络。请尝试 MetaMask 或其他 EVM 钱包，或手动添加代币。')
      } else if (switchErr?.code === 4001) {
        throw new Error('钱包中的网络切换被拒绝。')
      } else {
        throw switchErr
      }
    }

    await provider.request({
      method: 'wallet_watchAsset',
      params: {
        type: 'ERC20',
        options: {
          address: '0x70b7f7044D2ca8E2F1E999B90EF16d7Cb7A0cDA1',
          symbol: 'QUAI',
          decimals: 18,
          image: tokenLogo,
        },
      },
    })

    alert('QUAI 已添加到您的钱包。')
  } catch (e) {
    console.error(e)
    alert(e?.message || '添加代币失败。请连接后重试或在钱包中手动添加。')
  } finally {
    provider.__quaiAddTokenPending = false
  }
}}
    style={{ padding: '10px 14px', borderRadius: 8, border: '1px solid #ddd', background: 'var(--secondary-bg)', color: 'var(--primary-text)', cursor: 'pointer' }}
  >
    将 Ethereum 上的 QUAI 添加到 Ethereum 钱包
  </button>
</div>

## Symbiosis Bridge

Symbiosis 是一个跨链 AMM DEX，它将多个区块链的流动性汇集在一起，允许用户通过单笔交易在任何支持的链上交换任何代币。

<Card title="Symbiosis App" icon="bridge" href="https://symbiosis.finance">
  访问 Symbiosis 桥接界面，将资产转入和转出 Quai Network。
</Card>

## Quai Network 配置

| 属性                  | 值                                  |
| :------------------ | :--------------------------------- |
| Chain ID            | `9`                                |
| RPC 端点              | `https://rpc.quai.network/cyprus1` |
| 区块浏览器               | [QuaiScan](https://quaiscan.io)    |
| Filter Block Offset | `500`                              |

## Quai 上的智能合约地址

以下合约部署在 Quai Network（Chain ID: 9）上，用于 Symbiosis 桥接集成。

| 合约                | 地址                                           |
| :---------------- | :------------------------------------------- |
| MetaRouter        | `0x001C50a8527fA172A5FBcb65e5402D55cf319ADe` |
| MetaRouterGateway | `0x0024334B36aDe5b7FD9b168aD68Ad288d85Ba261` |
| Bridge            | `0x003d4d57930b2E0887606bE461ab167CAC2E769e` |
| Synthesis         | `0x004E53ED63b674B1e64Bed32eF037e1f94fc1996` |
| Portal            | `0x003d9F9666853fD4A10351FF5364c602470A7cF6` |
| Fabric            | `0x005a04B1EB81A8d1591602eb58742DEee478485D` |
| MulticallRouter   | `0x0049ff6C9ACe2BAf67ad0466D82e0A2Dc7E309d1` |

## Quai 上的代币

| 代币                   | 地址                                           | 小数位 |
| :------------------- | :------------------------------------------- | :-- |
| WQUAI (Wrapped Quai) | `0x006C3e2AaAE5DB1bCd11A1a097cE572312EADdBB` | 18  |

## 源链上的 Symbiosis 合约

### Ethereum (Chain ID: 1)

| 合约                | 地址                                           |
| :---------------- | :------------------------------------------- |
| MetaRouter        | `0xf621Fb08BBE51aF70e7E0F4EA63496894166Ff7F` |
| MetaRouterGateway | `0xfCEF2Fe72413b65d3F393d278A714caD87512bcd` |
| Bridge            | `0x5523985926Aa12BA58DC5Ad00DDca99678D7227E` |
| Synthesis         | `0xD7c3DF25683871d18BC838E4F619126442Dd38B3` |
| Portal            | `0xb8f275fBf7A959F4BCE59999A2EF122A099e81A8` |
| Fabric            | `0xbBFb7cb70f84fb6fE1Cb13e42A0B71EFDe769428` |
| MulticallRouter   | `0x49d3Fc00f3ACf80FABCb42D7681667B20F60889A` |

**Ethereum 上的 USDT：** `0xdAC17F958D2ee523a2206206994597C13D831ec7` (6 小数位)

### Base (Chain ID: 8453)

| 合约                | 地址                                           |
| :---------------- | :------------------------------------------- |
| MetaRouter        | `0x691df9C4561d95a4a726313089c8536dd682b946` |
| MetaRouterGateway | `0x41Ae964d0F61Bb5F5e253141A462aD6F3b625B92` |
| Bridge            | `0x8097f0B9f06C27AF9579F75762F971D745bb222F` |
| Synthesis         | `0x9F6424FE88fBe7785Fa34F0E369F192bF38E7A6e` |
| Portal            | `0xEE981B2459331AD268cc63CE6167b446AF4161f8` |
| Fabric            | `0x44487a445a7595446309464A82244B4bD4e325D5` |
| MulticallRouter   | `0x01A3c8E513B758EBB011F7AFaf6C37616c9C24d9` |

## 集成说明

* **CoinGecko Platform ID:** `quai-network`
* **Gas Token ID:** `quai-network`
* Quai 使用 Cyprus1 区域进行跨链操作
* Quai 上的交易使用标准 EVM 兼容签名进行基于账户的（Quai）代币

<Note>
  USDT 目前不作为 Quai Network 上的原生代币提供。从其他链桥接 USDT 时，它将通过 Symbiosis Synthesis 合约表示为合成资产。
</Note>

## 其他资源

<CardGroup cols={2}>
  <Card title="Symbiosis Docs" icon="book" href="https://docs.symbiosis.finance">
    Symbiosis 协议的完整文档
  </Card>

  <Card title="Symbiosis SDK" icon="code" href="https://github.com/symbiosis-finance/js-sdk">
    用于程序化桥接集成的 JavaScript SDK
  </Card>
</CardGroup>
