BluxBlux

Fund Me

Let users on-ramp fiat into crypto straight to their Stellar wallet from React.

Blux ships with a built-in Fund Me modal — an on-ramp flow that lets users buy crypto with fiat and have it delivered directly to their connected Stellar wallet. The modal lists supported on-ramp providers (such as MoonPay). Open it by calling fundMe() from the useBlux hook.

Import

import { useBlux } from "@bluxcc/react";

Usage

import { useBlux } from "@bluxcc/react";

function FundButton() {
  const { fundMe, isAuthenticated } = useBlux();

  return (
    <button disabled={!isAuthenticated} onClick={fundMe}>
      Add funds
    </button>
  );
}

fundMe takes no arguments — it opens the modal for the currently connected user.

The user must be authenticated before opening the Fund Me modal, since funds are delivered to their connected wallet. Gate the call behind isAuthenticated.

On this page