@b3dotfun/sdk 0.1.69-alpha.16 → 0.1.69-alpha.18

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 (125) hide show
  1. package/dist/cjs/anyspend/constants/rpc.d.ts +1 -1
  2. package/dist/cjs/anyspend/constants/rpc.js +1 -1
  3. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
  4. package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +3 -3
  5. package/dist/cjs/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
  6. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +2 -2
  7. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
  8. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
  9. package/dist/cjs/anyspend/utils/chain.js +8 -7
  10. package/dist/cjs/global-account/better-auth-client.d.ts +1883 -0
  11. package/dist/cjs/global-account/better-auth-client.js +17 -0
  12. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
  13. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
  14. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +4 -1
  15. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +3 -2
  16. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
  17. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +120 -0
  18. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
  19. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +67 -0
  20. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +34 -0
  21. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +149 -0
  22. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +9 -3
  23. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -0
  24. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +123 -0
  25. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +5 -1
  26. package/dist/cjs/global-account/react/components/custom/Button.d.ts +1 -1
  27. package/dist/cjs/global-account/react/components/index.d.ts +3 -0
  28. package/dist/cjs/global-account/react/components/index.js +7 -3
  29. package/dist/cjs/global-account/react/components/ui/button.d.ts +1 -1
  30. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -0
  31. package/dist/cjs/global-account/react/hooks/index.js +4 -2
  32. package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +969 -0
  33. package/dist/cjs/global-account/react/hooks/useBetterAuth.js +142 -0
  34. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +7 -7
  35. package/dist/cjs/shared/constants/chains/b3Chain.js +4 -4
  36. package/dist/cjs/shared/constants/chains/b3Viem.d.ts +6 -0
  37. package/dist/cjs/shared/constants/chains/b3Viem.js +19 -0
  38. package/dist/cjs/shared/constants/chains/supported.d.ts +1 -1
  39. package/dist/cjs/shared/generated/chain-networks.json +2 -2
  40. package/dist/cjs/shared/utils/chains.d.ts +1 -1
  41. package/dist/cjs/shared/utils/chains.js +2 -2
  42. package/dist/esm/anyspend/constants/rpc.d.ts +1 -1
  43. package/dist/esm/anyspend/constants/rpc.js +1 -1
  44. package/dist/esm/anyspend/react/components/AnySpendNFT.js +2 -2
  45. package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +3 -3
  46. package/dist/esm/anyspend/react/components/common/InsufficientDepositPayment.js +2 -2
  47. package/dist/esm/anyspend/react/components/common/OrderDetails.js +2 -2
  48. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +2 -2
  49. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +2 -2
  50. package/dist/esm/anyspend/utils/chain.js +10 -9
  51. package/dist/esm/global-account/better-auth-client.d.ts +1883 -0
  52. package/dist/esm/global-account/better-auth-client.js +13 -0
  53. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
  54. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +2 -1
  55. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +4 -1
  56. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +3 -2
  57. package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
  58. package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +115 -0
  59. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
  60. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthResetPassword.js +64 -0
  61. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +34 -0
  62. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +146 -0
  63. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +9 -3
  64. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -0
  65. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +120 -0
  66. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +5 -1
  67. package/dist/esm/global-account/react/components/custom/Button.d.ts +1 -1
  68. package/dist/esm/global-account/react/components/index.d.ts +3 -0
  69. package/dist/esm/global-account/react/components/index.js +2 -0
  70. package/dist/esm/global-account/react/components/ui/button.d.ts +1 -1
  71. package/dist/esm/global-account/react/hooks/index.d.ts +1 -0
  72. package/dist/esm/global-account/react/hooks/index.js +1 -0
  73. package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +969 -0
  74. package/dist/esm/global-account/react/hooks/useBetterAuth.js +136 -0
  75. package/dist/esm/shared/constants/chains/b3Chain.d.ts +7 -7
  76. package/dist/esm/shared/constants/chains/b3Chain.js +4 -4
  77. package/dist/esm/shared/constants/chains/b3Viem.d.ts +6 -0
  78. package/dist/esm/shared/constants/chains/b3Viem.js +16 -0
  79. package/dist/esm/shared/constants/chains/supported.d.ts +1 -1
  80. package/dist/esm/shared/generated/chain-networks.json +2 -2
  81. package/dist/esm/shared/utils/chains.d.ts +1 -1
  82. package/dist/esm/shared/utils/chains.js +2 -2
  83. package/dist/styles/index.css +1 -1
  84. package/dist/types/anyspend/constants/rpc.d.ts +1 -1
  85. package/dist/types/global-account/better-auth-client.d.ts +1883 -0
  86. package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +4 -1
  87. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +4 -1
  88. package/dist/types/global-account/react/components/B3Provider/BetterAuthProvider.d.ts +16 -0
  89. package/dist/types/global-account/react/components/SignInWithB3/BetterAuthResetPassword.d.ts +21 -0
  90. package/dist/types/global-account/react/components/SignInWithB3/BetterAuthSignIn.d.ts +34 -0
  91. package/dist/types/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.d.ts +6 -0
  92. package/dist/types/global-account/react/components/custom/Button.d.ts +1 -1
  93. package/dist/types/global-account/react/components/index.d.ts +3 -0
  94. package/dist/types/global-account/react/components/ui/button.d.ts +1 -1
  95. package/dist/types/global-account/react/hooks/index.d.ts +1 -0
  96. package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +969 -0
  97. package/dist/types/shared/constants/chains/b3Chain.d.ts +7 -7
  98. package/dist/types/shared/constants/chains/b3Viem.d.ts +6 -0
  99. package/dist/types/shared/constants/chains/supported.d.ts +1 -1
  100. package/dist/types/shared/utils/chains.d.ts +1 -1
  101. package/package.json +2 -1
  102. package/src/anyspend/constants/rpc.ts +2 -1
  103. package/src/anyspend/react/components/AnySpendNFT.tsx +2 -2
  104. package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +3 -3
  105. package/src/anyspend/react/components/common/InsufficientDepositPayment.tsx +2 -2
  106. package/src/anyspend/react/components/common/OrderDetails.tsx +2 -2
  107. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +4 -4
  108. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +2 -2
  109. package/src/anyspend/utils/chain.ts +9 -9
  110. package/src/global-account/better-auth-client.ts +17 -0
  111. package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +6 -0
  112. package/src/global-account/react/components/B3Provider/B3Provider.tsx +15 -5
  113. package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +127 -0
  114. package/src/global-account/react/components/SignInWithB3/BetterAuthResetPassword.tsx +146 -0
  115. package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +375 -0
  116. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +9 -3
  117. package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +263 -0
  118. package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +5 -1
  119. package/src/global-account/react/components/index.ts +3 -0
  120. package/src/global-account/react/hooks/index.ts +1 -0
  121. package/src/global-account/react/hooks/useBetterAuth.ts +177 -0
  122. package/src/shared/constants/chains/b3Chain.ts +5 -5
  123. package/src/shared/constants/chains/b3Viem.ts +18 -0
  124. package/src/shared/generated/chain-networks.json +2 -2
  125. package/src/shared/utils/chains.ts +3 -2
