nexus-elements-fast-bridge
SKILL.md
Nexus Elements - Fast Bridge
Install
- Install widget:
npx shadcn@latest add @nexus-elements/fast-bridge
- Ensure
NexusProvideris installed and initialized on wallet connect before renderingFastBridge.
Required setup before rendering
- Ensure
useNexus().nexusSDKis non-null. - Ensure
bridgableBalancehas loaded. - Pass connected wallet address as
connectedAddress.
Initialize SDK (required once per app)
- On wallet connect, resolve an EIP-1193 provider and call
useNexus().handleInit(provider). - Wait for
useNexus().nexusSDKbefore allowing bridge actions. - Re-run init after reconnect if wallet session resets.
Render widget
"use client";
import FastBridge from "@/components/fast-bridge/fast-bridge";
import { SUPPORTED_CHAINS } from "@avail-project/nexus-core";
export function BridgePanel({ address }: { address: `0x${string}` }) {
return (
<FastBridge
connectedAddress={address}
prefill={{
token: "USDC",
chainId: SUPPORTED_CHAINS.BASE,
}}
onStart={() => {
// track pending state
}}
onComplete={() => {
// show success state
}}
onError={(message) => {
console.error(message);
}}
/>
);
}
Live prop contract
connectedAddress(required): connected wallet address.prefill?:token,chainId, optionalamount, optionalrecipient.
maxAmount?: cap bridgeable amount.onStart?,onComplete?,onError?(message)callbacks.
SDK flow details (under the hood)
- Primary execute call:
sdk.bridge({ token, amount, toChainId, recipient, sourceChains }, { onEvent })
- Pre-execution validation and limits:
- input validation (token/chain/recipient/amount)
sdk.calculateMaxForBridge(...)for selected sources- source coverage checks before allow/execute
- Hook usage:
intent.currentstoresOnIntentHookDataallowance.currentstoresOnAllowanceHookData- flow calls
intent.refresh(selectedSources)before accept
- Event mapping:
NEXUS_EVENTS.STEPS_LISTseeds progress stepsNEXUS_EVENTS.STEP_COMPLETEupdates step completion and timer start
Understand source selection behavior
- Widget computes available sources from token breakdown excluding destination chain.
- Widget tracks selected source chains and coverage against required amount.
- Widget blocks accept/execute when source coverage is insufficient.
E2E verification
- Enter valid amount/recipient and confirm preview appears (intent hook received).
- Toggle sources and confirm max amount and coverage update.
- Accept flow and confirm allowance modal appears only when needed.
- Confirm transaction progresses through steps and returns explorer URL.
- Confirm balances refresh after success.
Common failure cases
Nexus SDK not initialized:- confirm
handleInit(provider)ran.
- confirm
- Source coverage errors:
- increase amount coverage or add more source chains.
- Stuck preview:
- ensure
allow()ordeny()is called from hook-driven UI.
- ensure
Weekly Installs
17
Repository
availproject/ne…elementsFirst Seen
Feb 4, 2026
Security Audits
Installed on
claude-code17
opencode16
cursor16
gemini-cli15
codex15
github-copilot14