@b3dotfun/sdk 0.0.40-alpha.3 → 0.0.40-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.
@@ -3,11 +3,10 @@ import { Account } from "thirdweb/wallets";
3
3
  import { ClientType } from "../../../client-manager";
4
4
  import { B3ContextType } from "./types";
5
5
  import "@reservoir0x/relay-kit-ui/styles.css";
6
- export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly import("wagmi").CreateConnectorFn[]>;
7
6
  /**
8
7
  * Main B3Provider component
9
8
  */
10
- export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType, }: {
9
+ export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType, rpcUrls, }: {
11
10
  theme: "light" | "dark";
12
11
  children: React.ReactNode;
13
12
  accountOverride?: Account;
@@ -19,6 +18,7 @@ export declare function B3Provider({ theme, children, accountOverride, environme
19
18
  style?: React.CSSProperties;
20
19
  };
21
20
  clientType?: ClientType;
21
+ rpcUrls?: Record<number, string>;
22
22
  }): import("react/jsx-runtime").JSX.Element;
23
23
  /**
24
24
  * Inner provider component that provides the actual B3Context
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wagmiConfig = void 0;
4
3
  exports.B3Provider = B3Provider;
5
4
  exports.InnerProvider = InnerProvider;
6
5
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -25,16 +24,24 @@ const DEFAULT_PERMISSIONS = {
25
24
  startDate: new Date(),
26
25
  endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
27
26
  };
28
- exports.wagmiConfig = (0, wagmi_1.createConfig)({
29
- chains: [supported_1.supportedChains[0], ...supported_1.supportedChains.slice(1)],
30
- transports: Object.fromEntries(supported_1.supportedChains.map(chain => [chain.id, (0, wagmi_1.http)()])),
31
- });
27
+ /**
28
+ * Creates wagmi config with optional custom RPC URLs
29
+ * @param rpcUrls - Optional mapping of chain IDs to RPC URLs
30
+ */
31
+ function createWagmiConfig(rpcUrls) {
32
+ return (0, wagmi_1.createConfig)({
33
+ chains: [supported_1.supportedChains[0], ...supported_1.supportedChains.slice(1)],
34
+ transports: Object.fromEntries(supported_1.supportedChains.map(chain => [chain.id, (0, wagmi_1.http)(rpcUrls?.[chain.id])])),
35
+ });
36
+ }
32
37
  // Create queryClient instance
33
38
  const queryClient = new react_query_1.QueryClient();
34
39
  /**
35
40
  * Main B3Provider component
36
41
  */
