@oasisprotocol/privana-sdk 0.5.10 → 0.5.11

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/index.d.cts CHANGED
@@ -849,6 +849,8 @@ interface UseModifyLockResult {
849
849
  }
850
850
  declare function useModifyLock(options?: UseModifyLockOptions): UseModifyLockResult;
851
851
 
852
+ declare function getMinDepositBaseUnits(response: DepositAddressResponse | undefined, chainId: number, kind: 'native' | 'erc20'): bigint | undefined;
853
+
852
854
  type DepositMethodTab = 'crypto' | 'credit-card';
853
855
  type DepositSource = 'connected' | 'external' | 'credit-card';
854
856
  interface DepositMethodHandlers {
@@ -936,4 +938,4 @@ interface PrivanaIconProps {
936
938
  }
937
939
  declare function PrivanaIcon({ className, size }: PrivanaIconProps): react_jsx_runtime.JSX.Element;
938
940
 
939
- export { AccountingApiError, Address, type Allowance, type AllowanceTerm, Button, Bytes32, type ChainConfig, DepositAddressResponse, DepositCheckResponse, DepositInlineModal, type DepositInlineModalProps, type DepositMethodHandlers, DepositModal, type DepositModalProps, type DepositParams, type DepositSource, type EIP712Domain, HOSTED_AUTH_CLOCK_SKEW_MS, HexString, HistoryEntry, type HostedAuthCallback, type HostedAuthCallbackError, type HostedAuthCallbackSuccess, type HostedAuthConfig, HostedAuthError, type HostedAuthPendingTransaction, HostedAuthRequiredError, type HostedAuthSession, HostedAuthStateMismatchError, HostedAuthTokenExchangeResponse, JwtRefreshResponse, LOCK_TYPES, type LockFundsParams, LockInfo, type LockMessage, MODIFY_LOCK_TYPES, type ModifyLockMessage, type ModifyLockParams, NetworkConfig, NetworkError, OnRampConfig, PendingDeposit, PendingDepositsResponse, PostDepositLockConfig, PostDepositLockError, PrivanaClient, type PrivanaContextValue, PrivanaIcon, PrivanaProvider, type PrivanaProviderProps, SUPPORTED_CHAINS, type SignLockParams, type SignModifyLockParams, type SignTransferLockedParams, type SignTransferParams, type SignWithdrawFromLockParams, type SignWithdrawParams, type SiweAuthConfig, type SiweAuthContextValue, SiweAuthProvider, type SiweAuthProviderProps, type SiweAuthSession, type SiweAuthTokens, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, TokenBalance, TokenConfig, TokenInfoResponse, type TokensStatus, TransactionSubmissionResponse, type TransferLockedMessage, type TransferLockedParams, type TransferMessage, type TransferParams, type UnlockFundsParams, type UseBalanceOptions, type UseBalanceResult, type UseBatchBalancesOptions, type UseBatchBalancesResult, type UseDepositAddressOptions, type UseDepositAddressResult, type UseDepositOptions, type UseDepositResult, type UseDepositVerificationOptions, type UseDepositVerificationResult, type UseExpiredLocksOptions, type UseExpiredLocksResult, type UseHistoryOptions, type UseHistoryResult, type UseHostedRedirectAuthResult, type UseLockFundsOptions, type UseLockFundsResult, type UseLockedFundsOptions, type UseLockedFundsResult, type UseModifyLockOptions, type UseModifyLockResult, type UsePendingDepositsOptions, type UsePendingDepositsResult, type UsePendingWithdrawalsOptions, type UsePendingWithdrawalsResult, type UseTokenInfoOptions, type UseTokenInfoResult, type UseTokenListOptions, type UseTokenListResult, type UseTotalLockedBalanceOptions, type UseTotalLockedBalanceResult, type UseTransferOptions, type UseTransferResult, type UseUnlockFundsOptions, type UseUnlockFundsResult, type UseWithdrawOptions, type UseWithdrawResult, ValidationError, type VerificationContext, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, WalletInlineModal, type WalletInlineModalProps, WalletModal, type WalletModalHandlers, type WalletModalProps, type WalletSession, type WithdrawFromLockMessage, WithdrawInlineModal, type WithdrawInlineModalProps, type WithdrawMessage, WithdrawModal, type WithdrawModalProps, type WithdrawParams, type WithdrawStep, WithdrawalInfo, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clearHostedAuthPendingTransaction, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, getChainById, getChainIcon, getExplorerAddressUrl, getExplorerLabel, getTokenIcon, isHostedAuthRefreshActive, isHostedAuthSessionActive, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useBalance, useBatchBalances, useDeposit, useDepositAddress, useDepositVerification, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingDeposits, usePendingWithdrawals, usePrivanaClient, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
941
+ export { AccountingApiError, Address, type Allowance, type AllowanceTerm, Button, Bytes32, type ChainConfig, DepositAddressResponse, DepositCheckResponse, DepositInlineModal, type DepositInlineModalProps, type DepositMethodHandlers, DepositModal, type DepositModalProps, type DepositParams, type DepositSource, type EIP712Domain, HOSTED_AUTH_CLOCK_SKEW_MS, HexString, HistoryEntry, type HostedAuthCallback, type HostedAuthCallbackError, type HostedAuthCallbackSuccess, type HostedAuthConfig, HostedAuthError, type HostedAuthPendingTransaction, HostedAuthRequiredError, type HostedAuthSession, HostedAuthStateMismatchError, HostedAuthTokenExchangeResponse, JwtRefreshResponse, LOCK_TYPES, type LockFundsParams, LockInfo, type LockMessage, MODIFY_LOCK_TYPES, type ModifyLockMessage, type ModifyLockParams, NetworkConfig, NetworkError, OnRampConfig, PendingDeposit, PendingDepositsResponse, PostDepositLockConfig, PostDepositLockError, PrivanaClient, type PrivanaContextValue, PrivanaIcon, PrivanaProvider, type PrivanaProviderProps, SUPPORTED_CHAINS, type SignLockParams, type SignModifyLockParams, type SignTransferLockedParams, type SignTransferParams, type SignWithdrawFromLockParams, type SignWithdrawParams, type SiweAuthConfig, type SiweAuthContextValue, SiweAuthProvider, type SiweAuthProviderProps, type SiweAuthSession, type SiweAuthTokens, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, TokenBalance, TokenConfig, TokenInfoResponse, type TokensStatus, TransactionSubmissionResponse, type TransferLockedMessage, type TransferLockedParams, type TransferMessage, type TransferParams, type UnlockFundsParams, type UseBalanceOptions, type UseBalanceResult, type UseBatchBalancesOptions, type UseBatchBalancesResult, type UseDepositAddressOptions, type UseDepositAddressResult, type UseDepositOptions, type UseDepositResult, type UseDepositVerificationOptions, type UseDepositVerificationResult, type UseExpiredLocksOptions, type UseExpiredLocksResult, type UseHistoryOptions, type UseHistoryResult, type UseHostedRedirectAuthResult, type UseLockFundsOptions, type UseLockFundsResult, type UseLockedFundsOptions, type UseLockedFundsResult, type UseModifyLockOptions, type UseModifyLockResult, type UsePendingDepositsOptions, type UsePendingDepositsResult, type UsePendingWithdrawalsOptions, type UsePendingWithdrawalsResult, type UseTokenInfoOptions, type UseTokenInfoResult, type UseTokenListOptions, type UseTokenListResult, type UseTotalLockedBalanceOptions, type UseTotalLockedBalanceResult, type UseTransferOptions, type UseTransferResult, type UseUnlockFundsOptions, type UseUnlockFundsResult, type UseWithdrawOptions, type UseWithdrawResult, ValidationError, type VerificationContext, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, WalletInlineModal, type WalletInlineModalProps, WalletModal, type WalletModalHandlers, type WalletModalProps, type WalletSession, type WithdrawFromLockMessage, WithdrawInlineModal, type WithdrawInlineModalProps, type WithdrawMessage, WithdrawModal, type WithdrawModalProps, type WithdrawParams, type WithdrawStep, WithdrawalInfo, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clearHostedAuthPendingTransaction, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, getChainById, getChainIcon, getExplorerAddressUrl, getExplorerLabel, getMinDepositBaseUnits, getTokenIcon, isHostedAuthRefreshActive, isHostedAuthSessionActive, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useBalance, useBatchBalances, useDeposit, useDepositAddress, useDepositVerification, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingDeposits, usePendingWithdrawals, usePrivanaClient, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
package/dist/index.d.ts CHANGED
@@ -849,6 +849,8 @@ interface UseModifyLockResult {
849
849
  }
850
850
  declare function useModifyLock(options?: UseModifyLockOptions): UseModifyLockResult;
851
851
 
852
+ declare function getMinDepositBaseUnits(response: DepositAddressResponse | undefined, chainId: number, kind: 'native' | 'erc20'): bigint | undefined;
853
+
852
854
  type DepositMethodTab = 'crypto' | 'credit-card';
853
855
  type DepositSource = 'connected' | 'external' | 'credit-card';
854
856
  interface DepositMethodHandlers {
@@ -936,4 +938,4 @@ interface PrivanaIconProps {
936
938
  }
937
939
  declare function PrivanaIcon({ className, size }: PrivanaIconProps): react_jsx_runtime.JSX.Element;
938
940
 
939
- export { AccountingApiError, Address, type Allowance, type AllowanceTerm, Button, Bytes32, type ChainConfig, DepositAddressResponse, DepositCheckResponse, DepositInlineModal, type DepositInlineModalProps, type DepositMethodHandlers, DepositModal, type DepositModalProps, type DepositParams, type DepositSource, type EIP712Domain, HOSTED_AUTH_CLOCK_SKEW_MS, HexString, HistoryEntry, type HostedAuthCallback, type HostedAuthCallbackError, type HostedAuthCallbackSuccess, type HostedAuthConfig, HostedAuthError, type HostedAuthPendingTransaction, HostedAuthRequiredError, type HostedAuthSession, HostedAuthStateMismatchError, HostedAuthTokenExchangeResponse, JwtRefreshResponse, LOCK_TYPES, type LockFundsParams, LockInfo, type LockMessage, MODIFY_LOCK_TYPES, type ModifyLockMessage, type ModifyLockParams, NetworkConfig, NetworkError, OnRampConfig, PendingDeposit, PendingDepositsResponse, PostDepositLockConfig, PostDepositLockError, PrivanaClient, type PrivanaContextValue, PrivanaIcon, PrivanaProvider, type PrivanaProviderProps, SUPPORTED_CHAINS, type SignLockParams, type SignModifyLockParams, type SignTransferLockedParams, type SignTransferParams, type SignWithdrawFromLockParams, type SignWithdrawParams, type SiweAuthConfig, type SiweAuthContextValue, SiweAuthProvider, type SiweAuthProviderProps, type SiweAuthSession, type SiweAuthTokens, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, TokenBalance, TokenConfig, TokenInfoResponse, type TokensStatus, TransactionSubmissionResponse, type TransferLockedMessage, type TransferLockedParams, type TransferMessage, type TransferParams, type UnlockFundsParams, type UseBalanceOptions, type UseBalanceResult, type UseBatchBalancesOptions, type UseBatchBalancesResult, type UseDepositAddressOptions, type UseDepositAddressResult, type UseDepositOptions, type UseDepositResult, type UseDepositVerificationOptions, type UseDepositVerificationResult, type UseExpiredLocksOptions, type UseExpiredLocksResult, type UseHistoryOptions, type UseHistoryResult, type UseHostedRedirectAuthResult, type UseLockFundsOptions, type UseLockFundsResult, type UseLockedFundsOptions, type UseLockedFundsResult, type UseModifyLockOptions, type UseModifyLockResult, type UsePendingDepositsOptions, type UsePendingDepositsResult, type UsePendingWithdrawalsOptions, type UsePendingWithdrawalsResult, type UseTokenInfoOptions, type UseTokenInfoResult, type UseTokenListOptions, type UseTokenListResult, type UseTotalLockedBalanceOptions, type UseTotalLockedBalanceResult, type UseTransferOptions, type UseTransferResult, type UseUnlockFundsOptions, type UseUnlockFundsResult, type UseWithdrawOptions, type UseWithdrawResult, ValidationError, type VerificationContext, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, WalletInlineModal, type WalletInlineModalProps, WalletModal, type WalletModalHandlers, type WalletModalProps, type WalletSession, type WithdrawFromLockMessage, WithdrawInlineModal, type WithdrawInlineModalProps, type WithdrawMessage, WithdrawModal, type WithdrawModalProps, type WithdrawParams, type WithdrawStep, WithdrawalInfo, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clearHostedAuthPendingTransaction, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, getChainById, getChainIcon, getExplorerAddressUrl, getExplorerLabel, getTokenIcon, isHostedAuthRefreshActive, isHostedAuthSessionActive, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useBalance, useBatchBalances, useDeposit, useDepositAddress, useDepositVerification, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingDeposits, usePendingWithdrawals, usePrivanaClient, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
941
+ export { AccountingApiError, Address, type Allowance, type AllowanceTerm, Button, Bytes32, type ChainConfig, DepositAddressResponse, DepositCheckResponse, DepositInlineModal, type DepositInlineModalProps, type DepositMethodHandlers, DepositModal, type DepositModalProps, type DepositParams, type DepositSource, type EIP712Domain, HOSTED_AUTH_CLOCK_SKEW_MS, HexString, HistoryEntry, type HostedAuthCallback, type HostedAuthCallbackError, type HostedAuthCallbackSuccess, type HostedAuthConfig, HostedAuthError, type HostedAuthPendingTransaction, HostedAuthRequiredError, type HostedAuthSession, HostedAuthStateMismatchError, HostedAuthTokenExchangeResponse, JwtRefreshResponse, LOCK_TYPES, type LockFundsParams, LockInfo, type LockMessage, MODIFY_LOCK_TYPES, type ModifyLockMessage, type ModifyLockParams, NetworkConfig, NetworkError, OnRampConfig, PendingDeposit, PendingDepositsResponse, PostDepositLockConfig, PostDepositLockError, PrivanaClient, type PrivanaContextValue, PrivanaIcon, PrivanaProvider, type PrivanaProviderProps, SUPPORTED_CHAINS, type SignLockParams, type SignModifyLockParams, type SignTransferLockedParams, type SignTransferParams, type SignWithdrawFromLockParams, type SignWithdrawParams, type SiweAuthConfig, type SiweAuthContextValue, SiweAuthProvider, type SiweAuthProviderProps, type SiweAuthSession, type SiweAuthTokens, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, TokenBalance, TokenConfig, TokenInfoResponse, type TokensStatus, TransactionSubmissionResponse, type TransferLockedMessage, type TransferLockedParams, type TransferMessage, type TransferParams, type UnlockFundsParams, type UseBalanceOptions, type UseBalanceResult, type UseBatchBalancesOptions, type UseBatchBalancesResult, type UseDepositAddressOptions, type UseDepositAddressResult, type UseDepositOptions, type UseDepositResult, type UseDepositVerificationOptions, type UseDepositVerificationResult, type UseExpiredLocksOptions, type UseExpiredLocksResult, type UseHistoryOptions, type UseHistoryResult, type UseHostedRedirectAuthResult, type UseLockFundsOptions, type UseLockFundsResult, type UseLockedFundsOptions, type UseLockedFundsResult, type UseModifyLockOptions, type UseModifyLockResult, type UsePendingDepositsOptions, type UsePendingDepositsResult, type UsePendingWithdrawalsOptions, type UsePendingWithdrawalsResult, type UseTokenInfoOptions, type UseTokenInfoResult, type UseTokenListOptions, type UseTokenListResult, type UseTotalLockedBalanceOptions, type UseTotalLockedBalanceResult, type UseTransferOptions, type UseTransferResult, type UseUnlockFundsOptions, type UseUnlockFundsResult, type UseWithdrawOptions, type UseWithdrawResult, ValidationError, type VerificationContext, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, WalletInlineModal, type WalletInlineModalProps, WalletModal, type WalletModalHandlers, type WalletModalProps, type WalletSession, type WithdrawFromLockMessage, WithdrawInlineModal, type WithdrawInlineModalProps, type WithdrawMessage, WithdrawModal, type WithdrawModalProps, type WithdrawParams, type WithdrawStep, WithdrawalInfo, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clearHostedAuthPendingTransaction, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, getChainById, getChainIcon, getExplorerAddressUrl, getExplorerLabel, getMinDepositBaseUnits, getTokenIcon, isHostedAuthRefreshActive, isHostedAuthSessionActive, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, syncHostedAuthSessionToClient, useBalance, useBatchBalances, useDeposit, useDepositAddress, useDepositVerification, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingDeposits, usePendingWithdrawals, usePrivanaClient, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { usePrivanaContext, createHostedAuthPendingStorageKey, clearHostedAuthPendingTransaction, HostedAuthRequiredError, HostedAuthError, createPkceVerifier, createPkceChallenge, createHostedAuthState, persistHostedAuthPendingTransaction, parseHostedAuthCallback, readHostedAuthPendingTransaction, HostedAuthStateMismatchError, buildHostedAuthSession, useSafePrivanaContext, usePrivateReadRequest, formatTokenAmount, submitPendingLock, PostDepositLockError, useDepositVerification, useEnsureCorrectChain, getTransactionReceipt, getBlockNumber, waitForTransactionReceipt, canUseBrowserStorage, clampLockAmount, requireDepositLockOwner, getWalletClient, createSignedLockRequest, requireServiceAddress, signWithdrawMessage, signLockMessage, signTransferMessage, signTransferLockedMessage, signModifyLockMessage, cn, stripHostedAuthCallbackParams, AccountingApiError, getBrowserStorageItem, removeBrowserStorageItem, isSignedLockUsable, setBrowserStorageItem, resolveProductOnRamp, matchesProductOnRampScope, createProductOnRampOutcomeCallbacks, canUseSharedBrowserStorage, DEFAULT_LOCK_DURATION_SECONDS, isMoonPayProductOnRamp, parseTokenAmount, Skeleton, createProductOnRampFlowSnapshot, shortenAddress, formatCountdown, getExplorerAddressUrl, getExplorerLabel, formatTimeRemaining, getSharedBrowserStorageItem, removeSharedBrowserStorageItem, setSharedBrowserStorageItem, matchesOnRampTransaction, useTransakOnRamp, getTransakMinimumTargetBaseUnits, matchesFrozenOnRampToken, Button, canRetryOnRampVerification, FiatOnRampForm } from './chunk-RDYNQUMV.js';
3
- export { AccountingApiError, Button, DEFAULT_LOCK_DURATION_SECONDS, DEFAULT_ONRAMP_LOCK_BUFFER, HOSTED_AUTH_CLOCK_SKEW_MS, HostedAuthError, HostedAuthRequiredError, HostedAuthStateMismatchError, HttpClient, LOCK_TYPES, MODIFY_LOCK_TYPES, NETWORK_CONFIG, NetworkError, PostDepositLockError, PrivanaClient, PrivanaProvider, SUPPORTED_CHAINS, SiweAuthProvider, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, ValidationError, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, applyLockBuffer, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clampLockAmount, clearHostedAuthPendingTransaction, clearPendingLock, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, createSignedLockRequest, getAccountingContract, getApiUrl, getChainById, getChainId, getExplorerAddressUrl, getExplorerLabel, isHostedAuthRefreshActive, isHostedAuthSessionActive, isSignedLockUsable, loadPendingLock, normalizeAddress, normalizeHex, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, requireDepositLockOwner, requireServiceAddress, savePendingLock, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, submitPendingLock, syncHostedAuthSessionToClient, useDepositVerification, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth } from './chunk-RDYNQUMV.js';
2
+ import { usePrivanaContext, createHostedAuthPendingStorageKey, clearHostedAuthPendingTransaction, HostedAuthRequiredError, HostedAuthError, createPkceVerifier, createPkceChallenge, createHostedAuthState, persistHostedAuthPendingTransaction, parseHostedAuthCallback, readHostedAuthPendingTransaction, HostedAuthStateMismatchError, buildHostedAuthSession, useSafePrivanaContext, usePrivateReadRequest, formatTokenAmount, submitPendingLock, PostDepositLockError, useDepositVerification, useEnsureCorrectChain, getTransactionReceipt, getBlockNumber, waitForTransactionReceipt, canUseBrowserStorage, clampLockAmount, requireDepositLockOwner, getWalletClient, createSignedLockRequest, requireServiceAddress, signWithdrawMessage, signLockMessage, signTransferMessage, signTransferLockedMessage, signModifyLockMessage, cn, stripHostedAuthCallbackParams, AccountingApiError, getBrowserStorageItem, removeBrowserStorageItem, isSignedLockUsable, setBrowserStorageItem, resolveProductOnRamp, matchesProductOnRampScope, createProductOnRampOutcomeCallbacks, canUseSharedBrowserStorage, DEFAULT_LOCK_DURATION_SECONDS, isMoonPayProductOnRamp, parseTokenAmount, Skeleton, createProductOnRampFlowSnapshot, shortenAddress, formatCountdown, getExplorerAddressUrl, getExplorerLabel, formatTimeRemaining, getSharedBrowserStorageItem, removeSharedBrowserStorageItem, setSharedBrowserStorageItem, matchesOnRampTransaction, useTransakOnRamp, getTransakMinimumTargetBaseUnits, matchesFrozenOnRampToken, Button, canRetryOnRampVerification, FiatOnRampForm } from './chunk-KUHXTCVW.js';
3
+ export { AccountingApiError, Button, DEFAULT_LOCK_DURATION_SECONDS, DEFAULT_ONRAMP_LOCK_BUFFER, HOSTED_AUTH_CLOCK_SKEW_MS, HostedAuthError, HostedAuthRequiredError, HostedAuthStateMismatchError, HttpClient, LOCK_TYPES, MODIFY_LOCK_TYPES, NETWORK_CONFIG, NetworkError, PostDepositLockError, PrivanaClient, PrivanaProvider, SUPPORTED_CHAINS, SiweAuthProvider, Skeleton, TRANSFER_LOCKED_TYPES, TRANSFER_TYPES, ValidationError, WITHDRAW_FROM_LOCK_TYPES, WITHDRAW_TYPES, applyLockBuffer, applyRefreshResponse, buildHostedAuthSession, buildSiweStatement, buttonVariants, clampLockAmount, clearHostedAuthPendingTransaction, clearPendingLock, createDomain, createHostedAuthPendingStorageKey, createHostedAuthState, createHostedAuthStorageKey, createLockExpiry, createPkceChallenge, createPkceVerifier, createSignedLockRequest, getAccountingContract, getApiUrl, getChainById, getChainId, getExplorerAddressUrl, getExplorerLabel, isHostedAuthRefreshActive, isHostedAuthSessionActive, isSignedLockUsable, loadPendingLock, normalizeAddress, normalizeHex, parseHostedAuthCallback, persistHostedAuthPendingTransaction, readHostedAuthPendingTransaction, readStoredHostedAuthSession, requireDepositLockOwner, requireServiceAddress, savePendingLock, signLockMessage, signModifyLockMessage, signTransferLockedMessage, signTransferMessage, signWithdrawFromLockMessage, signWithdrawMessage, stripHostedAuthCallbackParams, submitPendingLock, syncHostedAuthSessionToClient, useDepositVerification, usePrivanaContext, useSafeAccount, useSafePrivanaContext, useSiweAuth } from './chunk-KUHXTCVW.js';
4
4
  import { useState, useRef, useMemo, useCallback, useContext, useEffect, useId } from 'react';
5
5
  import { QueryClientContext, useQuery, useQueryClient, useMutation, keepPreviousData } from '@tanstack/react-query';
6
6
  import { useAccount, useWalletClient, useConfig, useWriteContract, useSendTransaction, useBalance as useBalance$1, useReadContract } from 'wagmi';
@@ -274,6 +274,20 @@ function useBatchBalances(options) {
274
274
  refetch: query.refetch
275
275
  };
276
276
  }
277
+
278
+ // src/sdk/utils/min-deposit.ts
279
+ function getMinDepositBaseUnits(response, chainId, kind) {
280
+ const value = response?.min_deposit?.[String(chainId)]?.[kind];
281
+ if (value === void 0) return void 0;
282
+ try {
283
+ const amount = BigInt(value);
284
+ return amount >= 0n ? amount : void 0;
285
+ } catch {
286
+ return void 0;
287
+ }
288
+ }
289
+
290
+ // src/sdk/hooks/use-deposit.ts
277
291
  var STALE_MS = 30 * 60 * 1e3;
278
292
  function resolveConfirmations(depositAddress, chainId) {
279
293
  const confirmations = depositAddress.finality_depth?.[String(chainId)];
@@ -543,11 +557,14 @@ function useDeposit(options = {}) {
543
557
  throw new Error("Invalid deposit address received from API");
544
558
  }
545
559
  const isNative = token.contract === zeroAddress;
546
- const minsForChain = addrResponse.min_deposit?.[String(sourceChain.id)];
547
- const minAmountStr = isNative ? minsForChain?.native : minsForChain?.erc20;
548
- if (minAmountStr && params.amount < BigInt(minAmountStr)) {
560
+ const minimum = getMinDepositBaseUnits(
561
+ addrResponse,
562
+ sourceChain.id,
563
+ isNative ? "native" : "erc20"
564
+ );
565
+ if (minimum !== void 0 && params.amount < minimum) {
549
566
  throw new Error(
550
- `Amount is below the minimum deposit (${minAmountStr}) for ${isNative ? "native" : "ERC-20"} on chain ${sourceChain.id}`
567
+ `Amount is below the minimum deposit (${minimum}) for ${isNative ? "native" : "ERC-20"} on chain ${sourceChain.id}`
551
568
  );
552
569
  }
553
570
  const confirmations = resolveConfirmations(addrResponse, sourceChain.id);
@@ -1520,7 +1537,7 @@ function DialogDescription({
1520
1537
  );
1521
1538
  }
1522
1539
 
1523
- // src/sdk/hooks/external-deposit-lock.ts
1540
+ // src/sdk/utils/external-deposit-lock.ts
1524
1541
  var ACTIVE_SESSION_PREFIX = "privana:external-deposit-lock:active:";
1525
1542
  var SESSION_PREFIX = "privana:external-deposit-lock:session:";
1526
1543
  var ExternalDepositLockSessionChangedError = class _ExternalDepositLockSessionChangedError extends Error {
@@ -1539,16 +1556,6 @@ function isExternalDepositBlockInSession(session, blockNumber) {
1539
1556
  function isCurrentExternalDepositVerification(session, txHash) {
1540
1557
  return session.creditedAmount === void 0 && session.verification?.hash.toLowerCase() === txHash.toLowerCase();
1541
1558
  }
1542
- function getExternalDepositMinimum(response, chainId) {
1543
- const value = response?.min_deposit?.[String(chainId)]?.erc20;
1544
- if (value === void 0) return void 0;
1545
- try {
1546
- const amount = BigInt(value);
1547
- return amount >= 0n ? amount : void 0;
1548
- } catch {
1549
- return void 0;
1550
- }
1551
- }
1552
1559
  function activeSessionKey(owner) {
1553
1560
  return `${ACTIVE_SESSION_PREFIX}${owner.toLowerCase()}`;
1554
1561
  }
@@ -1814,6 +1821,8 @@ async function submitExternalDepositLockAttempt(client, session, crossTabExclusi
1814
1821
  throw err;
1815
1822
  }
1816
1823
  }
1824
+
1825
+ // src/sdk/hooks/use-external-deposit-lock.ts
1817
1826
  function useExternalDepositLock({
1818
1827
  allowance,
1819
1828
  onLockSubmitted,
@@ -2365,6 +2374,29 @@ function EthereumIcon({ className, size = 24 }) {
2365
2374
  }
2366
2375
  );
2367
2376
  }
2377
+ function HyperliquidIcon({ className, size = 24 }) {
2378
+ return /* @__PURE__ */ jsxs(
2379
+ "svg",
2380
+ {
2381
+ width: size,
2382
+ height: size,
2383
+ viewBox: "0 0 24 24",
2384
+ fill: "none",
2385
+ xmlns: "http://www.w3.org/2000/svg",
2386
+ className,
2387
+ children: [
2388
+ /* @__PURE__ */ jsx("rect", { width: "24", height: "24", rx: "12", fill: "#0F3933" }),
2389
+ /* @__PURE__ */ jsx(
2390
+ "path",
2391
+ {
2392
+ d: "M21.0141 11.9135C21.0141 17.8492 17.3699 19.7541 15.4374 18.07C13.8638 16.6896 13.3944 13.7632 11.0202 13.4596C8.01092 13.1007 7.73484 17.1038 5.7471 17.1038C3.42805 17.1038 2.98633 13.7632 2.98633 12.0239C2.98633 10.2571 3.48327 7.85519 5.44341 7.85519C7.73484 7.85519 7.87289 11.3062 10.7441 11.1129C13.5877 10.9196 13.6429 7.33064 15.5202 5.81223C17.149 4.45945 21.0141 5.89505 21.0141 11.9135Z",
2393
+ fill: "#97FCE4"
2394
+ }
2395
+ )
2396
+ ]
2397
+ }
2398
+ );
2399
+ }
2368
2400
  function getTokenIcon(symbol, size) {
2369
2401
  const iconSize = size ?? 24;
2370
2402
  switch ((symbol ?? "").toUpperCase()) {
@@ -2373,6 +2405,9 @@ function getTokenIcon(symbol, size) {
2373
2405
  case "ETH":
2374
2406
  case "WETH":
2375
2407
  return /* @__PURE__ */ jsx(EthereumIcon, { size: iconSize });
2408
+ case "HYPE":
2409
+ case "WHYPE":
2410
+ return /* @__PURE__ */ jsx(HyperliquidIcon, { size: iconSize });
2376
2411
  default:
2377
2412
  return /* @__PURE__ */ jsx(
2378
2413
  "div",
@@ -3330,6 +3365,7 @@ function DepositView({
3330
3365
  amount,
3331
3366
  allowance,
3332
3367
  externalMinimum,
3368
+ walletMinimum,
3333
3369
  onAmountChange,
3334
3370
  onSelectToken,
3335
3371
  onConnectWallet,
@@ -3381,13 +3417,14 @@ function DepositView({
3381
3417
  const moonpayLimitsUnready = isMoonPayCard && !!onRamp.providerAssetCode && moonpayMinBuy == null;
3382
3418
  const creditCardUnavailable = isCreditCard && !!onRamp.unavailableReason;
3383
3419
  const externalTokenUnavailable = isExternal && !!selectedToken && isNative;
3384
- const externalMinimumRequired = isExternal && !!allowance && !!selectedToken;
3420
+ const externalMinimumRequired = isExternal && !!selectedToken;
3385
3421
  const externalMinimumLoading = externalMinimumRequired && externalMinimum === void 0;
3386
3422
  const externalMinimumUnavailable = externalMinimumRequired && externalMinimum === null;
3387
3423
  const belowExternalMinimum = externalMinimumRequired && hasValidAmount && !tooManyDecimals && !!selectedToken && typeof externalMinimum === "bigint" && parseTokenAmount(amount, selectedToken.decimals) < externalMinimum;
3424
+ const belowWalletMinimum = isConnectedSource && hasValidAmount && !tooManyDecimals && !exceedsBalance && !!selectedToken && typeof walletMinimum === "bigint" && parseTokenAmount(amount, selectedToken.decimals) < walletMinimum;
3388
3425
  const externalNeedsWallet = isExternal && (!!allowance || !hostedAuthConfig);
3389
3426
  const needsConnect = (isConnectedSource || externalNeedsWallet) && !isConnected;
3390
- const canDeposit = hasValidAmount && !!selectedToken && !tooManyDecimals && !exceedsBalance && !belowMoonpayMin && !moonpayLimitsUnready && !creditCardUnavailable && !externalTokenUnavailable && !externalMinimumLoading && !externalMinimumUnavailable && !belowExternalMinimum && !needsConnect;
3427
+ const canDeposit = hasValidAmount && !!selectedToken && !tooManyDecimals && !exceedsBalance && !belowMoonpayMin && !moonpayLimitsUnready && !creditCardUnavailable && !externalTokenUnavailable && !externalMinimumLoading && !externalMinimumUnavailable && !belowExternalMinimum && !belowWalletMinimum && !needsConnect;
3391
3428
  const handleMax = () => {
3392
3429
  if (selectedToken && walletBalance != null && walletBalance > 0n)
3393
3430
  onAmountChange(formatUnits(walletBalance, selectedToken.decimals));
@@ -3491,6 +3528,13 @@ function DepositView({
3491
3528
  selectedToken.symbol,
3492
3529
  "."
3493
3530
  ] }),
3531
+ belowWalletMinimum && selectedToken && typeof walletMinimum === "bigint" && /* @__PURE__ */ jsxs("p", { className: "text-destructive text-sm", children: [
3532
+ "Minimum deposit is ",
3533
+ formatUnits(walletMinimum, selectedToken.decimals),
3534
+ " ",
3535
+ selectedToken.symbol,
3536
+ "."
3537
+ ] }),
3494
3538
  externalMinimumLoading && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Checking minimum deposit\u2026" }),
3495
3539
  externalMinimumUnavailable && /* @__PURE__ */ jsx("p", { className: "text-destructive text-sm", children: "Couldn\u2019t load the minimum deposit. Please try again." }),
3496
3540
  isMoonPayCard && moonpayLimitsError && /* @__PURE__ */ jsx("p", { className: "text-destructive text-sm", children: "Couldn\u2019t load purchase limits. Please try again." }),
@@ -3574,6 +3618,7 @@ function ExternalDepositView({
3574
3618
  token,
3575
3619
  amount,
3576
3620
  depositAddressState,
3621
+ externalMinimum,
3577
3622
  onCredited,
3578
3623
  onDiscardLock,
3579
3624
  lock
@@ -3581,6 +3626,7 @@ function ExternalDepositView({
3581
3626
  const { getChainById: getChainById2, getTokenById, serviceName } = usePrivanaContext();
3582
3627
  const appName = serviceName ?? "Privana";
3583
3628
  const { depositAddress, isReady, isLoading } = depositAddressState;
3629
+ const minimumLabel = token && typeof externalMinimum === "bigint" ? `${formatUnits(externalMinimum, token.decimals)} ${token.symbol}` : void 0;
3584
3630
  const chain = token ? getChainById2(token.chainId) : void 0;
3585
3631
  const lockSession = lock?.session;
3586
3632
  const recordVerification = lock?.recordVerification;
@@ -3717,7 +3763,11 @@ function ExternalDepositView({
3717
3763
  /* @__PURE__ */ jsx(SummaryRow, { value: amount || "\u2014", label: "Value" })
3718
3764
  ] }),
3719
3765
  showDepositInstructions && /* @__PURE__ */ jsxs(Fragment, { children: [
3720
- !scanPaused && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Send the displayed amount in one transfer. Transfers below the minimum are not combined or automatically returned." }),
3766
+ !scanPaused && /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
3767
+ "Send the displayed amount in one transfer. Transfers below the minimum",
3768
+ minimumLabel ? ` (${minimumLabel})` : "",
3769
+ " are not combined or automatically returned."
3770
+ ] }),
3721
3771
  /* @__PURE__ */ jsx("div", { className: "bg-secondary flex h-50 items-center justify-center rounded-[10px]", children: !isReady ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground px-6 text-center text-sm", children: "Connect your wallet to generate a deposit address." }) : depositAddress ? /* @__PURE__ */ jsx("div", { className: "rounded-[10px] bg-white p-3", children: /* @__PURE__ */ jsx(QRCodeSVG, { value: depositAddress, size: 160 }) }) : isLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-full w-full rounded-[10px]" }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: "Deposit address unavailable" }) }),
3722
3772
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
3723
3773
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Deposit Address" }),
@@ -3971,10 +4021,15 @@ function DepositModalContent({
3971
4021
  const mountedCardFlow = cardFlow && matchesProductOnRampScope(cardFlow.scope, cardOnRampScope) ? cardFlow : null;
3972
4022
  const displayedCardOnRamp = view === "credit-card-widget" && mountedCardFlow ? mountedCardFlow.selection : cardOnRamp;
3973
4023
  const selectedToken = source === "credit-card" ? displayedCardOnRamp.token : stateSelectedToken;
3974
- const externalDepositAddress = useDepositAddress({
3975
- enabled: source === "external" && (view === "deposit" || view === "external-deposit")
4024
+ const depositAddressState = useDepositAddress({
4025
+ enabled: source === "external" && (view === "deposit" || view === "external-deposit") || source === "connected" && view === "deposit"
3976
4026
  });
3977
- const externalMinimum = source !== "external" || !selectedToken ? void 0 : externalDepositAddress.isError ? null : externalDepositAddress.response ? getExternalDepositMinimum(externalDepositAddress.response, selectedToken.chainId) ?? null : void 0;
4027
+ const externalMinimum = source !== "external" || !selectedToken ? void 0 : depositAddressState.isError ? null : depositAddressState.response ? getMinDepositBaseUnits(depositAddressState.response, selectedToken.chainId, "erc20") ?? null : void 0;
4028
+ const walletMinimum = source !== "connected" || !selectedToken ? void 0 : depositAddressState.isError ? null : depositAddressState.response ? getMinDepositBaseUnits(
4029
+ depositAddressState.response,
4030
+ selectedToken.chainId,
4031
+ selectedToken.contract === zeroAddress ? "native" : "erc20"
4032
+ ) ?? null : void 0;
3978
4033
  const prevAddressRef = useRef(address);
3979
4034
  useEffect(() => {
3980
4035
  const prev = prevAddressRef.current;
@@ -4125,10 +4180,6 @@ function DepositModalContent({
4125
4180
  return;
4126
4181
  }
4127
4182
  const depositAmount = parseTokenAmount(args.amount, token2.decimals);
4128
- if (!allowance) {
4129
- setView("external-deposit");
4130
- return;
4131
- }
4132
4183
  if (typeof externalMinimum !== "bigint") {
4133
4184
  toast.error("Minimum deposit is unavailable. Please try again.");
4134
4185
  return;
@@ -4139,6 +4190,10 @@ function DepositModalContent({
4139
4190
  );
4140
4191
  return;
4141
4192
  }
4193
+ if (!allowance) {
4194
+ setView("external-deposit");
4195
+ return;
4196
+ }
4142
4197
  externalLock.signAndPersist({
4143
4198
  tokenId: token2.id,
4144
4199
  amount: depositAmount
@@ -4428,6 +4483,7 @@ function DepositModalContent({
4428
4483
  amount,
4429
4484
  allowance,
4430
4485
  externalMinimum,
4486
+ walletMinimum,
4431
4487
  onAmountChange: setAmount,
4432
4488
  onSelectToken: () => setView("select-token"),
4433
4489
  onConnectWallet,
@@ -4453,7 +4509,8 @@ function DepositModalContent({
4453
4509
  {
4454
4510
  token: selectedToken,
4455
4511
  amount,
4456
- depositAddressState: externalDepositAddress,
4512
+ depositAddressState,
4513
+ externalMinimum,
4457
4514
  onCredited: allowance ? void 0 : onDepositSuccess,
4458
4515
  onDiscardLock: handleExternalVerificationDiscard,
4459
4516
  lock: externalLock.session ? externalLock : void 0
@@ -5384,6 +5441,6 @@ function WalletInlineModal({ className, ...handlers }) {
5384
5441
  );
5385
5442
  }
5386
5443
 
5387
- export { DepositInlineModal, DepositModal, PrivanaIcon, WalletInlineModal, WalletModal, WithdrawInlineModal, WithdrawModal, getChainIcon, getTokenIcon, useBalance, useBatchBalances, useDeposit, useDepositAddress, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingDeposits, usePendingWithdrawals, usePrivanaClient, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
5444
+ export { DepositInlineModal, DepositModal, PrivanaIcon, WalletInlineModal, WalletModal, WithdrawInlineModal, WithdrawModal, getChainIcon, getMinDepositBaseUnits, getTokenIcon, useBalance, useBatchBalances, useDeposit, useDepositAddress, useExpiredLocks, useHistory, useHostedRedirectAuth, useLockFunds, useLockedFunds, useModifyLock, usePendingDeposits, usePendingWithdrawals, usePrivanaClient, useTokenInfo, useTokenList, useTotalLockedBalance, useTransfer, useUnlockFunds, useWithdraw };
5388
5445
  //# sourceMappingURL=index.js.map
5389
5446
  //# sourceMappingURL=index.js.map