@b3dotfun/sdk 0.0.30 → 0.0.31-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/anyspend/react/components/AnySpend.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +6 -1
- package/dist/cjs/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/ChainTokenIcon.js +2 -1
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +23 -28
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +5 -5
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +1 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +3 -3
- package/dist/cjs/anyspend/react/components/common/PaySection.js +1 -1
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +5 -0
- package/dist/cjs/global-account/react/components/LinkAccount/LinkAccount.js +1 -0
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.d.ts +6 -0
- package/dist/cjs/global-account/react/components/ManageAccount/BalanceContent.js +94 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.d.ts +14 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.js +272 -0
- package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +9 -51
- package/dist/cjs/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +10 -0
- package/dist/cjs/global-account/react/components/ManageAccount/TokenBalanceRow.js +8 -0
- package/dist/cjs/global-account/react/components/TokenIcon.d.ts +11 -0
- package/dist/cjs/global-account/react/components/TokenIcon.js +43 -0
- package/dist/cjs/global-account/react/components/ui/accordion.d.ts +7 -0
- package/dist/cjs/global-account/react/components/ui/accordion.js +53 -0
- package/dist/cjs/global-account/react/components/ui/dialog.js +1 -1
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -0
- package/dist/cjs/global-account/react/hooks/index.js +5 -1
- package/dist/cjs/global-account/react/hooks/useAnalytics.d.ts +7 -0
- package/dist/cjs/global-account/react/hooks/useAnalytics.js +29 -0
- package/dist/cjs/global-account/react/hooks/useB3BalanceFromAddresses.js +2 -1
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -1
- package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +24 -0
- package/dist/cjs/global-account/react/hooks/useSimBalance.js +29 -0
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +2 -2
- package/dist/cjs/global-account/react/utils/profileDisplay.js +9 -0
- package/dist/cjs/global-account/utils/analytics.d.ts +16 -0
- package/dist/cjs/global-account/utils/analytics.js +55 -0
- package/dist/cjs/shared/constants/index.d.ts +1 -0
- package/dist/cjs/shared/constants/index.js +2 -1
- package/dist/cjs/shared/generated/chain-networks.json +185 -17
- package/dist/esm/anyspend/react/components/AnySpend.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +5 -1
- package/dist/esm/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/ChainTokenIcon.js +2 -1
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +22 -27
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +5 -5
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +1 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +4 -4
- package/dist/esm/anyspend/react/components/common/PaySection.js +1 -1
- package/dist/esm/global-account/react/components/B3DynamicModal.js +2 -5
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +5 -0
- package/dist/esm/global-account/react/components/LinkAccount/LinkAccount.js +1 -0
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.d.ts +6 -0
- package/dist/esm/global-account/react/components/ManageAccount/BalanceContent.js +88 -0
- package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.d.ts +14 -0
- package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.js +266 -0
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +12 -51
- package/dist/esm/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +10 -0
- package/dist/esm/global-account/react/components/ManageAccount/TokenBalanceRow.js +5 -0
- package/dist/esm/global-account/react/components/TokenIcon.d.ts +11 -0
- package/dist/esm/global-account/react/components/TokenIcon.js +37 -0
- package/dist/esm/global-account/react/components/ui/accordion.d.ts +7 -0
- package/dist/esm/global-account/react/components/ui/accordion.js +14 -0
- package/dist/esm/global-account/react/components/ui/dialog.js +1 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -0
- package/dist/esm/global-account/react/hooks/index.js +2 -0
- package/dist/esm/global-account/react/hooks/useAnalytics.d.ts +7 -0
- package/dist/esm/global-account/react/hooks/useAnalytics.js +26 -0
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +2 -1
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +2 -1
- package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +24 -0
- package/dist/esm/global-account/react/hooks/useSimBalance.js +26 -0
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +2 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +2 -2
- package/dist/esm/global-account/react/utils/profileDisplay.js +9 -0
- package/dist/esm/global-account/utils/analytics.d.ts +16 -0
- package/dist/esm/global-account/utils/analytics.js +50 -0
- package/dist/esm/shared/constants/index.d.ts +1 -0
- package/dist/esm/shared/constants/index.js +1 -0
- package/dist/esm/shared/generated/chain-networks.json +185 -17
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +4 -0
- package/dist/types/anyspend/react/components/common/ChainTokenIcon.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/CryptoReceiveSection.d.ts +3 -1
- package/dist/types/anyspend/react/components/common/PanelOnramp.d.ts +4 -1
- package/dist/types/global-account/react/components/ManageAccount/BalanceContent.d.ts +6 -0
- package/dist/types/global-account/react/components/ManageAccount/ContentTokens.d.ts +14 -0
- package/dist/types/global-account/react/components/ManageAccount/TokenBalanceRow.d.ts +10 -0
- package/dist/types/global-account/react/components/TokenIcon.d.ts +11 -0
- package/dist/types/global-account/react/components/ui/accordion.d.ts +7 -0
- package/dist/types/global-account/react/hooks/index.d.ts +2 -0
- package/dist/types/global-account/react/hooks/useAnalytics.d.ts +7 -0
- package/dist/types/global-account/react/hooks/useSimBalance.d.ts +24 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +2 -2
- package/dist/types/global-account/utils/analytics.d.ts +16 -0
- package/dist/types/shared/constants/index.d.ts +1 -0
- package/package.json +10 -18
- package/src/anyspend/react/components/AnySpend.tsx +1 -0
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +2 -1
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +3 -2
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +10 -0
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +4 -4
- package/src/anyspend/react/components/common/ChainTokenIcon.tsx +8 -2
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +56 -107
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +12 -3
- package/src/anyspend/react/components/common/OrderDetails.tsx +5 -5
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +2 -2
- package/src/anyspend/react/components/common/PanelOnramp.tsx +11 -5
- package/src/anyspend/react/components/common/PaySection.tsx +1 -1
- package/src/global-account/react/components/B3DynamicModal.tsx +8 -7
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +6 -0
- package/src/global-account/react/components/LinkAccount/LinkAccount.tsx +2 -1
- package/src/global-account/react/components/ManageAccount/BalanceContent.tsx +228 -0
- package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +568 -0
- package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +86 -341
- package/src/global-account/react/components/ManageAccount/TokenBalanceRow.tsx +46 -0
- package/src/global-account/react/components/TokenIcon.tsx +87 -0
- package/src/global-account/react/components/ui/accordion.tsx +53 -0
- package/src/global-account/react/components/ui/dialog.tsx +1 -1
- package/src/global-account/react/hooks/index.ts +2 -0
- package/src/global-account/react/hooks/useAccountAssets.ts +1 -0
- package/src/global-account/react/hooks/useAnalytics.tsx +30 -0
- package/src/global-account/react/hooks/useB3BalanceFromAddresses.ts +3 -2
- package/src/global-account/react/hooks/useNativeBalance.tsx +2 -1
- package/src/global-account/react/hooks/useSimBalance.ts +56 -0
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +3 -1
- package/src/global-account/react/stores/useModalStore.ts +2 -2
- package/src/global-account/react/utils/profileDisplay.ts +9 -0
- package/src/global-account/utils/analytics.ts +64 -0
- package/src/shared/constants/index.ts +2 -0
- package/src/shared/generated/chain-networks.json +185 -17
- package/src/{anyspend/types → types}/window.d.ts +5 -1
- package/dist/cjs/index.d.ts +0 -0
- package/dist/cjs/index.js +0 -2
- package/dist/esm/index.d.ts +0 -0
- package/dist/esm/index.js +0 -2
- package/dist/types/index.d.ts +0 -0
- package/src/index.ts +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { sendGA4Event } from "../../../global-account/utils/analytics.js";
|
|
2
|
+
import { useAccountWallet } from "./useAccountWallet.js";
|
|
3
|
+
/**
|
|
4
|
+
* Analytics hook that provides sendAnalyticsEvent function
|
|
5
|
+
* Automatically includes user address from useAccountWallet
|
|
6
|
+
*/
|
|
7
|
+
export function useAnalytics() {
|
|
8
|
+
const { address } = useAccountWallet();
|
|
9
|
+
/**
|
|
10
|
+
* Sends an analytics event to Google Analytics 4
|
|
11
|
+
* @param eventName - The name of the event to track
|
|
12
|
+
* @param parameters - Additional parameters to include with the event
|
|
13
|
+
*/
|
|
14
|
+
const sendAnalyticsEvent = (eventName, parameters) => {
|
|
15
|
+
// Merge user address with custom parameters
|
|
16
|
+
const eventData = {
|
|
17
|
+
user_address: address,
|
|
18
|
+
...parameters,
|
|
19
|
+
};
|
|
20
|
+
// Send event to GA4 using utility function
|
|
21
|
+
sendGA4Event(eventName, eventData);
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
sendAnalyticsEvent,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { B3_TOKEN } from "../../../anyspend/index.js";
|
|
2
|
+
import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
|
|
2
3
|
import { formatNumber } from "../../../shared/utils/formatNumber.js";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
4
5
|
import { createPublicClient, formatUnits, http } from "viem";
|
|
@@ -17,7 +18,7 @@ const abi = [
|
|
|
17
18
|
// Create a public client for Base
|
|
18
19
|
const client = createPublicClient({
|
|
19
20
|
chain: base,
|
|
20
|
-
transport: http(),
|
|
21
|
+
transport: http(PUBLIC_BASE_RPC_URL),
|
|
21
22
|
});
|
|
22
23
|
async function fetchB3Balances(addresses) {
|
|
23
24
|
try {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
|
|
1
2
|
import { b3Mainnet, b3Testnet } from "../../../shared/constants/chains/supported.js";
|
|
2
3
|
import { formatNumber } from "../../../shared/utils/formatNumber.js";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -86,7 +87,7 @@ export function useNativeBalanceFromRPC(address, chainId) {
|
|
|
86
87
|
try {
|
|
87
88
|
const publicClient = createPublicClient({
|
|
88
89
|
chain: chainId === 8333 ? b3Mainnet : b3Testnet,
|
|
89
|
-
transport: http(),
|
|
90
|
+
transport: http(chainId === 8333 ? PUBLIC_BASE_RPC_URL : undefined),
|
|
90
91
|
});
|
|
91
92
|
const balance = await publicClient.getBalance({
|
|
92
93
|
address: address,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface SimTokenMetadata {
|
|
2
|
+
logo?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface SimBalanceItem {
|
|
5
|
+
chain: string;
|
|
6
|
+
chain_id: number;
|
|
7
|
+
address: string;
|
|
8
|
+
amount: string;
|
|
9
|
+
symbol: string;
|
|
10
|
+
decimals: number;
|
|
11
|
+
price_usd?: number;
|
|
12
|
+
value_usd?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
token_metadata?: SimTokenMetadata;
|
|
15
|
+
pool_size?: number;
|
|
16
|
+
low_liquidity?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface SimBalanceResponse {
|
|
19
|
+
request_time: string;
|
|
20
|
+
response_time: string;
|
|
21
|
+
wallet_address: string;
|
|
22
|
+
balances: SimBalanceItem[];
|
|
23
|
+
}
|
|
24
|
+
export declare function useSimBalance(address?: string): import("@tanstack/react-query").UseQueryResult<SimBalanceResponse, Error>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
async function fetchSimBalance(address) {
|
|
3
|
+
if (!address)
|
|
4
|
+
throw new Error("Address is required");
|
|
5
|
+
let url = `https://simdune-api.sean-430.workers.dev/?url=https://api.sim.dune.com/v1/evm/balances/${address}?metadata=logo&chain_ids=mainnet`;
|
|
6
|
+
if (process.env.PUBLIC_LOCAL_KEY) {
|
|
7
|
+
url += `&localkey=${process.env.PUBLIC_LOCAL_KEY}`;
|
|
8
|
+
}
|
|
9
|
+
const response = await fetch(url);
|
|
10
|
+
if (!response.ok) {
|
|
11
|
+
throw new Error(`Failed to fetch balance: ${response.statusText}`);
|
|
12
|
+
}
|
|
13
|
+
const balanceData = await response.json();
|
|
14
|
+
return balanceData;
|
|
15
|
+
}
|
|
16
|
+
export function useSimBalance(address) {
|
|
17
|
+
return useQuery({
|
|
18
|
+
queryKey: ["simBalance", address],
|
|
19
|
+
queryFn: () => {
|
|
20
|
+
if (!address)
|
|
21
|
+
throw new Error("Address is required");
|
|
22
|
+
return fetchSimBalance(address);
|
|
23
|
+
},
|
|
24
|
+
enabled: Boolean(address),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -9,6 +9,7 @@ import { prepareTransaction, sendTransaction as twSendTransaction } from "thirdw
|
|
|
9
9
|
import { useSwitchChain, useWalletClient } from "wagmi";
|
|
10
10
|
import { useB3 } from "../components/index.js";
|
|
11
11
|
import { useAccountWallet } from "./useAccountWallet.js";
|
|
12
|
+
import { isAddress } from "viem";
|
|
12
13
|
const partnerId = String(process.env.PUBLIC_THIRDWEB_PARTNER_ID ||
|
|
13
14
|
process.env.NEXT_PUBLIC_THIRDWEB_PARTNER_ID ||
|
|
14
15
|
process.env.PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID ||
|
|
@@ -39,6 +40,7 @@ export function useUnifiedChainSwitchAndExecute() {
|
|
|
39
40
|
if (!targetChain) {
|
|
40
41
|
throw new Error(`Chain ${targetChainId} is not supported`);
|
|
41
42
|
}
|
|
43
|
+
invariant(isAddress(params.to), "params.to is not a valid address");
|
|
42
44
|
const hash = await walletClient.sendTransaction({
|
|
43
45
|
account: signer,
|
|
44
46
|
chain: targetChain,
|
|
@@ -104,7 +106,6 @@ export function useUnifiedChainSwitchAndExecute() {
|
|
|
104
106
|
try {
|
|
105
107
|
setIsSwitchingOrExecuting(true);
|
|
106
108
|
const chain = getThirdwebChain(targetChainId);
|
|
107
|
-
toast.info("Preparing transaction…");
|
|
108
109
|
const transaction = prepareTransaction({
|
|
109
110
|
client,
|
|
110
111
|
chain,
|
|
@@ -79,9 +79,9 @@ export interface ManageAccountModalProps extends BaseModalProps {
|
|
|
79
79
|
/** Partner ID */
|
|
80
80
|
partnerId: string;
|
|
81
81
|
/** Active Tab */
|
|
82
|
-
activeTab?: "
|
|
82
|
+
activeTab?: "overview" | "tokens" | "nfts" | "apps" | "settings";
|
|
83
83
|
/** Function to set the active tab */
|
|
84
|
-
setActiveTab?: (tab: "
|
|
84
|
+
setActiveTab?: (tab: "overview" | "tokens" | "nfts" | "apps" | "settings") => void;
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Props for the AnySpend modal
|
|
@@ -19,6 +19,15 @@ export function getProfileDisplayInfo(profile) {
|
|
|
19
19
|
type,
|
|
20
20
|
};
|
|
21
21
|
break;
|
|
22
|
+
case "farcaster":
|
|
23
|
+
displayInfo = {
|
|
24
|
+
title: details.name || details.username || "Unknown",
|
|
25
|
+
subtitle: details.username ? `@${details.username}` : "Farcaster Account",
|
|
26
|
+
imageUrl: details.profileImageUrl || null,
|
|
27
|
+
initial: "F",
|
|
28
|
+
type,
|
|
29
|
+
};
|
|
30
|
+
break;
|
|
22
31
|
case "google":
|
|
23
32
|
displayInfo = {
|
|
24
33
|
title: details.name || details.email || "Unknown",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
gtag: (...args: any[]) => void;
|
|
4
|
+
dataLayer: any[];
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Load Google Analytics 4 script and initialize
|
|
9
|
+
*/
|
|
10
|
+
export declare const loadGA4Script: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Send an analytics event to Google Analytics 4
|
|
13
|
+
* @param eventName - The name of the event to track
|
|
14
|
+
* @param parameters - Additional parameters to include with the event
|
|
15
|
+
*/
|
|
16
|
+
export declare const sendGA4Event: (eventName: string, parameters?: Record<string, any>) => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Global window interface augmentations for B3 SDK
|
|
2
|
+
const GA4_MEASUREMENT_ID = "G-VER9DKJH87";
|
|
3
|
+
/**
|
|
4
|
+
* Initialize Google Analytics 4
|
|
5
|
+
*/
|
|
6
|
+
const initializeGA4 = () => {
|
|
7
|
+
// Only initialize in browser environment
|
|
8
|
+
if (typeof window === "undefined")
|
|
9
|
+
return;
|
|
10
|
+
// Create gtag function if it doesn't exist
|
|
11
|
+
if (!window.gtag) {
|
|
12
|
+
window.dataLayer = window.dataLayer || [];
|
|
13
|
+
window.gtag = function gtag() {
|
|
14
|
+
window.dataLayer.push(arguments);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// Configure GA4
|
|
18
|
+
window.gtag("js", new Date());
|
|
19
|
+
window.gtag("config", GA4_MEASUREMENT_ID, {
|
|
20
|
+
page_location: window.location.href,
|
|
21
|
+
page_hostname: window.location.hostname,
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Load Google Analytics 4 script and initialize
|
|
26
|
+
*/
|
|
27
|
+
export const loadGA4Script = () => {
|
|
28
|
+
if (typeof window === "undefined")
|
|
29
|
+
return;
|
|
30
|
+
// Check if script is already loaded
|
|
31
|
+
if (document.querySelector(`script[src*="${GA4_MEASUREMENT_ID}"]`))
|
|
32
|
+
return;
|
|
33
|
+
const script = document.createElement("script");
|
|
34
|
+
script.async = true;
|
|
35
|
+
script.src = `https://www.googletagmanager.com/gtag/js?id=${GA4_MEASUREMENT_ID}`;
|
|
36
|
+
document.head.appendChild(script);
|
|
37
|
+
script.onload = initializeGA4;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Send an analytics event to Google Analytics 4
|
|
41
|
+
* @param eventName - The name of the event to track
|
|
42
|
+
* @param parameters - Additional parameters to include with the event
|
|
43
|
+
*/
|
|
44
|
+
export const sendGA4Event = (eventName, parameters) => {
|
|
45
|
+
// Only send events in browser environment
|
|
46
|
+
if (typeof window === "undefined" || !window.gtag)
|
|
47
|
+
return;
|
|
48
|
+
// Send event to GA4
|
|
49
|
+
window.gtag("event", eventName, parameters || {});
|
|
50
|
+
};
|
|
@@ -14,3 +14,4 @@ export declare const THIRDWEB_CLIENT_ID: string;
|
|
|
14
14
|
export declare const CLIENT_APP_BUNDLE_ID: string;
|
|
15
15
|
export declare const B3_AUTH_COOKIE_NAME = "b3-auth";
|
|
16
16
|
export declare const ENS_GATEWAY_URL = "https://ens-gateway.b3.fun/";
|
|
17
|
+
export declare const PUBLIC_BASE_RPC_URL = "https://base-rpc.publicnode.com";
|
|
@@ -19,3 +19,4 @@ export const THIRDWEB_CLIENT_ID = process.env.NEXT_PUBLIC_THIRDWEB_CLIENT_ID ||
|
|
|
19
19
|
export const CLIENT_APP_BUNDLE_ID = process.env.EXPO_PUBLIC_B3_BUNDLE_ID || "";
|
|
20
20
|
export const B3_AUTH_COOKIE_NAME = "b3-auth";
|
|
21
21
|
export const ENS_GATEWAY_URL = "https://ens-gateway.b3.fun/";
|
|
22
|
+
export const PUBLIC_BASE_RPC_URL = "https://base-rpc.publicnode.com";
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"testnetConfigID": "66b380b0fae0f6d8266798d0",
|
|
30
30
|
"badge": "https://cdn.b3.fun/b3_logo.svg",
|
|
31
31
|
"color": "#3368ef",
|
|
32
|
-
"enabledFeatures": ["
|
|
32
|
+
"enabledFeatures": ["basement", "explorer"]
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"_id": "66b380b0fae0f6d8266798d0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"format": "svg"
|
|
50
50
|
},
|
|
51
51
|
"blockExplorers": {
|
|
52
|
-
"default": "https://sepolia
|
|
52
|
+
"default": "https://sepolia.explorer.b3.fun",
|
|
53
53
|
"explorerTitle": "B3 Sepolia Explorer"
|
|
54
54
|
},
|
|
55
55
|
"nativeCurrency": {
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
},
|
|
60
60
|
"testnet": true,
|
|
61
61
|
"badge": "https://cdn.b3.fun/b3_logo.svg",
|
|
62
|
-
"color": "#3368ef"
|
|
62
|
+
"color": "#3368ef",
|
|
63
|
+
"enabledFeatures": ["basement", "explorer"]
|
|
63
64
|
},
|
|
64
65
|
{
|
|
65
66
|
"_id": "66f2044afe5a3ac32a1de9ff",
|
|
@@ -89,7 +90,8 @@
|
|
|
89
90
|
},
|
|
90
91
|
"testnet": false,
|
|
91
92
|
"badge": "https://cdn.b3.fun/base-badge.svg",
|
|
92
|
-
"color": "#004ae7"
|
|
93
|
+
"color": "#004ae7",
|
|
94
|
+
"enabledFeatures": ["basement", "explorer"]
|
|
93
95
|
},
|
|
94
96
|
{
|
|
95
97
|
"_id": "66f3221afe5a3ac32a1dea00",
|
|
@@ -119,7 +121,8 @@
|
|
|
119
121
|
},
|
|
120
122
|
"testnet": false,
|
|
121
123
|
"badge": "https://cdn.b3.fun/base-badge.svg",
|
|
122
|
-
"color": "#004ae7"
|
|
124
|
+
"color": "#004ae7",
|
|
125
|
+
"enabledFeatures": ["basement"]
|
|
123
126
|
},
|
|
124
127
|
{
|
|
125
128
|
"_id": "6706b240d442b7a2f8cb9efa",
|
|
@@ -149,7 +152,8 @@
|
|
|
149
152
|
},
|
|
150
153
|
"testnet": true,
|
|
151
154
|
"badge": "https://cdn.b3.fun/eth-badge.svg",
|
|
152
|
-
"color": "#B38DF0"
|
|
155
|
+
"color": "#B38DF0",
|
|
156
|
+
"enabledFeatures": ["basement"]
|
|
153
157
|
},
|
|
154
158
|
{
|
|
155
159
|
"_id": "671945d9d442b7a2f8cb9efe",
|
|
@@ -178,7 +182,8 @@
|
|
|
178
182
|
},
|
|
179
183
|
"testnet": true,
|
|
180
184
|
"badge": "https://cdn.b3.fun/eth-badge.svg",
|
|
181
|
-
"color": "#B38DF0"
|
|
185
|
+
"color": "#B38DF0",
|
|
186
|
+
"enabledFeatures": ["basement"]
|
|
182
187
|
},
|
|
183
188
|
{
|
|
184
189
|
"_id": "679a4a91703428bb5bb2f1ba",
|
|
@@ -208,7 +213,8 @@
|
|
|
208
213
|
},
|
|
209
214
|
"testnet": false,
|
|
210
215
|
"badge": "https://cdn.b3.fun/avalanche-badge.svg",
|
|
211
|
-
"color": "#c33738"
|
|
216
|
+
"color": "#c33738",
|
|
217
|
+
"enabledFeatures": ["basement"]
|
|
212
218
|
},
|
|
213
219
|
{
|
|
214
220
|
"_id": "679be46ca0f78fd619f6954b",
|
|
@@ -238,7 +244,8 @@
|
|
|
238
244
|
},
|
|
239
245
|
"testnet": false,
|
|
240
246
|
"badge": "https://cdn.b3.fun/geist-logo.svg",
|
|
241
|
-
"color": "#808080"
|
|
247
|
+
"color": "#808080",
|
|
248
|
+
"enabledFeatures": ["basement"]
|
|
242
249
|
},
|
|
243
250
|
{
|
|
244
251
|
"_id": "679be960a0f78fd619f6954d",
|
|
@@ -268,7 +275,8 @@
|
|
|
268
275
|
},
|
|
269
276
|
"testnet": false,
|
|
270
277
|
"badge": "https://cdn.b3.fun/arbitrum-badge.svg",
|
|
271
|
-
"color": "#4a5c7e"
|
|
278
|
+
"color": "#4a5c7e",
|
|
279
|
+
"enabledFeatures": ["basement"]
|
|
272
280
|
},
|
|
273
281
|
{
|
|
274
282
|
"_id": "679be9eba0f78fd619f6954f",
|
|
@@ -298,7 +306,8 @@
|
|
|
298
306
|
},
|
|
299
307
|
"testnet": false,
|
|
300
308
|
"badge": "https://cdn.b3.fun/ronin-logo.svg",
|
|
301
|
-
"color": "#004de5"
|
|
309
|
+
"color": "#004de5",
|
|
310
|
+
"enabledFeatures": ["basement"]
|
|
302
311
|
},
|
|
303
312
|
{
|
|
304
313
|
"_id": "679beabca0f78fd619f69551",
|
|
@@ -328,7 +337,8 @@
|
|
|
328
337
|
},
|
|
329
338
|
"testnet": false,
|
|
330
339
|
"badge": "https://cdn.b3.fun/solana-logo.png",
|
|
331
|
-
"color": "#9945FF"
|
|
340
|
+
"color": "#9945FF",
|
|
341
|
+
"enabledFeatures": ["basement"]
|
|
332
342
|
},
|
|
333
343
|
{
|
|
334
344
|
"_id": "67a452dda0f78fd619f69558",
|
|
@@ -358,7 +368,8 @@
|
|
|
358
368
|
},
|
|
359
369
|
"testnet": true,
|
|
360
370
|
"badge": "https://cdn.b3.fun/gunz-logo.svg",
|
|
361
|
-
"color": "#c8edfa"
|
|
371
|
+
"color": "#c8edfa",
|
|
372
|
+
"enabledFeatures": ["basement"]
|
|
362
373
|
},
|
|
363
374
|
{
|
|
364
375
|
"_id": "67aede9db3ba503f51eeaff7",
|
|
@@ -388,7 +399,8 @@
|
|
|
388
399
|
},
|
|
389
400
|
"testnet": false,
|
|
390
401
|
"badge": "https://cdn.b3.fun/ton-logo.svg",
|
|
391
|
-
"color": "#0088cc"
|
|
402
|
+
"color": "#0088cc",
|
|
403
|
+
"enabledFeatures": ["basement"]
|
|
392
404
|
},
|
|
393
405
|
{
|
|
394
406
|
"_id": "67b7895fb3ba503f51eeaffc",
|
|
@@ -418,7 +430,8 @@
|
|
|
418
430
|
},
|
|
419
431
|
"testnet": false,
|
|
420
432
|
"badge": "https://cdn.b3.fun/optimism-badge.svg",
|
|
421
|
-
"color": "#d6031b"
|
|
433
|
+
"color": "#d6031b",
|
|
434
|
+
"enabledFeatures": ["basement"]
|
|
422
435
|
},
|
|
423
436
|
{
|
|
424
437
|
"_id": "67bcbdb782f62aa6dc1efa60",
|
|
@@ -448,7 +461,8 @@
|
|
|
448
461
|
},
|
|
449
462
|
"testnet": false,
|
|
450
463
|
"badge": "https://cdn.b3.fun/polygon-badge.svg",
|
|
451
|
-
"color": "#7540cf"
|
|
464
|
+
"color": "#7540cf",
|
|
465
|
+
"enabledFeatures": ["basement"]
|
|
452
466
|
},
|
|
453
467
|
{
|
|
454
468
|
"_id": "6837258b25c59b8e08f806bf",
|
|
@@ -478,6 +492,160 @@
|
|
|
478
492
|
},
|
|
479
493
|
"testnet": false,
|
|
480
494
|
"badge": "https://avatars.githubusercontent.com/u/45615063?s=280&v=4",
|
|
481
|
-
"color": "#F3BA2F"
|
|
495
|
+
"color": "#F3BA2F",
|
|
496
|
+
"enabledFeatures": ["basement"]
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"_id": "684afd314a478ffb44a4f83e",
|
|
500
|
+
"id": 19934,
|
|
501
|
+
"name": "B4 Testnet",
|
|
502
|
+
"rpcUrls": {
|
|
503
|
+
"default": {
|
|
504
|
+
"http": "https://b4-testnet.rpc.caldera.xyz/http",
|
|
505
|
+
"ws": "wss://b4-testnet.rpc.caldera.xyz/ws"
|
|
506
|
+
},
|
|
507
|
+
"backups": []
|
|
508
|
+
},
|
|
509
|
+
"icon": {
|
|
510
|
+
"url": "https://cdn.b3.fun/b4-logo.png",
|
|
511
|
+
"width": 32,
|
|
512
|
+
"height": 32,
|
|
513
|
+
"format": "svg"
|
|
514
|
+
},
|
|
515
|
+
"blockExplorers": {
|
|
516
|
+
"default": "https://b4-testnet.explorer.caldera.xyz",
|
|
517
|
+
"explorerTitle": "B4 Testnet Explorer"
|
|
518
|
+
},
|
|
519
|
+
"nativeCurrency": {
|
|
520
|
+
"name": "Ether",
|
|
521
|
+
"symbol": "ETH",
|
|
522
|
+
"decimals": 18
|
|
523
|
+
},
|
|
524
|
+
"testnet": true,
|
|
525
|
+
"badge": "https://cdn.b3.fun/b4-logo.png",
|
|
526
|
+
"color": "#3368ef",
|
|
527
|
+
"enabledFeatures": ["explorer"]
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"_id": "684afdec4a478ffb44a4f83f",
|
|
531
|
+
"id": 243,
|
|
532
|
+
"name": "Reach Testnet",
|
|
533
|
+
"rpcUrls": {
|
|
534
|
+
"default": {
|
|
535
|
+
"http": "https://reach-testnet.rpc.caldera.xyz/http",
|
|
536
|
+
"ws": "wss://reach-testnet.rpc.caldera.xyz/ws"
|
|
537
|
+
},
|
|
538
|
+
"backups": []
|
|
539
|
+
},
|
|
540
|
+
"icon": {
|
|
541
|
+
"url": "https://cdn.b3.fun/reach-logo.png",
|
|
542
|
+
"width": 32,
|
|
543
|
+
"height": 32,
|
|
544
|
+
"format": "png"
|
|
545
|
+
},
|
|
546
|
+
"blockExplorers": {
|
|
547
|
+
"default": "https://reach-testnet.explorer.caldera.xyz",
|
|
548
|
+
"explorerTitle": "Reach Testnet Explorer"
|
|
549
|
+
},
|
|
550
|
+
"nativeCurrency": {
|
|
551
|
+
"name": "Ether",
|
|
552
|
+
"symbol": "ETH",
|
|
553
|
+
"decimals": 18
|
|
554
|
+
},
|
|
555
|
+
"testnet": true,
|
|
556
|
+
"badge": "https://cdn.b3.fun/reach-logo.png",
|
|
557
|
+
"color": "#3368ef",
|
|
558
|
+
"enabledFeatures": ["explorer"]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"_id": "684afed04a478ffb44a4f840",
|
|
562
|
+
"id": 10211403,
|
|
563
|
+
"name": "GLHF Testnet",
|
|
564
|
+
"rpcUrls": {
|
|
565
|
+
"default": {
|
|
566
|
+
"http": "https://glhf-testnet.rpc.caldera.xyz/http",
|
|
567
|
+
"ws": "wss://glhf-testnet.rpc.caldera.xyz/ws"
|
|
568
|
+
},
|
|
569
|
+
"backups": []
|
|
570
|
+
},
|
|
571
|
+
"icon": {
|
|
572
|
+
"url": "https://cdn.b3.fun/supergaming-logo.png",
|
|
573
|
+
"width": 62,
|
|
574
|
+
"height": 48,
|
|
575
|
+
"format": "png"
|
|
576
|
+
},
|
|
577
|
+
"blockExplorers": {
|
|
578
|
+
"default": "https://glhf-testnet.explorer.caldera.xyz",
|
|
579
|
+
"explorerTitle": "SuperGaming Testnet Explorer"
|
|
580
|
+
},
|
|
581
|
+
"nativeCurrency": {
|
|
582
|
+
"name": "Ether",
|
|
583
|
+
"symbol": "ETH",
|
|
584
|
+
"decimals": 18
|
|
585
|
+
},
|
|
586
|
+
"testnet": true,
|
|
587
|
+
"badge": "https://cdn.b3.fun/supergaming-logo.png",
|
|
588
|
+
"color": "#000000",
|
|
589
|
+
"enabledFeatures": ["explorer"]
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"_id": "685341f5ac22b8c3faae86ae",
|
|
593
|
+
"id": 4224,
|
|
594
|
+
"name": "Arpa Testnet",
|
|
595
|
+
"rpcUrls": {
|
|
596
|
+
"default": {
|
|
597
|
+
"http": "https://arpachain.calderachain.xyz/http",
|
|
598
|
+
"ws": "wss://arpachain.calderachain.xyz/ws"
|
|
599
|
+
},
|
|
600
|
+
"backups": []
|
|
601
|
+
},
|
|
602
|
+
"icon": {
|
|
603
|
+
"url": "https://cdn.b3.fun/arpa-logo.png",
|
|
604
|
+
"width": 175,
|
|
605
|
+
"height": 158,
|
|
606
|
+
"format": "png"
|
|
607
|
+
},
|
|
608
|
+
"blockExplorers": {
|
|
609
|
+
"default": "https://arpachain.calderaexplorer.xyz/",
|
|
610
|
+
"explorerTitle": "ArpaChain Testnet Explorer"
|
|
611
|
+
},
|
|
612
|
+
"nativeCurrency": {
|
|
613
|
+
"name": "Ether",
|
|
614
|
+
"symbol": "ETH",
|
|
615
|
+
"decimals": 18
|
|
616
|
+
},
|
|
617
|
+
"testnet": true,
|
|
618
|
+
"badge": "https://cdn.b3.fun/arpa-logo.png",
|
|
619
|
+
"color": "#3368ef",
|
|
620
|
+
"enabledFeatures": ["explorer"]
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"_id": "68a351c603e65c07b7645581",
|
|
624
|
+
"id": 1448000,
|
|
625
|
+
"name": "XRPLT",
|
|
626
|
+
"rpcUrls": {
|
|
627
|
+
"default": {
|
|
628
|
+
"http": "https://xrplt.rpc.caldera.xyz/http",
|
|
629
|
+
"ws": "wss://xrplt.rpc.caldera.xyz/ws"
|
|
630
|
+
},
|
|
631
|
+
"backups": []
|
|
632
|
+
},
|
|
633
|
+
"icon": {
|
|
634
|
+
"url": "https://cdn.b3.fun/xrpl_logo.svg",
|
|
635
|
+
"width": 32,
|
|
636
|
+
"height": 32,
|
|
637
|
+
"format": "svg"
|
|
638
|
+
},
|
|
639
|
+
"blockExplorers": {
|
|
640
|
+
"default": "https://xrplt.explorer.caldera.xyz/",
|
|
641
|
+
"explorerTitle": "XRPLT Explorer"
|
|
642
|
+
},
|
|
643
|
+
"nativeCurrency": {
|
|
644
|
+
"name": "XRP",
|
|
645
|
+
"symbol": "XRP",
|
|
646
|
+
"decimals": 18
|
|
647
|
+
},
|
|
648
|
+
"testnet": true,
|
|
649
|
+
"enabledFeatures": ["xcade", "explorer"]
|
|
482
650
|
}
|
|
483
651
|
]
|