@b3dotfun/sdk 0.0.14-alpha.2 → 0.0.14-alpha.4

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.
Files changed (105) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +38 -38
  2. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +18 -18
  3. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +70 -70
  4. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +22 -22
  5. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +7 -7
  6. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +21 -21
  7. package/dist/cjs/anyspend/react/components/AnySpendTournament.js +2 -2
  8. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +24 -24
  9. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -4
  10. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +6 -6
  11. package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +12 -12
  12. package/dist/cjs/anyspend/utils/orderPayload.js +1 -1
  13. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +5 -6
  14. package/dist/cjs/global-account/react/components/ManageAccount/ManageAccount.js +1 -1
  15. package/dist/cjs/global-account/react/components/ProfileAvatar.js +1 -1
  16. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +1 -1
  17. package/dist/cjs/global-account/react/components/custom/StaggeredFadeLoader.js +2 -2
  18. package/dist/cjs/global-account/react/components/magicui/AnimatedLottie.js +12 -12
  19. package/dist/cjs/global-account/react/components/ui/TabSystem.js +11 -11
  20. package/dist/cjs/global-account/react/components/ui/command.d.ts +1 -2
  21. package/dist/cjs/global-account/react/components/ui/input.d.ts +1 -2
  22. package/dist/cjs/global-account/react/components/ui/text-loop.d.ts +1 -1
  23. package/dist/cjs/global-account/react/components/ui/text-loop.js +6 -6
  24. package/dist/cjs/global-account/react/components/ui/text-shimmer.js +4 -4
  25. package/dist/cjs/global-account/react/components/ui/transition-panel.d.ts +1 -1
  26. package/dist/cjs/global-account/react/components/ui/transition-panel.js +2 -2
  27. package/dist/cjs/global-account/react/hooks/useChainSwitchWithAction.js +7 -3
  28. package/dist/cjs/shared/constants/chains/supported.d.ts +6 -2
  29. package/dist/cjs/shared/constants/chains/supported.js +17 -10
  30. package/dist/cjs/shared/utils/debug.js +1 -1
  31. package/dist/cjs/shared/utils/sprinter.js +1 -1
  32. package/dist/esm/anyspend/react/components/AnySpend.js +1 -1
  33. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +1 -1
  34. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +49 -49
  35. package/dist/esm/anyspend/react/components/AnySpendCustom.js +1 -1
  36. package/dist/esm/anyspend/react/components/AnySpendNFT.js +1 -1
  37. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +1 -1
  38. package/dist/esm/anyspend/react/components/AnySpendTournament.js +1 -1
  39. package/dist/esm/anyspend/react/components/common/OrderDetails.js +1 -1
  40. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +1 -1
  41. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -1
  42. package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +1 -1
  43. package/dist/esm/anyspend/utils/orderPayload.js +1 -1
  44. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +6 -7
  45. package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +1 -1
  46. package/dist/esm/global-account/react/components/ProfileAvatar.js +1 -1
  47. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  48. package/dist/esm/global-account/react/components/custom/StaggeredFadeLoader.js +1 -1
  49. package/dist/esm/global-account/react/components/magicui/AnimatedLottie.js +1 -1
  50. package/dist/esm/global-account/react/components/ui/TabSystem.js +1 -1
  51. package/dist/esm/global-account/react/components/ui/command.d.ts +1 -2
  52. package/dist/esm/global-account/react/components/ui/input.d.ts +1 -2
  53. package/dist/esm/global-account/react/components/ui/text-loop.d.ts +1 -1
  54. package/dist/esm/global-account/react/components/ui/text-loop.js +1 -1
  55. package/dist/esm/global-account/react/components/ui/text-shimmer.js +1 -1
  56. package/dist/esm/global-account/react/components/ui/transition-panel.d.ts +1 -1
  57. package/dist/esm/global-account/react/components/ui/transition-panel.js +1 -1
  58. package/dist/esm/global-account/react/hooks/useAuthentication.js +1 -1
  59. package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.js +4 -3
  60. package/dist/esm/shared/constants/chains/supported.d.ts +6 -2
  61. package/dist/esm/shared/constants/chains/supported.js +17 -10
  62. package/dist/esm/shared/utils/debug.js +1 -1
  63. package/dist/esm/shared/utils/sprinter.js +1 -1
  64. package/dist/types/global-account/react/components/ui/command.d.ts +1 -2
  65. package/dist/types/global-account/react/components/ui/input.d.ts +1 -2
  66. package/dist/types/global-account/react/components/ui/text-loop.d.ts +1 -1
  67. package/dist/types/global-account/react/components/ui/transition-panel.d.ts +1 -1
  68. package/dist/types/shared/constants/chains/supported.d.ts +6 -2
  69. package/package.json +3 -4
  70. package/src/anyspend/react/components/AnySpend.tsx +1 -1
  71. package/src/anyspend/react/components/AnySpendBondKit.tsx +1 -1
  72. package/src/anyspend/react/components/AnySpendBuySpin.tsx +63 -60
  73. package/src/anyspend/react/components/AnySpendCustom.tsx +1 -1
  74. package/src/anyspend/react/components/AnySpendNFT.tsx +1 -1
  75. package/src/anyspend/react/components/AnySpendStakeB3.tsx +1 -1
  76. package/src/anyspend/react/components/AnySpendTournament.tsx +3 -3
  77. package/src/anyspend/react/components/common/OrderDetails.tsx +1 -1
  78. package/src/anyspend/react/components/common/PanelOnramp.tsx +1 -1
  79. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +1 -1
  80. package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +1 -1
  81. package/src/anyspend/react/hooks/useAnyspendOrderHistory.ts +2 -2
  82. package/src/anyspend/services/anyspend.ts +2 -2
  83. package/src/anyspend/utils/orderPayload.ts +1 -1
  84. package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +1 -1
  85. package/src/global-account/react/components/B3Provider/B3Provider.tsx +14 -12
  86. package/src/global-account/react/components/ManageAccount/ManageAccount.tsx +1 -1
  87. package/src/global-account/react/components/ProfileAvatar.tsx +1 -1
  88. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +8 -8
  89. package/src/global-account/react/components/custom/StaggeredFadeLoader.tsx +1 -1
  90. package/src/global-account/react/components/magicui/AnimatedLottie.tsx +1 -1
  91. package/src/global-account/react/components/ui/TabSystem.tsx +1 -1
  92. package/src/global-account/react/components/ui/command.tsx +1 -1
  93. package/src/global-account/react/components/ui/input.tsx +1 -1
  94. package/src/global-account/react/components/ui/text-loop.tsx +1 -1
  95. package/src/global-account/react/components/ui/text-shimmer.tsx +1 -1
  96. package/src/global-account/react/components/ui/transition-panel.tsx +1 -1
  97. package/src/global-account/react/hooks/useAuthentication.ts +1 -1
  98. package/src/global-account/react/hooks/useChainSwitchWithAction.ts +4 -3
  99. package/src/global-account/react/hooks/useTokenPrice.tsx +1 -1
  100. package/src/shared/constants/chains/supported.ts +17 -10
  101. package/src/shared/utils/centerTruncate.ts +1 -1
  102. package/src/shared/utils/debug.ts +1 -1
  103. package/src/shared/utils/formatNumber.ts +1 -1
  104. package/src/shared/utils/simplehash.ts +1 -1
  105. package/src/shared/utils/sprinter.ts +1 -1
