Skip to content

chore(release): merge main into stable#486

Merged
onahprosper merged 28 commits into
stablefrom
main
May 1, 2026
Merged

chore(release): merge main into stable#486
onahprosper merged 28 commits into
stablefrom
main

Conversation

@chibie
Copy link
Copy Markdown
Contributor

@chibie chibie commented May 1, 2026

Description

This PR merges the latest main into stable for paycrest/noblocks so the stable release branch is current.

origin/main is 26 commits ahead of origin/stable, including dependency security patches (e.g. undici CVE, Dependabot batches), build/Turbopack adjustments, balances improvements (parallel rate + RPC, multicall, SWR cache, CNGN UX), swap mode / URL side work, Starknet-oriented UI and transfers, aggregator v2 rates (buy/sell), on-ramp proxy and related fixes, FAQ/home copy tweaks, migration path changes (Celo/Scroll), and assorted merges from stable into main earlier in the branch.

Purpose: synchronize stable with production-aligned work shipped on main for release or staged deploys.

References

None. (Previously PR #772 was opened on aggregator by mistake; closing that one is optional if unused.)

Testing

  • Confirm GitHub shows a clean compare for base stable, compare main (resolve conflicts locally if CI reports any).
  • After merge, rely on Noblocks CI (lint/build) on the stable result.
  • Spot-check: balances sheet, swap form (on-ramp/off-ramp), Starknet flows if enabled, and homepage.

Environment: Next.js Noblocks frontend; reviewers use latest main vs stable CI.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR (N/A — wholesale branch sync only)
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used (stablemain)

By submitting this PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

Dprof-in-tech and others added 26 commits April 9, 2026 14:37
* remove celo from migration path

* exclude scroll

---------

Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com>
* feat(rates): fetch quotes via aggregator v2 with buy/sell side

Made-with: Cursor

* feat(aggregator): enhance URL validation and parsing in aggregatorOriginForV2 function

Updated the aggregatorOriginForV2 function to include  error handling for the NEXT_PUBLIC_AGGREGATOR_URL. It now checks for valid absolute URLs and ensures the protocol is either HTTP or HTTPS before returning the base path.
* feat: enhance swap functionality in TransactionForm

- Simplified the stateProps object in MainPageContent for better readability.
- Introduced isSwapped state in TransactionForm to manage swap mode between token and currency.
- Updated calculations for amount sent and received based on swap mode.
- Enhanced dropdowns and button for swapping fields, improving user experience.

* feat: implement `onramp` support and enhance transaction flow

- Added support for wallet recipients in the transaction process, allowing users to send tokens directly to wallet addresses.
- Introduced new state management for onramp mode, differentiating between wallet and bank/mobile money transactions.
- Updated API interactions to handle wallet recipient data, including saving and migrating wallet recipients.
- Enhanced UI components to accommodate wallet-specific fields and improve user experience during recipient selection.
- Implemented ENS name resolution for wallet addresses to provide better visibility for users.
- Updated database schema to include a new table for saved wallet recipients, ensuring proper data handling and security.

* feat: enhance recipient management and transaction flow

- Added a `name` field to wallet recipient details for better identification.
- Implemented `getCurrencySymbol` utility to standardize currency symbol retrieval across components.
- Updated transaction handling to validate and include recipient names in API interactions.
- Enhanced UI components to display recipient names and improve user experience during transactions.
- Modified database schema to ensure recipient names are stored and managed correctly.

* feat: enhance recipient validation and UI components

- Introduced type predicates for recipient details to improve type safety in filtering bank/mobile money and wallet recipients.
- Added validation for wallet address format in the API, ensuring correct input before processing.
- Updated UI components to utilize new type predicates for better handling of recipient data.
- Enhanced error handling for missing required fields in recipient data during local storage migration.
- Improved styling in the AddBeneficiaryModal for better user experience.

* feat: enhance TransactionForm with onramp/offramp buttons

- Added Onramp and Offramp buttons to the TransactionForm for improved user interaction.
- Updated layout to better accommodate new buttons while maintaining UI consistency.
- Ensured walletAddress is cleared when switching to onramp mode for better state management.

* feat: add refund account management and payment order endpoints

- Introduced refund account API endpoints for fetching and saving refund account details.
- Added support for creating and retrieving v2 payment orders.
- Updated types to include new refund account and payment order structures.
- Enhanced middleware to include new API routes for refund accounts and payment orders.
- Updated configuration to include aggregator sender API key.
- Modified components and pages to integrate new refund account functionality and payment order handling.

* chore: remove referral feature files from onramp branch

Referral feature belongs to its own branch and has not been merged.
Removing all referral-specific files to keep this branch focused on the onramp implementation.

Made-with: Cursor

* feat: enhance transaction handling and add mobile sheet view type

- Introduced a new MobileSheetView type for better management of mobile sheet states.
- Updated TransactionPreview to reset the refund account on currency changes.
- Improved error handling in TransactionStatus for expired sessions during transaction tracking.

* feat: enhance onramp functionality and transaction status handling

- Added support for connected wallet address in RecipientDetailsForm.
- Updated transaction status types to include "expired".
- Implemented mapping of aggregator order status to database status for onramp transactions.
- Enhanced error handling and status resolution for onramp payment orders.
- Improved transaction details display for onramp transactions in TransactionDetails and TransactionPreview components.
- Refactored payment instruction mapping for better clarity and functionality.

* feat: introduce OnrampPaymentInstructions type and refactor mapping logic

- Added OnrampPaymentInstructions type to define the structure for virtual account/bank transfer instructions.
- Implemented mapProviderAccountToInstructions function to convert V2FiatProviderAccountDTO to OnrampPaymentInstructions.
- Removed redundant onrampPaymentInstructions module and updated imports in relevant components.
- Enhanced transaction handling in MakePayment and TransactionDetails components to utilize the new mapping function.

* refactor: improve addBeneficiary function and transaction status handling

- Enhanced the addBeneficiary function to return a boolean indicating success or failure, improving error handling and user feedback.
- Cleaned up transaction status type definitions for better readability.
- Updated UI elements to reflect changes in transaction status and actions based on the current state.

* feat: add isSwapped state to transaction forms and update related logic

- Introduced isSwapped boolean to FormData type for tracking swap mode.
- Updated MainPageContent and TransactionForm components to manage isSwapped state.
- Adjusted rate fetching logic based on isSwapped to differentiate between buy and sell sides.
- Enhanced wallet address handling to conditionally set isSwapped based on user input.

* fix: conditionally render receipt button based on onramp status

* feat: enhance transaction status handling for onramp flows

- Updated transaction completion logic to differentiate between onramp and off-ramp flows.
- Introduced processingStartedAt state to track the start time of onramp processing.
- Adjusted success visuals and button visibility based on transaction status for onramp transactions.
- Improved time spent calculations to reflect onramp processing duration accurately.

* feat: implement onramp client payment session management

- Added functionality to track and manage the onramp client payment session expiration.
- Introduced `isOnrampClientPaymentSessionExpired` utility to determine session validity based on transaction details.
- Updated `TransactionDetails`, `TransactionList`, and `MakePayment` components to reflect session expiration in UI.
- Enhanced transaction status handling to display "expired" when applicable, improving user feedback during onramp transactions.

* fix: correct base URL configuration for payment orders API

- Updated the base URL for the payment orders API to use the configured aggregator URL instead of a hardcoded value, ensuring proper integration with the aggregator service.

* fix: ensure contentClassName is safely handled in AnimatedModal component

- Updated the AnimatedModal component to use a fallback for contentClassName, preventing potential undefined values from causing issues in the className concatenation.

---------

Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com>
Homepage copy
* fix: update TransactionForm and TransactionPreview styles and structure

- Adjusted text color for dark mode in TransactionForm to improve visibility.
- Refactored refund account button in TransactionPreview for better accessibility and user interaction, including hover effects and aria-labels for improved screen reader support.

* feat: enhance onramp transaction handling and UI notifications

- Added utility functions to determine if an onramp order is awaiting user bank transfer.
- Integrated onramp pending notification dot in WalletDetails component to indicate pending bank transfers.
- Updated transaction fetching logic to ensure timely updates and re-evaluation of onramp status.
- Improved transaction context to handle reindexing of pending transactions and update backend accordingly.

* refactor: consolidate OnrampPendingNotificationDot into utils and enhance transaction context

- Moved OnrampPendingNotificationDot component logic to utils for better organization.
- Updated WalletDetails and TransactionPreview components to utilize the new OnrampPendingNotificationDot from utils.
- Enhanced StepContext to manage onramp provider details visibility, improving user experience during transactions.
- Refined isOnrampAwaitingUserBankTransfer function to simplify status checks for pending transactions.

* feat: enhance onramp provider details management and transaction context.
…env var (#464)

* feat(payment-orders): on-ramp-only proxy, messageHash apiKey, single env var

Restrict POST /api/v1/payment-orders to fiat on-ramp (v2); reject off-ramp.
Embed sender API key UUID in encrypted createOrder recipient metadata for indexer parity.
Use NEXT_PUBLIC_AGGREGATOR_SENDER_API_KEY_ID as the single config key for server and client.

* feat(onramp): explicit receive selection, NGN on-ramp rules, tx amount labels

Gate swap CTA and recipient flow on receiveDestinationExplicitlySelected.
On-ramp: NGN send side, min fiat vs rate, rate fetch after token chosen; hero copy.
Centralize transaction history amount/type display helpers; remove unused import.
Reset currency to empty so off-ramp matches initial no-selection state.
Adjust on-ramp hero: first line "Change cash to", second "stablecoins in seconds".
…mplete

Complete flow = receive destination + token + currency + both amounts > 0:
swap amounts/formatting and keep assets. Otherwise clear amounts and apply
defaults. On-ramp: normalize currency to NGN when switching from other fiat.

Also: onrampFiatMin and Select token CTA only after token; useSwapButton aligns.
TransactionDetails: on-ramp headline uses fiat amount; hide duplicate onchain
row; completed on-ramp opens explorer via View receipt (no PDF). Transfer
funds: Select token dropdown title and selected value.
Expand FAQs for stablecoin↔fiat both ways; add bank/mobile money on-ramp FAQ.
Home: move between stablecoins and cash line + 30s.
* chore: refactor clipboard functionality to improve reliability and user feedback

- Updated `copyToClipboard` function to use `navigator.clipboard` in secure contexts and fall back to `execCommand` for non-secure contexts.
- Changed return type of `copyToClipboard` to boolean to indicate success or failure.
- Refactored multiple components to utilize the updated `copyToClipboard` function, enhancing clipboard copy operations with toast notifications for user feedback.
- Ensured consistent handling of clipboard actions across various components, including `CopyAddressWarningModal`, `MobileDropdown`, and `TransactionDetails`.

* refactor: enhance clipboard copy functionality for improved reliability

---------

Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com>
* feat(starknet): Starknet wallet, APIs, and app integration on latest main

- Restore Starknet routes (create-wallet, get-public-key, transfer, create-order), context, lib, and STRK logo
- Wire balance, transfer, transaction flows, network UI, and Privy wallet API helpers
- Cast EVM viem Chain where migration/network lists still union with custom Starknet chain id type

Made-with: Cursor

* feat(aggregator): enhance fetchTokens function with URL validation and improved error handling

- Added validation for the AGGREGATOR_URL to ensure it is set and properly formatted.
- Improved error logging to provide more context on network issues when fetching tokens from the API.
- Updated the API request to use a constructed URL for better clarity and maintainability.

* feat(starknet): enhance create-order route with wallet address validation and error handling

- Added validation for the wallet address format in the create-order API, ensuring it is a valid string.
- Implemented error responses for missing or invalid wallet addresses to improve user feedback.
- Refactored the logic to check if the wallet is deployed using the normalized wallet address.
- Removed redundant code related to wallet deployment checks, streamlining the function.

* feat(starknet): improve wallet address handling and state management in Starknet context

- Added validation for wallet address format in the Starknet API, ensuring it is a valid string before processing.
- Implemented error responses for missing or invalid wallet addresses to enhance user feedback.
- Refactored state management in StarknetProvider to handle null values for wallet ID, address, and public key more effectively.
- Streamlined the logic for checking if a wallet is deployed using the normalized wallet address, improving code clarity.

* feat(starknet): enhance balance fetching and network handling for Starknet integration

- Introduced unified balance fetching for both EVM and Starknet networks, improving consistency in balance management.
- Added support for displaying balances in the WalletDetails component specifically for Starknet.
- Implemented user notifications for unsupported on-ramp functionality on Starknet, guiding users to switch to an EVM network.
- Refactored state management in BalanceContext to handle Starknet balances more effectively, ensuring accurate cross-chain balance representation.

* refactor(utils): remove temporary USDT addition for Base network and streamline fallback token handling

- Eliminated the temporary addition of USDT for the Base network during token fetching.
- Simplified the logic for merging fallback tokens, ensuring only relevant networks are processed.

* feat(starknet): enhance address validation and balance context management

- Added validation for Starknet addresses to ensure they are not empty or the zero address, improving error handling.
- Updated BalanceContext to reset smart wallet totals and cross-chain balances upon error, ensuring consistent state management during balance fetching.

* feat(starknet): add new API routes and enhance wallet management

- Introduced new API routes for Starknet: `/api/starknet/transfer` and `/api/starknet/create-order`, expanding functionality for wallet operations.
- Implemented comprehensive error handling and validation for wallet addresses across Starknet APIs, improving user feedback and security.
- Enhanced state management in the Starknet context to support new wallet-related features, including tracking wallet creation and transfer processes.
- Updated middleware to include wallet address extraction for improved request handling.

---------

Co-authored-by: sundayonah <sundayonah94@gmail.com>
…configuration (#476)

- Moved the Starknet ready account class hash and paymaster configuration from environment variables to the config module for better maintainability and clarity.
- Updated relevant API routes and hooks to utilize the new centralized configuration, improving consistency across the application.
- Removed redundant error handling for missing environment variables related to the paymaster setup, streamlining the codebase.
- Updated the CopyAddressWarningModal to display specific warnings and information for Starknet addresses, ensuring users are aware of the differences in address formats and supported networks.
- Centralized modal title, deposit description, and footer warning for improved readability and maintainability.
- Adjusted the list of supported networks displayed based on the selected network, enhancing user experience and clarity regarding supported stablecoins and networks.
* feat: enhance Starknet integration and UI components

- Added support for internal API origin configuration in the aggregator API to handle deployments with separate SPA and API origins.
- Updated the networks list in mocks to reflect explicit ranking based on aggregator volume, improving user experience.
- Introduced a new context for managing transaction form swap state, allowing global UI updates without prop drilling.
- Enhanced dropdown components to support a disabled state, preventing user interaction when necessary.
- Implemented validation for Starknet-specific on-ramp functionality, including UI adjustments to indicate unsupported features.
- Refactored transaction handling to ensure correct wallet address usage for Starknet, improving API interaction and error handling.
- Improved error handling in transaction fetching to gracefully manage 404 responses, enhancing user feedback.

* feat: improve Starknet on-ramp handling and transaction management

- Added validation to block form submission when the Starknet on-ramp is active and a swap is indicated, enhancing user experience.
- Updated transaction context to align cache state with API responses, preventing stale data from being used in future fetches.
- Enhanced swap button logic to disable interactions when the Starknet on-ramp is active, ensuring clarity for users.
- Refined wallet address handling in the TransactionPreview component to ensure proper API interactions and error handling, improving transaction persistence reliability.

* fix: improve error handling in TransactionsContext for transaction fetching

- Enhanced error handling in the TransactionsContext to log detailed error messages when fetching transactions fails.
- Simplified the handling of 404 errors by removing redundant state updates, ensuring clearer error reporting and user feedback.
…net and EVM networks (#481)

- Added comprehensive validation for recipient addresses based on the selected network, ensuring correct formats for both Starknet and EVM addresses.
- Integrated a trigger to validate the recipient address whenever the recipient network changes, improving user feedback and error handling.
- Refactored existing validation logic to streamline address checks and provide clearer error messages for invalid formats.
- Added a new  type to manage on-ramp and off-ramp states consistently.
- Updated  and various components to replace the  boolean with , enhancing clarity and maintainability.
- Implemented utility functions to derive swap mode from URL parameters and set initial values based on network conditions.
- Refactored transaction handling and UI components to utilize the new swap mode logic, improving user experience and error handling during transactions.
… CNGN UX (#482)

* feat(balances): parallelize rate+RPC, multicall per chain, SWR cache, CNGN UX

Speeds up wallet balance loads and removes the misleading "$0 red" CNGN
display when the NGN-USD rate is unavailable.

Highlights:
- Run getCNGNRateForNetwork in parallel with cross-chain balance fetches
  so wall time is max(rate, RPC) instead of sum.
- Replace per-token readContract loop with a single viem multicall per
  chain (allowFailure, sequential fallback when multicall3 is missing).
- Add client-only TTL+single-flight cache (walletBalanceCache) keyed by
  chainId+address; expose softRefresh (cache-respecting) and refreshBalance
  (bypass-cache) on BalanceContext.
- Treat missing CNGN rate as "USD valuation unknown" instead of \$0:
  introduce cngnUsdUnknown, render "—" with NGN-pegged copy in
  WalletDetails / WalletView, keep raw token amount visible.
- Re-apply CNGN correction when the rate later resolves without
  re-fetching balances; quote NGN<->USD on a fixed corridor
  (CNGN_CROSS_CHAIN_QUOTE_NETWORK) for cross-chain consistency.
- Identity-aware isRefreshing avoids showing another wallet's cached
  balances during account switches.
- Add lightweight balanceTelemetry (opt-in via localStorage.balance_debug
  in dev, 2% sample in prod) and tokenBalanceRowVisible helper.

Tests: extend coverage with tokenBalanceRowVisible.test.ts.

* fix(balances): honor bypass on rate fallback, safe cache invalidation, sequential read fallback

Pass bypassCache into getCNGNRateForNetwork when resolving CNGN rate in
BalanceContext so manual refresh can skip the local quote cache. Prevent
stale in-flight balance fetches from repopulating walletBalanceCache after
invalidation, and clear inflight keys on invalidate. Use a true sequential
ERC-20 readContract loop when multicall fails.

* perf(balances): run native getBalance in parallel with ERC-20 multicall

* fix(balances): bypass inflight dedupe on refresh, lazy-load cache on client

When bypassCache is set, start a fresh fetch instead of joining an older
in-flight request. Load walletBalanceCache via dynamic import in
fetchEvmBalancesForAddress and skip cache entirely on the server so shared
utils imports do not execute client-only Maps in Node.
…Turbopack (#483)

The production build was taking 10–12 minutes. This commit applies three
independent changes that together remove the largest sources of build cost:

1. Removed dependencies that nothing in the app actually imports:
   - thirdweb (5.102.6 + duplicate 5.29.6)
   - @thirdweb-dev/auth, @thirdweb-dev/wallets
   - @vidstack/react
   - net, tls (already polyfilled-out via the package.json `browser` map
     and Next webpack `resolve.fallback`)

   These pulled in ~400 MB of transitive code (multiple viem versions,
   @WalletConnect copies, three.js, lucide-react, @thirdweb-dev/contracts-js,
   etc.). After re-locking, pnpm reports `+76 -693` packages and node_modules
   shrinks from 2.6 GB to 1.6 GB, which speeds up dep resolution, SWC
   transforms, and CI cache restore.

2. Lazy-load @react-pdf/renderer in TransactionDetails and TransactionStatus.
   PDFKit + fontkit + image decoders are only needed when the user clicks
   "Get receipt", so they no longer enter the first-load JS bundle.

3. Switch `next build` to use Turbopack (stable in Next 15.5+). Combined
   with the smaller dep tree, this should cut production build time by
   several minutes on its own.

No app code or runtime behavior changes; the PDF receipt feature still
works identically (just dynamically imported on click).
Workaround for the "high bits of the position ... are not all 0s or 1s"
panic that crashes `next build --turbopack` on large module graphs (e.g.
via Sanity). Fixed upstream in Next.js 16 (vercel/next.js#83399) but not
in 15.5.x. Remove once we upgrade to a version that includes the fix.
* fix(deps): patch 90+ Dependabot security vulnerabilities

Update direct deps and add pnpm overrides to address all reachable
CVEs. Skipped uuid@14 (major API break), undici@6 (5→6 major), and
@tootallnate/once@3 (2→3 major) as they require breaking changes.

Direct upgrades:
- next ^15.5.7 → ^15.5.15 (DoS, high)
- axios ^1.9.0 → ^1.15.0 (SSRF/header injection, medium)
- postcss ^8.5.5 → ^8.5.10 (XSS, medium)
- @sanity/cli ^3.99.0 → ^4.4.1 (removes vite@7.1.x from tree)

New pnpm overrides (transitive):
- @hpke/core 1.7.2→1.9.0 (critical)
- jws 3.2.2→3.2.3, h3 1.15.3→1.15.11, valibot 1.1.0→1.3.1,
  preact 10.26.9→10.29.1 (high, production)
- dompurify →3.4.2, follow-redirects →1.16.0, defu →6.1.7 (medium)
- vite@7 7.1.2→7.3.2 (high, arbitrary file read)
- rollup 4.46.2→4.60.2, tar 7.4.3→7.5.13, tar-fs 2.1.3→2.1.4,
  systeminformation 5.27.7→5.31.5 (high)
- glob@10 →10.5.0, glob@11 →11.1.0 (high)
- minimatch@3/5/9/10, picomatch@2/4, yaml@1/2, js-yaml@3/4 all patched
- lodash/lodash-es →4.18.1, bn.js →5.2.3, qs →6.15.1,
  brace-expansion@2 →2.1.0, flatted →3.4.2, min-document →2.19.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(deps): drop noop @isaacs/brace-expansion override

The package was no longer in the dep tree after the related minimatch/glob
upgrades resolved upstream forks, making the override an unused defensive
guard. Removing reduces noise in the overrides config.

Verified: pnpm install --frozen-lockfile passes; next build compiles
successfully (15.5.15, Turbopack, 95s).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…hub overrides (#485)

Forces @actions/http-client to ^3.0.2 and @actions/github to ^9.1.1 via
pnpm.overrides. Both v3+ of http-client ship with undici@^6.23.0, eliminating
the vulnerable undici@5.29.0 that was pulled in via the
@sanity/cli → @sanity/template-validator@2.4.3 → @actions/github@6 chain.

Sanity's own latest releases (template-validator@3.x) already depend on
@actions/github@^9, so these versions are validated by the Sanity team.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@chibie chibie requested review from 5ran6 and onahprosper as code owners May 1, 2026 01:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3d9e0e02-8757-494c-a6bf-9e36f338783b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch main

Comment @coderabbitai help to get the list of available commands and usage tips.

@onahprosper onahprosper merged commit fdacd4c into stable May 1, 2026
1 check passed
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.

6 participants