nexus-elements-transfer
Original:🇺🇸 English
Translated
Integrate the Transfer element (registry name `transfer`) for bridge-to-recipient flows in React/TypeScript apps. Use when installing or debugging cross-chain recipient transfers, allowance/intent approvals, source-selection constraints, and `sdk.bridgeAndTransfer` step execution.
12installs
Added on
NPX Install
npx skill4agent add availproject/nexus-elements nexus-elements-transferTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Nexus Elements - Transfer
Install
- Install widget:
npx shadcn@latest add @nexus-elements/transfer
- Ensure is installed and initialized before rendering.
NexusProvider
Required setup before rendering
- Ensure is initialized.
useNexus().nexusSDK - Ensure has loaded.
bridgableBalance - Ensure recipient is valid EVM address (prefill or user input).
Initialize SDK (required once per app)
- On wallet connect, resolve an EIP-1193 provider and call .
useNexus().handleInit(provider) - Wait for before allowing transfer actions.
useNexus().nexusSDK - Re-run init after reconnect if wallet session resets.
Render widget
tsx
"use client";
import FastTransfer from "@/components/transfer/transfer";
import { SUPPORTED_CHAINS } from "@avail-project/nexus-core";
export function TransferPanel() {
return (
<FastTransfer
prefill={{
token: "USDC",
chainId: SUPPORTED_CHAINS.BASE,
recipient: "0x000000000000000000000000000000000000dead",
}}
onStart={() => {
// pending
}}
onComplete={() => {
// success
}}
onError={(message) => {
console.error(message);
}}
/>
);
}Live prop contract
- :
prefill?- ,
token, optionalchainId, optionalamount.recipient
- : cap transferable amount.
maxAmount? - ,
onStart?,onComplete?callbacks.onError?(message)
SDK flow details (under the hood)
- Primary execute call:
sdk.bridgeAndTransfer({ token, amount, toChainId, recipient, sourceChains }, { onEvent })
- Pre-execution checks:
- validate recipient + amount
- compute max available via
sdk.calculateMaxForBridge(...) - enforce selected-source sufficiency
- Hook usage:
- for transfer intent preview/refresh/allow
intent.current - for source-specific allowance decisions
allowance.current
- Event mapping:
- -> initialize step tracker
NEXUS_EVENTS.STEPS_LIST - -> progress update and elapsed timer
NEXUS_EVENTS.STEP_COMPLETE
Understand recipient behavior
- Transfer flow requires recipient address.
- Prefill recipient locks input.
- Without prefill, UI validates recipient and blocks invalid addresses.
E2E verification
- Fill token/chain/amount/recipient and confirm intent preview appears.
- Adjust source chains and confirm coverage indicators update.
- Accept and verify allowance step when required.
- Confirm success updates explorer URL and refreshes balances.
- Confirm history refresh event appears in (when present).
ViewHistory
Common failure cases
- Invalid recipient:
- pass a checksummed or valid hex address.
- Exceeds selected source max:
- reduce amount or enable more source chains.
- Flow canceled:
- expect with user-cancel message and reset state.
onError
- expect