uvd-x402-sdk 2.103.0 → 2.104.1
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 +2 -1
- package/dist/adapters/index.js +3 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +3 -0
- 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 +143 -130
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/index.mjs +143 -130
- package/dist/backend/index.mjs.map +1 -1
- package/dist/{index-CLlhFKbm.d.ts → escrow-contracts-C59jszp3.d.ts} +93 -30
- package/dist/{index-fImniLTl.d.mts → escrow-contracts-Dgcyu7Fh.d.mts} +93 -30
- package/dist/index.d.mts +75 -9
- package/dist/index.d.ts +75 -9
- package/dist/index.js +415 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +411 -43
- package/dist/index.mjs.map +1 -1
- package/dist/providers/algorand/index.js +3 -0
- package/dist/providers/algorand/index.js.map +1 -1
- package/dist/providers/algorand/index.mjs +3 -0
- package/dist/providers/algorand/index.mjs.map +1 -1
- package/dist/providers/evm/index.js +3 -0
- package/dist/providers/evm/index.js.map +1 -1
- package/dist/providers/evm/index.mjs +3 -0
- package/dist/providers/evm/index.mjs.map +1 -1
- package/dist/providers/near/index.js +3 -0
- package/dist/providers/near/index.js.map +1 -1
- package/dist/providers/near/index.mjs +3 -0
- package/dist/providers/near/index.mjs.map +1 -1
- package/dist/providers/solana/index.js +3 -0
- package/dist/providers/solana/index.js.map +1 -1
- package/dist/providers/solana/index.mjs +3 -0
- package/dist/providers/solana/index.mjs.map +1 -1
- package/dist/providers/stellar/index.js +3 -0
- package/dist/providers/stellar/index.js.map +1 -1
- package/dist/providers/stellar/index.mjs +3 -0
- package/dist/providers/stellar/index.mjs.map +1 -1
- package/dist/providers/sui/index.js +3 -0
- package/dist/providers/sui/index.js.map +1 -1
- package/dist/providers/sui/index.mjs +3 -0
- package/dist/providers/sui/index.mjs.map +1 -1
- package/dist/providers/xrpl/index.js +3 -0
- package/dist/providers/xrpl/index.js.map +1 -1
- package/dist/providers/xrpl/index.mjs +3 -0
- package/dist/providers/xrpl/index.mjs.map +1 -1
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +3 -0
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/picker/index.js.map +1 -1
- package/dist/react/picker/index.mjs.map +1 -1
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +3 -0
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/backend/index.ts +8 -157
- package/src/chains/index.ts +4 -1
- package/src/escrow-contracts.ts +254 -0
- package/src/escrow-preauth.ts +426 -30
- package/src/fixtures/escrow-operator-snapshot.json +3 -2
- package/src/index.ts +4 -0
package/README.md
CHANGED
|
@@ -675,6 +675,7 @@ import { buildEscrowPreAuth, EnvKeyAdapter } from 'uvd-x402-sdk';
|
|
|
675
675
|
// (e.g. Execution Market's GET /api/v1/h2a/payment-config).
|
|
676
676
|
const paymentAuth = await buildEscrowPreAuth(new EnvKeyAdapter(), {
|
|
677
677
|
networkConfig: config.escrow.networks.base,
|
|
678
|
+
network: 'base', // its chain_id must be the chain this SDK registers for it
|
|
678
679
|
payerWallet: '0xPublisher...',
|
|
679
680
|
workerWallet: '0xWorker...', // escrow receiver — committed by the nonce
|
|
680
681
|
bountyAtomic: '100000', // $0.10 in 6-decimal USDC
|
|
@@ -683,7 +684,7 @@ const paymentAuth = await buildEscrowPreAuth(new EnvKeyAdapter(), {
|
|
|
683
684
|
// Send as the X-Payment-Auth header (raw JSON, NOT base64).
|
|
684
685
|
```
|
|
685
686
|
|
|
686
|
-
Any `SigningWalletAdapter` works as the signer (only `signTypedData` is used); browser wallets can pass a minimal `{ signTypedData }` wrapper. Validation fails loud instead of falling back: incomplete network config, unknown tier, bounty outside the on-chain deposit limit ($100), or a `maxFeeBps` below the operator's 1300 bps all throw before anything is signed. `computeEscrowNonce` is exported to reproduce `AuthCaptureEscrow.getHash` externally.
|
|
687
|
+
Any `SigningWalletAdapter` works as the signer (only `signTypedData` is used); browser wallets can pass a minimal `{ signTypedData }` wrapper. Validation fails loud instead of falling back: incomplete network config, unknown tier, bounty outside the on-chain deposit limit ($100), or a `maxFeeBps` below the operator's 1300 bps all throw before anything is signed. What the config asserts is also checked against the SDK's own tables before signing, as in the Python SDK: the `chain_id` against the `network` you name (a registry name or `eip155:<id>`), the escrow, token collector and USDC against `ESCROW_CONTRACTS`, the operator against `ESCROW_OPERATORS`, and `maxFeeBps` against the chain's ceiling in `ESCROW_MAX_FEE_BPS`. A contradiction throws `INVALID_CONFIG`, and so do a `network` the SDK does not register and a chain without a row in each of the three tables, with or without `network`; name the network you expect to pay on, from your own code, never one read from the config. A server-published tier window must be an integer from 0 to its `ESCROW_TIER_WINDOW_MAX`, and `authorizationExpiry` at most `ESCROW_MAX_AUTHORIZATION_SEC` after now: past either, the SDK refuses, it never clamps. `computeEscrowNonce` is exported to reproduce `AuthCaptureEscrow.getHash` externally.
|
|
687
688
|
|
|
688
689
|
## Multi-Stablecoin (EVM)
|
|
689
690
|
|
package/dist/adapters/index.js
CHANGED
|
@@ -1126,6 +1126,9 @@ var SUPPORTED_CHAINS = {
|
|
|
1126
1126
|
var CHAIN_ALIASES = {
|
|
1127
1127
|
hedera: "hedera:mainnet",
|
|
1128
1128
|
"hedera-testnet": "hedera:testnet",
|
|
1129
|
+
// Execution Market's and Karmakadabra's keys for SKALE Base.
|
|
1130
|
+
skale: "skale-base",
|
|
1131
|
+
"skale-testnet": "skale-base-sepolia",
|
|
1129
1132
|
// Renamed in 2.85.0: the facilitator advertises the mainnet as `xrpl`.
|
|
1130
1133
|
"xrpl-mainnet": "xrpl"
|
|
1131
1134
|
};
|