uvd-x402-sdk 2.106.0 → 2.108.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 (83) hide show
  1. package/README.md +9 -1
  2. package/dist/adapters/index.js +56 -3
  3. package/dist/adapters/index.js.map +1 -1
  4. package/dist/adapters/index.mjs +56 -3
  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 +96 -22
  9. package/dist/backend/index.js.map +1 -1
  10. package/dist/backend/index.mjs +96 -22
  11. package/dist/backend/index.mjs.map +1 -1
  12. package/dist/erc8128/index.js +2 -0
  13. package/dist/erc8128/index.js.map +1 -1
  14. package/dist/erc8128/index.mjs +2 -0
  15. package/dist/erc8128/index.mjs.map +1 -1
  16. package/dist/{escrow-contracts-RTO6mJCW.d.ts → escrow-contracts-Bbr_osYS.d.ts} +2 -1
  17. package/dist/{escrow-contracts-D3iLODtY.d.mts → escrow-contracts-Fa138lPh.d.mts} +2 -1
  18. package/dist/{index-jNJd8jEb.d.mts → index-D9l_j3c-.d.mts} +2 -2
  19. package/dist/{index-CZHgEr58.d.ts → index-DmdTO8VO.d.ts} +2 -2
  20. package/dist/index.d.mts +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +96 -22
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +96 -22
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/providers/algorand/index.js +56 -3
  27. package/dist/providers/algorand/index.js.map +1 -1
  28. package/dist/providers/algorand/index.mjs +56 -3
  29. package/dist/providers/algorand/index.mjs.map +1 -1
  30. package/dist/providers/evm/index.js +56 -3
  31. package/dist/providers/evm/index.js.map +1 -1
  32. package/dist/providers/evm/index.mjs +56 -3
  33. package/dist/providers/evm/index.mjs.map +1 -1
  34. package/dist/providers/near/index.d.mts +97 -1
  35. package/dist/providers/near/index.d.ts +97 -1
  36. package/dist/providers/near/index.js +337 -14
  37. package/dist/providers/near/index.js.map +1 -1
  38. package/dist/providers/near/index.mjs +322 -16
  39. package/dist/providers/near/index.mjs.map +1 -1
  40. package/dist/providers/solana/index.js +56 -3
  41. package/dist/providers/solana/index.js.map +1 -1
  42. package/dist/providers/solana/index.mjs +56 -3
  43. package/dist/providers/solana/index.mjs.map +1 -1
  44. package/dist/providers/stellar/index.js +56 -3
  45. package/dist/providers/stellar/index.js.map +1 -1
  46. package/dist/providers/stellar/index.mjs +56 -3
  47. package/dist/providers/stellar/index.mjs.map +1 -1
  48. package/dist/providers/sui/index.js +56 -3
  49. package/dist/providers/sui/index.js.map +1 -1
  50. package/dist/providers/sui/index.mjs +56 -3
  51. package/dist/providers/sui/index.mjs.map +1 -1
  52. package/dist/providers/xrpl/index.js +56 -3
  53. package/dist/providers/xrpl/index.js.map +1 -1
  54. package/dist/providers/xrpl/index.mjs +56 -3
  55. package/dist/providers/xrpl/index.mjs.map +1 -1
  56. package/dist/react/index.d.mts +1 -1
  57. package/dist/react/index.d.ts +1 -1
  58. package/dist/react/index.js +56 -3
  59. package/dist/react/index.js.map +1 -1
  60. package/dist/react/index.mjs +56 -3
  61. package/dist/react/index.mjs.map +1 -1
  62. package/dist/react/picker/index.js +54 -3
  63. package/dist/react/picker/index.js.map +1 -1
  64. package/dist/react/picker/index.mjs +54 -3
  65. package/dist/react/picker/index.mjs.map +1 -1
  66. package/dist/reputation/index.d.mts +1 -1
  67. package/dist/reputation/index.d.ts +1 -1
  68. package/dist/reputation/index.js +54 -3
  69. package/dist/reputation/index.js.map +1 -1
  70. package/dist/reputation/index.mjs +54 -3
  71. package/dist/reputation/index.mjs.map +1 -1
  72. package/dist/utils/index.js +56 -3
  73. package/dist/utils/index.js.map +1 -1
  74. package/dist/utils/index.mjs +56 -3
  75. package/dist/utils/index.mjs.map +1 -1
  76. package/package.json +3 -2
  77. package/src/backend/index.ts +59 -28
  78. package/src/chains/index.ts +56 -4
  79. package/src/index.ts +2 -2
  80. package/src/providers/near/escrow.ts +288 -0
  81. package/src/providers/near/index.ts +2 -0
  82. package/src/providers/near/vectors/arras-v1.json +129 -0
  83. package/src/types/index.ts +2 -0
