@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.
@@ -12,15 +12,17 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
12
  var React2__default = /*#__PURE__*/_interopDefault(React2);
13
13
 
14
14
  // src/config/index.ts
15
+ var DEFAULT_ENGINE_URL = "https://api.one23.io";
16
+ var DEFAULT_CLIENT_ID = "one_pk_e8f647bfa643fdcfaa3a23f760488e49be09f929296eed4a6c399d437d907f60";
15
17
  var config = null;
16
18
  function initOneSDK(options) {
17
- if (!options.oneEngineUrl) {
18
- throw new Error("oneEngineUrl is required");
19
- }
20
- if (!options.oneClientId) {
21
- throw new Error("oneClientId is required");
22
- }
23
- config = options;
19
+ const engineUrl = options.oneEngineUrl || DEFAULT_ENGINE_URL;
20
+ const clientId = options.oneClientId || DEFAULT_CLIENT_ID;
21
+ config = {
22
+ ...options,
23
+ oneEngineUrl: engineUrl,
24
+ oneClientId: clientId
25
+ };
24
26
  }
25
27
  function getConfig() {
26
28
  if (!config) {
@@ -1537,7 +1539,7 @@ function createWalletConfig(config2) {
1537
1539
  }
1538
1540
  return [inApp];
1539
1541
  }
1540
- var DEFAULT_ENGINE_URL = process.env.NEXT_PUBLIC_ONE_ENGINE_URL || "/api";
1542
+ var DEFAULT_ENGINE_URL2 = process.env.NEXT_PUBLIC_ONE_ENGINE_URL || "/api";
1541
1543
  function OneThirdwebProvider({
1542
1544
  children,
1543
1545
  config: config2 = {}
@@ -1548,7 +1550,7 @@ function OneThirdwebProvider({
1548
1550
  React2.useEffect(() => {
1549
1551
  const fetchClientConfig = async () => {
1550
1552
  try {
1551
- const engineUrl = config2.engineUrl || DEFAULT_ENGINE_URL;
1553
+ const engineUrl = config2.engineUrl || DEFAULT_ENGINE_URL2;
1552
1554
  const response = await fetch(`${engineUrl}/v1/config/thirdweb`);
1553
1555
  if (response.ok) {
1554
1556
  const data = await response.json();