@@ -9,7 +9,7 @@ import {
9
9
  } from "@b3dotfun/sdk/global-account/react";
10
10
  import { AnySpendBondKitProps } from "@b3dotfun/sdk/global-account/react/stores/useModalStore";
11
11
  import { baseMainnet } from "@b3dotfun/sdk/shared/constants/chains/supported";
12
- import { motion } from "framer-motion";
12
+ import { motion } from "motion/react";
13
13
  import { useEffect, useMemo, useState } from "react";
14
14
  import { createPublicClient, encodeFunctionData, formatEther, http, parseEther } from "viem";
15
15
  import { ABI_bondKit } from "../../abis/bondKit";
@@ -11,9 +11,9 @@ import {
11
11
  useTokenBalance,
12
12
  } from "@b3dotfun/sdk/global-account/react";
13
13
  import { baseMainnet } from "@b3dotfun/sdk/shared/constants/chains/supported";
14
- import { motion } from "framer-motion";
15
14
  import invariant from "invariant";
16
15
  import { ArrowRight, Loader2 } from "lucide-react";
16
+ import { motion } from "motion/react";
17
17
  import { useCallback, useEffect, useState } from "react";
18
18
  import { toast } from "sonner";
19
19
  import { createPublicClient, encodeFunctionData, erc20Abi, formatUnits, http } from "viem";