@@ -0,0 +1,136 @@
1
+ import app from "../../../global-account/app.js";
2
+ import { useAuthStore, useB3Config } from "../../../global-account/react/index.js";
3
+ import { debugB3React } from "../../../shared/utils/debug.js";
4
+ import { useCallback } from "react";
5
+ import { betterAuthClient } from "../../better-auth-client.js";
6
+ import { useUserQuery } from "./useUserQuery.js";
7
+ const debug = debugB3React("useBetterAuth");
8
+ /**
9
+ * Hook for authentication via Better Auth (email/password + social providers).
10
+ *
11
+ * Follows the same pattern as Thirdweb auth:
12
+ * 1. Better Auth sign-in returns a session token
13
+ * 2. Token is passed as accessToken to app.authenticate({ strategy: "better-auth" })
14
+ * 3. BetterAuthStrategy verifies the token and issues a Feathers JWT
15
+ */
16
+ export function useBetterAuth() {
17
+ const { partnerId } = useB3Config();
18
+ const { setUser } = useUserQuery();
19
+ const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
20
+ const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating);
21
+ const setIsConnected = useAuthStore(state => state.setIsConnected);
22
+ const setHasStartedConnecting = useAuthStore(state => state.setHasStartedConnecting);
23
+ const exchangeForFeathersJWT = useCallback(async (sessionToken) => {
24
+ debug("Exchanging Better Auth token for Feathers JWT");
25
+ const response = await app.authenticate({
26
+ strategy: "better-auth",
27
+ accessToken: sessionToken,
28
+ partnerId,
29
+ });
30
+ if (!response.user) {
31
+ throw new Error("No user returned from authentication");
32
+ }
33
+ setUser(response.user);
34
+ setIsAuthenticated(true);
35
+ setIsConnected(true);
36
+ setIsAuthenticating(false);
37
+ debug("Feathers JWT exchange successful", { userId: response.user?.userId });
38
+ return response;
39
+ }, [partnerId, setUser, setIsAuthenticated, setIsConnected, setIsAuthenticating]);
40
+ const signInWithEmail = useCallback(async (email, password) => {
41
+ debug("Signing in with email", { email });
42
+ setHasStartedConnecting(true);
43
+ setIsAuthenticating(true);
44
+ try {
45
+ const result = await betterAuthClient.signIn.email({ email, password });
46
+ if (result.error) {
47
+ throw new Error(result.error.message || "Sign in failed");
48
+ }
49
+ const token = result.data?.token;
50
+ if (!token) {
51
+ throw new Error("No session token returned from sign in");
52
+ }
53
+ return await exchangeForFeathersJWT(token);
54
+ }
55
+ catch (error) {
56
+ setIsAuthenticating(false);
57
+ debug("Sign in failed", error);
58
+ throw error;
59
+ }
60
+ }, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting]);
61
+ const signUpWithEmail = useCallback(async (email, password, name) => {
62
+ debug("Signing up with email", { email, name });
63
+ setHasStartedConnecting(true);
64
+ setIsAuthenticating(true);
65
+ try {
66
+ const result = await betterAuthClient.signUp.email({ email, password, name });
67
+ if (result.error) {
68
+ throw new Error(result.error.message || "Sign up failed");
69
+ }
70
+ const token = result.data?.token;
71
+ if (!token) {
72
+ throw new Error("No session token returned from sign up");
73
+ }
74
+ return await exchangeForFeathersJWT(token);
75
+ }
76
+ catch (error) {
77
+ setIsAuthenticating(false);
78
+ debug("Sign up failed", error);
79
+ throw error;
80
+ }
81
+ }, [exchangeForFeathersJWT, setIsAuthenticating, setHasStartedConnecting]);
82
+ const signInWithSocial = useCallback(async (provider) => {
83
+ debug("Signing in with social provider", { provider });
84
+ setHasStartedConnecting(true);
85
+ setIsAuthenticating(true);
86
+ try {
87
+ const result = await betterAuthClient.signIn.social({
88
+ provider,
89
+ callbackURL: window.location.href,
90
+ });
91
+ if (result.error) {
92
+ throw new Error(result.error.message || `${provider} sign in failed`);
93
+ }
94
+ // Social auth redirects to provider — JWT exchange happens on callback
95
+ // via BetterAuthProvider session restore
96
+ }
97
+ catch (error) {
98
+ setIsAuthenticating(false);
99
+ debug("Social sign in failed", error);
100
+ throw error;
101
+ }
102
+ }, [setIsAuthenticating, setHasStartedConnecting]);
103
+ const requestPasswordReset = useCallback(async (email, redirectTo) => {
104
+ debug("Requesting password reset", { email });
105
+ const result = await betterAuthClient.requestPasswordReset({
106
+ email,
107
+ redirectTo,
108
+ });
109
+ if (result.error) {
110
+ throw new Error(result.error.message || "Password reset request failed");
111
+ }
112
+ debug("Password reset email sent");
113
+ return result;
114
+ }, []);
115
+ const resetPassword = useCallback(async (newPassword, token) => {
116
+ debug("Resetting password");
117
+ const result = await betterAuthClient.resetPassword({
118
+ newPassword,
119
+ token,
120
+ });
121
+ if (result.error) {
122
+ throw new Error(result.error.message || "Password reset failed");
123
+ }
124
+ debug("Password reset successful");
125
+ return result;
126
+ }, []);
127
+ return {
128
+ signInWithEmail,
129
+ signUpWithEmail,
130
+ signInWithSocial,
131
+ requestPasswordReset,
132
+ resetPassword,
133
+ exchangeForFeathersJWT,
134
+ betterAuthClient,
135
+ };
136
+ }
@@ -1,6 +1,6 @@
1
+ import { ChainNetworks } from "../../../global-account/types/chain-networks";
1
2
  import { Chain as ThirdwebChain } from "thirdweb";
