@getpara/cli 2.15.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.
Files changed (331) hide show
  1. package/README.md +97 -0
  2. package/dist/api/client.d.ts +49 -0
  3. package/dist/api/client.d.ts.map +1 -0
  4. package/dist/api/client.js +247 -0
  5. package/dist/api/errors.d.ts +9 -0
  6. package/dist/api/errors.d.ts.map +1 -0
  7. package/dist/api/errors.js +29 -0
  8. package/dist/api/types.d.ts +155 -0
  9. package/dist/api/types.d.ts.map +1 -0
  10. package/dist/api/types.js +58 -0
  11. package/dist/auth/polling-flow.d.ts +7 -0
  12. package/dist/auth/polling-flow.d.ts.map +1 -0
  13. package/dist/auth/polling-flow.js +94 -0
  14. package/dist/auth/session-manager.d.ts +7 -0
  15. package/dist/auth/session-manager.d.ts.map +1 -0
  16. package/dist/auth/session-manager.js +42 -0
  17. package/dist/cli.d.ts +16 -0
  18. package/dist/cli.d.ts.map +1 -0
  19. package/dist/cli.js +151 -0
  20. package/dist/commands/auth/index.d.ts +3 -0
  21. package/dist/commands/auth/index.d.ts.map +1 -0
  22. package/dist/commands/auth/index.js +18 -0
  23. package/dist/commands/auth/login.d.ts +3 -0
  24. package/dist/commands/auth/login.d.ts.map +1 -0
  25. package/dist/commands/auth/login.js +70 -0
  26. package/dist/commands/auth/logout.d.ts +3 -0
  27. package/dist/commands/auth/logout.d.ts.map +1 -0
  28. package/dist/commands/auth/logout.js +45 -0
  29. package/dist/commands/auth/status.d.ts +3 -0
  30. package/dist/commands/auth/status.d.ts.map +1 -0
  31. package/dist/commands/auth/status.js +54 -0
  32. package/dist/commands/config.d.ts +3 -0
  33. package/dist/commands/config.d.ts.map +1 -0
  34. package/dist/commands/config.js +122 -0
  35. package/dist/commands/create.d.ts +3 -0
  36. package/dist/commands/create.d.ts.map +1 -0
  37. package/dist/commands/create.js +587 -0
  38. package/dist/commands/doctor.d.ts +3 -0
  39. package/dist/commands/doctor.d.ts.map +1 -0
  40. package/dist/commands/doctor.js +67 -0
  41. package/dist/commands/init.d.ts +3 -0
  42. package/dist/commands/init.d.ts.map +1 -0
  43. package/dist/commands/init.js +45 -0
  44. package/dist/commands/keys/archive.d.ts +3 -0
  45. package/dist/commands/keys/archive.d.ts.map +1 -0
  46. package/dist/commands/keys/archive.js +49 -0
  47. package/dist/commands/keys/config/branding.d.ts +23 -0
  48. package/dist/commands/keys/config/branding.d.ts.map +1 -0
  49. package/dist/commands/keys/config/branding.js +246 -0
  50. package/dist/commands/keys/config/categories.d.ts +15 -0
  51. package/dist/commands/keys/config/categories.d.ts.map +1 -0
  52. package/dist/commands/keys/config/categories.js +67 -0
  53. package/dist/commands/keys/config/index.d.ts +3 -0
  54. package/dist/commands/keys/config/index.d.ts.map +1 -0
  55. package/dist/commands/keys/config/index.js +56 -0
  56. package/dist/commands/keys/config/ramps.d.ts +18 -0
  57. package/dist/commands/keys/config/ramps.d.ts.map +1 -0
  58. package/dist/commands/keys/config/ramps.js +185 -0
  59. package/dist/commands/keys/config/security.d.ts +15 -0
  60. package/dist/commands/keys/config/security.d.ts.map +1 -0
  61. package/dist/commands/keys/config/security.js +212 -0
  62. package/dist/commands/keys/config/setup.d.ts +16 -0
  63. package/dist/commands/keys/config/setup.d.ts.map +1 -0
  64. package/dist/commands/keys/config/setup.js +235 -0
  65. package/dist/commands/keys/config/webhooks.d.ts +18 -0
  66. package/dist/commands/keys/config/webhooks.d.ts.map +1 -0
  67. package/dist/commands/keys/config/webhooks.js +279 -0
  68. package/dist/commands/keys/create.d.ts +3 -0
  69. package/dist/commands/keys/create.d.ts.map +1 -0
  70. package/dist/commands/keys/create.js +64 -0
  71. package/dist/commands/keys/get.d.ts +3 -0
  72. package/dist/commands/keys/get.d.ts.map +1 -0
  73. package/dist/commands/keys/get.js +91 -0
  74. package/dist/commands/keys/index.d.ts +3 -0
  75. package/dist/commands/keys/index.d.ts.map +1 -0
  76. package/dist/commands/keys/index.js +22 -0
  77. package/dist/commands/keys/list.d.ts +3 -0
  78. package/dist/commands/keys/list.d.ts.map +1 -0
  79. package/dist/commands/keys/list.js +66 -0
  80. package/dist/commands/keys/rotate.d.ts +3 -0
  81. package/dist/commands/keys/rotate.d.ts.map +1 -0
  82. package/dist/commands/keys/rotate.js +59 -0
  83. package/dist/commands/orgs/index.d.ts +3 -0
  84. package/dist/commands/orgs/index.d.ts.map +1 -0
  85. package/dist/commands/orgs/index.js +15 -0
  86. package/dist/commands/orgs/list.d.ts +3 -0
  87. package/dist/commands/orgs/list.d.ts.map +1 -0
  88. package/dist/commands/orgs/list.js +53 -0
  89. package/dist/commands/orgs/switch.d.ts +3 -0
  90. package/dist/commands/orgs/switch.d.ts.map +1 -0
  91. package/dist/commands/orgs/switch.js +61 -0
  92. package/dist/commands/projects/archive.d.ts +3 -0
  93. package/dist/commands/projects/archive.d.ts.map +1 -0
  94. package/dist/commands/projects/archive.js +51 -0
  95. package/dist/commands/projects/create.d.ts +3 -0
  96. package/dist/commands/projects/create.d.ts.map +1 -0
  97. package/dist/commands/projects/create.js +48 -0
  98. package/dist/commands/projects/index.d.ts +3 -0
  99. package/dist/commands/projects/index.d.ts.map +1 -0
  100. package/dist/commands/projects/index.js +25 -0
  101. package/dist/commands/projects/list.d.ts +3 -0
  102. package/dist/commands/projects/list.d.ts.map +1 -0
  103. package/dist/commands/projects/list.js +52 -0
  104. package/dist/commands/projects/restore.d.ts +3 -0
  105. package/dist/commands/projects/restore.d.ts.map +1 -0
  106. package/dist/commands/projects/restore.js +36 -0
  107. package/dist/commands/projects/switch.d.ts +3 -0
  108. package/dist/commands/projects/switch.d.ts.map +1 -0
  109. package/dist/commands/projects/switch.js +57 -0
  110. package/dist/commands/projects/update.d.ts +3 -0
  111. package/dist/commands/projects/update.d.ts.map +1 -0
  112. package/dist/commands/projects/update.js +67 -0
  113. package/dist/commands/whoami.d.ts +3 -0
  114. package/dist/commands/whoami.d.ts.map +1 -0
  115. package/dist/commands/whoami.js +61 -0
  116. package/dist/config/config-manager.d.ts +3 -0
  117. package/dist/config/config-manager.d.ts.map +1 -0
  118. package/dist/config/config-manager.js +32 -0
  119. package/dist/config/config-store.d.ts +10 -0
  120. package/dist/config/config-store.d.ts.map +1 -0
  121. package/dist/config/config-store.js +37 -0
  122. package/dist/config/credential-store.d.ts +12 -0
  123. package/dist/config/credential-store.d.ts.map +1 -0
  124. package/dist/config/credential-store.js +94 -0
  125. package/dist/config/paths.d.ts +5 -0
  126. package/dist/config/paths.d.ts.map +1 -0
  127. package/dist/config/paths.js +29 -0
  128. package/dist/config/project-config.d.ts +8 -0
  129. package/dist/config/project-config.d.ts.map +1 -0
  130. package/dist/config/project-config.js +41 -0
  131. package/dist/core/constants.d.ts +27 -0
  132. package/dist/core/constants.d.ts.map +1 -0
  133. package/dist/core/constants.js +60 -0
  134. package/dist/core/error-handler.d.ts +24 -0
  135. package/dist/core/error-handler.d.ts.map +1 -0
  136. package/dist/core/error-handler.js +83 -0
  137. package/dist/core/types.d.ts +21 -0
  138. package/dist/core/types.d.ts.map +1 -0
  139. package/dist/core/types.js +0 -0
  140. package/dist/core/update-check.d.ts +6 -0
  141. package/dist/core/update-check.d.ts.map +1 -0
  142. package/dist/core/update-check.js +78 -0
  143. package/dist/diagnostics/checks/chain-dependencies.d.ts +2 -0
  144. package/dist/diagnostics/checks/chain-dependencies.d.ts.map +1 -0
  145. package/dist/diagnostics/checks/chain-dependencies.js +130 -0
  146. package/dist/diagnostics/checks/css-import.d.ts +2 -0
  147. package/dist/diagnostics/checks/css-import.d.ts.map +1 -0
  148. package/dist/diagnostics/checks/css-import.js +57 -0
  149. package/dist/diagnostics/checks/deprecated-packages.d.ts +2 -0
  150. package/dist/diagnostics/checks/deprecated-packages.d.ts.map +1 -0
  151. package/dist/diagnostics/checks/deprecated-packages.js +93 -0
  152. package/dist/diagnostics/checks/env-api-key.d.ts +2 -0
  153. package/dist/diagnostics/checks/env-api-key.d.ts.map +1 -0
  154. package/dist/diagnostics/checks/env-api-key.js +75 -0
  155. package/dist/diagnostics/checks/env-var-prefix.d.ts +2 -0
  156. package/dist/diagnostics/checks/env-var-prefix.d.ts.map +1 -0
  157. package/dist/diagnostics/checks/env-var-prefix.js +52 -0
  158. package/dist/diagnostics/checks/index.d.ts +13 -0
  159. package/dist/diagnostics/checks/index.d.ts.map +1 -0
  160. package/dist/diagnostics/checks/index.js +32 -0
  161. package/dist/diagnostics/checks/para-provider.d.ts +2 -0
  162. package/dist/diagnostics/checks/para-provider.d.ts.map +1 -0
  163. package/dist/diagnostics/checks/para-provider.js +42 -0
  164. package/dist/diagnostics/checks/query-client.d.ts +2 -0
  165. package/dist/diagnostics/checks/query-client.d.ts.map +1 -0
  166. package/dist/diagnostics/checks/query-client.js +58 -0
  167. package/dist/diagnostics/checks/use-client-directive.d.ts +2 -0
  168. package/dist/diagnostics/checks/use-client-directive.d.ts.map +1 -0
  169. package/dist/diagnostics/checks/use-client-directive.js +81 -0
  170. package/dist/diagnostics/checks/version-consistency.d.ts +2 -0
  171. package/dist/diagnostics/checks/version-consistency.d.ts.map +1 -0
  172. package/dist/diagnostics/checks/version-consistency.js +93 -0
  173. package/dist/diagnostics/context.d.ts +3 -0
  174. package/dist/diagnostics/context.d.ts.map +1 -0
  175. package/dist/diagnostics/context.js +56 -0
  176. package/dist/diagnostics/detectors/framework.d.ts +5 -0
  177. package/dist/diagnostics/detectors/framework.d.ts.map +1 -0
  178. package/dist/diagnostics/detectors/framework.js +73 -0
  179. package/dist/diagnostics/detectors/package-manager.d.ts +3 -0
  180. package/dist/diagnostics/detectors/package-manager.d.ts.map +1 -0
  181. package/dist/diagnostics/detectors/package-manager.js +17 -0
  182. package/dist/diagnostics/detectors/sdk.d.ts +7 -0
  183. package/dist/diagnostics/detectors/sdk.d.ts.map +1 -0
  184. package/dist/diagnostics/detectors/sdk.js +48 -0
  185. package/dist/diagnostics/runner.d.ts +3 -0
  186. package/dist/diagnostics/runner.d.ts.map +1 -0
  187. package/dist/diagnostics/runner.js +44 -0
  188. package/dist/diagnostics/types.d.ts +70 -0
  189. package/dist/diagnostics/types.d.ts.map +1 -0
  190. package/dist/diagnostics/types.js +14 -0
  191. package/dist/diagnostics/utils/code-search.d.ts +10 -0
  192. package/dist/diagnostics/utils/code-search.d.ts.map +1 -0
  193. package/dist/diagnostics/utils/code-search.js +98 -0
  194. package/dist/diagnostics/utils/file-system.d.ts +7 -0
  195. package/dist/diagnostics/utils/file-system.d.ts.map +1 -0
  196. package/dist/diagnostics/utils/file-system.js +72 -0
  197. package/dist/diagnostics/utils/package-json.d.ts +12 -0
  198. package/dist/diagnostics/utils/package-json.d.ts.map +1 -0
  199. package/dist/diagnostics/utils/package-json.js +51 -0
  200. package/dist/index.d.ts +2 -0
  201. package/dist/index.d.ts.map +1 -0
  202. package/dist/index.js +20 -0
  203. package/dist/output/formatter.d.ts +25 -0
  204. package/dist/output/formatter.d.ts.map +1 -0
  205. package/dist/output/formatter.js +76 -0
  206. package/dist/output/mask.d.ts +2 -0
  207. package/dist/output/mask.d.ts.map +1 -0
  208. package/dist/output/mask.js +15 -0
  209. package/dist/output/prompts.d.ts +25 -0
  210. package/dist/output/prompts.d.ts.map +1 -0
  211. package/dist/output/prompts.js +86 -0
  212. package/dist/output/spinner.d.ts +6 -0
  213. package/dist/output/spinner.d.ts.map +1 -0
  214. package/dist/output/spinner.js +7 -0
  215. package/dist/output/table.d.ts +9 -0
  216. package/dist/output/table.d.ts.map +1 -0
  217. package/dist/output/table.js +21 -0
  218. package/dist/scaffolding/scaffolder.d.ts +3 -0
  219. package/dist/scaffolding/scaffolder.d.ts.map +1 -0
  220. package/dist/scaffolding/scaffolder.js +78 -0
  221. package/dist/scaffolding/strategies/expo-template.d.ts +16 -0
  222. package/dist/scaffolding/strategies/expo-template.d.ts.map +1 -0
  223. package/dist/scaffolding/strategies/expo-template.js +160 -0
  224. package/dist/scaffolding/strategies/index.d.ts +5 -0
  225. package/dist/scaffolding/strategies/index.d.ts.map +1 -0
  226. package/dist/scaffolding/strategies/index.js +25 -0
  227. package/dist/scaffolding/strategies/nextjs-template.d.ts +12 -0
  228. package/dist/scaffolding/strategies/nextjs-template.d.ts.map +1 -0
  229. package/dist/scaffolding/strategies/nextjs-template.js +122 -0
  230. package/dist/scaffolding/template-renderer.d.ts +11 -0
  231. package/dist/scaffolding/template-renderer.d.ts.map +1 -0
  232. package/dist/scaffolding/template-renderer.js +99 -0
  233. package/dist/scaffolding/types.d.ts +69 -0
  234. package/dist/scaffolding/types.d.ts.map +1 -0
  235. package/dist/scaffolding/types.js +21 -0
  236. package/dist/scaffolding/utils/detect-package-manager.d.ts +23 -0
  237. package/dist/scaffolding/utils/detect-package-manager.d.ts.map +1 -0
  238. package/dist/scaffolding/utils/detect-package-manager.js +57 -0
  239. package/dist/scaffolding/utils/fs.d.ts +11 -0
  240. package/dist/scaffolding/utils/fs.d.ts.map +1 -0
  241. package/dist/scaffolding/utils/fs.js +45 -0
  242. package/dist/scaffolding/utils/resolve-para-version.d.ts +7 -0
  243. package/dist/scaffolding/utils/resolve-para-version.d.ts.map +1 -0
  244. package/dist/scaffolding/utils/resolve-para-version.js +21 -0
  245. package/dist/validation/auth-methods.d.ts +14 -0
  246. package/dist/validation/auth-methods.d.ts.map +1 -0
  247. package/dist/validation/auth-methods.js +23 -0
  248. package/dist/validation/cidr.d.ts +11 -0
  249. package/dist/validation/cidr.d.ts.map +1 -0
  250. package/dist/validation/cidr.js +35 -0
  251. package/dist/validation/hex-color.d.ts +7 -0
  252. package/dist/validation/hex-color.d.ts.map +1 -0
  253. package/dist/validation/hex-color.js +10 -0
  254. package/dist/validation/index.d.ts +9 -0
  255. package/dist/validation/index.d.ts.map +1 -0
  256. package/dist/validation/index.js +49 -0
  257. package/dist/validation/native-passkey.d.ts +31 -0
  258. package/dist/validation/native-passkey.d.ts.map +1 -0
  259. package/dist/validation/native-passkey.js +45 -0
  260. package/dist/validation/session-length.d.ts +18 -0
  261. package/dist/validation/session-length.d.ts.map +1 -0
  262. package/dist/validation/session-length.js +30 -0
  263. package/dist/validation/url.d.ts +26 -0
  264. package/dist/validation/url.d.ts.map +1 -0
  265. package/dist/validation/url.js +50 -0
  266. package/dist/validation/wallet-types.d.ts +14 -0
  267. package/dist/validation/wallet-types.d.ts.map +1 -0
  268. package/dist/validation/wallet-types.js +22 -0
  269. package/dist/validation/webhook.d.ts +4 -0
  270. package/dist/validation/webhook.d.ts.map +1 -0
  271. package/dist/validation/webhook.js +33 -0
  272. package/package.json +60 -0
  273. package/templates/expo/_env.example +3 -0
  274. package/templates/expo/_gitignore +48 -0
  275. package/templates/expo/_yarnrc.yml +1 -0
  276. package/templates/expo/app/(auth)/_layout.tsx +12 -0
  277. package/templates/expo/app/(auth)/index.tsx.template +86 -0
  278. package/templates/expo/app/(tabs)/_layout.tsx +16 -0
  279. package/templates/expo/app/(tabs)/index.tsx +112 -0
  280. package/templates/expo/app/(tabs)/send.tsx +111 -0
  281. package/templates/expo/app/_layout.tsx +17 -0
  282. package/templates/expo/app/index.tsx +22 -0
  283. package/templates/expo/app.json.template +32 -0
  284. package/templates/expo/assets/adaptive-icon.png +0 -0
  285. package/templates/expo/assets/favicon.png +0 -0
  286. package/templates/expo/assets/icon.png +0 -0
  287. package/templates/expo/assets/splash.png +0 -0
  288. package/templates/expo/babel.config.cjs +12 -0
  289. package/templates/expo/components/features/AuthForm.tsx.template +138 -0
  290. package/templates/expo/components/features/OAuthButtons.tsx.template +27 -0
  291. package/templates/expo/components/features/index.ts.template +4 -0
  292. package/templates/expo/components/ui/Button.tsx +58 -0
  293. package/templates/expo/components/ui/Card.tsx +11 -0
  294. package/templates/expo/components/ui/Divider.tsx +19 -0
  295. package/templates/expo/components/ui/Input.tsx +23 -0
  296. package/templates/expo/components/ui/WalletCard.tsx +44 -0
  297. package/templates/expo/components/ui/index.ts +5 -0
  298. package/templates/expo/eslint.config.cjs +15 -0
  299. package/templates/expo/global.css +3 -0
  300. package/templates/expo/hooks/useOneClickLogin.ts.template +161 -0
  301. package/templates/expo/hooks/useViemClient.ts +118 -0
  302. package/templates/expo/hooks/useWallets.ts +52 -0
  303. package/templates/expo/index.js +2 -0
  304. package/templates/expo/lib/auth.ts +54 -0
  305. package/templates/expo/lib/constants.ts.template +2 -0
  306. package/templates/expo/lib/para.ts +14 -0
  307. package/templates/expo/metro.config.cjs +14 -0
  308. package/templates/expo/nativewind-env.d.ts +2 -0
  309. package/templates/expo/prettier.config.cjs +10 -0
  310. package/templates/expo/providers/ParaProvider.tsx +140 -0
  311. package/templates/expo/tailwind.config.cjs +23 -0
  312. package/templates/expo/tsconfig.json +11 -0
  313. package/templates/expo/types/index.ts +28 -0
  314. package/templates/nextjs/README.md +69 -0
  315. package/templates/nextjs/_env.example +8 -0
  316. package/templates/nextjs/_gitignore +36 -0
  317. package/templates/nextjs/_yarnrc.yml +1 -0
  318. package/templates/nextjs/eslint.config.mjs +10 -0
  319. package/templates/nextjs/next.config.ts +5 -0
  320. package/templates/nextjs/postcss.config.mjs +7 -0
  321. package/templates/nextjs/public/para.svg +3 -0
  322. package/templates/nextjs/src/app/layout.tsx +30 -0
  323. package/templates/nextjs/src/app/page.tsx +40 -0
  324. package/templates/nextjs/src/components/ParaProvider.tsx +116 -0
  325. package/templates/nextjs/src/components/layout/Header.tsx +44 -0
  326. package/templates/nextjs/src/components/ui/ConnectCard.tsx +24 -0
  327. package/templates/nextjs/src/components/ui/SignMessage.tsx +53 -0
  328. package/templates/nextjs/src/components/ui/WalletInfo.tsx +22 -0
  329. package/templates/nextjs/src/hooks/useSignHelloWorld.ts +23 -0
  330. package/templates/nextjs/src/styles/globals.css +1 -0
  331. package/templates/nextjs/tsconfig.json +27 -0
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@getpara/cli",
3
+ "version": "2.15.0",
4
+ "description": "Unified CLI for Para SDK - project scaffolding, diagnostics, and API key management",
5
+ "type": "module",
6
+ "bin": {
7
+ "para": "./dist/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "files": [
11
+ "dist",
12
+ "templates"
13
+ ],
14
+ "scripts": {
15
+ "build": "rm -rf dist && node ./scripts/build.mjs && yarn typegen",
16
+ "typegen": "tsc --emitDeclarationOnly",
17
+ "dev": "tsc --watch",
18
+ "typecheck": "tsc --noEmit",
19
+ "test": "vitest run",
20
+ "test:watch": "vitest",
21
+ "prepublishOnly": "yarn build"
22
+ },
23
+ "dependencies": {
24
+ "@clack/prompts": "^0.9.1",
25
+ "@getpara/shared": "^1.11.0",
26
+ "commander": "^12.0.0",
27
+ "glob": "^11.0.1",
28
+ "ignore": "^6.0.2",
29
+ "open": "^10.0.0",
30
+ "picocolors": "^1.1.1"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^22.13.10",
34
+ "esbuild": "0.24.0",
35
+ "typescript": "^5.8.3",
36
+ "vitest": "^3.0.9"
37
+ },
38
+ "engines": {
39
+ "node": ">=18.0.0"
40
+ },
41
+ "keywords": [
42
+ "para",
43
+ "cli",
44
+ "scaffolding",
45
+ "diagnostics",
46
+ "api-keys",
47
+ "web3",
48
+ "wallet"
49
+ ],
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/getpara/web-sdk.git",
53
+ "directory": "packages/cli"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "license": "MIT",
59
+ "gitHead": "9cecc178e975a44d8ed4b03f46aeb57ddcb7a152"
60
+ }
@@ -0,0 +1,3 @@
1
+ # Para API Key
2
+ # Get your API key at https://developer.getpara.com
3
+ EXPO_PUBLIC_PARA_API_KEY=your_api_key_here
@@ -0,0 +1,48 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Expo
5
+ .expo/
6
+ dist/
7
+ web-build/
8
+
9
+ # Native builds
10
+ *.orig.*
11
+ *.jks
12
+ *.p8
13
+ *.p12
14
+ *.key
15
+ *.mobileprovision
16
+
17
+ # iOS
18
+ ios/
19
+ *.xcworkspace
20
+ *.xcodeproj
21
+
22
+ # Android
23
+ android/
24
+ *.apk
25
+ *.aab
26
+
27
+ # Environment
28
+ .env
29
+ .env.local
30
+ .env.*.local
31
+
32
+ # IDE
33
+ .idea/
34
+ .vscode/
35
+ *.swp
36
+ *.swo
37
+
38
+ # OS
39
+ .DS_Store
40
+ Thumbs.db
41
+
42
+ # Logs
43
+ npm-debug.log*
44
+ yarn-debug.log*
45
+ yarn-error.log*
46
+
47
+ # TypeScript
48
+ *.tsbuildinfo
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -0,0 +1,12 @@
1
+ import { Stack } from 'expo-router';
2
+
3
+ export default function AuthLayout() {
4
+ return (
5
+ <Stack
6
+ screenOptions={{
7
+ headerShown: false,
8
+ contentStyle: { backgroundColor: '#fff' },
9
+ }}
10
+ />
11
+ );
12
+ }
@@ -0,0 +1,86 @@
1
+ import { View, Text, ScrollView, KeyboardAvoidingView, Platform } from 'react-native';
2
+ import { SafeAreaView } from 'react-native-safe-area-context';
3
+ import { Ionicons } from '@expo/vector-icons';
4
+ import { useRouter } from 'expo-router';
5
+
6
+ // @if:hasOAuth
7
+ import { Divider } from '@/components/ui';
8
+ // @endif
9
+ import { AuthForm } from '@/components/features';
10
+ // @if:hasOAuth
11
+ import { OAuthButtons } from '@/components/features';
12
+ // @endif
13
+ import { useOneClickLogin } from '@/hooks/useOneClickLogin';
14
+ import { usePara } from '@/providers/ParaProvider';
15
+
16
+ export default function LoginScreen() {
17
+ const router = useRouter();
18
+ const { setAuthenticated } = usePara();
19
+
20
+ const handleSuccess = () => {
21
+ setAuthenticated(true);
22
+ router.replace('/(tabs)');
23
+ };
24
+
25
+ const {
26
+ // @if:hasEmail
27
+ loginWithEmail,
28
+ // @endif
29
+ // @if:hasPhone
30
+ loginWithPhone,
31
+ // @endif
32
+ // @if:hasOAuth
33
+ loginWithGoogle,
34
+ // @endif
35
+ status,
36
+ error,
37
+ } = useOneClickLogin(handleSuccess);
38
+
39
+ const isLoading = status === 'loading' || status === 'verifying' || status === 'completing';
40
+
41
+ const handleAuthSubmit = async (value: string, method: 'email' | 'phone') => {
42
+ // @if:hasEmail
43
+ if (method === 'email') {
44
+ await loginWithEmail(value);
45
+ }
46
+ // @endif
47
+ // @if:hasPhone
48
+ if (method === 'phone') {
49
+ await loginWithPhone(value);
50
+ }
51
+ // @endif
52
+ };
53
+
54
+ return (
55
+ <SafeAreaView className="flex-1 bg-white">
56
+ <KeyboardAvoidingView
57
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
58
+ className="flex-1">
59
+ <ScrollView
60
+ contentContainerStyle={{ flexGrow: 1 }}
61
+ keyboardShouldPersistTaps="handled"
62
+ className="flex-1">
63
+ <View className="flex-1 px-6 pb-8 pt-12">
64
+ <View className="mb-10 items-center">
65
+ <View className="mb-4 h-16 w-16 items-center justify-center rounded-2xl bg-gray-900">
66
+ <Ionicons name="wallet-outline" size={32} color="#fff" />
67
+ </View>
68
+ <Text className="mb-2 text-2xl font-bold text-gray-900">{{expoAppName}}</Text>
69
+ <Text className="text-center text-gray-500">Sign in to access your wallet</Text>
70
+ </View>
71
+ <AuthForm onSubmit={handleAuthSubmit} loading={isLoading} error={error} />
72
+ // @if:hasOAuth
73
+ <Divider text="or continue with" />
74
+ <OAuthButtons onGooglePress={loginWithGoogle} disabled={isLoading} />
75
+ // @endif
76
+ </View>
77
+ <View className="px-6 pb-4">
78
+ <Text className="text-center text-xs text-gray-400">
79
+ By continuing, you agree to our Terms of Service and Privacy Policy
80
+ </Text>
81
+ </View>
82
+ </ScrollView>
83
+ </KeyboardAvoidingView>
84
+ </SafeAreaView>
85
+ );
86
+ }
@@ -0,0 +1,16 @@
1
+ import { Stack } from 'expo-router';
2
+
3
+ export default function TabsLayout() {
4
+ return (
5
+ <Stack>
6
+ <Stack.Screen name="index" options={{ headerShown: false }} />
7
+ <Stack.Screen
8
+ name="send"
9
+ options={{
10
+ title: 'Send',
11
+ headerBackTitle: 'Back',
12
+ }}
13
+ />
14
+ </Stack>
15
+ );
16
+ }
@@ -0,0 +1,112 @@
1
+ import { View, Text, ScrollView, RefreshControl, Alert } from 'react-native';
2
+ import { SafeAreaView } from 'react-native-safe-area-context';
3
+ import { Ionicons } from '@expo/vector-icons';
4
+ import { useRouter } from 'expo-router';
5
+ import { useState, useCallback, useEffect } from 'react';
6
+
7
+ import { WalletCard, Button } from '@/components/ui';
8
+ import { usePara } from '@/providers/ParaProvider';
9
+ import { useViemClient } from '@/hooks/useViemClient';
10
+
11
+ export default function HomeScreen() {
12
+ const router = useRouter();
13
+ const { wallets, refreshAuth, logout } = usePara();
14
+ const { isReady, getBalance } = useViemClient();
15
+ const [refreshing, setRefreshing] = useState(false);
16
+ const [balance, setBalance] = useState<string | null>(null);
17
+
18
+ const fetchBalance = useCallback(async () => {
19
+ if (isReady) {
20
+ const bal = await getBalance();
21
+ setBalance(bal);
22
+ }
23
+ }, [isReady, getBalance]);
24
+
25
+ useEffect(() => {
26
+ fetchBalance();
27
+ }, [fetchBalance]);
28
+
29
+ const onRefresh = useCallback(async () => {
30
+ setRefreshing(true);
31
+ await refreshAuth();
32
+ await fetchBalance();
33
+ setRefreshing(false);
34
+ }, [refreshAuth, fetchBalance]);
35
+
36
+ const handleLogout = () => {
37
+ Alert.alert('Sign Out', 'Are you sure you want to sign out?', [
38
+ { text: 'Cancel', style: 'cancel' },
39
+ {
40
+ text: 'Sign Out',
41
+ style: 'destructive',
42
+ onPress: async () => {
43
+ await logout();
44
+ router.replace('/(auth)');
45
+ },
46
+ },
47
+ ]);
48
+ };
49
+
50
+ const handleSend = () => {
51
+ router.push('/(tabs)/send');
52
+ };
53
+
54
+ const primaryWallet = wallets[0];
55
+ const displayBalance = balance ? `${parseFloat(balance).toFixed(6)} ETH` : 'Loading...';
56
+
57
+ return (
58
+ <SafeAreaView testID="walletsView" className="flex-1 bg-gray-50">
59
+ <ScrollView
60
+ className="flex-1"
61
+ contentContainerStyle={{ padding: 24 }}
62
+ refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}>
63
+ <View className="mb-6">
64
+ <Text className="text-2xl font-bold text-gray-900">Your Wallet</Text>
65
+ <Text className="mt-1 text-gray-500">Manage your assets</Text>
66
+ </View>
67
+ {primaryWallet ? (
68
+ <WalletCard
69
+ address={primaryWallet.address}
70
+ balance={displayBalance}
71
+ network="Sepolia"
72
+ onSend={handleSend}
73
+ />
74
+ ) : (
75
+ <View className="items-center rounded-2xl bg-white p-6">
76
+ <Text className="text-center text-gray-500">No wallet found. Pull to refresh.</Text>
77
+ </View>
78
+ )}
79
+ {wallets.length > 1 && (
80
+ <View className="mt-6">
81
+ <Text className="mb-3 text-lg font-semibold text-gray-900">Other Wallets</Text>
82
+ {wallets.slice(1).map((wallet) => (
83
+ <View
84
+ key={wallet.id}
85
+ className="mb-2 flex-row items-center justify-between rounded-xl bg-white p-4">
86
+ <Text className="font-mono text-sm text-gray-600">
87
+ {wallet.address.slice(0, 10)}...{wallet.address.slice(-8)}
88
+ </Text>
89
+ <View className="rounded bg-gray-100 px-2 py-1">
90
+ <Text className="text-xs text-gray-600">{wallet.type}</Text>
91
+ </View>
92
+ </View>
93
+ ))}
94
+ </View>
95
+ )}
96
+
97
+ <View className="mt-8">
98
+ <Button
99
+ title="Sign Out"
100
+ variant="danger"
101
+ onPress={handleLogout}
102
+ icon={<Ionicons name="log-out-outline" size={20} color="#fff" />}
103
+ />
104
+ </View>
105
+
106
+ <View className="mt-8 items-center">
107
+ <Text className="text-sm text-gray-400">Powered by Para</Text>
108
+ </View>
109
+ </ScrollView>
110
+ </SafeAreaView>
111
+ );
112
+ }
@@ -0,0 +1,111 @@
1
+ import { View, Text, TextInput, Alert, KeyboardAvoidingView, Platform } from 'react-native';
2
+ import { SafeAreaView } from 'react-native-safe-area-context';
3
+ import { Ionicons } from '@expo/vector-icons';
4
+ import { useRouter } from 'expo-router';
5
+ import { useState, useCallback, useEffect } from 'react';
6
+ import type { Hex } from 'viem';
7
+
8
+ import { Button } from '@/components/ui';
9
+ import { useViemClient } from '@/hooks/useViemClient';
10
+
11
+ export default function SendScreen() {
12
+ const router = useRouter();
13
+ const { isReady, getBalance, sendTransaction, isLoading, error } = useViemClient();
14
+
15
+ const [balance, setBalance] = useState<string | null>(null);
16
+ const [recipient, setRecipient] = useState('');
17
+ const [amount, setAmount] = useState('');
18
+
19
+ const fetchBalance = useCallback(async () => {
20
+ if (isReady) {
21
+ const bal = await getBalance();
22
+ setBalance(bal);
23
+ }
24
+ }, [isReady, getBalance]);
25
+
26
+ useEffect(() => {
27
+ fetchBalance();
28
+ }, [fetchBalance]);
29
+
30
+ const handleSend = async () => {
31
+ if (!recipient) {
32
+ Alert.alert('Error', 'Please enter a recipient address');
33
+ return;
34
+ }
35
+ if (!amount || parseFloat(amount) <= 0) {
36
+ Alert.alert('Error', 'Please enter a valid amount');
37
+ return;
38
+ }
39
+
40
+ Alert.alert(
41
+ 'Confirm Transaction',
42
+ `Send ${amount} ETH to\n${recipient.slice(0, 16)}...?`,
43
+ [
44
+ { text: 'Cancel', style: 'cancel' },
45
+ {
46
+ text: 'Send',
47
+ onPress: async () => {
48
+ const hash = await sendTransaction(recipient as Hex, amount);
49
+ if (hash) {
50
+ Alert.alert('Success', `Transaction sent!\n\nHash: ${hash.slice(0, 20)}...`, [
51
+ { text: 'OK', onPress: () => router.back() },
52
+ ]);
53
+ } else if (error) {
54
+ Alert.alert('Error', error);
55
+ }
56
+ },
57
+ },
58
+ ]
59
+ );
60
+ };
61
+
62
+ const displayBalance = balance ? `${parseFloat(balance).toFixed(6)} ETH` : 'Loading...';
63
+
64
+ return (
65
+ <SafeAreaView className="flex-1 bg-gray-50" edges={['bottom']}>
66
+ <KeyboardAvoidingView
67
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
68
+ className="flex-1">
69
+ <View className="flex-1 p-6">
70
+ {/* Balance Display */}
71
+ <View className="mb-6 rounded-2xl bg-white p-4">
72
+ <Text className="text-sm text-gray-500">Available Balance</Text>
73
+ <Text className="text-2xl font-bold text-gray-900">{displayBalance}</Text>
74
+ </View>
75
+
76
+ {/* Form */}
77
+ <View className="flex-1">
78
+ <Text className="mb-2 text-sm font-medium text-gray-700">Recipient Address</Text>
79
+ <TextInput
80
+ className="mb-4 rounded-xl border border-gray-200 bg-white p-4 font-mono text-sm text-gray-900"
81
+ placeholder="0x..."
82
+ placeholderTextColor="#9ca3af"
83
+ value={recipient}
84
+ onChangeText={setRecipient}
85
+ autoCapitalize="none"
86
+ autoCorrect={false}
87
+ />
88
+
89
+ <Text className="mb-2 text-sm font-medium text-gray-700">Amount (ETH)</Text>
90
+ <TextInput
91
+ className="mb-6 rounded-xl border border-gray-200 bg-white p-4 text-sm text-gray-900"
92
+ placeholder="0.001"
93
+ placeholderTextColor="#9ca3af"
94
+ value={amount}
95
+ onChangeText={setAmount}
96
+ keyboardType="decimal-pad"
97
+ />
98
+ </View>
99
+
100
+ {/* Send Button */}
101
+ <Button
102
+ title={isLoading ? 'Sending...' : 'Send ETH'}
103
+ onPress={handleSend}
104
+ disabled={isLoading || !isReady}
105
+ icon={<Ionicons name="send-outline" size={20} color="#fff" />}
106
+ />
107
+ </View>
108
+ </KeyboardAvoidingView>
109
+ </SafeAreaView>
110
+ );
111
+ }
@@ -0,0 +1,17 @@
1
+ import '../global.css';
2
+
3
+ import { Stack } from 'expo-router';
4
+ import { StatusBar } from 'expo-status-bar';
5
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
6
+ import { ParaProvider } from '@/providers/ParaProvider';
7
+
8
+ export default function RootLayout() {
9
+ return (
10
+ <SafeAreaProvider>
11
+ <ParaProvider>
12
+ <StatusBar style="auto" />
13
+ <Stack screenOptions={{ headerShown: false }} />
14
+ </ParaProvider>
15
+ </SafeAreaProvider>
16
+ );
17
+ }
@@ -0,0 +1,22 @@
1
+ import { Redirect } from 'expo-router';
2
+ import { View, ActivityIndicator, Text } from 'react-native';
3
+ import { usePara } from '@/providers/ParaProvider';
4
+
5
+ export default function Index() {
6
+ const { isAuthenticated, isLoading } = usePara();
7
+
8
+ if (isLoading) {
9
+ return (
10
+ <View className="flex-1 items-center justify-center bg-white">
11
+ <ActivityIndicator size="large" color="#4F46E5" />
12
+ <Text className="mt-4 text-gray-500">Loading...</Text>
13
+ </View>
14
+ );
15
+ }
16
+
17
+ if (isAuthenticated) {
18
+ return <Redirect href="/(tabs)" />;
19
+ }
20
+
21
+ return <Redirect href="/(auth)" />;
22
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "expo": {
3
+ "name": "{{expoAppName}}",
4
+ "slug": "{{expoSlug}}",
5
+ "version": "1.0.0",
6
+ "scheme": "{{expoScheme}}",
7
+ "platforms": ["ios", "android"],
8
+ "orientation": "portrait",
9
+ "icon": "./assets/icon.png",
10
+ "userInterfaceStyle": "automatic",
11
+ "splash": {
12
+ "image": "./assets/splash.png",
13
+ "resizeMode": "contain",
14
+ "backgroundColor": "#ffffff"
15
+ },
16
+ "ios": {
17
+ "supportsTablet": true,
18
+ "bundleIdentifier": "{{bundleId}}"
19
+ },
20
+ "android": {
21
+ "package": "{{bundleId}}",
22
+ "adaptiveIcon": {
23
+ "foregroundImage": "./assets/adaptive-icon.png",
24
+ "backgroundColor": "#ffffff"
25
+ }
26
+ },
27
+ "plugins": ["expo-router"],
28
+ "experiments": {
29
+ "typedRoutes": true
30
+ }
31
+ }
32
+ }
Binary file
Binary file
@@ -0,0 +1,12 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ let plugins = [];
4
+
5
+ plugins.push('react-native-worklets/plugin');
6
+
7
+ return {
8
+ presets: [['babel-preset-expo', { jsxImportSource: 'nativewind' }], 'nativewind/babel'],
9
+
10
+ plugins,
11
+ };
12
+ };