Skip to content

Commit 241e181

Browse files
committed
um ?
1 parent c203f5b commit 241e181

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/utils/claimReferralTokens.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22
import { ReferralProvider } from "@jup-ag/referral-sdk";
3-
import { Connection, PublicKey } from "@solana/web3.js";
3+
import { clusterApiUrl, Connection, PublicKey } from "@solana/web3.js";
44
import { NETWORK, SOLANA_MAIN } from "./endpoints";
55
import { WalletContextState } from "@solana/wallet-adapter-react";
66
import { 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

src/utils/getReferralAccount.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
'use client'
22
import { LOCKIN_MINT } from "./globals";
33
import { ReferralProvider } from "@jup-ag/referral-sdk";
4-
import { Connection, PublicKey } from "@solana/web3.js";
4+
import { clusterApiUrl, Connection, PublicKey } from "@solana/web3.js";
55
import { NETWORK } from "./endpoints";
66
import { TOKEN_PROGRAM_ID } from "@solana/spl-token";
77

88
export 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) {

0 commit comments

Comments
 (0)