@one_deploy/sdk 1.0.1 → 1.0.3

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/index.mjs CHANGED
@@ -9,15 +9,17 @@ import { arbitrum, polygon, ethereum, base, optimism, bsc, avalanche } from 'thi
9
9
  export { arbitrum, base, ethereum, optimism, polygon } from 'thirdweb/chains';
10
10
 
11
11
  // src/config/index.ts
12
+ var DEFAULT_ENGINE_URL = "https://api.one23.io";
13
+ var DEFAULT_CLIENT_ID = "one_pk_e8f647bfa643fdcfaa3a23f760488e49be09f929296eed4a6c399d437d907f60";
12
14
  var config = null;
13
15
  function initOneSDK(options) {
14
- if (!options.oneEngineUrl) {
15
- throw new Error("oneEngineUrl is required");
16
- }
17
- if (!options.oneClientId) {
18
- throw new Error("oneClientId is required");
19
- }
20
- config = options;
16
+ const engineUrl = options.oneEngineUrl || DEFAULT_ENGINE_URL;
17
+ const clientId = options.oneClientId || DEFAULT_CLIENT_ID;
18
+ config = {
19
+ ...options,
20
+ oneEngineUrl: engineUrl,
21
+ oneClientId: clientId
22
+ };
21
23
  }
22
24
  function getConfig() {
23
25
  if (!config) {
@@ -29,7 +31,7 @@ function isInitialized() {
29
31
  return config !== null;
30
32
  }
31
33
  function getEngineUrl() {
32
- return config?.oneEngineUrl || process.env.NEXT_PUBLIC_ONE_ENGINE_URL || "http://localhost:4000/api";
34
+ return config?.oneEngineUrl || process.env.NEXT_PUBLIC_ONE_ENGINE_URL || DEFAULT_ENGINE_URL;
33
35
  }
34
36
  var chainsCache = null;
35
37
  var chainsCacheTimestamp = 0;
@@ -1984,7 +1986,7 @@ function createWalletConfig(config2) {
1984
1986
  }
1985
1987
  return [inApp];
1986
1988
  }
1987
- var DEFAULT_ENGINE_URL = process.env.NEXT_PUBLIC_ONE_ENGINE_URL || "/api";
1989
+ var DEFAULT_ENGINE_URL2 = process.env.NEXT_PUBLIC_ONE_ENGINE_URL || "/api";
1988
1990
  function OneThirdwebProvider({
1989
1991
  children,
1990
1992
  config: config2 = {}
@@ -1995,7 +1997,7 @@ function OneThirdwebProvider({
1995
1997
  useEffect(() => {
1996
1998
  const fetchClientConfig = async () => {
1997
1999
  try {
1998
- const engineUrl = config2.engineUrl || DEFAULT_ENGINE_URL;
2000
+ const engineUrl = config2.engineUrl || DEFAULT_ENGINE_URL2;
1999
2001
  const response = await fetch(`${engineUrl}/v1/config/thirdweb`);
2000
2002
  if (response.ok) {
2001
2003
  const data = await response.json();