@aurum-sdk/core 0.2.3-canary.3 → 0.2.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.
package/dist/index.js CHANGED
@@ -13,12 +13,27 @@
13
13
 
14
14
 
15
15
 
16
- var _chunkMHRKTE55js = require('./chunk-MHRKTE55.js');
16
+
17
+
18
+
19
+ var _chunkGTEGWUGUjs = require('./chunk-GTEGWUGU.js');
20
+ require('./chunk-LMQLRSFP.js');
21
+
22
+
23
+ var _chunkIQ7F5R7Djs = require('./chunk-IQ7F5R7D.js');
24
+
25
+ // src/index.ts
26
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
27
+
28
+ // src/Aurum.ts
29
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
17
30
 
18
31
  // src/AurumCore.ts
32
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
19
33
  var _viem = require('viem');
20
34
 
21
35
  // src/utils/chainHelpers.ts
36
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
22
37
  function normalizeChainId(chainId) {
23
38
  if (typeof chainId === "string" && chainId.startsWith("0x")) return chainId;
24
39
  const numericId = typeof chainId === "number" ? chainId : Number(chainId);
@@ -40,37 +55,43 @@ function isChainExistsError(error) {
40
55
  );
41
56
  }
42
57
 
58
+ // src/components/ConnectModal/renderConnectModal.tsx
59
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
60
+
43
61
  // src/components/ConnectModal/ModalShell.tsx
62
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
44
63
  var _react = require('react');
45
64
  var _jsxruntime = require('react/jsx-runtime');
46
65
  var ModalShell = ({ onClose, brandConfig }) => {
47
66
  const [isOpen, setIsOpen] = _react.useState.call(void 0, true);
48
- const { currentPage } = _chunkMHRKTE55js.useNavigation.call(void 0, );
67
+ const { currentPage } = _chunkGTEGWUGUjs.useNavigation.call(void 0, );
49
68
  const handleClose = () => {
50
69
  setIsOpen(false);
51
70
  onClose();
52
71
  };
53
72
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
54
- _chunkMHRKTE55js.Modal,
73
+ _chunkGTEGWUGUjs.Modal,
55
74
  {
56
75
  isOpen,
57
76
  closeOnOverlayClick: true,
58
77
  onCloseComplete: handleClose,
59
78
  brandConfig,
60
79
  transitionKey: currentPage,
61
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMHRKTE55js.ConnectPages, {})
80
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGTEGWUGUjs.ConnectPages, {})
62
81
  }
63
82
  );
64
83
  };
65
84
 
66
85
  // src/utils/createModalContainer.ts
86
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
67
87
  var _client = require('react-dom/client');
68
88
 
69
89
  // src/utils/createShadowRoot.ts
90
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
70
91
  function createShadowRoot(container, brandConfig) {
71
92
  const shadowRoot = container.attachShadow({ mode: "open" });
72
93
  shadowRoot.innerHTML = `
73
- <style>${_chunkMHRKTE55js.generateCompleteStyles.call(void 0, brandConfig)}</style>
94
+ <style>${_chunkGTEGWUGUjs.generateCompleteStyles.call(void 0, brandConfig)}</style>
74
95
  <div class="aurum-modal-root"></div>
75
96
  `;
76
97
  return shadowRoot.querySelector(".aurum-modal-root");
@@ -107,7 +128,7 @@ function renderConnectModal({
107
128
  brandConfig
108
129
  }) {
109
130
  return new Promise((resolve, reject) => {
110
- const sortedWallets = _chunkMHRKTE55js.sortWallets.call(void 0, displayedWallets, { filterHidden: false });
131
+ const sortedWallets = _chunkGTEGWUGUjs.sortWallets.call(void 0, displayedWallets, { filterHidden: false });
111
132
  const { root, cleanup } = createModalContainer(CONTAINER_ID, brandConfig);
112
133
  const onConnect = (result) => {
113
134
  cleanup();
@@ -118,20 +139,25 @@ function renderConnectModal({
118
139
  reject(new Error("User rejected request"));
119
140
  };
120
141
  root.render(
121
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMHRKTE55js.ThemeContainer, { theme: brandConfig.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMHRKTE55js.ConnectUIProviders, { onConnect, displayedWallets: sortedWallets, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalShell, { onClose, brandConfig }) }) })
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 }) }) })
122
143
  );
123
144
  });
124
145
  }
125
146
 
147
+ // src/utils/createWalletAdapters.ts
148
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
149
+
150
+ // src/wallet-adapters/index.ts
151
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
152
+
126
153
  // src/wallet-adapters/RabbyAdapter.ts
127
- var _logos = require('@aurum-sdk/logos');
128
- var _types = require('@aurum-sdk/types');
154
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
129
155
  var RABBY_RDNS = "io.rabby";
