BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/avail-widgets/nexus-provider

Nexus Provider

avail-widgets/nexus-provider
FreeComponent

Shared Nexus SDK provider and types for Avail Widgets

Install it

npx shadcn@latest add https://elements.nexus.availproject.org/r/nexus-provider.json

Source

registry/avail-widgets/nexus/NexusProvider.tsxelements.nexus.availproject.org/r/nexus-provider.json · first 6 KB
1"use client";
2import {
3 type ChainBalance,
4 createNexusClient,
5 type EthereumProvider,
6 type NexusClient,
7 type NexusNetwork,
8 type OnAllowanceHookData,
9 type OnIntentHookData,
10 type OnSwapIntentHookData,
11 type SupportedChainsAndTokensResult,
12 type TokenBalance,
13} from "@avail-project/nexus-core";
14import { getCoinbaseRates } from "@avail-project/nexus-core/utils";
15
16export type UserAsset = TokenBalance & {
17 breakdown: (ChainBalance & {
18 balance: string;
19 balanceInFiat: number;
20 chain: ChainBalance["chain"];
21 contractAddress: string;
22 decimals: number;
23 symbol: string;
24 })[];
25 balanceInFiat?: number;
26};
27
28type SupportedChainsResult = SupportedChainsAndTokensResult;
29
30type BalanceFetchTiming = {
31 runId: number;
32 source: string;
33 startTimeMs: number;
34 walletAddress: string | null;
35};
36
37import {
38 createContext,
39 type RefObject,
40 useCallback,
41 useContext,
42 useEffect,
43 useMemo,
44 useRef,
45 useState,
46} from "react";
47import { useAccountEffect } from "wagmi";
48import {
49 isSwapSupportedBySdkChainList,
50 type SdkChainListWithSwapSupport,
51} from "../common/utils/constant";
52import {
53 buildUsdPeggedSymbolSet,
54 DEFAULT_USD_PEGGED_TOKEN_SYMBOLS,
55 fetchCoinbaseUsdRate,
56 fetchCoinGeckoUsdRate,
57 getCoinbaseSymbolCandidates,
58 normalizeTokenSymbol,
59 resolveBaseSymbol,
60 toFinitePositiveNumber,
61 TOKEN_PRICE_PEGS,
62 TokenPricingError,
63 USD_PEGGED_FALLBACK_RATE,
64} from "../common/utils/token-pricing";
65
66interface NexusContextType {
67 allowance: RefObject<OnAllowanceHookData | null>;
68 attachEventHooks: () => void;
69 bridgableBalance: UserAsset[] | null;
70 bridgableBalanceLoading: boolean;
71 deinitializeNexus: () => Promise<void>;
72 exchangeRate: Record<string, number> | null;
73 fetchBridgableBalance: () => Promise<void>;
74 fetchSwapBalance: () => Promise<UserAsset[] | null>;
75 getFiatValue: (amount: number, token: string) => number;
76 handleInit: (
77 provider: EthereumProvider,
78 accountAddress?: string,
79 ) => Promise<void>;
80 initializeNexus: (
81 provider: EthereumProvider,
82 accountAddress?: string,
83 ) => Promise<void>;
84 intent: RefObject<OnIntentHookData | null>;
85 loading: boolean;
86 network?: NexusNetwork;
87 nexusSDK: NexusClient | null;
88 resolveTokenUsdRate: (tokenSymbol: string) => Promise<number | null>;
89 setAllowance: (data: OnAllowanceHookData | null) => void;
90 setIntent: (data: OnIntentHookData | null) => void;
91 supportedChainsAndTokens: SupportedChainsAndTokensResult | null;
92// … truncated

What it pulls in

npm packages

  • @avail-project/nexus-core@2.2.3
  • wagmi

Files it writes

  • registry/avail-widgets/nexus/NexusProvider.tsx

Facts

Registry
avail-widgets
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-10
Last confirmed
yesterday

Go to the source

elements.nexus.availproject.org availproject/widgets on GitHub Raw registry item This item as JSON

More from avail-widgets

All 27 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionavail-widgetsComponentsFree2 deps
All Elementsallavail-widgetsComponentsFreeno deps
Animated Spinneranimated-spinneravail-widgetsComponentsFreeno deps
Badgebadgeavail-widgetsComponentsFree2 deps
Bridge Depositbridge-depositavail-widgetsComponentsFree3 deps · 32 files
Buttonbuttonavail-widgetsComponentsFree2 deps
Cardcardavail-widgetsComponentsFreeno deps
Checkboxcheckboxavail-widgetsComponentsFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex