@zkp2p/sdk 0.12.2-rc.1 → 0.12.2-rc.2
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/dist/build-metadata.json +2 -2
- package/dist/{chunk-QVEW2DTE.mjs → chunk-67JSDBUL.mjs} +3 -3
- package/dist/{chunk-QVEW2DTE.mjs.map → chunk-67JSDBUL.mjs.map} +1 -1
- package/dist/{chunk-NCX4BO7G.mjs → chunk-UQEKVVIN.mjs} +3 -3
- package/dist/{chunk-NCX4BO7G.mjs.map → chunk-UQEKVVIN.mjs.map} +1 -1
- package/dist/{currency-XA62DCJH.mjs → currency-Y5CH6IXG.mjs} +3 -3
- package/dist/{currency-XA62DCJH.mjs.map → currency-Y5CH6IXG.mjs.map} +1 -1
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +14 -11
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-QE6LWS3W.mjs +5 -0
- package/dist/{protocolViewerParsers-KB2FTOE6.mjs.map → protocolViewerParsers-QE6LWS3W.mjs.map} +1 -1
- package/dist/react.mjs +1 -1
- package/dist/{timeout-7UJ6HZ4K.mjs → timeout-CQ4Y2Z4T.mjs} +3 -3
- package/dist/{timeout-7UJ6HZ4K.mjs.map → timeout-CQ4Y2Z4T.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/protocolViewerParsers-KB2FTOE6.mjs +0 -5
package/dist/index.d.mts
CHANGED
|
@@ -736,7 +736,7 @@ declare function resolvePaymentMethodNameFromHash(hash: string, catalog: Payment
|
|
|
736
736
|
*
|
|
737
737
|
* Kept inside the public SDK so its generated declarations and runtime remain
|
|
738
738
|
* self-contained for external consumers. The deployed policy (contracts-v2
|
|
739
|
-
* 0.4.
|
|
739
|
+
* 0.4.1) is full-gross: an intent on a payment method with a non-zero risk
|
|
740
740
|
* window locks the full intent amount 1:1 from the effective stake owner's
|
|
741
741
|
* free stake, so stake-backed capacity IS that free stake. A method with a
|
|
742
742
|
* zero (or absent) risk window admits unbonded and never touches stake.
|
package/dist/index.d.ts
CHANGED
|
@@ -736,7 +736,7 @@ declare function resolvePaymentMethodNameFromHash(hash: string, catalog: Payment
|
|
|
736
736
|
*
|
|
737
737
|
* Kept inside the public SDK so its generated declarations and runtime remain
|
|
738
738
|
* self-contained for external consumers. The deployed policy (contracts-v2
|
|
739
|
-
* 0.4.
|
|
739
|
+
* 0.4.1) is full-gross: an intent on a payment method with a non-zero risk
|
|
740
740
|
* window locks the full intent amount 1:1 from the effective stake owner's
|
|
741
741
|
* free stake, so stake-backed capacity IS that free stake. A method with a
|
|
742
742
|
* zero (or absent) risk window admits unbonded and never touches stake.
|
package/dist/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { IntentGuardianOperations } from './chunk-YA67SM3A.mjs';
|
|
|
2
2
|
export { ZERO_RATE_MANAGER_ID, classifyDelegationState, classifyIntentGuardianError, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-YA67SM3A.mjs';
|
|
3
3
|
import { NetworkError, ValidationError, APIError } from './chunk-3J4FPMPW.mjs';
|
|
4
4
|
export { APIError, ContractError, ErrorCode, NetworkError, ValidationError, ZKP2PError } from './chunk-3J4FPMPW.mjs';
|
|
5
|
-
import { OrchestratorRegistry_default, DisputeProtectionPolicy_default, METHOD_NAME_TO_HASH, matchesQuotePaymentMethod, matchesPaymentMethodNameAndHash, getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, SUPPORTED_PAYMENT_METHOD_HASHES, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash, OrchestratorV3_default, MultiAttestationVerifier_default, DisputeNullifierRegistry_default, DisputeVerifier_default, WhitelistPolicy_default, StakeVault_default, IntentLifecycleHookV1_default } from './chunk-
|
|
6
|
-
export { DISPUTE_PROTECTION_POLICY_ABI, ORCHESTRATOR_V3_ABI, PAYMENT_PLATFORMS, STAKE_VAULT_ABI, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, hasIntentGuardian, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-
|
|
5
|
+
import { OrchestratorRegistry_default, DisputeProtectionPolicy_default, METHOD_NAME_TO_HASH, matchesQuotePaymentMethod, matchesPaymentMethodNameAndHash, getContracts, getRateManagerContracts, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, parseBigIntLike, SUPPORTED_PAYMENT_METHOD_HASHES, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash, OrchestratorV3_default, MultiAttestationVerifier_default, DisputeNullifierRegistry_default, DisputeVerifier_default, WhitelistPolicy_default, StakeVault_default, IntentLifecycleHookV1_default } from './chunk-67JSDBUL.mjs';
|
|
6
|
+
export { DISPUTE_PROTECTION_POLICY_ABI, ORCHESTRATOR_V3_ABI, PAYMENT_PLATFORMS, STAKE_VAULT_ABI, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, hasIntentGuardian, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-67JSDBUL.mjs';
|
|
7
7
|
import { Currency, currencyKeccak256 } from './chunk-ZB22BZLZ.mjs';
|
|
8
8
|
export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchainMinRate } from './chunk-ZB22BZLZ.mjs';
|
|
9
|
-
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-
|
|
9
|
+
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-UQEKVVIN.mjs';
|
|
10
10
|
import { concatHex, encodeFunctionData, encodeAbiParameters, createPublicClient, http, isAddress, zeroAddress, keccak256, formatUnits } from 'viem';
|
|
11
11
|
import { hardhat, base } from 'viem/chains';
|
|
12
12
|
import { createEncryptedBuyerTeeSessionMaterial as createEncryptedBuyerTeeSessionMaterial$1, createEncryptedSellerCredentialUpload } from '@zkp2p/zkp2p-attestation';
|
|
@@ -357,7 +357,7 @@ async function withRetry(fn, maxRetries = 3, delayMs = 1e3, timeoutMs) {
|
|
|
357
357
|
for (let i = 0; i < maxRetries; i++) {
|
|
358
358
|
try {
|
|
359
359
|
if (timeoutMs) {
|
|
360
|
-
const { withTimeout } = await import('./timeout-
|
|
360
|
+
const { withTimeout } = await import('./timeout-CQ4Y2Z4T.mjs');
|
|
361
361
|
return await withTimeout(fn(), timeoutMs, `Operation timed out after ${timeoutMs}ms`);
|
|
362
362
|
}
|
|
363
363
|
return await fn();
|
|
@@ -1898,7 +1898,7 @@ var ProtocolViewerReader = class {
|
|
|
1898
1898
|
if (inputCount === null) {
|
|
1899
1899
|
throw new Error("Configured ProtocolViewer ABI does not expose getDeposit");
|
|
1900
1900
|
}
|
|
1901
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
1901
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-QE6LWS3W.mjs');
|
|
1902
1902
|
if (inputCount >= 3) {
|
|
1903
1903
|
return tryContexts(
|
|
1904
1904
|
protocolViewerContexts,
|
|
@@ -1984,7 +1984,7 @@ var ProtocolViewerReader = class {
|
|
|
1984
1984
|
return Promise.all(ids.map((id) => this.config.host.getPvDepositById(id)));
|
|
1985
1985
|
}
|
|
1986
1986
|
const bn = ids.map((id) => typeof id === "bigint" ? id : parseRawDepositId(id));
|
|
1987
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
1987
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-QE6LWS3W.mjs');
|
|
1988
1988
|
if (inputCount >= 2) {
|
|
1989
1989
|
const requests = ids.map((id, index) => ({
|
|
1990
1990
|
index,
|
|
@@ -2089,7 +2089,7 @@ var ProtocolViewerReader = class {
|
|
|
2089
2089
|
if (!protocolViewerAddress || !protocolViewerAbi || inputCount === null) {
|
|
2090
2090
|
return this.config.host.getPvAccountDepositsFromIndexer(owner);
|
|
2091
2091
|
}
|
|
2092
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
2092
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-QE6LWS3W.mjs');
|
|
2093
2093
|
const { address, abi } = this.config.host.requireProtocolViewer();
|
|
2094
2094
|
if (inputCount >= 2) {
|
|
2095
2095
|
const readAndFilter = async (raw2) => {
|
|
@@ -2160,7 +2160,7 @@ var ProtocolViewerReader = class {
|
|
|
2160
2160
|
if (protocolViewerEntries.length === 0) {
|
|
2161
2161
|
throw new Error("ProtocolViewer not available for this network");
|
|
2162
2162
|
}
|
|
2163
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
2163
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-QE6LWS3W.mjs');
|
|
2164
2164
|
const intentsByHash = /* @__PURE__ */ new Map();
|
|
2165
2165
|
let attemptedRead = false;
|
|
2166
2166
|
let hadSuccessfulRead = false;
|
|
@@ -2268,7 +2268,7 @@ var ProtocolViewerReader = class {
|
|
|
2268
2268
|
if (protocolViewerEntries.length === 0) {
|
|
2269
2269
|
throw new Error("ProtocolViewer not available for this network");
|
|
2270
2270
|
}
|
|
2271
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
2271
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-QE6LWS3W.mjs');
|
|
2272
2272
|
let lastError;
|
|
2273
2273
|
for (const pvEntry of protocolViewerEntries) {
|
|
2274
2274
|
const inputCount = this.pvEntryFunctionInputCount(pvEntry, "getIntent");
|
|
@@ -4850,6 +4850,9 @@ function resolveSignalableEscrow(chainId, runtimeEnv) {
|
|
|
4850
4850
|
return void 0;
|
|
4851
4851
|
}
|
|
4852
4852
|
}
|
|
4853
|
+
function hasDisputeProtectionFields(row) {
|
|
4854
|
+
return typeof row.disputeProtectionOptedIn === "boolean" && typeof row.disputeProtectionRequiresStake === "boolean";
|
|
4855
|
+
}
|
|
4853
4856
|
function isSignalableEscrowRow(rowEscrowAddress, signalableEscrow) {
|
|
4854
4857
|
if (!signalableEscrow) return true;
|
|
4855
4858
|
if (!rowEscrowAddress) return true;
|
|
@@ -4876,7 +4879,7 @@ async function apiGetOrderbookTable(params, optsOrBaseApiUrl, timeoutMs) {
|
|
|
4876
4879
|
return {
|
|
4877
4880
|
...responseObject,
|
|
4878
4881
|
rows: responseObject.rows.filter(
|
|
4879
|
-
(row) => matchesPaymentMethodNameAndHash(row.paymentPlatform, row.paymentMethodHash) && isSignalableEscrowRow(row.escrowAddress, signalableEscrow)
|
|
4882
|
+
(row) => hasDisputeProtectionFields(row) && matchesPaymentMethodNameAndHash(row.paymentPlatform, row.paymentMethodHash) && isSignalableEscrowRow(row.escrowAddress, signalableEscrow)
|
|
4880
4883
|
)
|
|
4881
4884
|
};
|
|
4882
4885
|
}
|
|
@@ -10679,7 +10682,7 @@ var Zkp2pClient = class {
|
|
|
10679
10682
|
}
|
|
10680
10683
|
}
|
|
10681
10684
|
});
|
|
10682
|
-
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-
|
|
10685
|
+
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-Y5CH6IXG.mjs');
|
|
10683
10686
|
currencies = mapConversionRatesToOnchainMinRate2(
|
|
10684
10687
|
params.conversionRates,
|
|
10685
10688
|
paymentMethods.length
|