130
156
  var RabbyAdapter = class {
131
157
  constructor() {
132
- this.id = _types.WalletId.Rabby;
133
- this.name = _types.WalletName.Rabby;
134
- this.icon = _nullishCoalesce(_logos.getLogoDataUri.call(void 0, _types.WalletId.Rabby, "brand"), () => ( ""));
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"), () => ( ""));
135
161
  this.hide = false;
136
162
  this.downloadUrl = "https://rabby.io";
137
163
  this.wcDeepLinkUrl = null;
@@ -190,7 +216,7 @@ var RabbyAdapter = class {
190
216
  await this.providerPromise;
191
217
  }
192
218
  if (!this.provider) {
193
- _chunkMHRKTE55js.sentryLogger.error("Rabby is not available");
219
+ _chunkGTEGWUGUjs.sentryLogger.error("Rabby is not available");
194
220
  throw new Error("Rabby is not available");
195
221
  }
196
222
  await this.provider.request({
@@ -202,7 +228,7 @@ var RabbyAdapter = class {
202
228
  params: []
203
229
  });
204
230
  if (!accounts || accounts.length === 0 || !accounts[0]) {
205
- _chunkMHRKTE55js.sentryLogger.error("No accounts returned from Rabby");
231
+ _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from Rabby");
206
232
  throw new Error("No accounts returned from Rabby");
207
233
  }
208
234
  return {
@@ -258,10 +284,10 @@ var RabbyAdapter = class {
258
284
  };
259
285
 
260
286
  // src/wallet-adapters/BraveAdapter.ts
261
-
262
-
287
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
263
288
 
264
289
  // src/utils/platform/isBraveBrowser.ts
290
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
265
291
  function isBraveBrowser() {
266
292
  if (typeof navigator === "undefined") return false;
267
293
  return navigator.brave !== void 0;
@@ -271,9 +297,9 @@ function isBraveBrowser() {
271
297
  var BRAVE_RDNS = "com.brave.wallet";
272
298
  var BraveAdapter = class {
273
299
  constructor() {
274
- this.id = _types.WalletId.Brave;
275
- this.name = _types.WalletName.Brave;
276
- this.icon = _nullishCoalesce(_logos.getLogoDataUri.call(void 0, _types.WalletId.Brave, "brand"), () => ( ""));
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"), () => ( ""));
277
303
  this.downloadUrl = "https://brave.com/download";
278
304
  this.wcDeepLinkUrl = null;
279
305
  this.provider = null;
@@ -336,7 +362,7 @@ var BraveAdapter = class {
336
362
  await this.providerPromise;
337
363
  }
338
364
  if (!this.provider) {
339
- _chunkMHRKTE55js.sentryLogger.error("Brave Wallet is not available");
365
+ _chunkGTEGWUGUjs.sentryLogger.error("Brave Wallet is not available");
340
366
  throw new Error("Brave Wallet is not available");
341
367
  }
342
368
  await this.provider.request({
@@ -348,7 +374,7 @@ var BraveAdapter = class {
348
374
  params: []
349
375
  });
350
376
  if (!accounts || accounts.length === 0 || !accounts[0]) {
351
- _chunkMHRKTE55js.sentryLogger.error("No accounts returned from Brave Wallet");
377
+ _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from Brave Wallet");
352
378
  throw new Error("No accounts returned from Brave Wallet");
353
379
  }
354
380
  return {
@@ -404,14 +430,13 @@ var BraveAdapter = class {
404
430
  };
405
431
 
406
432
  // src/wallet-adapters/PhantomAdapter.ts
407
-
408
-
433
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
409
434
  var PHANTOM_RDNS = "app.phantom";
410
435
  var PhantomAdapter = class {
411
436
  constructor() {
412
- this.id = _types.WalletId.Phantom;
413
- this.name = _types.WalletName.Phantom;
414
- this.icon = _nullishCoalesce(_logos.getLogoDataUri.call(void 0, _types.WalletId.Phantom, "brand"), () => ( ""));
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"), () => ( ""));
415
440
  this.hide = false;
416
441
  this.downloadUrl = "https://phantom.com/download";
417
442
  this.wcDeepLinkUrl = "phantom://wc?uri=";
@@ -475,7 +500,7 @@ var PhantomAdapter = class {
475
500
  await this.providerPromise;
476
501
  }
477
502
  if (!this.provider) {
478
- _chunkMHRKTE55js.sentryLogger.error("Phantom is not available");
503
+ _chunkGTEGWUGUjs.sentryLogger.error("Phantom is not available");
479
504
  throw new Error("Phantom is not available");
480
505
  }
481
506
  await this.provider.request({
@@ -487,7 +512,7 @@ var PhantomAdapter = class {
487
512
  params: []
488
513
  });
489
514
  if (!accounts || accounts.length === 0 || !accounts[0]) {
490
- _chunkMHRKTE55js.sentryLogger.error("No accounts returned from Phantom");
515
+ _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from Phantom");
491
516
  throw new Error("No accounts returned from Phantom");
492
517
  }
493
518
  return {
@@ -543,48 +568,51 @@ var PhantomAdapter = class {
543
568
  };
544
569
 
545
570
  // src/wallet-adapters/CoinbaseWalletAdapter.ts
546
- var _walletsdk = require('@coinbase/wallet-sdk');
547
-
548
-
571
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
549
572
  var CoinbaseWalletAdapter = class {
550
573
  constructor({ appName, appLogoUrl, telemetry }) {
551
- this.id = _types.WalletId.CoinbaseWallet;
552
- this.name = _types.WalletName.CoinbaseWallet;
553
- this.icon = _nullishCoalesce(_logos.getLogoDataUri.call(void 0, _types.WalletId.CoinbaseWallet, "brand"), () => ( ""));
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"), () => ( ""));
554
577
  this.hide = false;
555
578
  this.downloadUrl = "https://www.coinbase.com/wallet/downloads";
556
579
  this.wcDeepLinkUrl = "cbwallet://wc?uri=";
557
580
  this.provider = null;
558
581
  this.accountsChangedCallback = null;
559
- this.provider = this.detectProvider({ appName, appLogoUrl, telemetry: _nullishCoalesce(telemetry, () => ( false)) });
560
- }
561
- detectProvider({
562
- appName,
563
- appLogoUrl,
564
- telemetry
565
- }) {
566
- if (typeof window === "undefined") return null;
582
+ this.initPromise = null;
583
+ this.config = { appName, appLogoUrl, telemetry: _nullishCoalesce(telemetry, () => ( false)) };
584
+ }
585
+ async ensureInitialized() {
586
+ if (this.provider) return;
587
+ if (!this.initPromise) {
588
+ this.initPromise = this.initializeProvider();
589
+ }
590
+ await this.initPromise;
591
+ }
592
+ async initializeProvider() {
593
+ if (typeof window === "undefined") return;
567
594
  try {
568
- const coinbaseSdk = _walletsdk.createCoinbaseWalletSDK.call(void 0, {
569
- appName,
570
- appLogoUrl,
595
+ const { createCoinbaseWalletSDK } = await Promise.resolve().then(() => _interopRequireWildcard(require("./dist-3K7ESMKX.js")));
596
+ const coinbaseSdk = createCoinbaseWalletSDK({
597
+ appName: this.config.appName,
598
+ appLogoUrl: this.config.appLogoUrl,
571
599
  preference: {
572
600
  options: "all",
573
- telemetry
601
+ telemetry: this.config.telemetry
574
602
  }
575
603
  });
576
- return coinbaseSdk.getProvider();
604
+ this.provider = coinbaseSdk.getProvider();
577
605
  } catch (error) {
578
- _chunkMHRKTE55js.sentryLogger.warn("Failed to initialize Coinbase Wallet provider", { error });
579
- return null;
606
+ _chunkGTEGWUGUjs.sentryLogger.warn("Failed to initialize Coinbase Wallet provider", { error });
580
607
  }
581
608
  }
582
609
  isInstalled() {
583
- return Boolean(this.provider);
610
+ return true;
584
611
  }
585
612
  async connect() {
586
- if (!this.isInstalled() || !this.provider) {
587
- _chunkMHRKTE55js.sentryLogger.error("Coinbase Wallet is not available");
613
+ await this.ensureInitialized();
614
+ if (!this.provider) {
615
+ _chunkGTEGWUGUjs.sentryLogger.error("Coinbase Wallet is not available");
588
616
  throw new Error("Coinbase Wallet is not available");
589
617
  }
590
618
  const accounts = await this.provider.request({
@@ -592,7 +620,7 @@ var CoinbaseWalletAdapter = class {
592
620
  params: []
593
621
  });
594
622
  if (!accounts || accounts.length === 0 || !accounts[0]) {
595
- _chunkMHRKTE55js.sentryLogger.error("No accounts returned from Coinbase Wallet");
623
+ _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from Coinbase Wallet");
596
624
  throw new Error("No accounts returned from Coinbase Wallet");
597
625
  }
598
626
  return {
@@ -602,7 +630,8 @@ var CoinbaseWalletAdapter = class {
602
630
  };
603
631
  }
604
632
  async tryRestoreConnection() {
605
- if (!this.isInstalled() || !this.provider) {
633
+ await this.ensureInitialized();
634
+ if (!this.provider) {
606
635
  return null;
607
636
  }
608
637
  try {
@@ -623,14 +652,15 @@ var CoinbaseWalletAdapter = class {
623
652
  }
624
653
  }
625
654
  async disconnect() {
655
+ if (!this.provider) return;
626
656
  try {
627
- if (_optionalChain([this, 'access', _47 => _47.provider, 'optionalAccess', _48 => _48.close])) {
657
+ if (this.provider.close) {
628
658
  await this.provider.close();
629
- } else if (_optionalChain([this, 'access', _49 => _49.provider, 'optionalAccess', _50 => _50.disconnect])) {
659
+ } else if (this.provider.disconnect) {
630
660
  await this.provider.disconnect();
631
661
  }
632
662
  } catch (error) {
633
- _chunkMHRKTE55js.sentryLogger.warn("Error disconnecting from Coinbase Wallet", { error });
663
+ _chunkGTEGWUGUjs.sentryLogger.warn("Error disconnecting from Coinbase Wallet", { error });
634
664
  } finally {
635
665
  this.clearLocalStorage();
636
666
  }
@@ -654,29 +684,28 @@ var CoinbaseWalletAdapter = class {
654
684
  // Called by Aurum when user connects wallet
655
685
  // Passes Aurum.ts --> syncStateFromAccountsChanged() to handle the provider accounts changed event
656
686
  onAccountsChanged(callback) {
657
- if (!_optionalChain([this, 'access', _51 => _51.provider, 'optionalAccess', _52 => _52.on])) return;
687
+ if (!_optionalChain([this, 'access', _47 => _47.provider, 'optionalAccess', _48 => _48.on])) return;
658
688
  if (this.accountsChangedCallback) {
659
- _optionalChain([this, 'access', _53 => _53.provider, 'access', _54 => _54.removeListener, 'optionalCall', _55 => _55("accountsChanged", this.accountsChangedCallback)]);
689
+ _optionalChain([this, 'access', _49 => _49.provider, 'access', _50 => _50.removeListener, 'optionalCall', _51 => _51("accountsChanged", this.accountsChangedCallback)]);
660
690
  }
661
691
  this.accountsChangedCallback = callback;
662
692
  this.provider.on("accountsChanged", this.accountsChangedCallback);
663
693
  }
664
694
  removeListeners() {
665
- if (!_optionalChain([this, 'access', _56 => _56.provider, 'optionalAccess', _57 => _57.removeListener]) || !this.accountsChangedCallback) return;
695
+ if (!_optionalChain([this, 'access', _52 => _52.provider, 'optionalAccess', _53 => _53.removeListener]) || !this.accountsChangedCallback) return;
666
696
  this.provider.removeListener("accountsChanged", this.accountsChangedCallback);
667
697
  this.accountsChangedCallback = null;
668
698
  }
669
699
  };
670
700
 
671
701
  // src/wallet-adapters/MetaMaskAdapter.ts
672
-
673
-
702
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
674
703
  var METAMASK_RDNS = "io.metamask";
675
704
  var MetaMaskAdapter = class {
676
705
  constructor() {
677
- this.id = _types.WalletId.MetaMask;
678
- this.name = _types.WalletName.MetaMask;
679
- this.icon = _nullishCoalesce(_logos.getLogoDataUri.call(void 0, _types.WalletId.MetaMask, "brand"), () => ( ""));
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"), () => ( ""));
680
709
  this.hide = false;
681
710
  this.downloadUrl = "https://metamask.io/download";
682
711
  this.wcDeepLinkUrl = "metamask://wc?uri=";
@@ -724,7 +753,7 @@ var MetaMaskAdapter = class {
724
753
  detectLegacyProvider() {
725
754
  const ethereum = window.ethereum;
726
755
  if (!ethereum) return null;
727
- if (_optionalChain([ethereum, 'access', _58 => _58.providers, 'optionalAccess', _59 => _59.length])) {
756
+ if (_optionalChain([ethereum, 'access', _54 => _54.providers, 'optionalAccess', _55 => _55.length])) {
728
757
  const metaMaskProvider = ethereum.providers.find((p) => p.isMetaMask && !p.isBraveWallet);
729
758
  if (metaMaskProvider) return metaMaskProvider;
730
759
  }
@@ -741,7 +770,7 @@ var MetaMaskAdapter = class {
741
770
  await this.providerPromise;
742
771
  }
743
772
  if (!this.provider) {
744
- _chunkMHRKTE55js.sentryLogger.error("MetaMask is not available");
773
+ _chunkGTEGWUGUjs.sentryLogger.error("MetaMask is not available");
745
774
  throw new Error("MetaMask is not available");
746
775
  }
747
776
  await this.provider.request({
@@ -753,7 +782,7 @@ var MetaMaskAdapter = class {
753
782
  params: []
754
783
  });
755
784
  if (!accounts || accounts.length === 0 || !accounts[0]) {
756
- _chunkMHRKTE55js.sentryLogger.error("No accounts returned from MetaMask");
785
+ _chunkGTEGWUGUjs.sentryLogger.error("No accounts returned from MetaMask");
757
786
  throw new Error("No accounts returned from MetaMask");
758
787
  }
759
788
  return {
@@ -794,25 +823,25 @@ var MetaMaskAdapter = class {
794
823
  // Called by Aurum when user connects wallet
795
824
  // Passes Aurum.ts --> syncStateFromAccountsChanged() to handle the provider accounts changed event
796
825
  onAccountsChanged(callback) {
797
- if (!_optionalChain([this, 'access', _60 => _60.provider, 'optionalAccess', _61 => _61.on])) return;
826
+ if (!_optionalChain([this, 'access', _56 => _56.provider, 'optionalAccess', _57 => _57.on])) return;
798
827
  if (this.accountsChangedCallback) {
799
- _optionalChain([this, 'access', _62 => _62.provider, 'access', _63 => _63.removeListener, 'optionalCall', _64 => _64("accountsChanged", this.accountsChangedCallback)]);
828
+ _optionalChain([this, 'access', _58 => _58.provider, 'access', _59 => _59.removeListener, 'optionalCall', _60 => _60("accountsChanged", this.accountsChangedCallback)]);
800
829
  }
801
830
  this.accountsChangedCallback = callback;
802
831
  this.provider.on("accountsChanged", this.accountsChangedCallback);
803
832
  }
804
833
  removeListeners() {
805
- if (!_optionalChain([this, 'access', _65 => _65.provider, 'optionalAccess', _66 => _66.removeListener]) || !this.accountsChangedCallback) return;
834
+ if (!_optionalChain([this, 'access', _61 => _61.provider, 'optionalAccess', _62 => _62.removeListener]) || !this.accountsChangedCallback) return;
806
835
  this.provider.removeListener("accountsChanged", this.accountsChangedCallback);
807
836
  this.accountsChangedCallback = null;
808
837
  }
809
838
  };
810
839
 
811
840
  // src/wallet-adapters/WalletConnectAdapter.ts
812
-
813
-
841
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
814
842
 
815
843
  // src/constants/adapters.ts
844
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
816
845
  var WALLETCONNECT_NAMESPACE = {
817
846
  eip155: {
818
847
  methods: [
@@ -899,15 +928,15 @@ var WALLETCONNECT_NAMESPACE = {
899
928
 
900
929
  // src/wallet-adapters/WalletConnectAdapter.ts
901
930
  function extractAddressFromSession(namespaces) {
902
- const accounts = _optionalChain([namespaces, 'optionalAccess', _67 => _67.eip155, 'optionalAccess', _68 => _68.accounts]) || [];
931
+ const accounts = _optionalChain([namespaces, 'optionalAccess', _63 => _63.eip155, 'optionalAccess', _64 => _64.accounts]) || [];
903
932
  const firstAccount = accounts[0];
904
- return _nullishCoalesce(_optionalChain([firstAccount, 'optionalAccess', _69 => _69.split, 'call', _70 => _70(":"), 'access', _71 => _71[2]]), () => ( null));
933
+ return _nullishCoalesce(_optionalChain([firstAccount, 'optionalAccess', _65 => _65.split, 'call', _66 => _66(":"), 'access', _67 => _67[2]]), () => ( null));
905
934
  }
906
935
  var WalletConnectAdapter = class {
907
936
  constructor(config) {
908
- this.id = _types.WalletId.WalletConnect;
909
- this.name = _types.WalletName.WalletConnect;
910
- this.icon = _nullishCoalesce(_logos.getLogoDataUri.call(void 0, _types.WalletId.WalletConnect, "brand"), () => ( ""));
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"), () => ( ""));
911
940
  this.hide = false;
912
941
  this.downloadUrl = null;
913
942
  this.wcDeepLinkUrl = null;
@@ -1012,11 +1041,11 @@ var WalletConnectAdapter = class {
1012
1041
  }
1013
1042
  }
1014
1043
  syncAddressFromWagmi() {
1015
- if (!_optionalChain([this, 'access', _72 => _72.wagmiAdapter, 'optionalAccess', _73 => _73.wagmiConfig])) return;
1044
+ if (!_optionalChain([this, 'access', _68 => _68.wagmiAdapter, 'optionalAccess', _69 => _69.wagmiConfig])) return;
1016
1045
  const { state } = this.wagmiAdapter.wagmiConfig;
1017
1046
  if (state.current && state.connections) {
1018
1047
  const connection = state.connections.get(state.current);
1019
- if (_optionalChain([connection, 'optionalAccess', _74 => _74.accounts, 'optionalAccess', _75 => _75[0]])) {
1048
+ if (_optionalChain([connection, 'optionalAccess', _70 => _70.accounts, 'optionalAccess', _71 => _71[0]])) {
1020
1049
  this.address = connection.accounts[0];
1021
1050
  }
1022
1051
  }
@@ -1027,17 +1056,17 @@ var WalletConnectAdapter = class {
1027
1056
  const getProvidersFn = this.modal.getProviders;
1028
1057
  if (typeof getProvidersFn === "function") {
1029
1058
  const providers = getProvidersFn.call(this.modal);
1030
- const eip155Provider = _optionalChain([providers, 'optionalAccess', _76 => _76["eip155"]]);
1059
+ const eip155Provider = _optionalChain([providers, 'optionalAccess', _72 => _72["eip155"]]);
1031
1060
  if (eip155Provider) {
1032
1061
  this.provider = eip155Provider;
1033
1062
  return;
1034
1063
  }
1035
1064
  }
1036
- if (_optionalChain([this, 'access', _77 => _77.wagmiAdapter, 'optionalAccess', _78 => _78.wagmiConfig])) {
1065
+ if (_optionalChain([this, 'access', _73 => _73.wagmiAdapter, 'optionalAccess', _74 => _74.wagmiConfig])) {
1037
1066
  const { state } = this.wagmiAdapter.wagmiConfig;
1038
1067
  if (state.current && state.connections) {
1039
1068
  const connection = state.connections.get(state.current);
1040
- const connector = _optionalChain([connection, 'optionalAccess', _79 => _79.connector]);
1069
+ const connector = _optionalChain([connection, 'optionalAccess', _75 => _75.connector]);
1041
1070
  if (connector && typeof connector.getProvider === "function") {
1042
1071
  try {
1043
1072
  const provider = await connector.getProvider();
@@ -1045,13 +1074,13 @@ var WalletConnectAdapter = class {
1045
1074
  this.provider = provider;
1046
1075
  }
1047
1076
  } catch (error) {
1048
- _chunkMHRKTE55js.sentryLogger.warn("Failed to get provider from wagmi connector", { error });
1077
+ _chunkGTEGWUGUjs.sentryLogger.warn("Failed to get provider from wagmi connector", { error });
1049
1078
  }
1050
1079
  }
1051
1080
  }
1052
1081
  }
1053
1082
  } catch (error) {
1054
- _chunkMHRKTE55js.sentryLogger.warn("Failed to get provider from WalletConnect", { error });
1083
+ _chunkGTEGWUGUjs.sentryLogger.warn("Failed to get provider from WalletConnect", { error });
1055
1084
  }
1056
1085
  }
1057
1086
  isInstalled() {
@@ -1067,20 +1096,20 @@ var WalletConnectAdapter = class {
1067
1096
  this.lastKnownAccounts = [];
1068
1097
  this.lastKnownChainId = null;
1069
1098
  try {
1070
- const { state } = _optionalChain([this, 'access', _80 => _80.wagmiAdapter, 'optionalAccess', _81 => _81.wagmiConfig]) || {};
1071
- const connection = _optionalChain([state, 'optionalAccess', _82 => _82.current]) && _optionalChain([state, 'access', _83 => _83.connections, 'optionalAccess', _84 => _84.get, 'call', _85 => _85(state.current)]);
1072
- if (connection && typeof connection !== "string" && _optionalChain([connection, 'access', _86 => _86.connector, 'optionalAccess', _87 => _87.disconnect])) {
1099
+ const { state } = _optionalChain([this, 'access', _76 => _76.wagmiAdapter, 'optionalAccess', _77 => _77.wagmiConfig]) || {};
1100
+ const connection = _optionalChain([state, 'optionalAccess', _78 => _78.current]) && _optionalChain([state, 'access', _79 => _79.connections, 'optionalAccess', _80 => _80.get, 'call', _81 => _81(state.current)]);
1101
+ if (connection && typeof connection !== "string" && _optionalChain([connection, 'access', _82 => _82.connector, 'optionalAccess', _83 => _83.disconnect])) {
1073
1102
  await connection.connector.disconnect();
1074
1103
  }
1075
1104
  } catch (e6) {
1076
1105
  }
1077
- if (_optionalChain([this, 'access', _88 => _88.modal, 'optionalAccess', _89 => _89.getIsConnectedState, 'call', _90 => _90()])) {
1106
+ if (_optionalChain([this, 'access', _84 => _84.modal, 'optionalAccess', _85 => _85.getIsConnectedState, 'call', _86 => _86()])) {
1078
1107
  try {
1079
1108
  await this.modal.disconnect("eip155");
1080
1109
  } catch (e7) {
1081
1110
  }
1082
1111
  }
1083
- if (_optionalChain([this, 'access', _91 => _91.universalProvider, 'optionalAccess', _92 => _92.session])) {
1112
+ if (_optionalChain([this, 'access', _87 => _87.universalProvider, 'optionalAccess', _88 => _88.session])) {
1084
1113
  try {
1085
1114
  await this.universalProvider.disconnect();
1086
1115
  } catch (e8) {
@@ -1094,7 +1123,7 @@ var WalletConnectAdapter = class {
1094
1123
  * Emits walletconnect:uri event for QR code display.
1095
1124
  */
1096
1125
  async connect() {
1097
- if (!this.config.projectId) throw _chunkMHRKTE55js.createConfigError.call(void 0, "WalletConnect");
1126
+ if (!this.config.projectId) throw _chunkGTEGWUGUjs.createConfigError.call(void 0, "WalletConnect");
1098
1127
  await this.ensureInitialized();
1099
1128
  if (!this.universalProvider) throw new Error("WalletConnect is not available");
1100
1129
  await this.resetConnectionState();
@@ -1157,7 +1186,7 @@ var WalletConnectAdapter = class {
1157
1186
  * Used on mobile and when user clicks "Open Modal" button.
1158
1187
  */
1159
1188
  async openModal() {
1160
- if (!this.config.projectId) throw _chunkMHRKTE55js.createConfigError.call(void 0, "WalletConnect");
1189
+ if (!this.config.projectId) throw _chunkGTEGWUGUjs.createConfigError.call(void 0, "WalletConnect");
1161
1190
  await this.ensureInitialized();
1162
1191
  if (!this.modal) throw new Error("AppKit is not available");
1163
1192
  await this.resetConnectionState();
@@ -1169,7 +1198,7 @@ var WalletConnectAdapter = class {
1169
1198
  const startTime = Date.now();
1170
1199
  let unsubscribe = null;
1171
1200
  let resolved = false;
1172
- const cleanup = () => _optionalChain([unsubscribe, 'optionalCall', _93 => _93()]);
1201
+ const cleanup = () => _optionalChain([unsubscribe, 'optionalCall', _89 => _89()]);
1173
1202
  const checkConnection = async () => {
1174
1203
  if (resolved) return true;
1175
1204
  this.syncAddressFromWagmi();
@@ -1177,10 +1206,10 @@ var WalletConnectAdapter = class {
1177
1206
  if (this.provider && this.address) {
1178
1207
  try {
1179
1208
  const accounts = await this.provider.request({ method: "eth_accounts" });
1180
- if (_optionalChain([accounts, 'optionalAccess', _94 => _94.length])) {
1209
+ if (_optionalChain([accounts, 'optionalAccess', _90 => _90.length])) {
1181
1210
  resolved = true;
1182
1211
  cleanup();
1183
- _optionalChain([this, 'access', _95 => _95.modal, 'optionalAccess', _96 => _96.close, 'call', _97 => _97()]);
1212
+ _optionalChain([this, 'access', _91 => _91.modal, 'optionalAccess', _92 => _92.close, 'call', _93 => _93()]);
1184
1213
  this.lastKnownAccounts = accounts;
1185
1214
  resolve({ address: this.address, provider: this.provider, walletId: this.id });
1186
1215
  return true;
@@ -1215,9 +1244,9 @@ var WalletConnectAdapter = class {
1215
1244
  try {
1216
1245
  await new Promise((r) => setTimeout(r, 1e3));
1217
1246
  const { state } = this.wagmiAdapter.wagmiConfig || {};
1218
- const connection = _optionalChain([state, 'optionalAccess', _98 => _98.current]) && _optionalChain([state, 'access', _99 => _99.connections, 'optionalAccess', _100 => _100.get, 'call', _101 => _101(state.current)]);
1247
+ const connection = _optionalChain([state, 'optionalAccess', _94 => _94.current]) && _optionalChain([state, 'access', _95 => _95.connections, 'optionalAccess', _96 => _96.get, 'call', _97 => _97(state.current)]);
1219
1248
  if (!connection || typeof connection === "string") return null;
1220
- const address = _optionalChain([connection, 'access', _102 => _102.accounts, 'optionalAccess', _103 => _103[0]]);
1249
+ const address = _optionalChain([connection, 'access', _98 => _98.accounts, 'optionalAccess', _99 => _99[0]]);
1221
1250
  if (address && this.provider) {
1222
1251
  this.address = address;
1223
1252
  this.lastKnownAccounts = [...connection.accounts || []];
@@ -1246,10 +1275,10 @@ var WalletConnectAdapter = class {
1246
1275
  return this.provider;
1247
1276
  }
1248
1277
  onAccountsChanged(callback) {
1249
- if (this.accountsChangedCallback && _optionalChain([this, 'access', _104 => _104.provider, 'optionalAccess', _105 => _105.removeListener])) {
1278
+ if (this.accountsChangedCallback && _optionalChain([this, 'access', _100 => _100.provider, 'optionalAccess', _101 => _101.removeListener])) {
1250
1279
  this.provider.removeListener("accountsChanged", this.accountsChangedCallback);
1251
1280
  }
1252
- if (this.sessionUpdateHandler && _optionalChain([this, 'access', _106 => _106.universalProvider, 'optionalAccess', _107 => _107.removeListener])) {
1281
+ if (this.sessionUpdateHandler && _optionalChain([this, 'access', _102 => _102.universalProvider, 'optionalAccess', _103 => _103.removeListener])) {
1253
1282
  this.universalProvider.removeListener("session_update", this.sessionUpdateHandler);
1254
1283
  }
1255
1284
  if (!this.lastKnownAccounts.length && this.address) this.lastKnownAccounts = [this.address];
@@ -1258,12 +1287,12 @@ var WalletConnectAdapter = class {
1258
1287
  this.lastKnownAccounts = accounts;
1259
1288
  callback(accounts);
1260
1289
  };
1261
- if (_optionalChain([this, 'access', _108 => _108.provider, 'optionalAccess', _109 => _109.on])) {
1290
+ if (_optionalChain([this, 'access', _104 => _104.provider, 'optionalAccess', _105 => _105.on])) {
1262
1291
  this.provider.on("accountsChanged", this.accountsChangedCallback);
1263
1292
  }
1264
- if (_optionalChain([this, 'access', _110 => _110.universalProvider, 'optionalAccess', _111 => _111.on])) {
1293
+ if (_optionalChain([this, 'access', _106 => _106.universalProvider, 'optionalAccess', _107 => _107.on])) {
1265
1294
  this.sessionUpdateHandler = (args) => {
1266
- const accounts = this.extractAccountsFromNamespaces(_optionalChain([args, 'optionalAccess', _112 => _112.params, 'optionalAccess', _113 => _113.namespaces]));
1295
+ const accounts = this.extractAccountsFromNamespaces(_optionalChain([args, 'optionalAccess', _108 => _108.params, 'optionalAccess', _109 => _109.namespaces]));
1267
1296
  if (accounts.length && this.hasAccountsChanged(accounts)) {
1268
1297
  this.lastKnownAccounts = accounts;
1269
1298
  this.address = accounts[0];
@@ -1274,8 +1303,8 @@ var WalletConnectAdapter = class {
1274
1303
  }
1275
1304
  }
1276
1305
  onChainChanged(callback) {
1277
- if (!_optionalChain([this, 'access', _114 => _114.provider, 'optionalAccess', _115 => _115.on])) return;
1278
- if (this.chainChangedCallback) _optionalChain([this, 'access', _116 => _116.provider, 'access', _117 => _117.removeListener, 'optionalCall', _118 => _118("chainChanged", this.chainChangedCallback)]);
1306
+ if (!_optionalChain([this, 'access', _110 => _110.provider, 'optionalAccess', _111 => _111.on])) return;
1307
+ if (this.chainChangedCallback) _optionalChain([this, 'access', _112 => _112.provider, 'access', _113 => _113.removeListener, 'optionalCall', _114 => _114("chainChanged", this.chainChangedCallback)]);
1279
1308
  this.chainChangedCallback = (chainId) => {
1280
1309
  const normalized = typeof chainId === "string" ? chainId : `0x${Number(chainId).toString(16)}`;
1281
1310
  if (normalized !== this.lastKnownChainId) {
@@ -1300,7 +1329,7 @@ var WalletConnectAdapter = class {
1300
1329
  if (!namespaces) return [];
1301
1330
  const accounts = [];
1302
1331
  Object.values(namespaces).forEach((ns) => {
1303
- _optionalChain([ns, 'optionalAccess', _119 => _119.accounts, 'optionalAccess', _120 => _120.forEach, 'call', _121 => _121((account) => {
1332
+ _optionalChain([ns, 'optionalAccess', _115 => _115.accounts, 'optionalAccess', _116 => _116.forEach, 'call', _117 => _117((account) => {
1304
1333
  const address = account.split(":")[2];
1305
1334
  if (address) accounts.push(address);
1306
1335
  })]);
@@ -1309,19 +1338,19 @@ var WalletConnectAdapter = class {
1309
1338
  }
1310
1339
  hasAccountsChanged(newAccounts) {
1311
1340
  if (newAccounts.length !== this.lastKnownAccounts.length) return true;
1312
- return newAccounts.some((acc, i) => acc.toLowerCase() !== _optionalChain([this, 'access', _122 => _122.lastKnownAccounts, 'access', _123 => _123[i], 'optionalAccess', _124 => _124.toLowerCase, 'call', _125 => _125()]));
1341
+ return newAccounts.some((acc, i) => acc.toLowerCase() !== _optionalChain([this, 'access', _118 => _118.lastKnownAccounts, 'access', _119 => _119[i], 'optionalAccess', _120 => _120.toLowerCase, 'call', _121 => _121()]));
1313
1342
  }
1314
1343
  removeListeners() {
1315
1344
  if (this.accountsChangedCallback) {
1316
- _optionalChain([this, 'access', _126 => _126.provider, 'optionalAccess', _127 => _127.removeListener, 'optionalCall', _128 => _128("accountsChanged", this.accountsChangedCallback)]);
1345
+ _optionalChain([this, 'access', _122 => _122.provider, 'optionalAccess', _123 => _123.removeListener, 'optionalCall', _124 => _124("accountsChanged", this.accountsChangedCallback)]);
1317
1346
  this.accountsChangedCallback = null;
1318
1347
  }
1319
1348
  if (this.chainChangedCallback) {
1320
- _optionalChain([this, 'access', _129 => _129.provider, 'optionalAccess', _130 => _130.removeListener, 'optionalCall', _131 => _131("chainChanged", this.chainChangedCallback)]);
1349
+ _optionalChain([this, 'access', _125 => _125.provider, 'optionalAccess', _126 => _126.removeListener, 'optionalCall', _127 => _127("chainChanged", this.chainChangedCallback)]);
1321
1350
  this.chainChangedCallback = null;
1322
1351
  }
1323
1352
  if (this.sessionUpdateHandler) {
1324
- _optionalChain([this, 'access', _132 => _132.universalProvider, 'optionalAccess', _133 => _133.removeListener, 'optionalCall', _134 => _134("session_update", this.sessionUpdateHandler)]);
1353
+ _optionalChain([this, 'access', _128 => _128.universalProvider, 'optionalAccess', _129 => _129.removeListener, 'optionalCall', _130 => _130("session_update", this.sessionUpdateHandler)]);
1325
1354
  this.sessionUpdateHandler = null;
1326
1355
  }
1327
1356
  this.disconnectCallback = null;
@@ -1333,21 +1362,20 @@ var WalletConnectAdapter = class {
1333
1362
  };
1334
1363
 
1335
1364
  // src/wallet-adapters/EmailAdapter.ts
1336
-
1337
-
1365
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
1338
1366
  var _EmailAdapter = class _EmailAdapter {
1339
1367
  constructor(config) {
1340
- this.id = _types.WalletId.Email;
1341
- this.name = _types.WalletName.Email;
1342
- this.icon = _nullishCoalesce(_logos.getLogoDataUri.call(void 0, _types.WalletId.Email, "brand"), () => ( ""));
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"), () => ( ""));
1343
1371
  this.hide = true;
1344
1372
  this.downloadUrl = null;
1345
1373
  this.wcDeepLinkUrl = null;
1346
1374
  this.provider = null;
1347
1375
  this.initPromise = null;
1348
1376
  this.publicClientCache = /* @__PURE__ */ new Map();
1349
- this.projectId = _optionalChain([config, 'optionalAccess', _135 => _135.projectId]) || "";
1350
- this.telemetry = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _136 => _136.telemetry]), () => ( false));
1377
+ this.projectId = _optionalChain([config, 'optionalAccess', _131 => _131.projectId]) || "";
1378
+ this.telemetry = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _132 => _132.telemetry]), () => ( false));
1351
1379
  }
1352
1380
  async ensureInitialized() {
1353
1381
  if (this.provider) return;
@@ -1361,21 +1389,16 @@ var _EmailAdapter = class _EmailAdapter {
1361
1389
  }
1362
1390
  async emailAuthStart(email) {
1363
1391
  if (!this.projectId) {
1364
- throw _chunkMHRKTE55js.createConfigError.call(void 0, "Email");
1392
+ throw _chunkGTEGWUGUjs.createConfigError.call(void 0, "Email");
1365
1393
  }
1366
1394
  await this.ensureInitialized();
1367
1395
  if (!this.provider) {
1368
- _chunkMHRKTE55js.sentryLogger.error("Email is not available");
1396
+ _chunkGTEGWUGUjs.sentryLogger.error("Email is not available");
1369
1397
  throw new Error("Email is not available");
1370
1398
  }
1371
- try {
1372
- const { signInWithEmail } = await Promise.resolve().then(() => _interopRequireWildcard(require("@coinbase/cdp-core")));
1373
- const authResult = await signInWithEmail({ email });
1374
- return authResult;
1375
- } catch (error) {
1376
- _chunkMHRKTE55js.sentryLogger.error("Failed to start email authentication", { error });
1377
- throw error;
1378
- }
1399
+ const { signInWithEmail } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1400
+ const authResult = await signInWithEmail({ email });
1401
+ return authResult;
1379
1402
  }
1380
1403
  async emailAuthVerify(flowId, otp) {
1381
1404
  if (!flowId || !otp) {
@@ -1383,14 +1406,14 @@ var _EmailAdapter = class _EmailAdapter {
1383
1406
  }
1384
1407
  await this.ensureInitialized();
1385
1408
  if (!this.provider) {
1386
- _chunkMHRKTE55js.sentryLogger.error("Email provider not initialized");
1409
+ _chunkGTEGWUGUjs.sentryLogger.error("Email provider not initialized");
1387
1410
  throw new Error("Email provider not initialized");
1388
1411
  }
1389
- const { verifyEmailOTP } = await Promise.resolve().then(() => _interopRequireWildcard(require("@coinbase/cdp-core")));
1412
+ const { verifyEmailOTP } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1390
1413
  return verifyEmailOTP({ flowId, otp });
1391
1414
  }
1392
1415
  async connect() {
1393
- _chunkMHRKTE55js.sentryLogger.error("EmailAdapter.connect() is not implemented");
1416
+ _chunkGTEGWUGUjs.sentryLogger.error("EmailAdapter.connect() is not implemented");
1394
1417
  throw new Error("EmailAdapter.connect() is not implemented");
1395
1418
  }
1396
1419
  async tryRestoreConnection() {
@@ -1418,7 +1441,7 @@ var _EmailAdapter = class _EmailAdapter {
1418
1441
  async disconnect() {
1419
1442
  try {
1420
1443
  await this.ensureInitialized();
1421
- const { signOut } = await Promise.resolve().then(() => _interopRequireWildcard(require("@coinbase/cdp-core")));
1444
+ const { signOut } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1422
1445
  await signOut();
1423
1446
  } catch (e12) {
1424
1447
  }
@@ -1464,7 +1487,7 @@ var _EmailAdapter = class _EmailAdapter {
1464
1487
  * Called by ensureInitialized() - deduplication handled via initPromise.
1465
1488
  */
1466
1489
  async initializeProvider() {
1467
- const { initialize } = await Promise.resolve().then(() => _interopRequireWildcard(require("@coinbase/cdp-core")));
1490
+ const { initialize } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1468
1491
  await initialize({
1469
1492
  projectId: this.projectId,
1470
1493
  ethereum: {
@@ -1482,7 +1505,7 @@ var _EmailAdapter = class _EmailAdapter {
1482
1505
  async createProvider() {
1483
1506
  try {
1484
1507
  await _EmailAdapter.initializeChainData();
1485
- const { createCDPEmbeddedWallet } = await Promise.resolve().then(() => _interopRequireWildcard(require("@coinbase/cdp-core")));
1508
+ const { createCDPEmbeddedWallet } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-ZRK5OLZ5.js")));
1486
1509
  const wallet = createCDPEmbeddedWallet({
1487
1510
  chains: _EmailAdapter.viemChains,
1488
1511
  transports: _EmailAdapter.viemTransports
@@ -1495,15 +1518,15 @@ var _EmailAdapter = class _EmailAdapter {
1495
1518
  try {
1496
1519
  return await base.request(args);
1497
1520
  } catch (err) {
1498
- const msg = String(_optionalChain([err, 'optionalAccess', _137 => _137.message]) || "");
1499
- const isUnsupported = msg.includes("not supported") || msg.includes("Unsupported") || _optionalChain([err, 'optionalAccess', _138 => _138.code]) === -32601;
1521
+ const msg = String(_optionalChain([err, 'optionalAccess', _133 => _133.message]) || "");
1522
+ const isUnsupported = msg.includes("not supported") || msg.includes("Unsupported") || _optionalChain([err, 'optionalAccess', _134 => _134.code]) === -32601;
1500
1523
  if (isUnsupported) {
1501
1524
  let chainId;
1502
1525
  try {
1503
1526
  const chainIdHex = await base.request({ method: "eth_chainId", params: [] });
1504
1527
  chainId = parseInt(chainIdHex, 16);
1505
1528
  } catch (e13) {
1506
- _chunkMHRKTE55js.sentryLogger.error("Failed to get chainId for fallback request");
1529
+ _chunkGTEGWUGUjs.sentryLogger.error("Failed to get chainId for fallback request");
1507
1530
  throw new Error("Failed to get chainId for fallback request");
1508
1531
  }
1509
1532
  const publicClient = await getPublicClient(chainId);
@@ -1518,7 +1541,7 @@ var _EmailAdapter = class _EmailAdapter {
1518
1541
  };
1519
1542
  return wrapped;
1520
1543
  } catch (error) {
1521
- _chunkMHRKTE55js.sentryLogger.error("Failed to initialize Email provider", { error });
1544
+ _chunkGTEGWUGUjs.sentryLogger.error("Failed to initialize Email provider", { error });
1522
1545
  return null;
1523
1546
  }
1524
1547
  }
@@ -1544,10 +1567,10 @@ function createWalletAdapters({
1544
1567
  telemetry
1545
1568
  }) {
1546
1569
  return [
1547
- new EmailAdapter({ projectId: _optionalChain([walletsConfig, 'optionalAccess', _139 => _139.embedded, 'optionalAccess', _140 => _140.projectId]), telemetry }),
1570
+ new EmailAdapter({ projectId: _optionalChain([walletsConfig, 'optionalAccess', _135 => _135.embedded, 'optionalAccess', _136 => _136.projectId]), telemetry }),
1548
1571
  new MetaMaskAdapter(),
1549
1572
  new WalletConnectAdapter({
1550
- projectId: _optionalChain([walletsConfig, 'optionalAccess', _141 => _141.walletConnect, 'optionalAccess', _142 => _142.projectId]),
1573
+ projectId: _optionalChain([walletsConfig, 'optionalAccess', _137 => _137.walletConnect, 'optionalAccess', _138 => _138.projectId]),
1551
1574
  appName,
1552
1575
  modalZIndex,
1553
1576
  theme,
@@ -1560,10 +1583,8 @@ function createWalletAdapters({
1560
1583
  ];
1561
1584
  }
1562
1585
 
1563
- // src/AurumCore.ts
1564
-
1565
-
1566
1586
  // src/providers/RpcProvider.ts
1587
+ _chunkIQ7F5R7Djs.init_polyfills.call(void 0, );
1567
1588
  var ProviderRpcError = class extends Error {
1568
1589
  constructor(code, message, data) {
1569
1590
  super(message);
@@ -1647,9 +1668,9 @@ var _AurumCore = class _AurumCore {
1647
1668
  return _AurumCore.instance;
1648
1669
  }
1649
1670
  const telemetryEnabled = config.telemetry !== false;
1650
- _chunkMHRKTE55js.initSentry.call(void 0, telemetryEnabled);
1671
+ _chunkGTEGWUGUjs.initSentry.call(void 0, telemetryEnabled);
1651
1672
  this.brandConfig = this.resolveBrandConfig(config);
1652
- this.excludedWallets = new Set(_nullishCoalesce(_optionalChain([config, 'access', _143 => _143.wallets, 'optionalAccess', _144 => _144.exclude]), () => ( [])));
1673
+ this.excludedWallets = new Set(_nullishCoalesce(_optionalChain([config, 'access', _139 => _139.wallets, 'optionalAccess', _140 => _140.exclude]), () => ( [])));
1653
1674
  this.wallets = createWalletAdapters({
1654
1675
  walletsConfig: config.wallets,
1655
1676
  appName: this.brandConfig.appName,
@@ -1686,7 +1707,7 @@ var _AurumCore = class _AurumCore {
1686
1707
  if (walletId === "email") {
1687
1708
  throw new Error("Use emailAuthStart() and emailAuthVerify() for email wallet connections");
1688
1709
  }
1689
- if (_optionalChain([this, 'access', _145 => _145.userInfo, 'optionalAccess', _146 => _146.publicAddress]) && _optionalChain([this, 'access', _147 => _147.connectedWalletAdapter, 'optionalAccess', _148 => _148.getProvider, 'call', _149 => _149()])) {
1710
+ if (_optionalChain([this, 'access', _141 => _141.userInfo, 'optionalAccess', _142 => _142.publicAddress]) && _optionalChain([this, 'access', _143 => _143.connectedWalletAdapter, 'optionalAccess', _144 => _144.getProvider, 'call', _145 => _145()])) {
1690
1711
  if (!walletId || this.userInfo.walletId === walletId) {
1691
1712
  return this.userInfo.publicAddress;
1692
1713
  }
@@ -1702,7 +1723,7 @@ var _AurumCore = class _AurumCore {
1702
1723
  if (!adapter) {
1703
1724
  throw new Error(`${walletId} is not configured`);
1704
1725
  }
1705
- if (walletId === _types.WalletId.WalletConnect && adapter.openModal) {
1726
+ if (walletId === _chunkGTEGWUGUjs.WalletId.WalletConnect && adapter.openModal) {
1706
1727
  result = await adapter.openModal();
1707
1728
  } else {
1708
1729
  if (!adapter.isInstalled()) {
@@ -1714,19 +1735,19 @@ var _AurumCore = class _AurumCore {
1714
1735
  const displayedWallets = this.wallets.filter((w) => !this.excludedWallets.has(w.id));
1715
1736
  const modalResult = await renderConnectModal({ displayedWallets, brandConfig: this.brandConfig });
1716
1737
  if (!modalResult) {
1717
- _chunkMHRKTE55js.sentryLogger.error("Missing modal result");
1738
+ _chunkGTEGWUGUjs.sentryLogger.error("Missing modal result");
1718
1739
  throw new Error("Missing modal result");
1719
1740
  }
1720
1741
  adapter = this.wallets.find((w) => w.id === modalResult.walletId) || null;
1721
1742
  if (!adapter) {
1722
- _chunkMHRKTE55js.sentryLogger.error(`Selected wallet adapter not found: ${modalResult.walletId}`);
1743
+ _chunkGTEGWUGUjs.sentryLogger.error(`Selected wallet adapter not found: ${modalResult.walletId}`);
1723
1744
  throw new Error("Selected wallet adapter not found");
1724
1745
  }
1725
1746
  result = modalResult;
1726
1747
  }
1727
1748
  const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
1728
1749
  if (!provider) {
1729
- _chunkMHRKTE55js.sentryLogger.error(`Error fetching provider on login: ${adapter.id}`);
1750
+ _chunkGTEGWUGUjs.sentryLogger.error(`Error fetching provider on login: ${adapter.id}`);
1730
1751
  throw new Error("Error fetching provider. Please try again.");
1731
1752
  }
1732
1753
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1743,7 +1764,7 @@ var _AurumCore = class _AurumCore {
1743
1764
  const chainId = await provider.request({ method: "eth_chainId" });
1744
1765
  this.emitConnect(chainId);
1745
1766
  this.emitAccountsChanged([checksumAdr]);
1746
- _chunkMHRKTE55js.sentryLogger.info(`Wallet connected: ${adapter.id} (${walletId ? "headless" : "modal"})`);
1767
+ _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${adapter.id} (${walletId ? "headless" : "modal"})`);
1747
1768
  return checksumAdr;
1748
1769
  }
1749
1770
  async disconnect() {
@@ -1763,7 +1784,7 @@ var _AurumCore = class _AurumCore {
1763
1784
  async isConnected() {
1764
1785
  await this.whenReady();
1765
1786
  return Boolean(
1766
- _optionalChain([this, 'access', _150 => _150.userInfo, 'optionalAccess', _151 => _151.publicAddress]) && _optionalChain([this, 'access', _152 => _152.userInfo, 'optionalAccess', _153 => _153.walletName]) && _optionalChain([this, 'access', _154 => _154.connectedWalletAdapter, 'optionalAccess', _155 => _155.getProvider, 'call', _156 => _156()])
1787
+ _optionalChain([this, 'access', _146 => _146.userInfo, 'optionalAccess', _147 => _147.publicAddress]) && _optionalChain([this, 'access', _148 => _148.userInfo, 'optionalAccess', _149 => _149.walletName]) && _optionalChain([this, 'access', _150 => _150.connectedWalletAdapter, 'optionalAccess', _151 => _151.getProvider, 'call', _152 => _152()])
1767
1788
  );
1768
1789
  }
1769
1790
  async handleWidgetConnection(result) {
@@ -1772,7 +1793,7 @@ var _AurumCore = class _AurumCore {
1772
1793
  if (!adapter) throw new Error("Selected wallet adapter not found");
1773
1794
  const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
1774
1795
  if (!provider) {
1775
- _chunkMHRKTE55js.sentryLogger.error(`Error fetching provider on widget login: ${_optionalChain([result, 'optionalAccess', _157 => _157.walletId])}`);
1796
+ _chunkGTEGWUGUjs.sentryLogger.error(`Error fetching provider on widget login: ${_optionalChain([result, 'optionalAccess', _153 => _153.walletId])}`);
1776
1797
  throw new Error("Error fetching provider. Please try again.");
1777
1798
  }
1778
1799
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1789,7 +1810,7 @@ var _AurumCore = class _AurumCore {
1789
1810
  const chainId = await provider.request({ method: "eth_chainId" });
1790
1811
  this.emitConnect(chainId);
1791
1812
  this.emitAccountsChanged([checksumAdr]);
1792
- _chunkMHRKTE55js.sentryLogger.info(`Wallet connected: ${adapter.id} (widget)`);
1813
+ _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${adapter.id} (widget)`);
1793
1814
  return this.userInfo;
1794
1815
  }
1795
1816
  async getChainId() {
@@ -1808,7 +1829,7 @@ var _AurumCore = class _AurumCore {
1808
1829
  }
1809
1830
  }
1810
1831
  updateBrandConfig(newConfig) {
1811
- const defaultTheme = _chunkMHRKTE55js.getDefaultThemeConfig.call(void 0, _nullishCoalesce(newConfig.theme, () => ( this.brandConfig.theme)));
1832
+ const defaultTheme = _chunkGTEGWUGUjs.getDefaultThemeConfig.call(void 0, _nullishCoalesce(newConfig.theme, () => ( this.brandConfig.theme)));
1812
1833
  this.brandConfig = {
1813
1834
  logo: "logo" in newConfig ? _nullishCoalesce(newConfig.logo, () => ( defaultTheme.logo)) : this.brandConfig.logo,
1814
1835
  theme: "theme" in newConfig ? _nullishCoalesce(newConfig.theme, () => ( defaultTheme.theme)) : this.brandConfig.theme,
@@ -1821,8 +1842,8 @@ var _AurumCore = class _AurumCore {
1821
1842
  walletLayout: "walletLayout" in newConfig ? _nullishCoalesce(newConfig.walletLayout, () => ( defaultTheme.walletLayout)) : this.brandConfig.walletLayout
1822
1843
  };
1823
1844
  if ("theme" in newConfig && this.brandConfig.theme) {
1824
- const wcAdapter = this.wallets.find((w) => w.id === _types.WalletId.WalletConnect);
1825
- _optionalChain([wcAdapter, 'optionalAccess', _158 => _158.updateTheme, 'call', _159 => _159(this.brandConfig.theme)]);
1845
+ const wcAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.WalletConnect);
1846
+ _optionalChain([wcAdapter, 'optionalAccess', _154 => _154.updateTheme, 'call', _155 => _155(this.brandConfig.theme)]);
1826
1847
  }
1827
1848
  }
1828
1849
  updateWalletsConfig(newConfig) {
@@ -1837,7 +1858,7 @@ var _AurumCore = class _AurumCore {
1837
1858
  */
1838
1859
  async emailAuthStart(email) {
1839
1860
  await this.whenReady();
1840
- const emailAdapter = this.wallets.find((w) => w.id === _types.WalletId.Email);
1861
+ const emailAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.Email);
1841
1862
  if (!emailAdapter || !emailAdapter.emailAuthStart) {
1842
1863
  throw new Error("Email wallet is not configured");
1843
1864
  }
@@ -1852,20 +1873,20 @@ var _AurumCore = class _AurumCore {
1852
1873
  */
1853
1874
  async emailAuthVerify(flowId, otp) {
1854
1875
  await this.whenReady();
1855
- const emailAdapter = this.wallets.find((w) => w.id === _types.WalletId.Email);
1876
+ const emailAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.Email);
1856
1877
  if (!emailAdapter || !emailAdapter.emailAuthVerify) {
1857
1878
  throw new Error("Email wallet is not configured");
1858
1879
  }
1859
1880
  const verifyResult = await emailAdapter.emailAuthVerify(flowId, otp);
1860
1881
  const provider = emailAdapter.getProvider();
1861
1882
  if (!provider) {
1862
- _chunkMHRKTE55js.sentryLogger.error("Failed to get provider after email verification");
1883
+ _chunkGTEGWUGUjs.sentryLogger.error("Failed to get provider after email verification");
1863
1884
  throw new Error("Failed to get provider after email verification");
1864
1885
  }
1865
- const address = _optionalChain([verifyResult, 'access', _160 => _160.user, 'optionalAccess', _161 => _161.evmAccounts, 'optionalAccess', _162 => _162[0]]);
1866
- const email = _optionalChain([verifyResult, 'access', _163 => _163.user, 'optionalAccess', _164 => _164.authenticationMethods, 'optionalAccess', _165 => _165.email, 'optionalAccess', _166 => _166.email]);
1886
+ const address = _optionalChain([verifyResult, 'access', _156 => _156.user, 'optionalAccess', _157 => _157.evmAccounts, 'optionalAccess', _158 => _158[0]]);
1887
+ const email = _optionalChain([verifyResult, 'access', _159 => _159.user, 'optionalAccess', _160 => _160.authenticationMethods, 'optionalAccess', _161 => _161.email, 'optionalAccess', _162 => _162.email]);
1867
1888
  if (!address || !email) {
1868
- _chunkMHRKTE55js.sentryLogger.error("Address or email not found after email verification");
1889
+ _chunkGTEGWUGUjs.sentryLogger.error("Address or email not found after email verification");
1869
1890
  throw new Error("Address or email not found after email verification");
1870
1891
  }
1871
1892
  const checksumAdr = _viem.checksumAddress.call(void 0, address);
@@ -1882,7 +1903,7 @@ var _AurumCore = class _AurumCore {
1882
1903
  const chainId = await provider.request({ method: "eth_chainId" });
1883
1904
  this.emitConnect(chainId);
1884
1905
  this.emitAccountsChanged([checksumAdr]);
1885
- _chunkMHRKTE55js.sentryLogger.info(`Wallet connected: ${emailAdapter.id} (headless)`);
1906
+ _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${emailAdapter.id} (headless)`);
1886
1907
  return { address: checksumAdr, email: _nullishCoalesce(email, () => ( "")), isNewUser: _nullishCoalesce(verifyResult.isNewUser, () => ( false)) };
1887
1908
  }
1888
1909
  /**
@@ -1891,7 +1912,7 @@ var _AurumCore = class _AurumCore {
1891
1912
  */
1892
1913
  async getWalletConnectSession() {
1893
1914
  await this.whenReady();
1894
- const wcAdapter = this.wallets.find((w) => w.id === _types.WalletId.WalletConnect);
1915
+ const wcAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.WalletConnect);
1895
1916
  if (!wcAdapter) {
1896
1917
  throw new Error("WalletConnect is not enabled");
1897
1918
  }
@@ -1902,7 +1923,7 @@ var _AurumCore = class _AurumCore {
1902
1923
  const result = await session.waitForConnection();
1903
1924
  const provider = _nullishCoalesce(result.provider, () => ( wcAdapter.getProvider()));
1904
1925
  if (!provider) {
1905
- _chunkMHRKTE55js.sentryLogger.error("Failed to get provider after WalletConnect connection");
1926
+ _chunkGTEGWUGUjs.sentryLogger.error("Failed to get provider after WalletConnect connection");
1906
1927
  throw new Error("Failed to get provider after WalletConnect connection");
1907
1928
  }
1908
1929
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1918,7 +1939,7 @@ var _AurumCore = class _AurumCore {
1918
1939
  const chainId = await provider.request({ method: "eth_chainId" });
1919
1940
  this.emitConnect(chainId);
1920
1941
  this.emitAccountsChanged([checksumAdr]);
1921
- _chunkMHRKTE55js.sentryLogger.info(`Wallet connected: ${wcAdapter.id} (headless)`);
1942
+ _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${wcAdapter.id} (headless)`);
1922
1943
  return checksumAdr;
1923
1944
  }
1924
1945
  };
@@ -1934,15 +1955,15 @@ var _AurumCore = class _AurumCore {
1934
1955
  }
1935
1956
  this.eventListeners.get(event).add(callback);
1936
1957
  if (!_AurumCore.MANAGED_EVENTS.includes(event)) {
1937
- _optionalChain([this, 'access', _167 => _167.currentProvider, 'access', _168 => _168.on, 'optionalCall', _169 => _169(event, callback)]);
1958
+ _optionalChain([this, 'access', _163 => _163.currentProvider, 'access', _164 => _164.on, 'optionalCall', _165 => _165(event, callback)]);
1938
1959
  }
1939
1960
  };
1940
1961
  }
1941
1962
  if (prop === "removeListener") {
1942
1963
  return (event, callback) => {
1943
- _optionalChain([this, 'access', _170 => _170.eventListeners, 'access', _171 => _171.get, 'call', _172 => _172(event), 'optionalAccess', _173 => _173.delete, 'call', _174 => _174(callback)]);
1964
+ _optionalChain([this, 'access', _166 => _166.eventListeners, 'access', _167 => _167.get, 'call', _168 => _168(event), 'optionalAccess', _169 => _169.delete, 'call', _170 => _170(callback)]);
1944
1965
  if (!_AurumCore.MANAGED_EVENTS.includes(event)) {
1945
- _optionalChain([this, 'access', _175 => _175.currentProvider, 'access', _176 => _176.removeListener, 'optionalCall', _177 => _177(event, callback)]);
1966
+ _optionalChain([this, 'access', _171 => _171.currentProvider, 'access', _172 => _172.removeListener, 'optionalCall', _173 => _173(event, callback)]);
1946
1967
  }
1947
1968
  };
1948
1969
  }
@@ -1967,7 +1988,7 @@ var _AurumCore = class _AurumCore {
1967
1988
  this.eventListeners.forEach((callbacks, event) => {
1968
1989
  if (!_AurumCore.MANAGED_EVENTS.includes(event)) {
1969
1990
  callbacks.forEach((callback) => {
1970
- _optionalChain([newProvider, 'access', _178 => _178.on, 'optionalCall', _179 => _179(event, callback)]);
1991
+ _optionalChain([newProvider, 'access', _174 => _174.on, 'optionalCall', _175 => _175(event, callback)]);
1971
1992
  });
1972
1993
  }
1973
1994
  });
@@ -1975,7 +1996,7 @@ var _AurumCore = class _AurumCore {
1975
1996
  /* BRAND & THEME METHODS */
1976
1997
  resolveBrandConfig(config) {
1977
1998
  const { brand = {} } = config || {};
1978
- const themeConfig = _chunkMHRKTE55js.getDefaultThemeConfig.call(void 0, brand.theme || _chunkMHRKTE55js.DEFAULT_THEME);
1999
+ const themeConfig = _chunkGTEGWUGUjs.getDefaultThemeConfig.call(void 0, brand.theme || _chunkGTEGWUGUjs.DEFAULT_THEME);
1979
2000
  return {
1980
2001
  logo: _nullishCoalesce(brand.logo, () => ( themeConfig.logo)),
1981
2002
  theme: _nullishCoalesce(brand.theme, () => ( themeConfig.theme)),
@@ -1990,8 +2011,8 @@ var _AurumCore = class _AurumCore {
1990
2011
  }
1991
2012
  async tryRestoreConnection() {
1992
2013
  try {
1993
- await _chunkMHRKTE55js.waitForStoreHydration.call(void 0, );
1994
- const store = _chunkMHRKTE55js.useAurumStore.getState();
2014
+ await _chunkGTEGWUGUjs.waitForStoreHydration.call(void 0, );
2015
+ const store = _chunkGTEGWUGUjs.useAurumStore.getState();
1995
2016
  if (!store.isConnected || !store.walletId || !store.address || !store.walletName) {
1996
2017
  return;
1997
2018
  }
@@ -2021,7 +2042,7 @@ var _AurumCore = class _AurumCore {
2021
2042
  }
2022
2043
  }
2023
2044
  persistConnectionState(adapter, address, email) {
2024
- _chunkMHRKTE55js.useAurumStore.getState().setConnection(adapter.id, _viem.checksumAddress.call(void 0, address), adapter.name, email);
2045
+ _chunkGTEGWUGUjs.useAurumStore.getState().setConnection(adapter.id, _viem.checksumAddress.call(void 0, address), adapter.name, email);
2025
2046
  }
2026
2047
  /* INTERNAL LISTENER METHODS */
2027
2048
  setInternalAccountChangeListener(adapter) {
@@ -2035,14 +2056,14 @@ var _AurumCore = class _AurumCore {
2035
2056
  }
2036
2057
  async syncStateFromAccountsChanged(accounts) {
2037
2058
  if (!accounts.length || !accounts[0]) return;
2038
- const prevAccount = _optionalChain([this, 'access', _180 => _180.userInfo, 'optionalAccess', _181 => _181.publicAddress]);
2059
+ const prevAccount = _optionalChain([this, 'access', _176 => _176.userInfo, 'optionalAccess', _177 => _177.publicAddress]);
2039
2060
  const newAccount = _viem.checksumAddress.call(void 0, accounts[0]);
2040
2061
  if (newAccount !== prevAccount) {
2041
2062
  this.userInfo = {
2042
2063
  publicAddress: newAccount,
2043
- walletName: _optionalChain([this, 'access', _182 => _182.userInfo, 'optionalAccess', _183 => _183.walletName]),
2044
- walletId: _optionalChain([this, 'access', _184 => _184.userInfo, 'optionalAccess', _185 => _185.walletId]),
2045
- email: _optionalChain([this, 'access', _186 => _186.userInfo, 'optionalAccess', _187 => _187.email])
2064
+ walletName: _optionalChain([this, 'access', _178 => _178.userInfo, 'optionalAccess', _179 => _179.walletName]),
2065
+ walletId: _optionalChain([this, 'access', _180 => _180.userInfo, 'optionalAccess', _181 => _181.walletId]),
2066
+ email: _optionalChain([this, 'access', _182 => _182.userInfo, 'optionalAccess', _183 => _183.email])
2046
2067
  };
2047
2068
  if (this.connectedWalletAdapter) {
2048
2069
  this.persistConnectionState(this.connectedWalletAdapter, newAccount, this.userInfo.email);
@@ -2101,7 +2122,7 @@ var _AurumCore = class _AurumCore {
2101
2122
  }
2102
2123
  }
2103
2124
  async addChain(chain) {
2104
- if (!_optionalChain([chain, 'optionalAccess', _188 => _188.id]) || !_optionalChain([chain, 'optionalAccess', _189 => _189.name]) || !_optionalChain([chain, 'optionalAccess', _190 => _190.nativeCurrency]) || !_optionalChain([chain, 'optionalAccess', _191 => _191.rpcUrls, 'optionalAccess', _192 => _192.default, 'optionalAccess', _193 => _193.http])) {
2125
+ if (!_optionalChain([chain, 'optionalAccess', _184 => _184.id]) || !_optionalChain([chain, 'optionalAccess', _185 => _185.name]) || !_optionalChain([chain, 'optionalAccess', _186 => _186.nativeCurrency]) || !_optionalChain([chain, 'optionalAccess', _187 => _187.rpcUrls, 'optionalAccess', _188 => _188.default, 'optionalAccess', _189 => _189.http])) {
2105
2126
  throw new Error("Invalid chain configuration: missing required properties");
2106
2127
  }
2107
2128
  await this.rpcProvider.request({
@@ -2119,7 +2140,7 @@ var _AurumCore = class _AurumCore {
2119
2140
  }
2120
2141
  /* REST */
2121
2142
  resetConnectionState() {
2122
- _chunkMHRKTE55js.useAurumStore.getState().clearConnection();
2143
+ _chunkGTEGWUGUjs.useAurumStore.getState().clearConnection();
2123
2144
  this.connectedWalletAdapter = null;
2124
2145
  this.updateProvider(this.skeletonProvider);
2125
2146
  this.userInfo = void 0;