uvd-x402-sdk 2.92.0 → 2.94.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 (108) hide show
  1. package/README.md +7 -3
  2. package/dist/adapters/index.d.mts +1 -1
  3. package/dist/adapters/index.d.ts +1 -1
  4. package/dist/adapters/index.js +63 -4
  5. package/dist/adapters/index.js.map +1 -1
  6. package/dist/adapters/index.mjs +63 -4
  7. package/dist/adapters/index.mjs.map +1 -1
  8. package/dist/backend/index.d.mts +2 -2
  9. package/dist/backend/index.d.ts +2 -2
  10. package/dist/backend/index.js +144 -14
  11. package/dist/backend/index.js.map +1 -1
  12. package/dist/backend/index.mjs +145 -15
  13. package/dist/backend/index.mjs.map +1 -1
  14. package/dist/erc8128/index.js +2 -0
  15. package/dist/erc8128/index.js.map +1 -1
  16. package/dist/erc8128/index.mjs +2 -0
  17. package/dist/erc8128/index.mjs.map +1 -1
  18. package/dist/{index-DkoNhJfq.d.ts → index-CF2HBEAJ.d.mts} +5 -5
  19. package/dist/{index-DRk6i654.d.mts → index-CIUGPbu8.d.mts} +1 -1
  20. package/dist/{index-B-iLEkAH.d.mts → index-CkHu2s9r.d.ts} +5 -5
  21. package/dist/{index-s6ot_Mu-.d.ts → index-DTbVW7EU.d.ts} +1 -1
  22. package/dist/{index-DbauIMV2.d.mts → index-DnxubrYX.d.mts} +14 -6
  23. package/dist/{index-DbauIMV2.d.ts → index-DnxubrYX.d.ts} +14 -6
  24. package/dist/index.d.mts +9 -4
  25. package/dist/index.d.ts +9 -4
  26. package/dist/index.js +296 -18
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +293 -20
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/providers/algorand/index.d.mts +1 -1
  31. package/dist/providers/algorand/index.d.ts +1 -1
  32. package/dist/providers/algorand/index.js +62 -4
  33. package/dist/providers/algorand/index.js.map +1 -1
  34. package/dist/providers/algorand/index.mjs +62 -4
  35. package/dist/providers/algorand/index.mjs.map +1 -1
  36. package/dist/providers/evm/index.d.mts +1 -1
  37. package/dist/providers/evm/index.d.ts +1 -1
  38. package/dist/providers/evm/index.js +62 -4
  39. package/dist/providers/evm/index.js.map +1 -1
  40. package/dist/providers/evm/index.mjs +62 -4
  41. package/dist/providers/evm/index.mjs.map +1 -1
  42. package/dist/providers/hedera/index.d.mts +84 -0
  43. package/dist/providers/hedera/index.d.ts +84 -0
  44. package/dist/providers/hedera/index.js +192 -0
  45. package/dist/providers/hedera/index.js.map +1 -0
  46. package/dist/providers/hedera/index.mjs +182 -0
  47. package/dist/providers/hedera/index.mjs.map +1 -0
  48. package/dist/providers/near/index.d.mts +1 -1
  49. package/dist/providers/near/index.d.ts +1 -1
  50. package/dist/providers/near/index.js +57 -4
  51. package/dist/providers/near/index.js.map +1 -1
  52. package/dist/providers/near/index.mjs +57 -4
  53. package/dist/providers/near/index.mjs.map +1 -1
  54. package/dist/providers/solana/index.d.mts +1 -1
  55. package/dist/providers/solana/index.d.ts +1 -1
  56. package/dist/providers/solana/index.js +57 -4
  57. package/dist/providers/solana/index.js.map +1 -1
  58. package/dist/providers/solana/index.mjs +57 -4
  59. package/dist/providers/solana/index.mjs.map +1 -1
  60. package/dist/providers/stellar/index.d.mts +1 -1
  61. package/dist/providers/stellar/index.d.ts +1 -1
  62. package/dist/providers/stellar/index.js +57 -4
  63. package/dist/providers/stellar/index.js.map +1 -1
  64. package/dist/providers/stellar/index.mjs +57 -4
  65. package/dist/providers/stellar/index.mjs.map +1 -1
  66. package/dist/providers/sui/index.d.mts +1 -1
  67. package/dist/providers/sui/index.d.ts +1 -1
  68. package/dist/providers/sui/index.js +57 -4
  69. package/dist/providers/sui/index.js.map +1 -1
  70. package/dist/providers/sui/index.mjs +57 -4
  71. package/dist/providers/sui/index.mjs.map +1 -1
  72. package/dist/providers/xrpl/index.d.mts +1 -1
  73. package/dist/providers/xrpl/index.d.ts +1 -1
  74. package/dist/providers/xrpl/index.js +57 -4
  75. package/dist/providers/xrpl/index.js.map +1 -1
  76. package/dist/providers/xrpl/index.mjs +57 -4
  77. package/dist/providers/xrpl/index.mjs.map +1 -1
  78. package/dist/react/index.d.mts +3 -3
  79. package/dist/react/index.d.ts +3 -3
  80. package/dist/react/index.js +88 -10
  81. package/dist/react/index.js.map +1 -1
  82. package/dist/react/index.mjs +88 -10
  83. package/dist/react/index.mjs.map +1 -1
  84. package/dist/react/picker/index.d.mts +1 -1
  85. package/dist/react/picker/index.d.ts +1 -1
  86. package/dist/react/picker/index.js +55 -5
  87. package/dist/react/picker/index.js.map +1 -1
  88. package/dist/react/picker/index.mjs +55 -5
  89. package/dist/react/picker/index.mjs.map +1 -1
  90. package/dist/utils/index.d.mts +2 -2
  91. package/dist/utils/index.d.ts +2 -2
  92. package/dist/utils/index.js +64 -5
  93. package/dist/utils/index.js.map +1 -1
  94. package/dist/utils/index.mjs +64 -5
  95. package/dist/utils/index.mjs.map +1 -1
  96. package/dist/{validity-C0z0GqH6.d.ts → validity-BrvXzCEF.d.ts} +2 -2
  97. package/dist/{validity-BTMBMmuj.d.mts → validity-SD6nwegA.d.mts} +2 -2
  98. package/package.json +20 -5
  99. package/src/backend/index.ts +15 -0
  100. package/src/chains/index.ts +50 -2
  101. package/src/client/X402Client.ts +25 -5
  102. package/src/facilitator.ts +6 -0
  103. package/src/index.ts +5 -1
  104. package/src/providers/hedera/index.ts +179 -0
  105. package/src/react/NetworkPicker.tsx +1 -0
  106. package/src/types/index.ts +12 -6
  107. package/src/utils/validation.ts +7 -1
  108. package/src/utils/x402.ts +4 -1
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # uvd-x402-sdk
2
2
 
