@oasisprotocol/privana-sdk 0.5.3 → 0.5.5

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.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { A as Address, J as JwtRefreshResponse, H as HostedAuthTokenExchangeResponse, B as Bytes32, a as HexString, P as PrivanaClient, N as NetworkConfig, T as TokenConfig, b as TokenBalance, c as PostDepositLockConfig, D as DepositAddressResponse, d as DepositCheckResponse, e as TransactionSubmissionResponse, f as PostDepositLockError, L as LockInfo, g as PendingDeposit, h as PendingDepositsResponse, W as WithdrawalInfo, i as HistoryEntry, j as TokenInfoResponse } from './pending-lock-f4bWWTyN.js';
2
- export { k as BalanceResponse, l as BatchBalancesRequest, m as BatchBalancesResponse, C as CreateOnRampIntentRequest, n as CreateOnRampIntentResponse, o as CreateSignedLockRequestParams, p as DEFAULT_LOCK_DURATION_SECONDS, q as DEFAULT_ONRAMP_LOCK_BUFFER, r as DepositAddressRequest, s as DepositCheckRequest, E as ExpiredLocksResponse, t as HistoryKind, u as HistoryRequest, v as HistoryResponse, w as HostedAuthAuthorizeUrlRequest, x as HostedAuthResponseMode, y as HostedAuthTokenExchangeRequest, z as HttpClient, F as HttpClientConfig, I as IntegerLike, G as JwtLogoutRequest, K as JwtLogoutResponse, M as JwtRefreshRequest, O as LockFundsRequest, Q as LockNonceResponse, R as LockedFundsResponse, S as MinDepositAmounts, U as ModifyLockNonceResponse, V as ModifyLockRequest, X as NETWORK_CONFIG, Y as Network, Z as OnRampPostDepositLockConfig, _ as OnRampRecord, $ as OnRampStatus, a0 as PendingDepositStatus, a1 as PendingDepositsRequest, a2 as PendingOnRampsResponse, a3 as PendingWithdrawalsResponse, a4 as PostDepositLockFailureReason, a5 as PrivanaClientConfig, a6 as SignOnRampUrlRequest, a7 as SignOnRampUrlResponse, a8 as SiweDomainResponse, a9 as SiweLoginRequest, aa as SiweLoginResponse, ab as SiweNonceResponse, ac as SubmitPendingLockParams, ad as TokenListResponse, ae as TotalLockedBalanceResponse, af as TransferFundsRequest, ag as TransferLockedFundsRequest, ah as TransferLockedNonceResponse, ai as TransferNonceResponse, aj as UnlockAllExpiredRequest, ak as UnlockFundsRequest, al as UpdateOnRampRequest, am as UpdateOnRampResponse, an as WithdrawFromLockRequest, ao as WithdrawalInfoResponse, ap as WithdrawalNonceResponse, aq as WithdrawalRequest, ar as applyLockBuffer, as as clampLockAmount, at as clearPendingLock, au as createSignedLockRequest, av as getAccountingContract, aw as getApiUrl, ax as getChainId, ay as isSignedLockUsable, az as loadPendingLock, aA as normalizeAddress, aB as normalizeHex, aC as requireDepositLockOwner, aD as requireServiceAddress, aE as savePendingLock, aF as submitPendingLock } from './pending-lock-f4bWWTyN.js';
1
+ import { A as Address, J as JwtRefreshResponse, H as HostedAuthTokenExchangeResponse, B as Bytes32, a as HexString, P as PrivanaClient, N as NetworkConfig, T as TokenConfig, b as TokenBalance, c as PostDepositLockConfig, D as DepositAddressResponse, d as DepositCheckResponse, e as TransactionSubmissionResponse, f as PostDepositLockError, L as LockInfo, g as PendingDeposit, h as PendingDepositsResponse, W as WithdrawalInfo, i as HistoryEntry, j as TokenInfoResponse } from './pending-lock-IgzZyg9C.js';
2
+ export { k as BalanceResponse, l as BatchBalancesRequest, m as BatchBalancesResponse, C as CreateOnRampIntentRequest, n as CreateOnRampIntentResponse, o as CreateSignedLockRequestParams, p as DEFAULT_LOCK_DURATION_SECONDS, q as DEFAULT_ONRAMP_LOCK_BUFFER, r as DepositAddressRequest, s as DepositCheckRequest, E as ExpiredLocksResponse, t as HistoryKind, u as HistoryRequest, v as HistoryResponse, w as HostedAuthAuthorizeUrlRequest, x as HostedAuthResponseMode, y as HostedAuthTokenExchangeRequest, z as HttpClient, F as HttpClientConfig, I as IntegerLike, G as JwtLogoutRequest, K as JwtLogoutResponse, M as JwtRefreshRequest, O as LockFundsRequest, Q as LockNonceResponse, R as LockedFundsResponse, S as MinDepositAmounts, U as ModifyLockNonceResponse, V as ModifyLockRequest, X as NETWORK_CONFIG, Y as Network, Z as OnRampPostDepositLockConfig, _ as OnRampProvider, $ as OnRampRecord, a0 as OnRampStatus, a1 as PendingDepositStatus, a2 as PendingDepositsRequest, a3 as PendingOnRampsResponse, a4 as PendingWithdrawalsResponse, a5 as PostDepositLockFailureReason, a6 as PrivanaClientConfig, a7 as SignOnRampUrlRequest, a8 as SignOnRampUrlResponse, a9 as SiweDomainResponse, aa as SiweLoginRequest, ab as SiweLoginResponse, ac as SiweNonceResponse, ad as SubmitPendingLockParams, ae as TokenListResponse, af as TotalLockedBalanceResponse, ag as TransferFundsRequest, ah as TransferLockedFundsRequest, ai as TransferLockedNonceResponse, aj as TransferNonceResponse, ak as UnlockAllExpiredRequest, al as UnlockFundsRequest, am as UpdateOnRampRequest, an as UpdateOnRampResponse, ao as WithdrawFromLockRequest, ap as WithdrawalInfoResponse, aq as WithdrawalNonceResponse, ar as WithdrawalRequest, as as applyLockBuffer, at as clampLockAmount, au as clearPendingLock, av as createSignedLockRequest, aw as getAccountingContract, ax as getApiUrl, ay as getChainId, az as isSignedLockUsable, aA as loadPendingLock, aB as normalizeAddress, aC as normalizeHex, aD as requireDepositLockOwner, aE as requireServiceAddress, aF as savePendingLock, aG as submitPendingLock } from './pending-lock-IgzZyg9C.js';
3
3
  import { WalletClient, Address as Address$1 } from 'viem';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as React$1 from 'react';
