uvd-x402-sdk 2.106.0 → 2.107.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 +7 -1
- package/dist/adapters/index.js +56 -3
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +56 -3
- 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 +96 -22
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/index.mjs +96 -22
- package/dist/backend/index.mjs.map +1 -1
- package/dist/erc8128/index.js +2 -0
- package/dist/erc8128/index.js.map +1 -1
- package/dist/erc8128/index.mjs +2 -0
- package/dist/erc8128/index.mjs.map +1 -1
- package/dist/{escrow-contracts-RTO6mJCW.d.ts → escrow-contracts-Bbr_osYS.d.ts} +2 -1
- package/dist/{escrow-contracts-D3iLODtY.d.mts → escrow-contracts-Fa138lPh.d.mts} +2 -1
- package/dist/{index-jNJd8jEb.d.mts → index-D9l_j3c-.d.mts} +2 -2
- package/dist/{index-CZHgEr58.d.ts → index-DmdTO8VO.d.ts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +96 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -22
- package/dist/index.mjs.map +1 -1
- package/dist/providers/algorand/index.js +56 -3
- package/dist/providers/algorand/index.js.map +1 -1
- package/dist/providers/algorand/index.mjs +56 -3
- package/dist/providers/algorand/index.mjs.map +1 -1
- package/dist/providers/evm/index.js +56 -3
- package/dist/providers/evm/index.js.map +1 -1
- package/dist/providers/evm/index.mjs +56 -3
- package/dist/providers/evm/index.mjs.map +1 -1
- package/dist/providers/near/index.js +56 -3
- package/dist/providers/near/index.js.map +1 -1
- package/dist/providers/near/index.mjs +56 -3
- package/dist/providers/near/index.mjs.map +1 -1
- package/dist/providers/solana/index.js +56 -3
- package/dist/providers/solana/index.js.map +1 -1
- package/dist/providers/solana/index.mjs +56 -3
- package/dist/providers/solana/index.mjs.map +1 -1
- package/dist/providers/stellar/index.js +56 -3
- package/dist/providers/stellar/index.js.map +1 -1
- package/dist/providers/stellar/index.mjs +56 -3
- package/dist/providers/stellar/index.mjs.map +1 -1
- package/dist/providers/sui/index.js +56 -3
- package/dist/providers/sui/index.js.map +1 -1
- package/dist/providers/sui/index.mjs +56 -3
- package/dist/providers/sui/index.mjs.map +1 -1
- package/dist/providers/xrpl/index.js +56 -3
- package/dist/providers/xrpl/index.js.map +1 -1
- package/dist/providers/xrpl/index.mjs +56 -3
- package/dist/providers/xrpl/index.mjs.map +1 -1
- package/dist/react/index.d.mts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +56 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +56 -3
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/picker/index.js +54 -3
- package/dist/react/picker/index.js.map +1 -1
- package/dist/react/picker/index.mjs +54 -3
- package/dist/react/picker/index.mjs.map +1 -1
- package/dist/reputation/index.d.mts +1 -1
- package/dist/reputation/index.d.ts +1 -1
- package/dist/reputation/index.js +54 -3
- package/dist/reputation/index.js.map +1 -1
- package/dist/reputation/index.mjs +54 -3
- package/dist/reputation/index.mjs.map +1 -1
- package/dist/utils/index.js +56 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +56 -3
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/backend/index.ts +59 -28
- package/src/chains/index.ts +56 -4
- package/src/index.ts +2 -2
- package/src/types/index.ts +2 -0
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Users sign a message or transaction, and the Ultravioleta facilitator handles on
|
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- **
|
|
13
|
+
- **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
14
|
- **Multi-Stablecoin**: USDC, EURC, AUSD, PYUSD, USDT, USDG (Robinhood Chain)
|
|
15
15
|
- **x402 v1 & v2**: Protocol auto-detection; native Hedera supports v2/exact only
|
|
16
16
|
- **Gasless**: Facilitator pays all network fees
|
|
@@ -813,6 +813,8 @@ const header = svm.encodePaymentHeader(payload, chainConfig);
|
|
|
813
813
|
| Scroll | 534352 | USDC |
|
|
814
814
|
| SKALE Base | 1187947933 | USDC.e |
|
|
815
815
|
| SKALE Base Sepolia | 324705682 | USDC.e |
|
|
816
|
+
| HashKey Chain | 177 | USDC |
|
|
817
|
+
| HashKey Chain Testnet | 133 | USDC |
|
|
816
818
|
| Robinhood Chain | 4663 | USDG |
|
|
817
819
|
| Robinhood Chain Testnet | 46630 | USDG |
|
|
818
820
|
| Arc | 5042 | USDC, EURC |
|
|
@@ -820,6 +822,8 @@ const header = svm.encodePaymentHeader(payload, chainConfig);
|
|
|
820
822
|
|
|
821
823
|
> **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
824
|
|
|
825
|
+
> **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).
|
|
826
|
+
|
|
823
827
|
> **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
828
|
|
|
825
829
|
### SVM (2)
|
|
@@ -882,6 +886,8 @@ getFacilitatorAddress('xrpl-mainnet'); // rfADKk...
|
|
|
882
886
|
|
|
883
887
|
## Backend
|
|
884
888
|
|
|
889
|
+
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.
|
|
890
|
+
|
|
885
891
|
```typescript
|
|
886
892
|
import {
|
|
887
893
|
FacilitatorClient,
|
package/dist/adapters/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var SUPPORTED_CHAINS = {
|
|
|
36
36
|
x402: { facilitatorUrl: DEFAULT_FACILITATOR_URL, enabled: true }
|
|
37
37
|
},
|
|
38
38
|
// ============================================================================
|
|
39
|
-
// EVM CHAINS (
|
|
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: "
|
|
445
|
-
// USD₮0
|
|
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",
|