@moon-x/react-native-sdk 0.12.0 → 0.13.0

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.
@@ -0,0 +1,23 @@
1
+ import { PublicWallet } from '@moon-x/core/types';
2
+
3
+ type ExportKeyResult = {
4
+ status: "completed";
5
+ } | {
6
+ status: "cancelled";
7
+ } | {
8
+ status: "failed";
9
+ error: string;
10
+ };
11
+ /**
12
+ * Trigger the export-key flow. The plaintext private key never leaves
13
+ * the WebView's DOM — the iframe-app's `/export-key` route renders the
14
+ * UI inside the WebView, which is presented full-screen during the
15
+ * flow. The RN-side promise resolves when the user dismisses the modal and
16
+ * reports whether the key was displayed, the flow was cancelled, or export
17
+ * failed.
18
+ */
19
+ declare const useExportKey: () => {
20
+ exportKey: (wallet: PublicWallet) => Promise<ExportKeyResult>;
21
+ };
22
+
23
+ export { type ExportKeyResult as E, useExportKey as u };
@@ -0,0 +1,23 @@
1
+ import { PublicWallet } from '@moon-x/core/types';
2
+
3
+ type ExportKeyResult = {
4
+ status: "completed";
5
+ } | {
6
+ status: "cancelled";
7
+ } | {
8
+ status: "failed";
9
+ error: string;
10
+ };
11
+ /**
12
+ * Trigger the export-key flow. The plaintext private key never leaves
13
+ * the WebView's DOM — the iframe-app's `/export-key` route renders the
14
+ * UI inside the WebView, which is presented full-screen during the
15
+ * flow. The RN-side promise resolves when the user dismisses the modal and
16
+ * reports whether the key was displayed, the flow was cancelled, or export
17
+ * failed.
18
+ */
19
+ declare const useExportKey: () => {
20
+ exportKey: (wallet: PublicWallet) => Promise<ExportKeyResult>;
21
+ };
22
+
23
+ export { type ExportKeyResult as E, useExportKey as u };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moon-x/react-native-sdk",
3
- "version": "0.12.0",
4
- "description": "MoonX React Native SDK — WebView-backed transport, react-native-passkeys, AsyncStorage. Mobile parity with @moon-x/react-sdk + @moon-x/core-sdk.",
3
+ "version": "0.13.0",
4
+ "description": "Headless MoonX React Native SDK with WebView-backed transport, native passkeys, and app-owned UI.",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -22,6 +22,11 @@
22
22
  "import": "./dist/solana.mjs",
23
23
  "require": "./dist/solana.js"
24
24
  },
25
+ "./tron": {
26
+ "types": "./dist/tron.d.ts",
27
+ "import": "./dist/tron.mjs",
28
+ "require": "./dist/tron.js"
29
+ },
25
30
  "./app.plugin.js": "./app.plugin.js",
26
31
  "./plugin": "./plugin/index.js",
27
32
  "./plugin/index.js": "./plugin/index.js",
@@ -46,10 +51,11 @@
46
51
  "react-native-passkeys": "0.3.3",
47
52
  "react-native-webview": "13.16.0",
48
53
  "tsup": "8.5.1",
49
- "typescript": "5.9.3"
54
+ "typescript": "5.9.3",
55
+ "vitest": "4.1.0"
50
56
  },
51
57
  "dependencies": {
52
- "@moon-x/core": "0.14.0"
58
+ "@moon-x/core": "0.15.0"
53
59
  },
54
60
  "peerDependencies": {
55
61
  "@expo/config-plugins": ">=10.0.0",
@@ -80,6 +86,8 @@
80
86
  "scripts": {
81
87
  "build": "tsup",
82
88
  "dev": "tsup --watch",
89
+ "test": "vitest run",
90
+ "test:watch": "vitest",
83
91
  "type-check": "tsc --noEmit",
84
92
  "clean": "rm -rf dist .turbo node_modules"
85
93
  }