uvd-x402-sdk 2.28.0 → 2.30.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 (58) hide show
  1. package/README.md +72 -3
  2. package/dist/adapters/index.js +24 -24
  3. package/dist/adapters/index.js.map +1 -1
  4. package/dist/adapters/index.mjs +24 -24
  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 +24 -24
  9. package/dist/backend/index.js.map +1 -1
  10. package/dist/backend/index.mjs +24 -24
  11. package/dist/backend/index.mjs.map +1 -1
  12. package/dist/{index-B3_MwB-N.d.ts → index-BRcugkwC.d.ts} +5 -1
  13. package/dist/{index-Do24bn4j.d.mts → index-BZE2zu4a.d.mts} +5 -1
  14. package/dist/index.d.mts +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +53 -24
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +53 -24
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/providers/algorand/index.js +24 -24
  21. package/dist/providers/algorand/index.js.map +1 -1
  22. package/dist/providers/algorand/index.mjs +24 -24
  23. package/dist/providers/algorand/index.mjs.map +1 -1
  24. package/dist/providers/evm/index.js +24 -24
  25. package/dist/providers/evm/index.js.map +1 -1
  26. package/dist/providers/evm/index.mjs +24 -24
  27. package/dist/providers/evm/index.mjs.map +1 -1
  28. package/dist/providers/near/index.js +24 -24
  29. package/dist/providers/near/index.js.map +1 -1
  30. package/dist/providers/near/index.mjs +24 -24
  31. package/dist/providers/near/index.mjs.map +1 -1
  32. package/dist/providers/solana/index.js +24 -24
  33. package/dist/providers/solana/index.js.map +1 -1
  34. package/dist/providers/solana/index.mjs +24 -24
  35. package/dist/providers/solana/index.mjs.map +1 -1
  36. package/dist/providers/stellar/index.js +24 -24
  37. package/dist/providers/stellar/index.js.map +1 -1
  38. package/dist/providers/stellar/index.mjs +24 -24
  39. package/dist/providers/stellar/index.mjs.map +1 -1
  40. package/dist/providers/sui/index.js +24 -24
  41. package/dist/providers/sui/index.js.map +1 -1
  42. package/dist/providers/sui/index.mjs +24 -24
  43. package/dist/providers/sui/index.mjs.map +1 -1
  44. package/dist/react/index.d.mts +1 -1
  45. package/dist/react/index.d.ts +1 -1
  46. package/dist/react/index.js +53 -24
  47. package/dist/react/index.js.map +1 -1
  48. package/dist/react/index.mjs +53 -24
  49. package/dist/react/index.mjs.map +1 -1
  50. package/dist/utils/index.js +24 -24
  51. package/dist/utils/index.js.map +1 -1
  52. package/dist/utils/index.mjs +24 -24
  53. package/dist/utils/index.mjs.map +1 -1
  54. package/package.json +2 -2
  55. package/src/backend/index.ts +1 -1
  56. package/src/chains/index.ts +19 -19
  57. package/src/client/X402Client.ts +39 -1
  58. package/src/types/index.ts +2 -2
package/README.md CHANGED
@@ -6,7 +6,7 @@ Users sign a message or transaction, and the Ultravioleta facilitator handles on
6
6
 
7
7
  ## Features
8
8
 
9
- - **21 Networks**: EVM (13 including Scroll, SKALE), Solana, Fogo, Stellar, NEAR, Algorand, Sui
9
+ - **21 Networks**: EVM (13 including Scroll, SKALE Base), Solana, Fogo, Stellar, NEAR, Algorand, Sui
10
10
  - **Multi-Stablecoin**: USDC, EURC, AUSD, PYUSD, USDT
11
11
  - **x402 v1 & v2**: Both protocol versions with auto-detection
12
12
  - **Gasless**: Facilitator pays all network fees
@@ -15,6 +15,8 @@ Users sign a message or transaction, and the Ultravioleta facilitator handles on
15
15
  - **ERC-8004 Trustless Agents**: On-chain reputation and identity (EVM + Solana)
