@aurora-is-near/intents-swap-widget-standalone

中文文档
7.29.0发布于 2026/11/03MITTypeScriptES Module近 30 天下载 2453

Standalone wrapper for the Intents swap widget

原始使用文档
文档目录8 节
  1. Quick start
  2. What's included
  3. How it relates to the other packages
  4. Extra exports
  5. Standalone or core?
  6. Troubleshooting
  7. Links
  8. License

@aurora-is-near/intents-swap-widget-standalone

npm Widget Studio

The Intents Swap Widget with wallet connection built in. This is the fastest way to add cross-chain swaps to a React app: no wallet libraries, provider setup or connect button needed.

[!TIP] Your app already connects wallets, or you need TON? Use the core @aurora-is-near/intents-swap-widget with the chain adapters instead.

Quick start

1. Get an API key in Widget Studio. You can also design your widget there and copy a ready-made snippet.

2. Install:

npm install @aurora-is-near/intents-swap-widget-standalone

3. Render:

import '@aurora-is-near/intents-swap-widget/styles.css'; // installed as a dependency

import {
  Widget,
  WidgetConfigProvider,
} from '@aurora-is-near/intents-swap-widget-standalone';

export function Swap() {
  return (
    <WidgetConfigProvider config={{ apiKey: 'YOUR_STUDIO_API_KEY' }}>
      <Widget />
    </WidgetConfigProvider>
  );
}

The widget now renders its own Connect wallet button and a profile button for connecting and disconnecting.

What's included

Wallet familyConnected viaWallets
EVMReown AppKitMetaMask, Coinbase, Trust and 50+ via WalletConnect
SolanaReown AppKitPhantom, Solflare, WalletConnect
NEARNEAR ConnectHOT, Meteor, MyNearWallet, NEAR Mobile, …
StellarStellar Wallets KitFreighter, xBull, …

EVM networks in the wallet modal: Ethereum, Arbitrum, Base, BSC, Polygon, Optimism, Avalanche, Gnosis, Berachain, Monad, Plasma, Scroll, X Layer, ADI, Robinhood Chain, Aurora.

Users can still swap to any supported chain, including chains they have no wallet for.

How it relates to the other packages

flowchart LR
    SA["<b>intents-swap-widget-standalone</b><br/>wallet modal + wiring"] --> CORE["<b>intents-swap-widget</b><br/>UI, quotes, state"]
    SA --> EVM[intents-swap-widget-evm]
    SA --> SOL[intents-swap-widget-solana]
    SA --> XLM[intents-swap-widget-stellar]
    EVM -. plugin .-> CORE
    SOL -. plugin .-> CORE
    XLM -. plugin .-> CORE

This package re-exports everything from the core package. The one difference is WidgetConfigProvider, which here connects the wallets and fills these config keys for you:

Set automatically (don't pass them)Value
connectedWalletsAddress(es) from the wallet the user connected
providersEVM / Solana / Stellar / NEAR signers
pluginsevm, sol, stellar adapters
onWalletSignin / onWalletSignoutOpens the wallet selector / disconnects
showProfileButtontrue

All other options work the same as in the core package: apiKey, appFees, allowed tokens and chains, confidentialMode, theme, localisation, …

<WidgetConfigProvider
  config={{
    apiKey: 'YOUR_STUDIO_API_KEY',
    allowedChainsList: ['eth', 'base', 'sol', 'near'],
    defaultTargetToken: { symbol: 'USDC', blockchain: 'base' },
    appFees: [{ recipient: 'your-app.near', fee: 20 }],
  }}
  theme={{ colorScheme: 'dark', accentColor: '#bc9cf8', stylePreset: 'bold' }}>
  <Widget />
</WidgetConfigProvider>

📖 Full option reference: Widget Configuration · Theming · Localisation

Extra exports

ExportUse it to
AppKitProviderLow-level AppKit context used by the standalone provider
useAppKitWallet()Read { address, isConnected, isConnecting, connect, disconnect } of the AppKit (EVM/Solana) connection
useAppKitProviders()Get the raw { evm, sol } wallet providers

Standalone or core?

Standalone (this)Core + adapters
Lines of wallet code0You write the connect flow
TON wallets❌✅
Custom wallet modal❌✅
BundleAll chain SDKsOnly adapters you install

Troubleshooting

SymptomFix
Duplicate @reown/*, @solana/* or valtio versionsPin them with resolutions / overrides (list)
connectedWallets I passed is ignoredExpected: standalone uses its own connection. Use the core package for that
No stylesImport @aurora-is-near/intents-swap-widget/styles.css, and wrap your CSS reset in @layer base
🧩 Core widget READMEConfig, events, theming, subpath exports, how swaps work
🗂 Monorepo READMEAll packages and development
👛 Wallet Connection docsBuilt-in vs external wallets
🛠 Widget StudioAPI key, fees, visual config, embed code
🤖 llms.txtMachine-readable docs index

License

MIT

版本与发布记录

@aurora-is-near/intents-swap-widget-standalone 共发布 122 个版本,首次发布于 2026/02/13;过去 12 个月发布了 122 个版本。

版本发布日期距今
7.29.0latest2026/11/035 天前
7.28.02026/10/2910 天前
7.27.12026/10/2612 天前
7.27.02026/10/1523 天前
7.26.02026/10/1325 天前
7.25.12026/10/081 个月前

关于 @aurora-is-near/intents-swap-widget-standalone 的常见问题

@aurora-is-near/intents-swap-widget-standalone 是什么?

Standalone wrapper for the Intents swap widget

如何安装 @aurora-is-near/intents-swap-widget-standalone?

在项目目录运行 npm install @aurora-is-near/intents-swap-widget-standalone,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18.2.0)、react-dom(>=18.2.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aurora-is-near/intents-swap-widget-standalone 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aurora-is-near/intents-swap-widget-standalone 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aurora-is-near/intents-swap-widget-standalone 可以商用吗?

@aurora-is-near/intents-swap-widget-standalone 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aurora-is-near/intents-swap-widget-standalone 的下载量有多少?

根据 npm 官方下载统计,@aurora-is-near/intents-swap-widget-standalone 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,453 次,日均约 82 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aurora-is-near/intents-swap-widget-standalone 还在维护吗?

最新版本 7.29.0 发布于 2026/11/03(5 天前);至今共发布 122 个版本,其中过去 12 个月发布了 122 个;首次发布于 2026/02/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。