@@ -202,13 +202,74 @@ export function AnySpendBuySpin({
202
202
  const [displayQuantity, setDisplayQuantity] = useState<string>("");
203
203
  const [debouncedQuantity, setDebouncedQuantity] = useState<string>("");
204
204
 
205
+ const validateAndSetQuantity = useCallback(
206
+ (value: string) => {
207
+ // Only allow positive integers
208
+ const isValidFormat = /^\d+$/.test(value) || value === "";
209
+
210
+ if (!isValidFormat && value !== "") {
211
+ return;
212
+ }
213
+
214
+ setDisplayQuantity(value);
215
+
216
+ try {
217
+ if (value === "") {
218
+ setUserSpinQuantity("");
219
+ setIsQuantityValid(false);
220
+ setValidationError("");
221
+ return;
222
+ }
223
+
224
+ const numValue = parseInt(value);
225
+ if (isNaN(numValue) || numValue <= 0) {
226
+ setIsQuantityValid(false);
227
+ setUserSpinQuantity("");
228
+ setValidationError("Please enter a valid positive number");
229
+ return;
230
+ }
231
+
232
+ // Check maximum entries per user (0 means no limit)
233
+ if (
234
+ paymentConfig &&
235
+ paymentConfig.maxEntriesPerUser > BigInt(0) &&
236
+ BigInt(numValue) > paymentConfig.maxEntriesPerUser
237
+ ) {
238
+ setIsQuantityValid(false);
239
+ setUserSpinQuantity("");
240
+ setValidationError(`Maximum ${paymentConfig.maxEntriesPerUser.toString()} spins allowed`);
241
+ return;
242
+ }
243
+
244
+ // Check if quantity exceeds remaining entries
245
+ if (wheelInfo && BigInt(numValue) > wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_) {
246
+ setIsQuantityValid(false);
247
+ setUserSpinQuantity("");
248
+ setValidationError(
249
+ `Only ${(wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_).toString()} spins remaining`,
250
+ );
251
+ return;
252
+ }
253
+
254
+ setUserSpinQuantity(value);
255
+ setIsQuantityValid(true);
256
+ setValidationError("");
257
+ } catch (error) {
258
+ setIsQuantityValid(false);
259
+ setUserSpinQuantity("");
260
+ setValidationError("Please enter a valid quantity");
261
+ }
262
+ },
263
+ [paymentConfig, wheelInfo],
264
+ );
265
+
205
266
  useEffect(() => {
206
267
  if (prefillQuantity && wheelInfo) {
207
268
  const remainingSpins = wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_;
208
269
  const adjustedQuantity = BigInt(prefillQuantity) > remainingSpins ? remainingSpins.toString() : prefillQuantity;
209
270
  validateAndSetQuantity(adjustedQuantity);
210
271
  }
211
- }, [prefillQuantity, wheelInfo]);
272
+ }, [prefillQuantity, validateAndSetQuantity, wheelInfo]);
212
273
 
213
274
  // Calculate total cost
214
275
  const totalCost =
@@ -281,64 +342,6 @@ export function AnySpendBuySpin({
281
342
  return () => clearTimeout(timer);
282
343
  }, [displayQuantity, userSpinQuantity]);
283
344
 
