Compare commits
No commits in common. "48f3b72e81821e86ebee8ceffa3262f135c9fb2b" and "4274ffe2b6e168ed8c859d2851f30bb3d9c61de2" have entirely different histories.
48f3b72e81
...
4274ffe2b6
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -13,7 +13,7 @@ import { games } from "@/data/games";
|
|||
import { WAGER_PRIZE_MULT } from "@/shared/constants";
|
||||
import { EXPLORER_ADDRESS_TEMPLATE } from "@/data/shared";
|
||||
|
||||
const ENABLE_REFERRAL_SYSTEM = true; // Toggle for referral system visibility
|
||||
const ENABLE_REFERRAL_SYSTEM = false; // Toggle for referral system visibility
|
||||
|
||||
interface GameHistory {
|
||||
ended_time: string;
|
||||
|
|
@ -206,21 +206,9 @@ export default function PrivyButton() {
|
|||
wallets.forEach((wallet) => {
|
||||
if (wallet.type === "solana") {
|
||||
setSolWallet(wallet.address);
|
||||
updateActiveWallet(wallet.address);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const updateActiveWallet = async (walletAddress: string) => {
|
||||
if(walletAddress.length < 10){
|
||||
return;
|
||||
}
|
||||
const updateUrl = `${API_URL}update_active_wallet.php?id=${user?.id}&wallet=${walletAddress}`;
|
||||
const response = await fetch(updateUrl);
|
||||
const data = await response.text();
|
||||
console.log(`Updated active wallet to ${walletAddress}, response: ${data}`);
|
||||
}
|
||||
|
||||
const fetchSolBalance = async () => {
|
||||
updateSolWallet();
|
||||
|
||||
|
|
@ -731,10 +719,10 @@ export default function PrivyButton() {
|
|||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<p className="text-gray-400 text-sm">Your Referral ID:</p>
|
||||
<p className="font-mono text-sm">{refId}</p>
|
||||
<p className="font-mono text-sm">{user?.id?.slice(0, 8)}</p>
|
||||
<button
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(refId.toString());
|
||||
navigator.clipboard.writeText(user?.id || '');
|
||||
toast.success('Referral ID copied!');
|
||||
}}
|
||||
className="text-gray-400 hover:text-white transition p-1"
|
||||
|
|
@ -746,7 +734,7 @@ export default function PrivyButton() {
|
|||
</div>
|
||||
<button
|
||||
onClick={() => {
|
||||
const referralLink = `${window.location.origin}?ref=${refId}`;
|
||||
const referralLink = `${window.location.origin}?ref=${user?.id}`;
|
||||
navigator.clipboard.writeText(referralLink);
|
||||
toast.success('Referral link copied!');
|
||||
}}
|
||||
|
|
@ -760,10 +748,10 @@ export default function PrivyButton() {
|
|||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-4">
|
||||
{/* <div>
|
||||
<div>
|
||||
<p className="text-gray-400 text-xs">Referral Earnings</p>
|
||||
<p className="text-lg font-semibold">{referralStats.earnings.toFixed(2)} SOL</p>
|
||||
</div> */}
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-gray-400 text-xs">Total Referrals</p>
|
||||
<p className="text-lg font-semibold">{referralStats.count}</p>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Connection } from "@solana/web3.js";
|
||||
import { Connection } from "@solana/web3.js";
|
||||
|
||||
// Replace this URL with your dedicated RPC endpoint
|
||||
// You can get one from providers like QuickNode, Alchemy, Helius, or GenesysGo
|
||||
|
|
|
|||
|
|
@ -47,16 +47,6 @@ export type Bets = {
|
|||
"writable": true,
|
||||
"signer": true
|
||||
},
|
||||
{
|
||||
"name": "ownerReferrer",
|
||||
"writable": true,
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "joinerReferrer",
|
||||
"writable": true,
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "systemProgram",
|
||||
"address": "11111111111111111111111111111111"
|
||||
|
|
|
|||
|
|
@ -41,16 +41,6 @@
|
|||
"writable": true,
|
||||
"signer": true
|
||||
},
|
||||
{
|
||||
"name": "owner_referrer",
|
||||
"writable": true,
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "joiner_referrer",
|
||||
"writable": true,
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "system_program",
|
||||
"address": "11111111111111111111111111111111"
|
||||
|
|
|
|||
|
|
@ -147,9 +147,7 @@ export async function closeBet(wallets: ConnectedSolanaWallet, uid:string, betI
|
|||
betVault: chosenBet,
|
||||
betsList: bet_list_pda,
|
||||
winner: winner,
|
||||
feeWallet: FEE_COLLECTOR_PUBKEY,
|
||||
ownerReferrer: FEE_COLLECTOR_PUBKEY,
|
||||
joinerReferrer: FEE_COLLECTOR_PUBKEY
|
||||
feeWallet: FEE_COLLECTOR_PUBKEY
|
||||
})
|
||||
.transaction();
|
||||
tx.feePayer = new PublicKey(wallets.address);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user