@aurum-sdk/core 0.2.4 → 0.2.6

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.js CHANGED
@@ -16,24 +16,24 @@
16
16
 
17
17
 
18
18
 
19
- var _chunkGTEGWUGUjs = require('./chunk-GTEGWUGU.js');
20
- require('./chunk-LMQLRSFP.js');
19
+ var _chunkKD3A4VYBjs = require('./chunk-KD3A4VYB.js');
20
+ require('./chunk-4EBNC4R3.js');
21
21
 
22
22
 
23
- var _chunkIQ7F5R7Djs = require('./chunk-IQ7F5R7D.js');
23
+ var _chunkQIPVNM7Tjs = require('./chunk-QIPVNM7T.js');
24
24
 
25
25
  // src/index.ts
26
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
26
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
27
27
 
28
28
  // src/Aurum.ts
29
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
29
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
30
30
 
31
31
  // src/AurumCore.ts
32
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
32
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
33
33
  var _viem = require('viem');
34
34
 
35
35
  // src/utils/chainHelpers.ts
36
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
36
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
37
37
  function normalizeChainId(chainId) {
38
38
  if (typeof chainId === "string" && chainId.startsWith("0x")) return chainId;
39
39
  const numericId = typeof chainId === "number" ? chainId : Number(chainId);
@@ -56,42 +56,42 @@ function isChainExistsError(error) {
56
56
  }
57
57
 
58
58
  // src/components/ConnectModal/renderConnectModal.tsx
59
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
59
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
60
60
 
61
61
  // src/components/ConnectModal/ModalShell.tsx
62
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
62
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
63
63
  var _react = require('react');
64
64
  var _jsxruntime = require('react/jsx-runtime');
65
65
  var ModalShell = ({ onClose, brandConfig }) => {
66
66
  const [isOpen, setIsOpen] = _react.useState.call(void 0, true);
67
- const { currentPage } = _chunkGTEGWUGUjs.useNavigation.call(void 0, );
67
+ const { currentPage } = _chunkKD3A4VYBjs.useNavigation.call(void 0, );
68
68
  const handleClose = () => {
69
69
  setIsOpen(false);
70
70
  onClose();
71
71
  };
72
72
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
73
- _chunkGTEGWUGUjs.Modal,
73
+ _chunkKD3A4VYBjs.Modal,
74
74
  {
75
75
  isOpen,
76
76
  closeOnOverlayClick: true,
77
77
  onCloseComplete: handleClose,
78
78
  brandConfig,
79
79
  transitionKey: currentPage,
80
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGTEGWUGUjs.ConnectPages, {})
80
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ConnectPages, {})
81
81
  }
82
82
  );
83
83
  };
84
84
 
85
85
  // src/utils/createModalContainer.ts
86
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
86
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
87
87
  var _client = require('react-dom/client');
88
88
 
89
89
  // src/utils/createShadowRoot.ts
90
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
90
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
91
91
  function createShadowRoot(container, brandConfig) {
92
92
  const shadowRoot = container.attachShadow({ mode: "open" });
93
93
  shadowRoot.innerHTML = `
94
- <style>${_chunkGTEGWUGUjs.generateCompleteStyles.call(void 0, brandConfig)}</style>
94
+ <style>${_chunkKD3A4VYBjs.generateCompleteStyles.call(void 0, brandConfig)}</style>
95
95
  <div class="aurum-modal-root"></div>
96
96
  `;
97
97
  return shadowRoot.querySelector(".aurum-modal-root");
@@ -128,7 +128,7 @@ function renderConnectModal({
128
128
  brandConfig
129
129
  }) {
130
130
  return new Promise((resolve, reject) => {
131
- const sortedWallets = _chunkGTEGWUGUjs.sortWallets.call(void 0, displayedWallets, { filterHidden: false });
131
+ const sortedWallets = _chunkKD3A4VYBjs.sortWallets.call(void 0, displayedWallets, { filterHidden: false });
132
132
  const { root, cleanup } = createModalContainer(CONTAINER_ID, brandConfig);
133
133
  const onConnect = (result) => {
134
134
  cleanup();
@@ -139,25 +139,25 @@ function renderConnectModal({
139
139
  reject(new Error("User rejected request"));
140
140
  };
141
141
  root.render(
142
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGTEGWUGUjs.ThemeContainer, { theme: brandConfig.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGTEGWUGUjs.ConnectUIProviders, { onConnect, displayedWallets: sortedWallets, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalShell, { onClose, brandConfig }) }) })
142
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ThemeContainer, { theme: brandConfig.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ConnectUIProviders, { onConnect, displayedWallets: sortedWallets, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalShell, { onClose, brandConfig }) }) })
143
143
  );
144
144
  });
145
145
  }
146
146
 
147
147
  // src/utils/createWalletAdapters.ts
148
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
148
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
149
149
 
150
150
  // src/wallet-adapters/index.ts
151
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
151
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
152
152
 
153
153
  // src/wallet-adapters/RabbyAdapter.ts
154
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
154
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
155
155
  var RABBY_RDNS = "io.rabby";