284
- const validateAndSetQuantity = (value: string) => {
285
- // Only allow positive integers
286
- const isValidFormat = /^\d+$/.test(value) || value === "";
287
-
288
- if (!isValidFormat && value !== "") {
289
- return;
290
- }
291
-
292
- setDisplayQuantity(value);
293
-
294
- try {
295
- if (value === "") {
296
- setUserSpinQuantity("");
297
- setIsQuantityValid(false);
298
- setValidationError("");
299
- return;
300
- }
301
-
302
- const numValue = parseInt(value);
303
- if (isNaN(numValue) || numValue <= 0) {
304
- setIsQuantityValid(false);
305
- setUserSpinQuantity("");
306
- setValidationError("Please enter a valid positive number");
307
- return;
308
- }
309
-
310
- // Check maximum entries per user (0 means no limit)
311
- if (
312
- paymentConfig &&
313
- paymentConfig.maxEntriesPerUser > BigInt(0) &&
314
- BigInt(numValue) > paymentConfig.maxEntriesPerUser
315
- ) {
316
- setIsQuantityValid(false);
317
- setUserSpinQuantity("");
318
- setValidationError(`Maximum ${paymentConfig.maxEntriesPerUser.toString()} spins allowed`);
319
- return;
320
- }
321
-
322
- // Check if quantity exceeds remaining entries
323
- if (wheelInfo && BigInt(numValue) > wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_) {
324
- setIsQuantityValid(false);
325
- setUserSpinQuantity("");
326
- setValidationError(
327
- `Only ${(wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_).toString()} spins remaining`,
328
- );
329
- return;
330
- }
331
-
332
- setUserSpinQuantity(value);
333
- setIsQuantityValid(true);
334
- setValidationError("");
335
- } catch (error) {
336
- setIsQuantityValid(false);
337
- setUserSpinQuantity("");
338
- setValidationError("Please enter a valid quantity");
339
- }
340
- };
341
-
342
345
  const handleDirectBuying = async () => {
343
346
  if (!address || !basePublicClient || !userSpinQuantity || !paymentConfig) return;
344
347
 
@@ -40,9 +40,9 @@ import { cn } from "@b3dotfun/sdk/shared/utils";
40
40
  import centerTruncate from "@b3dotfun/sdk/shared/utils/centerTruncate";
41
41
  import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
42
42
  import { simpleHashChainToChainName } from "@b3dotfun/sdk/shared/utils/simplehash";
43
- import { motion } from "framer-motion";
44
43
  import invariant from "invariant";
45
44
  import { ChevronRightCircle, Loader2 } from "lucide-react";
45
+ import { motion } from "motion/react";
46
46
  import React, { useCallback, useEffect, useMemo, useState } from "react";
47
47
  import { toast } from "sonner";
48
48
  import { base, baseSepolia } from "viem/chains";
@@ -5,8 +5,8 @@ import { cn } from "@b3dotfun/sdk/shared/utils";
5
5
  import { getIpfsUrl } from "@b3dotfun/sdk/shared/utils/ipfs";
6
6
 
7
7
  import { formatDisplayNumber, formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
8
- import { AnimatePresence } from "framer-motion";
9
8
  import { MoreVertical } from "lucide-react";
9
+ import { AnimatePresence } from "motion/react";
10
10
  import { useEffect, useState } from "react";
11
11
  import { b3 } from "viem/chains";
12
12
  import { GetQuoteResponse } from "../../types/api_req_res";
@@ -11,9 +11,9 @@ import {
11
11
  useTokenBalance,
12
12
  } from "@b3dotfun/sdk/global-account/react";
13
13
  import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
14
- import { motion } from "framer-motion";
15
14
  import invariant from "invariant";
16
15
  import { ArrowRight, Loader2 } from "lucide-react";
16
+ import { motion } from "motion/react";
17
17
  import { useEffect, useState } from "react";
18
18
  import { toast } from "sonner";
19
19
  import { createPublicClient, encodeFunctionData, erc20Abi, http } from "viem";
@@ -1,9 +1,9 @@
1
+ import { components } from "@b3dotfun/sdk/anyspend/types/api";
2
+ import { GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
1
3
  import { cn } from "@b3dotfun/sdk/shared/utils";
2
4
  import { formatDisplayNumber, formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
3
- import { AnimatePresence } from "framer-motion";
5
+ import { AnimatePresence } from "motion/react";
4
6
  import { AnySpendCustom } from "./AnySpendCustom";
5
- import { components } from "@b3dotfun/sdk/anyspend/types/api";
6
- import { GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
7
7
 
8
8
  type AnySpendTournamentProps =
9
9
  | {
@@ -39,7 +39,6 @@ import {
39
39
  } from "@solana/spl-token";
40
40
  import { ComputeBudgetProgram, Connection, PublicKey, SystemProgram, Transaction } from "@solana/web3.js";
41
41
  import { WalletCoinbase, WalletMetamask, WalletPhantom, WalletTrust, WalletWalletConnect } from "@web3icons/react";
42
- import { motion } from "framer-motion";
43
42
  import {
44
43
  CheckIcon,
45
44
  ChevronDown,
@@ -51,6 +50,7 @@ import {
51
50
  RefreshCcw,
52
51
  SquareArrowOutUpRight,
53
52
  } from "lucide-react";
53
+ import { motion } from "motion/react";
54
54
  import { QRCodeSVG } from "qrcode.react";
55
55
  import { memo, useCallback, useEffect, useMemo, useState } from "react";
56
56
  import TimeAgo from "react-timeago";
@@ -1,6 +1,6 @@
1
1
  import { useCoinbaseOnrampOptions } from "@b3dotfun/sdk/anyspend/react";
2
2
  import { Input, useGetGeo } from "@b3dotfun/sdk/global-account/react";
3
- import { AnimatePresence, motion } from "framer-motion";
3
+ import { AnimatePresence, motion } from "motion/react";
4
4
  import { useRef } from "react";
5
5
  import { toast } from "sonner";
6
6
  import { PaymentOptions } from "./PaymentOptions";
@@ -3,9 +3,9 @@ import { components } from "@b3dotfun/sdk/anyspend/types/api";
3
3
  import { GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
4
4
  import { Button } from "@b3dotfun/sdk/global-account/react";
5
5
  import centerTruncate from "@b3dotfun/sdk/shared/utils/centerTruncate";
6
- import { motion } from "framer-motion";
7
6
  import invariant from "invariant";
8
7
  import { ChevronLeft, ChevronRight, Landmark, Loader2 } from "lucide-react";
8
+ import { motion } from "motion/react";
9
9
  import { useEffect, useRef, useState } from "react";
10
10
  import { toast } from "sonner";
11
11
  import { AnySpendFingerprintWrapper, getFingerprintConfig } from "../AnySpendFingerprintWrapper";
@@ -5,8 +5,8 @@ import { GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
5
5
  import centerTruncate from "@b3dotfun/sdk/shared/utils/centerTruncate";
6
6
  import { AddressElement, Elements, PaymentElement, useElements, useStripe } from "@stripe/react-stripe-js";
7
7
  import { loadStripe } from "@stripe/stripe-js";
8
- import { motion } from "framer-motion";
9
8
  import { Loader2 } from "lucide-react";
9
+ import { motion } from "motion/react";
10
10
  import { useEffect, useRef, useState } from "react";
11
11
  import { toast } from "sonner";
12
12
  import { formatUnits } from "viem";
@@ -5,8 +5,8 @@ import { useMemo } from "react";
5
5
  export function useAnyspendOrderHistory(
6
6
  isMainnet: boolean,
7
7
  creatorAddress: string | undefined,
8
- limit: number = 100,
9
- offset: number = 0,
8
+ limit = 100,
9
+ offset = 0,
10
10
  ) {
11
11
  const {
12
12
  data: rawData = [],
@@ -133,8 +133,8 @@ export const anyspendService = {
133
133
  getOrderHistory: async (
134
134
  isMainnet: boolean,
135
135
  creatorAddress: string | undefined,
136
- limit: number = 100,
137
- offset: number = 0,
136
+ limit = 100,
137
+ offset = 0,
138
138
  ): Promise<GetOrderHistoryResponse> => {
139
139
  const params = new URLSearchParams({
140
140
  limit: limit.toString(),
@@ -24,7 +24,7 @@ export const buildPayload = (orderType: components["schemas"]["Order"]["type"],
24
24
  return {
25
25
  contractAddress: normalizeAddress(nft.contractAddress),
26
26
  nftPrice: nft?.price || "",
27
- tokenId: nft?.tokenId!,
27
+ tokenId: nft.tokenId,
28
28
  contractType: nft?.type,
29
29
  };
30
30
  } else if (nft?.type === "erc721") {
@@ -1,6 +1,6 @@
1
1
  import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
2
2
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3
- import { createContext, useContext, useMemo, useState } from "react";
3
+ import { useState } from "react";
4
4
  import { ThirdwebProvider, useActiveAccount } from "thirdweb/react";
5
5
  import { Account } from "thirdweb/wallets";
6
6
  // import { RelayKitProviderWrapper } from "./RelayKitProviderWrapper";
@@ -3,7 +3,7 @@ import { User } from "@b3dotfun/sdk/global-account/types/b3-api.types";
3
3
  import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
4
4
  import { supportedChains } from "@b3dotfun/sdk/shared/constants/chains/supported";
5
5
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
6
- import { useEffect, useState } from "react";
6
+ import { useCallback, useEffect, useState } from "react";
7
7
  import { Toaster } from "sonner";
8
8
  import { ThirdwebProvider, useActiveAccount, useConnectedWallets, useSetActiveWallet } from "thirdweb/react";
9
9
  import { Account, Wallet } from "thirdweb/wallets";
@@ -108,28 +108,30 @@ export function InnerProvider({
108
108
  setManuallySetAccount(account);
109
109
  };
110
110
 
111
- const setWallet = (wallet: Wallet) => {
112
- setManuallySelectedWallet(wallet);
113
- const account = wallet.getAccount();
114
- setManuallySetAccount(account);
115
- console.log("@@gio:setWallet", wallet.id, account?.address);
116
- setActiveWallet(wallet);
117
- };
111
+ const setWallet = useCallback(
112
+ (wallet: Wallet) => {
113
+ setManuallySelectedWallet(wallet);
114
+ const account = wallet.getAccount();
115
+ setManuallySetAccount(account);
116
+ console.log("@@gio:setWallet", wallet.id, account?.address);
117
+ setActiveWallet(wallet);
118
+ },
119
+ [setManuallySelectedWallet, setManuallySetAccount, setActiveWallet],
120
+ );
118
121
 
119
- const setFirstEoa = () => {
122
+ const setFirstEoa = useCallback(() => {
120
123
  const firstEoa = wallets.find(wallet => ["com.coinbase.wallet", "io.metamask"].includes(wallet.id));
121
124
  if (firstEoa) {
122
125
  setWallet(firstEoa);
123
126
  }
124
- };
127
+ }, [setWallet, wallets]);
125
128
 
126
129
  useEffect(() => {
127
130
  if (automaticallySetFirstEoa) {
128
131
  console.log("@@gio:wallets", wallets);
129
132
  setFirstEoa();
130
133
  }
131
- // eslint-disable-next-line react-hooks/exhaustive-deps
132
- }, [automaticallySetFirstEoa, wallets]);
134
+ }, [automaticallySetFirstEoa, setFirstEoa, wallets]);
133
135
 
134
136
  return (
135
137
  <B3Context.Provider
@@ -152,7 +152,7 @@ export function ManageAccount({
152
152
 
153
153
  const AssetsContent = () => (
154
154
  <div className="bg-b3-react-card border-b3-react-border rounded-lg border p-4">
155
- <AccountAssets nfts={assets?.nftResponse!} isLoading={isLoading} />
155
+ {assets?.nftResponse && <AccountAssets nfts={assets.nftResponse} isLoading={isLoading} />}
156
156
  </div>
157
157
  );
158
158
 
@@ -1,6 +1,6 @@
1
1
  // "use client";
2
2
 
3
- // import { AnimatePresence, motion } from "framer-motion";
3
+ // import { AnimatePresence, motion } from "motion/react";
4
4
  // import { useEffect, useState } from "react";
5
5
  // import ClientOnly from "./custom/ClientOnly";
6
6
 
@@ -1,20 +1,20 @@
1
1
  import {
2
- Button,
3
- AuthButton,
4
- WalletRow,
5
- useAuthentication,
6
- useConnect,
7
- LoginStepContainer,
8
- useAuthStore,
9
2
  AllowedStrategy,
3
+ AuthButton,
4
+ Button,
10
5
  getConnectOptionsFromStrategy,
11
6
  isWalletType,
7
+ LoginStepContainer,
8
+ useAuthentication,
9
+ useAuthStore,
10
+ useConnect,
11
+ WalletRow,
12
12
  } from "@b3dotfun/sdk/global-account/react";
13
- import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
14
13
  import { useState } from "react";
15
14
  import { Chain } from "thirdweb";
16
15
  import { useConnect as useConnectTW } from "thirdweb/react";
17
16
  import { Account, createWallet, Wallet, WalletId } from "thirdweb/wallets";
17
+ import { client } from "@b3dotfun/sdk/shared/utils/thirdweb";
18
18
 
19
19
  interface LoginStepCustomProps {
20
20
  automaticallySetFirstEoa: boolean;
@@ -1,4 +1,4 @@
1
- import { motion } from "framer-motion";
1
+ import { motion } from "motion/react";
2
2
 
3
3
  export function StaggeredFadeLoader({ className = "bg-white/50", size = 4 }: { className?: string; size?: number }) {
4
4
  const circleVariants = {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { DotLottieReact } from "@lottiefiles/dotlottie-react";
4
- import { motion } from "framer-motion";
4
+ import { motion } from "motion/react";
5
5
  import React, { useCallback, useEffect, useMemo, useState } from "react";
6
6
 
7
7
  interface AnimatedLottieProps {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { TransitionPanel } from "@b3dotfun/sdk/global-account/react";
4
4
  import { cn } from "@b3dotfun/sdk/shared/utils/cn";
5
- import { AnimatePresence, motion } from "framer-motion";
5
+ import { AnimatePresence, motion } from "motion/react";
6
6
  import React, { ReactNode, createContext, useContext } from "react";
7
7
 
8
8
  interface TabsContextType {
@@ -24,7 +24,7 @@ const Command = React.forwardRef<
24
24
  ));
25
25
  Command.displayName = CommandPrimitive.displayName;
26
26
 
27
- interface CommandDialogProps extends DialogProps {}
27
+ type CommandDialogProps = DialogProps;
28
28
 
29
29
  const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
30
30
  return (
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
 
3
3
  import { cn } from "@b3dotfun/sdk/shared/utils";
4
4
 
5
- export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
5
+ export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
6
6
 
7
7
  const Input = React.forwardRef<HTMLInputElement, InputProps>(({ className, type, ...props }, ref) => {
8
8
  return (
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { cn } from "@b3dotfun/sdk/shared/utils/cn";
3
- import { AnimatePresence, motion, Transition, Variants } from "framer-motion";
3
+ import { AnimatePresence, motion, Transition, Variants } from "motion/react";
4
4
  import { Children, useEffect, useState } from "react";
5
5
 
6
6
  type TextLoopProps = {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { cn } from "@b3dotfun/sdk/shared/utils/cn";
3
- import { motion } from "framer-motion";
3
+ import { motion } from "motion/react";
4
4
  import React, { type JSX, useMemo } from "react";
5
5
 
6
6
  interface TextShimmerProps {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { cn } from "@b3dotfun/sdk/shared/utils/cn";
3
- import { AnimatePresence, MotionProps, Transition, Variant, motion } from "framer-motion";
3
+ import { AnimatePresence, MotionProps, Transition, Variant, motion } from "motion/react";
4
4
 
5
5
  type TransitionPanelProps = {
6
6
  children: React.ReactNode[];
@@ -1,5 +1,5 @@
1
1
  import app from "@b3dotfun/sdk/global-account/app";
2
- import { useB3, useAuthStore } from "@b3dotfun/sdk/global-account/react";
2
+ import { useAuthStore, useB3 } from "@b3dotfun/sdk/global-account/react";
3
3
  import { ecosystemWalletId } from "@b3dotfun/sdk/shared/constants";
4
4
  import { b3MainnetThirdWeb } from "@b3dotfun/sdk/shared/constants/chains/supported";
5
5
  import { debugB3React } from "@b3dotfun/sdk/shared/utils/debug";
@@ -1,6 +1,6 @@
1
1
  import { getChainName, getNativeToken } from "@b3dotfun/sdk/anyspend";
2
2
  import { supportedChains } from "@b3dotfun/sdk/shared/constants/chains/supported";
3
- import { invariant } from "framer-motion";
3
+ import invariant from "invariant";
4
4
  import { useCallback, useState } from "react";
5
5
  import { toast } from "sonner";
6
6
  import { WalletClient } from "viem";
@@ -46,14 +46,15 @@ export function useChainSwitchWithAction() {
46
46
  }
47
47
 
48
48
  try {
49
- invariant(!!targetChain.blockExplorers?.default.url, "Block explorer URL is required");
49
+ const blockExplorerUrl = targetChain.blockExplorers?.default.url;
50
+ invariant(blockExplorerUrl, "Block explorer URL is required");
50
51
  const nativeCurrency = getNativeToken(targetChainId);
51
52
  await switchChainAsync({
52
53
  chainId: targetChainId,
53
54
  addEthereumChainParameter: {
54
55
  chainName: targetChain.name,
55
56
  rpcUrls: [targetChain.rpcUrls.default.http[0]],
56
- blockExplorerUrls: [targetChain.blockExplorers?.default.url!],
57
+ blockExplorerUrls: [blockExplorerUrl],
57
58
  nativeCurrency: {
58
59
  name: nativeCurrency.name,
59
60
  symbol: nativeCurrency.symbol,
@@ -20,7 +20,7 @@ interface TokenPriceResponse {
20
20
  };
21
21
  }
22
22
 
23
- async function fetchTokenPrice(contractAddress: string, chainId: number, vsCurrency: string = "usd") {
23
+ async function fetchTokenPrice(contractAddress: string, chainId: number, vsCurrency = "usd") {
24
24
  const platformId = getPlatformId(chainId as ChainId);
25
25
  const response = await fetch(
26
26
  `https://pro-api.coingecko.com/api/v3/simple/token_price/${platformId}?contract_addresses=${contractAddress}&vs_currencies=${vsCurrency}`,
@@ -4,8 +4,10 @@ import invariant from "invariant";
4
4
 
5
5
  import type { Chain as ThirdwebChain } from "thirdweb";
6
6
  // Import the JSON directly
7
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7
8
  // @ts-ignore
8
9
  import chainNetworksJSON from "../../generated/chain-networks.json" with { type: "json" };
10
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9
11
  // @ts-ignore
10
12
  import coingeckoChainsJSON from "../../generated/coingecko-chains.json" with { type: "json" };
11
13
 
@@ -45,17 +47,22 @@ export function getCoingeckoChainInfo(chainId: number) {
45
47
  return coingeckoChains[chainId];
46
48
  }
47
49
 
48
- export const b3MainnetThirdWeb: ThirdwebChain = supportedChainsTW.find(chain => chain.id === 8333)!;
49
- invariant(b3MainnetThirdWeb, "B3 mainnet chain not found in supported chains TW");
50
+ const _b3MainnetThirdWeb: ThirdwebChain | undefined = supportedChainsTW.find(chain => chain.id === 8333);
51
+ invariant(_b3MainnetThirdWeb, "B3 mainnet chain not found in supported chains TW");
52
+ export const b3MainnetThirdWeb = _b3MainnetThirdWeb;
50
53
 
51
- export const b3TestnetThirdWeb: ThirdwebChain = supportedChainsTW.find(chain => chain.id === 1993)!;
52
- invariant(b3TestnetThirdWeb, "B3 testnet chain not found in supported chains TW");
54
+ const _b3TestnetThirdWeb: ThirdwebChain | undefined = supportedChainsTW.find(chain => chain.id === 1993);
55
+ invariant(_b3TestnetThirdWeb, "B3 testnet chain not found in supported chains TW");
56
+ export const b3TestnetThirdWeb = _b3TestnetThirdWeb;
53
57
 
54
- export const b3Mainnet = supportedChains.find(chain => chain.id === 8333)!;
55
- invariant(b3Mainnet, "B3 mainnet chain not found in supported chains");
58
+ const _b3Mainnet = supportedChains.find(chain => chain.id === 8333);
59
+ invariant(_b3Mainnet, "B3 mainnet chain not found in supported chains");
60
+ export const b3Mainnet = _b3Mainnet;
56
61
 
57
- export const b3Testnet = supportedChains.find(chain => chain.id === 1993)!;
58
- invariant(b3Testnet, "B3 testnet chain not found in supported chains");
62
+ const _b3Testnet = supportedChains.find(chain => chain.id === 1993);
63
+ invariant(_b3Testnet, "B3 testnet chain not found in supported chains");
64
+ export const b3Testnet = _b3Testnet;
59
65
 
60
- export const baseMainnet = supportedChains.find(chain => chain.id === 8453)!;
61
- invariant(baseMainnet, "Base mainnet chain not found in supported chains");
66
+ const _baseMainnet = supportedChains.find(chain => chain.id === 8453);
67
+ invariant(_baseMainnet, "Base mainnet chain not found in supported chains");
68
+ export const baseMainnet = _baseMainnet;
@@ -1,4 +1,4 @@
1
- export default function centerTruncate(str: string, x: number = 6, y: number = 4): string {
1
+ export default function centerTruncate(str: string, x = 6, y = 4): string {
2
2
  if (!str) return "";
3
3
 
4
4
  if (x + y >= str?.length) {
@@ -5,7 +5,7 @@ createDebug.formatters.h = v => {
5
5
  };
6
6
 
7
7
  export const debug = createDebug("@@b3dotfun/sdk");
8
- let debugMakers: Record<string, any> = {};
8
+ const debugMakers: Record<string, any> = {};
9
9
 
10
10
  export const debugB3React = (name: string) => {
11
11
  if (!debugMakers[name]) {
@@ -7,7 +7,7 @@ export function isString(value: unknown): value is string {
7
7
  return typeof value === "string" || value instanceof String;
8
8
  }
9
9
 
10
- export function formatNumber(amount: number | string, decimals: number = 3, useAbbreviations: boolean = false): string {
10
+ export function formatNumber(amount: number | string, decimals = 3, useAbbreviations = false): string {
11
11
  if (isString(amount)) {
12
12
  amount = parseFloat(amount);
13
13
  if (isNaN(amount)) {
@@ -310,7 +310,7 @@ export async function fetchSimpleHashData<T extends SimpleHashRoute>(
310
310
 
311
311
  export async function fetchFungibleAssets(
312
312
  fungibleIds: string[],
313
- includePrices: boolean = true,
313
+ includePrices = true,
314
314
  ): Promise<SimpleHashTypes.FungibleAsset | SimpleHashTypes.FungibleAsset[]> {
315
315
  const route = "/v0/fungibles/assets";
316
316
  const params = {
@@ -6,7 +6,7 @@
6
6
  // currentSprinterTestnet = state.sprinterTestnet;
7
7
  // });
8
8
 
9
- let currentSprinterTestnet = false;
9
+ const currentSprinterTestnet = false;
10
10
 
11
11
  export const getSprinterBaseUrl = (test?: boolean) => {
12
12
  const isTestnet = test || currentSprinterTestnet;