@aurum-sdk/core 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-27AOACEW.js → chunk-KD3A4VYB.js} +2 -2
- package/dist/{chunk-X6ADRWYF.mjs → chunk-UPYYZG5D.mjs} +2 -2
- package/dist/empty-stub-JW2K2GSS.js +14 -0
- package/dist/empty-stub-X6WHS3X3.mjs +14 -0
- package/dist/index.js +102 -80
- package/dist/index.mjs +28 -6
- package/dist/{index.web-T26HBS3X.mjs → index.web-Q2L3EMC3.mjs} +2 -2
- package/dist/{index.web-WXUV52ZW.js → index.web-V7DLWC7H.js} +2 -2
- package/dist/widgets.js +12 -12
- package/dist/widgets.mjs +1 -1
- package/package.json +5 -5
|
@@ -10267,7 +10267,7 @@ function initSentry(enabled = true) {
|
|
|
10267
10267
|
const client = new BrowserClient({
|
|
10268
10268
|
dsn: "https://0bb16fd7057ac7b45ae0ab416cdbea8b@o4505953815494656.ingest.us.sentry.io/4509747448184832",
|
|
10269
10269
|
environment: getEnvironment(),
|
|
10270
|
-
release: `@aurum-sdk/core@${"0.2.
|
|
10270
|
+
release: `@aurum-sdk/core@${"0.2.6"}`,
|
|
10271
10271
|
sendDefaultPii: false,
|
|
10272
10272
|
transport: makeFetchTransport,
|
|
10273
10273
|
stackParser: defaultStackParser,
|
|
@@ -13329,4 +13329,4 @@ lucide-react/dist/esm/lucide-react.js:
|
|
|
13329
13329
|
* See the LICENSE file in the root directory of this source tree.
|
|
13330
13330
|
*)
|
|
13331
13331
|
*/
|
|
13332
|
-
//# sourceMappingURL=chunk-
|
|
13332
|
+
//# sourceMappingURL=chunk-KD3A4VYB.js.map
|
|
@@ -10267,7 +10267,7 @@ function initSentry(enabled = true) {
|
|
|
10267
10267
|
const client = new BrowserClient({
|
|
10268
10268
|
dsn: "https://0bb16fd7057ac7b45ae0ab416cdbea8b@o4505953815494656.ingest.us.sentry.io/4509747448184832",
|
|
10269
10269
|
environment: getEnvironment(),
|
|
10270
|
-
release: `@aurum-sdk/core@${"0.2.
|
|
10270
|
+
release: `@aurum-sdk/core@${"0.2.6"}`,
|
|
10271
10271
|
sendDefaultPii: false,
|
|
10272
10272
|
transport: makeFetchTransport,
|
|
10273
10273
|
stackParser: defaultStackParser,
|
|
@@ -13329,4 +13329,4 @@ lucide-react/dist/esm/lucide-react.js:
|
|
|
13329
13329
|
* See the LICENSE file in the root directory of this source tree.
|
|
13330
13330
|
*)
|
|
13331
13331
|
*/
|
|
13332
|
-
//# sourceMappingURL=chunk-
|
|
13332
|
+
//# sourceMappingURL=chunk-UPYYZG5D.mjs.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkQIPVNM7Tjs = require('./chunk-QIPVNM7T.js');
|
|
5
|
+
|
|
6
|
+
// scripts/empty-stub.js
|
|
7
|
+
var require_empty_stub = _chunkQIPVNM7Tjs.__commonJS.call(void 0, {
|
|
8
|
+
"scripts/empty-stub.js"(exports, module) {
|
|
9
|
+
_chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
|
|
10
|
+
module.exports = {};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports. default = require_empty_stub();
|
|
14
|
+
//# sourceMappingURL=empty-stub-JW2K2GSS.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
init_polyfills
|
|
4
|
+
} from "./chunk-J6XFKNJN.mjs";
|
|
5
|
+
|
|
6
|
+
// scripts/empty-stub.js
|
|
7
|
+
var require_empty_stub = __commonJS({
|
|
8
|
+
"scripts/empty-stub.js"(exports, module) {
|
|
9
|
+
init_polyfills();
|
|
10
|
+
module.exports = {};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export default require_empty_stub();
|
|
14
|
+
//# sourceMappingURL=empty-stub-X6WHS3X3.mjs.map
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkKD3A4VYBjs = require('./chunk-KD3A4VYB.js');
|
|
20
20
|
require('./chunk-4EBNC4R3.js');
|
|
21
21
|
|
|
22
22
|
|
|
@@ -64,20 +64,20 @@ 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 } =
|
|
67
|
+
const { currentPage } = _chunkKD3A4VYBjs.useNavigation.call(void 0, );
|
|
68
68
|
const handleClose = () => {
|
|
69
69
|
setIsOpen(false);
|
|
70
70
|
onClose();
|
|
71
71
|
};
|
|
72
72
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
73
|
-
|
|
73
|
+
_chunkKD3A4VYBjs.Modal,
|
|
74
74
|
{
|
|
75
75
|
isOpen,
|
|
76
76
|
closeOnOverlayClick: true,
|
|
77
77
|
onCloseComplete: handleClose,
|
|
78
78
|
brandConfig,
|
|
79
79
|
transitionKey: currentPage,
|
|
80
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
80
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ConnectPages, {})
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
83
|
};
|
|
@@ -91,7 +91,7 @@ _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>${
|
|
94
|
+
<style>${_chunkKD3A4VYBjs.generateCompleteStyles.call(void 0, brandConfig)}</style>
|
|
95
95
|
<div class="aurum-modal-root"></div>
|
|
96
96
|
`;
|
|
97
97
|
return shadowRoot.querySelector(".aurum-modal-root");
|
|
@@ -128,7 +128,7 @@ function renderConnectModal({
|
|
|
128
128
|
brandConfig
|
|
129
129
|
}) {
|
|
130
130
|
return new Promise((resolve, reject) => {
|
|
131
|
-
const sortedWallets =
|
|
131
|
+
const sortedWallets = _chunkKD3A4VYBjs.sortWallets.call(void 0, displayedWallets, { filterHidden: false });
|
|
132
132
|
const { root, cleanup } = createModalContainer(CONTAINER_ID, brandConfig);
|
|
133
133
|
const onConnect = (result) => {
|
|
134
134
|
cleanup();
|
|
@@ -139,7 +139,7 @@ function renderConnectModal({
|
|
|
139
139
|
reject(new Error("User rejected request"));
|
|
140
140
|
};
|
|
141
141
|
root.render(
|
|
142
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
142
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ThemeContainer, { theme: brandConfig.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ConnectUIProviders, { onConnect, displayedWallets: sortedWallets, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModalShell, { onClose, brandConfig }) }) })
|
|
143
143
|
);
|
|
144
144
|
});
|
|
145
145
|
}
|
|
@@ -155,9 +155,9 @@ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
|
|
|
155
155
|
var RABBY_RDNS = "io.rabby";
|
|
156
156
|
var RabbyAdapter = class {
|
|
157
157
|
constructor() {
|
|
158
|
-
this.id =
|
|
159
|
-
this.name =
|
|
160
|
-
this.icon = _nullishCoalesce(
|
|
158
|
+
this.id = _chunkKD3A4VYBjs.WalletId.Rabby;
|
|
159
|
+
this.name = _chunkKD3A4VYBjs.WalletName.Rabby;
|
|
160
|
+
this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.Rabby, "brand"), () => ( ""));
|
|
161
161
|
this.hide = false;
|
|
162
162
|
this.downloadUrl = "https://rabby.io";
|
|
163
163
|
this.wcDeepLinkUrl = null;
|
|
@@ -216,7 +216,7 @@ var RabbyAdapter = class {
|
|
|
216
216
|
await this.providerPromise;
|
|
217
217
|
}
|
|
218
218
|
if (!this.provider) {
|
|
219
|
-
|
|
219
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Rabby is not available");
|
|
220
220
|
throw new Error("Rabby is not available");
|
|
221
221
|
}
|
|
222
222
|
await this.provider.request({
|
|
@@ -228,7 +228,7 @@ var RabbyAdapter = class {
|
|
|
228
228
|
params: []
|
|
229
229
|
});
|
|
230
230
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
231
|
-
|
|
231
|
+
_chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from Rabby");
|
|
232
232
|
throw new Error("No accounts returned from Rabby");
|
|
233
233
|
}
|
|
234
234
|
return {
|
|
@@ -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 =
|
|
301
|
-
this.name =
|
|
302
|
-
this.icon = _nullishCoalesce(
|
|
300
|
+
this.id = _chunkKD3A4VYBjs.WalletId.Brave;
|
|
301
|
+
this.name = _chunkKD3A4VYBjs.WalletName.Brave;
|
|
302
|
+
this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.Brave, "brand"), () => ( ""));
|
|
303
303
|
this.downloadUrl = "https://brave.com/download";
|
|
304
304
|
this.wcDeepLinkUrl = null;
|
|
305
305
|
this.provider = null;
|
|
@@ -362,7 +362,7 @@ var BraveAdapter = class {
|
|
|
362
362
|
await this.providerPromise;
|
|
363
363
|
}
|
|
364
364
|
if (!this.provider) {
|
|
365
|
-
|
|
365
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Brave Wallet is not available");
|
|
366
366
|
throw new Error("Brave Wallet is not available");
|
|
367
367
|
}
|
|
368
368
|
await this.provider.request({
|
|
@@ -374,7 +374,7 @@ var BraveAdapter = class {
|
|
|
374
374
|
params: []
|
|
375
375
|
});
|
|
376
376
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
377
|
-
|
|
377
|
+
_chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from Brave Wallet");
|
|
378
378
|
throw new Error("No accounts returned from Brave Wallet");
|
|
379
379
|
}
|
|
380
380
|
return {
|
|
@@ -434,9 +434,9 @@ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
|
|
|
434
434
|
var PHANTOM_RDNS = "app.phantom";
|
|
435
435
|
var PhantomAdapter = class {
|
|
436
436
|
constructor() {
|
|
437
|
-
this.id =
|
|
438
|
-
this.name =
|
|
439
|
-
this.icon = _nullishCoalesce(
|
|
437
|
+
this.id = _chunkKD3A4VYBjs.WalletId.Phantom;
|
|
438
|
+
this.name = _chunkKD3A4VYBjs.WalletName.Phantom;
|
|
439
|
+
this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.Phantom, "brand"), () => ( ""));
|
|
440
440
|
this.hide = false;
|
|
441
441
|
this.downloadUrl = "https://phantom.com/download";
|
|
442
442
|
this.wcDeepLinkUrl = "phantom://wc?uri=";
|
|
@@ -500,7 +500,7 @@ var PhantomAdapter = class {
|
|
|
500
500
|
await this.providerPromise;
|
|
501
501
|
}
|
|
502
502
|
if (!this.provider) {
|
|
503
|
-
|
|
503
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Phantom is not available");
|
|
504
504
|
throw new Error("Phantom is not available");
|
|
505
505
|
}
|
|
506
506
|
await this.provider.request({
|
|
@@ -512,7 +512,7 @@ var PhantomAdapter = class {
|
|
|
512
512
|
params: []
|
|
513
513
|
});
|
|
514
514
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
515
|
-
|
|
515
|
+
_chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from Phantom");
|
|
516
516
|
throw new Error("No accounts returned from Phantom");
|
|
517
517
|
}
|
|
518
518
|
return {
|
|
@@ -571,9 +571,9 @@ var PhantomAdapter = class {
|
|
|
571
571
|
_chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
|
|
572
572
|
var CoinbaseWalletAdapter = class {
|
|
573
573
|
constructor({ appName, appLogoUrl, telemetry }) {
|
|
574
|
-
this.id =
|
|
575
|
-
this.name =
|
|
576
|
-
this.icon = _nullishCoalesce(
|
|
574
|
+
this.id = _chunkKD3A4VYBjs.WalletId.CoinbaseWallet;
|
|
575
|
+
this.name = _chunkKD3A4VYBjs.WalletName.CoinbaseWallet;
|
|
576
|
+
this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.CoinbaseWallet, "brand"), () => ( ""));
|
|
577
577
|
this.hide = false;
|
|
578
578
|
this.downloadUrl = "https://www.coinbase.com/wallet/downloads";
|
|
579
579
|
this.wcDeepLinkUrl = "cbwallet://wc?uri=";
|
|
@@ -603,7 +603,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
603
603
|
});
|
|
604
604
|
this.provider = coinbaseSdk.getProvider();
|
|
605
605
|
} catch (error) {
|
|
606
|
-
|
|
606
|
+
_chunkKD3A4VYBjs.sentryLogger.warn("Failed to initialize Coinbase Wallet provider", { error });
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
isInstalled() {
|
|
@@ -612,7 +612,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
612
612
|
async connect() {
|
|
613
613
|
await this.ensureInitialized();
|
|
614
614
|
if (!this.provider) {
|
|
615
|
-
|
|
615
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Coinbase Wallet is not available");
|
|
616
616
|
throw new Error("Coinbase Wallet is not available");
|
|
617
617
|
}
|
|
618
618
|
const accounts = await this.provider.request({
|
|
@@ -620,7 +620,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
620
620
|
params: []
|
|
621
621
|
});
|
|
622
622
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
623
|
-
|
|
623
|
+
_chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from Coinbase Wallet");
|
|
624
624
|
throw new Error("No accounts returned from Coinbase Wallet");
|
|
625
625
|
}
|
|
626
626
|
return {
|
|
@@ -660,7 +660,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
660
660
|
await this.provider.disconnect();
|
|
661
661
|
}
|
|
662
662
|
} catch (error) {
|
|
663
|
-
|
|
663
|
+
_chunkKD3A4VYBjs.sentryLogger.warn("Error disconnecting from Coinbase Wallet", { error });
|
|
664
664
|
} finally {
|
|
665
665
|
this.clearLocalStorage();
|
|
666
666
|
}
|
|
@@ -703,9 +703,9 @@ _chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
|
|
|
703
703
|
var METAMASK_RDNS = "io.metamask";
|
|
704
704
|
var MetaMaskAdapter = class {
|
|
705
705
|
constructor() {
|
|
706
|
-
this.id =
|
|
707
|
-
this.name =
|
|
708
|
-
this.icon = _nullishCoalesce(
|
|
706
|
+
this.id = _chunkKD3A4VYBjs.WalletId.MetaMask;
|
|
707
|
+
this.name = _chunkKD3A4VYBjs.WalletName.MetaMask;
|
|
708
|
+
this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.MetaMask, "brand"), () => ( ""));
|
|
709
709
|
this.hide = false;
|
|
710
710
|
this.downloadUrl = "https://metamask.io/download";
|
|
711
711
|
this.wcDeepLinkUrl = "metamask://wc?uri=";
|
|
@@ -770,7 +770,7 @@ var MetaMaskAdapter = class {
|
|
|
770
770
|
await this.providerPromise;
|
|
771
771
|
}
|
|
772
772
|
if (!this.provider) {
|
|
773
|
-
|
|
773
|
+
_chunkKD3A4VYBjs.sentryLogger.error("MetaMask is not available");
|
|
774
774
|
throw new Error("MetaMask is not available");
|
|
775
775
|
}
|
|
776
776
|
await this.provider.request({
|
|
@@ -782,7 +782,7 @@ var MetaMaskAdapter = class {
|
|
|
782
782
|
params: []
|
|
783
783
|
});
|
|
784
784
|
if (!accounts || accounts.length === 0 || !accounts[0]) {
|
|
785
|
-
|
|
785
|
+
_chunkKD3A4VYBjs.sentryLogger.error("No accounts returned from MetaMask");
|
|
786
786
|
throw new Error("No accounts returned from MetaMask");
|
|
787
787
|
}
|
|
788
788
|
return {
|
|
@@ -934,9 +934,9 @@ function extractAddressFromSession(namespaces) {
|
|
|
934
934
|
}
|
|
935
935
|
var WalletConnectAdapter = class {
|
|
936
936
|
constructor(config) {
|
|
937
|
-
this.id =
|
|
938
|
-
this.name =
|
|
939
|
-
this.icon = _nullishCoalesce(
|
|
937
|
+
this.id = _chunkKD3A4VYBjs.WalletId.WalletConnect;
|
|
938
|
+
this.name = _chunkKD3A4VYBjs.WalletName.WalletConnect;
|
|
939
|
+
this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.WalletConnect, "brand"), () => ( ""));
|
|
940
940
|
this.hide = false;
|
|
941
941
|
this.downloadUrl = null;
|
|
942
942
|
this.wcDeepLinkUrl = null;
|
|
@@ -1074,13 +1074,13 @@ var WalletConnectAdapter = class {
|
|
|
1074
1074
|
this.provider = provider;
|
|
1075
1075
|
}
|
|
1076
1076
|
} catch (error) {
|
|
1077
|
-
|
|
1077
|
+
_chunkKD3A4VYBjs.sentryLogger.warn("Failed to get provider from wagmi connector", { error });
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
} catch (error) {
|
|
1083
|
-
|
|
1083
|
+
_chunkKD3A4VYBjs.sentryLogger.warn("Failed to get provider from WalletConnect", { error });
|
|
1084
1084
|
}
|
|
1085
1085
|
}
|
|
1086
1086
|
isInstalled() {
|
|
@@ -1123,7 +1123,7 @@ var WalletConnectAdapter = class {
|
|
|
1123
1123
|
* Emits walletconnect:uri event for QR code display.
|
|
1124
1124
|
*/
|
|
1125
1125
|
async connect() {
|
|
1126
|
-
if (!this.config.projectId) throw
|
|
1126
|
+
if (!this.config.projectId) throw _chunkKD3A4VYBjs.createConfigError.call(void 0, "WalletConnect");
|
|
1127
1127
|
await this.ensureInitialized();
|
|
1128
1128
|
if (!this.universalProvider) throw new Error("WalletConnect is not available");
|
|
1129
1129
|
await this.resetConnectionState();
|
|
@@ -1186,7 +1186,7 @@ var WalletConnectAdapter = class {
|
|
|
1186
1186
|
* Used on mobile and when user clicks "Open Modal" button.
|
|
1187
1187
|
*/
|
|
1188
1188
|
async openModal() {
|
|
1189
|
-
if (!this.config.projectId) throw
|
|
1189
|
+
if (!this.config.projectId) throw _chunkKD3A4VYBjs.createConfigError.call(void 0, "WalletConnect");
|
|
1190
1190
|
await this.ensureInitialized();
|
|
1191
1191
|
if (!this.modal) throw new Error("AppKit is not available");
|
|
1192
1192
|
await this.resetConnectionState();
|
|
@@ -1365,9 +1365,9 @@ var WalletConnectAdapter = class {
|
|
|
1365
1365
|
_chunkQIPVNM7Tjs.init_polyfills.call(void 0, );
|
|
1366
1366
|
var _EmailAdapter = class _EmailAdapter {
|
|
1367
1367
|
constructor(config) {
|
|
1368
|
-
this.id =
|
|
1369
|
-
this.name =
|
|
1370
|
-
this.icon = _nullishCoalesce(
|
|
1368
|
+
this.id = _chunkKD3A4VYBjs.WalletId.Email;
|
|
1369
|
+
this.name = _chunkKD3A4VYBjs.WalletName.Email;
|
|
1370
|
+
this.icon = _nullishCoalesce(_chunkKD3A4VYBjs.getLogoDataUri.call(void 0, _chunkKD3A4VYBjs.WalletId.Email, "brand"), () => ( ""));
|
|
1371
1371
|
this.hide = true;
|
|
1372
1372
|
this.downloadUrl = null;
|
|
1373
1373
|
this.wcDeepLinkUrl = null;
|
|
@@ -1389,14 +1389,14 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1389
1389
|
}
|
|
1390
1390
|
async emailAuthStart(email) {
|
|
1391
1391
|
if (!this.projectId) {
|
|
1392
|
-
throw
|
|
1392
|
+
throw _chunkKD3A4VYBjs.createConfigError.call(void 0, "Email");
|
|
1393
1393
|
}
|
|
1394
1394
|
await this.ensureInitialized();
|
|
1395
1395
|
if (!this.provider) {
|
|
1396
|
-
|
|
1396
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Email is not available");
|
|
1397
1397
|
throw new Error("Email is not available");
|
|
1398
1398
|
}
|
|
1399
|
-
const { signInWithEmail } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-
|
|
1399
|
+
const { signInWithEmail } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
|
|
1400
1400
|
const authResult = await signInWithEmail({ email });
|
|
1401
1401
|
return authResult;
|
|
1402
1402
|
}
|
|
@@ -1406,14 +1406,14 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
await this.ensureInitialized();
|
|
1408
1408
|
if (!this.provider) {
|
|
1409
|
-
|
|
1409
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Email provider not initialized");
|
|
1410
1410
|
throw new Error("Email provider not initialized");
|
|
1411
1411
|
}
|
|
1412
|
-
const { verifyEmailOTP } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-
|
|
1412
|
+
const { verifyEmailOTP } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
|
|
1413
1413
|
return verifyEmailOTP({ flowId, otp });
|
|
1414
1414
|
}
|
|
1415
1415
|
async connect() {
|
|
1416
|
-
|
|
1416
|
+
_chunkKD3A4VYBjs.sentryLogger.error("EmailAdapter.connect() is not implemented");
|
|
1417
1417
|
throw new Error("EmailAdapter.connect() is not implemented");
|
|
1418
1418
|
}
|
|
1419
1419
|
async tryRestoreConnection() {
|
|
@@ -1441,7 +1441,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1441
1441
|
async disconnect() {
|
|
1442
1442
|
try {
|
|
1443
1443
|
await this.ensureInitialized();
|
|
1444
|
-
const { signOut } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-
|
|
1444
|
+
const { signOut } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
|
|
1445
1445
|
await signOut();
|
|
1446
1446
|
} catch (e12) {
|
|
1447
1447
|
}
|
|
@@ -1487,7 +1487,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1487
1487
|
* Called by ensureInitialized() - deduplication handled via initPromise.
|
|
1488
1488
|
*/
|
|
1489
1489
|
async initializeProvider() {
|
|
1490
|
-
const { initialize } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-
|
|
1490
|
+
const { initialize } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
|
|
1491
1491
|
await initialize({
|
|
1492
1492
|
projectId: this.projectId,
|
|
1493
1493
|
ethereum: {
|
|
@@ -1505,7 +1505,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1505
1505
|
async createProvider() {
|
|
1506
1506
|
try {
|
|
1507
1507
|
await _EmailAdapter.initializeChainData();
|
|
1508
|
-
const { createCDPEmbeddedWallet } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-
|
|
1508
|
+
const { createCDPEmbeddedWallet } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.web-V7DLWC7H.js")));
|
|
1509
1509
|
const wallet = createCDPEmbeddedWallet({
|
|
1510
1510
|
chains: _EmailAdapter.viemChains,
|
|
1511
1511
|
transports: _EmailAdapter.viemTransports
|
|
@@ -1526,7 +1526,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1526
1526
|
const chainIdHex = await base.request({ method: "eth_chainId", params: [] });
|
|
1527
1527
|
chainId = parseInt(chainIdHex, 16);
|
|
1528
1528
|
} catch (e13) {
|
|
1529
|
-
|
|
1529
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Failed to get chainId for fallback request");
|
|
1530
1530
|
throw new Error("Failed to get chainId for fallback request");
|
|
1531
1531
|
}
|
|
1532
1532
|
const publicClient = await getPublicClient(chainId);
|
|
@@ -1541,7 +1541,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1541
1541
|
};
|
|
1542
1542
|
return wrapped;
|
|
1543
1543
|
} catch (error) {
|
|
1544
|
-
|
|
1544
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Failed to initialize Email provider", { error });
|
|
1545
1545
|
return null;
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
@@ -1665,10 +1665,17 @@ var _AurumCore = class _AurumCore {
|
|
|
1665
1665
|
this.connectedWalletAdapter = null;
|
|
1666
1666
|
this.eventListeners = /* @__PURE__ */ new Map();
|
|
1667
1667
|
if (_AurumCore.instance) {
|
|
1668
|
+
const incoming = _AurumCore.serializeConfig(config);
|
|
1669
|
+
if (incoming !== null && incoming !== _AurumCore.storedConfigJson) {
|
|
1670
|
+
console.warn(
|
|
1671
|
+
"Aurum Constructor called a second time with a different config; the original config is kept. Use updateBrandConfig() / updateWalletsConfig() to change config at runtime."
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1668
1674
|
return _AurumCore.instance;
|
|
1669
1675
|
}
|
|
1676
|
+
_AurumCore.storedConfigJson = _AurumCore.serializeConfig(config);
|
|
1670
1677
|
const telemetryEnabled = config.telemetry !== false;
|
|
1671
|
-
|
|
1678
|
+
_chunkKD3A4VYBjs.initSentry.call(void 0, telemetryEnabled);
|
|
1672
1679
|
this.brandConfig = this.resolveBrandConfig(config);
|
|
1673
1680
|
this.excludedWallets = new Set(_nullishCoalesce(_optionalChain([config, 'access', _139 => _139.wallets, 'optionalAccess', _140 => _140.exclude]), () => ( [])));
|
|
1674
1681
|
this.wallets = createWalletAdapters({
|
|
@@ -1685,10 +1692,17 @@ var _AurumCore = class _AurumCore {
|
|
|
1685
1692
|
this.readyPromise = this.tryRestoreConnection();
|
|
1686
1693
|
_AurumCore.instance = this;
|
|
1687
1694
|
}
|
|
1695
|
+
static serializeConfig(config) {
|
|
1696
|
+
try {
|
|
1697
|
+
return JSON.stringify(config);
|
|
1698
|
+
} catch (e14) {
|
|
1699
|
+
return null;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1688
1702
|
async whenReady() {
|
|
1689
1703
|
try {
|
|
1690
1704
|
await this.readyPromise;
|
|
1691
|
-
} catch (
|
|
1705
|
+
} catch (e15) {
|
|
1692
1706
|
this.resetConnectionState();
|
|
1693
1707
|
this.ready = true;
|
|
1694
1708
|
}
|
|
@@ -1723,7 +1737,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1723
1737
|
if (!adapter) {
|
|
1724
1738
|
throw new Error(`${walletId} is not configured`);
|
|
1725
1739
|
}
|
|
1726
|
-
if (walletId ===
|
|
1740
|
+
if (walletId === _chunkKD3A4VYBjs.WalletId.WalletConnect && adapter.openModal) {
|
|
1727
1741
|
result = await adapter.openModal();
|
|
1728
1742
|
} else {
|
|
1729
1743
|
if (!adapter.isInstalled()) {
|
|
@@ -1735,19 +1749,19 @@ var _AurumCore = class _AurumCore {
|
|
|
1735
1749
|
const displayedWallets = this.wallets.filter((w) => !this.excludedWallets.has(w.id));
|
|
1736
1750
|
const modalResult = await renderConnectModal({ displayedWallets, brandConfig: this.brandConfig });
|
|
1737
1751
|
if (!modalResult) {
|
|
1738
|
-
|
|
1752
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Missing modal result");
|
|
1739
1753
|
throw new Error("Missing modal result");
|
|
1740
1754
|
}
|
|
1741
1755
|
adapter = this.wallets.find((w) => w.id === modalResult.walletId) || null;
|
|
1742
1756
|
if (!adapter) {
|
|
1743
|
-
|
|
1757
|
+
_chunkKD3A4VYBjs.sentryLogger.error(`Selected wallet adapter not found: ${modalResult.walletId}`);
|
|
1744
1758
|
throw new Error("Selected wallet adapter not found");
|
|
1745
1759
|
}
|
|
1746
1760
|
result = modalResult;
|
|
1747
1761
|
}
|
|
1748
1762
|
const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
|
|
1749
1763
|
if (!provider) {
|
|
1750
|
-
|
|
1764
|
+
_chunkKD3A4VYBjs.sentryLogger.error(`Error fetching provider on login: ${adapter.id}`);
|
|
1751
1765
|
throw new Error("Error fetching provider. Please try again.");
|
|
1752
1766
|
}
|
|
1753
1767
|
const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
|
|
@@ -1764,7 +1778,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1764
1778
|
const chainId = await provider.request({ method: "eth_chainId" });
|
|
1765
1779
|
this.emitConnect(chainId);
|
|
1766
1780
|
this.emitAccountsChanged([checksumAdr]);
|
|
1767
|
-
|
|
1781
|
+
_chunkKD3A4VYBjs.sentryLogger.info(`Wallet connected: ${adapter.id} (${walletId ? "headless" : "modal"})`);
|
|
1768
1782
|
return checksumAdr;
|
|
1769
1783
|
}
|
|
1770
1784
|
async disconnect() {
|
|
@@ -1793,7 +1807,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1793
1807
|
if (!adapter) throw new Error("Selected wallet adapter not found");
|
|
1794
1808
|
const provider = _nullishCoalesce(result.provider, () => ( adapter.getProvider()));
|
|
1795
1809
|
if (!provider) {
|
|
1796
|
-
|
|
1810
|
+
_chunkKD3A4VYBjs.sentryLogger.error(`Error fetching provider on widget login: ${_optionalChain([result, 'optionalAccess', _153 => _153.walletId])}`);
|
|
1797
1811
|
throw new Error("Error fetching provider. Please try again.");
|
|
1798
1812
|
}
|
|
1799
1813
|
const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
|
|
@@ -1810,7 +1824,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1810
1824
|
const chainId = await provider.request({ method: "eth_chainId" });
|
|
1811
1825
|
this.emitConnect(chainId);
|
|
1812
1826
|
this.emitAccountsChanged([checksumAdr]);
|
|
1813
|
-
|
|
1827
|
+
_chunkKD3A4VYBjs.sentryLogger.info(`Wallet connected: ${adapter.id} (widget)`);
|
|
1814
1828
|
return this.userInfo;
|
|
1815
1829
|
}
|
|
1816
1830
|
async getChainId() {
|
|
@@ -1829,7 +1843,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1829
1843
|
}
|
|
1830
1844
|
}
|
|
1831
1845
|
updateBrandConfig(newConfig) {
|
|
1832
|
-
const defaultTheme =
|
|
1846
|
+
const defaultTheme = _chunkKD3A4VYBjs.getDefaultThemeConfig.call(void 0, _nullishCoalesce(newConfig.theme, () => ( this.brandConfig.theme)));
|
|
1833
1847
|
this.brandConfig = {
|
|
1834
1848
|
logo: "logo" in newConfig ? _nullishCoalesce(newConfig.logo, () => ( defaultTheme.logo)) : this.brandConfig.logo,
|
|
1835
1849
|
theme: "theme" in newConfig ? _nullishCoalesce(newConfig.theme, () => ( defaultTheme.theme)) : this.brandConfig.theme,
|
|
@@ -1842,7 +1856,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1842
1856
|
walletLayout: "walletLayout" in newConfig ? _nullishCoalesce(newConfig.walletLayout, () => ( defaultTheme.walletLayout)) : this.brandConfig.walletLayout
|
|
1843
1857
|
};
|
|
1844
1858
|
if ("theme" in newConfig && this.brandConfig.theme) {
|
|
1845
|
-
const wcAdapter = this.wallets.find((w) => w.id ===
|
|
1859
|
+
const wcAdapter = this.wallets.find((w) => w.id === _chunkKD3A4VYBjs.WalletId.WalletConnect);
|
|
1846
1860
|
_optionalChain([wcAdapter, 'optionalAccess', _154 => _154.updateTheme, 'call', _155 => _155(this.brandConfig.theme)]);
|
|
1847
1861
|
}
|
|
1848
1862
|
}
|
|
@@ -1858,7 +1872,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1858
1872
|
*/
|
|
1859
1873
|
async emailAuthStart(email) {
|
|
1860
1874
|
await this.whenReady();
|
|
1861
|
-
const emailAdapter = this.wallets.find((w) => w.id ===
|
|
1875
|
+
const emailAdapter = this.wallets.find((w) => w.id === _chunkKD3A4VYBjs.WalletId.Email);
|
|
1862
1876
|
if (!emailAdapter || !emailAdapter.emailAuthStart) {
|
|
1863
1877
|
throw new Error("Email wallet is not configured");
|
|
1864
1878
|
}
|
|
@@ -1873,20 +1887,20 @@ var _AurumCore = class _AurumCore {
|
|
|
1873
1887
|
*/
|
|
1874
1888
|
async emailAuthVerify(flowId, otp) {
|
|
1875
1889
|
await this.whenReady();
|
|
1876
|
-
const emailAdapter = this.wallets.find((w) => w.id ===
|
|
1890
|
+
const emailAdapter = this.wallets.find((w) => w.id === _chunkKD3A4VYBjs.WalletId.Email);
|
|
1877
1891
|
if (!emailAdapter || !emailAdapter.emailAuthVerify) {
|
|
1878
1892
|
throw new Error("Email wallet is not configured");
|
|
1879
1893
|
}
|
|
1880
1894
|
const verifyResult = await emailAdapter.emailAuthVerify(flowId, otp);
|
|
1881
1895
|
const provider = emailAdapter.getProvider();
|
|
1882
1896
|
if (!provider) {
|
|
1883
|
-
|
|
1897
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Failed to get provider after email verification");
|
|
1884
1898
|
throw new Error("Failed to get provider after email verification");
|
|
1885
1899
|
}
|
|
1886
1900
|
const address = _optionalChain([verifyResult, 'access', _156 => _156.user, 'optionalAccess', _157 => _157.evmAccounts, 'optionalAccess', _158 => _158[0]]);
|
|
1887
1901
|
const email = _optionalChain([verifyResult, 'access', _159 => _159.user, 'optionalAccess', _160 => _160.authenticationMethods, 'optionalAccess', _161 => _161.email, 'optionalAccess', _162 => _162.email]);
|
|
1888
1902
|
if (!address || !email) {
|
|
1889
|
-
|
|
1903
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Address or email not found after email verification");
|
|
1890
1904
|
throw new Error("Address or email not found after email verification");
|
|
1891
1905
|
}
|
|
1892
1906
|
const checksumAdr = _viem.checksumAddress.call(void 0, address);
|
|
@@ -1903,7 +1917,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1903
1917
|
const chainId = await provider.request({ method: "eth_chainId" });
|
|
1904
1918
|
this.emitConnect(chainId);
|
|
1905
1919
|
this.emitAccountsChanged([checksumAdr]);
|
|
1906
|
-
|
|
1920
|
+
_chunkKD3A4VYBjs.sentryLogger.info(`Wallet connected: ${emailAdapter.id} (headless)`);
|
|
1907
1921
|
return { address: checksumAdr, email: _nullishCoalesce(email, () => ( "")), isNewUser: _nullishCoalesce(verifyResult.isNewUser, () => ( false)) };
|
|
1908
1922
|
}
|
|
1909
1923
|
/**
|
|
@@ -1912,7 +1926,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1912
1926
|
*/
|
|
1913
1927
|
async getWalletConnectSession() {
|
|
1914
1928
|
await this.whenReady();
|
|
1915
|
-
const wcAdapter = this.wallets.find((w) => w.id ===
|
|
1929
|
+
const wcAdapter = this.wallets.find((w) => w.id === _chunkKD3A4VYBjs.WalletId.WalletConnect);
|
|
1916
1930
|
if (!wcAdapter) {
|
|
1917
1931
|
throw new Error("WalletConnect is not enabled");
|
|
1918
1932
|
}
|
|
@@ -1923,7 +1937,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1923
1937
|
const result = await session.waitForConnection();
|
|
1924
1938
|
const provider = _nullishCoalesce(result.provider, () => ( wcAdapter.getProvider()));
|
|
1925
1939
|
if (!provider) {
|
|
1926
|
-
|
|
1940
|
+
_chunkKD3A4VYBjs.sentryLogger.error("Failed to get provider after WalletConnect connection");
|
|
1927
1941
|
throw new Error("Failed to get provider after WalletConnect connection");
|
|
1928
1942
|
}
|
|
1929
1943
|
const checksumAdr = _viem.checksumAddress.call(void 0, result.address);
|
|
@@ -1939,7 +1953,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1939
1953
|
const chainId = await provider.request({ method: "eth_chainId" });
|
|
1940
1954
|
this.emitConnect(chainId);
|
|
1941
1955
|
this.emitAccountsChanged([checksumAdr]);
|
|
1942
|
-
|
|
1956
|
+
_chunkKD3A4VYBjs.sentryLogger.info(`Wallet connected: ${wcAdapter.id} (headless)`);
|
|
1943
1957
|
return checksumAdr;
|
|
1944
1958
|
}
|
|
1945
1959
|
};
|
|
@@ -1996,7 +2010,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1996
2010
|
/* BRAND & THEME METHODS */
|
|
1997
2011
|
resolveBrandConfig(config) {
|
|
1998
2012
|
const { brand = {} } = config || {};
|
|
1999
|
-
const themeConfig =
|
|
2013
|
+
const themeConfig = _chunkKD3A4VYBjs.getDefaultThemeConfig.call(void 0, brand.theme || _chunkKD3A4VYBjs.DEFAULT_THEME);
|
|
2000
2014
|
return {
|
|
2001
2015
|
logo: _nullishCoalesce(brand.logo, () => ( themeConfig.logo)),
|
|
2002
2016
|
theme: _nullishCoalesce(brand.theme, () => ( themeConfig.theme)),
|
|
@@ -2010,9 +2024,13 @@ var _AurumCore = class _AurumCore {
|
|
|
2010
2024
|
};
|
|
2011
2025
|
}
|
|
2012
2026
|
async tryRestoreConnection() {
|
|
2027
|
+
if (typeof window === "undefined") {
|
|
2028
|
+
this.ready = true;
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2013
2031
|
try {
|
|
2014
|
-
await
|
|
2015
|
-
const store =
|
|
2032
|
+
await _chunkKD3A4VYBjs.waitForStoreHydration.call(void 0, );
|
|
2033
|
+
const store = _chunkKD3A4VYBjs.useAurumStore.getState();
|
|
2016
2034
|
if (!store.isConnected || !store.walletId || !store.address || !store.walletName) {
|
|
2017
2035
|
return;
|
|
2018
2036
|
}
|
|
@@ -2035,14 +2053,14 @@ var _AurumCore = class _AurumCore {
|
|
|
2035
2053
|
email: _nullishCoalesce(store.email, () => ( void 0))
|
|
2036
2054
|
};
|
|
2037
2055
|
this.setInternalAccountChangeListener(persistedAdapter);
|
|
2038
|
-
} catch (
|
|
2056
|
+
} catch (e16) {
|
|
2039
2057
|
this.resetConnectionState();
|
|
2040
2058
|
} finally {
|
|
2041
2059
|
this.ready = true;
|
|
2042
2060
|
}
|
|
2043
2061
|
}
|
|
2044
2062
|
persistConnectionState(adapter, address, email) {
|
|
2045
|
-
|
|
2063
|
+
_chunkKD3A4VYBjs.useAurumStore.getState().setConnection(adapter.id, _viem.checksumAddress.call(void 0, address), adapter.name, email);
|
|
2046
2064
|
}
|
|
2047
2065
|
/* INTERNAL LISTENER METHODS */
|
|
2048
2066
|
setInternalAccountChangeListener(adapter) {
|
|
@@ -2140,7 +2158,7 @@ var _AurumCore = class _AurumCore {
|
|
|
2140
2158
|
}
|
|
2141
2159
|
/* REST */
|
|
2142
2160
|
resetConnectionState() {
|
|
2143
|
-
|
|
2161
|
+
_chunkKD3A4VYBjs.useAurumStore.getState().clearConnection();
|
|
2144
2162
|
this.connectedWalletAdapter = null;
|
|
2145
2163
|
this.updateProvider(this.skeletonProvider);
|
|
2146
2164
|
this.userInfo = void 0;
|
|
@@ -2148,6 +2166,10 @@ var _AurumCore = class _AurumCore {
|
|
|
2148
2166
|
};
|
|
2149
2167
|
// Singleton instance
|
|
2150
2168
|
_AurumCore.instance = null;
|
|
2169
|
+
// Serialized first-construction config used to detect mismatched re-inits (dev footgun: HMR,
|
|
2170
|
+
// cross-module imports, etc). Stored as a string so re-construction with structurally-equal
|
|
2171
|
+
// config doesn't false-positive.
|
|
2172
|
+
_AurumCore.storedConfigJson = null;
|
|
2151
2173
|
// Events managed by AurumCore (not forwarded to underlying provider)
|
|
2152
2174
|
_AurumCore.MANAGED_EVENTS = ["accountsChanged", "connect", "disconnect"];
|
|
2153
2175
|
var AurumCore = _AurumCore;
|
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
useAurumStore,
|
|
17
17
|
useNavigation,
|
|
18
18
|
waitForStoreHydration
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-UPYYZG5D.mjs";
|
|
20
20
|
import "./chunk-DRID67T7.mjs";
|
|
21
21
|
import {
|
|
22
22
|
init_polyfills
|
|
@@ -1396,7 +1396,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1396
1396
|
sentryLogger.error("Email is not available");
|
|
1397
1397
|
throw new Error("Email is not available");
|
|
1398
1398
|
}
|
|
1399
|
-
const { signInWithEmail } = await import("./index.web-
|
|
1399
|
+
const { signInWithEmail } = await import("./index.web-Q2L3EMC3.mjs");
|
|
1400
1400
|
const authResult = await signInWithEmail({ email });
|
|
1401
1401
|
return authResult;
|
|
1402
1402
|
}
|
|
@@ -1409,7 +1409,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1409
1409
|
sentryLogger.error("Email provider not initialized");
|
|
1410
1410
|
throw new Error("Email provider not initialized");
|
|
1411
1411
|
}
|
|
1412
|
-
const { verifyEmailOTP } = await import("./index.web-
|
|
1412
|
+
const { verifyEmailOTP } = await import("./index.web-Q2L3EMC3.mjs");
|
|
1413
1413
|
return verifyEmailOTP({ flowId, otp });
|
|
1414
1414
|
}
|
|
1415
1415
|
async connect() {
|
|
@@ -1441,7 +1441,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1441
1441
|
async disconnect() {
|
|
1442
1442
|
try {
|
|
1443
1443
|
await this.ensureInitialized();
|
|
1444
|
-
const { signOut } = await import("./index.web-
|
|
1444
|
+
const { signOut } = await import("./index.web-Q2L3EMC3.mjs");
|
|
1445
1445
|
await signOut();
|
|
1446
1446
|
} catch {
|
|
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 import("./index.web-
|
|
1490
|
+
const { initialize } = await import("./index.web-Q2L3EMC3.mjs");
|
|
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 import("./index.web-
|
|
1508
|
+
const { createCDPEmbeddedWallet } = await import("./index.web-Q2L3EMC3.mjs");
|
|
1509
1509
|
const wallet = createCDPEmbeddedWallet({
|
|
1510
1510
|
chains: _EmailAdapter.viemChains,
|
|
1511
1511
|
transports: _EmailAdapter.viemTransports
|
|
@@ -1665,8 +1665,15 @@ var _AurumCore = class _AurumCore {
|
|
|
1665
1665
|
this.connectedWalletAdapter = null;
|
|
1666
1666
|
this.eventListeners = /* @__PURE__ */ new Map();
|
|
1667
1667
|
if (_AurumCore.instance) {
|
|
1668
|
+
const incoming = _AurumCore.serializeConfig(config);
|
|
1669
|
+
if (incoming !== null && incoming !== _AurumCore.storedConfigJson) {
|
|
1670
|
+
console.warn(
|
|
1671
|
+
"Aurum Constructor called a second time with a different config; the original config is kept. Use updateBrandConfig() / updateWalletsConfig() to change config at runtime."
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1668
1674
|
return _AurumCore.instance;
|
|
1669
1675
|
}
|
|
1676
|
+
_AurumCore.storedConfigJson = _AurumCore.serializeConfig(config);
|
|
1670
1677
|
const telemetryEnabled = config.telemetry !== false;
|
|
1671
1678
|
initSentry(telemetryEnabled);
|
|
1672
1679
|
this.brandConfig = this.resolveBrandConfig(config);
|
|
@@ -1685,6 +1692,13 @@ var _AurumCore = class _AurumCore {
|
|
|
1685
1692
|
this.readyPromise = this.tryRestoreConnection();
|
|
1686
1693
|
_AurumCore.instance = this;
|
|
1687
1694
|
}
|
|
1695
|
+
static serializeConfig(config) {
|
|
1696
|
+
try {
|
|
1697
|
+
return JSON.stringify(config);
|
|
1698
|
+
} catch {
|
|
1699
|
+
return null;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1688
1702
|
async whenReady() {
|
|
1689
1703
|
try {
|
|
1690
1704
|
await this.readyPromise;
|
|
@@ -2010,6 +2024,10 @@ var _AurumCore = class _AurumCore {
|
|
|
2010
2024
|
};
|
|
2011
2025
|
}
|
|
2012
2026
|
async tryRestoreConnection() {
|
|
2027
|
+
if (typeof window === "undefined") {
|
|
2028
|
+
this.ready = true;
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2013
2031
|
try {
|
|
2014
2032
|
await waitForStoreHydration();
|
|
2015
2033
|
const store = useAurumStore.getState();
|
|
@@ -2148,6 +2166,10 @@ var _AurumCore = class _AurumCore {
|
|
|
2148
2166
|
};
|
|
2149
2167
|
// Singleton instance
|
|
2150
2168
|
_AurumCore.instance = null;
|
|
2169
|
+
// Serialized first-construction config used to detect mismatched re-inits (dev footgun: HMR,
|
|
2170
|
+
// cross-module imports, etc). Stored as a string so re-construction with structurally-equal
|
|
2171
|
+
// config doesn't false-positive.
|
|
2172
|
+
_AurumCore.storedConfigJson = null;
|
|
2151
2173
|
// Events managed by AurumCore (not forwarded to underlying provider)
|
|
2152
2174
|
_AurumCore.MANAGED_EVENTS = ["accountsChanged", "connect", "disconnect"];
|
|
2153
2175
|
var AurumCore = _AurumCore;
|
|
@@ -25561,7 +25561,7 @@ function g12(e28 = {}) {
|
|
|
25561
25561
|
throw new Error("No account found");
|
|
25562
25562
|
})();
|
|
25563
25563
|
try {
|
|
25564
|
-
const { wrapFetchWithPayment: u27 } = await import("
|
|
25564
|
+
const { wrapFetchWithPayment: u27 } = await import("./empty-stub-X6WHS3X3.mjs");
|
|
25565
25565
|
r28 = u27(
|
|
25566
25566
|
a29,
|
|
25567
25567
|
o34,
|
|
@@ -28158,4 +28158,4 @@ safe-buffer/index.js:
|
|
|
28158
28158
|
@coinbase/cdp-core/dist/esm/index.web149.js:
|
|
28159
28159
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
28160
28160
|
*/
|
|
28161
|
-
//# sourceMappingURL=index.web-
|
|
28161
|
+
//# sourceMappingURL=index.web-Q2L3EMC3.mjs.map
|
|
@@ -25561,7 +25561,7 @@ function g12(e28 = {}) {
|
|
|
25561
25561
|
throw new Error("No account found");
|
|
25562
25562
|
})();
|
|
25563
25563
|
try {
|
|
25564
|
-
const { wrapFetchWithPayment: u27 } = await Promise.resolve().then(() => _interopRequireWildcard(require("
|
|
25564
|
+
const { wrapFetchWithPayment: u27 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./empty-stub-JW2K2GSS.js")));
|
|
25565
25565
|
r28 = u27(
|
|
25566
25566
|
a29,
|
|
25567
25567
|
o34,
|
|
@@ -28158,4 +28158,4 @@ safe-buffer/index.js:
|
|
|
28158
28158
|
@coinbase/cdp-core/dist/esm/index.web149.js:
|
|
28159
28159
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
28160
28160
|
*/
|
|
28161
|
-
//# sourceMappingURL=index.web-
|
|
28161
|
+
//# sourceMappingURL=index.web-V7DLWC7H.js.map
|
package/dist/widgets.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkKD3A4VYBjs = require('./chunk-KD3A4VYB.js');
|
|
15
15
|
require('./chunk-4EBNC4R3.js');
|
|
16
16
|
|
|
17
17
|
|
|
@@ -35,20 +35,20 @@ var noop = () => {
|
|
|
35
35
|
};
|
|
36
36
|
var WidgetShell = ({ brandConfig, children }) => {
|
|
37
37
|
const headerPortalRef = _react.useRef.call(void 0, null);
|
|
38
|
-
const { currentPage } =
|
|
39
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
38
|
+
const { currentPage } = _chunkKD3A4VYBjs.useNavigation.call(void 0, );
|
|
39
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.WidgetProvider, { mode: "widget", brandConfig, onDismiss: noop, headerPortalRef, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "widget-provider", children: [
|
|
40
40
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: headerPortalRef }),
|
|
41
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
41
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.PageTransitionContainer, { transitionKey: currentPage, children }),
|
|
42
42
|
!brandConfig.hideFooter ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
43
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
44
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
45
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
43
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.Spacer, { size: `${_chunkKD3A4VYBjs.POWERED_BY_SPACER_REM}rem` }),
|
|
44
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.PoweredBy, {})
|
|
45
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.Spacer, { size: "0.3125rem" })
|
|
46
46
|
] }) });
|
|
47
47
|
};
|
|
48
48
|
var WidgetStyleContainer = ({ children, brandConfig }) => {
|
|
49
49
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "aurum-widget", style: { width: "100%" }, children: [
|
|
50
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children:
|
|
51
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
50
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: _chunkKD3A4VYBjs.generateCompleteStyles.call(void 0, brandConfig) }),
|
|
51
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ThemeContainer, { theme: brandConfig.theme, children })
|
|
52
52
|
] });
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -60,7 +60,7 @@ var ConnectWidget = ({ aurum, onConnect }) => {
|
|
|
60
60
|
const excludedWalletIds = aurum.excludedWalletIds;
|
|
61
61
|
const displayedWallets = _react.useMemo.call(void 0, () => {
|
|
62
62
|
const filtered = walletAdapters.filter((w) => !excludedWalletIds.has(w.id));
|
|
63
|
-
return
|
|
63
|
+
return _chunkKD3A4VYBjs.sortWallets.call(void 0, filtered, { filterHidden: false });
|
|
64
64
|
}, [walletAdapters, excludedWalletIds]);
|
|
65
65
|
const handleConnect = _react.useCallback.call(void 0,
|
|
66
66
|
async (result) => {
|
|
@@ -69,11 +69,11 @@ var ConnectWidget = ({ aurum, onConnect }) => {
|
|
|
69
69
|
},
|
|
70
70
|
[aurum, onConnect]
|
|
71
71
|
);
|
|
72
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyleContainer, { brandConfig, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
72
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyleContainer, { brandConfig, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ConnectUIProviders, { onConnect: handleConnect, displayedWallets, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetShell, { brandConfig, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKD3A4VYBjs.ConnectPages, {}) }) }) });
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
exports.ConnectWidget = ConnectWidget; exports.WidgetProvider =
|
|
78
|
+
exports.ConnectWidget = ConnectWidget; exports.WidgetProvider = _chunkKD3A4VYBjs.WidgetProvider; exports.useWidgetContext = _chunkKD3A4VYBjs.useWidgetContext;
|
|
79
79
|
//# sourceMappingURL=widgets.js.map
|
package/dist/widgets.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurum-sdk/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Aurum wallet connection SDK",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
@@ -88,16 +88,16 @@
|
|
|
88
88
|
"@liquid-js/qr-code-styling": "^5.3.1",
|
|
89
89
|
"@metamask/sdk": "~0.33.1",
|
|
90
90
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
91
|
-
"@reown/appkit": "
|
|
92
|
-
"@reown/appkit-adapter-wagmi": "
|
|
91
|
+
"@reown/appkit": "1.8.17",
|
|
92
|
+
"@reown/appkit-adapter-wagmi": "1.8.17",
|
|
93
93
|
"@sentry/browser": "^10.29.0",
|
|
94
94
|
"buffer": "^6.0.3",
|
|
95
95
|
"lucide-react": "^0.460.0",
|
|
96
96
|
"mobile-detect": "^1.4.5",
|
|
97
97
|
"porto": "^0.2.37",
|
|
98
98
|
"zustand": "^5.0.9",
|
|
99
|
-
"@aurum-sdk/logos": "^0.2.
|
|
100
|
-
"@aurum-sdk/types": "^0.2.
|
|
99
|
+
"@aurum-sdk/logos": "^0.2.6",
|
|
100
|
+
"@aurum-sdk/types": "^0.2.6"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"build": "tsup",
|