package/README.md CHANGED
@@ -10,7 +10,9 @@ Users sign a message or transaction, and the Ultravioleta facilitator handles on
10
10
 
11
11
  ## Features
12
12
 
13
- - **29 Networks**: EVM (17 including Arc, Scroll, SKALE Base, Robinhood Chain), Solana, Fogo, Stellar, NEAR, Algorand, Sui, XRP Ledger, Hedera (mainnet + testnet)
13
+ **Arras NEAR escrow (v2.108.0):** offline local-key NEP-366 authorization, canonical Rust payment IDs and pull lifecycle helpers through `uvd-x402-sdk/near`. [Guide and agent example](docs/near-escrow.md). As of 2026-11-02 the facilitator advertises escrow only on testnet, and the SDK's escrow contract registry has no mainnet row yet.
14
+
15
+ - **31 Networks**: EVM (19 including HashKey Chain, Arc, Scroll, SKALE Base, Robinhood Chain), Solana, Fogo, Stellar, NEAR, Algorand, Sui, XRP Ledger, Hedera (mainnet + testnet)
14
16
  - **Multi-Stablecoin**: USDC, EURC, AUSD, PYUSD, USDT, USDG (Robinhood Chain)
15
17
  - **x402 v1 & v2**: Protocol auto-detection; native Hedera supports v2/exact only
16
18
  - **Gasless**: Facilitator pays all network fees
@@ -813,6 +815,8 @@ const header = svm.encodePaymentHeader(payload, chainConfig);
813
815
  | Scroll | 534352 | USDC |
814
816
  | SKALE Base | 1187947933 | USDC.e |
815
817
  | SKALE Base Sepolia | 324705682 | USDC.e |
818
+ | HashKey Chain | 177 | USDC |
819
+ | HashKey Chain Testnet | 133 | USDC |
816
820
  | Robinhood Chain | 4663 | USDG |
817
821
  | Robinhood Chain Testnet | 46630 | USDG |
818
822
  | Arc | 5042 | USDC, EURC |
@@ -820,6 +824,8 @@ const header = svm.encodePaymentHeader(payload, chainConfig);
820
824
 
821
825
  > **Arc mainnet and testnet:** payment amounts use 6 decimals. USDC signs with the `USDC` / `2` domain; EURC (`0xbEf5…21c1` mainnet, `0x89B5…D72a` testnet) signs with `EURC` / `2` and its amounts are **euros**, not dollars (`tokenType: 'eurc'`, `usdPegged: false`). Native gas uses 18 decimals on the same balance. Use `arc` / `eip155:5042` for mainnet and `arc-testnet` / `eip155:5042002` for testnet. See [Arc usage and validation](docs/networks/arc.md).
822
826
 
827
+ > **HashKey Chain / USDC:** Use `hashkey` (177) or `hashkey-testnet` (133). Gas is HSK; payments use 6-decimal USDC. Mainnet's EIP-712 name is `Bridged USDC` and testnet's is `USD Coin`, both version `2`. HashKey USDT is unsupported because it has no EIP-3009. [Network configuration and measured domains](docs/networks/hashkey.md).
828
+
823
829
  > **Robinhood Chain / USDG:** Robinhood Chain has no USDC — the settlement stablecoin is Paxos **USDG** (Global Dollar, 6 decimals, EIP-3009). Its on-chain `version()` getter reverts, so the EIP-712 domain `{ name: "Global Dollar", version: "1" }` can never be resolved on-chain. The SDK carries this domain in the chain config; when constructing `PaymentRequirements` yourself, send it in `extra`: `{ "name": "Global Dollar", "version": "1" }`. Use `tokenType: 'usdg'` (or the default, which resolves to USDG on these networks).
824
830
 
825
831
  ### SVM (2)
@@ -882,6 +888,8 @@ getFacilitatorAddress('xrpl-mainnet'); // rfADKk...
882
888
 
883
889
  ## Backend
884
890
 
