@aurora-is-near/intents-connect-wallet

中文文档
7.29.0发布于 2026/11/03MITTypeScriptES Module零依赖近 30 天下载 2081

Chain wallets for @aurora-is-near/intents-connect: deposit transfers and wallet connection, one subpath per chain

原始使用文档
文档目录5 节
  1. Why subpaths
  2. Transfers
  3. Connection
  4. Deviations from the widget
  5. Solana execution instructions

@aurora-is-near/intents-connect-wallet

Chain wallets for @aurora-is-near/intents-connect: deposit transfers and wallet connection, one subpath per chain.

Ported from intents-swap-widget-evm/-solana/-stellar, the widget's useMakeNEARFtTransferCall hook, and intents-swap-widget-standalone — with no dependency on the widget.

📖 Docs: Wallet integrations · Intents Connect SDK

Why subpaths

Every chain SDK is an optional peer dependency, reachable only through its own subpath. That matters more than it sounds: @creit.tech/stellar-wallets-kit alone installs a ~160M closure (it bundles its own WalletConnect, Reown and viem copies), so an EVM-only integration must not be made to install it.

SubpathPurposeOptional peers
.shared transfer types, no deps—
./evmEVM deposit transferviem
./solanaSolana deposit transfer@solana/web3.js, @solana/spl-token
./stellarStellar transfer + decodePublicKey@stellar/stellar-sdk
./nearNEAR deposit transfer— (plain fetch)
./connectmodal, presets, coordinatorreact, @headlessui/react
./connect/appkitEVM + Solana connectors@reown/*, @solana/wallet-adapter-*, viem
./connect/nearNEAR connector@hot-labs/near-connect
./connect/stellarStellar connector@creit.tech/stellar-wallets-kit, @stellar/stellar-sdk

Install only what you use — e.g. EVM with our modal:

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

Transfers

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

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

Connection

./connect is chain-agnostic: the coordinator takes connectors as arguments rather than importing them, and the modal renders whatever options it is handed. The widget's useWalletSelector imported all three chains directly, which is why it could never be split.

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}
      />
    </>
  );
}

Wrap the tree in <AppKitProvider> when using ./connect/appkit.

Each connector carries the runner-facing members (signingStandard, getPublicKey, getChainId, decodePublicKey, getProviders), so the adapter to intents-connect's WalletConnector is a thin projection of selector.connected:

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?.() ?? {},
  };
};

Connections are mutually exclusive: an execution is bound to one origin wallet, since both the signing standard and the intermediary address follow from it. select() disconnects the others first.

Deviations from the widget

  • AppKit takes config instead of widget constants. Theme collapsed to themeMode, and CHAIN_IDS_MAP/DEFAULT_RPCS became an optional rpcOverrides map that falls back to each chain's public RPC from viem. projectId is now a prop — it defaults to Aurora's, but register your own.
  • ethers is gone. It was imported for one type, which intents-connect already provides.
  • Solana's RPC is configurable. The widget hardcoded an Alchemy URL built from an alchemyApiKey; pass rpcUrl or a connection instead.
  • NEAR uses ft_transfer, not ft_transfer_call, and does not swallow user rejection. See the notes in src/near/makeTransfer.ts.

Solana execution instructions

The /solana entry point also prepares instructions for an intents-connect SolanaRecipe. Use the concrete intermediary address to derive accounts; the converter substitutes {INTERMEDIARY} in account metadata.

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.

The recipient helper creates a standard SPL ATA idempotently. The converter preserves instruction bytes, account order, duplicate accounts, and lookup-table order; it rejects foreign signers and omits compute-budget instructions supplied by Connect. Supply action instructions only, excluding provider tips and nonce/fee infrastructure. These helpers perform no network requests or signing.

版本与发布记录

@aurora-is-near/intents-connect-wallet 共发布 18 个版本,首次发布于 2026/08/27;过去 12 个月发布了 18 个版本。

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

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

Chain wallets for @aurora-is-near/intents-connect: deposit transfers and wallet connection, one subpath per chain

如何安装 @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 和提交记录判断。