@b3dotfun/sdk 0.0.52 → 0.0.53

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.
@@ -12,6 +12,7 @@ export declare const b3Mainnet: {
12
12
  readonly url: "https://explorer.b3.fun";
13
13
  };
14
14
  };
15
+ blockTime?: number | undefined | undefined;
15
16
  contracts?: {
16
17
  [x: string]: import("viem").ChainContract | {
17
18
  [sourceId: number]: import("viem").ChainContract | undefined;
@@ -19,7 +20,7 @@ export declare const b3Mainnet: {
19
20
  ensRegistry?: import("viem").ChainContract | undefined;
20
21
  ensUniversalResolver?: import("viem").ChainContract | undefined;
21
22
  multicall3?: import("viem").ChainContract | undefined;
22
- universalSignatureVerifier?: import("viem").ChainContract | undefined;
23
+ erc6492Verifier?: import("viem").ChainContract | undefined;
23
24
  } | undefined;
24
25
  ensTlds?: readonly string[] | undefined;
25
26
  id: 8333;
@@ -29,6 +30,7 @@ export declare const b3Mainnet: {
29
30
  readonly symbol: "ETH";
30
31
  readonly decimals: 18;
31
32
  };
33
+ experimental_preconfirmationTime?: number | undefined | undefined;
32
34
  rpcUrls: {
33
35
  readonly default: {
34
36
  readonly http: readonly ["https://mainnet-rpc.b3.fun"];
@@ -56,6 +58,7 @@ export declare const getViemChainConfig: (config: ChainNetworks) => {
56
58
  readonly url: string;
57
59
  };
58
60
  };
61
+ blockTime?: number | undefined | undefined;
59
62
  contracts?: {
60
63
  [x: string]: import("viem").ChainContract | {
61
64
  [sourceId: number]: import("viem").ChainContract | undefined;
@@ -63,7 +66,7 @@ export declare const getViemChainConfig: (config: ChainNetworks) => {
63
66
  ensRegistry?: import("viem").ChainContract | undefined;
64
67
  ensUniversalResolver?: import("viem").ChainContract | undefined;
65
68
  multicall3?: import("viem").ChainContract | undefined;
66
- universalSignatureVerifier?: import("viem").ChainContract | undefined;
69
+ erc6492Verifier?: import("viem").ChainContract | undefined;
67
70
  } | undefined;
68
71
  ensTlds?: readonly string[] | undefined;
69
72
  id: number;
@@ -73,6 +76,7 @@ export declare const getViemChainConfig: (config: ChainNetworks) => {
73
76
  name: string;
74
77
  decimals: number;
75
78
  };
79
+ experimental_preconfirmationTime?: number | undefined | undefined;
76
80
  rpcUrls: {
77
81
  readonly default: {
78
82
  readonly http: readonly [string];
@@ -103,6 +107,7 @@ export declare const b3Chain: Chain | {
103
107
  readonly url: "https://explorer.b3.fun";
104
108
  };
105
109
  };
110
+ blockTime?: number | undefined | undefined;
106
111
  contracts?: {
107
112
  [x: string]: import("viem").ChainContract | {
108
113
  [sourceId: number]: import("viem").ChainContract | undefined;
@@ -110,7 +115,7 @@ export declare const b3Chain: Chain | {
110
115
  ensRegistry?: import("viem").ChainContract | undefined;
111
116
  ensUniversalResolver?: import("viem").ChainContract | undefined;
112
117
  multicall3?: import("viem").ChainContract | undefined;
113
- universalSignatureVerifier?: import("viem").ChainContract | undefined;
118
+ erc6492Verifier?: import("viem").ChainContract | undefined;
114
119
  } | undefined;
115
120
  ensTlds?: readonly string[] | undefined;
116
121
  id: 8333;
@@ -120,6 +125,7 @@ export declare const b3Chain: Chain | {
120
125
  readonly symbol: "ETH";
121
126
  readonly decimals: 18;
122
127
  };
128
+ experimental_preconfirmationTime?: number | undefined | undefined;
123
129
  rpcUrls: {
124
130
  readonly default: {
125
131
  readonly http: readonly ["https://mainnet-rpc.b3.fun"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -301,7 +301,7 @@
301
301
  "@solana/web3.js": "^1.98.2",
302
302
  "@stripe/react-stripe-js": "^3.7.0",
303
303
  "@stripe/stripe-js": "^7.3.1",
304
- "@thirdweb-dev/wagmi-adapter": "0.2.159",
304
+ "@thirdweb-dev/wagmi-adapter": "0.2.165",
305
305
  "@web3icons/react": "3.16.0",
306
306
  "big.js": "^7.0.1",
307
307
  "class-variance-authority": "0.7.0",
@@ -374,10 +374,11 @@
374
374
  "react": "^18.0.0 || ^19.0.0",
375
375
  "react-dom": "^18.0.0 || ^19.0.0",
376
376
  "react-native-mmkv": "^3.2.0",
377
- "thirdweb": "5.108.9",
377
+ "thirdweb": "5.108.14",
378
378
  "three": "^0.175.0",
379
- "viem": "^2.28.1",
380
- "wagmi": "^2.14.15"
379
+ "viem": "2.37.9",
380
+ "wagmi": "2.16.9",
381
+ "@wagmi/core": "2.20.3"
381
382
  },
382
383
  "peerDependenciesMeta": {
383
384
  "@react-three/postprocessing": {
@@ -4,6 +4,7 @@ import {
4
4
  useAuthentication,
5
5
  useB3,
6
6
  useB3BalanceFromAddresses,
7
+ useGlobalAccount,
7
8
  useModalStore,
8
9
  useNativeBalance,
9
10
  useProfile,
@@ -34,6 +35,7 @@ function centerTruncate(str: string, length = 4) {
34
35
 
35
36
  export function BalanceContent({ onLogout, showDeposit = true, showSwap = true }: BalanceContentProps) {
36
37
  const account = useActiveAccount();
38
+ const globalAccount = useGlobalAccount();
37
39
  const { address: eoaAddress, info: eoaInfo } = useFirstEOA();
38
40
  const { data: profile } = useProfile({
39
41
  address: eoaAddress || account?.address,
@@ -62,12 +64,13 @@ export function BalanceContent({ onLogout, showDeposit = true, showSwap = true }
62
64
 
63
65
  console.log("eoaAddress", eoaAddress);
64
66
  console.log("account?.address", account?.address);
67
+ console.log("globalAccount", globalAccount);
65
68
 
66
69
  // Balance data fetching
67
70
  const { data: eoaNativeBalance, isLoading: eoaNativeLoading } = useNativeBalance(eoaAddress);
68
71
  const { data: eoaB3Balance, isLoading: eoaB3Loading } = useB3BalanceFromAddresses(eoaAddress);
69
- const { data: b3Balance, isLoading: b3Loading } = useB3BalanceFromAddresses(account?.address);
70
- const { data: nativeBalance, isLoading: nativeLoading } = useNativeBalance(account?.address);
72
+ const { data: b3Balance, isLoading: b3Loading } = useB3BalanceFromAddresses(globalAccount?.address);
73
+ const { data: nativeBalance, isLoading: nativeLoading } = useNativeBalance(globalAccount?.address);
71
74
 
72
75
  // Calculate total USD values for comparison
73
76
  const globalAccountTotalUsd = (b3Balance?.balanceUsd || 0) + (nativeBalance?.totalUsd || 0);
@@ -184,7 +187,7 @@ export function BalanceContent({ onLogout, showDeposit = true, showSwap = true }
184
187
  {/* Global Account Balance Section */}
185
188
  <AccordionItem value="global-account" className="border-none">
186
189
  <AccordionTrigger className="text-b3-grey font-neue-montreal-semibold py-2 hover:no-underline">
187
- <span>Balance</span>
190
+ <span>Smart Account Balance</span>
188
191
  </AccordionTrigger>
189
192
  <AccordionContent className="space-y-4">
190
193
  <TokenBalanceRow
@@ -209,7 +212,7 @@ export function BalanceContent({ onLogout, showDeposit = true, showSwap = true }
209
212
  <AccordionItem value="eoa-account" className="border-none">
210
213
  <AccordionTrigger className="text-b3-grey font-neue-montreal-semibold py-2 hover:no-underline">
211
214
  <div className="flex items-center gap-3">
212
- <span>Connected {eoaInfo?.data?.name || "Wallet"}</span>
215
+ <span>{eoaInfo?.data?.name || "Wallet"}</span>
213
216
  <div className="address-button border-b3-line bg-b3-line/20 hover:bg-b3-line/40 flex w-fit items-center gap-2 rounded-full border px-3 py-1 transition-colors">
214
217
  <span className="text-b3-foreground-muted font-mono text-xs">{centerTruncate(eoaAddress, 6)}</span>
215
218
  <CopyToClipboard text={eoaAddress} />
@@ -1,12 +1,14 @@
1
1
  import { useAuthStore } from "@b3dotfun/sdk/global-account/react";
2
2
  import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
3
- import { useEffect, useState } from "react";
3
+ import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
4
+ import { useEffect, useMemo, useState } from "react";
5
+ import { viemAdapter } from "thirdweb/adapters/viem";
4
6
  import { useConnectedWallets, useWalletInfo } from "thirdweb/react";
5
7
  import { Wallet } from "thirdweb/wallets";
6
8
 
7
9
  const debug = debugB3React("useFirstEOA");
8
10
 
9
- export function useFirstEOA() {
11
+ export function useFirstEOA(chain?: { id: number; name: string; rpc: string }) {
10
12
  const wallets = useConnectedWallets();
11
13
  const isConnected = useAuthStore(state => state.isConnected);
12
14
  const [firstEOA, setFirstEOA] = useState<Wallet | undefined>(undefined);
@@ -39,9 +41,25 @@ export function useFirstEOA() {
39
41
  autoSelectFirstEOAWallet();
40
42
  }, [isConnected, wallets]);
41
43
 
44
+ const walletClient = useMemo(() => {
45
+ if (!firstEOA) return undefined;
46
+ if (!chain) return undefined;
47
+ try {
48
+ const viemClientWallet = viemAdapter.wallet.toViem({
49
+ client,
50
+ chain,
51
+ wallet: firstEOA,
52
+ });
53
+ return viemClientWallet;
54
+ } catch (err) {
55
+ console.error("Error setting wallet client", err);
56
+ }
57
+ }, [firstEOA, chain]);
58
+
42
59
  return {
43
60
  account: firstEOA,
44
61
  address,
45
62
  info: walletInfo,
63
+ walletClient,
46
64
  };
47
65
  }