@provex/react 1.6.2 → 1.7.0-rc.20260522201545.020a3eb
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/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/{ProvexProvider-BQ5vZkHO.d.cts → ProvexProvider-eG_i0Yz3.d.cts} +13 -4
- package/dist/{ProvexProvider-BQ5vZkHO.d.ts → ProvexProvider-eG_i0Yz3.d.ts} +13 -4
- package/dist/{chunk-VWWANYB2.js → chunk-NAGOACEK.js} +22 -11
- package/dist/chunk-NAGOACEK.js.map +1 -0
- package/dist/index.cjs +19 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/wagmi.cjs +19 -8
- package/dist/wagmi.cjs.map +1 -1
- package/dist/wagmi.d.cts +1 -1
- package/dist/wagmi.d.ts +1 -1
- package/dist/wagmi.js +1 -1
- package/package.json +7 -5
- package/skills/react-integration/SKILL.md +246 -0
- package/dist/chunk-VWWANYB2.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreateDepositRawParams, I as IndexerAdapter, P as ProveXClientConfig, a as PaginationOptions, b as PaginatedResult, c as IndexedDeposit, d as IndexedIntent, R as ReputationData, W as WritableMethod, e as CreateDepositParams$1, T as TransactionResult, f as PreparedTransaction, S as SignalIntentParams, g as SignalIntentResult, h as PayeeDetails, M as MakerRegistrationParams, A as AttestationParams, i as AttestationResponse, j as WalletAdapter, U as UseProvexBuyOptions, k as UseProvexBuyReturn, l as PhaseRenderProps, B as BuyProps } from './ProvexProvider-
|
|
2
|
-
export { y as ApiClient, n as BuyPhase, X as DepositInfo, D as DepositPaymentMethod, $ as IndexedVerifier, Y as IntentStatus, Z as PayeeInfo, p as PhaseComponentProps, t as ProveXError, v as ProveXErrorCode, m as ProvexConfig, r as ProvexContextValue, q as ProvexProvider, s as ProvexProviderProps, o as ProvexTheme, V as ReputationLimits, Q as ReputationLimitsParams, w as SignalIntentRawParams, _ as SignalIntentStatus, x as createApiClient, F as getRate, H as intentStatuses, E as useDeposits, L as useOptionalProvexPublicClient, O as useOptionalProvexWallet, G as usePayeeDetails, u as useProvex, K as useProvexPublicClient, N as useProvexWallet, z as useReputationLimits, J as useSignalIntent } from './ProvexProvider-
|
|
1
|
+
import { C as CreateDepositRawParams, I as IndexerAdapter, P as ProveXClientConfig, a as PaginationOptions, b as PaginatedResult, c as IndexedDeposit, d as IndexedIntent, R as ReputationData, W as WritableMethod, e as CreateDepositParams$1, T as TransactionResult, f as PreparedTransaction, S as SignalIntentParams, g as SignalIntentResult, h as PayeeDetails, M as MakerRegistrationParams, A as AttestationParams, i as AttestationResponse, j as WalletAdapter, U as UseProvexBuyOptions, k as UseProvexBuyReturn, l as PhaseRenderProps, B as BuyProps } from './ProvexProvider-eG_i0Yz3.cjs';
|
|
2
|
+
export { y as ApiClient, n as BuyPhase, X as DepositInfo, D as DepositPaymentMethod, $ as IndexedVerifier, Y as IntentStatus, Z as PayeeInfo, p as PhaseComponentProps, t as ProveXError, v as ProveXErrorCode, m as ProvexConfig, r as ProvexContextValue, q as ProvexProvider, s as ProvexProviderProps, o as ProvexTheme, V as ReputationLimits, Q as ReputationLimitsParams, w as SignalIntentRawParams, _ as SignalIntentStatus, x as createApiClient, F as getRate, H as intentStatuses, E as useDeposits, L as useOptionalProvexPublicClient, O as useOptionalProvexWallet, G as usePayeeDetails, u as useProvex, K as useProvexPublicClient, N as useProvexWallet, z as useReputationLimits, J as useSignalIntent } from './ProvexProvider-eG_i0Yz3.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default from 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CreateDepositRawParams, I as IndexerAdapter, P as ProveXClientConfig, a as PaginationOptions, b as PaginatedResult, c as IndexedDeposit, d as IndexedIntent, R as ReputationData, W as WritableMethod, e as CreateDepositParams$1, T as TransactionResult, f as PreparedTransaction, S as SignalIntentParams, g as SignalIntentResult, h as PayeeDetails, M as MakerRegistrationParams, A as AttestationParams, i as AttestationResponse, j as WalletAdapter, U as UseProvexBuyOptions, k as UseProvexBuyReturn, l as PhaseRenderProps, B as BuyProps } from './ProvexProvider-
|
|
2
|
-
export { y as ApiClient, n as BuyPhase, X as DepositInfo, D as DepositPaymentMethod, $ as IndexedVerifier, Y as IntentStatus, Z as PayeeInfo, p as PhaseComponentProps, t as ProveXError, v as ProveXErrorCode, m as ProvexConfig, r as ProvexContextValue, q as ProvexProvider, s as ProvexProviderProps, o as ProvexTheme, V as ReputationLimits, Q as ReputationLimitsParams, w as SignalIntentRawParams, _ as SignalIntentStatus, x as createApiClient, F as getRate, H as intentStatuses, E as useDeposits, L as useOptionalProvexPublicClient, O as useOptionalProvexWallet, G as usePayeeDetails, u as useProvex, K as useProvexPublicClient, N as useProvexWallet, z as useReputationLimits, J as useSignalIntent } from './ProvexProvider-
|
|
1
|
+
import { C as CreateDepositRawParams, I as IndexerAdapter, P as ProveXClientConfig, a as PaginationOptions, b as PaginatedResult, c as IndexedDeposit, d as IndexedIntent, R as ReputationData, W as WritableMethod, e as CreateDepositParams$1, T as TransactionResult, f as PreparedTransaction, S as SignalIntentParams, g as SignalIntentResult, h as PayeeDetails, M as MakerRegistrationParams, A as AttestationParams, i as AttestationResponse, j as WalletAdapter, U as UseProvexBuyOptions, k as UseProvexBuyReturn, l as PhaseRenderProps, B as BuyProps } from './ProvexProvider-eG_i0Yz3.js';
|
|
2
|
+
export { y as ApiClient, n as BuyPhase, X as DepositInfo, D as DepositPaymentMethod, $ as IndexedVerifier, Y as IntentStatus, Z as PayeeInfo, p as PhaseComponentProps, t as ProveXError, v as ProveXErrorCode, m as ProvexConfig, r as ProvexContextValue, q as ProvexProvider, s as ProvexProviderProps, o as ProvexTheme, V as ReputationLimits, Q as ReputationLimitsParams, w as SignalIntentRawParams, _ as SignalIntentStatus, x as createApiClient, F as getRate, H as intentStatuses, E as useDeposits, L as useOptionalProvexPublicClient, O as useOptionalProvexWallet, G as usePayeeDetails, u as useProvex, K as useProvexPublicClient, N as useProvexWallet, z as useReputationLimits, J as useSignalIntent } from './ProvexProvider-eG_i0Yz3.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default from 'react';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useOptionalProvexPublicClient, useOrchestratorAddress, useContractRead, useOptionalProvexWallet, getTransactionGasInputs, useOptionalProvex, createProveXClient, checkTransactionIndexed, ProveXError, isUserRejectionError, getUserFriendlyErrorMessage, checkMutation, useProvex, ProveXClient } from './chunk-
|
|
2
|
-
export { BrowsePhase, CommittedPhase, CompletePhase, ProveXClient, ProveXError, ProvexBuy, ProvexBuyProvider, ProvexProvider, ProvingPhase, createApiClient, createProveXClient, getRate, getTierDisplayInfo, intentStatuses, useDeposits, useOptionalProvexPublicClient, useOptionalProvexWallet, useOrchestratorAddress, usePayeeDetails, useProtocolFeePercentage, useProtocolFees, useProvex, useProvexBuy, useProvexBuyContext, useProvexPublicClient, useProvexWallet, useReputation, useReputationLimits, useSignalIntent } from './chunk-
|
|
1
|
+
import { useOptionalProvexPublicClient, useOrchestratorAddress, useContractRead, useOptionalProvexWallet, getTransactionGasInputs, useOptionalProvex, createProveXClient, checkTransactionIndexed, ProveXError, isUserRejectionError, getUserFriendlyErrorMessage, checkMutation, useProvex, ProveXClient } from './chunk-NAGOACEK.js';
|
|
2
|
+
export { BrowsePhase, CommittedPhase, CompletePhase, ProveXClient, ProveXError, ProvexBuy, ProvexBuyProvider, ProvexProvider, ProvingPhase, createApiClient, createProveXClient, getRate, getTierDisplayInfo, intentStatuses, useDeposits, useOptionalProvexPublicClient, useOptionalProvexWallet, useOrchestratorAddress, usePayeeDetails, useProtocolFeePercentage, useProtocolFees, useProvex, useProvexBuy, useProvexBuyContext, useProvexPublicClient, useProvexWallet, useReputation, useReputationLimits, useSignalIntent } from './chunk-NAGOACEK.js';
|
|
3
3
|
import { useCallback, useMemo, useState } from 'react';
|
|
4
4
|
import { OrchestratorAbi, PaymentVerifierRegistryAbi, UnifiedPaymentVerifierAbi, NullifierRegistryAbi, V2EscrowAbi, V3EscrowAbi } from '@provex/abis';
|
|
5
5
|
import { maxUint256, erc20Abi, encodeFunctionData } from 'viem';
|
package/dist/wagmi.cjs
CHANGED
|
@@ -888,7 +888,9 @@ var ProveXClient = class {
|
|
|
888
888
|
let errorMessage = `Attestation error: ${res.status}`;
|
|
889
889
|
try {
|
|
890
890
|
const errorJson = await res.json();
|
|
891
|
-
if (errorJson.message) errorMessage = errorJson.message;
|
|
891
|
+
if (errorJson.details?.message) errorMessage = errorJson.details.message;
|
|
892
|
+
else if (errorJson.message) errorMessage = errorJson.message;
|
|
893
|
+
else if (errorJson.error) errorMessage = errorJson.error;
|
|
892
894
|
} catch {
|
|
893
895
|
}
|
|
894
896
|
return {
|
|
@@ -1164,6 +1166,7 @@ function useReputationLimits({
|
|
|
1164
1166
|
chainId,
|
|
1165
1167
|
selectedPaymentMethod,
|
|
1166
1168
|
tier,
|
|
1169
|
+
decimals,
|
|
1167
1170
|
amountInInt,
|
|
1168
1171
|
cooldownEndsAt
|
|
1169
1172
|
}) {
|
|
@@ -1196,19 +1199,20 @@ function useReputationLimits({
|
|
|
1196
1199
|
return reputation.getCooldownHours({ tier, providerKey: selectedPaymentMethod });
|
|
1197
1200
|
}, [hasLimits, tier, selectedPaymentMethod]);
|
|
1198
1201
|
const effectiveCap = react.useMemo(() => {
|
|
1199
|
-
return reputation.getEffectiveCap({ tier, providerKey: selectedPaymentMethod });
|
|
1200
|
-
}, [hasLimits, tier, selectedPaymentMethod]);
|
|
1202
|
+
return reputation.getEffectiveCap({ tier, providerKey: selectedPaymentMethod, decimals });
|
|
1203
|
+
}, [hasLimits, tier, selectedPaymentMethod, decimals]);
|
|
1201
1204
|
const amountExceedsCap = react.useMemo(() => {
|
|
1202
1205
|
if (effectiveCap === null) return false;
|
|
1203
1206
|
if (!amountInInt) return false;
|
|
1204
|
-
|
|
1205
|
-
return amountUsd > effectiveCap;
|
|
1207
|
+
return amountInInt > effectiveCap;
|
|
1206
1208
|
}, [effectiveCap, amountInInt]);
|
|
1207
1209
|
const capExceededMessage = react.useMemo(() => {
|
|
1208
1210
|
if (!amountExceedsCap || effectiveCap === null) return null;
|
|
1211
|
+
if (effectiveCap === reputation.UNLIMITED_CAP_BASE_UNITS) return null;
|
|
1212
|
+
const capUsd = reputation.getEffectiveCapDisplayUsd(effectiveCap, decimals) ?? 0;
|
|
1209
1213
|
const providerName = payment.providerConfigs(chainId)[selectedPaymentMethod]?.name ?? selectedPaymentMethod;
|
|
1210
|
-
return `Amount exceeds your $${
|
|
1211
|
-
}, [amountExceedsCap, effectiveCap, chainId, selectedPaymentMethod]);
|
|
1214
|
+
return `Amount exceeds your $${capUsd.toLocaleString()} limit for ${providerName}`;
|
|
1215
|
+
}, [amountExceedsCap, effectiveCap, chainId, selectedPaymentMethod, decimals]);
|
|
1212
1216
|
return {
|
|
1213
1217
|
hasLimits,
|
|
1214
1218
|
noCooldownProviders,
|
|
@@ -1550,11 +1554,18 @@ function useProvexBuy({
|
|
|
1550
1554
|
() => parseAmountSafe(amount, currency.decimals),
|
|
1551
1555
|
[amount, currency.decimals]
|
|
1552
1556
|
);
|
|
1557
|
+
const tokenDecimals = token?.decimals ?? 6;
|
|
1558
|
+
const amountInTokenUnits = react.useMemo(() => {
|
|
1559
|
+
if (amountBigInt === null) return null;
|
|
1560
|
+
const decimalShift = BigInt(tokenDecimals - currency.decimals);
|
|
1561
|
+
return decimalShift >= 0n ? amountBigInt * 10n ** decimalShift : amountBigInt / 10n ** -decimalShift;
|
|
1562
|
+
}, [amountBigInt, tokenDecimals, currency.decimals]);
|
|
1553
1563
|
const limits = useReputationLimits({
|
|
1554
1564
|
chainId,
|
|
1555
1565
|
selectedPaymentMethod: activePaymentMethod,
|
|
1556
1566
|
tier: reputation$1.tier,
|
|
1557
|
-
|
|
1567
|
+
decimals: tokenDecimals,
|
|
1568
|
+
amountInInt: amountInTokenUnits,
|
|
1558
1569
|
cooldownEndsAt: reputation$1.cooldownEndsAt
|
|
1559
1570
|
});
|
|
1560
1571
|
const signalIntent = useSignalIntent({
|