uvd-x402-sdk 2.91.0 → 2.92.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 +6 -2
- package/dist/adapters/index.js +88 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +88 -1
- package/dist/adapters/index.mjs.map +1 -1
- package/dist/backend/index.js +88 -1
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/index.mjs +88 -1
- 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/{index-DAC3DRdT.d.mts → index-B-iLEkAH.d.mts} +3 -2
- package/dist/{index-DRSEcZ36.d.ts → index-DkoNhJfq.d.ts} +3 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +88 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -1
- package/dist/index.mjs.map +1 -1
- package/dist/providers/algorand/index.js +88 -1
- package/dist/providers/algorand/index.js.map +1 -1
- package/dist/providers/algorand/index.mjs +88 -1
- package/dist/providers/algorand/index.mjs.map +1 -1
- package/dist/providers/evm/index.js +88 -1
- package/dist/providers/evm/index.js.map +1 -1
- package/dist/providers/evm/index.mjs +88 -1
- package/dist/providers/evm/index.mjs.map +1 -1
- package/dist/providers/near/index.js +88 -1
- package/dist/providers/near/index.js.map +1 -1
- package/dist/providers/near/index.mjs +88 -1
- package/dist/providers/near/index.mjs.map +1 -1
- package/dist/providers/solana/index.js +88 -1
- package/dist/providers/solana/index.js.map +1 -1
- package/dist/providers/solana/index.mjs +88 -1
- package/dist/providers/solana/index.mjs.map +1 -1
- package/dist/providers/stellar/index.js +88 -1
- package/dist/providers/stellar/index.js.map +1 -1
- package/dist/providers/stellar/index.mjs +88 -1
- package/dist/providers/stellar/index.mjs.map +1 -1
- package/dist/providers/sui/index.js +88 -1
- package/dist/providers/sui/index.js.map +1 -1
- package/dist/providers/sui/index.mjs +88 -1
- package/dist/providers/sui/index.mjs.map +1 -1
- package/dist/providers/xrpl/index.js +88 -1
- package/dist/providers/xrpl/index.js.map +1 -1
- package/dist/providers/xrpl/index.mjs +88 -1
- 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 +88 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +88 -1
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/picker/index.js +86 -1
- package/dist/react/picker/index.js.map +1 -1
- package/dist/react/picker/index.mjs +86 -1
- package/dist/react/picker/index.mjs.map +1 -1
- package/dist/utils/index.js +88 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +88 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/chains/index.ts +85 -3
- package/src/index.ts +2 -2
- package/src/types/index.ts +2 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# uvd-x402-sdk
|
|
2
2
|
|
|
3
|
-
Gasless crypto payments across
|
|
3
|
+
Gasless crypto payments across 27 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
|
|
|
@@ -723,7 +723,7 @@ const header = svm.encodePaymentHeader(payload, chainConfig);
|
|
|
723
723
|
|
|
724
724
|
## Supported Networks
|
|
725
725
|
|
|
726
|
-
### EVM (
|
|
726
|
+
### EVM (16)
|
|
727
727
|
|
|
728
728
|
| Network | Chain ID | Tokens |
|
|
729
729
|
|---------|----------|--------|
|
|
@@ -742,6 +742,10 @@ const header = svm.encodePaymentHeader(payload, chainConfig);
|
|
|
742
742
|
| SKALE Base Sepolia | 324705682 | USDC.e |
|
|
743
743
|
| Robinhood Chain | 4663 | USDG |
|
|
744
744
|
| Robinhood Chain Testnet | 46630 | USDG |
|
|
745
|
+
| Arc | 5042 | USDC |
|
|
746
|
+
| Arc Testnet | 5042002 | USDC |
|
|
747
|
+
|
|
748
|
+
> **Arc mainnet and testnet:** payment amounts use 6 decimals and the `USDC` / `2` domain. 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).
|
|
745
749
|
|
|
746
750
|
> **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).
|
|
747
751
|
|
package/dist/adapters/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var ethers = require('ethers');
|
|
|
6
6
|
var DEFAULT_FACILITATOR_URL = "https://facilitator.ultravioletadao.xyz";
|
|
7
7
|
var SUPPORTED_CHAINS = {
|
|
8
8
|
// ============================================================================
|
|
9
|
-
// EVM CHAINS (
|
|
9
|
+
// EVM CHAINS (16 enabled + BSC, disabled)
|
|
10
10
|
// ============================================================================
|
|
11
11
|
base: {
|
|
12
12
|
chainId: 8453,
|
|
@@ -636,6 +636,91 @@ var SUPPORTED_CHAINS = {
|
|
|
636
636
|
enabled: true
|
|
637
637
|
}
|
|
638
638
|
},
|
|
639
|
+
// Arc testnet (Circle). The stablecoin IS the chain's native asset, so the SAME
|
|
640
|
+
// balance is readable at TWO precisions:
|
|
641
|
+
// - native / gas, via eth_getBalance and EIP-1559 fees: 18 decimals
|
|
642
|
+
// - ERC-20 interface, via balanceOf and transferWithAuthorization: 6 decimals
|
|
643
|
+
// (the ERC-20 view is floor(native / 10^12))
|
|
644
|
+
// An x402 payment is an EIP-3009 authorization against the ERC-20 interface, so
|
|
645
|
+
// its `value` is ALWAYS in the 6 of `tokens.usdc.decimals`. Scaling a price with
|
|
646
|
+
// `nativeCurrency.decimals` instead charges 10^12 times the amount: $0.01 would
|
|
647
|
+
// be signed as 10000000000000000 units, i.e. 10 billion USDC. `nativeCurrency`
|
|
648
|
+
// below is correct where it is actually used -- the wallet_addEthereumChain
|
|
649
|
+
// params -- and must never reach `parseUnits` for a payment.
|
|
650
|
+
// Pinned by src/arc-testnet.test.ts.
|
|
651
|
+
//
|
|
652
|
+
// 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.
|
|
654
|
+
arc: {
|
|
655
|
+
chainId: 5042,
|
|
656
|
+
chainIdHex: "0x13b2",
|
|
657
|
+
name: "arc",
|
|
658
|
+
displayName: "Arc",
|
|
659
|
+
networkType: "evm",
|
|
660
|
+
rpcUrl: "https://rpc.mainnet.arc.io",
|
|
661
|
+
explorerUrl: "https://explorer.arc.io",
|
|
662
|
+
nativeCurrency: {
|
|
663
|
+
name: "USD Coin",
|
|
664
|
+
symbol: "USDC",
|
|
665
|
+
decimals: 18
|
|
666
|
+
// gas precision ONLY -- never the scale of a payment
|
|
667
|
+
},
|
|
668
|
+
usdc: {
|
|
669
|
+
address: "0x3600000000000000000000000000000000000000",
|
|
670
|
+
decimals: 6,
|
|
671
|
+
// ERC-20 interface, which is what an EIP-3009 value is denominated in
|
|
672
|
+
name: "USDC",
|
|
673
|
+
// on-chain name(); must match the EIP-712 domain exactly
|
|
674
|
+
version: "2"
|
|
675
|
+
},
|
|
676
|
+
tokens: {
|
|
677
|
+
usdc: {
|
|
678
|
+
address: "0x3600000000000000000000000000000000000000",
|
|
679
|
+
decimals: 6,
|
|
680
|
+
name: "USDC",
|
|
681
|
+
version: "2"
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
x402: {
|
|
685
|
+
facilitatorUrl: DEFAULT_FACILITATOR_URL,
|
|
686
|
+
enabled: true
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
"arc-testnet": {
|
|
690
|
+
chainId: 5042002,
|
|
691
|
+
chainIdHex: "0x4cef52",
|
|
692
|
+
name: "arc-testnet",
|
|
693
|
+
displayName: "Arc Testnet",
|
|
694
|
+
networkType: "evm",
|
|
695
|
+
rpcUrl: "https://rpc.testnet.arc.io",
|
|
696
|
+
explorerUrl: "https://explorer.testnet.arc.io",
|
|
697
|
+
nativeCurrency: {
|
|
698
|
+
name: "USD Coin",
|
|
699
|
+
symbol: "USDC",
|
|
700
|
+
decimals: 18
|
|
701
|
+
// gas precision ONLY -- never the scale of a payment
|
|
702
|
+
},
|
|
703
|
+
usdc: {
|
|
704
|
+
address: "0x3600000000000000000000000000000000000000",
|
|
705
|
+
decimals: 6,
|
|
706
|
+
// ERC-20 interface, which is what an EIP-3009 value is denominated in
|
|
707
|
+
name: "USDC",
|
|
708
|
+
// on-chain name(); must match the EIP-712 domain exactly
|
|
709
|
+
version: "2"
|
|
710
|
+
},
|
|
711
|
+
tokens: {
|
|
712
|
+
usdc: {
|
|
713
|
+
address: "0x3600000000000000000000000000000000000000",
|
|
714
|
+
decimals: 6,
|
|
715
|
+
name: "USDC",
|
|
716
|
+
version: "2"
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
x402: {
|
|
720
|
+
facilitatorUrl: DEFAULT_FACILITATOR_URL,
|
|
721
|
+
enabled: true
|
|
722
|
+
}
|
|
723
|
+
},
|
|
639
724
|
// ============================================================================
|
|
640
725
|
// SVM CHAINS (2 networks) - Solana Virtual Machine
|
|
641
726
|
// ============================================================================
|
|
@@ -1016,6 +1101,8 @@ var CAIP2_IDENTIFIERS = {
|
|
|
1016
1101
|
"skale-base-sepolia": "eip155:324705682",
|
|
1017
1102
|
robinhood: "eip155:4663",
|
|
1018
1103
|
"robinhood-testnet": "eip155:46630",
|
|
1104
|
+
arc: "eip155:5042",
|
|
1105
|
+
"arc-testnet": "eip155:5042002",
|
|
1019
1106
|
// SVM chains
|
|
1020
1107
|
solana: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
1021
1108
|
fogo: "svm:fogo",
|