Commit 1cf15e0
authored
Build Transaction History and Receipt System (#140)
* feat(sep0007): add SEP-0007 URI parser and validator
- parseSep0007Uri: parses web+stellar:pay and web+stellar:tx URIs
- buildSep0007PayUri: builds a SEP-0007 pay URI from params
- detectQrContentType: classifies scanned QR content
- isStellarAddress / isFederatedAddress / isValidStellarDestination helpers
- Full TypeScript types for pay and tx operation params
* feat(hooks): add useCameraPermission hook
Wraps expo-camera's useCameraPermissions with a clean interface:
- granted / denied / undetermined state flags
- loading state during permission request
- requestPermission() async helper
* feat(scan): implement QR code scanner with SEP-0007 support
- Live camera feed via expo-camera CameraView
- Barcode scanner restricted to QR type
- Flash toggle (on/off)
- Gallery picker via expo-image-picker
- Manual address / URI entry fallback
- SEP-0007 pay and tx URI parsing with payment preview
- Plain Stellar G-address and federated address detection
- Payment details preview screen (recipient, amount, asset, memo)
- Confirm → navigates to /transfer pre-filled with scanned params
- Graceful error screen for invalid QR codes with retry
- Camera permission request and denied state with Settings deep-link
- Responsive scanner viewport (tablet-aware)
- Corner bracket overlay for scan target UX
- Accessibility labels and roles throughout
* feat(receive): generate real SEP-0007 QR code for receiving payments
- Replace QR placeholder icon with react-native-qrcode-svg
- External wallet receive generates a web+stellar:pay URI via buildSep0007PayUri
- BLINKS ID receive shows blinkId as QR value
- Wire up Copy ID button with Clipboard + toast feedback
- Import buildSep0007PayUri from sep0007 utils
* feat(merchant/qr-code): generate SEP-0007 compliant payment QR
- Build web+stellar:pay URI with destination, amount, asset_code, memo
- Replace JSON payload with standards-compliant SEP-0007 URI
- Add Share functionality to share the URI directly
- Any SEP-0007 compatible wallet can now scan and pay the merchant
* chore(deps): install expo-camera and expo-image-picker
- expo-camera: live camera feed + QR barcode scanning
- expo-image-picker: gallery access for QR image selection
* feat(types): add Transaction, TransactionPage, TransactionFilters types
Defines the full data model for the transaction history system:
- Transaction: id, type, status, amount, asset, fiatValue, address,
stellarTxHash, memo, fee, network
- TransactionPage: paginated response with nextCursor and total
- TransactionFilters: type, status, dateFrom, dateTo, search, amountMin/Max
* feat(service): add transactionService with pagination and offline cache
- fetchTransactions: cursor-based pagination with filter support
(type, status, date range, amount range, full-text search)
- fetchTransactionById: cache-first single transaction lookup
- invalidateTransactionCache: clears AsyncStorage cache
- 5-minute TTL cache via AsyncStorage
- Mock data with 8 realistic Stellar transactions (replace with API)
* feat(utils): add receiptGenerator for shareable transaction receipts
- buildReceiptText: formats a plain-text receipt with all tx details
- shareReceipt: writes receipt to cache dir and opens native share sheet
- getReceiptText: returns receipt string for display/copy
- Includes Stellar explorer URL in receipt when hash is present
* feat(hooks): add useTransactions hook
- Initial load, pull-to-refresh, infinite scroll (loadMore)
- applyFilters: updates filters and reloads from page 1
- Separate loading / refreshing / loadingMore states
- Error state with message
- Cursor ref tracking for pagination
* feat(components): add TransactionFilterSheet bottom sheet
- Modal bottom sheet with drag handle
- Type filter chips (All / Sent / Received)
- Status filter chips (All / Completed / Pending / Failed)
- Date range inputs (dateFrom / dateTo)
- Amount range inputs (min / max)
- Reset and Apply buttons
- Syncs with current filters when opened
* feat(history): rewrite history screen with full transaction system
- Paginated list via useTransactions hook
- Date-grouped sections (Today / Yesterday / date label)
- Pull-to-refresh with RefreshControl
- Infinite scroll with onEndReached
- Debounced search bar (address, memo, hash, asset)
- Filter button with active indicator dot
- TransactionFilterSheet integration
- Transaction row: icon, label, time, status pill, amount, fiat value
- Loading, error, and empty states
- Tapping a row navigates to /transaction/[id]
* feat(transaction): add transaction detail and receipt screen
- Amount hero with type icon, fiat value, status badge
- Transaction details card: date, type, counterparty, address, memo, fee, network
- Blockchain card: truncated hash with copy button, View on Stellar Explorer link
- Share Receipt button: generates plain-text receipt and opens native share sheet
- Share icon in header for quick access
- Handles loading and not-found states
- Deep-linkable via /transaction/[id]
* chore(deps): install expo-sharing, expo-file-system, expo-clipboard
Required for receipt generation and sharing functionality1 parent c68d4f6 commit 1cf15e0
9 files changed
Lines changed: 1834 additions & 194 deletions
File tree
- mobileapp
- app
- (personal)
- transaction
- src
- components
- hooks
- services
- types
- utils
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
0 commit comments