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

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

Stellar connector for the Intents swap widget

原始使用文档
文档目录8 节
  1. Do I need it?
  2. Where it fits
  3. Usage
  4. providers.stellar
  5. What it does
  6. Exports
  7. Related
  8. License

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

npm

Stellar chain adapter for the Intents Swap Widget. It lets users swap from Stellar wallets (Freighter, xBull, Stellar Wallets Kit, …) by sending XLM or USDC to the deposit address, and it loads their Stellar balances.

Do I need it?

Your setupInstall this?
intents-swap-widget-standalone❌ No, it is already included
intents-swap-widget + your own Stellar wallet connection✅ Yes
Users only receive on Stellar❌ No, destinations don't need an adapter

Without it, Stellar swaps fail with "Stellar transfers are not supported. Add the Stellar plugin from @aurora-is-near/intents-swap-widget-stellar …". Without providers.stellar, they fail with "… Add a Stellar provider …".

Where it fits

flowchart TB
    W["Swap Widget<br/>(quote ready)"] -- "plugins.stellar.makeTransfer()" --> A["<b>this adapter</b>"]
    A -- "build tx with memo + sign XDR" --> WL["User's Stellar wallet<br/>(providers.stellar)"]
    WL -- "XLM / USDC payment" --> D["1Click deposit address"]
    D --> NI["NEAR Intents settles the swap"]

Usage

npm install @aurora-is-near/intents-swap-widget @aurora-is-near/intents-swap-widget-stellar
import '@aurora-is-near/intents-swap-widget/styles.css';

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

const wallet = useYourStellarWallet(); // e.g. Stellar Wallets Kit

<WidgetConfigProvider
  config={{
    apiKey: 'YOUR_STUDIO_API_KEY', // https://studio.aurora.dev
    connectedWallets: { default: wallet.address },
    providers: {
      stellar: {
        publicKey: wallet.address, // G… address
        signMessage: wallet.signMessage,
        signTransaction: wallet.signTransaction,
      },
    },
    plugins: { stellar },
    onWalletSignin: wallet.connect,
    onWalletSignout: wallet.disconnect,
  }}>
  <Widget />
</WidgetConfigProvider>;

providers.stellar

FieldType
publicKeystring (G… address)
signMessage(message: string) => Promise<{ signedMessage, signerAddress }>
signTransaction(xdr: string, opts?: { networkPassphrase, address }) => Promise<string | { signedTxXdr }>

Both the Stellar Wallets Kit signature (2 args) and the single-argument Freighter API work. The adapter detects which one it gets and falls back automatically.

What it does

CapabilityBehaviour
makeTransferBuilds a Stellar mainnet payment of XLM or USDC (Circle) with the memo from the quote. The memo is required, and the adapter handles text, ID and hash formats. The wallet signs it, then the adapter submits it
getNativeBalancesReads XLM and USDC (trustline) balances straight from Soroban RPC
decodePublicKeyConverts the G… address to raw bytes. The widget uses this to derive the user's Intents account
RPCTries sorobanrpc.stellar.org, then Ankr, then Nodies

Exports

ExportTypeUse
stellarStellarNetworkPluginPass it as plugins.stellar
makeTransfer(args, { provider })Promise<{ hash }>The transfer logic, callable directly
MakeTransferOptionstype{ provider: StellarProvider }

Dependencies: @stellar/stellar-sdk, axios. Peer: @aurora-is-near/intents-swap-widget.

🧩 Core widget READMEConfig, events, theming, how swaps work
🔌 Other adaptersEVM · Solana · NEAR is built into the core
🗂 Monorepo READMEAll packages
👛 Wallet Connection docsStellar and multi-chain examples
📖 Supported chainsEverything you can swap to and from
🤖 llms.txtMachine-readable docs index

License

MIT

版本与发布记录

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

版本发布日期距今
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-stellar 的常见问题

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

Stellar connector for the Intents swap widget

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

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

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

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

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

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

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

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

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

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

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

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