@zkp2p/sdk 0.12.1 → 0.12.2-rc.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 +96 -24
- package/dist/build-metadata.json +22 -0
- package/dist/{chunk-GHQK65J2.mjs → chunk-3J4FPMPW.mjs} +2 -2
- package/dist/{chunk-GHQK65J2.mjs.map → chunk-3J4FPMPW.mjs.map} +1 -1
- package/dist/chunk-NCX4BO7G.mjs +12 -0
- package/dist/chunk-NCX4BO7G.mjs.map +1 -0
- package/dist/{chunk-DZQOCRT4.mjs → chunk-QVEW2DTE.mjs} +373 -373
- package/dist/{chunk-DZQOCRT4.mjs.map → chunk-QVEW2DTE.mjs.map} +1 -1
- package/dist/{chunk-FCOH36IX.mjs → chunk-YA67SM3A.mjs} +2 -2
- package/dist/{chunk-FCOH36IX.mjs.map → chunk-YA67SM3A.mjs.map} +1 -1
- package/dist/{chunk-ZFBH4HD7.mjs → chunk-ZB22BZLZ.mjs} +2 -2
- package/dist/{chunk-ZFBH4HD7.mjs.map → chunk-ZB22BZLZ.mjs.map} +1 -1
- package/dist/{currency-MARF3D2J.mjs → currency-XA62DCJH.mjs} +4 -4
- package/dist/{currency-MARF3D2J.mjs.map → currency-XA62DCJH.mjs.map} +1 -1
- package/dist/index.cjs +2263 -561
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +34 -9
- package/dist/index.d.ts +34 -9
- package/dist/index.mjs +1638 -105
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-KB2FTOE6.mjs +5 -0
- package/dist/{protocolViewerParsers-WK2QPJH7.mjs.map → protocolViewerParsers-KB2FTOE6.mjs.map} +1 -1
- package/dist/react.cjs +41 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +15 -3
- package/dist/react.d.ts +15 -3
- package/dist/react.mjs +44 -4
- package/dist/react.mjs.map +1 -1
- package/dist/{timeout-YLP3WHZF.mjs → timeout-7UJ6HZ4K.mjs} +4 -4
- package/dist/{timeout-YLP3WHZF.mjs.map → timeout-7UJ6HZ4K.mjs.map} +1 -1
- package/dist/{vaultUtils-Bc9KwywX.d.mts → vaultUtils-Dla_eG15.d.mts} +206 -43
- package/dist/{vaultUtils-Bc9KwywX.d.ts → vaultUtils-Dla_eG15.d.ts} +206 -43
- package/package.json +23 -22
- package/dist/chunk-J5LGTIGS.mjs +0 -9
- package/dist/chunk-J5LGTIGS.mjs.map +0 -1
- package/dist/protocolViewerParsers-WK2QPJH7.mjs +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { enrichPvDepositView, enrichPvIntentView, parseDepositView, parseIntentView } from './chunk-QVEW2DTE.mjs';
|
|
2
|
+
import './chunk-ZB22BZLZ.mjs';
|
|
3
|
+
import './chunk-NCX4BO7G.mjs';
|
|
4
|
+
//# sourceMappingURL=protocolViewerParsers-KB2FTOE6.mjs.map
|
|
5
|
+
//# sourceMappingURL=protocolViewerParsers-KB2FTOE6.mjs.map
|
package/dist/{protocolViewerParsers-WK2QPJH7.mjs.map → protocolViewerParsers-KB2FTOE6.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"protocolViewerParsers-KB2FTOE6.mjs"}
|
package/dist/react.cjs
CHANGED
|
@@ -432,6 +432,46 @@ function useSetRetainOnEmpty({ client, onSuccess, onError }) {
|
|
|
432
432
|
);
|
|
433
433
|
return react.useMemo(() => ({ setRetainOnEmpty, isLoading, error, txHash }), [setRetainOnEmpty, isLoading, error, txHash]);
|
|
434
434
|
}
|
|
435
|
+
function useSetDisputeProtectionEnabled({
|
|
436
|
+
client,
|
|
437
|
+
onSuccess,
|
|
438
|
+
onError
|
|
439
|
+
}) {
|
|
440
|
+
const [isLoading, setIsLoading] = react.useState(false);
|
|
441
|
+
const [error, setError] = react.useState(null);
|
|
442
|
+
const [txHash, setTxHash] = react.useState(null);
|
|
443
|
+
const setDisputeProtectionEnabled = react.useCallback(
|
|
444
|
+
async (params) => {
|
|
445
|
+
if (!client) {
|
|
446
|
+
const nextError = new Error("Zkp2pClient is not initialized");
|
|
447
|
+
setError(nextError);
|
|
448
|
+
onError?.(nextError);
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
setIsLoading(true);
|
|
452
|
+
setError(null);
|
|
453
|
+
setTxHash(null);
|
|
454
|
+
try {
|
|
455
|
+
const hash = await client.setDisputeProtectionEnabled(params);
|
|
456
|
+
setTxHash(hash);
|
|
457
|
+
onSuccess?.(hash);
|
|
458
|
+
return hash;
|
|
459
|
+
} catch (caught) {
|
|
460
|
+
const nextError = caught instanceof Error ? caught : new Error(String(caught));
|
|
461
|
+
setError(nextError);
|
|
462
|
+
onError?.(nextError);
|
|
463
|
+
return null;
|
|
464
|
+
} finally {
|
|
465
|
+
setIsLoading(false);
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
[client, onError, onSuccess]
|
|
469
|
+
);
|
|
470
|
+
return react.useMemo(
|
|
471
|
+
() => ({ setDisputeProtectionEnabled, isLoading, error, txHash }),
|
|
472
|
+
[setDisputeProtectionEnabled, isLoading, error, txHash]
|
|
473
|
+
);
|
|
474
|
+
}
|
|
435
475
|
function useSetDelegate({ client, onSuccess, onError }) {
|
|
436
476
|
const [isLoading, setIsLoading] = react.useState(false);
|
|
437
477
|
const [error, setError] = react.useState(null);
|
|
@@ -1612,6 +1652,7 @@ exports.useRemovePaymentMethod = useRemovePaymentMethod;
|
|
|
1612
1652
|
exports.useSetAcceptingIntents = useSetAcceptingIntents;
|
|
1613
1653
|
exports.useSetCurrencyMinRate = useSetCurrencyMinRate;
|
|
1614
1654
|
exports.useSetDelegate = useSetDelegate;
|
|
1655
|
+
exports.useSetDisputeProtectionEnabled = useSetDisputeProtectionEnabled;
|
|
1615
1656
|
exports.useSetIntentRange = useSetIntentRange;
|
|
1616
1657
|
exports.useSetPaymentMethodActive = useSetPaymentMethodActive;
|
|
1617
1658
|
exports.useSetRetainOnEmpty = useSetRetainOnEmpty;
|