react-native-fpay 0.1.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.
Files changed (167) hide show
  1. package/Fpay.podspec +20 -0
  2. package/LICENSE +20 -0
  3. package/README.md +37 -0
  4. package/android/build.gradle +67 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/com/fpay/FpayModule.kt +15 -0
  7. package/android/src/main/java/com/fpay/FpayPackage.kt +31 -0
  8. package/ios/Fpay.h +5 -0
  9. package/ios/Fpay.mm +21 -0
  10. package/lib/module/FountainPayProvider.js +18 -0
  11. package/lib/module/FountainPayProvider.js.map +1 -0
  12. package/lib/module/core/api/client.js +47 -0
  13. package/lib/module/core/api/client.js.map +1 -0
  14. package/lib/module/core/api/index.js +35 -0
  15. package/lib/module/core/api/index.js.map +1 -0
  16. package/lib/module/core/types/index.js +4 -0
  17. package/lib/module/core/types/index.js.map +1 -0
  18. package/lib/module/engine/BLEReceiverService.js +190 -0
  19. package/lib/module/engine/BLEReceiverService.js.map +1 -0
  20. package/lib/module/engine/BLESenderService.js +259 -0
  21. package/lib/module/engine/BLESenderService.js.map +1 -0
  22. package/lib/module/engine/FPEngine.js +340 -0
  23. package/lib/module/engine/FPEngine.js.map +1 -0
  24. package/lib/module/engine/NearbyUsersService.js +87 -0
  25. package/lib/module/engine/NearbyUsersService.js.map +1 -0
  26. package/lib/module/index.js +16 -0
  27. package/lib/module/index.js.map +1 -0
  28. package/lib/module/package.json +1 -0
  29. package/lib/module/ui/components/FPButton.js +71 -0
  30. package/lib/module/ui/components/FPButton.js.map +1 -0
  31. package/lib/module/ui/components/LoadingAnimation/InLoading.js +74 -0
  32. package/lib/module/ui/components/LoadingAnimation/InLoading.js.map +1 -0
  33. package/lib/module/ui/components/LoadingAnimation/index.js +82 -0
  34. package/lib/module/ui/components/LoadingAnimation/index.js.map +1 -0
  35. package/lib/module/ui/components/OtpInput/OTPInputView.js +290 -0
  36. package/lib/module/ui/components/OtpInput/OTPInputView.js.map +1 -0
  37. package/lib/module/ui/components/OtpInput/Styles.js +20 -0
  38. package/lib/module/ui/components/OtpInput/Styles.js.map +1 -0
  39. package/lib/module/ui/components/OtpInput/helpers/codeToArray.js +7 -0
  40. package/lib/module/ui/components/OtpInput/helpers/codeToArray.js.map +1 -0
  41. package/lib/module/ui/components/OtpInput/helpers/device.js +9 -0
  42. package/lib/module/ui/components/OtpInput/helpers/device.js.map +1 -0
  43. package/lib/module/ui/components/OtpInput/helpers/styles.js +17 -0
  44. package/lib/module/ui/components/OtpInput/helpers/styles.js.map +1 -0
  45. package/lib/module/ui/components/OtpInput/helpers/types.js +4 -0
  46. package/lib/module/ui/components/OtpInput/helpers/types.js.map +1 -0
  47. package/lib/module/ui/components/OtpInput/index.js +45 -0
  48. package/lib/module/ui/components/OtpInput/index.js.map +1 -0
  49. package/lib/module/ui/components/PulseAnimation.js +61 -0
  50. package/lib/module/ui/components/PulseAnimation.js.map +1 -0
  51. package/lib/module/ui/modals/FPPaymentRequestModal.js +253 -0
  52. package/lib/module/ui/modals/FPPaymentRequestModal.js.map +1 -0
  53. package/lib/module/ui/modals/FPShell.js +180 -0
  54. package/lib/module/ui/modals/FPShell.js.map +1 -0
  55. package/lib/module/ui/screens/ReceiveScreen.js +291 -0
  56. package/lib/module/ui/screens/ReceiveScreen.js.map +1 -0
  57. package/lib/module/ui/screens/SendScreen.js +216 -0
  58. package/lib/module/ui/screens/SendScreen.js.map +1 -0
  59. package/lib/module/ui/screens/sub/BluetoothSubScreen.js +403 -0
  60. package/lib/module/ui/screens/sub/BluetoothSubScreen.js.map +1 -0
  61. package/lib/module/ui/screens/sub/NFCSubScreen.js +169 -0
  62. package/lib/module/ui/screens/sub/NFCSubScreen.js.map +1 -0
  63. package/lib/module/ui/screens/sub/NQRSubScreen.js +136 -0
  64. package/lib/module/ui/screens/sub/NQRSubScreen.js.map +1 -0
  65. package/lib/module/ui/screens/sub/ProximitySubScreen.js +501 -0
  66. package/lib/module/ui/screens/sub/ProximitySubScreen.js.map +1 -0
  67. package/lib/module/ui/screens/sub/TransferSubScreen.js +361 -0
  68. package/lib/module/ui/screens/sub/TransferSubScreen.js.map +1 -0
  69. package/lib/module/ui/theme/index.js +64 -0
  70. package/lib/module/ui/theme/index.js.map +1 -0
  71. package/lib/module/useFountainPay.js +82 -0
  72. package/lib/module/useFountainPay.js.map +1 -0
  73. package/lib/typescript/package.json +1 -0
  74. package/lib/typescript/src/FountainPayProvider.d.ts +7 -0
  75. package/lib/typescript/src/FountainPayProvider.d.ts.map +1 -0
  76. package/lib/typescript/src/core/api/client.d.ts +7 -0
  77. package/lib/typescript/src/core/api/client.d.ts.map +1 -0
  78. package/lib/typescript/src/core/api/index.d.ts +67 -0
  79. package/lib/typescript/src/core/api/index.d.ts.map +1 -0
  80. package/lib/typescript/src/core/types/index.d.ts +130 -0
  81. package/lib/typescript/src/core/types/index.d.ts.map +1 -0
  82. package/lib/typescript/src/engine/BLEReceiverService.d.ts +43 -0
  83. package/lib/typescript/src/engine/BLEReceiverService.d.ts.map +1 -0
  84. package/lib/typescript/src/engine/BLESenderService.d.ts +39 -0
  85. package/lib/typescript/src/engine/BLESenderService.d.ts.map +1 -0
  86. package/lib/typescript/src/engine/FPEngine.d.ts +24 -0
  87. package/lib/typescript/src/engine/FPEngine.d.ts.map +1 -0
  88. package/lib/typescript/src/engine/NearbyUsersService.d.ts +19 -0
  89. package/lib/typescript/src/engine/NearbyUsersService.d.ts.map +1 -0
  90. package/lib/typescript/src/index.d.ts +4 -0
  91. package/lib/typescript/src/index.d.ts.map +1 -0
  92. package/lib/typescript/src/ui/components/FPButton.d.ts +12 -0
  93. package/lib/typescript/src/ui/components/FPButton.d.ts.map +1 -0
  94. package/lib/typescript/src/ui/components/LoadingAnimation/InLoading.d.ts +7 -0
  95. package/lib/typescript/src/ui/components/LoadingAnimation/InLoading.d.ts.map +1 -0
  96. package/lib/typescript/src/ui/components/LoadingAnimation/index.d.ts +6 -0
  97. package/lib/typescript/src/ui/components/LoadingAnimation/index.d.ts.map +1 -0
  98. package/lib/typescript/src/ui/components/OtpInput/OTPInputView.d.ts +29 -0
  99. package/lib/typescript/src/ui/components/OtpInput/OTPInputView.d.ts.map +1 -0
  100. package/lib/typescript/src/ui/components/OtpInput/Styles.d.ts +330 -0
  101. package/lib/typescript/src/ui/components/OtpInput/Styles.d.ts.map +1 -0
  102. package/lib/typescript/src/ui/components/OtpInput/helpers/codeToArray.d.ts +6 -0
  103. package/lib/typescript/src/ui/components/OtpInput/helpers/codeToArray.d.ts.map +1 -0
  104. package/lib/typescript/src/ui/components/OtpInput/helpers/device.d.ts +6 -0
  105. package/lib/typescript/src/ui/components/OtpInput/helpers/device.d.ts.map +1 -0
  106. package/lib/typescript/src/ui/components/OtpInput/helpers/styles.d.ts +6 -0
  107. package/lib/typescript/src/ui/components/OtpInput/helpers/styles.d.ts.map +1 -0
  108. package/lib/typescript/src/ui/components/OtpInput/helpers/types.d.ts +84 -0
  109. package/lib/typescript/src/ui/components/OtpInput/helpers/types.d.ts.map +1 -0
  110. package/lib/typescript/src/ui/components/OtpInput/index.d.ts +9 -0
  111. package/lib/typescript/src/ui/components/OtpInput/index.d.ts.map +1 -0
  112. package/lib/typescript/src/ui/components/PulseAnimation.d.ts +2 -0
  113. package/lib/typescript/src/ui/components/PulseAnimation.d.ts.map +1 -0
  114. package/lib/typescript/src/ui/modals/FPPaymentRequestModal.d.ts +2 -0
  115. package/lib/typescript/src/ui/modals/FPPaymentRequestModal.d.ts.map +1 -0
  116. package/lib/typescript/src/ui/modals/FPShell.d.ts +2 -0
  117. package/lib/typescript/src/ui/modals/FPShell.d.ts.map +1 -0
  118. package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts +10 -0
  119. package/lib/typescript/src/ui/screens/ReceiveScreen.d.ts.map +1 -0
  120. package/lib/typescript/src/ui/screens/SendScreen.d.ts +9 -0
  121. package/lib/typescript/src/ui/screens/SendScreen.d.ts.map +1 -0
  122. package/lib/typescript/src/ui/screens/sub/BluetoothSubScreen.d.ts +552 -0
  123. package/lib/typescript/src/ui/screens/sub/BluetoothSubScreen.d.ts.map +1 -0
  124. package/lib/typescript/src/ui/screens/sub/NFCSubScreen.d.ts +19 -0
  125. package/lib/typescript/src/ui/screens/sub/NFCSubScreen.d.ts.map +1 -0
  126. package/lib/typescript/src/ui/screens/sub/NQRSubScreen.d.ts +13 -0
  127. package/lib/typescript/src/ui/screens/sub/NQRSubScreen.d.ts.map +1 -0
  128. package/lib/typescript/src/ui/screens/sub/ProximitySubScreen.d.ts +552 -0
  129. package/lib/typescript/src/ui/screens/sub/ProximitySubScreen.d.ts.map +1 -0
  130. package/lib/typescript/src/ui/screens/sub/TransferSubScreen.d.ts +12 -0
  131. package/lib/typescript/src/ui/screens/sub/TransferSubScreen.d.ts.map +1 -0
  132. package/lib/typescript/src/ui/theme/index.d.ts +62 -0
  133. package/lib/typescript/src/ui/theme/index.d.ts.map +1 -0
  134. package/lib/typescript/src/useFountainPay.d.ts +3 -0
  135. package/lib/typescript/src/useFountainPay.d.ts.map +1 -0
  136. package/package.json +217 -0
  137. package/src/FountainPayProvider.tsx +21 -0
  138. package/src/core/api/client.ts +47 -0
  139. package/src/core/api/index.ts +61 -0
  140. package/src/core/types/index.ts +144 -0
  141. package/src/engine/BLEReceiverService.ts +244 -0
  142. package/src/engine/BLESenderService.ts +314 -0
  143. package/src/engine/FPEngine.ts +370 -0
  144. package/src/engine/NearbyUsersService.ts +106 -0
  145. package/src/index.ts +30 -0
  146. package/src/ui/components/FPButton.tsx +42 -0
  147. package/src/ui/components/LoadingAnimation/InLoading.tsx +88 -0
  148. package/src/ui/components/LoadingAnimation/index.tsx +93 -0
  149. package/src/ui/components/OtpInput/OTPInputView.tsx +243 -0
  150. package/src/ui/components/OtpInput/Styles.ts +19 -0
  151. package/src/ui/components/OtpInput/helpers/codeToArray.ts +3 -0
  152. package/src/ui/components/OtpInput/helpers/device.ts +6 -0
  153. package/src/ui/components/OtpInput/helpers/styles.ts +17 -0
  154. package/src/ui/components/OtpInput/helpers/types.ts +88 -0
  155. package/src/ui/components/OtpInput/index.tsx +51 -0
  156. package/src/ui/components/PulseAnimation.tsx +78 -0
  157. package/src/ui/modals/FPPaymentRequestModal.tsx +158 -0
  158. package/src/ui/modals/FPShell.tsx +107 -0
  159. package/src/ui/screens/ReceiveScreen.tsx +119 -0
  160. package/src/ui/screens/SendScreen.tsx +86 -0
  161. package/src/ui/screens/sub/BluetoothSubScreen.tsx +433 -0
  162. package/src/ui/screens/sub/NFCSubScreen.tsx +83 -0
  163. package/src/ui/screens/sub/NQRSubScreen.tsx +61 -0
  164. package/src/ui/screens/sub/ProximitySubScreen.tsx +390 -0
  165. package/src/ui/screens/sub/TransferSubScreen.tsx +146 -0
  166. package/src/ui/theme/index.ts +24 -0
  167. package/src/useFountainPay.ts +95 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProximitySubScreen.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/sub/ProximitySubScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAoF,QAAQ,EAAU,MAAM,cAAc,CAAC;AAIlI,OAAO,KAAK,EAAE,UAAU,EAAmB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA+E/F,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAatB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAEtB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAKtB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAGxB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIrB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIzB,CAAC;AAgGF,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,UAAU,CAAC;IACrC,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,aAAa,KAAK,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3E;AAED,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,KAAK,2CA+IzF"}