156
156
  var RabbyAdapter = class {
157
157
  constructor() {
158
- this.id = _chunkGTEGWUGUjs.WalletId.Rabby;
159
- this.name = _chunkGTEGWUGUjs.WalletName.Rabby;
160
- this.icon = _nullishCoalesce(_chunkGTEGWUGUjs.getLogoDataUri.call(void 0, _chunkGTEGWUGUjs.WalletId.Rabby, "brand"), () => ( ""));
158
+ this.id = _chunkKD3A4VYBjs.WalletId.Rabby;
159
+ this.name = _chunkKD3A4VYBjs.WalletName.Rabby;
160
+ this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.Rabby, "brand"), () => ( ""));
161
161
  this.hide = false;
162
162
  this.downloadUrl = "https://rabby.io";
163
163
  this.wcDeepLinkUrl = null;
@@ -216,7 +216,7 @@ var RabbyAdapter = class {
216
216
  await this.providerPromise;
217
217
  }
218
218
  if (!this.provider) {
219
- _chunkGTEGWUGUjs.sentryLogger.error("Rabby is not available");
219
+ _chunkKD3A4VYBjs.sentryLogger.error("Rabby is not available");
220
220
  throw new Error("Rabby is not available");
221
221
  }
222
222
  await this.provider.request({
@@ -228,7 +228,7 @@ var RabbyAdapter = class {
228
228
  params: []
229
229
  });
230
230
  if (!accounts || accounts.length === 0 || !accounts[0]) {
231
- _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from Rabby");
231
+ _chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from Rabby");
232
232
  throw new Error("No accounts returned from Rabby");
233
233
  }
234
234
  return {
@@ -284,10 +284,10 @@ var RabbyAdapter = class {
284
284
  };
285
285
 
286
286
  // src/wallet-adapters/BraveAdapter.ts
287
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
287
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
288
288
 
289
289
  // src/utils/platform/isBraveBrowser.ts
290
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
290
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
291
291
  function isBraveBrowser() {
292
292
  if (typeof navigator === "undefined") return false;
293
293
  return navigator.brave !== void 0;
@@ -297,9 +297,9 @@ function isBraveBrowser() {
297
297
  var BRAVE_RDNS = "com.brave.wallet";
298
298
  var BraveAdapter = class {
299
299
  constructor() {
300
- this.id = _chunkGTEGWUGUjs.WalletId.Brave;
301
- this.name = _chunkGTEGWUGUjs.WalletName.Brave;
302
- this.icon = _nullishCoalesce(_chunkGTEGWUGUjs.getLogoDataUri.call(void 0, _chunkGTEGWUGUjs.WalletId.Brave, "brand"), () => ( ""));
300
+ this.id = _chunkKD3A4VYBjs.WalletId.Brave;
301
+ this.name = _chunkKD3A4VYBjs.WalletName.Brave;
302
+ this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.Brave, "brand"), () => ( ""));
303
303
  this.downloadUrl = "https://brave.com/download";
304
304
  this.wcDeepLinkUrl = null;
305
305
  this.provider = null;
@@ -362,7 +362,7 @@ var BraveAdapter = class {
362
362
  await this.providerPromise;
363
363
  }
364
364
  if (!this.provider) {
365
- _chunkGTEGWUGUjs.sentryLogger.error("Brave Wallet is not available");
365
+ _chunkKD3A4VYBjs.sentryLogger.error("Brave Wallet is not available");
366
366
  throw new Error("Brave Wallet is not available");
367
367
  }
368
368
  await this.provider.request({
@@ -374,7 +374,7 @@ var BraveAdapter = class {
374
374
  params: []
375
375
  });
376
376
  if (!accounts || accounts.length === 0 || !accounts[0]) {
377
- _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from Brave Wallet");
377
+ _chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from Brave Wallet");
378
378
  throw new Error("No accounts returned from Brave Wallet");
379
379
  }
380
380
  return {
@@ -430,13 +430,13 @@ var BraveAdapter = class {
430
430
  };
431
431
 
432
432
  // src/wallet-adapters/PhantomAdapter.ts
433
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
433
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
434
434
  var PHANTOM_RDNS = "app.phantom";
435
435
  var PhantomAdapter = class {
436
436
  constructor() {
437
- this.id = _chunkGTEGWUGUjs.WalletId.Phantom;
438
- this.name = _chunkGTEGWUGUjs.WalletName.Phantom;
439
- this.icon = _nullishCoalesce(_chunkGTEGWUGUjs.getLogoDataUri.call(void 0, _chunkGTEGWUGUjs.WalletId.Phantom, "brand"), () => ( ""));
437
+ this.id = _chunkKD3A4VYBjs.WalletId.Phantom;
438
+ this.name = _chunkKD3A4VYBjs.WalletName.Phantom;
439
+ this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.Phantom, "brand"), () => ( ""));
440
440
  this.hide = false;
441
441
  this.downloadUrl = "https://phantom.com/download";
442
442
  this.wcDeepLinkUrl = "phantom://wc?uri=";
@@ -500,7 +500,7 @@ var PhantomAdapter = class {
500
500
  await this.providerPromise;
501
501
  }
502
502
  if (!this.provider) {
503
- _chunkGTEGWUGUjs.sentryLogger.error("Phantom is not available");
503
+ _chunkKD3A4VYBjs.sentryLogger.error("Phantom is not available");
504
504
  throw new Error("Phantom is not available");
505
505
  }
506
506
  await this.provider.request({
@@ -512,7 +512,7 @@ var PhantomAdapter = class {
512
512
  params: []
513
513
  });
514
514
  if (!accounts || accounts.length === 0 || !accounts[0]) {
515
- _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from Phantom");
515
+ _chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from Phantom");
516
516
  throw new Error("No accounts returned from Phantom");
517
517
  }
518
518
  return {
@@ -568,12 +568,12 @@ var PhantomAdapter = class {
568
568
  };
569
569
 
570
570
  // src/wallet-adapters/CoinbaseWalletAdapter.ts
571
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
571
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
572
572
  var CoinbaseWalletAdapter = class {
573
573
  constructor({ appName, appLogoUrl, telemetry }) {
574
- this.id = _chunkGTEGWUGUjs.WalletId.CoinbaseWallet;
575
- this.name = _chunkGTEGWUGUjs.WalletName.CoinbaseWallet;
576
- this.icon = _nullishCoalesce(_chunkGTEGWUGUjs.getLogoDataUri.call(void 0, _chunkGTEGWUGUjs.WalletId.CoinbaseWallet, "brand"), () => ( ""));
574
+ this.id = _chunkKD3A4VYBjs.WalletId.CoinbaseWallet;
575
+ this.name = _chunkKD3A4VYBjs.WalletName.CoinbaseWallet;
576
+ this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.CoinbaseWallet, "brand"), () => ( ""));
577
577
  this.hide = false;
578
578
  this.downloadUrl = "https://www.coinbase.com/wallet/downloads";
579
579
  this.wcDeepLinkUrl = "cbwallet://wc?uri=";
@@ -592,7 +592,7 @@ var CoinbaseWalletAdapter = class {
592
592
  async initializeProvider() {
593
593
  if (typeof window === "undefined") return;
594
594
  try {
595
- const { createCoinbaseWalletSDK } = await Promise.resolve().then(() => _interopRequireWildcard(require("./dist-3K7ESMKX.js")));
595
+ const { createCoinbaseWalletSDK } = await Promise.resolve().then(() => _interopRequireWildcard(require("./dist-7I773YNF.js")));
596
596
  const coinbaseSdk = createCoinbaseWalletSDK({
597
597
  appName: this.config.appName,
598
598
  appLogoUrl: this.config.appLogoUrl,
@@ -603,7 +603,7 @@ var CoinbaseWalletAdapter = class {
603
603
  });
604
604
  this.provider = coinbaseSdk.getProvider();
605
605
  } catch (error) {
606
- _chunkGTEGWUGUjs.sentryLogger.warn("Failed to initialize Coinbase Wallet provider", { error });
606
+ _chunkKD3A4VYBjs.sentryLogger.warn("Failed to initialize Coinbase Wallet provider", { error });
607
607
  }
608
608
  }
609
609
  isInstalled() {
@@ -612,7 +612,7 @@ var CoinbaseWalletAdapter = class {
612
612
  async connect() {
613
613
  await this.ensureInitialized();
614
614
  if (!this.provider) {
615
- _chunkGTEGWUGUjs.sentryLogger.error("Coinbase Wallet is not available");
615
+ _chunkKD3A4VYBjs.sentryLogger.error("Coinbase Wallet is not available");
616
616
  throw new Error("Coinbase Wallet is not available");
617
617
  }
618
618
  const accounts = await this.provider.request({
@@ -620,7 +620,7 @@ var CoinbaseWalletAdapter = class {
620
620
  params: []
621
621
  });
622
622
  if (!accounts || accounts.length === 0 || !accounts[0]) {
623
- _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from Coinbase Wallet");
623
+ _chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from Coinbase Wallet");
624
624
  throw new Error("No accounts returned from Coinbase Wallet");
625
625
  }
626
626
  return {
@@ -660,7 +660,7 @@ var CoinbaseWalletAdapter = class {
660
660
  await this.provider.disconnect();
661
661
  }
662
662
  } catch (error) {
663
- _chunkGTEGWUGUjs.sentryLogger.warn("Error disconnecting from Coinbase Wallet", { error });
663
+ _chunkKD3A4VYBjs.sentryLogger.warn("Error disconnecting from Coinbase Wallet", { error });
664
664
  } finally {
665
665
  this.clearLocalStorage();
666
666
  }
@@ -699,13 +699,13 @@ var CoinbaseWalletAdapter = class {
699
699
  };
700
700
 
701
701
  // src/wallet-adapters/MetaMaskAdapter.ts
702
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
702
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
703
703
  var METAMASK_RDNS = "io.metamask";
704
704
  var MetaMaskAdapter = class {
705
705
  constructor() {
706
- this.id = _chunkGTEGWUGUjs.WalletId.MetaMask;
707
- this.name = _chunkGTEGWUGUjs.WalletName.MetaMask;
708
- this.icon = _nullishCoalesce(_chunkGTEGWUGUjs.getLogoDataUri.call(void 0, _chunkGTEGWUGUjs.WalletId.MetaMask, "brand"), () => ( ""));
706
+ this.id = _chunkKD3A4VYBjs.WalletId.MetaMask;
707
+ this.name = _chunkKD3A4VYBjs.WalletName.MetaMask;
708
+ this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.MetaMask, "brand"), () => ( ""));
709
709
  this.hide = false;
710
710
  this.downloadUrl = "https://metamask.io/download";
711
711
  this.wcDeepLinkUrl = "metamask://wc?uri=";
@@ -770,7 +770,7 @@ var MetaMaskAdapter = class {
770
770
  await this.providerPromise;
771
771
  }
772
772
  if (!this.provider) {
773
- _chunkGTEGWUGUjs.sentryLogger.error("MetaMask is not available");
773
+ _chunkKD3A4VYBjs.sentryLogger.error("MetaMask is not available");
774
774
  throw new Error("MetaMask is not available");
775
775
  }
776
776
  await this.provider.request({
@@ -782,7 +782,7 @@ var MetaMaskAdapter = class {
782
782
  params: []
783
783
  });
784
784
  if (!accounts || accounts.length === 0 || !accounts[0]) {
785
- _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from MetaMask");
785
+ _chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from MetaMask");
786
786
  throw new Error("No accounts returned from MetaMask");
787
787
  }
788
788
  return {
@@ -838,10 +838,10 @@ var MetaMaskAdapter = class {
838
838
  };
839
839
 
840
840
  // src/wallet-adapters/WalletConnectAdapter.ts
841
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
841
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
842
842
 
843
843
  // src/constants/adapters.ts
844
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
844
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
845
845
  var WALLETCONNECT_NAMESPACE = {
846
846
  eip155: {
847
847
  methods: [
@@ -934,9 +934,9 @@ function extractAddressFromSession(namespaces) {
934
934
  }
935
935
  var WalletConnectAdapter = class {
936
936
  constructor(config) {
937
- this.id = _chunkGTEGWUGUjs.WalletId.WalletConnect;
938
- this.name = _chunkGTEGWUGUjs.WalletName.WalletConnect;
939
- this.icon = _nullishCoalesce(_chunkGTEGWUGUjs.getLogoDataUri.call(void 0, _chunkGTEGWUGUjs.WalletId.WalletConnect, "brand"), () => ( ""));
937
+ this.id = _chunkKD3A4VYBjs.WalletId.WalletConnect;
938
+ this.name = _chunkKD3A4VYBjs.WalletName.WalletConnect;
939
+ this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.WalletConnect, "brand"), () => ( ""));
940
940
  this.hide = false;
941
941
  this.downloadUrl = null;
942
942
  this.wcDeepLinkUrl = null;
@@ -1074,13 +1074,13 @@ var WalletConnectAdapter = class {
1074
1074
  this.provider = provider;
1075
1075
  }
1076
1076
  } catch (error) {
1077
- _chunkGTEGWUGUjs.sentryLogger.warn("Failed to get provider from wagmi connector", { error });
1077
+ _chunkKD3A4VYBjs.sentryLogger.warn("Failed to get provider from wagmi connector", { error });
1078
1078
  }
1079
1079
  }
1080
1080
  }
1081
1081
  }
1082
1082
  } catch (error) {
1083
- _chunkGTEGWUGUjs.sentryLogger.warn("Failed to get provider from WalletConnect", { error });
1083
+ _chunkKD3A4VYBjs.sentryLogger.warn("Failed to get provider from WalletConnect", { error });
1084
1084
  }
1085
1085
  }
1086
1086
  isInstalled() {
@@ -1123,7 +1123,7 @@ var WalletConnectAdapter = class {
1123
1123
  * Emits walletconnect:uri event for QR code display.
1124
1124
  */
1125
1125
  async connect() {
1126
- if (!this.config.projectId) throw _chunkGTEGWUGUjs.createConfigError.call(void 0, "WalletConnect");
1126
+ if (!this.config.projectId) throw _chunkKD3A4VYBjs.createConfigError.call(void 0, "WalletConnect");
1127
1127
  await this.ensureInitialized();
1128
1128
  if (!this.universalProvider) throw new Error("WalletConnect is not available");
1129
1129
  await this.resetConnectionState();
@@ -1186,7 +1186,7 @@ var WalletConnectAdapter = class {
1186
1186
  * Used on mobile and when user clicks "Open Modal" button.
1187
1187
  */
1188
1188
  async openModal() {
1189
- if (!this.config.projectId) throw _chunkGTEGWUGUjs.createConfigError.call(void 0, "WalletConnect");
1189
+ if (!this.config.projectId) throw _chunkKD3A4VYBjs.createConfigError.call(void 0, "WalletConnect");
1190
1190
  await this.ensureInitialized();
1191
1191
  if (!this.modal) throw new Error("AppKit is not available");
1192
1192
  await this.resetConnectionState();
@@ -1362,12 +1362,12 @@ var WalletConnectAdapter = class {
1362
1362
  };
1363
1363
 
1364
1364
  // src/wallet-adapters/EmailAdapter.ts
1365
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
1365
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
1366
1366
  var _EmailAdapter = class _EmailAdapter {
1367
1367
  constructor(config) {
1368
- this.id = _chunkGTEGWUGUjs.WalletId.Email;
1369
- this.name = _chunkGTEGWUGUjs.WalletName.Email;
1370
- this.icon = _nullishCoalesce(_chunkGTEGWUGUjs.getLogoDataUri.call(void 0, _chunkGTEGWUGUjs.WalletId.Email, "brand"), () => ( ""));
1368
+ this.id = _chunkKD3A4VYBjs.WalletId.Email;
1369
+ this.name = _chunkKD3A4VYBjs.WalletName.Email;
1370
+ this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.Email, "brand"), () => ( ""));
1371
1371
  this.hide = true;
1372
1372
  this.downloadUrl = null;
1373
1373
  this.wcDeepLinkUrl = null;
@@ -1389,14 +1389,14 @@ var _EmailAdapter = class _EmailAdapter {
1389
1389
  }
1390
1390
  async emailAuthStart(email) {
1391
1391
  if (!this.projectId) {
1392
- throw _chunkGTEGWUGUjs.createConfigError.call(void 0, "Email");
1392
+ throw _chunkKD3A4VYBjs.createConfigError.call(void 0, "Email");
1393
1393
  }
1394
1394
  await this.ensureInitialized();
1395
1395
  if (!this.provider) {
1396
- _chunkGTEGWUGUjs.sentryLogger.error("Email is not available");
1396
+ _chunkKD3A4VYBjs.sentryLogger.error("Email is not available");
1397
1397
  throw new Error("Email is not available");
1398
1398
  }
1399
- const { signInWithEmail } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1399
+ const { signInWithEmail } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
1400
1400
  const authResult = await signInWithEmail({ email });
1401
1401
  return authResult;
1402
1402
  }
@@ -1406,14 +1406,14 @@ var _EmailAdapter = class _EmailAdapter {
1406
1406
  }
1407
1407
  await this.ensureInitialized();
1408
1408
  if (!this.provider) {
1409
- _chunkGTEGWUGUjs.sentryLogger.error("Email provider not initialized");
1409
+ _chunkKD3A4VYBjs.sentryLogger.error("Email provider not initialized");
1410
1410
  throw new Error("Email provider not initialized");
1411
1411
  }
1412
- const { verifyEmailOTP } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1412
+ const { verifyEmailOTP } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
1413
1413
  return verifyEmailOTP({ flowId, otp });
1414
1414
  }
1415
1415
  async connect() {
1416
- _chunkGTEGWUGUjs.sentryLogger.error("EmailAdapter.connect() is not implemented");
1416
+ _chunkKD3A4VYBjs.sentryLogger.error("EmailAdapter.connect() is not implemented");
1417
1417
  throw new Error("EmailAdapter.connect() is not implemented");
1418
1418
  }
1419
1419
  async tryRestoreConnection() {
@@ -1441,7 +1441,7 @@ var _EmailAdapter = class _EmailAdapter {
1441
1441
  async disconnect() {
1442
1442
  try {
1443
1443
  await this.ensureInitialized();
1444
- const { signOut } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1444
+ const { signOut } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
1445
1445
  await signOut();
1446
1446
  } catch (e12) {
1447
1447
  }
@@ -1487,7 +1487,7 @@ var _EmailAdapter = class _EmailAdapter {
1487
1487
  * Called by ensureInitialized() - deduplication handled via initPromise.
1488
1488
  */
1489
1489
  async initializeProvider() {
1490
- const { initialize } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1490
+ const { initialize } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
1491
1491
  await initialize({
1492
1492
  projectId: this.projectId,
1493
1493
  ethereum: {
@@ -1505,7 +1505,7 @@ var _EmailAdapter = class _EmailAdapter {
1505
1505
  async createProvider() {
1506
1506
  try {
1507
1507
  await _EmailAdapter.initializeChainData();
1508
- const { createCDPEmbeddedWallet } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1508
+ const { createCDPEmbeddedWallet } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
1509
1509
  const wallet = createCDPEmbeddedWallet({
1510
1510
  chains: _EmailAdapter.viemChains,
1511
1511
  transports: _EmailAdapter.viemTransports
@@ -1526,7 +1526,7 @@ var _EmailAdapter = class _EmailAdapter {
1526
1526
  const chainIdHex = await base.request({ method: "eth_chainId", params: [] });
1527
1527
  chainId = parseInt(chainIdHex, 16);
1528
1528
  } catch (e13) {
1529
- _chunkGTEGWUGUjs.sentryLogger.error("Failed to get chainId for fallback request");
1529
+ _chunkKD3A4VYBjs.sentryLogger.error("Failed to get chainId for fallback request");
1530
1530
  throw new Error("Failed to get chainId for fallback request");
1531
1531
  }
1532
1532
  const publicClient = await getPublicClient(chainId);
@@ -1541,7 +1541,7 @@ var _EmailAdapter = class _EmailAdapter {
1541
1541
  };
1542
1542
  return wrapped;
1543
1543
  } catch (error) {
1544
- _chunkGTEGWUGUjs.sentryLogger.error("Failed to initialize Email provider", { error });
1544
+ _chunkKD3A4VYBjs.sentryLogger.error("Failed to initialize Email provider", { error });
1545
1545
  return null;
1546
1546
  }
1547
1547
  }
@@ -1584,7 +1584,7 @@ function createWalletAdapters({
1584
1584
  }
1585
1585
 
1586
1586
  // src/providers/RpcProvider.ts
1587
- _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
1587
+ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
1588
1588
  var ProviderRpcError = class extends Error {
1589
1589
  constructor(code, message, data) {
1590
1590
  super(message);
@@ -1665,10 +1665,17 @@ var _AurumCore = class _AurumCore {
1665
1665
  this.connectedWalletAdapter = null;
1666
1666
  this.eventListeners = /* @__PURE__ */ new Map();
1667
1667
  if (_AurumCore.instance) {
1668
+ const incoming = _AurumCore.serializeConfig(config);
1669
+ if (incoming !== null && incoming !== _AurumCore.storedConfigJson) {
1670
+ console.warn(
1671
+ "Aurum Constructor called a second time with a different config; the original config is kept. Use updateBrandConfig() / updateWalletsConfig() to change config at runtime."
1672
+ );
1673
+ }
1668
1674
  return _AurumCore.instance;
1669
1675
  }
1676
+ _AurumCore.storedConfigJson = _AurumCore.serializeConfig(config);
1670
1677
  const telemetryEnabled = config.telemetry !== false;
1671
- _chunkGTEGWUGUjs.initSentry.call(void 0, telemetryEnabled);
1678
+ _chunkKD3A4VYBjs.initSentry.call(void 0, telemetryEnabled);
1672
1679
  this.brandConfig = this.resolveBrandConfig(config);
1673
1680
  this.excludedWallets = new Set(_nullishCoalesce(_optionalChain([config, 'access', _139 => _139.wallets, 'optionalAccess', _140 => _140.exclude]), () => ( [])));
1674
1681
  this.wallets = createWalletAdapters({
@@ -1685,10 +1692,17 @@ var _AurumCore = class _AurumCore {
1685
1692
  this.readyPromise = this.tryRestoreConnection();
1686
1693
  _AurumCore.instance = this;
1687
1694
  }
1695
+ static serializeConfig(config) {
1696
+ try {
1697
+ return JSON.stringify(config);
1698
+ } catch (e14) {
1699
+ return null;
1700
+ }
1701
+ }
1688
1702
  async whenReady() {
1689
1703
  try {
1690
1704
  await this.readyPromise;
1691
- } catch (e14) {
1705
+ } catch (e15) {
1692
1706
  this.resetConnectionState();
1693
1707
  this.ready = true;
1694
1708
  }
@@ -1723,7 +1737,7 @@ var _AurumCore = class _AurumCore {
1723
1737
  if (!adapter) {
1724
1738
  throw new Error(`${walletId} is not configured`);
1725
1739
  }
1726
- if (walletId === _chunkGTEGWUGUjs.WalletId.WalletConnect && adapter.openModal) {
1740
+ if (walletId === _chunkKD3A4VYBjs.WalletId.WalletConnect && adapter.openModal) {
1727
1741
  result = await adapter.openModal();
1728
1742
  } else {
1729
1743
  if (!adapter.isInstalled()) {
@@ -1735,19 +1749,19 @@ var _AurumCore = class _AurumCore {
1735
1749
  const displayedWallets = this.wallets.filter((w) => !this.excludedWallets.has(w.id));
1736
1750
  const modalResult = await renderConnectModal({ displayedWallets, brandConfig: this.brandConfig });
1737
1751
  if (!modalResult) {
1738
- _chunkGTEGWUGUjs.sentryLogger.error("Missing modal result");
1752
+ _chunkKD3A4VYBjs.sentryLogger.error("Missing modal result");
1739
1753
  throw new Error("Missing modal result");
1740
1754
  }
1741
1755
  adapter = this.wallets.find((w) => w.id === modalResult.walletId) || null;
1742
1756
  if (!adapter) {
1743
- _chunkGTEGWUGUjs.sentryLogger.error(`Selected wallet adapter not found: ${modalResult.walletId}`);
1757
+ _chunkKD3A4VYBjs.sentryLogger.error(`Selected wallet adapter not found: ${modalResult.walletId}`);
1744
1758
  throw new Error("Selected wallet adapter not found");
1745
1759
  }
1746
1760
  result = modalResult;
1747
1761
  }
1748
1762
  const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
1749
1763
  if (!provider) {
1750
- _chunkGTEGWUGUjs.sentryLogger.error(`Error fetching provider on login: ${adapter.id}`);
1764
+ _chunkKD3A4VYBjs.sentryLogger.error(`Error fetching provider on login: ${adapter.id}`);
1751
1765
  throw new Error("Error fetching provider. Please try again.");
1752
1766
  }
1753
1767
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1764,7 +1778,7 @@ var _AurumCore = class _AurumCore {
1764
1778
  const chainId = await provider.request({ method: "eth_chainId" });
1765
1779
  this.emitConnect(chainId);
1766
1780
  this.emitAccountsChanged([checksumAdr]);
1767
- _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${adapter.id} (${walletId ? "headless" : "modal"})`);
1781
+ _chunkKD3A4VYBjs.sentryLogger.info(`Wallet connected: ${adapter.id} (${walletId ? "headless" : "modal"})`);
1768
1782
  return checksumAdr;
1769
1783
  }
1770
1784
  async disconnect() {
@@ -1793,7 +1807,7 @@ var _AurumCore = class _AurumCore {
1793
1807
  if (!adapter) throw new Error("Selected wallet adapter not found");
1794
1808
  const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
1795
1809
  if (!provider) {
1796
- _chunkGTEGWUGUjs.sentryLogger.error(`Error fetching provider on widget login: ${_optionalChain([result, 'optionalAccess', _153 => _153.walletId])}`);
1810
+ _chunkKD3A4VYBjs.sentryLogger.error(`Error fetching provider on widget login: ${_optionalChain([result, 'optionalAccess', _153 => _153.walletId])}`);
1797
1811
  throw new Error("Error fetching provider. Please try again.");
1798
1812
  }
1799
1813
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1810,7 +1824,7 @@ var _AurumCore = class _AurumCore {
1810
1824
  const chainId = await provider.request({ method: "eth_chainId" });
1811
1825
  this.emitConnect(chainId);
1812
1826
  this.emitAccountsChanged([checksumAdr]);
1813
- _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${adapter.id} (widget)`);
1827
+ _chunkKD3A4VYBjs.sentryLogger.info(`Wallet connected: ${adapter.id} (widget)`);
1814
1828
  return this.userInfo;
1815
1829
  }
1816
1830
  async getChainId() {
@@ -1829,7 +1843,7 @@ var _AurumCore = class _AurumCore {
1829
1843
  }
1830
1844
  }
1831
1845
  updateBrandConfig(newConfig) {
1832
- const defaultTheme = _chunkGTEGWUGUjs.getDefaultThemeConfig.call(void 0, _nullishCoalesce(newConfig.theme, () => ( this.brandConfig.theme)));
1846
+ const defaultTheme = _chunkKD3A4VYBjs.getDefaultThemeConfig.call(void 0, _nullishCoalesce(newConfig.theme, () => ( this.brandConfig.theme)));
1833
1847
  this.brandConfig = {
1834
1848
  logo: "logo" in newConfig ? _nullishCoalesce(newConfig.logo, () => ( defaultTheme.logo)) : this.brandConfig.logo,
1835
1849
  theme: "theme" in newConfig ? _nullishCoalesce(newConfig.theme, () => ( defaultTheme.theme)) : this.brandConfig.theme,
@@ -1842,7 +1856,7 @@ var _AurumCore = class _AurumCore {
1842
1856
  walletLayout: "walletLayout" in newConfig ? _nullishCoalesce(newConfig.walletLayout, () => ( defaultTheme.walletLayout)) : this.brandConfig.walletLayout
1843
1857
  };
1844
1858
  if ("theme" in newConfig && this.brandConfig.theme) {
1845
- const wcAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.WalletConnect);
1859
+ const wcAdapter = this.wallets.find((w) => w.id === _chunkKD3A4VYBjs.WalletId.WalletConnect);
1846
1860
  _optionalChain([wcAdapter, 'optionalAccess', _154 => _154.updateTheme, 'call', _155 => _155(this.brandConfig.theme)]);
1847
1861
  }
1848
1862
  }
@@ -1858,7 +1872,7 @@ var _AurumCore = class _AurumCore {
1858
1872
  */
1859
1873
  async emailAuthStart(email) {
1860
1874
  await this.whenReady();
1861
- const emailAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.Email);
1875
+ const emailAdapter = this.wallets.find((w) => w.id === _chunkKD3A4VYBjs.WalletId.Email);
1862
1876
  if (!emailAdapter || !emailAdapter.emailAuthStart) {
1863
1877
  throw new Error("Email wallet is not configured");
1864
1878
  }
@@ -1873,20 +1887,20 @@ var _AurumCore = class _AurumCore {
1873
1887
  */
1874
1888
  async emailAuthVerify(flowId, otp) {
1875
1889
  await this.whenReady();
1876
- const emailAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.Email);
1890
+ const emailAdapter = this.wallets.find((w) => w.id === _chunkKD3A4VYBjs.WalletId.Email);
1877
1891
  if (!emailAdapter || !emailAdapter.emailAuthVerify) {
1878
1892
  throw new Error("Email wallet is not configured");
1879
1893
  }
1880
1894
  const verifyResult = await emailAdapter.emailAuthVerify(flowId, otp);
1881
1895
  const provider = emailAdapter.getProvider();
1882
1896
  if (!provider) {
1883
- _chunkGTEGWUGUjs.sentryLogger.error("Failed to get provider after email verification");
1897
+ _chunkKD3A4VYBjs.sentryLogger.error("Failed to get provider after email verification");
1884
1898
  throw new Error("Failed to get provider after email verification");
1885
1899
  }
1886
1900
  const address = _optionalChain([verifyResult, 'access', _156 => _156.user, 'optionalAccess', _157 => _157.evmAccounts, 'optionalAccess', _158 => _158[0]]);
1887
1901
  const email = _optionalChain([verifyResult, 'access', _159 => _159.user, 'optionalAccess', _160 => _160.authenticationMethods, 'optionalAccess', _161 => _161.email, 'optionalAccess', _162 => _162.email]);
1888
1902
  if (!address || !email) {
1889
- _chunkGTEGWUGUjs.sentryLogger.error("Address or email not found after email verification");
1903
+ _chunkKD3A4VYBjs.sentryLogger.error("Address or email not found after email verification");
1890
1904
  throw new Error("Address or email not found after email verification");
1891
1905
  }
1892
1906
  const checksumAdr = _viem.checksumAddress.call(void 0, address);
@@ -1903,7 +1917,7 @@ var _AurumCore = class _AurumCore {
1903
1917
  const chainId = await provider.request({ method: "eth_chainId" });
1904
1918
  this.emitConnect(chainId);
1905
1919
  this.emitAccountsChanged([checksumAdr]);
1906
- _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${emailAdapter.id} (headless)`);
1920
+ _chunkKD3A4VYBjs.sentryLogger.info(`Wallet connected: ${emailAdapter.id} (headless)`);
1907
1921
  return { address: checksumAdr, email: _nullishCoalesce(email, () => ( "")), isNewUser: _nullishCoalesce(verifyResult.isNewUser, () => ( false)) };
1908
1922
  }
1909
1923
  /**
@@ -1912,7 +1926,7 @@ var _AurumCore = class _AurumCore {
1912
1926
  */
1913
1927
  async getWalletConnectSession() {
1914
1928
  await this.whenReady();
1915
- const wcAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.WalletConnect);
1929
+ const wcAdapter = this.wallets.find((w) => w.id === _chunkKD3A4VYBjs.WalletId.WalletConnect);
1916
1930
  if (!wcAdapter) {
1917
1931
  throw new Error("WalletConnect is not enabled");
1918
1932
  }
@@ -1923,7 +1937,7 @@ var _AurumCore = class _AurumCore {
1923
1937
  const result = await session.waitForConnection();
1924
1938
  const provider = _nullishCoalesce(result.provider, () => ( wcAdapter.getProvider()));
1925
1939
  if (!provider) {
1926
- _chunkGTEGWUGUjs.sentryLogger.error("Failed to get provider after WalletConnect connection");
1940
+ _chunkKD3A4VYBjs.sentryLogger.error("Failed to get provider after WalletConnect connection");
1927
1941
  throw new Error("Failed to get provider after WalletConnect connection");
1928
1942
  }
1929
1943
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1939,7 +1953,7 @@ var _AurumCore = class _AurumCore {
1939
1953
  const chainId = await provider.request({ method: "eth_chainId" });
1940
1954
  this.emitConnect(chainId);
1941
1955
  this.emitAccountsChanged([checksumAdr]);
1942
- _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${wcAdapter.id} (headless)`);
1956
+ _chunkKD3A4VYBjs.sentryLogger.info(`Wallet connected: ${wcAdapter.id} (headless)`);
1943
1957
  return checksumAdr;
1944
1958
  }
1945
1959
  };
@@ -1996,7 +2010,7 @@ var _AurumCore = class _AurumCore {
1996
2010
  /* BRAND & THEME METHODS */
1997
2011
  resolveBrandConfig(config) {
1998
2012
  const { brand = {} } = config || {};
1999
- const themeConfig = _chunkGTEGWUGUjs.getDefaultThemeConfig.call(void 0, brand.theme || _chunkGTEGWUGUjs.DEFAULT_THEME);
2013
+ const themeConfig = _chunkKD3A4VYBjs.getDefaultThemeConfig.call(void 0, brand.theme || _chunkKD3A4VYBjs.DEFAULT_THEME);
2000
2014
  return {
2001
2015
  logo: _nullishCoalesce(brand.logo, () => ( themeConfig.logo)),
2002
2016
  theme: _nullishCoalesce(brand.theme, () => ( themeConfig.theme)),
@@ -2010,9 +2024,13 @@ var _AurumCore = class _AurumCore {
2010
2024
  };
2011
2025
  }
2012
2026
  async tryRestoreConnection() {
2027
+ if (typeof window === "undefined") {
2028
+ this.ready = true;
2029
+ return;
2030
+ }
2013
2031
  try {
2014
- await _chunkGTEGWUGUjs.waitForStoreHydration.call(void 0, );
2015
- const store = _chunkGTEGWUGUjs.useAurumStore.getState();
2032
+ await _chunkKD3A4VYBjs.waitForStoreHydration.call(void 0, );
2033
+ const store = _chunkKD3A4VYBjs.useAurumStore.getState();
2016
2034
  if (!store.isConnected || !store.walletId || !store.address || !store.walletName) {
2017
2035
  return;
2018
2036
  }
@@ -2035,14 +2053,14 @@ var _AurumCore = class _AurumCore {
2035
2053
  email: _nullishCoalesce(store.email, () => ( void 0))
2036
2054
  };
2037
2055
  this.setInternalAccountChangeListener(persistedAdapter);
2038
- } catch (e15) {
2056
+ } catch (e16) {
2039
2057
  this.resetConnectionState();
2040
2058
  } finally {
2041
2059
  this.ready = true;
2042
2060
  }
2043
2061
  }
2044
2062
  persistConnectionState(adapter, address, email) {
2045
- _chunkGTEGWUGUjs.useAurumStore.getState().setConnection(adapter.id, _viem.checksumAddress.call(void 0, address), adapter.name, email);
2063
+ _chunkKD3A4VYBjs.useAurumStore.getState().setConnection(adapter.id, _viem.checksumAddress.call(void 0, address), adapter.name, email);
2046
2064
  }
2047
2065
  /* INTERNAL LISTENER METHODS */
2048
2066
  setInternalAccountChangeListener(adapter) {
@@ -2140,7 +2158,7 @@ var _AurumCore = class _AurumCore {
2140
2158
  }
2141
2159
  /* REST */
2142
2160
  resetConnectionState() {
2143
- _chunkGTEGWUGUjs.useAurumStore.getState().clearConnection();
2161
+ _chunkKD3A4VYBjs.useAurumStore.getState().clearConnection();
2144
2162
  this.connectedWalletAdapter = null;
2145
2163
  this.updateProvider(this.skeletonProvider);
2146
2164
  this.userInfo = void 0;
@@ -2148,6 +2166,10 @@ var _AurumCore = class _AurumCore {
2148
2166
  };
2149
2167
  // Singleton instance
2150
2168
  _AurumCore.instance = null;
2169
+ // Serialized first-construction config used to detect mismatched re-inits (dev footgun: HMR,
2170
+ // cross-module imports, etc). Stored as a string so re-construction with structurally-equal
2171
+ // config doesn't false-positive.
2172
+ _AurumCore.storedConfigJson = null;
2151
2173
  // Events managed by AurumCore (not forwarded to underlying provider)
2152
2174
  _AurumCore.MANAGED_EVENTS = ["accountsChanged", "connect", "disconnect"];
2153
2175
  var AurumCore = _AurumCore;