create-solana-mobile-app 1.1.1 → 1.2.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/README.md CHANGED
@@ -68,27 +68,6 @@ Run the CLI directly from source:
68
68
  node index.js my-app --wallet-ui
69
69
  ```
70
70
 
71
- ## Publish to npm
72
-
73
- 1. Update `package.json` version.
74
- 2. Login to npm:
75
-
76
- ```bash
77
- npm login
78
- ```
79
-
80
- 3. Check package contents:
81
-
82
- ```bash
83
- npm pack --dry-run
84
- ```
85
-
86
- 4. Publish:
87
-
88
- ```bash
89
- npm publish --access public
90
- ```
91
-
92
71
  ## Troubleshooting
93
72
 
94
73
  ### "Wallet connected, but no valid base58 account address was returned"
package/package.json CHANGED
@@ -1,22 +1,32 @@
1
1
  {
2
2
  "name": "create-solana-mobile-app",
3
- "version": "1.1.1",
4
- "description": "",
3
+ "version": "1.2.1",
4
+ "description": "Scaffold Expo + Solana Mobile starter apps with Mobile Wallet Adapter support",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "create-solana-mobile-app": "index.js"
7
+ "create-solana-mobile-app": "./index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
11
11
  },
12
- "keywords": [],
12
+ "files": [
13
+ "index.js",
14
+ "template/"
15
+ ],
16
+ "keywords": [
17
+ "solana",
18
+ "solana-mobile",
19
+ "expo",
20
+ "react-native",
21
+ "mobile-wallet-adapter",
22
+ "create-app"
23
+ ],
13
24
  "author": "",
14
25
  "license": "ISC",
15
26
  "type": "commonjs",
16
27
  "dependencies": {
17
28
  "chalk": "^5.6.2",
18
29
  "execa": "^9.6.1",
19
- "expo": "^55.0.8",
20
30
  "fs-extra": "^11.3.4",
21
31
  "ora": "^9.3.0"
22
32
  }
@@ -11,3 +11,72 @@ declare module "@solana/kit" {
11
11
  decode(bytes: Uint8Array, offset?: number): string;
12
12
  };
13
13
  }
14
+
15
+ declare module "@solana-mobile/mobile-wallet-adapter-protocol-web3js" {
16
+ type WalletAccount = Record<string, unknown>;
17
+
18
+ type AuthorizeResult = {
19
+ accounts?: WalletAccount[];
20
+ };
21
+
22
+ type MobileWallet = {
23
+ authorize(params: {
24
+ chain?: string;
25
+ identity: {
26
+ name?: string;
27
+ uri?: string;
28
+ icon?: string;
29
+ };
30
+ }): Promise<AuthorizeResult>;
31
+ };
32
+
33
+ export function transact<T>(
34
+ callback: (mobileWallet: MobileWallet) => Promise<T>,
35
+ ): Promise<T>;
36
+ }
37
+
38
+ declare module "react" {
39
+ export type ReactNode = unknown;
40
+ export type SetStateAction<S> = S | ((prevState: S) => S);
41
+ export type Dispatch<A> = (value: A) => void;
42
+
43
+ export interface ProviderProps<T> {
44
+ value: T;
45
+ children?: ReactNode;
46
+ }
47
+
48
+ export interface Provider<T> {
49
+ (props: ProviderProps<T>): unknown;
50
+ }
51
+
52
+ export interface Context<T> {
53
+ Provider: Provider<T>;
54
+ }
55
+
56
+ export function createContext<T>(defaultValue: T): Context<T>;
57
+ export function useMemo<T>(factory: () => T, deps: readonly unknown[]): T;
58
+ export function useState<S>(
59
+ initialState: S,
60
+ ): [S, Dispatch<SetStateAction<S>>];
61
+
62
+ const React: {
63
+ createContext: typeof createContext;
64
+ useMemo: typeof useMemo;
65
+ useState: typeof useState;
66
+ };
67
+
68
+ export default React;
69
+ }
70
+
71
+ declare module "react/jsx-runtime" {
72
+ export namespace JSX {
73
+ type Element = unknown;
74
+ interface IntrinsicElements {
75
+ [elemName: string]: unknown;
76
+ }
77
+ }
78
+
79
+ export const Fragment: unique symbol;
80
+ export function jsx(type: unknown, props: unknown, key?: unknown): unknown;
81
+ export function jsxs(type: unknown, props: unknown, key?: unknown): unknown;
82
+ }