@aurum-sdk/core 0.2.3-canary.1 → 0.2.3
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/README.md +6 -0
- package/dist/{chunk-ZM4G3XP6.js → chunk-JXTTDJRM.js} +4 -4
- package/dist/{chunk-76O7KRQ5.mjs → chunk-KAP5LMPM.mjs} +4 -4
- package/dist/index.js +133 -132
- package/dist/index.mjs +29 -28
- package/dist/widgets.js +12 -12
- package/dist/widgets.mjs +1 -1
- package/package.json +7 -7
- package/dist/chunk-76O7KRQ5.mjs.map +0 -1
- package/dist/chunk-ZM4G3XP6.js.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/widgets.css.map +0 -1
- package/dist/widgets.js.map +0 -1
- package/dist/widgets.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
useAurumStore,
|
|
14
14
|
useNavigation,
|
|
15
15
|
waitForStoreHydration
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KAP5LMPM.mjs";
|
|
17
17
|
|
|
18
18
|
// src/AurumCore.ts
|
|
19
19
|
import { checksumAddress } from "viem";
|
|
@@ -543,7 +543,6 @@ var PhantomAdapter = class {
|
|
|
543
543
|
};
|
|
544
544
|
|
|
545
545
|
// src/wallet-adapters/CoinbaseWalletAdapter.ts
|
|
546
|
-
import { createCoinbaseWalletSDK } from "@coinbase/wallet-sdk";
|
|
547
546
|
import { getLogoDataUri as getLogoDataUri4 } from "@aurum-sdk/logos";
|
|
548
547
|
import { WalletId as WalletId4, WalletName as WalletName4 } from "@aurum-sdk/types";
|
|
549
548
|
var CoinbaseWalletAdapter = class {
|
|
@@ -556,34 +555,39 @@ var CoinbaseWalletAdapter = class {
|
|
|
556
555
|
this.wcDeepLinkUrl = "cbwallet://wc?uri=";
|
|
557
556
|
this.provider = null;
|
|
558
557
|
this.accountsChangedCallback = null;
|
|
559
|
-
this.
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
558
|
+
this.initPromise = null;
|
|
559
|
+
this.config = { appName, appLogoUrl, telemetry: telemetry ?? false };
|
|
560
|
+
}
|
|
561
|
+
async ensureInitialized() {
|
|
562
|
+
if (this.provider) return;
|
|
563
|
+
if (!this.initPromise) {
|
|
564
|
+
this.initPromise = this.initializeProvider();
|
|
565
|
+
}
|
|
566
|
+
await this.initPromise;
|
|
567
|
+
}
|
|
568
|
+
async initializeProvider() {
|
|
569
|
+
if (typeof window === "undefined") return;
|
|
567
570
|
try {
|
|
571
|
+
const { createCoinbaseWalletSDK } = await import("@coinbase/wallet-sdk");
|
|
568
572
|
const coinbaseSdk = createCoinbaseWalletSDK({
|
|
569
|
-
appName,
|
|
570
|
-
appLogoUrl,
|
|
573
|
+
appName: this.config.appName,
|
|
574
|
+
appLogoUrl: this.config.appLogoUrl,
|
|
571
575
|
preference: {
|
|
572
576
|
options: "all",
|
|
573
|
-
telemetry
|
|
577
|
+
telemetry: this.config.telemetry
|
|
574
578
|
}
|
|
575
579
|
});
|
|
576
|
-
|
|
580
|
+
this.provider = coinbaseSdk.getProvider();
|
|
577
581
|
} catch (error) {
|
|
578
582
|
sentryLogger.warn("Failed to initialize Coinbase Wallet provider", { error });
|
|
579
|
-
return null;
|
|
580
583
|
}
|
|
581
584
|
}
|
|
582
585
|
isInstalled() {
|
|
583
|
-
return
|
|
586
|
+
return true;
|
|
584
587
|
}
|
|
585
588
|
async connect() {
|
|
586
|
-
|
|
589
|
+
await this.ensureInitialized();
|
|
590
|
+
if (!this.provider) {
|
|
587
591
|
sentryLogger.error("Coinbase Wallet is not available");
|
|
588
592
|
throw new Error("Coinbase Wallet is not available");
|
|
589
593
|
}
|
|
@@ -602,7 +606,8 @@ var CoinbaseWalletAdapter = class {
|
|
|
602
606
|
};
|
|
603
607
|
}
|
|
604
608
|
async tryRestoreConnection() {
|
|
605
|
-
|
|
609
|
+
await this.ensureInitialized();
|
|
610
|
+
if (!this.provider) {
|
|
606
611
|
return null;
|
|
607
612
|
}
|
|
608
613
|
try {
|
|
@@ -623,10 +628,11 @@ var CoinbaseWalletAdapter = class {
|
|
|
623
628
|
}
|
|
624
629
|
}
|
|
625
630
|
async disconnect() {
|
|
631
|
+
if (!this.provider) return;
|
|
626
632
|
try {
|
|
627
|
-
if (this.provider
|
|
633
|
+
if (this.provider.close) {
|
|
628
634
|
await this.provider.close();
|
|
629
|
-
} else if (this.provider
|
|
635
|
+
} else if (this.provider.disconnect) {
|
|
630
636
|
await this.provider.disconnect();
|
|
631
637
|
}
|
|
632
638
|
} catch (error) {
|
|
@@ -1368,14 +1374,9 @@ var _EmailAdapter = class _EmailAdapter {
|
|
|
1368
1374
|
sentryLogger.error("Email is not available");
|
|
1369
1375
|
throw new Error("Email is not available");
|
|
1370
1376
|
}
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
return authResult;
|
|
1375
|
-
} catch (error) {
|
|
1376
|
-
sentryLogger.error("Failed to start email authentication", { error });
|
|
1377
|
-
throw error;
|
|
1378
|
-
}
|
|
1377
|
+
const { signInWithEmail } = await import("@coinbase/cdp-core");
|
|
1378
|
+
const authResult = await signInWithEmail({ email });
|
|
1379
|
+
return authResult;
|
|
1379
1380
|
}
|
|
1380
1381
|
async emailAuthVerify(flowId, otp) {
|
|
1381
1382
|
if (!flowId || !otp) {
|
package/dist/widgets.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkJXTTDJRMjs = require('./chunk-JXTTDJRM.js');
|
|
15
15
|
|
|
16
16
|
// src/components/widgets/ConnectWidget.tsx
|
|
17
17
|
var _react = require('react');
|
|
@@ -23,20 +23,20 @@ var noop = () => {
|
|
|
23
23
|
};
|
|
24
24
|
var WidgetShell = ({ brandConfig, children }) => {
|
|
25
25
|
const headerPortalRef = _react.useRef.call(void 0, null);
|
|
26
|
-
const { currentPage } =
|
|
27
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
26
|
+
const { currentPage } = _chunkJXTTDJRMjs.useNavigation.call(void 0, );
|
|
27
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJXTTDJRMjs.WidgetProvider, { mode: "widget", brandConfig, onDismiss: noop, headerPortalRef, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "widget-provider", children: [
|
|
28
28
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: headerPortalRef }),
|
|
29
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
29
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJXTTDJRMjs.PageTransitionContainer, { transitionKey: currentPage, children }),
|
|
30
30
|
!brandConfig.hideFooter ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
31
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
32
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
33
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
31
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJXTTDJRMjs.Spacer, { size: `${_chunkJXTTDJRMjs.POWERED_BY_SPACER_REM}rem` }),
|
|
32
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJXTTDJRMjs.PoweredBy, {})
|
|
33
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJXTTDJRMjs.Spacer, { size: "0.3125rem" })
|
|
34
34
|
] }) });
|
|
35
35
|
};
|
|
36
36
|
var WidgetStyleContainer = ({ children, brandConfig }) => {
|
|
37
37
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "aurum-widget", style: { width: "100%" }, children: [
|
|
38
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children:
|
|
39
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
38
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: _chunkJXTTDJRMjs.generateCompleteStyles.call(void 0, brandConfig) }),
|
|
39
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJXTTDJRMjs.ThemeContainer, { theme: brandConfig.theme, children })
|
|
40
40
|
] });
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -48,7 +48,7 @@ var ConnectWidget = ({ aurum, onConnect }) => {
|
|
|
48
48
|
const excludedWalletIds = aurum.excludedWalletIds;
|
|
49
49
|
const displayedWallets = _react.useMemo.call(void 0, () => {
|
|
50
50
|
const filtered = walletAdapters.filter((w) => !excludedWalletIds.has(w.id));
|
|
51
|
-
return
|
|
51
|
+
return _chunkJXTTDJRMjs.sortWallets.call(void 0, filtered, { filterHidden: false });
|
|
52
52
|
}, [walletAdapters, excludedWalletIds]);
|
|
53
53
|
const handleConnect = _react.useCallback.call(void 0,
|
|
54
54
|
async (result) => {
|
|
@@ -57,11 +57,11 @@ var ConnectWidget = ({ aurum, onConnect }) => {
|
|
|
57
57
|
},
|
|
58
58
|
[aurum, onConnect]
|
|
59
59
|
);
|
|
60
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyleContainer, { brandConfig, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
60
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyleContainer, { brandConfig, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJXTTDJRMjs.ConnectUIProviders, { onConnect: handleConnect, displayedWallets, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetShell, { brandConfig, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJXTTDJRMjs.ConnectPages, {}) }) }) });
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
exports.ConnectWidget = ConnectWidget; exports.WidgetProvider =
|
|
66
|
+
exports.ConnectWidget = ConnectWidget; exports.WidgetProvider = _chunkJXTTDJRMjs.WidgetProvider; exports.useWidgetContext = _chunkJXTTDJRMjs.useWidgetContext;
|
|
67
67
|
//# 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
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Aurum wallet connection SDK",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|
|
37
|
+
"!dist/**/*.map",
|
|
37
38
|
"README.md"
|
|
38
39
|
],
|
|
39
40
|
"peerDependencies": {
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"react-dom": "^19.2.2",
|
|
61
62
|
"tsup": "^8.0.0",
|
|
62
63
|
"typescript": "^5.0.0",
|
|
63
|
-
"viem": "^2.
|
|
64
|
+
"viem": "^2.44.2",
|
|
64
65
|
"vite": "^6.0.0",
|
|
65
66
|
"vitest": "^2.1.0",
|
|
66
67
|
"wagmi": "^3.1.0"
|
|
@@ -86,18 +87,17 @@
|
|
|
86
87
|
"@gemini-wallet/core": "^0.3.2",
|
|
87
88
|
"@metamask/sdk": "~0.33.1",
|
|
88
89
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
89
|
-
"@reown/appkit": "^1.8.
|
|
90
|
-
"@reown/appkit-adapter-wagmi": "^1.8.
|
|
90
|
+
"@reown/appkit": "^1.8.17",
|
|
91
|
+
"@reown/appkit-adapter-wagmi": "^1.8.17",
|
|
91
92
|
"@sentry/browser": "^10.29.0",
|
|
92
93
|
"buffer": "^6.0.3",
|
|
93
94
|
"lucide-react": "^0.460.0",
|
|
94
95
|
"mobile-detect": "^1.4.5",
|
|
95
96
|
"porto": "^0.2.37",
|
|
96
97
|
"react-qrcode-logo": "^3.0.0",
|
|
97
|
-
"x402-fetch": "^0.7.0",
|
|
98
98
|
"zustand": "^5.0.9",
|
|
99
|
-
"@aurum-sdk/logos": "^0.2.3
|
|
100
|
-
"@aurum-sdk/types": "^0.2.3
|
|
99
|
+
"@aurum-sdk/logos": "^0.2.3",
|
|
100
|
+
"@aurum-sdk/types": "^0.2.3"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"build": "tsup",
|