Commit 2b28234
committed
Add intent ID generation for purchase requests
FEATURE: Unique Order/Intent ID
- Generate intent ID format: pi_<buyerPubkey8>_<timestamp>
- Example: pi_8f7a9b2c_1761034427234
- Ties order to buyer (first 8 chars of pubkey)
- Sortable by timestamp
- Included in encrypted purchase intent message
Technical Changes:
- Add intentId field to PurchaseIntent interface
- Update preparePurchaseIntent() to accept buyerPubkey parameter
- Get buyer pubkey from signer.getPublicKey() before preparing messages
- Intent ID logged for tracking in service logs
Benefits:
- Both buyer and seller can reference same order ID
- Traceable in logs and conversation history
- Unique identifier before Nostr event ID exists
- Helps with order management and support1 parent a9e0ee8 commit 2b28234
2 files changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
165 | 169 | | |
166 | 170 | | |
| 171 | + | |
167 | 172 | | |
168 | 173 | | |
169 | | - | |
| 174 | + | |
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
| |||
177 | 182 | | |
178 | 183 | | |
179 | 184 | | |
| 185 | + | |
180 | 186 | | |
181 | 187 | | |
182 | 188 | | |
| |||
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
223 | 232 | | |
224 | 233 | | |
225 | 234 | | |
| |||
229 | 238 | | |
230 | 239 | | |
231 | 240 | | |
232 | | - | |
233 | | - | |
| 241 | + | |
| 242 | + | |
234 | 243 | | |
235 | 244 | | |
236 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
0 commit comments