3
- Gasless crypto payments across 27 blockchain networks using the x402 protocol.
3
+ Gasless crypto payments across 29 blockchain networks using the x402 protocol.
4
4
 
5
5
  Users sign a message or transaction, and the Ultravioleta facilitator handles on-chain settlement. No gas fees for users.
6
6
 
7
+ **New in v2.94.0**: EURC on Arc mainnet and testnet, six-decimal euro amounts and token-specific signatures. Gas remains USDC. Contract metadata and offline tests verified; funded EURC payments pending. [Arc EURC guide](docs/networks/arc.md#eurc-prices-in-euros).
8
+
9
+ **New in v2.93.0**: Native Hedera mainnet and testnet with sponsored HBAR/USDC payments, offline signing and buyer/merchant helpers. [Hedera guide](docs/networks/hedera.md). Arc USDC remains supported on mainnet and testnet.
10
+
7
11
  ## Features
8
12
 
9
- - **25 Networks**: EVM (15 including Scroll, SKALE Base, Robinhood Chain), Solana, Fogo, Stellar, NEAR, Algorand, Sui, XRP Ledger (mainnet + testnet)
13
+ - **29 Networks**: EVM (17 including Arc, Scroll, SKALE Base, Robinhood Chain), Solana, Fogo, Stellar, NEAR, Algorand, Sui, XRP Ledger, Hedera (mainnet + testnet)
10
14
  - **Multi-Stablecoin**: USDC, EURC, AUSD, PYUSD, USDT, USDG (Robinhood Chain)
11
- - **x402 v1 & v2**: Both protocol versions with auto-detection
15
+ - **x402 v1 & v2**: Protocol auto-detection; native Hedera supports v2/exact only
12
16
  - **Gasless**: Facilitator pays all network fees
13
17
  - **Buyer Policy**: Per-payment and cumulative budgets, payee allowlist and offer expiry, evaluated against the offer in hand **before signing** — six closed refusal codes in a fixed order
14
18
  - **Type-Safe**: Full TypeScript support
@@ -1,4 +1,4 @@
1
- import { X as X402Version, a as PaymentResult } from '../index-DbauIMV2.mjs';
1
+ import { X as X402Version, a as PaymentResult } from '../index-DnxubrYX.mjs';
2
2
  export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from '../ows-Z9v4GxOZ.mjs';
3
3
  import '../wallet-w7BnImDG.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { X as X402Version, a as PaymentResult } from '../index-DbauIMV2.js';
1
+ import { X as X402Version, a as PaymentResult } from '../index-DnxubrYX.js';
2
2
  export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from '../ows-C-KmORG9.js';
3
3
  import '../wallet-w7BnImDG.js';
4
4
 
@@ -5,6 +5,38 @@ var ethers = require('ethers');
5
5
  // src/chains/index.ts
6
6
  var DEFAULT_FACILITATOR_URL = "https://facilitator.ultravioletadao.xyz";
7
7
  var SUPPORTED_CHAINS = {
8
+ "hedera:mainnet": {
9
+ chainId: 0,
10
+ chainIdHex: "0x0",
11
+ name: "hedera:mainnet",
12
+ displayName: "Hedera",
13
+ networkType: "hedera",
14
+ rpcUrl: "https://mainnet-public.mirrornode.hedera.com",
15
+ explorerUrl: "https://hashscan.io/mainnet",
16
+ nativeCurrency: { name: "HBAR", symbol: "HBAR", decimals: 8 },
17
+ usdc: { address: "0.0.456858", decimals: 6, name: "USDC", version: "" },
18
+ tokens: {
19
+ usdc: { address: "0.0.456858", decimals: 6, name: "USDC", version: "" },
20
+ hbar: { address: "0.0.0", decimals: 8, name: "HBAR", version: "", usdPegged: false }
21
+ },
22
+ x402: { facilitatorUrl: DEFAULT_FACILITATOR_URL, enabled: true }
23
+ },
24
+ "hedera:testnet": {
25
+ chainId: 0,
26
+ chainIdHex: "0x0",
27
+ name: "hedera:testnet",
28
+ displayName: "Hedera Testnet",
29
+ networkType: "hedera",
30
+ rpcUrl: "https://testnet.mirrornode.hedera.com",
31
+ explorerUrl: "https://hashscan.io/testnet",
32
+ nativeCurrency: { name: "HBAR", symbol: "HBAR", decimals: 8 },
33
+ usdc: { address: "0.0.429274", decimals: 6, name: "USDC", version: "" },
34
+ tokens: {
35
+ usdc: { address: "0.0.429274", decimals: 6, name: "USDC", version: "" },
36
+ hbar: { address: "0.0.0", decimals: 8, name: "HBAR", version: "", usdPegged: false }
37
+ },
38
+ x402: { facilitatorUrl: DEFAULT_FACILITATOR_URL, enabled: true }
39
+ },
8
40
  // ============================================================================
9
41
  // EVM CHAINS (16 enabled + BSC, disabled)
10
42
  // ============================================================================
@@ -38,7 +70,8 @@ var SUPPORTED_CHAINS = {
38
70
  address: "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",
39
71
  decimals: 6,
40
72
  name: "EURC",
41
- version: "2"
73
+ version: "2",
74
+ usdPegged: false
42
75
  }
43
76
  },
44
77
  x402: {
@@ -76,7 +109,8 @@ var SUPPORTED_CHAINS = {
76
109
  address: "0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",
77
110
  decimals: 6,
78
111
  name: "EURC",
79
- version: "2"
112
+ version: "2",
113
+ usdPegged: false
80
114
  },
81
115
  ausd: {
82
116
  address: "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
@@ -120,7 +154,8 @@ var SUPPORTED_CHAINS = {
120
154
  address: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
121
155
  decimals: 6,
122
156
  name: "Euro Coin",
123
- version: "2"
157
+ version: "2",
158
+ usdPegged: false
124
159
  },
125
160
  ausd: {
126
161
  address: "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
@@ -650,7 +685,7 @@ var SUPPORTED_CHAINS = {
650
685
  // Pinned by src/arc-testnet.test.ts.
651
686
  //
652
687
  // Mainnet (5042) and testnet (5042002) were verified independently against
653
- // their official RPCs on 2026-09-16. EURC is not registered without its E2E proof.
688
+ // their official RPCs on 2026-09-16. EURC domains checked on 2026-09-17; live payments pending.
654
689
  arc: {
655
690
  chainId: 5042,
656
691
  chainIdHex: "0x13b2",
@@ -679,6 +714,13 @@ var SUPPORTED_CHAINS = {
679
714
  decimals: 6,
680
715
  name: "USDC",
681
716
  version: "2"
717
+ },
718
+ eurc: {
719
+ address: "0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1",
720
+ decimals: 6,
721
+ name: "EURC",
722
+ version: "2",
723
+ usdPegged: false
682
724
  }
683
725
  },
684
726
  x402: {
@@ -714,6 +756,13 @@ var SUPPORTED_CHAINS = {
714
756
  decimals: 6,
715
757
  name: "USDC",
716
758
  version: "2"
759
+ },
760
+ eurc: {
761
+ address: "0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a",
762
+ decimals: 6,
763
+ name: "EURC",
764
+ version: "2",
765
+ usdPegged: false
717
766
  }
718
767
  },
719
768
  x402: {
@@ -1074,6 +1123,8 @@ var SUPPORTED_CHAINS = {
1074
1123
  }
1075
1124
  };
1076
1125
  var CHAIN_ALIASES = {
1126
+ hedera: "hedera:mainnet",
1127
+ "hedera-testnet": "hedera:testnet",
1077
1128
  // Renamed in 2.85.0: the facilitator advertises the mainnet as `xrpl`.
1078
1129
  "xrpl-mainnet": "xrpl"
1079
1130
  };
@@ -1084,6 +1135,8 @@ function getChainByName(name) {
1084
1135
 
1085
1136
  // src/types/index.ts
1086
1137
  var CAIP2_IDENTIFIERS = {
1138
+ "hedera:mainnet": "hedera:mainnet",
1139
+ "hedera:testnet": "hedera:testnet",
1087
1140
  // EVM chains
1088
1141
  base: "eip155:8453",
1089
1142
  ethereum: "eip155:1",
@@ -1169,6 +1222,7 @@ function encodeX402Header(header) {
1169
1222
  return encodeBase64Json(header);
1170
1223
  }
1171
1224
  function createX402V1Header(network, payload) {
1225
+ if (getChainByName(network)?.networkType === "hedera") throw new Error("Native Hedera supports only x402 v2");
1172
1226
  return {
1173
1227
  x402Version: 1,
1174
1228
  scheme: "exact",
@@ -1241,6 +1295,11 @@ function validateRecipient(recipient, networkType) {
1241
1295
  );
1242
1296
  }
1243
1297
  break;
1298
+ case "hedera":
1299
+ if (!/^0\.0\.[1-9][0-9]*$/.test(trimmed)) {
1300
+ throw new X402Error("Hedera recipient must be a native numeric account ID", "INVALID_RECIPIENT");
1301
+ }
1302
+ break;
1244
1303
  case "xrpl":
1245
1304
  if (!XRPL_ADDRESS_REGEX.test(trimmed)) {
1246
1305
  throw new X402Error(