AgentSkillsCN

nexus-sdk-integration

为任意 JS/TS 前端项目(React/Next/Vite 等)提供 Avail Nexus SDK 的端到端集成指南。当您被要求集成、初始化或串联 Nexus SDK 流程(桥接、转账、执行、交换)、钩子、事件、余额、支持的链/代币,或格式化工具时,可调用此技能。

SKILL.md
--- frontmatter
name: nexus-sdk-integration
description: End-to-end integration guidance for Avail Nexus SDK in any JS/TS frontend project (React/Next/Vite/etc). Use when asked to integrate, initialize, or wire Nexus SDK flows (bridge, transfer, execute, swap), hooks, events, balances, supported chains/tokens, or formatter utilities.

Nexus SDK Integration (Parent Skill)

Integrate end-to-end

  • Integrate Nexus SDK in any JS/TS frontend project without relying on local repo references.

Ask for required inputs (if missing)

  • Ask for target runtime (React/Next/Vite/Vanilla JS).
  • Ask for network (mainnet or testnet).
  • Ask for wallet connection details (library/provider source).
  • Ask which flows are needed (bridge, transfer, execute, swap).

Orchestrate subskills in this order

  1. nexus-sdk-setup
  2. nexus-sdk-hooks-events
  3. nexus-sdk-bridge-flows
  4. nexus-sdk-swap-flows
  5. nexus-sdk-balances-metadata-utils

Follow this integration checklist (high level)

  • Install dependency @avail-project/nexus-core.
  • Obtain an EIP-1193 provider from wallet connection.
  • Initialize SDK once and store instance.
  • Attach hooks for intents, allowances, and swap intents (or rely on auto-approve).
  • Wire onEvent listeners for progress updates.
  • Implement required flows (bridge, transfer, execute, swap).
  • Fetch balances and supported chains/tokens for UI.
  • Use formatter utilities for display.
  • Handle errors and cleanup on disconnect.