2
3
  import { Chain } from "viem";
3
- import { ChainNetworks } from "../../../global-account/types/chain-networks";
4
4
  export declare const nullAddress = "0x0000000000000000000000000000000000000000";
5
5
  export declare const avatarsNFTCollectionAddress = "0x658E2F67D3121A0eA81e5854be0b7539be27Aeb0";
6
6
  export declare const viemToThirdwebChain: (chain: Chain) => ThirdwebChain;
@@ -33,8 +33,8 @@ export declare const b3Mainnet: {
33
33
  experimental_preconfirmationTime?: number | undefined | undefined;
34
34
  rpcUrls: {
35
35
  readonly default: {
36
- readonly http: readonly ["https://mainnet-rpc.b3.fun"];
37
- readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
36
+ readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
37
+ readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
38
38
  };
39
39
  };
40
40
  sourceId?: number | undefined | undefined;
@@ -43,7 +43,7 @@ export declare const b3Mainnet: {
43
43
  fees?: import("viem").ChainFees<undefined> | undefined;
44
44
  formatters?: undefined;
45
45
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
46
- readonly rpc: "https://mainnet-rpc.b3.fun";
46
+ readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
47
47
  readonly icon: {
48
48
  readonly url: "https://cdn.b3.fun/b3_logo.svg";
49
49
  readonly width: 32;
@@ -128,8 +128,8 @@ export declare const b3Chain: Chain | {
128
128
  experimental_preconfirmationTime?: number | undefined | undefined;
129
129
  rpcUrls: {
130
130
  readonly default: {
131
- readonly http: readonly ["https://mainnet-rpc.b3.fun"];
132
- readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
131
+ readonly http: readonly ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
132
+ readonly ws: readonly ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"];
133
133
  };
134
134
  };
135
135
  sourceId?: number | undefined | undefined;
@@ -138,7 +138,7 @@ export declare const b3Chain: Chain | {
138
138
  fees?: import("viem").ChainFees<undefined> | undefined;
139
139
  formatters?: undefined;
140
140
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
141
- readonly rpc: "https://mainnet-rpc.b3.fun";
141
+ readonly rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2";
142
142
  readonly icon: {
143
143
  readonly url: "https://cdn.b3.fun/b3_logo.svg";
144
144
  readonly width: 32;
@@ -52,11 +52,11 @@ export const b3Testnet = defineChain({
52
52
  export const b3Mainnet = defineChain({
53
53
  id: 8333,
54
54
  name: "B3",
55
- rpc: "https://mainnet-rpc.b3.fun",
55
+ rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2",
56
56
  rpcUrls: {
57
57
  default: {
58
- http: ["https://mainnet-rpc.b3.fun"],
59
- ws: ["wss://mainnet-rpc.b3.fun/ws"],
58
+ http: ["https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
59
+ ws: ["wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2"],
60
60
  },
61
61
  },
62
62
  icon: {
@@ -123,7 +123,7 @@ export const thirdwebB3Testnet = defineThirdwebChain({
123
123
  export const thirdwebB3Mainnet = defineThirdwebChain({
124
124
  id: 8333,
125
125
  name: "B3",
126
- rpc: "https://mainnet-rpc.b3.fun/http",
126
+ rpc: "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
127
127
  icon: {
128
128
  url: "https://cdn.b3.fun/b3_logo.svg",
129
129
  width: 32,
@@ -0,0 +1,6 @@
1
+ import type { Chain } from "viem";
2
+ /**
3
+ * Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
4
+ * RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
5
+ */
6
+ export declare const b3Viem: Chain;
@@ -0,0 +1,16 @@
1
+ import { B3_PUBLIC_RPC } from "../../../anyspend/constants/rpc.js";
2
+ import { b3 as viemB3 } from "viem/chains";
3
+ /**
4
+ * Viem's built-in `b3` chain points at mainnet-rpc.b3.fun; we spread it and override
5
+ * RPC URLs so all SDK call sites stay aligned with {@link B3_PUBLIC_RPC}.
6
+ */
7
+ export const b3Viem = {
8
+ ...viemB3,
9
+ rpcUrls: {
10
+ ...viemB3.rpcUrls,
11
+ default: {
12
+ ...viemB3.rpcUrls.default,
13
+ http: [B3_PUBLIC_RPC],
14
+ },
15
+ },
16
+ };
@@ -2,6 +2,7 @@ import type { Chain as ThirdwebChain } from "thirdweb";
2
2
  export declare const supportedChains: import("viem").Chain[];
3
3
  export declare const supportedChainsTW: ThirdwebChain[];
4
4
  export declare const supportedChainNetworks: {
5
+ formatters?: Record<string, any> | undefined;
5
6
  contracts?: Record<string, {
6
7
  blockCreated?: number | undefined;
7
8
  address: string;
@@ -9,7 +10,6 @@ export declare const supportedChainNetworks: {
9
10
  sourceId?: number | undefined;
10
11
  testnet?: boolean | undefined;
11
12
  fees?: Record<string, any> | undefined;
12
- formatters?: Record<string, any> | undefined;
13
13
  color?: string | undefined;
14
14
  testnetConfigID?: number | undefined;
15
15
  badge?: string | undefined;
@@ -5,8 +5,8 @@
5
5
  "name": "B3",
6
6
  "rpcUrls": {
7
7
  "default": {
8
- "http": "https://mainnet-rpc.b3.fun",
9
- "ws": "wss://mainnet-rpc.b3.fun/ws"
8
+ "http": "https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/",
9
+ "ws": "wss://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/"
10
10
  },
11
11
  "backups": []
12
12
  },
@@ -1,4 +1,4 @@
1
- import { Chain } from "viem/chains";
1
+ import type { Chain } from "viem";
2
2
  export declare function getChainById(id: number): Chain | undefined;
3
3
  export declare function chainIdToName(id: number): string | undefined;
4
4
  export declare function getExplorerUrl(chain: Chain, txHash: string): string;
@@ -1,5 +1,5 @@
1
+ import { b3Viem } from "../../shared/constants/chains/b3Viem.js";
1
2
  import { supportedChains } from "../../shared/constants/chains/supported.js";
2
- import { b3 } from "viem/chains";
3
3
  const baseChainBaseUrl = "https://basescan.org";
4
4
  export function getChainById(id) {
5
5
  return Object.values(supportedChains).find(chain => chain.id === id);
@@ -9,7 +9,7 @@ export function chainIdToName(id) {
9
9
  return name === "Base Mainnet" ? "Base" : name === "The Open Network" ? "Open Network" : name;
10
10
  }
11
11
  export function getExplorerUrl(chain, txHash) {
12
- if (chain.id === b3.id) {
12
+ if (chain.id === b3Viem.id) {
13
13
  return "https://explorer.b3.fun/b3/tx/" + txHash;
14
14
  }
15
15
  let baseUrl = chain.blockExplorers?.default.url;