uvd-x402-sdk 2.44.0 → 2.45.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uvd-x402-sdk",
3
- "version": "2.44.0",
3
+ "version": "2.45.0",
4
4
  "description": "x402 Payment SDK - Gasless crypto payments across 25 blockchains via Ultravioleta facilitator. Supports EVM (including Scroll, SKALE Base, Robinhood Chain), Solana, Fogo, Stellar, NEAR, Algorand, Sui, and XRP Ledger. Features: ERC-8004 Trustless Agents, Escrow/Refunds, multi-stablecoin (USDC, EURC, AUSD, PYUSD, USDT, USDG).",
5
5
  "author": "Ultravioleta DAO <ultravioletadao@gmail.com>",
6
6
  "license": "MIT",
package/src/events.ts CHANGED
@@ -81,6 +81,19 @@ export interface TrafficEvent {
81
81
  tx?: string;
82
82
  amount?: string;
83
83
  asset?: string;
84
+ /**
85
+ * The protected endpoint being bought.
86
+ *
87
+ * Answers "what was paid for", which the amount alone never does — two
88
+ * 1-USDC settles are indistinguishable without it.
89
+ */
90
+ resource?: string;
91
+ /** The seller receiving the payment. */
92
+ payTo?: string;
93
+ /** Human-readable description the seller advertised. */
94
+ description?: string;
95
+ /** Payment scheme: `exact`, `escrow`, `commerce`, `upto`. */
96
+ scheme?: string;
84
97
  }
85
98
 
86
99
  /** Raised when the stream cannot be opened. Carries the HTTP status. */
@@ -212,6 +225,10 @@ export function parseTrafficEvent(frame: SSEFrame): TrafficEvent | null {
212
225
  if (typeof raw.tx === 'string') event.tx = raw.tx;
213
226
  if (typeof raw.amount === 'string') event.amount = raw.amount;
214
227
  if (typeof raw.asset === 'string') event.asset = raw.asset;
228
+ if (typeof raw.resource === 'string') event.resource = raw.resource;
229
+ if (typeof raw.payTo === 'string') event.payTo = raw.payTo;
230
+ if (typeof raw.description === 'string') event.description = raw.description;
231
+ if (typeof raw.scheme === 'string') event.scheme = raw.scheme;
215
232
  return event;
216
233
  }
217
234