@aurum-sdk/core 0.1.0 → 0.1.1
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/LICENSE +21 -0
- package/dist/{chunk-DHEVW7CR.js → chunk-7TIZKMSS.js} +4 -4
- package/dist/chunk-7TIZKMSS.js.map +1 -0
- package/dist/{chunk-U5BSED2R.mjs → chunk-DND52DSA.mjs} +4 -4
- package/dist/{chunk-U5BSED2R.mjs.map → chunk-DND52DSA.mjs.map} +1 -1
- package/dist/index.js +58 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/widgets.js +13 -13
- package/dist/widgets.js.map +1 -1
- package/dist/widgets.mjs +1 -1
- package/package.json +13 -14
- package/dist/chunk-DHEVW7CR.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk7TIZKMSSjs = require('./chunk-7TIZKMSS.js');
|
|
18
18
|
|
|
19
19
|
// src/AurumCore.ts
|
|
20
20
|
var _viem = require('viem');
|
|
@@ -46,20 +46,20 @@ var _react = require('react');
|
|
|
46
46
|
var _jsxruntime = require('react/jsx-runtime');
|
|
47
47
|
var ModalShell = ({ onClose, brandConfig }) => {
|
|
48
48
|
const [isOpen, setIsOpen] = _react.useState.call(void 0, true);
|
|
49
|
-
const { currentPage } =
|
|
49
|
+
const { currentPage } = _chunk7TIZKMSSjs.useNavigation.call(void 0, );
|
|
50
50
|
const handleClose = () => {
|
|
51
51
|
setIsOpen(false);
|
|
52
52
|
onClose();
|
|
53
53
|
};
|
|
54
54
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
55
|
-
|
|
55
|
+
_chunk7TIZKMSSjs.Modal,
|
|
56
56
|
{
|
|
57
57
|
isOpen,
|
|
58
58
|
closeOnOverlayClick: true,
|
|
59
59
|
onCloseComplete: handleClose,
|
|
60
60
|
brandConfig,
|
|
61
61
|
transitionKey: currentPage,
|
|
62
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
62
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7TIZKMSSjs.ConnectPages, {})
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
65
|
};
|
|
@@ -71,7 +71,7 @@ var _client = require('react-dom/client');
|
|
|
71
71
|
function createShadowRoot(container, brandConfig) {
|
|
72
72
|
const shadowRoot = container.attachShadow({ mode: "open" });
|
|
73
73
|
shadowRoot.innerHTML = `
|
|
74
|
-
<style>${
|
|
74
|
+
<style>${_chunk7TIZKMSSjs.generateCompleteStyles.call(void 0, brandConfig)}</style>
|
|
75
75
|
<div class="aurum-modal-root"></div>
|
|
76
76
|
`;
|
|
77
77
|
return shadowRoot.querySelector(".aurum-modal-root");
|
|
@@ -109,9 +109,9 @@ function renderConnectModal({
|
|
|
109
109
|
brandConfig
|
|
110
110
|
}) {
|
|
111
111
|
return new Promise((resolve, reject) => {
|
|
112
|
-
let sortedWallets =
|
|
112
|
+
let sortedWallets = _chunk7TIZKMSSjs.sortWallets.call(void 0, displayedWallets, { filterHidden: false });
|
|
113
113
|
const hasAppKit = sortedWallets.some((w) => w.id === _types.WalletId.AppKit);
|
|
114
|
-
if (
|
|
114
|
+
if (_chunk7TIZKMSSjs.isMobile.call(void 0, ) && !hasAppKit) {
|
|
115
115
|
sortedWallets = sortedWallets.filter((w) => w.id !== _types.WalletId.WalletConnect);
|
|
116
116
|
}
|
|
117
117
|
const { root, cleanup } = createModalContainer(CONTAINER_ID, brandConfig);
|
|
@@ -124,7 +124,7 @@ function renderConnectModal({
|
|
|
124
124
|
reject(new Error("User rejected request"));
|
|
125
125
|
};
|
|
126
126
|
root.render(
|
|
127
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7TIZKMSSjs.ThemeContainer, { theme: brandConfig.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7TIZKMSSjs.ConnectUIProviders, { onConnect, displayedWallets: sortedWallets, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalShell, { onClose, brandConfig }) }) })
|
|
128
128
|
);
|
|
129
129
|
});
|
|
130
130
|
}
|
|
@@ -237,13 +237,13 @@ var AppKitAdapter = class {
|
|
|
237
237
|
this.provider = provider;
|
|
238
238
|
}
|
|
239
239
|
} catch (error) {
|
|
240
|
-
|
|
240
|
+
_chunk7TIZKMSSjs.sentryLogger.warn("Failed to get provider from wagmi connector", { error });
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
} catch (error) {
|
|
246
|
-
|
|
246
|
+
_chunk7TIZKMSSjs.sentryLogger.warn("Failed to get provider from AppKit", { error });
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
isInstalled() {
|
|
@@ -251,11 +251,11 @@ var AppKitAdapter = class {
|
|
|
251
251
|
}
|
|
252
252
|
async connect() {
|
|
253
253
|
if (!this.config.projectId) {
|
|
254
|
-
throw
|
|
254
|
+
throw _chunk7TIZKMSSjs.createConfigError.call(void 0, "AppKit");
|
|
255
255
|
}
|
|
256
256
|
await this.ensureInitialized();
|
|
257
257
|
if (!this.modal) {
|
|
258
|
-
|
|
258
|
+
_chunk7TIZKMSSjs.sentryLogger.error("AppKit is not available");
|
|
259
259
|
throw new Error("AppKit is not available");
|
|
260
260
|
}
|
|
261
261
|
const existingAddress = this.modal.getAddress();
|
|
@@ -457,7 +457,7 @@ var RabbyAdapter = class {
|
|
|
457
457
|
await this.providerPromise;
|
|
458
458
|
}
|
|
459
459
|
if (!this.provider) {
|
|
460
|
-
|
|
460
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Rabby is not available");
|
|
461
461
|
throw new Error("Rabby is not available");
|
|
462
462
|
}
|
|
463
463
|
try {
|
|
@@ -470,7 +470,7 @@ var RabbyAdapter = class {
|
|
|
470
470
|
params: []
|
|
471
471
|
});
|
|
472
472
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
473
|
-
|
|
473
|
+
_chunk7TIZKMSSjs.sentryLogger.error("No accounts returned from Rabby");
|
|
474
474
|
throw new Error("No accounts returned from Rabby");
|
|
475
475
|
}
|
|
476
476
|
return {
|
|
@@ -599,7 +599,7 @@ var BraveAdapter = class {
|
|
|
599
599
|
await this.providerPromise;
|
|
600
600
|
}
|
|
601
601
|
if (!this.provider) {
|
|
602
|
-
|
|
602
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Brave Wallet is not available");
|
|
603
603
|
throw new Error("Brave Wallet is not available");
|
|
604
604
|
}
|
|
605
605
|
try {
|
|
@@ -612,7 +612,7 @@ var BraveAdapter = class {
|
|
|
612
612
|
params: []
|
|
613
613
|
});
|
|
614
614
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
615
|
-
|
|
615
|
+
_chunk7TIZKMSSjs.sentryLogger.error("No accounts returned from Brave Wallet");
|
|
616
616
|
throw new Error("No accounts returned from Brave Wallet");
|
|
617
617
|
}
|
|
618
618
|
return {
|
|
@@ -693,7 +693,7 @@ var LedgerAdapter = class {
|
|
|
693
693
|
async connect() {
|
|
694
694
|
try {
|
|
695
695
|
if (!this.walletConnectProjectId) {
|
|
696
|
-
throw
|
|
696
|
+
throw _chunk7TIZKMSSjs.createConfigError.call(void 0, "Ledger");
|
|
697
697
|
}
|
|
698
698
|
const { loadConnectKit } = await Promise.resolve().then(() => _interopRequireWildcard(require("@ledgerhq/connect-kit-loader")));
|
|
699
699
|
const connectKit = await loadConnectKit();
|
|
@@ -707,7 +707,7 @@ var LedgerAdapter = class {
|
|
|
707
707
|
});
|
|
708
708
|
this.provider = await connectKit.getProvider();
|
|
709
709
|
if (!this.provider) {
|
|
710
|
-
|
|
710
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Failed to get Ledger provider");
|
|
711
711
|
throw new Error("Failed to get Ledger provider");
|
|
712
712
|
}
|
|
713
713
|
const accounts = await this.provider.request({
|
|
@@ -715,7 +715,7 @@ var LedgerAdapter = class {
|
|
|
715
715
|
params: []
|
|
716
716
|
});
|
|
717
717
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
718
|
-
|
|
718
|
+
_chunk7TIZKMSSjs.sentryLogger.error("No accounts returned from Ledger");
|
|
719
719
|
throw new Error("No accounts returned from Ledger");
|
|
720
720
|
}
|
|
721
721
|
return {
|
|
@@ -766,7 +766,7 @@ var LedgerAdapter = class {
|
|
|
766
766
|
}
|
|
767
767
|
this.provider = null;
|
|
768
768
|
} catch (error) {
|
|
769
|
-
|
|
769
|
+
_chunk7TIZKMSSjs.sentryLogger.warn("Failed to disconnect from Ledger", { error });
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
772
|
getProvider() {
|
|
@@ -859,7 +859,7 @@ var PhantomAdapter = class {
|
|
|
859
859
|
await this.providerPromise;
|
|
860
860
|
}
|
|
861
861
|
if (!this.provider) {
|
|
862
|
-
|
|
862
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Phantom is not available");
|
|
863
863
|
throw new Error("Phantom is not available");
|
|
864
864
|
}
|
|
865
865
|
try {
|
|
@@ -872,7 +872,7 @@ var PhantomAdapter = class {
|
|
|
872
872
|
params: []
|
|
873
873
|
});
|
|
874
874
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
875
|
-
|
|
875
|
+
_chunk7TIZKMSSjs.sentryLogger.error("No accounts returned from Phantom");
|
|
876
876
|
throw new Error("No accounts returned from Phantom");
|
|
877
877
|
}
|
|
878
878
|
return {
|
|
@@ -955,7 +955,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
955
955
|
});
|
|
956
956
|
return coinbaseSdk.getProvider();
|
|
957
957
|
} catch (error) {
|
|
958
|
-
|
|
958
|
+
_chunk7TIZKMSSjs.sentryLogger.warn("Failed to initialize Coinbase Wallet provider", { error });
|
|
959
959
|
return null;
|
|
960
960
|
}
|
|
961
961
|
}
|
|
@@ -964,7 +964,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
964
964
|
}
|
|
965
965
|
async connect() {
|
|
966
966
|
if (!this.isInstalled() || !this.provider) {
|
|
967
|
-
|
|
967
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Coinbase Wallet is not available");
|
|
968
968
|
throw new Error("Coinbase Wallet is not available");
|
|
969
969
|
}
|
|
970
970
|
try {
|
|
@@ -973,7 +973,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
973
973
|
params: []
|
|
974
974
|
});
|
|
975
975
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
976
|
-
|
|
976
|
+
_chunk7TIZKMSSjs.sentryLogger.error("No accounts returned from Coinbase Wallet");
|
|
977
977
|
throw new Error("No accounts returned from Coinbase Wallet");
|
|
978
978
|
}
|
|
979
979
|
return {
|
|
@@ -1014,7 +1014,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
1014
1014
|
await this.provider.disconnect();
|
|
1015
1015
|
}
|
|
1016
1016
|
} catch (error) {
|
|
1017
|
-
|
|
1017
|
+
_chunk7TIZKMSSjs.sentryLogger.warn("Error disconnecting from Coinbase Wallet", { error });
|
|
1018
1018
|
} finally {
|
|
1019
1019
|
this.clearLocalStorage();
|
|
1020
1020
|
}
|
|
@@ -1125,7 +1125,7 @@ var MetaMaskAdapter = class {
|
|
|
1125
1125
|
await this.providerPromise;
|
|
1126
1126
|
}
|
|
1127
1127
|
if (!this.provider) {
|
|
1128
|
-
|
|
1128
|
+
_chunk7TIZKMSSjs.sentryLogger.error("MetaMask is not available");
|
|
1129
1129
|
throw new Error("MetaMask is not available");
|
|
1130
1130
|
}
|
|
1131
1131
|
try {
|
|
@@ -1138,7 +1138,7 @@ var MetaMaskAdapter = class {
|
|
|
1138
1138
|
params: []
|
|
1139
1139
|
});
|
|
1140
1140
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
1141
|
-
|
|
1141
|
+
_chunk7TIZKMSSjs.sentryLogger.error("No accounts returned from MetaMask");
|
|
1142
1142
|
throw new Error("No accounts returned from MetaMask");
|
|
1143
1143
|
}
|
|
1144
1144
|
return {
|
|
@@ -1262,17 +1262,17 @@ var WalletConnectAdapter = class {
|
|
|
1262
1262
|
}
|
|
1263
1263
|
async connect() {
|
|
1264
1264
|
if (!this.config.projectId) {
|
|
1265
|
-
throw
|
|
1265
|
+
throw _chunk7TIZKMSSjs.createConfigError.call(void 0, "WalletConnect");
|
|
1266
1266
|
}
|
|
1267
1267
|
try {
|
|
1268
1268
|
await this.ensureInitialized();
|
|
1269
1269
|
if (!this.provider) {
|
|
1270
|
-
|
|
1270
|
+
_chunk7TIZKMSSjs.sentryLogger.error("connect: WalletConnect is not available");
|
|
1271
1271
|
throw new Error("WalletConnect is not available");
|
|
1272
1272
|
}
|
|
1273
1273
|
const accounts = await this.provider.enable();
|
|
1274
1274
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
1275
|
-
|
|
1275
|
+
_chunk7TIZKMSSjs.sentryLogger.error("connect: No accounts returned from WalletConnect");
|
|
1276
1276
|
throw new Error("No accounts returned from WalletConnect");
|
|
1277
1277
|
}
|
|
1278
1278
|
return {
|
|
@@ -1298,7 +1298,7 @@ var WalletConnectAdapter = class {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
await this.ensureInitialized();
|
|
1300
1300
|
if (!this.provider) {
|
|
1301
|
-
|
|
1301
|
+
_chunk7TIZKMSSjs.sentryLogger.error("startSession: WalletConnect is not available");
|
|
1302
1302
|
throw new Error("WalletConnect is not available");
|
|
1303
1303
|
}
|
|
1304
1304
|
this.connectionUri = null;
|
|
@@ -1315,7 +1315,7 @@ var WalletConnectAdapter = class {
|
|
|
1315
1315
|
const connectionPromise = (async () => {
|
|
1316
1316
|
const accounts = await this.provider.enable();
|
|
1317
1317
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
1318
|
-
|
|
1318
|
+
_chunk7TIZKMSSjs.sentryLogger.error("startSession: No accounts returned from WalletConnect");
|
|
1319
1319
|
throw new Error("No accounts returned from WalletConnect");
|
|
1320
1320
|
}
|
|
1321
1321
|
return {
|
|
@@ -1415,11 +1415,11 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1415
1415
|
}
|
|
1416
1416
|
async emailAuthStart(email) {
|
|
1417
1417
|
if (!this.projectId) {
|
|
1418
|
-
throw
|
|
1418
|
+
throw _chunk7TIZKMSSjs.createConfigError.call(void 0, "Email");
|
|
1419
1419
|
}
|
|
1420
1420
|
await this.ensureInitialized();
|
|
1421
1421
|
if (!this.provider) {
|
|
1422
|
-
|
|
1422
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Email is not available");
|
|
1423
1423
|
throw new Error("Email is not available");
|
|
1424
1424
|
}
|
|
1425
1425
|
try {
|
|
@@ -1427,7 +1427,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1427
1427
|
const authResult = await signInWithEmail({ email });
|
|
1428
1428
|
return authResult;
|
|
1429
1429
|
} catch (error) {
|
|
1430
|
-
|
|
1430
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Failed to start email authentication", { error });
|
|
1431
1431
|
throw error;
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
@@ -1437,14 +1437,14 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1437
1437
|
}
|
|
1438
1438
|
await this.ensureInitialized();
|
|
1439
1439
|
if (!this.provider) {
|
|
1440
|
-
|
|
1440
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Email provider not initialized");
|
|
1441
1441
|
throw new Error("Email provider not initialized");
|
|
1442
1442
|
}
|
|
1443
1443
|
const { verifyEmailOTP } = await Promise.resolve().then(() => _interopRequireWildcard(require("@coinbase/cdp-core")));
|
|
1444
1444
|
return verifyEmailOTP({ flowId, otp });
|
|
1445
1445
|
}
|
|
1446
1446
|
async connect() {
|
|
1447
|
-
|
|
1447
|
+
_chunk7TIZKMSSjs.sentryLogger.error("EmailAdapter.connect() is not implemented");
|
|
1448
1448
|
throw new Error("EmailAdapter.connect() is not implemented");
|
|
1449
1449
|
}
|
|
1450
1450
|
async tryRestoreConnection() {
|
|
@@ -1556,7 +1556,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1556
1556
|
const chainIdHex = await base.request({ method: "eth_chainId", params: [] });
|
|
1557
1557
|
chainId = parseInt(chainIdHex, 16);
|
|
1558
1558
|
} catch (e20) {
|
|
1559
|
-
|
|
1559
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Failed to get chainId for fallback request");
|
|
1560
1560
|
throw new Error("Failed to get chainId for fallback request");
|
|
1561
1561
|
}
|
|
1562
1562
|
const publicClient = await getPublicClient(chainId);
|
|
@@ -1571,7 +1571,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1571
1571
|
};
|
|
1572
1572
|
return wrapped;
|
|
1573
1573
|
} catch (error) {
|
|
1574
|
-
|
|
1574
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Failed to initialize Email provider", { error });
|
|
1575
1575
|
return null;
|
|
1576
1576
|
}
|
|
1577
1577
|
}
|
|
@@ -1671,7 +1671,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1671
1671
|
return _AurumCore.instance;
|
|
1672
1672
|
}
|
|
1673
1673
|
const telemetryEnabled = config.telemetry !== false;
|
|
1674
|
-
|
|
1674
|
+
_chunk7TIZKMSSjs.initSentry.call(void 0, telemetryEnabled);
|
|
1675
1675
|
this.brandConfig = this.resolveBrandConfig(config);
|
|
1676
1676
|
this.excludedWallets = new Set(_nullishCoalesce(_optionalChain([config, 'access', _117 => _117.wallets, 'optionalAccess', _118 => _118.exclude]), () => ( [])));
|
|
1677
1677
|
this.wallets = createWalletAdapters({
|
|
@@ -1736,19 +1736,19 @@ var _AurumCore = class _AurumCore {
|
|
|
1736
1736
|
const displayedWallets = this.wallets.filter((w) => !this.excludedWallets.has(w.id));
|
|
1737
1737
|
const modalResult = await renderConnectModal({ displayedWallets, brandConfig: this.brandConfig });
|
|
1738
1738
|
if (!modalResult) {
|
|
1739
|
-
|
|
1739
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Missing modal result");
|
|
1740
1740
|
throw new Error("Missing modal result");
|
|
1741
1741
|
}
|
|
1742
1742
|
adapter = this.wallets.find((w) => w.id === modalResult.walletId) || null;
|
|
1743
1743
|
if (!adapter) {
|
|
1744
|
-
|
|
1744
|
+
_chunk7TIZKMSSjs.sentryLogger.error(`Selected wallet adapter not found: ${modalResult.walletId}`);
|
|
1745
1745
|
throw new Error("Selected wallet adapter not found");
|
|
1746
1746
|
}
|
|
1747
1747
|
result = modalResult;
|
|
1748
1748
|
}
|
|
1749
1749
|
const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
|
|
1750
1750
|
if (!provider) {
|
|
1751
|
-
|
|
1751
|
+
_chunk7TIZKMSSjs.sentryLogger.error(`Error fetching provider on login: ${adapter.id}`);
|
|
1752
1752
|
throw new Error("Error fetching provider. Please try again.");
|
|
1753
1753
|
}
|
|
1754
1754
|
const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
|
|
@@ -1765,7 +1765,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1765
1765
|
const chainId = await provider.request({ method: "eth_chainId" });
|
|
1766
1766
|
this.emitConnect(chainId);
|
|
1767
1767
|
this.emitAccountsChanged([checksumAdr]);
|
|
1768
|
-
|
|
1768
|
+
_chunk7TIZKMSSjs.sentryLogger.info(`Wallet connected: ${adapter.id} (${walletId ? "headless" : "modal"})`);
|
|
1769
1769
|
return checksumAdr;
|
|
1770
1770
|
}
|
|
1771
1771
|
async disconnect() {
|
|
@@ -1794,7 +1794,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1794
1794
|
if (!adapter) throw new Error("Selected wallet adapter not found");
|
|
1795
1795
|
const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
|
|
1796
1796
|
if (!provider) {
|
|
1797
|
-
|
|
1797
|
+
_chunk7TIZKMSSjs.sentryLogger.error(`Error fetching provider on widget login: ${_optionalChain([result, 'optionalAccess', _131 => _131.walletId])}`);
|
|
1798
1798
|
throw new Error("Error fetching provider. Please try again.");
|
|
1799
1799
|
}
|
|
1800
1800
|
const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
|
|
@@ -1811,7 +1811,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1811
1811
|
const chainId = await provider.request({ method: "eth_chainId" });
|
|
1812
1812
|
this.emitConnect(chainId);
|
|
1813
1813
|
this.emitAccountsChanged([checksumAdr]);
|
|
1814
|
-
|
|
1814
|
+
_chunk7TIZKMSSjs.sentryLogger.info(`Wallet connected: ${adapter.id} (widget)`);
|
|
1815
1815
|
}
|
|
1816
1816
|
async getChainId() {
|
|
1817
1817
|
await this.whenReady();
|
|
@@ -1829,7 +1829,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
1831
|
updateBrandConfig(newConfig) {
|
|
1832
|
-
const defaultTheme =
|
|
1832
|
+
const defaultTheme = _chunk7TIZKMSSjs.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,
|
|
@@ -1876,13 +1876,13 @@ var _AurumCore = class _AurumCore {
|
|
|
1876
1876
|
const verifyResult = await emailAdapter.emailAuthVerify(flowId, otp);
|
|
1877
1877
|
const provider = emailAdapter.getProvider();
|
|
1878
1878
|
if (!provider) {
|
|
1879
|
-
|
|
1879
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Failed to get provider after email verification");
|
|
1880
1880
|
throw new Error("Failed to get provider after email verification");
|
|
1881
1881
|
}
|
|
1882
1882
|
const address = _optionalChain([verifyResult, 'access', _132 => _132.user, 'optionalAccess', _133 => _133.evmAccounts, 'optionalAccess', _134 => _134[0]]);
|
|
1883
1883
|
const email = _optionalChain([verifyResult, 'access', _135 => _135.user, 'optionalAccess', _136 => _136.authenticationMethods, 'optionalAccess', _137 => _137.email, 'optionalAccess', _138 => _138.email]);
|
|
1884
1884
|
if (!address || !email) {
|
|
1885
|
-
|
|
1885
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Address or email not found after email verification");
|
|
1886
1886
|
throw new Error("Address or email not found after email verification");
|
|
1887
1887
|
}
|
|
1888
1888
|
const checksumAdr = _viem.checksumAddress.call(void 0, address);
|
|
@@ -1899,7 +1899,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1899
1899
|
const chainId = await provider.request({ method: "eth_chainId" });
|
|
1900
1900
|
this.emitConnect(chainId);
|
|
1901
1901
|
this.emitAccountsChanged([checksumAdr]);
|
|
1902
|
-
|
|
1902
|
+
_chunk7TIZKMSSjs.sentryLogger.info(`Wallet connected: ${emailAdapter.id} (headless)`);
|
|
1903
1903
|
return { address: checksumAdr, email: _nullishCoalesce(email, () => ( "")), isNewUser: _nullishCoalesce(verifyResult.isNewUser, () => ( false)) };
|
|
1904
1904
|
}
|
|
1905
1905
|
/**
|
|
@@ -1919,7 +1919,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1919
1919
|
const result = await session.waitForConnection();
|
|
1920
1920
|
const provider = _nullishCoalesce(result.provider, () => ( wcAdapter.getProvider()));
|
|
1921
1921
|
if (!provider) {
|
|
1922
|
-
|
|
1922
|
+
_chunk7TIZKMSSjs.sentryLogger.error("Failed to get provider after WalletConnect connection");
|
|
1923
1923
|
throw new Error("Failed to get provider after WalletConnect connection");
|
|
1924
1924
|
}
|
|
1925
1925
|
const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
|
|
@@ -1935,7 +1935,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1935
1935
|
const chainId = await provider.request({ method: "eth_chainId" });
|
|
1936
1936
|
this.emitConnect(chainId);
|
|
1937
1937
|
this.emitAccountsChanged([checksumAdr]);
|
|
1938
|
-
|
|
1938
|
+
_chunk7TIZKMSSjs.sentryLogger.info(`Wallet connected: ${wcAdapter.id} (headless)`);
|
|
1939
1939
|
return checksumAdr;
|
|
1940
1940
|
}
|
|
1941
1941
|
};
|
|
@@ -1992,7 +1992,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1992
1992
|
/* BRAND & THEME METHODS */
|
|
1993
1993
|
resolveBrandConfig(config) {
|
|
1994
1994
|
const { brand = {} } = config || {};
|
|
1995
|
-
const themeConfig =
|
|
1995
|
+
const themeConfig = _chunk7TIZKMSSjs.getDefaultThemeConfig.call(void 0, brand.theme || _chunk7TIZKMSSjs.DEFAULT_THEME);
|
|
1996
1996
|
return {
|
|
1997
1997
|
logo: _nullishCoalesce(brand.logo, () => ( themeConfig.logo)),
|
|
1998
1998
|
theme: _nullishCoalesce(brand.theme, () => ( themeConfig.theme)),
|
|
@@ -2007,8 +2007,8 @@ var _AurumCore = class _AurumCore {
|
|
|
2007
2007
|
}
|
|
2008
2008
|
async tryRestoreConnection() {
|
|
2009
2009
|
try {
|
|
2010
|
-
await
|
|
2011
|
-
const store =
|
|
2010
|
+
await _chunk7TIZKMSSjs.waitForStoreHydration.call(void 0, );
|
|
2011
|
+
const store = _chunk7TIZKMSSjs.useAurumStore.getState();
|
|
2012
2012
|
if (!store.isConnected || !store.walletId || !store.address || !store.walletName) {
|
|
2013
2013
|
return;
|
|
2014
2014
|
}
|
|
@@ -2038,7 +2038,7 @@ var _AurumCore = class _AurumCore {
|
|
|
2038
2038
|
}
|
|
2039
2039
|
}
|
|
2040
2040
|
persistConnectionState(adapter, address, email) {
|
|
2041
|
-
|
|
2041
|
+
_chunk7TIZKMSSjs.useAurumStore.getState().setConnection(adapter.id, _viem.checksumAddress.call(void 0, address), adapter.name, email);
|
|
2042
2042
|
}
|
|
2043
2043
|
/* INTERNAL LISTENER METHODS */
|
|
2044
2044
|
setInternalAccountChangeListener(adapter) {
|
|
@@ -2136,7 +2136,7 @@ var _AurumCore = class _AurumCore {
|
|
|
2136
2136
|
}
|
|
2137
2137
|
/* REST */
|
|
2138
2138
|
resetConnectionState() {
|
|
2139
|
-
|
|
2139
|
+
_chunk7TIZKMSSjs.useAurumStore.getState().clearConnection();
|
|
2140
2140
|
this.connectedWalletAdapter = null;
|
|
2141
2141
|
this.updateProvider(this.skeletonProvider);
|
|
2142
2142
|
this.userInfo = void 0;
|