@aurum-sdk/core 0.2.4 → 0.2.5

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 _chunk27AOACEWjs = require('./chunk-27AOACEW.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 } = _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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, _chunk27AOACEWjs.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>${_chunk27AOACEWjs.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 = _chunk27AOACEWjs.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, _chunk27AOACEWjs.ThemeContainer, { theme: brandConfig.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk27AOACEWjs.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 = _chunk27AOACEWjs.WalletId.Rabby;
159
+ this.name = _chunk27AOACEWjs.WalletName.Rabby;
160
+ this.icon = _nullishCoalesce(_chunk27AOACEWjs.getLogoDataUri.call(void 0, _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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 = _chunk27AOACEWjs.WalletId.Brave;
301
+ this.name = _chunk27AOACEWjs.WalletName.Brave;
302
+ this.icon = _nullishCoalesce(_chunk27AOACEWjs.getLogoDataUri.call(void 0, _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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 = _chunk27AOACEWjs.WalletId.Phantom;
438
+ this.name = _chunk27AOACEWjs.WalletName.Phantom;
439
+ this.icon = _nullishCoalesce(_chunk27AOACEWjs.getLogoDataUri.call(void 0, _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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 = _chunk27AOACEWjs.WalletId.CoinbaseWallet;
575
+ this.name = _chunk27AOACEWjs.WalletName.CoinbaseWallet;
576
+ this.icon = _nullishCoalesce(_chunk27AOACEWjs.getLogoDataUri.call(void 0, _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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 = _chunk27AOACEWjs.WalletId.MetaMask;
707
+ this.name = _chunk27AOACEWjs.WalletName.MetaMask;
708
+ this.icon = _nullishCoalesce(_chunk27AOACEWjs.getLogoDataUri.call(void 0, _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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 = _chunk27AOACEWjs.WalletId.WalletConnect;
938
+ this.name = _chunk27AOACEWjs.WalletName.WalletConnect;
939
+ this.icon = _nullishCoalesce(_chunk27AOACEWjs.getLogoDataUri.call(void 0, _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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 _chunk27AOACEWjs.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 _chunk27AOACEWjs.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 = _chunk27AOACEWjs.WalletId.Email;
1369
+ this.name = _chunk27AOACEWjs.WalletName.Email;
1370
+ this.icon = _nullishCoalesce(_chunk27AOACEWjs.getLogoDataUri.call(void 0, _chunk27AOACEWjs.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 _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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-WXUV52ZW.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
+ _chunk27AOACEWjs.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-WXUV52ZW.js")));
1413
1413
  return verifyEmailOTP({ flowId, otp });
1414
1414
  }
1415
1415
  async connect() {
1416
- _chunkGTEGWUGUjs.sentryLogger.error("EmailAdapter.connect() is not implemented");
1416
+ _chunk27AOACEWjs.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-WXUV52ZW.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-WXUV52ZW.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-WXUV52ZW.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
+ _chunk27AOACEWjs.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
+ _chunk27AOACEWjs.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);
@@ -1668,7 +1668,7 @@ var _AurumCore = class _AurumCore {
1668
1668
  return _AurumCore.instance;
1669
1669
  }
1670
1670
  const telemetryEnabled = config.telemetry !== false;
1671
- _chunkGTEGWUGUjs.initSentry.call(void 0, telemetryEnabled);
1671
+ _chunk27AOACEWjs.initSentry.call(void 0, telemetryEnabled);
1672
1672
  this.brandConfig = this.resolveBrandConfig(config);
1673
1673
  this.excludedWallets = new Set(_nullishCoalesce(_optionalChain([config, 'access', _139 => _139.wallets, 'optionalAccess', _140 => _140.exclude]), () => ( [])));
1674
1674
  this.wallets = createWalletAdapters({
@@ -1723,7 +1723,7 @@ var _AurumCore = class _AurumCore {
1723
1723
  if (!adapter) {
1724
1724
  throw new Error(`${walletId} is not configured`);
1725
1725
  }
1726
- if (walletId === _chunkGTEGWUGUjs.WalletId.WalletConnect && adapter.openModal) {
1726
+ if (walletId === _chunk27AOACEWjs.WalletId.WalletConnect && adapter.openModal) {
1727
1727
  result = await adapter.openModal();
1728
1728
  } else {
1729
1729
  if (!adapter.isInstalled()) {
@@ -1735,19 +1735,19 @@ var _AurumCore = class _AurumCore {
1735
1735
  const displayedWallets = this.wallets.filter((w) => !this.excludedWallets.has(w.id));
1736
1736
  const modalResult = await renderConnectModal({ displayedWallets, brandConfig: this.brandConfig });
1737
1737
  if (!modalResult) {
1738
- _chunkGTEGWUGUjs.sentryLogger.error("Missing modal result");
1738
+ _chunk27AOACEWjs.sentryLogger.error("Missing modal result");
1739
1739
  throw new Error("Missing modal result");
1740
1740
  }
1741
1741
  adapter = this.wallets.find((w) => w.id === modalResult.walletId) || null;
1742
1742
  if (!adapter) {
1743
- _chunkGTEGWUGUjs.sentryLogger.error(`Selected wallet adapter not found: ${modalResult.walletId}`);
1743
+ _chunk27AOACEWjs.sentryLogger.error(`Selected wallet adapter not found: ${modalResult.walletId}`);
1744
1744
  throw new Error("Selected wallet adapter not found");
1745
1745
  }
1746
1746
  result = modalResult;
1747
1747
  }
1748
1748
  const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
1749
1749
  if (!provider) {
1750
- _chunkGTEGWUGUjs.sentryLogger.error(`Error fetching provider on login: ${adapter.id}`);
1750
+ _chunk27AOACEWjs.sentryLogger.error(`Error fetching provider on login: ${adapter.id}`);
1751
1751
  throw new Error("Error fetching provider. Please try again.");
1752
1752
  }
1753
1753
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1764,7 +1764,7 @@ var _AurumCore = class _AurumCore {
1764
1764
  const chainId = await provider.request({ method: "eth_chainId" });
1765
1765
  this.emitConnect(chainId);
1766
1766
  this.emitAccountsChanged([checksumAdr]);
1767
- _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${adapter.id} (${walletId ? "headless" : "modal"})`);
1767
+ _chunk27AOACEWjs.sentryLogger.info(`Wallet connected: ${adapter.id} (${walletId ? "headless" : "modal"})`);
1768
1768
  return checksumAdr;
1769
1769
  }
1770
1770
  async disconnect() {
@@ -1793,7 +1793,7 @@ var _AurumCore = class _AurumCore {
1793
1793
  if (!adapter) throw new Error("Selected wallet adapter not found");
1794
1794
  const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
1795
1795
  if (!provider) {
1796
- _chunkGTEGWUGUjs.sentryLogger.error(`Error fetching provider on widget login: ${_optionalChain([result, 'optionalAccess', _153 => _153.walletId])}`);
1796
+ _chunk27AOACEWjs.sentryLogger.error(`Error fetching provider on widget login: ${_optionalChain([result, 'optionalAccess', _153 => _153.walletId])}`);
1797
1797
  throw new Error("Error fetching provider. Please try again.");
1798
1798
  }
1799
1799
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1810,7 +1810,7 @@ var _AurumCore = class _AurumCore {
1810
1810
  const chainId = await provider.request({ method: "eth_chainId" });
1811
1811
  this.emitConnect(chainId);
1812
1812
  this.emitAccountsChanged([checksumAdr]);
1813
- _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${adapter.id} (widget)`);
1813
+ _chunk27AOACEWjs.sentryLogger.info(`Wallet connected: ${adapter.id} (widget)`);
1814
1814
  return this.userInfo;
1815
1815
  }
1816
1816
  async getChainId() {
@@ -1829,7 +1829,7 @@ var _AurumCore = class _AurumCore {
1829
1829
  }
1830
1830
  }
1831
1831
  updateBrandConfig(newConfig) {
1832
- const defaultTheme = _chunkGTEGWUGUjs.getDefaultThemeConfig.call(void 0, _nullishCoalesce(newConfig.theme, () => ( this.brandConfig.theme)));
1832
+ const defaultTheme = _chunk27AOACEWjs.getDefaultThemeConfig.call(void 0, _nullishCoalesce(newConfig.theme, () => ( this.brandConfig.theme)));
1833
1833
  this.brandConfig = {
1834
1834
  logo: "logo" in newConfig ? _nullishCoalesce(newConfig.logo, () => ( defaultTheme.logo)) : this.brandConfig.logo,
1835
1835
  theme: "theme" in newConfig ? _nullishCoalesce(newConfig.theme, () => ( defaultTheme.theme)) : this.brandConfig.theme,
@@ -1842,7 +1842,7 @@ var _AurumCore = class _AurumCore {
1842
1842
  walletLayout: "walletLayout" in newConfig ? _nullishCoalesce(newConfig.walletLayout, () => ( defaultTheme.walletLayout)) : this.brandConfig.walletLayout
1843
1843
  };
1844
1844
  if ("theme" in newConfig && this.brandConfig.theme) {
1845
- const wcAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.WalletConnect);
1845
+ const wcAdapter = this.wallets.find((w) => w.id === _chunk27AOACEWjs.WalletId.WalletConnect);
1846
1846
  _optionalChain([wcAdapter, 'optionalAccess', _154 => _154.updateTheme, 'call', _155 => _155(this.brandConfig.theme)]);
1847
1847
  }
1848
1848
  }
@@ -1858,7 +1858,7 @@ var _AurumCore = class _AurumCore {
1858
1858
  */
1859
1859
  async emailAuthStart(email) {
1860
1860
  await this.whenReady();
1861
- const emailAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.Email);
1861
+ const emailAdapter = this.wallets.find((w) => w.id === _chunk27AOACEWjs.WalletId.Email);
1862
1862
  if (!emailAdapter || !emailAdapter.emailAuthStart) {
1863
1863
  throw new Error("Email wallet is not configured");
1864
1864
  }
@@ -1873,20 +1873,20 @@ var _AurumCore = class _AurumCore {
1873
1873
  */
1874
1874
  async emailAuthVerify(flowId, otp) {
1875
1875
  await this.whenReady();
1876
- const emailAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.Email);
1876
+ const emailAdapter = this.wallets.find((w) => w.id === _chunk27AOACEWjs.WalletId.Email);
1877
1877
  if (!emailAdapter || !emailAdapter.emailAuthVerify) {
1878
1878
  throw new Error("Email wallet is not configured");
1879
1879
  }
1880
1880
  const verifyResult = await emailAdapter.emailAuthVerify(flowId, otp);
1881
1881
  const provider = emailAdapter.getProvider();
1882
1882
  if (!provider) {
1883
- _chunkGTEGWUGUjs.sentryLogger.error("Failed to get provider after email verification");
1883
+ _chunk27AOACEWjs.sentryLogger.error("Failed to get provider after email verification");
1884
1884
  throw new Error("Failed to get provider after email verification");
1885
1885
  }
1886
1886
  const address = _optionalChain([verifyResult, 'access', _156 => _156.user, 'optionalAccess', _157 => _157.evmAccounts, 'optionalAccess', _158 => _158[0]]);
1887
1887
  const email = _optionalChain([verifyResult, 'access', _159 => _159.user, 'optionalAccess', _160 => _160.authenticationMethods, 'optionalAccess', _161 => _161.email, 'optionalAccess', _162 => _162.email]);
1888
1888
  if (!address || !email) {
1889
- _chunkGTEGWUGUjs.sentryLogger.error("Address or email not found after email verification");
1889
+ _chunk27AOACEWjs.sentryLogger.error("Address or email not found after email verification");
1890
1890
  throw new Error("Address or email not found after email verification");
1891
1891
  }
1892
1892
  const checksumAdr = _viem.checksumAddress.call(void 0, address);
@@ -1903,7 +1903,7 @@ var _AurumCore = class _AurumCore {
1903
1903
  const chainId = await provider.request({ method: "eth_chainId" });
1904
1904
  this.emitConnect(chainId);
1905
1905
  this.emitAccountsChanged([checksumAdr]);
1906
- _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${emailAdapter.id} (headless)`);
1906
+ _chunk27AOACEWjs.sentryLogger.info(`Wallet connected: ${emailAdapter.id} (headless)`);
1907
1907
  return { address: checksumAdr, email: _nullishCoalesce(email, () => ( "")), isNewUser: _nullishCoalesce(verifyResult.isNewUser, () => ( false)) };
1908
1908
  }
1909
1909
  /**
@@ -1912,7 +1912,7 @@ var _AurumCore = class _AurumCore {
1912
1912
  */
1913
1913
  async getWalletConnectSession() {
1914
1914
  await this.whenReady();
1915
- const wcAdapter = this.wallets.find((w) => w.id === _chunkGTEGWUGUjs.WalletId.WalletConnect);
1915
+ const wcAdapter = this.wallets.find((w) => w.id === _chunk27AOACEWjs.WalletId.WalletConnect);
1916
1916
  if (!wcAdapter) {
1917
1917
  throw new Error("WalletConnect is not enabled");
1918
1918
  }
@@ -1923,7 +1923,7 @@ var _AurumCore = class _AurumCore {
1923
1923
  const result = await session.waitForConnection();
1924
1924
  const provider = _nullishCoalesce(result.provider, () => ( wcAdapter.getProvider()));
1925
1925
  if (!provider) {
1926
- _chunkGTEGWUGUjs.sentryLogger.error("Failed to get provider after WalletConnect connection");
1926
+ _chunk27AOACEWjs.sentryLogger.error("Failed to get provider after WalletConnect connection");
1927
1927
  throw new Error("Failed to get provider after WalletConnect connection");
1928
1928
  }
1929
1929
  const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
@@ -1939,7 +1939,7 @@ var _AurumCore = class _AurumCore {
1939
1939
  const chainId = await provider.request({ method: "eth_chainId" });
1940
1940
  this.emitConnect(chainId);
1941
1941
  this.emitAccountsChanged([checksumAdr]);
1942
- _chunkGTEGWUGUjs.sentryLogger.info(`Wallet connected: ${wcAdapter.id} (headless)`);
1942
+ _chunk27AOACEWjs.sentryLogger.info(`Wallet connected: ${wcAdapter.id} (headless)`);
1943
1943
  return checksumAdr;
1944
1944
  }
1945
1945
  };
@@ -1996,7 +1996,7 @@ var _AurumCore = class _AurumCore {
1996
1996
  /* BRAND & THEME METHODS */
1997
1997
  resolveBrandConfig(config) {
1998
1998
  const { brand = {} } = config || {};
1999
- const themeConfig = _chunkGTEGWUGUjs.getDefaultThemeConfig.call(void 0, brand.theme || _chunkGTEGWUGUjs.DEFAULT_THEME);
1999
+ const themeConfig = _chunk27AOACEWjs.getDefaultThemeConfig.call(void 0, brand.theme || _chunk27AOACEWjs.DEFAULT_THEME);
2000
2000
  return {
2001
2001
  logo: _nullishCoalesce(brand.logo, () => ( themeConfig.logo)),
2002
2002
  theme: _nullishCoalesce(brand.theme, () => ( themeConfig.theme)),
@@ -2011,8 +2011,8 @@ var _AurumCore = class _AurumCore {
2011
2011
  }
2012
2012
  async tryRestoreConnection() {
2013
2013
  try {
2014
- await _chunkGTEGWUGUjs.waitForStoreHydration.call(void 0, );
2015
- const store = _chunkGTEGWUGUjs.useAurumStore.getState();
2014
+ await _chunk27AOACEWjs.waitForStoreHydration.call(void 0, );
2015
+ const store = _chunk27AOACEWjs.useAurumStore.getState();
2016
2016
  if (!store.isConnected || !store.walletId || !store.address || !store.walletName) {
2017
2017
  return;
2018
2018
  }
@@ -2042,7 +2042,7 @@ var _AurumCore = class _AurumCore {
2042
2042
  }
2043
2043
  }
2044
2044
  persistConnectionState(adapter, address, email) {
2045
- _chunkGTEGWUGUjs.useAurumStore.getState().setConnection(adapter.id, _viem.checksumAddress.call(void 0, address), adapter.name, email);
2045
+ _chunk27AOACEWjs.useAurumStore.getState().setConnection(adapter.id, _viem.checksumAddress.call(void 0, address), adapter.name, email);
2046
2046
  }
2047
2047
  /* INTERNAL LISTENER METHODS */
2048
2048
  setInternalAccountChangeListener(adapter) {
@@ -2140,7 +2140,7 @@ var _AurumCore = class _AurumCore {
2140
2140
  }
2141
2141
  /* REST */
2142
2142
  resetConnectionState() {
2143
- _chunkGTEGWUGUjs.useAurumStore.getState().clearConnection();
2143
+ _chunk27AOACEWjs.useAurumStore.getState().clearConnection();
2144
2144
  this.connectedWalletAdapter = null;
2145
2145
  this.updateProvider(this.skeletonProvider);
2146
2146
  this.userInfo = void 0;