uvd-x402-sdk 2.14.0 → 2.15.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 (56) hide show
  1. package/README.md +218 -1396
  2. package/dist/adapters/index.d.mts +1 -1
  3. package/dist/adapters/index.d.ts +1 -1
  4. package/dist/adapters/index.js.map +1 -1
  5. package/dist/adapters/index.mjs.map +1 -1
  6. package/dist/backend/index.d.mts +1 -1
  7. package/dist/backend/index.d.ts +1 -1
  8. package/dist/backend/index.js.map +1 -1
  9. package/dist/backend/index.mjs.map +1 -1
  10. package/dist/{index-fIhvHqCQ.d.mts → index-BYIugZlE.d.mts} +17 -0
  11. package/dist/{index-fIhvHqCQ.d.ts → index-BYIugZlE.d.ts} +17 -0
  12. package/dist/{index-DmJGKD9r.d.ts → index-Cwi_VM05.d.ts} +1 -1
  13. package/dist/{index-C6Vxnneo.d.mts → index-D3PO3jLW.d.mts} +1 -1
  14. package/dist/index.d.mts +2 -2
  15. package/dist/index.d.ts +2 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/providers/algorand/index.d.mts +4 -1
  19. package/dist/providers/algorand/index.d.ts +4 -1
  20. package/dist/providers/algorand/index.js +25 -15
  21. package/dist/providers/algorand/index.js.map +1 -1
  22. package/dist/providers/algorand/index.mjs +25 -15
  23. package/dist/providers/algorand/index.mjs.map +1 -1
  24. package/dist/providers/evm/index.d.mts +1 -1
  25. package/dist/providers/evm/index.d.ts +1 -1
  26. package/dist/providers/evm/index.js.map +1 -1
  27. package/dist/providers/evm/index.mjs.map +1 -1
  28. package/dist/providers/near/index.d.mts +40 -2
  29. package/dist/providers/near/index.d.ts +40 -2
  30. package/dist/providers/near/index.js +68 -1
  31. package/dist/providers/near/index.js.map +1 -1
  32. package/dist/providers/near/index.mjs +68 -1
  33. package/dist/providers/near/index.mjs.map +1 -1
  34. package/dist/providers/solana/index.d.mts +1 -1
  35. package/dist/providers/solana/index.d.ts +1 -1
  36. package/dist/providers/solana/index.js +3 -0
  37. package/dist/providers/solana/index.js.map +1 -1
  38. package/dist/providers/solana/index.mjs +3 -0
  39. package/dist/providers/solana/index.mjs.map +1 -1
  40. package/dist/providers/stellar/index.d.mts +1 -1
  41. package/dist/providers/stellar/index.d.ts +1 -1
  42. package/dist/providers/stellar/index.js.map +1 -1
  43. package/dist/providers/stellar/index.mjs.map +1 -1
  44. package/dist/react/index.d.mts +3 -3
  45. package/dist/react/index.d.ts +3 -3
  46. package/dist/react/index.js.map +1 -1
  47. package/dist/react/index.mjs.map +1 -1
  48. package/dist/utils/index.d.mts +1 -1
  49. package/dist/utils/index.d.ts +1 -1
  50. package/dist/utils/index.js.map +1 -1
  51. package/dist/utils/index.mjs.map +1 -1
  52. package/package.json +1 -1
  53. package/src/providers/algorand/index.ts +33 -20
  54. package/src/providers/near/index.ts +101 -1
  55. package/src/providers/solana/index.ts +9 -2
  56. package/src/types/index.ts +18 -0
@@ -42,6 +42,7 @@ import type {
42
42
  ChainConfig,
43
43
  PaymentInfo,
44
44
  SolanaPaymentPayload,
45
+ TokenInfo,
45
46
  WalletAdapter,
46
47
  X402Version,
47
48
  } from '../../types';
@@ -412,11 +413,17 @@ export class SVMProvider implements WalletAdapter {
412
413
  // Use chain name from config, or default to 'solana' for backward compatibility
413
414
  const networkName = chainConfig?.name || 'solana';
414
415
 
415
- // Build the payload data
416
- const payloadData = {
416
+ // Build the payload data - preserve token info for Token2022 (AUSD, etc.)
417
+ const payloadData: { transaction: string; token?: TokenInfo } = {
417
418
  transaction: payload.transaction,
418
419
  };
419
420
 
421
+ // CRITICAL: Preserve token info for non-USDC tokens (Token2022 like AUSD)
422
+ // Without this, the facilitator cannot verify Token2022 transfers correctly
423
+ if (payload.token) {
424
+ payloadData.token = payload.token;
425
+ }
426
+
420
427
  // Format in x402 standard format (v1 or v2)
421
428
  const x402Payload = version === 2
422
429
  ? {
@@ -305,12 +305,30 @@ export interface EVMPaymentPayload {
305
305
  token: string;
306
306
  }
307
307
 
308
+ /**
309
+ * Token info for non-USDC stablecoins (e.g., Token2022 like AUSD)
310
+ * Required in payload for facilitator to verify Token2022 transfers correctly.
311
+ */
312
+ export interface TokenInfo {
313
+ /** Token mint address */
314
+ address: string;
315
+ /** Token symbol (e.g., 'AUSD') */
316
+ symbol: string;
317
+ /** Token decimals (e.g., 6) */
318
+ decimals: number;
319
+ }
320
+
308
321
  /**
309
322
  * Solana payment payload (partially-signed transaction)
310
323
  */
311
324
  export interface SolanaPaymentPayload {
312
325
  /** Base64-encoded serialized transaction */
313
326
  transaction: string;
327
+ /**
328
+ * Token info for non-USDC tokens (e.g., Token2022 like AUSD)
329
+ * CRITICAL: Must be included for Token2022 tokens for facilitator verification
330
+ */
331
+ token?: TokenInfo;
314
332
  }
315
333
 
316
334
  /**