Skip to content

Feat/sdk integration#202

Merged
KruGoL merged 33 commits intodevfrom
feat/sdk-integration
Feb 12, 2026
Merged

Feat/sdk integration#202
KruGoL merged 33 commits intodevfrom
feat/sdk-integration

Conversation

@KruGoL
Copy link
Collaborator

@KruGoL KruGoL commented Feb 12, 2026

No description provided.

KruGoL and others added 30 commits February 8, 2026 14:04
- Add @unicitylabs/sphere-sdk (local link to ../sphere-sdk)
- Remove IPFS dependencies (helia, @helia/ipns, @helia/json, @noble/ed25519)
- Create src/sdk/ adapter layer with React hooks wrapping sphere-sdk:
  - SphereProvider: React Context for Sphere singleton lifecycle
  - Core hooks: useSphere, useWalletStatus, useIdentity, useNametag, useSphereEvents
  - Payment hooks: useTokens, useBalance, useAssets, useTransfer, useTransactionHistory
  - L1 hooks: useL1Balance, useL1Utxos, useL1Send, useL1Transactions
  - Communications hooks: useSendDM, usePaymentRequests
  - Query keys (SPHERE_KEYS) for TanStack Query integration
  - Format utilities

This is Step 1-2 of the SDK integration. Next steps:
- Step 3: Migrate components to use new hooks
- Step 4: Delete legacy code (~56 files)
- Step 5: Dependency cleanup
- Step 6: Verification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ce conditions

Add real-time debounced nametag availability checking (500ms) across all
nametag input flows: onboarding NametagScreen, AddressSelector new address
modal, and RegisterNametagModal. Shows spinner/checkmark/alert indicators
with colored borders as user types.

Add resolveNametag() to SphereContext that uses transport.resolveNametagInfo()
directly — works without a wallet by pre-connecting transport with dummy
identity during onboarding.

Work around SDK race condition where NostrTransportProvider.setIdentity()
triggers an async reconnect that isn't awaited, causing "not connected"
errors during nametag registration. Fix by disconnecting transport before
Sphere.init/switchToAddress and manually reconnecting after.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… to use SDK

Add CoinGecko API proxy and configure price provider in SphereProvider.
Replace hardcoded fiat prices with live market data from SDK. Refactor
useAssets to use sphere.payments.getAssets() and useBalance to support
both per-coin and total portfolio queries. Re-export Asset type from
sphere-sdk instead of maintaining a local interface.
… drag-and-drop

Adds complete file import onboarding: file type detection, encrypted file
password prompt, L1 address scanning with progress/abort, and deferred
sphere context finalization to avoid premature re-renders during import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…payment request rendering

- Fix AssetRow memo comparison to include totalAmount, tokenCount, priceUsd, iconUrl
  so balances update immediately after transfers without tab switching
- Change useTokens staleTime from Infinity to 30s for consistent cache behavior
- Switch useSphereEvents from refetchQueries to invalidateQueries for reliable updates
- Route legacy ApiService.fetchPrices through Vite proxy (/coingecko) with 5min cache
- Increase CoinGecko cache TTL to 5min in both SDK provider and legacy ApiService
- Fix TokenId display: use toJSON() instead of toString() to show clean hex
- Fix payment request symbol: resolve via TokenRegistry instead of raw coinId hex
- Fix payment request sender: fallback to truncated pubkey when nametag unavailable
fix: asset list reactivity, CoinGecko rate limits, token ID display
SDK now handles storage auto-connection internally in Sphere.clear(),
matching the pattern already used by Sphere.exists(), Sphere.import(),
and initializeProviders().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… wallet code

Switch @unicitylabs/sphere-sdk from local file reference to npm v0.2.3.
Remove legacy useWallet hook (~1300 lines) and AggregatedAsset/CryptoCurrency
classes (~145 lines), replacing all consumers with SDK hooks (useIdentity,
useAssets, useTransfer) and SDK types (Asset, toSmallestUnit, formatAmount).
@KruGoL KruGoL merged commit dbe65ae into dev Feb 12, 2026
4 checks passed
@KruGoL KruGoL deleted the feat/sdk-integration branch February 12, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants