Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# These owners will be the default owners for everything in

# the repo. Unless a later match takes precedence,

# @chibie @jeremy0x be requested for

# review when someone opens a pull request.
* @chibie @jeremy0x

- @chibie @OnahProsper
9 changes: 8 additions & 1 deletion app/pages/TransactionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
useNetwork,
useTokens,
} from "../context";
import { min } from "date-fns";

/**
* TransactionForm component renders a form for submitting a transaction.
Expand Down Expand Up @@ -338,18 +339,24 @@ export const TransactionForm = ({
let minAmountSentValue = 0.5;

const normalizedToken = token?.toUpperCase();
const isEthereum = selectedNetwork?.chain?.name === "Ethereum";

if (normalizedToken === "CNGN") {
if (cngnRate && cngnRate > 0) {
// Valid rate available - calculate limits and clear errors
maxAmountSentValue = 50000000;
minAmountSentValue = 0.5 * cngnRate;
// For Ethereum, require 1M worth of cNGN. For other networks, require 0.5 worth
minAmountSentValue = isEthereum ? 716 * cngnRate : 0.5 * cngnRate;
setRateError(null);
} else {
// cNGN selected but no valid rate - set error
const errorMessage = cngnRateError || "No available quote";
minAmountSentValue = isEthereum ? 716 : 0.5;
setRateError(errorMessage);
}
} else if (isEthereum) {
// For non-cNGN tokens on Ethereum, require $50 minimum
minAmountSentValue = 50;
}

formMethods.register("amountSent", {
Expand Down