@aurum-sdk/core 0.2.3 → 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/chunk-27AOACEW.js +13332 -0
- package/dist/chunk-4EBNC4R3.js +33 -0
- package/dist/chunk-DRID67T7.mjs +33 -0
- package/dist/chunk-J6XFKNJN.mjs +1878 -0
- package/dist/chunk-QIPVNM7T.js +1878 -0
- package/dist/chunk-X6ADRWYF.mjs +13332 -0
- package/dist/chunk-XTOUIIXZ.js +891 -0
- package/dist/chunk-YP64HBUK.mjs +891 -0
- package/dist/dist-7I773YNF.js +4825 -0
- package/dist/dist-YBFFGXT3.mjs +4825 -0
- package/dist/index.js +116 -96
- package/dist/index.mjs +67 -47
- package/dist/index.web-T26HBS3X.mjs +28161 -0
- package/dist/index.web-WXUV52ZW.js +28161 -0
- package/dist/widgets.js +24 -12
- package/dist/widgets.mjs +13 -1
- package/package.json +4 -4
- package/dist/chunk-JXTTDJRM.js +0 -2455
- package/dist/chunk-KAP5LMPM.mjs +0 -2455
package/dist/index.mjs
CHANGED
|
@@ -4,21 +4,36 @@ import {
|
|
|
4
4
|
DEFAULT_THEME,
|
|
5
5
|
Modal,
|
|
6
6
|
ThemeContainer,
|
|
7
|
+
WalletId,
|
|
8
|
+
WalletName,
|
|
7
9
|
createConfigError,
|
|
8
10
|
generateCompleteStyles,
|
|
9
11
|
getDefaultThemeConfig,
|
|
12
|
+
getLogoDataUri,
|
|
10
13
|
initSentry,
|
|
11
14
|
sentryLogger,
|
|
12
15
|
sortWallets,
|
|
13
16
|
useAurumStore,
|
|
14
17
|
useNavigation,
|
|
15
18
|
waitForStoreHydration
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-X6ADRWYF.mjs";
|
|
20
|
+
import "./chunk-DRID67T7.mjs";
|
|
21
|
+
import {
|
|
22
|
+
init_polyfills
|
|
23
|
+
} from "./chunk-J6XFKNJN.mjs";
|
|
24
|
+
|
|
25
|
+
// src/index.ts
|
|
26
|
+
init_polyfills();
|
|
27
|
+
|
|
28
|
+
// src/Aurum.ts
|
|
29
|
+
init_polyfills();
|
|
17
30
|
|
|
18
31
|
// src/AurumCore.ts
|
|
32
|
+
init_polyfills();
|
|
19
33
|
import { checksumAddress } from "viem";
|
|
20
34
|
|
|
21
35
|
// src/utils/chainHelpers.ts
|
|
36
|
+
init_polyfills();
|
|
22
37
|
function normalizeChainId(chainId) {
|
|
23
38
|
if (typeof chainId === "string" && chainId.startsWith("0x")) return chainId;
|
|
24
39
|
const numericId = typeof chainId === "number" ? chainId : Number(chainId);
|
|
@@ -40,7 +55,11 @@ function isChainExistsError(error) {
|
|
|
40
55
|
);
|
|
41
56
|
}
|
|
42
57
|
|
|
58
|
+
// src/components/ConnectModal/renderConnectModal.tsx
|
|
59
|
+
init_polyfills();
|
|
60
|
+
|
|
43
61
|
// src/components/ConnectModal/ModalShell.tsx
|
|
62
|
+
init_polyfills();
|
|
44
63
|
import { useState } from "react";
|
|
45
64
|
import { jsx } from "react/jsx-runtime";
|
|
46
65
|
var ModalShell = ({ onClose, brandConfig }) => {
|
|
@@ -64,9 +83,11 @@ var ModalShell = ({ onClose, brandConfig }) => {
|
|
|
64
83
|
};
|
|
65
84
|
|
|
66
85
|
// src/utils/createModalContainer.ts
|
|
86
|
+
init_polyfills();
|
|
67
87
|
import { createRoot } from "react-dom/client";
|
|
68
88
|
|
|
69
89
|
// src/utils/createShadowRoot.ts
|
|
90
|
+
init_polyfills();
|
|
70
91
|
function createShadowRoot(container, brandConfig) {
|
|
71
92
|
const shadowRoot = container.attachShadow({ mode: "open" });
|
|
72
93
|
shadowRoot.innerHTML = `
|
|
@@ -123,9 +144,14 @@ function renderConnectModal({
|
|
|
123
144
|
});
|
|
124
145
|
}
|
|
125
146
|
|
|
147
|
+
// src/utils/createWalletAdapters.ts
|
|
148
|
+
init_polyfills();
|
|
149
|
+
|
|
150
|
+
// src/wallet-adapters/index.ts
|
|
151
|
+
init_polyfills();
|
|
152
|
+
|
|
126
153
|
// src/wallet-adapters/RabbyAdapter.ts
|
|
127
|
-
|
|
128
|
-
import { WalletId, WalletName } from "@aurum-sdk/types";
|
|
154
|
+
init_polyfills();
|
|
129
155
|
var RABBY_RDNS = "io.rabby";
|
|
130
156
|
var RabbyAdapter = class {
|
|
131
157
|
constructor() {
|
|
@@ -258,10 +284,10 @@ var RabbyAdapter = class {
|
|
|
258
284
|
};
|
|
259
285
|
|
|
260
286
|
// src/wallet-adapters/BraveAdapter.ts
|
|
261
|
-
|
|
262
|
-
import { WalletId as WalletId2, WalletName as WalletName2 } from "@aurum-sdk/types";
|
|
287
|
+
init_polyfills();
|
|
263
288
|
|
|
264
289
|
// src/utils/platform/isBraveBrowser.ts
|
|
290
|
+
init_polyfills();
|
|
265
291
|
function isBraveBrowser() {
|
|
266
292
|
if (typeof navigator === "undefined") return false;
|
|
267
293
|
return navigator.brave !== void 0;
|
|
@@ -271,9 +297,9 @@ function isBraveBrowser() {
|
|
|
271
297
|
var BRAVE_RDNS = "com.brave.wallet";
|
|
272
298
|
var BraveAdapter = class {
|
|
273
299
|
constructor() {
|
|
274
|
-
this.id =
|
|
275
|
-
this.name =
|
|
276
|
-
this.icon =
|
|
300
|
+
this.id = WalletId.Brave;
|
|
301
|
+
this.name = WalletName.Brave;
|
|
302
|
+
this.icon = getLogoDataUri(WalletId.Brave, "brand") ?? "";
|
|
277
303
|
this.downloadUrl = "https://brave.com/download";
|
|
278
304
|
this.wcDeepLinkUrl = null;
|
|
279
305
|
this.provider = null;
|
|
@@ -404,14 +430,13 @@ var BraveAdapter = class {
|
|
|
404
430
|
};
|
|
405
431
|
|
|
406
432
|
// src/wallet-adapters/PhantomAdapter.ts
|
|
407
|
-
|
|
408
|
-
import { WalletId as WalletId3, WalletName as WalletName3 } from "@aurum-sdk/types";
|
|
433
|
+
init_polyfills();
|
|
409
434
|
var PHANTOM_RDNS = "app.phantom";
|
|
410
435
|
var PhantomAdapter = class {
|
|
411
436
|
constructor() {
|
|
412
|
-
this.id =
|
|
413
|
-
this.name =
|
|
414
|
-
this.icon =
|
|
437
|
+
this.id = WalletId.Phantom;
|
|
438
|
+
this.name = WalletName.Phantom;
|
|
439
|
+
this.icon = getLogoDataUri(WalletId.Phantom, "brand") ?? "";
|
|
415
440
|
this.hide = false;
|
|
416
441
|
this.downloadUrl = "https://phantom.com/download";
|
|
417
442
|
this.wcDeepLinkUrl = "phantom://wc?uri=";
|
|
@@ -543,13 +568,12 @@ var PhantomAdapter = class {
|
|
|
543
568
|
};
|
|
544
569
|
|
|
545
570
|
// src/wallet-adapters/CoinbaseWalletAdapter.ts
|
|
546
|
-
|
|
547
|
-
import { WalletId as WalletId4, WalletName as WalletName4 } from "@aurum-sdk/types";
|
|
571
|
+
init_polyfills();
|
|
548
572
|
var CoinbaseWalletAdapter = class {
|
|
549
573
|
constructor({ appName, appLogoUrl, telemetry }) {
|
|
550
|
-
this.id =
|
|
551
|
-
this.name =
|
|
552
|
-
this.icon =
|
|
574
|
+
this.id = WalletId.CoinbaseWallet;
|
|
575
|
+
this.name = WalletName.CoinbaseWallet;
|
|
576
|
+
this.icon = getLogoDataUri(WalletId.CoinbaseWallet, "brand") ?? "";
|
|
553
577
|
this.hide = false;
|
|
554
578
|
this.downloadUrl = "https://www.coinbase.com/wallet/downloads";
|
|
555
579
|
this.wcDeepLinkUrl = "cbwallet://wc?uri=";
|
|
@@ -568,7 +592,7 @@ var CoinbaseWalletAdapter = class {
|
|
|
568
592
|
async initializeProvider() {
|
|
569
593
|
if (typeof window === "undefined") return;
|
|
570
594
|
try {
|
|
571
|
-
const { createCoinbaseWalletSDK } = await import("
|
|
595
|
+
const { createCoinbaseWalletSDK } = await import("./dist-YBFFGXT3.mjs");
|
|
572
596
|
const coinbaseSdk = createCoinbaseWalletSDK({
|
|
573
597
|
appName: this.config.appName,
|
|
574
598
|
appLogoUrl: this.config.appLogoUrl,
|
|
@@ -675,14 +699,13 @@ var CoinbaseWalletAdapter = class {
|
|
|
675
699
|
};
|
|
676
700
|
|
|
677
701
|
// src/wallet-adapters/MetaMaskAdapter.ts
|
|
678
|
-
|
|
679
|
-
import { WalletId as WalletId5, WalletName as WalletName5 } from "@aurum-sdk/types";
|
|
702
|
+
init_polyfills();
|
|
680
703
|
var METAMASK_RDNS = "io.metamask";
|
|
681
704
|
var MetaMaskAdapter = class {
|
|
682
705
|
constructor() {
|
|
683
|
-
this.id =
|
|
684
|
-
this.name =
|
|
685
|
-
this.icon =
|
|
706
|
+
this.id = WalletId.MetaMask;
|
|
707
|
+
this.name = WalletName.MetaMask;
|
|
708
|
+
this.icon = getLogoDataUri(WalletId.MetaMask, "brand") ?? "";
|
|
686
709
|
this.hide = false;
|
|
687
710
|
this.downloadUrl = "https://metamask.io/download";
|
|
688
711
|
this.wcDeepLinkUrl = "metamask://wc?uri=";
|
|
@@ -815,10 +838,10 @@ var MetaMaskAdapter = class {
|
|
|
815
838
|
};
|
|
816
839
|
|
|
817
840
|
// src/wallet-adapters/WalletConnectAdapter.ts
|
|
818
|
-
|
|
819
|
-
import { WalletId as WalletId6, WalletName as WalletName6 } from "@aurum-sdk/types";
|
|
841
|
+
init_polyfills();
|
|
820
842
|
|
|
821
843
|
// src/constants/adapters.ts
|
|
844
|
+
init_polyfills();
|
|
822
845
|
var WALLETCONNECT_NAMESPACE = {
|
|
823
846
|
eip155: {
|
|
824
847
|
methods: [
|
|
@@ -911,9 +934,9 @@ function extractAddressFromSession(namespaces) {
|
|
|
911
934
|
}
|
|
912
935
|
var WalletConnectAdapter = class {
|
|
913
936
|
constructor(config) {
|
|
914
|
-
this.id =
|
|
915
|
-
this.name =
|
|
916
|
-
this.icon =
|
|
937
|
+
this.id = WalletId.WalletConnect;
|
|
938
|
+
this.name = WalletName.WalletConnect;
|
|
939
|
+
this.icon = getLogoDataUri(WalletId.WalletConnect, "brand") ?? "";
|
|
917
940
|
this.hide = false;
|
|
918
941
|
this.downloadUrl = null;
|
|
919
942
|
this.wcDeepLinkUrl = null;
|
|
@@ -1339,13 +1362,12 @@ var WalletConnectAdapter = class {
|
|
|
1339
1362
|
};
|
|
1340
1363
|
|
|
1341
1364
|
// src/wallet-adapters/EmailAdapter.ts
|
|
1342
|
-
|
|
1343
|
-
import { getLogoDataUri as getLogoDataUri7 } from "@aurum-sdk/logos";
|
|
1365
|
+
init_polyfills();
|
|
1344
1366
|
var _EmailAdapter = class _EmailAdapter {
|
|
1345
1367
|
constructor(config) {
|
|
1346
|
-
this.id =
|
|
1347
|
-
this.name =
|
|
1348
|
-
this.icon =
|
|
1368
|
+
this.id = WalletId.Email;
|
|
1369
|
+
this.name = WalletName.Email;
|
|
1370
|
+
this.icon = getLogoDataUri(WalletId.Email, "brand") ?? "";
|
|
1349
1371
|
this.hide = true;
|
|
1350
1372
|
this.downloadUrl = null;
|
|
1351
1373
|
this.wcDeepLinkUrl = null;
|
|
@@ -1374,7 +1396,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1374
1396
|
sentryLogger.error("Email is not available");
|
|
1375
1397
|
throw new Error("Email is not available");
|
|
1376
1398
|
}
|
|
1377
|
-
const { signInWithEmail } = await import("
|
|
1399
|
+
const { signInWithEmail } = await import("./index.web-T26HBS3X.mjs");
|
|
1378
1400
|
const authResult = await signInWithEmail({ email });
|
|
1379
1401
|
return authResult;
|
|
1380
1402
|
}
|
|
@@ -1387,7 +1409,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1387
1409
|
sentryLogger.error("Email provider not initialized");
|
|
1388
1410
|
throw new Error("Email provider not initialized");
|
|
1389
1411
|
}
|
|
1390
|
-
const { verifyEmailOTP } = await import("
|
|
1412
|
+
const { verifyEmailOTP } = await import("./index.web-T26HBS3X.mjs");
|
|
1391
1413
|
return verifyEmailOTP({ flowId, otp });
|
|
1392
1414
|
}
|
|
1393
1415
|
async connect() {
|
|
@@ -1419,7 +1441,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1419
1441
|
async disconnect() {
|
|
1420
1442
|
try {
|
|
1421
1443
|
await this.ensureInitialized();
|
|
1422
|
-
const { signOut } = await import("
|
|
1444
|
+
const { signOut } = await import("./index.web-T26HBS3X.mjs");
|
|
1423
1445
|
await signOut();
|
|
1424
1446
|
} catch {
|
|
1425
1447
|
}
|
|
@@ -1465,7 +1487,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1465
1487
|
* Called by ensureInitialized() - deduplication handled via initPromise.
|
|
1466
1488
|
*/
|
|
1467
1489
|
async initializeProvider() {
|
|
1468
|
-
const { initialize } = await import("
|
|
1490
|
+
const { initialize } = await import("./index.web-T26HBS3X.mjs");
|
|
1469
1491
|
await initialize({
|
|
1470
1492
|
projectId: this.projectId,
|
|
1471
1493
|
ethereum: {
|
|
@@ -1483,7 +1505,7 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1483
1505
|
async createProvider() {
|
|
1484
1506
|
try {
|
|
1485
1507
|
await _EmailAdapter.initializeChainData();
|
|
1486
|
-
const { createCDPEmbeddedWallet } = await import("
|
|
1508
|
+
const { createCDPEmbeddedWallet } = await import("./index.web-T26HBS3X.mjs");
|
|
1487
1509
|
const wallet = createCDPEmbeddedWallet({
|
|
1488
1510
|
chains: _EmailAdapter.viemChains,
|
|
1489
1511
|
transports: _EmailAdapter.viemTransports
|
|
@@ -1561,10 +1583,8 @@ function createWalletAdapters({
|
|
|
1561
1583
|
];
|
|
1562
1584
|
}
|
|
1563
1585
|
|
|
1564
|
-
// src/AurumCore.ts
|
|
1565
|
-
import { WalletId as WalletId8 } from "@aurum-sdk/types";
|
|
1566
|
-
|
|
1567
1586
|
// src/providers/RpcProvider.ts
|
|
1587
|
+
init_polyfills();
|
|
1568
1588
|
var ProviderRpcError = class extends Error {
|
|
1569
1589
|
constructor(code, message, data) {
|
|
1570
1590
|
super(message);
|
|
@@ -1703,7 +1723,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1703
1723
|
if (!adapter) {
|
|
1704
1724
|
throw new Error(`${walletId} is not configured`);
|
|
1705
1725
|
}
|
|
1706
|
-
if (walletId ===
|
|
1726
|
+
if (walletId === WalletId.WalletConnect && adapter.openModal) {
|
|
1707
1727
|
result = await adapter.openModal();
|
|
1708
1728
|
} else {
|
|
1709
1729
|
if (!adapter.isInstalled()) {
|
|
@@ -1822,7 +1842,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1822
1842
|
walletLayout: "walletLayout" in newConfig ? newConfig.walletLayout ?? defaultTheme.walletLayout : this.brandConfig.walletLayout
|
|
1823
1843
|
};
|
|
1824
1844
|
if ("theme" in newConfig && this.brandConfig.theme) {
|
|
1825
|
-
const wcAdapter = this.wallets.find((w) => w.id ===
|
|
1845
|
+
const wcAdapter = this.wallets.find((w) => w.id === WalletId.WalletConnect);
|
|
1826
1846
|
wcAdapter?.updateTheme(this.brandConfig.theme);
|
|
1827
1847
|
}
|
|
1828
1848
|
}
|
|
@@ -1838,7 +1858,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1838
1858
|
*/
|
|
1839
1859
|
async emailAuthStart(email) {
|
|
1840
1860
|
await this.whenReady();
|
|
1841
|
-
const emailAdapter = this.wallets.find((w) => w.id ===
|
|
1861
|
+
const emailAdapter = this.wallets.find((w) => w.id === WalletId.Email);
|
|
1842
1862
|
if (!emailAdapter || !emailAdapter.emailAuthStart) {
|
|
1843
1863
|
throw new Error("Email wallet is not configured");
|
|
1844
1864
|
}
|
|
@@ -1853,7 +1873,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1853
1873
|
*/
|
|
1854
1874
|
async emailAuthVerify(flowId, otp) {
|
|
1855
1875
|
await this.whenReady();
|
|
1856
|
-
const emailAdapter = this.wallets.find((w) => w.id ===
|
|
1876
|
+
const emailAdapter = this.wallets.find((w) => w.id === WalletId.Email);
|
|
1857
1877
|
if (!emailAdapter || !emailAdapter.emailAuthVerify) {
|
|
1858
1878
|
throw new Error("Email wallet is not configured");
|
|
1859
1879
|
}
|
|
@@ -1892,7 +1912,7 @@ var _AurumCore = class _AurumCore {
|
|
|
1892
1912
|
*/
|
|
1893
1913
|
async getWalletConnectSession() {
|
|
1894
1914
|
await this.whenReady();
|
|
1895
|
-
const wcAdapter = this.wallets.find((w) => w.id ===
|
|
1915
|
+
const wcAdapter = this.wallets.find((w) => w.id === WalletId.WalletConnect);
|
|
1896
1916
|
if (!wcAdapter) {
|
|
1897
1917
|
throw new Error("WalletConnect is not enabled");
|
|
1898
1918
|
}
|