@provex/react 1.8.0 → 1.9.0-rc.20260609201133.15dab31

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.
@@ -3,11 +3,11 @@ import React__default from 'react';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
4
  import { Hex, Chain, TransactionReceipt, PublicClient } from 'viem';
5
5
  import { ChainId } from '@provex/utils/chain';
6
- import * as _provex_utils_payment from '@provex/utils/payment';
7
6
  import { ProviderKey, SubProviderKey, TakerTier } from '@provex/utils/payment';
8
7
  import { UserReputation } from '@provex/utils/reputation';
9
8
  import { Currency } from '@provex/utils/currencies';
10
9
  import { TokenInfo } from '@provex/utils/tokens';
10
+ import * as _provex_utils from '@provex/utils';
11
11
  import { WriteHookParams } from '@valve-tech/wallet-adapter';
12
12
 
13
13
  /**
@@ -289,10 +289,6 @@ interface IndexerAdapter {
289
289
  } | null>;
290
290
  }
291
291
 
292
- /**
293
- * @fileoverview Types for the ProveXClient — framework-agnostic protocol client.
294
- */
295
-
296
292
  interface ProveXClientConfig {
297
293
  /**
298
294
  * The viem Chain object to operate on. Provides chain ID, RPC URLs,
@@ -542,6 +538,20 @@ interface SignalIntentRawParams {
542
538
  postIntentHook: Hex;
543
539
  data: Hex;
544
540
  }
541
+ /**
542
+ * Params for fulfilling a signalled intent on-chain (buyer side, after the
543
+ * payment is verified). Mirrors the live encode in
544
+ * packages/ui/.../SubmitStep.tsx:468-497.
545
+ */
546
+ interface FulfillIntentParams {
547
+ intentHash: Hex;
548
+ /** Verified attestation from the capture adapter / enclave. */
549
+ attestation: _provex_utils.V3AttestationResponseObject;
550
+ /** Signer identity for the on-chain verifier (enclave signer). */
551
+ verificationData: Hex;
552
+ /** Defaults to '0x' when omitted. */
553
+ postIntentHookData?: Hex;
554
+ }
545
555
  /** Raw contract-level params matching the V3 Escrow's createDeposit signature. */
546
556
  interface CreateDepositRawParams {
547
557
  token: Hex;
@@ -805,7 +815,7 @@ declare function usePayeeDetails({ intentHash, chainId, }: {
805
815
  fiatCurrency: `0x${string}`;
806
816
  conversionRate: bigint;
807
817
  } | null;
808
- providerKey: _provex_utils_payment.ProviderKey | null;
818
+ providerKey: _provex_utils.ProviderKey | null;
809
819
  userId: `0x${string}` | null;
810
820
  payeeDetails: PayeeInfo | null;
811
821
  deposit: IndexedDeposit | null;
@@ -1067,4 +1077,4 @@ declare function useProvexWallet(): WalletAdapter | undefined;
1067
1077
  */
1068
1078
  declare function useOptionalProvexWallet(): WalletAdapter | undefined;
1069
1079
 
1070
- export { type IndexedVerifier as $, type AttestationParams as A, type BuyProps as B, type CreateDepositRawParams as C, type DepositPaymentMethod as D, useDeposits as E, getRate as F, usePayeeDetails as G, intentStatuses as H, type IndexerAdapter as I, useSignalIntent as J, useProvexPublicClient as K, useOptionalProvexPublicClient as L, type MakerRegistrationParams as M, useProvexWallet as N, useOptionalProvexWallet as O, type ProveXClientConfig as P, type ReputationLimitsParams as Q, type ReputationData as R, type SignalIntentParams as S, type TransactionResult as T, type UseProvexBuyOptions as U, type ReputationLimits as V, type WritableMethod as W, type DepositInfo as X, type IntentStatus as Y, type PayeeInfo as Z, type SignalIntentStatus as _, type PaginationOptions as a, type PaginatedResult as b, type IndexedDeposit as c, type IndexedIntent as d, type CreateDepositParams as e, type PreparedTransaction as f, type SignalIntentResult as g, type PayeeDetails as h, type AttestationResponse as i, type WalletAdapter as j, type UseProvexBuyReturn as k, type PhaseRenderProps as l, type ProvexConfig as m, type BuyPhase as n, type ProvexTheme as o, type PhaseComponentProps as p, ProvexProvider as q, type ProvexContextValue as r, type ProvexProviderProps as s, ProveXError as t, useProvex as u, type ProveXErrorCode as v, type SignalIntentRawParams as w, createApiClient as x, type ApiClient as y, useReputationLimits as z };
1080
+ export { type SignalIntentStatus as $, type AttestationParams as A, type BuyProps as B, type CreateDepositRawParams as C, type DepositPaymentMethod as D, useDeposits as E, type FulfillIntentParams as F, getRate as G, usePayeeDetails as H, type IndexerAdapter as I, intentStatuses as J, useSignalIntent as K, useProvexPublicClient as L, type MakerRegistrationParams as M, useOptionalProvexPublicClient as N, useProvexWallet as O, type ProveXClientConfig as P, useOptionalProvexWallet as Q, type ReputationData as R, type SignalIntentParams as S, type TransactionResult as T, type UseProvexBuyOptions as U, type ReputationLimitsParams as V, type WritableMethod as W, type ReputationLimits as X, type DepositInfo as Y, type IntentStatus as Z, type PayeeInfo as _, type PaginationOptions as a, type IndexedVerifier as a0, type PaginatedResult as b, type IndexedDeposit as c, type IndexedIntent as d, type CreateDepositParams as e, type PreparedTransaction as f, type SignalIntentResult as g, type PayeeDetails as h, type AttestationResponse as i, type WalletAdapter as j, type UseProvexBuyReturn as k, type PhaseRenderProps as l, type ProvexConfig as m, type BuyPhase as n, type ProvexTheme as o, type PhaseComponentProps as p, ProvexProvider as q, type ProvexContextValue as r, type ProvexProviderProps as s, ProveXError as t, useProvex as u, type ProveXErrorCode as v, type SignalIntentRawParams as w, createApiClient as x, type ApiClient as y, useReputationLimits as z };
@@ -3,11 +3,11 @@ import React__default from 'react';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
4
  import { Hex, Chain, TransactionReceipt, PublicClient } from 'viem';
5
5
  import { ChainId } from '@provex/utils/chain';
6
- import * as _provex_utils_payment from '@provex/utils/payment';
7
6
  import { ProviderKey, SubProviderKey, TakerTier } from '@provex/utils/payment';
8
7
  import { UserReputation } from '@provex/utils/reputation';
9
8
  import { Currency } from '@provex/utils/currencies';
10
9
  import { TokenInfo } from '@provex/utils/tokens';
10
+ import * as _provex_utils from '@provex/utils';
11
11
  import { WriteHookParams } from '@valve-tech/wallet-adapter';
12
12
 
13
13
  /**
@@ -289,10 +289,6 @@ interface IndexerAdapter {
289
289
  } | null>;
290
290
  }
291
291
 
292
- /**
293
- * @fileoverview Types for the ProveXClient — framework-agnostic protocol client.
294
- */
295
-
296
292
  interface ProveXClientConfig {
297
293
  /**
298
294
  * The viem Chain object to operate on. Provides chain ID, RPC URLs,
@@ -542,6 +538,20 @@ interface SignalIntentRawParams {
542
538
  postIntentHook: Hex;
543
539
  data: Hex;
544
540
  }
541
+ /**
542
+ * Params for fulfilling a signalled intent on-chain (buyer side, after the
543
+ * payment is verified). Mirrors the live encode in
544
+ * packages/ui/.../SubmitStep.tsx:468-497.
545
+ */
546
+ interface FulfillIntentParams {
547
+ intentHash: Hex;
548
+ /** Verified attestation from the capture adapter / enclave. */
549
+ attestation: _provex_utils.V3AttestationResponseObject;
550
+ /** Signer identity for the on-chain verifier (enclave signer). */
551
+ verificationData: Hex;
552
+ /** Defaults to '0x' when omitted. */
553
+ postIntentHookData?: Hex;
554
+ }
545
555
  /** Raw contract-level params matching the V3 Escrow's createDeposit signature. */
546
556
  interface CreateDepositRawParams {
547
557
  token: Hex;
@@ -805,7 +815,7 @@ declare function usePayeeDetails({ intentHash, chainId, }: {
805
815
  fiatCurrency: `0x${string}`;
806
816
  conversionRate: bigint;
807
817
  } | null;
808
- providerKey: _provex_utils_payment.ProviderKey | null;
818
+ providerKey: _provex_utils.ProviderKey | null;
809
819
  userId: `0x${string}` | null;
810
820
  payeeDetails: PayeeInfo | null;
811
821
  deposit: IndexedDeposit | null;
@@ -1067,4 +1077,4 @@ declare function useProvexWallet(): WalletAdapter | undefined;
1067
1077
  */
1068
1078
  declare function useOptionalProvexWallet(): WalletAdapter | undefined;
1069
1079
 
1070
- export { type IndexedVerifier as $, type AttestationParams as A, type BuyProps as B, type CreateDepositRawParams as C, type DepositPaymentMethod as D, useDeposits as E, getRate as F, usePayeeDetails as G, intentStatuses as H, type IndexerAdapter as I, useSignalIntent as J, useProvexPublicClient as K, useOptionalProvexPublicClient as L, type MakerRegistrationParams as M, useProvexWallet as N, useOptionalProvexWallet as O, type ProveXClientConfig as P, type ReputationLimitsParams as Q, type ReputationData as R, type SignalIntentParams as S, type TransactionResult as T, type UseProvexBuyOptions as U, type ReputationLimits as V, type WritableMethod as W, type DepositInfo as X, type IntentStatus as Y, type PayeeInfo as Z, type SignalIntentStatus as _, type PaginationOptions as a, type PaginatedResult as b, type IndexedDeposit as c, type IndexedIntent as d, type CreateDepositParams as e, type PreparedTransaction as f, type SignalIntentResult as g, type PayeeDetails as h, type AttestationResponse as i, type WalletAdapter as j, type UseProvexBuyReturn as k, type PhaseRenderProps as l, type ProvexConfig as m, type BuyPhase as n, type ProvexTheme as o, type PhaseComponentProps as p, ProvexProvider as q, type ProvexContextValue as r, type ProvexProviderProps as s, ProveXError as t, useProvex as u, type ProveXErrorCode as v, type SignalIntentRawParams as w, createApiClient as x, type ApiClient as y, useReputationLimits as z };
1080
+ export { type SignalIntentStatus as $, type AttestationParams as A, type BuyProps as B, type CreateDepositRawParams as C, type DepositPaymentMethod as D, useDeposits as E, type FulfillIntentParams as F, getRate as G, usePayeeDetails as H, type IndexerAdapter as I, intentStatuses as J, useSignalIntent as K, useProvexPublicClient as L, type MakerRegistrationParams as M, useOptionalProvexPublicClient as N, useProvexWallet as O, type ProveXClientConfig as P, useOptionalProvexWallet as Q, type ReputationData as R, type SignalIntentParams as S, type TransactionResult as T, type UseProvexBuyOptions as U, type ReputationLimitsParams as V, type WritableMethod as W, type ReputationLimits as X, type DepositInfo as Y, type IntentStatus as Z, type PayeeInfo as _, type PaginationOptions as a, type IndexedVerifier as a0, type PaginatedResult as b, type IndexedDeposit as c, type IndexedIntent as d, type CreateDepositParams as e, type PreparedTransaction as f, type SignalIntentResult as g, type PayeeDetails as h, type AttestationResponse as i, type WalletAdapter as j, type UseProvexBuyReturn as k, type PhaseRenderProps as l, type ProvexConfig as m, type BuyPhase as n, type ProvexTheme as o, type PhaseComponentProps as p, ProvexProvider as q, type ProvexContextValue as r, type ProvexProviderProps as s, ProveXError as t, useProvex as u, type ProveXErrorCode as v, type SignalIntentRawParams as w, createApiClient as x, type ApiClient as y, useReputationLimits as z };
@@ -7,6 +7,7 @@ import { parseUnits, formatUnits } from '@provex/utils/units';
7
7
  import { providerConfigs, providerKeyToContractId, computePayeeDetailsHash, tiers, verifiablePaymentMethods, getPlatformRisk, verifierGetsKey, resolveApiProviderKey, getPaymentMethodName } from '@provex/utils/payment';
8
8
  import { convertCurrencyToTokenOutput } from '@provex/utils/conversionRates';
9
9
  import { getLatestContract, reclaimSigners } from '@provex/utils/contracts';
10
+ import { encodeV3PaymentProof } from '@provex/utils';
10
11
  import { normalizeFeePrecision } from '@provex/utils/fees';
11
12
  import { V3EscrowAbi, OrchestratorAbi, PaymentVerifierRegistryAbi, UnifiedPaymentVerifierAbi, NullifierRegistryAbi } from '@provex/abis';
12
13
  import { publicClient, getDefaultToken } from '@provex/utils/tokens';
@@ -488,6 +489,19 @@ var ProveXClient = class {
488
489
  functionName: "approve",
489
490
  argsMapper: (params) => [params.spender, params.amount ?? BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")]
490
491
  });
492
+ this.fulfillIntent = this.buildWritableMethod({
493
+ abi: OrchestratorAbi,
494
+ contractResolver: () => this.getOrchestratorAddress(),
495
+ functionName: "fulfillIntent",
496
+ argsMapper: (params) => [
497
+ {
498
+ paymentProof: encodeV3PaymentProof(params.attestation),
499
+ intentHash: params.intentHash,
500
+ verificationData: params.verificationData,
501
+ postIntentHookData: params.postIntentHookData ?? "0x"
502
+ }
503
+ ]
504
+ });
491
505
  }
492
506
  // ─── Address Resolution ──────────────────────────────────────────────────
493
507
  /** Get the V3 escrow address for this client's chain. */
@@ -599,6 +613,7 @@ var ProveXClient = class {
599
613
  addCurrencies;
600
614
  deactivateCurrency;
601
615
  addPaymentMethods;
616
+ fulfillIntent;
602
617
  /**
603
618
  * Create a deposit with human-readable params.
604
619
  *
@@ -2188,5 +2203,5 @@ function ProvexBuyRoot({
2188
2203
  }
2189
2204
 
2190
2205
  export { BrowsePhase, CommittedPhase, CompletePhase, ProveXClient, ProveXError, ProvexBuy, ProvexBuyProvider, ProvexProvider, ProvingPhase, checkMutation, checkTransactionIndexed, createApiClient, createProveXClient, getRate, getTierDisplayInfo, getTransactionGasInputs, getUserFriendlyErrorMessage, intentStatuses, isUserRejectionError, useContractRead, useDeposits, useOptionalProvex, useOptionalProvexPublicClient, useOptionalProvexWallet, useOrchestratorAddress, usePayeeDetails, useProtocolFeePercentage, useProtocolFees, useProvex, useProvexBuy, useProvexBuyContext, useProvexPublicClient, useProvexWallet, useReputation, useReputationLimits, useSignalIntent };
2191
- //# sourceMappingURL=chunk-YLJM5TTI.js.map
2192
- //# sourceMappingURL=chunk-YLJM5TTI.js.map
2206
+ //# sourceMappingURL=chunk-KJAMNOBD.js.map
2207
+ //# sourceMappingURL=chunk-KJAMNOBD.js.map