wallaby-cash 2.3.0-alpha.2 → 2.3.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 (37) hide show
  1. package/README.md +69 -0
  2. package/dist/generated/api.d.ts +1369 -2674
  3. package/dist/helpers/base64.base.d.ts +12 -0
  4. package/dist/helpers/base64.d.ts +6 -0
  5. package/dist/helpers/base64.native.d.ts +6 -0
  6. package/dist/helpers/normalize-storage-keys.d.ts +8 -0
  7. package/dist/index.cjs.js +861 -543
  8. package/dist/index.cjs.js.map +1 -1
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.esm.js +861 -543
  11. package/dist/index.esm.js.map +1 -1
  12. package/dist/index.js +1022 -595
  13. package/dist/index.js.map +1 -1
  14. package/dist/lib/auth/auth.service.d.ts +1 -1
  15. package/dist/lib/auth/authenticator.d.ts +3 -3
  16. package/dist/lib/auth/authenticator.native.d.ts +36 -0
  17. package/dist/lib/auth/passkey.model.d.ts +10 -3
  18. package/dist/lib/auth/passkey.service.base.d.ts +76 -0
  19. package/dist/lib/auth/passkey.service.d.ts +1 -76
  20. package/dist/lib/auth/passkey.service.native.d.ts +4 -0
  21. package/dist/lib/index.d.ts +1 -0
  22. package/dist/lib/swap/index.d.ts +36 -0
  23. package/dist/lib/system/index.d.ts +14 -4
  24. package/dist/lib/transactions/index.d.ts +4 -2
  25. package/dist/lib/utils/constants.d.ts +1 -1
  26. package/dist/lib/wallet/wallet-data.service.d.ts +5 -3
  27. package/dist/package.json +22 -12
  28. package/dist/routes/index.d.ts +1 -0
  29. package/dist/routes/swap.d.ts +24 -0
  30. package/dist/types/auth.d.ts +152 -4
  31. package/dist/types/common.d.ts +3 -0
  32. package/dist/types/error-response-codes.d.ts +1 -0
  33. package/dist/types/index.d.ts +1 -0
  34. package/dist/types/swap.d.ts +95 -0
  35. package/dist/types/transactions.d.ts +1 -0
  36. package/dist/types/wallet.d.ts +2 -4
  37. package/package.json +22 -12
package/README.md CHANGED
@@ -32,6 +32,75 @@ The SDK currently supports the following blockchains:
32
32
  npm install wallaby-cash@latest
33
33
  ```
34
34
 
35
+ ## React Native migration plan (updated for v2.2.7)
36
+
37
+ This plan reflects the current SDK package layout and native passkey support.
38
+
39
+ ### 1) Upgrade the SDK
40
+
41
+ - Use `wallaby-cash@latest` (or your pinned `file:`/git tag) so Metro can resolve the `react-native` entrypoint.
42
+ - If you are rolling out gradually, keep the old version in a feature-flagged branch and verify passkey flows before flipping users.
43
+
44
+ ### 2) Provide a secure storage adapter
45
+
46
+ React Native must supply a storage implementation (async is supported). Any adapter that implements
47
+ `getItem`/`setItem`/`removeItem` or their `*Async` equivalents will work.
48
+
49
+ ```javascript
50
+ import * as Keychain from 'react-native-keychain';
51
+ import { Wallaby } from 'wallaby-cash';
52
+
53
+ const storageAdapter = {
54
+ async getItem(key) {
55
+ const result = await Keychain.getGenericPassword({ service: key });
56
+ return result ? result.password : null;
57
+ },
58
+ async setItem(key, value) {
59
+ await Keychain.setGenericPassword('wallaby', value, { service: key });
60
+ },
61
+ async removeItem(key) {
62
+ await Keychain.resetGenericPassword({ service: key });
63
+ },
64
+ };
65
+ ```
66
+
67
+ ### 3) Configure the passkey RP ID
68
+
69
+ Passkeys require a stable RP ID. Provide `hostname` in the SDK options and align it with your
70
+ Associated Domains (iOS) and Asset Links (Android) configuration.
71
+
72
+ ```javascript
73
+ const wallaby = new Wallaby({
74
+ apiKey,
75
+ baseUrl,
76
+ clientAuthToken,
77
+ userId,
78
+ options: {
79
+ storage: storageAdapter,
80
+ hostname: 'your-domain.com',
81
+ },
82
+ });
83
+ ```
84
+
85
+ ### 4) Validate native passkey support
86
+
87
+ The SDK uses `react-native-passkey` under the hood and will throw if the device does not support
88
+ passkeys. Make sure your UI gracefully handles these errors and provides an alternative path.
89
+
90
+ ### 5) Verify PRF support and passkey flows
91
+
92
+ The native authenticator expects PRF data (`extensions.prf.eval.first`) in the passkey options.
93
+ Confirm your backend sends PRF extensions and validate:
94
+
95
+ - `auth.isDevicePrfCompatible()`
96
+ - `auth.signUp()` / `auth.signIn()`
97
+ - `auth.getPasskeyCredentials()`
98
+
99
+ ### 6) Rollout + migration checks
100
+
101
+ The SDK already migrates legacy storage keys to v2 formats. Avoid clearing storage during rollout
102
+ and validate behavior on existing users before enabling passkeys for all accounts.
103
+
35
104
  ## Client Initialization
36
105
 
37
106
  After installing the library, you can then import and use the SDK.