@@ -0,0 +1,12 @@
1
+ import type { FPCurrency, FPTransaction, FPError } from '../../../core/types';
2
+ interface Props {
3
+ amount: number;
4
+ currency: FPCurrency;
5
+ onBack: () => void;
6
+ onDone: () => void;
7
+ onSuccess?: (tx: FPTransaction) => void;
8
+ onError?: (err: FPError) => void;
9
+ }
10
+ export declare function TransferSubScreen({ amount, currency, onBack, onDone, onSuccess, onError }: Props): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
12
+ //# sourceMappingURL=TransferSubScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransferSubScreen.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/sub/TransferSubScreen.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAI9E,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,UAAU,CAAC;IACrC,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,aAAa,KAAK,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3E;AAED,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,KAAK,kDAqGhG"}
@@ -0,0 +1,62 @@
1
+ export declare const C: {
2
+ ink: string;
3
+ brand: string;
4
+ brandLight: string;
5
+ green: string;
6
+ greenLight: string;
7
+ red: string;
8
+ redLight: string;
9
+ amber: string;
10
+ white: string;
11
+ surface: string;
12
+ border: string;
13
+ muted: string;
14
+ ghost: string;
15
+ };
16
+ export declare const R: {
17
+ sm: number;
18
+ md: number;
19
+ lg: number;
20
+ xl: number;
21
+ full: number;
22
+ };
23
+ export declare const S: {
24
+ xs: number;
25
+ sm: number;
26
+ md: number;
27
+ lg: number;
28
+ xl: number;
29
+ xxl: number;
30
+ };
31
+ export declare const F: {
32
+ xs: number;
33
+ sm: number;
34
+ md: number;
35
+ lg: number;
36
+ xl: number;
37
+ xxl: number;
38
+ hero: number;
39
+ };
40
+ export declare const shadow: {
41
+ sm: {
42
+ shadowColor: string;
43
+ shadowOffset: {
44
+ width: number;
45
+ height: number;
46
+ };
47
+ shadowOpacity: number;
48
+ shadowRadius: number;
49
+ elevation: number;
50
+ };
51
+ lg: {
52
+ shadowColor: string;
53
+ shadowOffset: {
54
+ width: number;
55
+ height: number;
56
+ };
57
+ shadowOpacity: number;
58
+ shadowRadius: number;
59
+ elevation: number;
60
+ };
61
+ };
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/theme/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;CAcb,CAAC;AAEF,eAAO,MAAM,CAAC;;;;;;CAA+C,CAAC;AAC9D,eAAO,MAAM,CAAC;;;;;;;CAAoD,CAAC;AACnE,eAAO,MAAM,CAAC;;;;;;;;CAAgE,CAAC;AAE/E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAGlB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FPInstance, FPSDKOptions } from './core/types';
2
+ export declare function useFountainPay(apiKey: string, options?: FPSDKOptions): FPInstance;
3
+ //# sourceMappingURL=useFountainPay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFountainPay.d.ts","sourceRoot":"","sources":["../../../src/useFountainPay.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,UAAU,EAEV,YAAY,EAKb,MAAM,cAAc,CAAC;AAEtB,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,UAAU,CAqEjF"}
package/package.json ADDED
@@ -0,0 +1,217 @@
1
+ {
2
+ "name": "react-native-fpay",
3
+ "version": "0.1.1",
4
+ "description": "Fountain Pay react-native sdk library",
5
+ "main": "./lib/module/index.js",
6
+ "module": "./lib/module/index.js",
7
+ "types": "./lib/typescript/src/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "exports": {
11
+ ".": {
12
+ "source": "./src/index.tsx",
13
+ "types": "./lib/typescript/src/index.d.ts",
14
+ "default": "./lib/module/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "src",
20
+ "lib",
21
+ "android",
22
+ "ios",
23
+ "cpp",
24
+ "*.podspec",
25
+ "react-native.config.js",
26
+ "!ios/build",
27
+ "!android/build",
28
+ "!android/gradle",
29
+ "!android/gradlew",
30
+ "!android/gradlew.bat",
31
+ "!android/local.properties",
32
+ "!**/__tests__",
33
+ "!**/__fixtures__",
34
+ "!**/__mocks__",
35
+ "!**/.*"
36
+ ],
37
+ "scripts": {
38
+ "example": "yarn workspace react-native-fpay-example",
39
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
40
+ "prepare": "bob build",
41
+ "typecheck": "tsc",
42
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
43
+ "test": "jest",
44
+ "release": "release-it --only-version"
45
+ },
46
+ "keywords": [
47
+ "react-native",
48
+ "payment",
49
+ "pssp",
50
+ "wallet",
51
+ "nfc",
52
+ "bluetooth",
53
+ "nqr",
54
+ "fintech"
55
+ ],
56
+ "repository": {
57
+ "type": "git",
58
+ "url": "git+https://github.com/Axentia-Ltd/react-native-fpay.git"
59
+ },
60
+ "author": "Adedeji RIchards <adewumiadedeji27@gmail.com> (https://github.com/adewumiadedeji)",
61
+ "license": "MIT",
62
+ "bugs": {
63
+ "url": "https://github.com/Axentia-Ltd/react-native-fpay/issues"
64
+ },
65
+ "homepage": "https://github.com/Axentia-Ltd/react-native-fpay#readme",
66
+ "publishConfig": {
67
+ "registry": "https://registry.npmjs.org/"
68
+ },
69
+ "dependencies": {
70
+ "@gorhom/bottom-sheet": "^5.2.8",
71
+ "@react-native-async-storage/async-storage": "^2.2.0",
72
+ "@react-native-community/blur": "^4.4.1",
73
+ "@react-native-community/clipboard": "^1.5.1",
74
+ "@react-native-community/geolocation": "^3.4.0",
75
+ "@react-native/new-app-screen": "0.83.1",
76
+ "@react-navigation/native": "^7.1.28",
77
+ "@react-navigation/native-stack": "^7.10.0",
78
+ "@types/react-native-vector-icons": "^6.4.18",
79
+ "axios": "^1.13.5",
80
+ "buffer": "^6.0.3",
81
+ "md5": "^2.3.0",
82
+ "react": "*",
83
+ "react-native": "*",
84
+ "react-native-biometrics": "^3.0.1",
85
+ "react-native-ble-plx": "^3.5.0",
86
+ "react-native-fs": "^2.20.0",
87
+ "react-native-gesture-handler": "^2.30.0",
88
+ "react-native-html-to-pdf": "^1.3.0",
89
+ "react-native-image-picker": "^8.2.1",
90
+ "react-native-linear-gradient": "^2.8.3",
91
+ "react-native-multi-ble-peripheral": "^0.1.8",
92
+ "react-native-nfc-manager": "^3.17.2",
93
+ "react-native-qr-kit": "^1.1.6",
94
+ "react-native-qrcode-svg": "^6.3.21",
95
+ "react-native-safe-area-context": "^5.6.2",
96
+ "react-native-screens": "^4.19.0",
97
+ "react-native-share": "^12.2.4",
98
+ "react-native-static-safe-area-insets": "^2.2.0",
99
+ "react-native-svg": "^15.15.1",
100
+ "react-native-svg-transformer": "^1.5.3",
101
+ "react-native-toast-message": "^2.3.3",
102
+ "react-native-vector-icons": "^10.3.0",
103
+ "react-native-vision-camera": "^4.7.3",
104
+ "styled-components": "^6.3.11",
105
+ "zustand": "^5.0.10"
106
+ },
107
+ "devDependencies": {
108
+ "@commitlint/config-conventional": "^19.8.1",
109
+ "@eslint/compat": "^1.3.2",
110
+ "@eslint/eslintrc": "^3.3.1",
111
+ "@eslint/js": "^9.35.0",
112
+ "@react-native/babel-preset": "0.83.0",
113
+ "@react-native/eslint-config": "0.83.0",
114
+ "@release-it/conventional-changelog": "^10.0.1",
115
+ "@types/jest": "^29.5.14",
116
+ "@types/react": "^19.2.0",
117
+ "commitlint": "^19.8.1",
118
+ "del-cli": "^6.0.0",
119
+ "eslint": "^9.35.0",
120
+ "eslint-config-prettier": "^10.1.8",
121
+ "eslint-plugin-ft-flow": "^3.0.11",
122
+ "eslint-plugin-prettier": "^5.5.4",
123
+ "eslint-plugin-react-native": "^5.0.0",
124
+ "jest": "^29.7.0",
125
+ "lefthook": "^2.0.3",
126
+ "prettier": "^3.8.1",
127
+ "react": "19.2.0",
128
+ "react-native": "0.83.0",
129
+ "react-native-builder-bob": "^0.40.13",
130
+ "release-it": "^19.0.4",
131
+ "turbo": "^2.5.6",
132
+ "typescript": "^5.9.2"
133
+ },
134
+ "peerDependencies": {
135
+ "react": "*",
136
+ "react-native": "*"
137
+ },
138
+ "workspaces": [
139
+ "example"
140
+ ],
141
+ "packageManager": "yarn@4.11.0",
142
+ "react-native-builder-bob": {
143
+ "source": "src",
144
+ "output": "lib",
145
+ "targets": [
146
+ [
147
+ "module",
148
+ {
149
+ "esm": true
150
+ }
151
+ ],
152
+ [
153
+ "typescript",
154
+ {
155
+ "project": "tsconfig.build.json"
156
+ }
157
+ ]
158
+ ]
159
+ },
160
+ "codegenConfig": {
161
+ "name": "FpaySpec",
162
+ "type": "modules",
163
+ "jsSrcsDir": "src",
164
+ "android": {
165
+ "javaPackageName": "com.fpay"
166
+ }
167
+ },
168
+ "prettier": {
169
+ "quoteProps": "consistent",
170
+ "singleQuote": true,
171
+ "tabWidth": 2,
172
+ "trailingComma": "es5",
173
+ "useTabs": false
174
+ },
175
+ "jest": {
176
+ "preset": "react-native",
177
+ "modulePathIgnorePatterns": [
178
+ "<rootDir>/example/node_modules",
179
+ "<rootDir>/lib/"
180
+ ]
181
+ },
182
+ "commitlint": {
183
+ "extends": [
184
+ "@commitlint/config-conventional"
185
+ ]
186
+ },
187
+ "release-it": {
188
+ "git": {
189
+ "commitMessage": "chore: release ${version}",
190
+ "tagName": "v${version}"
191
+ },
192
+ "npm": {
193
+ "publish": true
194
+ },
195
+ "github": {
196
+ "release": true
197
+ },
198
+ "plugins": {
199
+ "@release-it/conventional-changelog": {
200
+ "preset": {
201
+ "name": "angular"
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "create-react-native-library": {
207
+ "type": "turbo-module",
208
+ "languages": "kotlin-objc",
209
+ "tools": [
210
+ "eslint",
211
+ "jest",
212
+ "lefthook",
213
+ "release-it"
214
+ ],
215
+ "version": "0.57.2"
216
+ }
217
+ }
@@ -0,0 +1,21 @@
1
+ // ─────────────────────────────────────────────
2
+ // FountainPayProvider
3
+ // The ONLY thing the host app mounts.
4
+ // Wraps children and mounts the invisible shell.
5
+ // ─────────────────────────────────────────────
6
+ import React, { type ReactNode } from 'react';
7
+ import { FPShell } from './ui/modals/FPShell';
8
+
9
+ interface Props {
10
+ children: ReactNode;
11
+ }
12
+
13
+ export function FountainPayProvider({ children }: Props) {
14
+ return (
15
+ <>
16
+ {children}
17
+ {/* FPShell is invisible until pay.send() or pay.receive() is called */}
18
+ <FPShell />
19
+ </>
20
+ );
21
+ }
@@ -0,0 +1,47 @@
1
+ // FountainPay SDK — HTTP Client
2
+ // All API communication goes through here.
3
+ // The host app never touches this directly.
4
+
5
+ import axios, { type AxiosInstance } from 'axios';
6
+ import type { FPError } from '../types';
7
+
8
+ const DEFAULT_BASE_URL = 'https://api.fountainpay.ng/sdk/detect/';
9
+
10
+ let _client: AxiosInstance | null = null;
11
+
12
+ export function initClient(apiKey: string, options: { baseUrl?: string; environment?: string } = {}): void {
13
+ _client = axios.create({
14
+ baseURL: options.baseUrl ?? DEFAULT_BASE_URL,
15
+ timeout: 30000,
16
+ headers: {
17
+ 'Content-Type': 'application/json',
18
+ 'x-api-key': apiKey,
19
+ 'x-sdk': 'react-native-fountainpay-sdk',
20
+ 'x-sdk-version': '1.0.0',
21
+ 'x-env': options.environment ?? 'production',
22
+ },
23
+ });
24
+
25
+ _client.interceptors.response.use(
26
+ (r) => r,
27
+ (err) => {
28
+ const e: FPError = { code: 'UNKNOWN', message: 'An error occurred' };
29
+ if (!err.response) {
30
+ e.code = 'NETWORK_ERROR';
31
+ e.message = 'Network error. Check your connection.';
32
+ } else {
33
+ const d = err.response.data ?? {};
34
+ e.code = d.code ?? `HTTP_${err.response.status}`;
35
+ e.message = d.message ?? err.message;
36
+ e.statusCode = err.response.status;
37
+ if (err.response.status === 401) { e.code = 'INVALID_API_KEY'; e.message = 'Invalid API key.'; }
38
+ }
39
+ return Promise.reject(e);
40
+ }
41
+ );
42
+ }
43
+
44
+ export function http(): AxiosInstance {
45
+ if (!_client) throw new Error('[FountainPay] SDK not initialized. Call pay.initializeSDK() first.');
46
+ return _client;
47
+ }
@@ -0,0 +1,61 @@
1
+ // FountainPay SDK — All API calls
2
+ import { http } from "./client";
3
+ import type {
4
+ FPVirtualAccount,
5
+ FPGenerateAccountRequest,
6
+ FPBankItem,
7
+ FPTransaction,
8
+ FPNQRData,
9
+ FPTxStatus,
10
+ FPProximityPeer,
11
+ } from "../types";
12
+
13
+ export const walletAPI = {
14
+ generate: (req: FPGenerateAccountRequest) =>
15
+ http().post<FPVirtualAccount>("/v1/wallet/generate", req).then(r => r.data),
16
+
17
+ getBalance: (walletId: string) =>
18
+ http().get<{ balance: number; currency: string }>("/v1/wallet/" + walletId + "/balance").then(r => r.data),
19
+ };
20
+
21
+ export const transferAPI = {
22
+ getBanks: () =>
23
+ http().get<FPBankItem[]>("/v1/banks").then(r => r.data),
24
+
25
+ verifyAccount: (accountNumber: string, bankCode: string) =>
26
+ http().post<{ accountName: string; accountNumber: string; bankName: string; bankCode: string }>(
27
+ "/v1/transfer/verify-account", { accountNumber, bankCode }
28
+ ).then(r => r.data),
29
+
30
+ send: (payload: { accountNumber: string; bankCode: string; amount: number; narration?: string; reference?: string }) =>
31
+ http().post<{ reference: string; status: FPTxStatus; amount: number; currency: string; recipient: { accountName: string }; message: string; createdAt: string }>(
32
+ "/v1/transfer/initiate", payload
33
+ ).then(r => r.data),
34
+
35
+ status: (reference: string) =>
36
+ http().get<{ status: FPTxStatus; reference: string }>("/v1/transfer/" + reference + "/status").then(r => r.data),
37
+ };
38
+
39
+ export const nqrAPI = {
40
+ generate: (payload: { amount?: number; reference?: string; currency?: string; expiresInMinutes?: number }) =>
41
+ http().post<FPNQRData>("/v1/payment/nqr/generate", payload).then(r => r.data),
42
+
43
+ pay: (payload: { qrString: string; amount: number; currency: string }) =>
44
+ http().post<FPTransaction>("/v1/payment/nqr/pay", payload).then(r => r.data),
45
+ };
46
+
47
+ export const proximityAPI = {
48
+ broadcast: (payload: { latitude: number; longitude: number; accountName: string; accountNumber: string; bankCode: string; bankName: string }) =>
49
+ http().post<{ sessionId: string }>("/v1/proximity/broadcast", payload).then(r => r.data),
50
+
51
+ heartbeat: (sessionId: string, lat: number, lng: number) =>
52
+ http().patch("/v1/proximity/broadcast/" + sessionId, { latitude: lat, longitude: lng }),
53
+
54
+ unregister: (sessionId: string) =>
55
+ http().delete("/v1/proximity/broadcast/" + sessionId),
56
+
57
+ discover: (lat: number, lng: number, radiusMeters: number) =>
58
+ http().post<{ peers: FPProximityPeer[] }>(
59
+ "/v1/proximity/discover", { latitude: lat, longitude: lng, radiusMeters }
60
+ ).then(r => r.data.peers),
61
+ };
@@ -0,0 +1,144 @@
1
+ // FountainPay SDK — Master Types
2
+
3
+ import type { Device } from "react-native-ble-plx";
4
+
5
+ export type FPCurrency = 'NGN' | 'USD' | 'GBP' | 'EUR' | string;
6
+ export type FPChannel = 'transfer' | 'nqr' | 'proximity' | 'bluetooth' | 'nfc';
7
+ export type FPTxStatus = 'pending' | 'processing' | 'successful' | 'failed' | 'reversed';
8
+ export type FPTxType = 'debit' | 'credit';
9
+
10
+ export interface FPUserInfo {
11
+ accountName: string;
12
+ accountNumber: string;
13
+ bankName: string;
14
+ bankCode: string;
15
+ phone?: string;
16
+ email?: string;
17
+ userId?: string;
18
+ }
19
+
20
+ export interface FPSDKOptions {
21
+ baseUrl?: string;
22
+ environment?: 'sandbox' | 'production';
23
+ proximityRadius?: number;
24
+ bluetoothDisplayName?: string;
25
+ }
26
+
27
+ export interface FPParty {
28
+ accountName: string;
29
+ accountNumber?: string;
30
+ bankName?: string;
31
+ bankCode?: string;
32
+ phone?: string;
33
+ email?: string;
34
+ }
35
+
36
+ export interface FPTransaction {
37
+ id: string;
38
+ reference: string;
39
+ type: FPTxType;
40
+ channel: FPChannel;
41
+ amount: number;
42
+ currency: FPCurrency;
43
+ status: FPTxStatus;
44
+ description?: string;
45
+ sender?: FPParty;
46
+ recipient?: FPParty;
47
+ metadata?: Record<string, unknown>;
48
+ createdAt: string;
49
+ }
50
+
51
+ export interface FPGenerateAccountRequest {
52
+ accountName: string;
53
+ email?: string;
54
+ phone?: string;
55
+ reference?: string;
56
+ amount?: number;
57
+ currency?: FPCurrency;
58
+ expiresInMinutes?: number;
59
+ metadata?: Record<string, unknown>;
60
+ }
61
+
62
+ export interface FPVirtualAccount {
63
+ accountNumber: string;
64
+ accountName: string;
65
+ bankName: string;
66
+ bankCode: string;
67
+ currency: FPCurrency;
68
+ balance: number;
69
+ reference: string;
70
+ walletId: string;
71
+ qrCode?: string;
72
+ expiresAt?: string;
73
+ createdAt: string;
74
+ }
75
+
76
+ export interface FPBluetoothPaymentRequest {
77
+ requestId: string;
78
+ sender: FPParty & { deviceId: string; deviceName?: string };
79
+ amount: number;
80
+ currency: FPCurrency;
81
+ narration?: string;
82
+ timestamp: string;
83
+ }
84
+
85
+ export interface FPProximityPeer {
86
+ peerId: string;
87
+ displayName: string;
88
+ accountNumber: string;
89
+ bankCode: string;
90
+ bankName: string;
91
+ distance?: number;
92
+ lastSeen: string;
93
+ }
94
+
95
+ export interface FPNQRData {
96
+ qrString: string;
97
+ qrCodeImageBase64: string;
98
+ reference: string;
99
+ amount?: number;
100
+ currency?: FPCurrency;
101
+ expiresAt?: string;
102
+ }
103
+
104
+ export interface FPBankItem {
105
+ name: string;
106
+ code: string;
107
+ logo?: string;
108
+ }
109
+
110
+ export interface FPCallbacks {
111
+ onPaymentRequest?: (request: FPBluetoothPaymentRequest) => void;
112
+ onPaymentReceived?: (transaction: FPTransaction) => void;
113
+ onPaymentDeclined?: (request: FPBluetoothPaymentRequest) => void;
114
+ onPaymentSent?: (transaction: FPTransaction) => void;
115
+ onError?: (error: FPError) => void;
116
+ }
117
+
118
+ export interface FPError {
119
+ code: string;
120
+ message: string;
121
+ statusCode?: number;
122
+ }
123
+
124
+ export interface FPInstance {
125
+ initializeSDK: (user: FPUserInfo, callbacks?: FPCallbacks) => Promise<void>;
126
+ send: (amount: number, currency: FPCurrency) => void;
127
+ receive: (amount?: number, currency?: FPCurrency) => void;
128
+ generateAccountNumber: (request: FPGenerateAccountRequest) => Promise<FPVirtualAccount>;
129
+ listen: () => void;
130
+ destroy: () => void;
131
+ isReady: boolean;
132
+ currentUser: FPUserInfo | null;
133
+ }
134
+
135
+
136
+ export interface FintechDevice {
137
+ id: string;
138
+ name: string;
139
+ appName: string;
140
+ userName?: string;
141
+ rssi: number;
142
+ rawDevice: Device;
143
+ waiting?: boolean;
144
+ }