From 4f6674818c0e906794ea4b46493a73b27532a85c Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Mon, 21 Jul 2025 17:40:37 +0530 Subject: [PATCH] Use cluster API URL with mainnet beta --- src/components/PaymentModal.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/PaymentModal.tsx b/src/components/PaymentModal.tsx index a0a644a..80ef67f 100644 --- a/src/components/PaymentModal.tsx +++ b/src/components/PaymentModal.tsx @@ -2,15 +2,15 @@ import { useCallback, useMemo, useState } from 'react'; import BN from 'bn.js'; -import assert from 'assert'; +// import assert from 'assert'; -import { Connection } from '@solana/web3.js'; +import { clusterApiUrl, Connection } from '@solana/web3.js'; import { sendSolanaTokenPayment } from '@/services/solana'; import { PaymentModalProps } from '@/types'; -assert(process.env.NEXT_PUBLIC_SOLANA_RPC_URL, 'SOLANA_RPC_URL is required'); -const SOLANA_RPC_URL = process.env.NEXT_PUBLIC_SOLANA_RPC_URL; +// assert(process.env.NEXT_PUBLIC_SOLANA_RPC_URL, 'SOLANA_RPC_URL is required'); +// const SOLANA_RPC_URL = process.env.NEXT_PUBLIC_SOLANA_RPC_URL; export default function PaymentModal({ isOpen, @@ -22,7 +22,8 @@ export default function PaymentModal({ const [loading, setLoading] = useState(false); const [error, setError] = useState(''); - const connection = useMemo(() => new Connection(SOLANA_RPC_URL), []) + const connection = useMemo(() => new Connection(clusterApiUrl("mainnet-beta")), []); + // const connection = useMemo(() => new Connection(SOLANA_RPC_URL), []) // Get configuration from environment variables directly const amount = parseInt(process.env.NEXT_PUBLIC_SOLANA_PAYMENT_AMOUNT!);