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.
- package/README.md +218 -1396
- package/dist/adapters/index.d.mts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs.map +1 -1
- package/dist/backend/index.d.mts +1 -1
- package/dist/backend/index.d.ts +1 -1
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/index.mjs.map +1 -1
- package/dist/{index-fIhvHqCQ.d.mts → index-BYIugZlE.d.mts} +17 -0
- package/dist/{index-fIhvHqCQ.d.ts → index-BYIugZlE.d.ts} +17 -0
- package/dist/{index-DmJGKD9r.d.ts → index-Cwi_VM05.d.ts} +1 -1
- package/dist/{index-C6Vxnneo.d.mts → index-D3PO3jLW.d.mts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/providers/algorand/index.d.mts +4 -1
- package/dist/providers/algorand/index.d.ts +4 -1
- package/dist/providers/algorand/index.js +25 -15
- package/dist/providers/algorand/index.js.map +1 -1
- package/dist/providers/algorand/index.mjs +25 -15
- package/dist/providers/algorand/index.mjs.map +1 -1
- package/dist/providers/evm/index.d.mts +1 -1
- package/dist/providers/evm/index.d.ts +1 -1
- package/dist/providers/evm/index.js.map +1 -1
- package/dist/providers/evm/index.mjs.map +1 -1
- package/dist/providers/near/index.d.mts +40 -2
- package/dist/providers/near/index.d.ts +40 -2
- package/dist/providers/near/index.js +68 -1
- package/dist/providers/near/index.js.map +1 -1
- package/dist/providers/near/index.mjs +68 -1
- package/dist/providers/near/index.mjs.map +1 -1
- package/dist/providers/solana/index.d.mts +1 -1
- package/dist/providers/solana/index.d.ts +1 -1
- package/dist/providers/solana/index.js +3 -0
- package/dist/providers/solana/index.js.map +1 -1
- package/dist/providers/solana/index.mjs +3 -0
- package/dist/providers/solana/index.mjs.map +1 -1
- package/dist/providers/stellar/index.d.mts +1 -1
- package/dist/providers/stellar/index.d.ts +1 -1
- package/dist/providers/stellar/index.js.map +1 -1
- package/dist/providers/stellar/index.mjs.map +1 -1
- package/dist/react/index.d.mts +3 -3
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs.map +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/providers/algorand/index.ts +33 -20
- package/src/providers/near/index.ts +101 -1
- package/src/providers/solana/index.ts +9 -2
- 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
|
? {
|
package/src/types/index.ts
CHANGED
|
@@ -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
|
/**
|