Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计提醒

nexus-elements-deposit联系元素存款

Agent Skill

nexus-elements-deposit 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

649

周安装

26

GitHub Stars

公开资料未说明

下载量

210
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nexus-elements-deposit(联系元素存款)
来源仓库:https://github.com/availproject/nexus-elements
仓库路径:skills/nexus-elements-deposit
安装命令:
npx skills add https://github.com/availproject/nexus-elements --skill nexus-elements-deposit
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/availproject/nexus-elements --skill nexus-elements-deposit

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合在代码变更或协作事项整理场景中使用。
  • 可通过安装命令集成到主流 Agent 工具中。
  • 使用前应确认权限范围及是否触发文件读写操作。
  • nexus-elements-deposit 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Nexus Elements - Deposit

Install

  • Install widget:

- npx shadcn@latest add @nexus-elements/deposit

  • Ensure NexusProvider is installed and initialized before rendering.

Required setup before rendering

  • Ensure useNexus().nexusSDK is initialized.
  • Ensure exchangeRate contains destination token rate (widget requires it for amount simulation).
  • Provide a correct destination config and executeDeposit builder.
  • If using the built-in MAX interaction, ensure the widget can compute current source selections so it can call sdk.calculateMaxForSwap(...).

Initialize SDK (required once per app)

  • On wallet connect, resolve an EIP-1193 provider and call useNexus().handleInit(provider).
  • Wait for useNexus().nexusSDK before allowing amount confirmation.
  • Re-run init after reconnect if wallet session resets.

Render widget

"use client";

import NexusDeposit from "@/components/deposit/nexus-deposit";
import {
  SUPPORTED_CHAINS,
  TOKEN_CONTRACT_ADDRESSES,
  TOKEN_METADATA,
  CHAIN_METADATA,
} from "@avail-project/nexus-core";
import { encodeFunctionData, type Abi } from "viem";

export function DepositPanel() {
  return (
    <NexusDeposit
      heading="Deposit USDC"
      destination={{
        chainId: SUPPORTED_CHAINS.BASE,
        tokenAddress: TOKEN_CONTRACT_ADDRESSES["USDC"][SUPPORTED_CHAINS.BASE],
        tokenSymbol: "USDC",
        tokenDecimals: TOKEN_METADATA["USDC"].decimals,
        tokenLogo: TOKEN_METADATA["USDC"].icon,
        label: "Deposit to protocol",
        gasTokenSymbol: CHAIN_METADATA[SUPPORTED_CHAINS.BASE].nativeCurrency.symbol,
        explorerUrl: CHAIN_METADATA[SUPPORTED_CHAINS.BASE].blockExplorerUrls[0],
        estimatedTime: "~30s",
      }}
      executeDeposit={(tokenSymbol, tokenAddress, amount, _chainId, user) => {
        const contract = "0x0000000000000000000000000000000000000000" as const;
        const abi: Abi = [
          {
            type: "function",
            name: "deposit",
            stateMutability: "nonpayable",
            inputs: [
              { name: "asset", type: "address" },
              { name: "amount", type: "uint256" },
              { name: "beneficiary", type: "address" },
            ],
            outputs: [],
          },
        ];

        const data = encodeFunctionData({
          abi,
          functionName: "deposit",
          args: [tokenAddress, amount, user],
        });

        return {
          to: contract,
          data,
          tokenApproval: {
            token: tokenAddress,
            amount,
            spender: contract,
          },
        };
      }}
      onSuccess={() => {
        // success
      }}
      onError={(message) => {
        console.error(message);
      }}
    />
  );
}

Live prop contract

  • Required:

- destination: DestinationConfig - executeDeposit(tokenSymbol, tokenAddress, amount, chainId, user)

  • Optional:

- heading, embed, className - open, onOpenChange, defaultOpen (dialog mode) - onSuccess, onError, onClose

SDK flow details (under the hood)

  • Main execute call:

- sdk.swapAndExecute({toChainId, toTokenAddress, toAmount, fromSources?, execute}, {onEvent})

  • Max amount call:

- sdk.calculateMaxForSwap({toChainId, toTokenAddress, fromSources?})

  • Step and status behavior:

- amount step starts simulation-loading - waits for swapIntent hook to enter previewing state - confirm order calls activeIntent.allow() and moves to executing

  • Event mapping:

- listens to NEXUS_EVENTS.SWAP_STEP_COMPLETE - handles DETERMINING_SWAP and SWAP_SKIPPED

  • Fee handling:

- destination execute receipt computes actual gas USD in success path

Important amount semantics

  • Amount input is interpreted as USD in this widget flow.
  • Widget converts USD amount to destination token amount via provider exchange rates.
  • MAX is destination-token aware:

- widget computes MaxSwapInput from the current destination and selected source pool - widget calls sdk.calculateMaxForSwap(...) - returned destination-token max is converted back to USD for the input field

  • If destination token exchange rate is missing/invalid, widget shows error and blocks confirmation.

Source selection semantics

  • Amount changes reset source selection back to auto mode.
  • In auto mode, the widget derives source balances from the current filter and current widget logic before simulation.
  • Preset filters in the source picker (Any token, Stablecoins, Native) act as explicit source selections for that pool.
  • Manual source edits are treated as exact selected sources until the amount changes again.
  • Pay using and the fromSources sent to sdk.swapAndExecute(...) should reflect the same current source set.

Preview cancellation behavior

  • Backing out from the confirmation screen before activeIntent.allow() denies the preview intent.
  • This intentional preview cancellation should not surface as the widget's own local error banner, though external onError handlers may still observe the rejection if the app wants it.

E2E verification

  • Enter amount and continue to confirmation.
  • Confirm simulation appears and updates every polling cycle.
  • Confirm order and verify status screen transitions.
  • Verify both source and destination explorer links when available.
  • Verify onSuccess and balance refresh after completion.
  • Verify error screen appears on failed simulation/execution.

Common failure cases

  • Nexus SDK is not initialized:

- ensure handleInit(provider) ran after wallet connect.

  • Unable to fetch pricing for <token>:

- ensure rates loaded in provider and token symbol is valid.

  • Execute revert:

- validate executeDeposit target, calldata, and token approval spender.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

39.19%
按下载量换算82

Claude

29.32%
按下载量换算62

Cursor

19.31%
按下载量换算41

Gemini CLI

9.59%
按下载量换算20

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills