# @aurora-is-near/intents-connect-wallet 中文文档

规范地址：https://npmcn.com/package/%40aurora-is-near/intents-connect-wallet/

版本：7\.29\.0
npm 元数据更新时间：2026-11-02T16:53:22.252Z
中文译文更新时间：2026-11-07T06:05:19.533Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aurora-is-near/intents-connect-wallet
原文对照：https://npmcn.com/package/%40aurora-is-near/intents-connect-wallet/?lang=original
项目主页：https://github.com/aurora-is-near/intents-swap-widget#readme
源码仓库：https://github.com/aurora-is-near/intents-swap-widget

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：951 kB，147 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：0 个
- peer 依赖：viem ^2\.55\.0，react \>=18\.2\.0，@reown/appkit ^1\.8\.11，@solana/web3\.js ^1\.98\.4，@headlessui/react ^2\.2\.4，@solana/spl-token ^0\.4\.14，@stellar/stellar-sdk ^14\.6\.1，@hot-labs/near-connect ^0\.6\.8，@reown/appkit-adapter-ethers ^1\.8\.11，@reown/appkit-adapter-solana ^1\.8\.11，@solana/wallet-adapter-phantom ^0\.9\.28，@aurora-is-near/intents-connect ^7\.29\.0，@creit\.tech/stellar-wallets-kit ^2\.1\.0，@solana/wallet-adapter-solflare ^0\.6\.32
- 首次发布：2026-08-27T10:07:18.974Z
- 最新版本发布：2026-11-02T16:53:21.977Z
- 近 30 天下载量：2081（2026-10-07 至 2026-11-05，npm 官方下载统计）
- 已发布版本数：18（近 12 个月 18 个）

## 中文简介

@aurora-is- near/intents- connect:存款转账和钱包连接的链条钱包,每个链条一个子路径

## 安装

```sh
npm install @aurora-is-near/intents-connect-wallet
```

也可以使用：`pnpm add @aurora-is-near/intents-connect-wallet`、`yarn add @aurora-is-near/intents-connect-wallet`、`bun add @aurora-is-near/intents-connect-wallet`

## README

# @aurora-is-near/intents-connect-wallet (英语)