16
16
  - **Escrow & Refunds**: Hold payments with dispute resolution
17
17
  - **`/accepts` Negotiation**: Discover facilitator capabilities before constructing payments
18
+ - **Bazaar Discovery**: Register and discover paid resources across the x402 network
19
+ - **Facilitator Info**: Query version, supported networks, blacklist, and health
18
20
 
19
21
  ## Installation
20
22
 
@@ -450,8 +452,8 @@ const header = svm.encodePaymentHeader(payload, chainConfig);
450
452
  | Unichain | 130 | USDC |
451
453
  | Monad | 143 | USDC, AUSD |
452
454
  | Scroll | 534352 | USDC |
453
- | SKALE | 1187947933 | USDC |
454
- | SKALE Testnet | 324705682 | USDC |
455
+ | SKALE Base | 1187947933 | USDC.e |
456
+ | SKALE Base Sepolia | 324705682 | USDC.e |
455
457
 
456
458
  ### SVM (2)
457
459
 
@@ -677,6 +679,73 @@ await escrow.requestRefund({
677
679
  escrowId: escrowPayment.id,
678
680
  reason: 'Service not delivered',
679
681
  });
682
+
683
+ // Query on-chain escrow state
684
+ const state = await escrow.getEscrowState({
685
+ network: 'base-mainnet',
686
+ payer: '0xPayer...',
687
+ recipient: '0xRecipient...',
688
+ nonce: '0x1234...',
689
+ });
690
+ ```
691
+
692
+ ## Bazaar Discovery
693
+
694
+ Register and discover paid x402 resources across the network.
695
+
696
+ ```typescript
697
+ import { BazaarClient } from 'uvd-x402-sdk/backend';
698
+
699
+ const bazaar = new BazaarClient({ apiKey: 'your-api-key' });
700
+
701
+ // Discover resources
702
+ const results = await bazaar.discover({
703
+ category: 'ai',
704
+ network: 'base',
705
+ maxPrice: '0.10',
706
+ });
707
+
708
+ for (const resource of results.resources) {
709
+ console.log(`${resource.name}: ${resource.url}`);
710
+ }
711
+
712
+ // Register a resource
713
+ const resource = await bazaar.register({
714
+ url: 'https://api.example.com/v1/generate',
715
+ name: 'Image Generator API',
716
+ description: 'Generate images with AI',
717
+ category: 'ai',
718
+ networks: ['base', 'ethereum'],
719
+ price: '0.05',
720
+ payTo: '0x1234...',
721
+ });
722
+ ```
723
+
724
+ ## Facilitator Info
725
+
726
+ Query the facilitator for version, supported networks, and compliance data.
727
+
728
+ ```typescript
729
+ import { FacilitatorClient } from 'uvd-x402-sdk/backend';
730
+
731
+ const client = new FacilitatorClient();
732
+
733
+ // Check version
734
+ const { version } = await client.getVersion();
735
+ console.log(`Facilitator: v${version}`);
736
+
737
+ // List supported networks
738
+ const supported = await client.getSupported();
739
+ for (const kind of supported.kinds) {
740
+ console.log(` ${kind.network} - ${kind.scheme}`);
741
+ }
742
+
743
+ // Check blacklist
744
+ const bl = await client.getBlacklist();
745
+ console.log(`Blocked addresses: ${bl.totalBlocked}`);
746
+
747
+ // Health check
748
+ const isHealthy = await client.healthCheck();
680
749
  ```
681
750
 
682
751
  ## Links
@@ -446,32 +446,32 @@ var SUPPORTED_CHAINS = {
446
446
  enabled: true
447
447
  }
448
448
  },
449
- skale: {
449
+ "skale-base": {
450
450
  chainId: 1187947933,
451
451
  chainIdHex: "0x46cea59d",
452
- name: "skale",
453
- displayName: "SKALE",
452
+ name: "skale-base",
453
+ displayName: "SKALE Base",
454
454
  networkType: "evm",
455
- rpcUrl: "https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague",
456
- explorerUrl: "https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com",
455
+ rpcUrl: "https://skale-base.skalenodes.com/v1/base",
456
+ explorerUrl: "https://skale-base-explorer.skalenodes.com",
457
457
  nativeCurrency: {
458
- name: "sFUEL",
459
- symbol: "sFUEL",
458
+ name: "CREDIT",
459
+ symbol: "CREDIT",
460
460
  decimals: 18
461
461
  },
462
462
  usdc: {
463
463
  address: "0x85889c8c714505E0c94b30fcfcF64fE3Ac8FCb20",
464
464
  decimals: 6,
465
- name: "USDC",
466
- // SKALE uses "USDC"
465
+ name: "Bridged USDC (SKALE Bridge)",
466
+ // Must match on-chain EIP-712 domain exactly
467
467
  version: "2"
468
468
  },
469
469
  tokens: {
470
470
  usdc: {
471
471
  address: "0x85889c8c714505E0c94b30fcfcF64fE3Ac8FCb20",
472
472
  decimals: 6,
473
- name: "USDC",
474
- // SKALE uses "USDC"
473
+ name: "Bridged USDC (SKALE Bridge)",
474
+ // Must match on-chain EIP-712 domain exactly
475
475
  version: "2"
476
476
  }
477
477
  },
@@ -480,32 +480,32 @@ var SUPPORTED_CHAINS = {
480
480
  enabled: true
481
481
  }
482
482
  },
483
- "skale-testnet": {
483
+ "skale-base-sepolia": {
484
484
  chainId: 324705682,
485
485
  chainIdHex: "0x135a9d92",
486
- name: "skale-testnet",
487
- displayName: "SKALE Testnet",
486
+ name: "skale-base-sepolia",
487
+ displayName: "SKALE Base Sepolia",
488
488
  networkType: "evm",
489
- rpcUrl: "https://testnet.skalenodes.com/v1/lanky-ill-funny-testnet",
490
- explorerUrl: "https://lanky-ill-funny-testnet.explorer.testnet.skalenodes.com",
489
+ rpcUrl: "https://base-sepolia-testnet.skalenodes.com/v1/jubilant-horrible-ancha",
490
+ explorerUrl: "https://base-sepolia-testnet-explorer.skalenodes.com",
491
491
  nativeCurrency: {
492
- name: "sFUEL",
493
- symbol: "sFUEL",
492
+ name: "CREDIT",
493
+ symbol: "CREDIT",
494
494
  decimals: 18
495
495
  },
496
496
  usdc: {
497
497
  address: "0x2e08028E3C4c2356572E096d8EF835cD5C6030bD",
498
498
  decimals: 6,
499
- name: "USDC",
500
- // SKALE testnet uses "USDC"
499
+ name: "Bridged USDC (SKALE Bridge)",
500
+ // Must match on-chain EIP-712 domain exactly
501
501
  version: "2"
502
502
  },
503
503
  tokens: {
504
504
  usdc: {
505
505
  address: "0x2e08028E3C4c2356572E096d8EF835cD5C6030bD",
506
506
  decimals: 6,
507
- name: "USDC",
508
- // SKALE testnet uses "USDC"
507
+ name: "Bridged USDC (SKALE Bridge)",
508
+ // Must match on-chain EIP-712 domain exactly
509
509
  version: "2"
510
510
  }
511
511
  },
@@ -818,8 +818,8 @@ var CAIP2_IDENTIFIERS = {
818
818
  unichain: "eip155:130",
819
819
  monad: "eip155:143",
820
820
  scroll: "eip155:534352",
821
- skale: "eip155:1187947933",
822
- "skale-testnet": "eip155:324705682",
821
+ "skale-base": "eip155:1187947933",
822
+ "skale-base-sepolia": "eip155:324705682",
823
823
  // SVM chains
824
824
  solana: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
825
825
  fogo: "svm:fogo",