Onramp to Crypto

This feature is currently an alpha release

The toAddress parameter is optional because users have the option to enter the wallet address directly within the widget.

import { useWeb3 } from "@paytweed/core-react";

function DemoPage() {
  const { createOnRamp } = useWeb3();

  function handleCreateOnRamp() {
    createOnRamp({
      toAddress: "0x7f8e0B31dd7e8C12cF907225E25Ed83C649bCc62", // optional
      commodities: [{ commodity: "MATIC", network: "Amoy" }], // optional
      currencyAmount: 100, // optional
      variant: 'sandbox' //optional, live by default
    });
  }

  return (
    <>
      <button onClick={handleCreateOnRamp}>onramp</button>
    </>
  );
}

export default DemoPage;

Last updated