File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 11'use client'
22import { ReferralProvider } from "@jup-ag/referral-sdk" ;
3- import { Connection , PublicKey } from "@solana/web3.js" ;
3+ import { clusterApiUrl , Connection , PublicKey } from "@solana/web3.js" ;
44import { NETWORK , SOLANA_MAIN } from "./endpoints" ;
55import { WalletContextState } from "@solana/wallet-adapter-react" ;
66import { LOCKIN_MINT } from "./globals" ;
@@ -19,8 +19,10 @@ export async function claimReferralTokens(
1919) : Promise < ClaimReferralResult > {
2020 try {
2121 console . log ( 'Starting claim process...' ) ;
22-
23- const connection = new Connection ( "https://mainnet.helius-rpc.com/?api-key=59516a79-eec8-4ff4-a505-63ea684999b5" , "processed" ) ;
22+ const connection = new Connection (
23+ NETWORK . startsWith ( 'http' ) ? NETWORK : clusterApiUrl ( "mainnet-beta" ) ,
24+ 'confirmed'
25+ ) ;
2426 const provider = new ReferralProvider ( connection ) ;
2527
2628 // Get claim transactions
Original file line number Diff line number Diff line change 11'use client'
22import { LOCKIN_MINT } from "./globals" ;
33import { ReferralProvider } from "@jup-ag/referral-sdk" ;
4- import { Connection , PublicKey } from "@solana/web3.js" ;
4+ import { clusterApiUrl , Connection , PublicKey } from "@solana/web3.js" ;
55import { NETWORK } from "./endpoints" ;
66import { TOKEN_PROGRAM_ID } from "@solana/spl-token" ;
77
88export const getReferralAccount = async ( walletAddress : string ) => {
9- const connection = new Connection ( NETWORK ) ;
9+ const connection = new Connection (
10+ NETWORK . startsWith ( 'http' ) ? NETWORK : clusterApiUrl ( "mainnet-beta" ) ,
11+ 'confirmed'
12+ ) ;
1013 const provider = new ReferralProvider ( connection ) ;
1114
1215 if ( ! walletAddress ) {
You can’t perform that action at this time.
0 commit comments