链钱包 [`@aurora-is-near/intents-connect`](https://npmcn.com/package/%40aurora-is-near/intents-connect)数字 : 存款转账和钱包连接, **每个链条有一个子路径**。 。 。 .

从 `intents-swap-widget-evm/-solana/-stellar`,部件的 `useMakeNEARFtTransferCall` 钩子,和 `intents-swap-widget-standalone` 没有 依赖部件 .

📖 **文档 :** [钱包整合](https://docs.intents.aurora.dev/intents-connect/intents-connect-sdk/wallet-integrations) • 妇女 [意图连接 SDK](https://docs.intents.aurora.dev/intents-connect/intents-connect-sdk)

## 为什么子路径

每个链式SDK都是 **可选同伴依赖**,只能通过其 自己的子路径。 这比听起来更重要: `@creit.tech/stellar-wallets-kit` 单独安装 ~160M 关闭( 它捆绑了自己的钱包连接, Reown and viem) 复制件),因此,不能进行EVM-唯一的集成来安装.

| 子路径 | 目的 | 可选同伴 |
| --- | --- | --- |
| `.` | 共享传输类型, 无道具 | —— 说 |
| `./evm` | EVM 存款转账 | `viem` |
| `./solana` | 索拉纳存款转账 | `@solana/web3.js`, (中文(简体) ), `@solana/spl-token` |
| `./stellar` | 转接 + `decodePublicKey` | `@stellar/stellar-sdk` |
| `./near` | 最近的存款转账 | ——(说明 `fetch`(中文(简体) ) |
| `./connect` | 模式、预设、协调员 | `react`, (中文(简体) ), `@headlessui/react` |
| `./connect/appkit` | EVM + Solana 连接器 | `@reown/*`, (中文(简体) ), `@solana/wallet-adapter-*`, (中文(简体) ), `viem` |
| `./connect/near` | 近距离连接器 | `@hot-labs/near-connect` |
| `./connect/stellar` | 斯特拉尔连接器 | `@creit.tech/stellar-wallets-kit`, (中文(简体) ), `@stellar/stellar-sdk` |

仅安装您使用的东西—— 例如 EVM 和我们的模式 :

```bash
yarn add @aurora-is-near/intents-connect @aurora-is-near/intents-connect-wallet \
         viem react @headlessui/react @reown/appkit @reown/appkit-adapter-ethers
```

## 转账

```ts
import { evm } from '@aurora-is-near/intents-connect-wallet/evm';

createExecutionRunner({
  api,
  wallet,
  plugins: { evm },
  pluginOptions: { provider: window.ethereum },
});
```

## 连接

`./connect` 实值 **连锁不可知**: 协调员将连接符作为参数 而不是进口它们,而且模式会做出任何选择. 部件的 `useWalletSelector` 直接导入所有三个链条,这就是为什么 它永远无法分开.

```tsx
import {
  WalletSelectorModal,
  useWalletSelector,
  EVM_SOLANA_WALLET_OPTION,
  NEAR_WALLET_OPTION,
} from '@aurora-is-near/intents-connect-wallet/connect';
import {
  AppKitProvider,
  useAppKitConnector,
} from '@aurora-is-near/intents-connect-wallet/connect/appkit';
import { useNearConnector } from '@aurora-is-near/intents-connect-wallet/connect/near';

function Wallets({ children }) {
  const evmSolana = useAppKitConnector();
  const near = useNearConnector();
  const selector = useWalletSelector([evmSolana, near]);

  return (
    <>
      <IntentsConnectProvider api={api} wallet={toWalletConnector(selector)}>
        {children}
      </IntentsConnectProvider>
      <WalletSelectorModal
        open={selector.isOpen}
        onClose={selector.close}
        options={[EVM_SOLANA_WALLET_OPTION, NEAR_WALLET_OPTION]}
        onSelect={selector.select}
      />
    </>
  );
}
```

将树包入 `<AppKitProvider>` 使用时 `./connect/appkit`。 。 。 .

每个接通器都搭载着跑腿成员(`signingStandard`, (中文(简体) ), `getPublicKey`, (中文(简体) ), `getChainId`, (中文(简体) ), `decodePublicKey`, (中文(简体) ), `getProviders`因此 适应器 `intents-connect`是因为 `WalletConnector` 是一个薄的投影 `selector.connected`数字 :

```ts
const toWalletConnector = (selector: WalletSelectorState) => {
  const { connected } = selector;

  if (!connected?.signingStandard) return null;

  return {
    id: connected.id,
    name: connected.id,
    chains: [],
    signingStandard: connected.signingStandard,
    connect: async () => connected.connect(),
    disconnect: async () => connected.disconnect(),
    getAddress: () => connected.address,
    getPublicKey: connected.getPublicKey,
    getChainId: connected.getChainId,
    decodePublicKey: connected.decodePublicKey,
    getProviders: () => connected.getProviders?.() ?? {},
  };
};
```

连接是 **相互排斥**: 执行绑定于一个来源 钱包,因为签名标准和中间地址都来自 这个. `select()` 先断开其他人.

## 从部件偏移

-   **AppKit 需要配置而不是部件常数 .** `Theme` 崩溃到 `themeMode`,以及 `CHAIN_IDS_MAP`编号 :`DEFAULT_RPCS` 成为可选 `rpcOverrides` 从viem返回到每个链条的公开RPC的地图. `projectId` 现在是一个道具——它默认是Aurora的,但注册你自己的.
-   **`ethers` 不见了.** 它的进口 一种类型 `intents-connect` 已经提供了.
-   **索拉纳的RPC可塑.** 元件硬码构建了 Alchemy URL 从一个 `alchemyApiKey`; 通过 `rpcUrl` 或一个 `connection` 换句话说.
-   **NEAR 用途 `ft_transfer`没有 `ft_transfer_call`, (中文(简体) ),** 不吞入用户 拒绝。 见注: `src/near/makeTransfer.ts`。 。 。 .

## 索拉纳执行指示

这个 `/solana` 进入点还编写指令,用于 `intents-connect` `SolanaRecipe`。使用具体的中间地址得出 账户; 转换器替代 `{INTERMEDIARY}` 在账户元数据中.

```ts
import {
  createSolanaRecipientAta,
  prepareSolanaSteps,
} from '@aurora-is-near/intents-connect-wallet/solana';

const recipientAta = createSolanaRecipientAta({ intermediary, recipient, mint });
// Request swap instructions that pay recipientAta.address.
const prepared = prepareSolanaSteps(
  [recipientAta.instruction, ...swapInstructions],
  { intermediary, addressLookupTables },
);
// Return prepared from SolanaRecipe.buildSteps.
```

接收帮助者创建标准 SPL ATA 一能化. 转换器 保存指令字节、账户顺序、重复账户和查询表 命令; 它拒绝外国签名人并省略所提供的计算预算指令 由Connect编辑. 仅供应行动指示,不包括提供者提示和 非现金/收费基础设施。 这些帮助者不执行网络请求或签名.

## 常见问题

### @aurora-is-near/intents-connect-wallet 是什么？

@aurora-is- near/intents- connect:存款转账和钱包连接的链条钱包,每个链条一个子路径

### 如何安装 @aurora-is-near/intents-connect-wallet？

在项目目录运行 npm install @aurora-is-near/intents-connect-wallet，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@aurora-is-near/intents-connect（^7\.29\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @aurora-is-near/intents-connect-wallet 支持 TypeScript 吗？

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

### @aurora-is-near/intents-connect-wallet 支持 ESM 还是 CommonJS？

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

### @aurora-is-near/intents-connect-wallet 可以商用吗？

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

### @aurora-is-near/intents-connect-wallet 的下载量有多少？

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

### @aurora-is-near/intents-connect-wallet 还在维护吗？

最新版本 7\.29\.0 发布于 2026/11/03（5 天前）；至今共发布 18 个版本，其中过去 12 个月发布了 18 个；首次发布于 2026/08/27。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