37
- function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType = "rest", }) {
42
+ function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType = "rest", rpcUrls, }) {
43
+ // Create wagmi config with custom RPC URLs if provided
44
+ const [wagmiConfig] = (0, react_2.useState)(() => createWagmiConfig(rpcUrls));
38
45
  // Initialize Google Analytics on mount
39
46
  (0, react_2.useEffect)(() => {
40
47
  (0, analytics_1.loadGA4Script)();
@@ -43,7 +50,7 @@ function B3Provider({ theme = "light", children, accountOverride, environment, a
43
50
  (0, react_2.useEffect)(() => {
44
51
  (0, client_manager_1.setClientType)(clientType);
45
52
  }, [clientType]);
46
- return ((0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: exports.wagmiConfig, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_3.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, clientType: clientType, children: (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { simDuneApiKey: simDuneApiKey, children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" }), (0, jsx_runtime_1.jsx)(sonner_1.Toaster, { theme: theme, position: toaster?.position, style: toaster?.style })] }) }) }) }) }) }));
53
+ return ((0, jsx_runtime_1.jsx)(wagmi_1.WagmiProvider, { config: wagmiConfig, children: (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(react_3.ThirdwebProvider, { children: (0, jsx_runtime_1.jsx)(react_1.TooltipProvider, { children: (0, jsx_runtime_1.jsx)(InnerProvider, { accountOverride: accountOverride, environment: environment, theme: theme, automaticallySetFirstEoa: !!automaticallySetFirstEoa, clientType: clientType, children: (0, jsx_runtime_1.jsxs)(react_1.RelayKitProviderWrapper, { simDuneApiKey: simDuneApiKey, children: [children, (0, jsx_runtime_1.jsx)(StyleRoot_1.StyleRoot, { id: "b3-root" }), (0, jsx_runtime_1.jsx)(sonner_1.Toaster, { theme: theme, position: toaster?.position, style: toaster?.style })] }) }) }) }) }) }));
47
54
  }
48
55
  /**
49
56
  * Inner provider component that provides the actual B3Context
@@ -3,11 +3,10 @@ import { Account } from "thirdweb/wallets";
3
3
  import { ClientType } from "../../../client-manager";
4
4
  import { B3ContextType } from "./types";
5
5
  import "@reservoir0x/relay-kit-ui/styles.css";
6
- export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly import("wagmi").CreateConnectorFn[]>;
7
6
  /**
8
7
  * Main B3Provider component
9
8
  */
10
- export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType, }: {
9
+ export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType, rpcUrls, }: {
11
10
  theme: "light" | "dark";
12
11
  children: React.ReactNode;
13
12
  accountOverride?: Account;
@@ -19,6 +18,7 @@ export declare function B3Provider({ theme, children, accountOverride, environme
19
18
  style?: React.CSSProperties;
20
19
  };
21
20
  clientType?: ClientType;
21
+ rpcUrls?: Record<number, string>;
22
22
  }): import("react/jsx-runtime").JSX.Element;
23
23
  /**
24
24
  * Inner provider component that provides the actual B3Context
@@ -20,16 +20,24 @@ const DEFAULT_PERMISSIONS = {
20
20
  startDate: new Date(),
21
21
  endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
22
22
  };
23
- export const wagmiConfig = createConfig({
24
- chains: [supportedChains[0], ...supportedChains.slice(1)],
25
- transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http()])),
26
- });
23
+ /**
24
+ * Creates wagmi config with optional custom RPC URLs
25
+ * @param rpcUrls - Optional mapping of chain IDs to RPC URLs
26
+ */
27
+ function createWagmiConfig(rpcUrls) {
28
+ return createConfig({
29
+ chains: [supportedChains[0], ...supportedChains.slice(1)],
30
+ transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http(rpcUrls?.[chain.id])])),
31
+ });
32
+ }
27
33
  // Create queryClient instance
28
34
  const queryClient = new QueryClient();
29
35
  /**
30
36
  * Main B3Provider component
31
37
  */
32
- export function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType = "rest", }) {
38
+ export function B3Provider({ theme = "light", children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType = "rest", rpcUrls, }) {
39
+ // Create wagmi config with custom RPC URLs if provided
40
+ const [wagmiConfig] = useState(() => createWagmiConfig(rpcUrls));
33
41
  // Initialize Google Analytics on mount
34
42
  useEffect(() => {
35
43
  loadGA4Script();
@@ -3,11 +3,10 @@ import { Account } from "thirdweb/wallets";
3
3
  import { ClientType } from "../../../client-manager";
4
4
  import { B3ContextType } from "./types";
5
5
  import "@reservoir0x/relay-kit-ui/styles.css";
6
- export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly import("wagmi").CreateConnectorFn[]>;
7
6
  /**
8
7
  * Main B3Provider component
9
8
  */
10
- export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType, }: {
9
+ export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, clientType, rpcUrls, }: {
11
10
  theme: "light" | "dark";
12
11
  children: React.ReactNode;
13
12
  accountOverride?: Account;
@@ -19,6 +18,7 @@ export declare function B3Provider({ theme, children, accountOverride, environme
19
18
  style?: React.CSSProperties;
20
19
  };
21
20
  clientType?: ClientType;
21
+ rpcUrls?: Record<number, string>;
22
22
  }): import("react/jsx-runtime").JSX.Element;
23
23
  /**
24
24
  * Inner provider component that provides the actual B3Context
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.40-alpha.3",
3
+ "version": "0.0.40-alpha.4",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -31,10 +31,16 @@ const DEFAULT_PERMISSIONS = {
31
31
  endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
32
32
  };
33
33
 
34
- export const wagmiConfig = createConfig({
35
- chains: [supportedChains[0], ...supportedChains.slice(1)],
36
- transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http()])) as any,
37
- });
34
+ /**
35
+ * Creates wagmi config with optional custom RPC URLs
36
+ * @param rpcUrls - Optional mapping of chain IDs to RPC URLs
37
+ */
38
+ function createWagmiConfig(rpcUrls?: Record<number, string>) {
39
+ return createConfig({
40
+ chains: [supportedChains[0], ...supportedChains.slice(1)],
41
+ transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http(rpcUrls?.[chain.id])])) as any,
42
+ });
43
+ }
38
44
 
39
45
  // Create queryClient instance
40
46
  const queryClient = new QueryClient();
@@ -51,6 +57,7 @@ export function B3Provider({
51
57
  simDuneApiKey,
52
58
  toaster,
53
59
  clientType = "rest",
60
+ rpcUrls,
54
61
  }: {
55
62
  theme: "light" | "dark";
56
63
  children: React.ReactNode;
@@ -63,7 +70,11 @@ export function B3Provider({
63
70
  style?: React.CSSProperties;
64
71
  };
65
72
  clientType?: ClientType;
73
+ rpcUrls?: Record<number, string>;
66
74
  }) {
75
+ // Create wagmi config with custom RPC URLs if provided
76
+ const [wagmiConfig] = useState(() => createWagmiConfig(rpcUrls));
77
+
67
78
  // Initialize Google Analytics on mount
68
79
  useEffect(() => {
69
80
  loadGA4Script();