@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.
@@ -8,15 +8,17 @@ import { base } from 'thirdweb/chains';
8
8
  export { arbitrum, base, ethereum, optimism, polygon } from 'thirdweb/chains';
9
9
 
10
10
  // src/config/index.ts
11
+ var DEFAULT_ENGINE_URL = "https://api.one23.io";
12
+ var DEFAULT_CLIENT_ID = "one_pk_e8f647bfa643fdcfaa3a23f760488e49be09f929296eed4a6c399d437d907f60";
11
13
  var config = null;
12
14
  function initOneSDK(options) {
13
- if (!options.oneEngineUrl) {
14
- throw new Error("oneEngineUrl is required");
15
- }
16
- if (!options.oneClientId) {
17
- throw new Error("oneClientId is required");
18
- }
19
- config = options;
15
+ const engineUrl = options.oneEngineUrl || DEFAULT_ENGINE_URL;
16
+ const clientId = options.oneClientId || DEFAULT_CLIENT_ID;
17
+ config = {
18
+ ...options,
19
+ oneEngineUrl: engineUrl,
20
+ oneClientId: clientId
21
+ };
20
22
  }
21
23
  function getConfig() {
22
24
  if (!config) {
@@ -1533,7 +1535,7 @@ function createWalletConfig(config2) {
1533
1535
  }
1534
1536
  return [inApp];
1535
1537
  }
1536
- var DEFAULT_ENGINE_URL = process.env.NEXT_PUBLIC_ONE_ENGINE_URL || "/api";
1538
+ var DEFAULT_ENGINE_URL2 = process.env.NEXT_PUBLIC_ONE_ENGINE_URL || "/api";
1537
1539
  function OneThirdwebProvider({
1538
1540
  children,
1539
1541
  config: config2 = {}
@@ -1544,7 +1546,7 @@ function OneThirdwebProvider({
1544
1546
  useEffect(() => {
1545
1547
  const fetchClientConfig = async () => {
1546
1548
  try {
1547
- const engineUrl = config2.engineUrl || DEFAULT_ENGINE_URL;
1549
+ const engineUrl = config2.engineUrl || DEFAULT_ENGINE_URL2;
1548
1550
  const response = await fetch(`${engineUrl}/v1/config/thirdweb`);
1549
1551
  if (response.ok) {
1550
1552
  const data = await response.json();