nexus-elements-overview
10
总安装量
5
周安装量
#29789
全站排名
安装命令
npx skills add https://github.com/availproject/nexus-elements --skill nexus-elements-overview
Agent 安装分布
claude-code
5
opencode
4
cursor
4
gemini-cli
3
replit
2
Skill 文档
Nexus Elements Overview
Overview
Select the right Nexus Elements sub-skill and ensure prerequisites (shadcn registry + NexusProvider + wallet connection) are in place.
Prerequisites checklist
- Ensure shadcn/ui is initialized (a
components.jsonexists) or be ready to manual copy files from/rJSON. - Ensure wallet connection is configured (wagmi or any EIP-1193 provider).
- Install and wrap the app with
NexusProvider; callhandleIniton wallet connect.
Provider setup (minimal)
"use client";
import NexusProvider from "@/components/nexus/NexusProvider";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return <NexusProvider>{children}</NexusProvider>;
}
"use client";
import { useEffect } from "react";
import { useAccount } from "wagmi";
import type { EthereumProvider } from "@avail-project/nexus-core";
import { useNexus } from "@/components/nexus/NexusProvider";
export function InitNexusOnConnect() {
const { status, connector } = useAccount();
const { handleInit } = useNexus();
useEffect(() => {
if (status === "connected") {
connector?.getProvider().then((p) => handleInit(p as EthereumProvider));
}
}, [status, connector, handleInit]);
return null;
}
Registry info
- Base registry URL:
https://elements.nexus.availproject.org/r/{name}.json - If
components.jsonexists, ensure this registry mapping exists:
"registries": {
"@nexus-elements/": "https://elements.nexus.availproject.org/r/{name}.json"
}
Pick the right sub-skill
- Fast bridge UI:
nexus-elements-fast-bridge - Transfer UI:
nexus-elements-transfer(registry name istransfer, docs sometimes sayfast-transfer) - Deposit widget (swap + execute via
swapAndExecute):nexus-elements-deposit - Bridge deposit (bridge + execute via
bridgeAndExecute):nexus-elements-bridge-deposit - Swaps widget:
nexus-elements-swaps - Unified balance display:
nexus-elements-unified-balance - View history (intent history):
nexus-elements-view-history(noview-intentcomponent exists) - Provider setup:
nexus-elements-nexus-provider - Shared hooks/utils:
nexus-elements-common
SDK flow mapping (for answering questions)
- Fast bridge â
sdk.bridge+ intent/allowance hooks +NEXUS_EVENTS.STEPS_LIST/STEP_COMPLETE. - Transfer â
sdk.bridgeAndTransfer+ intent/allowance hooks. - Deposit â
sdk.swapAndExecute+ swap intent hook (swapIntent). - Bridge deposit â
sdk.bridgeAndExecute+ intent/allowance hooks. - Swaps â
sdk.swapWithExactIn/sdk.swapWithExactOut+ swap intent hook +NEXUS_EVENTS.SWAP_STEP_COMPLETE. - Unified balance â
sdk.getBalancesForBridge/sdk.getBalancesForSwap(viaNexusProvider). - View history â
sdk.getMyIntents().
Manual install fallback
If shadcn is not initialized, use the /r JSON for a component and create each file in files[].target with files[].content. Repeat for all registryDependencies listed in that JSON and install the dependencies array.