@zkp2p/sdk 0.16.0-rc.2 → 0.16.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 +2 -4
- package/dist/build-metadata.json +2 -2
- package/dist/{chunk-HJBGLG7B.mjs → chunk-4UV5XMBU.mjs} +3 -3
- package/dist/{chunk-HJBGLG7B.mjs.map → chunk-4UV5XMBU.mjs.map} +1 -1
- package/dist/chunk-LBUSUTNI.mjs +12 -0
- package/dist/chunk-LBUSUTNI.mjs.map +1 -0
- package/dist/{currency-C5NRMALA.mjs → currency-6EFHONXS.mjs} +3 -3
- package/dist/{currency-C5NRMALA.mjs.map → currency-6EFHONXS.mjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/protocolViewerParsers-LD72M77T.mjs +5 -0
- package/dist/{protocolViewerParsers-BFM6TWI6.mjs.map → protocolViewerParsers-LD72M77T.mjs.map} +1 -1
- package/dist/react.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-WHTCQ6GA.mjs +0 -12
- package/dist/chunk-WHTCQ6GA.mjs.map +0 -1
- package/dist/protocolViewerParsers-BFM6TWI6.mjs +0 -5
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IntentGuardianOperations } from './chunk-RZFNRIED.mjs';
|
|
2
2
|
export { ZERO_RATE_MANAGER_ID, classifyDelegationState, classifyIntentGuardianError, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-RZFNRIED.mjs';
|
|
3
|
-
import { STAKE_VAULT_V2_ABI, ORCHESTRATOR_V4_ABI, METHOD_NAME_TO_HASH, matchesQuotePaymentMethod, matchesPaymentMethodNameAndHash, getDisputeStackAbis, getContracts, getRateManagerContracts, DISPUTE_PROTECTION_POLICY_ABI, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, DISPUTE_PROTECTION_POLICY_V2_ABI, parseBigIntLike, SUPPORTED_PAYMENT_METHOD_HASHES, getKnownStakeVaultContracts, getOrchestratorV4Contract, getOrchestratorV3Contract, getDisputeProtectionPolicyV2Contract, getDisputeProtectionPolicyContract, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash, pickAddress, baseStaging_default, base_default } from './chunk-
|
|
4
|
-
export { DISPUTE_PROTECTION_POLICY_ABI, DISPUTE_PROTECTION_POLICY_V2_ABI, ORCHESTRATOR_V3_ABI, ORCHESTRATOR_V4_ABI, PAYMENT_PLATFORMS, STAKE_VAULT_ABI, STAKE_VAULT_V2_ABI, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getDisputeProtectionPolicyV2Contract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getOrchestratorV4Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, getStakeVaultV2Contract, hasIntentGuardian, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-
|
|
3
|
+
import { STAKE_VAULT_V2_ABI, ORCHESTRATOR_V4_ABI, METHOD_NAME_TO_HASH, matchesQuotePaymentMethod, matchesPaymentMethodNameAndHash, getDisputeStackAbis, getContracts, getRateManagerContracts, DISPUTE_PROTECTION_POLICY_ABI, getPaymentMethodsCatalog, resolvePaymentMethodHashFromCatalog, getGatingServiceAddress, DISPUTE_PROTECTION_POLICY_V2_ABI, parseBigIntLike, SUPPORTED_PAYMENT_METHOD_HASHES, getKnownStakeVaultContracts, getOrchestratorV4Contract, getOrchestratorV3Contract, getDisputeProtectionPolicyV2Contract, getDisputeProtectionPolicyContract, resolveFiatCurrencyBytes32, resolvePaymentMethodNameFromHash, pickAddress, baseStaging_default, base_default } from './chunk-4UV5XMBU.mjs';
|
|
4
|
+
export { DISPUTE_PROTECTION_POLICY_ABI, DISPUTE_PROTECTION_POLICY_V2_ABI, ORCHESTRATOR_V3_ABI, ORCHESTRATOR_V4_ABI, PAYMENT_PLATFORMS, STAKE_VAULT_ABI, STAKE_VAULT_V2_ABI, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getDisputeProtectionPolicyV2Contract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getOrchestratorV4Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, getStakeVaultV2Contract, hasIntentGuardian, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash } from './chunk-4UV5XMBU.mjs';
|
|
5
5
|
import { Currency, currencyKeccak256, getCurrencyCodeFromHash, currencyInfo } from './chunk-PMFXZGDQ.mjs';
|
|
6
6
|
export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchainMinRate } from './chunk-PMFXZGDQ.mjs';
|
|
7
|
-
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-
|
|
7
|
+
import { define_ZKP2P_SDK_BUILD_METADATA_default } from './chunk-LBUSUTNI.mjs';
|
|
8
8
|
import { parseUnits, parseAbi, keccak256, isAddress, isAddressEqual, zeroAddress, decodeEventLog, isHex, concatHex, encodeFunctionData, encodeAbiParameters, zeroHash, createPublicClient, http, getAddress, stringToBytes, createWalletClient, parseEventLogs, formatUnits } from 'viem';
|
|
9
9
|
import { hardhat, base } from 'viem/chains';
|
|
10
10
|
import { hashUtf8, createNitroAttestationClient, verifySellerCredentialBundle, NitroAttestationError, createEncryptedBuyerTeeSessionMaterial as createEncryptedBuyerTeeSessionMaterial$1, createEncryptedDisputeSessionMaterial as createEncryptedDisputeSessionMaterial$1, createEncryptedSellerCredentialUpload } from '@zkp2p/zkp2p-attestation';
|
|
@@ -3190,7 +3190,7 @@ var ProtocolViewerReader = class {
|
|
|
3190
3190
|
if (inputCount === null) {
|
|
3191
3191
|
throw new Error("Configured ProtocolViewer ABI does not expose getDeposit");
|
|
3192
3192
|
}
|
|
3193
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
3193
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-LD72M77T.mjs');
|
|
3194
3194
|
if (inputCount >= 3) {
|
|
3195
3195
|
return tryContexts(
|
|
3196
3196
|
protocolViewerContexts,
|
|
@@ -3280,7 +3280,7 @@ var ProtocolViewerReader = class {
|
|
|
3280
3280
|
return Promise.all(ids.map((id) => this.config.host.getPvDepositById(id)));
|
|
3281
3281
|
}
|
|
3282
3282
|
const bn = ids.map((id) => typeof id === "bigint" ? id : parseRawDepositId(id));
|
|
3283
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
3283
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-LD72M77T.mjs');
|
|
3284
3284
|
if (inputCount >= 2) {
|
|
3285
3285
|
const requests = ids.map((id, index) => ({
|
|
3286
3286
|
index,
|
|
@@ -3397,7 +3397,7 @@ var ProtocolViewerReader = class {
|
|
|
3397
3397
|
if (!protocolViewerAddress || !protocolViewerAbi || inputCount === null) {
|
|
3398
3398
|
return this.config.host.getPvAccountDepositsFromIndexer(owner);
|
|
3399
3399
|
}
|
|
3400
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
3400
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-LD72M77T.mjs');
|
|
3401
3401
|
const { address: address3, abi } = this.config.host.requireProtocolViewer();
|
|
3402
3402
|
if (inputCount >= 2) {
|
|
3403
3403
|
const readAndFilter = async (raw2) => {
|
|
@@ -3485,7 +3485,7 @@ var ProtocolViewerReader = class {
|
|
|
3485
3485
|
if (typeof raw !== "object" || raw === null || !("intentHash" in raw) || !isHex(raw.intentHash, { strict: true }) || raw.intentHash.length !== 66 || !("intent" in raw) || !("deposit" in raw)) {
|
|
3486
3486
|
throw new Error("Malformed ProtocolViewerV4 intent view");
|
|
3487
3487
|
}
|
|
3488
|
-
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-
|
|
3488
|
+
const { parseDepositView: parseDepositView2 } = await import('./protocolViewerParsers-LD72M77T.mjs');
|
|
3489
3489
|
const { depositId, deposit, availableLiquidity, paymentMethods } = parseDepositView2(
|
|
3490
3490
|
raw.deposit
|
|
3491
3491
|
);
|
|
@@ -3515,7 +3515,7 @@ var ProtocolViewerReader = class {
|
|
|
3515
3515
|
if (protocolViewerEntries.length === 0 && !v4) {
|
|
3516
3516
|
throw new Error("ProtocolViewer not available for this network");
|
|
3517
3517
|
}
|
|
3518
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
3518
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-LD72M77T.mjs');
|
|
3519
3519
|
const intentsByHash = /* @__PURE__ */ new Map();
|
|
3520
3520
|
let attemptedRead = Boolean(v4);
|
|
3521
3521
|
let hadSuccessfulRead = false;
|
|
@@ -3660,7 +3660,7 @@ var ProtocolViewerReader = class {
|
|
|
3660
3660
|
if (protocolViewerEntries.length === 0) {
|
|
3661
3661
|
throw new Error("ProtocolViewer not available for this network");
|
|
3662
3662
|
}
|
|
3663
|
-
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-
|
|
3663
|
+
const { parseIntentView: parseIntentView2 } = await import('./protocolViewerParsers-LD72M77T.mjs');
|
|
3664
3664
|
for (const pvEntry of protocolViewerEntries) {
|
|
3665
3665
|
const inputCount = this.pvEntryFunctionInputCount(pvEntry, "getIntent");
|
|
3666
3666
|
if (inputCount === null) {
|
|
@@ -13641,7 +13641,7 @@ var Zkp2pClient = class {
|
|
|
13641
13641
|
}
|
|
13642
13642
|
}
|
|
13643
13643
|
});
|
|
13644
|
-
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-
|
|
13644
|
+
const { mapConversionRatesToOnchainMinRate: mapConversionRatesToOnchainMinRate2 } = await import('./currency-6EFHONXS.mjs');
|
|
13645
13645
|
currencies = mapConversionRatesToOnchainMinRate2(
|
|
13646
13646
|
params.conversionRates,
|
|
13647
13647
|
paymentMethods.length
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-4UV5XMBU.mjs';
|
|
2
|
+
import './chunk-PMFXZGDQ.mjs';
|
|
3
|
+
import './chunk-LBUSUTNI.mjs';
|
|
4
|
+
//# sourceMappingURL=protocolViewerParsers-LD72M77T.mjs.map
|
|
5
|
+
//# sourceMappingURL=protocolViewerParsers-LD72M77T.mjs.map
|
package/dist/{protocolViewerParsers-BFM6TWI6.mjs.map → protocolViewerParsers-LD72M77T.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-LD72M77T.mjs"}
|
package/dist/react.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { asErrorMessage, ZERO_ADDRESS, getDelegationRoute, assertDelegationMethodSupport, prepareClearDelegationTx, normalizeRateManagerId, normalizeRegistry, isZeroRateManagerId, assertAtomicDelegationSwitchSupport, prepareSetDelegationTx, classifyIntentGuardianError } from './chunk-RZFNRIED.mjs';
|
|
2
2
|
export { ZERO_ADDRESS as VAULT_ZERO_ADDRESS, ZERO_RATE_MANAGER_ID, asErrorMessage, assertDelegationMethodSupport, classifyDelegationState, getDelegationRoute, isZeroRateManagerId, normalizeRateManagerId, normalizeRegistry } from './chunk-RZFNRIED.mjs';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-LBUSUTNI.mjs';
|
|
4
4
|
import { useState, useCallback, useMemo } from 'react';
|
|
5
5
|
|
|
6
6
|
function useCreateDeposit({ client, onSuccess, onError }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkp2p/sdk",
|
|
3
|
-
"version": "0.16.0
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Peer SDK - sell USDC for fiat with peer.sell(), buy USDC with peer.buy(), and the lower-level ZKP2P client for deposits, intents and liquidity",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"homepage": "https://github.com/zkp2p/zkp2p-clients/tree/main/packages/sdk#readme",
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public",
|
|
72
|
-
"tag": "
|
|
72
|
+
"tag": "latest"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=22"
|
package/dist/chunk-WHTCQ6GA.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// <define:__ZKP2P_SDK_BUILD_METADATA__>
|
|
8
|
-
var define_ZKP2P_SDK_BUILD_METADATA_default = { schemaVersion: 2, source: { repository: "zkp2p/zkp2p-clients", commitSha: "88bcfc628829c0cb9ef666d70bec182015325b54", kind: "github", distributable: true }, sdkPackageVersion: "0.16.0-rc.2", contractsPackageVersion: "0.4.4-rc.13", indexerSchemaPackageVersion: "0.23.0-rc.0", activeDisputeStack: { base: { version: 2, selectionHash: "ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c" }, baseStaging: { version: 2, selectionHash: "6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9" } } };
|
|
9
|
-
|
|
10
|
-
export { __export, define_ZKP2P_SDK_BUILD_METADATA_default };
|
|
11
|
-
//# sourceMappingURL=chunk-WHTCQ6GA.mjs.map
|
|
12
|
-
//# sourceMappingURL=chunk-WHTCQ6GA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["%3Cdefine:__ZKP2P_SDK_BUILD_METADATA__%3E"],"names":[],"mappings":";;;;;;;AAAA,IAAA,uCAAA,GAAA,EAAC,aAAA,EAAgB,CAAA,EAAE,MAAA,EAAS,EAAC,YAAa,qBAAA,EAAsB,SAAA,EAAY,0CAAA,EAA2C,IAAA,EAAO,UAAS,aAAA,EAAgB,IAAA,EAAI,EAAE,iBAAA,EAAoB,eAAc,uBAAA,EAA0B,aAAA,EAAc,2BAAA,EAA8B,aAAA,EAAc,oBAAqB,EAAC,IAAA,EAAO,EAAC,OAAA,EAAU,GAAE,aAAA,EAAgB,kEAAA,EAAkE,EAAE,WAAA,EAAc,EAAC,OAAA,EAAU,CAAA,EAAE,aAAA,EAAgB,kEAAA,IAAmE","file":"chunk-WHTCQ6GA.mjs","sourcesContent":["{\"schemaVersion\":2,\"source\":{\"repository\":\"zkp2p/zkp2p-clients\",\"commitSha\":\"88bcfc628829c0cb9ef666d70bec182015325b54\",\"kind\":\"github\",\"distributable\":true},\"sdkPackageVersion\":\"0.16.0-rc.2\",\"contractsPackageVersion\":\"0.4.4-rc.13\",\"indexerSchemaPackageVersion\":\"0.23.0-rc.0\",\"activeDisputeStack\":{\"base\":{\"version\":2,\"selectionHash\":\"ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c\"},\"baseStaging\":{\"version\":2,\"selectionHash\":\"6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9\"}}}"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-HJBGLG7B.mjs';
|
|
2
|
-
import './chunk-PMFXZGDQ.mjs';
|
|
3
|
-
import './chunk-WHTCQ6GA.mjs';
|
|
4
|
-
//# sourceMappingURL=protocolViewerParsers-BFM6TWI6.mjs.map
|
|
5
|
-
//# sourceMappingURL=protocolViewerParsers-BFM6TWI6.mjs.map
|