6
- import { ReactNode, ComponentProps, ReactElement } from 'react';
6
+ import { ReactNode } from 'react';
7
7
  import * as class_variance_authority_types from 'class-variance-authority/types';
8
8
  import { VariantProps } from 'class-variance-authority';
9
9
 
@@ -843,46 +843,6 @@ interface UseModifyLockResult {
843
843
  }
844
844
  declare function useModifyLock(options?: UseModifyLockOptions): UseModifyLockResult;
845
845
 
846
- declare const buttonVariants: (props?: ({
847
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
848
- size?: "default" | "icon" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
849
- } & class_variance_authority_types.ClassProp) | undefined) => string;
850
- declare function Button({ className, variant, size, asChild, ...props }: React$1.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
851
- asChild?: boolean;
852
- }): react_jsx_runtime.JSX.Element;
853
-
854
- type ButtonVariantProps = VariantProps<typeof buttonVariants>;
855
- interface PrivanaButtonProps extends Omit<ComponentProps<'button'>, 'children'> {
856
- children?: ReactNode;
857
- variant?: ButtonVariantProps['variant'];
858
- size?: ButtonVariantProps['size'];
859
- asChild?: boolean;
860
- renderButton?: (props: {
861
- onClick: () => void;
862
- isOpen: boolean;
863
- }) => ReactElement;
864
- hideWhenDisconnected?: boolean;
865
- showLockedFunds?: boolean;
866
- defaultTab?: 'deposit' | 'withdraw';
867
- onDepositSuccess?: () => void;
868
- }
869
- declare function PrivanaButton({ children, className, variant, size, asChild, renderButton, hideWhenDisconnected, showLockedFunds, defaultTab, onDepositSuccess, ...buttonProps }: PrivanaButtonProps): react_jsx_runtime.JSX.Element | null;
870
-
871
- interface PrivanaModalProps {
872
- open: boolean;
873
- onClose: () => void;
874
- showLockedFunds?: boolean;
875
- defaultTab?: 'deposit' | 'withdraw';
876
- onDepositSuccess?: () => void;
877
- }
878
- declare function PrivanaModal({ open, onClose, showLockedFunds, defaultTab, onDepositSuccess, }: PrivanaModalProps): react_jsx_runtime.JSX.Element;
879
- declare function PrivanaInlineModal({ className, showLockedFunds, defaultTab, onDepositSuccess, }: {
880
- className?: string;
881
- showLockedFunds?: boolean;
882
- defaultTab?: 'deposit' | 'withdraw';
883
- onDepositSuccess?: () => void;
884
- }): react_jsx_runtime.JSX.Element;
885
-
886
846
  type DepositMethodTab = 'crypto' | 'credit-card';