891
+ Payment headers follow one rule in Express, Hono and `createFetchPaywall`: send `X-PAYMENT`, `PAYMENT-SIGNATURE`, or both with the same value. Names are case-insensitive and surrounding HTTP spaces/tabs are ignored. Distinct values return **400** (`Conflicting payment headers`) before verification or settlement. Empty or malformed payment headers, including payments with no network in either `network` or `accepted.network`, return **400**; absent payment headers return **402**. The extractor returns `null` for invalid or conflicting headers. Standard v2 payments carry their network in `accepted.network`; a top-level string `network` takes precedence when present. Empty or whitespace-padded networks are invalid. Verification and settlement use the same parsed payment, including manual settlement.
892
+
885
893
  ```typescript
886
894
  import {
887
895
  FacilitatorClient,
@@ -36,7 +36,7 @@ var SUPPORTED_CHAINS = {
36
36
  x402: { facilitatorUrl: DEFAULT_FACILITATOR_URL, enabled: true }
37
37
  },
38
38
  // ============================================================================
39
- // EVM CHAINS (16 enabled + BSC, disabled)
39
+ // EVM CHAINS (19 enabled + BSC, disabled)
40
40
  // ============================================================================
41
41
  base: {
42
42
  chainId: 8453,
@@ -441,8 +441,8 @@ var SUPPORTED_CHAINS = {
441
441
  usdt: {
442
442
  address: "0xe7cd86e13AC4309349F30B3435a9d337750fC82D",
443
443
  decimals: 6,
444
- name: "USD\u20AE0",
445
- // USD₮0 (USDT0 omnichain via LayerZero)
444
+ name: "USDT0",
445
+ // ASCII on Monad, unlike USD₮0 on Arbitrum/Optimism (src/usdt-domains.test.ts)
446
446
  version: "1"
447
447
  }
448
448
  },
@@ -594,6 +594,57 @@ var SUPPORTED_CHAINS = {
594
594
  enabled: true
595
595
  }
596
596
  },
597
+ // HashKey Chain: USDC supports EIP-3009; HashKey USDT does not.
598
+ hashkey: {
599
+ chainId: 177,
600
+ chainIdHex: "0xb1",
601
+ name: "hashkey",
602
+ displayName: "HashKey Chain",
603
+ networkType: "evm",
604
+ rpcUrl: "https://mainnet.hsk.xyz",
605
+ explorerUrl: "https://hsk.blockscout.com",
606
+ nativeCurrency: { name: "HashKey", symbol: "HSK", decimals: 18 },
607
+ usdc: {
608
+ address: "0x054ed45810DbBAb8B27668922D110669c9D88D0a",
609
+ decimals: 6,
610
+ name: "Bridged USDC",
611
+ version: "2"
612
+ },
613
+ tokens: {
614
+ usdc: {
615
+ address: "0x054ed45810DbBAb8B27668922D110669c9D88D0a",
616
+ decimals: 6,
617
+ name: "Bridged USDC",
618
+ version: "2"
619
+ }
620
+ },
621
+ x402: { facilitatorUrl: DEFAULT_FACILITATOR_URL, enabled: true }
622
+ },
623
+ "hashkey-testnet": {
624
+ chainId: 133,
625
+ chainIdHex: "0x85",
626
+ name: "hashkey-testnet",
627
+ displayName: "HashKey Chain Testnet",
628
+ networkType: "evm",
629
+ rpcUrl: "https://testnet.hsk.xyz",
630
+ explorerUrl: "https://testnet-explorer.hskchain.net",
631
+ nativeCurrency: { name: "HashKey", symbol: "HSK", decimals: 18 },
632
+ usdc: {
633
+ address: "0x8FE3cB719Ee4410E236Cd6b72ab1fCDC06eF53c6",
634
+ decimals: 6,
635
+ name: "USD Coin",
636
+ version: "2"
637
+ },
638
+ tokens: {
639
+ usdc: {
640
+ address: "0x8FE3cB719Ee4410E236Cd6b72ab1fCDC06eF53c6",
641
+ decimals: 6,
642
+ name: "USD Coin",
643
+ version: "2"
644
+ }
645
+ },
646
+ x402: { facilitatorUrl: DEFAULT_FACILITATOR_URL, enabled: true }
647
+ },
597
648
  // Robinhood Chain (Arbitrum Orbit L2). NOTE: there is NO USDC on this chain -
598
649
  // the settlement stablecoin is Paxos USDG (Global Dollar). The `usdc` field
599
650
  // below carries USDG for interface compatibility (same pattern as XRPL's native
@@ -1156,6 +1207,8 @@ var CAIP2_IDENTIFIERS = {
1156
1207
  scroll: "eip155:534352",
1157
1208
  "skale-base": "eip155:1187947933",
1158
1209
  "skale-base-sepolia": "eip155:324705682",
1210
+ hashkey: "eip155:177",
1211
+ "hashkey-testnet": "eip155:133",
1159
1212
  robinhood: "eip155:4663",
1160
1213
  "robinhood-testnet": "eip155:46630",
1161
1214
  arc: "eip155:5042",