887
847
  type DepositSource = 'connected' | 'external' | 'credit-card';
888
848
  interface DepositMethodHandlers {
@@ -917,12 +877,14 @@ declare function DepositInlineModal({ className, ...handlers }: DepositInlineMod
917
877
  interface WithdrawModalProps {
918
878
  open: boolean;
919
879
  onClose: () => void;
880
+ onWithdrawSuccess?: () => void;
920
881
  }
921
- declare function WithdrawModal({ open, onClose }: WithdrawModalProps): react_jsx_runtime.JSX.Element;
882
+ declare function WithdrawModal({ open, onClose, onWithdrawSuccess }: WithdrawModalProps): react_jsx_runtime.JSX.Element;
922
883
  interface WithdrawInlineModalProps {
923
884
  className?: string;
885
+ onWithdrawSuccess?: () => void;
924
886
  }
925
- declare function WithdrawInlineModal({ className }: WithdrawInlineModalProps): react_jsx_runtime.JSX.Element;
887
+ declare function WithdrawInlineModal({ className, onWithdrawSuccess }: WithdrawInlineModalProps): react_jsx_runtime.JSX.Element;
926
888
 
927
889
  interface WalletSession {
928
890
  /** Funds committed to the active session, in the display token's base units. */
@@ -937,6 +899,7 @@ interface WalletModalHandlers extends DepositMethodHandlers {
937
899
  amount: string;
938
900
  }) => unknown;
939
901
  onEndSession?: () => Promise<void>;
902
+ onWithdrawSuccess?: () => void;
940
903
  }
941
904
  interface WalletModalProps extends WalletModalHandlers {
942
905
  open: boolean;
@@ -948,6 +911,14 @@ interface WalletInlineModalProps extends WalletModalHandlers {
948
911
  }
949
912
  declare function WalletInlineModal({ className, ...handlers }: WalletInlineModalProps): react_jsx_runtime.JSX.Element;
950
913
 
914
+ declare const buttonVariants: (props?: ({
915
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
916
+ size?: "default" | "icon" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
917
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
918
+ declare function Button({ className, variant, size, asChild, ...props }: React$1.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
919
+ asChild?: boolean;
920
+ }): react_jsx_runtime.JSX.Element;
921
+
951
922
  declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
952
923
 
953
924
  declare function getTokenIcon(symbol: string, size?: number): react_jsx_runtime.JSX.Element;
@@ -959,4 +930,4 @@ interface PrivanaIconProps {
959
930
  }
960
931
  declare function PrivanaIcon({ className, size }: PrivanaIconProps): react_jsx_runtime.JSX.Element;
961
932
 
962
- 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, PendingDeposit, PendingDepositsResponse, PostDepositLockConfig, PostDepositLockError, PrivanaButton, type PrivanaButtonProps, PrivanaClient, type PrivanaContextValue, PrivanaIcon, PrivanaInlineModal, PrivanaModal, 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 };
933
+ 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, 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 };