@unifold/ui-react 0.1.42 → 0.1.43
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.mts +103 -5
- package/dist/index.d.ts +103 -5
- package/dist/index.js +1420 -380
- package/dist/index.mjs +1417 -371
- package/dist/styles-base.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { AutoSwapResponse, ChainType, Wallet, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, DestinationToken, DestinationTokenChain, SupportedDestinationTokensResponse, VerifyAddressResponse } from '@unifold/core';
|
|
2
|
+
import { AutoSwapResponse, ChainType, Wallet, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, DestinationToken, DestinationTokenChain, PaymentIntent, DepositQuote, SupportedDestinationTokensResponse, VerifyAddressResponse } from '@unifold/core';
|
|
3
3
|
export { ChainType } from '@unifold/core';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -14,6 +14,11 @@ type DepositConfirmationMode = "auto_ui" | "auto_silent" | "manual";
|
|
|
14
14
|
interface UseDepositPollingOptions {
|
|
15
15
|
userId: string | undefined;
|
|
16
16
|
publishableKey: string;
|
|
17
|
+
/**
|
|
18
|
+
* When provided, polls executions via the payment-intent-scoped endpoint
|
|
19
|
+
* instead of the user-scoped queryExecutions endpoint.
|
|
20
|
+
*/
|
|
21
|
+
clientSecret?: string;
|
|
17
22
|
/** Controls when polling starts and whether a waiting UI is shown.
|
|
18
23
|
* - "auto_ui": After 10s, starts polling and shows "Processing..." card (default)
|
|
19
24
|
* - "auto_silent": After 10s, starts polling silently (no waiting UI)
|
|
@@ -50,7 +55,7 @@ interface UseDepositPollingResult {
|
|
|
50
55
|
/** Call this when user clicks "I've made the deposit" (manual mode) */
|
|
51
56
|
handleIveDeposited: () => void;
|
|
52
57
|
}
|
|
53
|
-
declare function useDepositPolling({ userId, publishableKey, depositConfirmationMode, depositWalletId, enabled, immediateDirectPolling, onDepositSuccess, onDepositError, }: UseDepositPollingOptions): UseDepositPollingResult;
|
|
58
|
+
declare function useDepositPolling({ userId, publishableKey, clientSecret, depositConfirmationMode, depositWalletId, enabled, immediateDirectPolling, onDepositSuccess, onDepositError, }: UseDepositPollingOptions): UseDepositPollingResult;
|
|
54
59
|
|
|
55
60
|
declare global {
|
|
56
61
|
interface Window {
|
|
@@ -224,6 +229,8 @@ declare function DepositHeader({ title, subtitle, showBack, showClose, onBack, o
|
|
|
224
229
|
interface TransferCryptoSingleInputProps {
|
|
225
230
|
userId: string;
|
|
226
231
|
publishableKey: string;
|
|
232
|
+
/** When provided, polls executions via the payment-intent-scoped endpoint instead of user-scoped. */
|
|
233
|
+
clientSecret?: string;
|
|
227
234
|
recipientAddress?: string;
|
|
228
235
|
destinationChainType?: ChainType;
|
|
229
236
|
destinationChainId?: string;
|
|
@@ -250,8 +257,23 @@ interface TransferCryptoSingleInputProps {
|
|
|
250
257
|
code?: string;
|
|
251
258
|
}) => void;
|
|
252
259
|
wallets?: Wallet[];
|
|
260
|
+
/** Called when the user changes the selected source token/chain. */
|
|
261
|
+
onSourceTokenChange?: (info: {
|
|
262
|
+
symbol: string;
|
|
263
|
+
chainType: string;
|
|
264
|
+
chainId: string;
|
|
265
|
+
tokenAddress: string;
|
|
266
|
+
minimumDepositAmountUsd: number;
|
|
267
|
+
}) => void;
|
|
268
|
+
/** Checkout mode: estimated source amount to send (from /public/quotes). Shown above the QR code. */
|
|
269
|
+
checkoutQuote?: {
|
|
270
|
+
sourceAmount: string;
|
|
271
|
+
sourceTokenDecimals: number;
|
|
272
|
+
sourceTokenSymbol: string;
|
|
273
|
+
sourceAmountUsd: string | null;
|
|
274
|
+
} | null;
|
|
253
275
|
}
|
|
254
|
-
declare function TransferCryptoSingleInput({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, }: TransferCryptoSingleInputProps): react_jsx_runtime.JSX.Element;
|
|
276
|
+
declare function TransferCryptoSingleInput({ userId, publishableKey, clientSecret, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, onSourceTokenChange, checkoutQuote, }: TransferCryptoSingleInputProps): react_jsx_runtime.JSX.Element;
|
|
255
277
|
|
|
256
278
|
interface TransferCryptoDoubleInputProps {
|
|
257
279
|
userId: string;
|
|
@@ -425,8 +447,36 @@ interface ConfirmingViewProps {
|
|
|
425
447
|
onClose: () => void;
|
|
426
448
|
executions?: AutoSwapResponse[];
|
|
427
449
|
isPolling?: boolean;
|
|
450
|
+
onNewDeposit?: () => void;
|
|
451
|
+
onDone?: () => void;
|
|
452
|
+
paymentIntentStatus?: string;
|
|
453
|
+
/** Live amount_received_usd from the payment intent (updates via polling). */
|
|
454
|
+
amountReceivedUsd?: string;
|
|
455
|
+
/** Snapshot of amount_received_usd taken when the transaction was submitted. */
|
|
456
|
+
amountReceivedUsdAtSubmission?: string | null;
|
|
457
|
+
}
|
|
458
|
+
declare function ConfirmingView({ isConfirming, onClose, executions, isPolling, onNewDeposit, onDone, paymentIntentStatus, amountReceivedUsd, amountReceivedUsdAtSubmission, }: ConfirmingViewProps): react_jsx_runtime.JSX.Element;
|
|
459
|
+
|
|
460
|
+
interface CheckoutModalProps {
|
|
461
|
+
open: boolean;
|
|
462
|
+
onOpenChange: (open: boolean) => void;
|
|
463
|
+
clientSecret: string;
|
|
464
|
+
publishableKey: string;
|
|
465
|
+
modalTitle?: string;
|
|
466
|
+
/** Enable browser wallet connection option. Defaults to false */
|
|
467
|
+
enableConnectWallet?: boolean;
|
|
468
|
+
theme?: "light" | "dark" | "auto";
|
|
469
|
+
onCheckoutSuccess?: (data: {
|
|
470
|
+
paymentIntentId: string;
|
|
471
|
+
status: string;
|
|
472
|
+
}) => void;
|
|
473
|
+
onCheckoutError?: (error: {
|
|
474
|
+
message: string;
|
|
475
|
+
error?: unknown;
|
|
476
|
+
code?: string;
|
|
477
|
+
}) => void;
|
|
428
478
|
}
|
|
429
|
-
declare function
|
|
479
|
+
declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableConnectWallet, theme, onCheckoutSuccess, onCheckoutError, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
|
|
430
480
|
|
|
431
481
|
interface WithdrawTransactionInfo {
|
|
432
482
|
/** Source (sending) chain type */
|
|
@@ -543,6 +593,18 @@ declare function sendSolanaWithdraw(params: {
|
|
|
543
593
|
amountBaseUnit: string;
|
|
544
594
|
publishableKey: string;
|
|
545
595
|
}): Promise<string>;
|
|
596
|
+
declare const HYPERCORE_CHAIN_ID = "1337";
|
|
597
|
+
declare function isHypercoreChain(chainId: string): boolean;
|
|
598
|
+
declare function sendHypercoreWithdraw(params: {
|
|
599
|
+
provider: EvmWalletProvider;
|
|
600
|
+
fromAddress: string;
|
|
601
|
+
depositWalletAddress: string;
|
|
602
|
+
sourceTokenAddress: string;
|
|
603
|
+
amount: string;
|
|
604
|
+
tokenSymbol: string;
|
|
605
|
+
publishableKey: string;
|
|
606
|
+
}): Promise<void>;
|
|
607
|
+
|
|
546
608
|
declare function detectBrowserWallet(chainType: string, senderAddress?: string): Promise<DetectedWallet | null>;
|
|
547
609
|
|
|
548
610
|
interface WithdrawFormProps {
|
|
@@ -723,6 +785,42 @@ interface AllowedCountryResult {
|
|
|
723
785
|
*/
|
|
724
786
|
declare function useAllowedCountry(publishableKey: string): AllowedCountryResult;
|
|
725
787
|
|
|
788
|
+
interface UsePaymentIntentParams {
|
|
789
|
+
clientSecret: string;
|
|
790
|
+
publishableKey: string;
|
|
791
|
+
/** Whether the query should execute. Defaults to true. */
|
|
792
|
+
enabled?: boolean;
|
|
793
|
+
/** Polling interval in ms. Defaults to 5000 (5s). Set to 0 to disable. */
|
|
794
|
+
pollingInterval?: number;
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Hook to retrieve and poll a payment intent via react-query.
|
|
798
|
+
*
|
|
799
|
+
* Fetches the payment intent on mount and polls at the configured interval
|
|
800
|
+
* so `amount_received_usd` and `status` stay up-to-date in the UI.
|
|
801
|
+
*/
|
|
802
|
+
declare function usePaymentIntent(params: UsePaymentIntentParams): _tanstack_react_query.UseQueryResult<PaymentIntent, Error>;
|
|
803
|
+
|
|
804
|
+
interface UseDepositQuoteParams {
|
|
805
|
+
publishableKey: string;
|
|
806
|
+
sourceChainType: string;
|
|
807
|
+
sourceChainId: string;
|
|
808
|
+
sourceTokenAddress: string;
|
|
809
|
+
destinationAmount: string;
|
|
810
|
+
destinationChainType: string;
|
|
811
|
+
destinationChainId: string;
|
|
812
|
+
destinationTokenAddress: string;
|
|
813
|
+
enabled?: boolean;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Hook to fetch a deposit quote via react-query.
|
|
817
|
+
*
|
|
818
|
+
* Returns the estimated source token amount needed to receive a specific
|
|
819
|
+
* destination amount, accounting for bridge fees and slippage.
|
|
820
|
+
* Server-side cached for 1 minute; client re-fetches on param change.
|
|
821
|
+
*/
|
|
822
|
+
declare function useDepositQuote(params: UseDepositQuoteParams): _tanstack_react_query.UseQueryResult<DepositQuote, Error>;
|
|
823
|
+
|
|
726
824
|
interface UseWithdrawPollingOptions {
|
|
727
825
|
userId: string | undefined;
|
|
728
826
|
publishableKey: string;
|
|
@@ -1066,4 +1164,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1066
1164
|
*/
|
|
1067
1165
|
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
1068
1166
|
|
|
1069
|
-
export { type AllowedCountryResult, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type BuyWithCardProps, type CardTokens, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, type DepositModalInitialScreen, type DepositModalProps, DepositPollingUi, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, type DetectedWallet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EvmWalletProvider, type FontConfig, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SolanaWalletProvider, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buttonVariants, cn, colors, defaultColors, detectBrowserWallet, getColors, mergeColors, resolveComponentTokens, sendEvmWithdraw, sendSolanaWithdraw, truncateAddress, useAddressBalance, useAllowedCountry, useDepositPolling, useSourceTokenValidation, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };
|
|
1167
|
+
export { type AllowedCountryResult, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type BuyWithCardProps, type CardTokens, CheckoutModal, type CheckoutModalProps, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, type DepositModalInitialScreen, type DepositModalProps, DepositPollingUi, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, type DetectedWallet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EvmWalletProvider, type FontConfig, HYPERCORE_CHAIN_ID, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SolanaWalletProvider, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, type UseDepositQuoteParams, type UsePaymentIntentParams, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buttonVariants, cn, colors, defaultColors, detectBrowserWallet, getColors, isHypercoreChain, mergeColors, resolveComponentTokens, sendEvmWithdraw, sendHypercoreWithdraw, sendSolanaWithdraw, truncateAddress, useAddressBalance, useAllowedCountry, useDepositPolling, useDepositQuote, usePaymentIntent, useSourceTokenValidation, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { AutoSwapResponse, ChainType, Wallet, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, DestinationToken, DestinationTokenChain, SupportedDestinationTokensResponse, VerifyAddressResponse } from '@unifold/core';
|
|
2
|
+
import { AutoSwapResponse, ChainType, Wallet, FiatCurrency, ExecutionStatus, FeaturedToken, PaymentNetwork, DestinationToken, DestinationTokenChain, PaymentIntent, DepositQuote, SupportedDestinationTokensResponse, VerifyAddressResponse } from '@unifold/core';
|
|
3
3
|
export { ChainType } from '@unifold/core';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -14,6 +14,11 @@ type DepositConfirmationMode = "auto_ui" | "auto_silent" | "manual";
|
|
|
14
14
|
interface UseDepositPollingOptions {
|
|
15
15
|
userId: string | undefined;
|
|
16
16
|
publishableKey: string;
|
|
17
|
+
/**
|
|
18
|
+
* When provided, polls executions via the payment-intent-scoped endpoint
|
|
19
|
+
* instead of the user-scoped queryExecutions endpoint.
|
|
20
|
+
*/
|
|
21
|
+
clientSecret?: string;
|
|
17
22
|
/** Controls when polling starts and whether a waiting UI is shown.
|
|
18
23
|
* - "auto_ui": After 10s, starts polling and shows "Processing..." card (default)
|
|
19
24
|
* - "auto_silent": After 10s, starts polling silently (no waiting UI)
|
|
@@ -50,7 +55,7 @@ interface UseDepositPollingResult {
|
|
|
50
55
|
/** Call this when user clicks "I've made the deposit" (manual mode) */
|
|
51
56
|
handleIveDeposited: () => void;
|
|
52
57
|
}
|
|
53
|
-
declare function useDepositPolling({ userId, publishableKey, depositConfirmationMode, depositWalletId, enabled, immediateDirectPolling, onDepositSuccess, onDepositError, }: UseDepositPollingOptions): UseDepositPollingResult;
|
|
58
|
+
declare function useDepositPolling({ userId, publishableKey, clientSecret, depositConfirmationMode, depositWalletId, enabled, immediateDirectPolling, onDepositSuccess, onDepositError, }: UseDepositPollingOptions): UseDepositPollingResult;
|
|
54
59
|
|
|
55
60
|
declare global {
|
|
56
61
|
interface Window {
|
|
@@ -224,6 +229,8 @@ declare function DepositHeader({ title, subtitle, showBack, showClose, onBack, o
|
|
|
224
229
|
interface TransferCryptoSingleInputProps {
|
|
225
230
|
userId: string;
|
|
226
231
|
publishableKey: string;
|
|
232
|
+
/** When provided, polls executions via the payment-intent-scoped endpoint instead of user-scoped. */
|
|
233
|
+
clientSecret?: string;
|
|
227
234
|
recipientAddress?: string;
|
|
228
235
|
destinationChainType?: ChainType;
|
|
229
236
|
destinationChainId?: string;
|
|
@@ -250,8 +257,23 @@ interface TransferCryptoSingleInputProps {
|
|
|
250
257
|
code?: string;
|
|
251
258
|
}) => void;
|
|
252
259
|
wallets?: Wallet[];
|
|
260
|
+
/** Called when the user changes the selected source token/chain. */
|
|
261
|
+
onSourceTokenChange?: (info: {
|
|
262
|
+
symbol: string;
|
|
263
|
+
chainType: string;
|
|
264
|
+
chainId: string;
|
|
265
|
+
tokenAddress: string;
|
|
266
|
+
minimumDepositAmountUsd: number;
|
|
267
|
+
}) => void;
|
|
268
|
+
/** Checkout mode: estimated source amount to send (from /public/quotes). Shown above the QR code. */
|
|
269
|
+
checkoutQuote?: {
|
|
270
|
+
sourceAmount: string;
|
|
271
|
+
sourceTokenDecimals: number;
|
|
272
|
+
sourceTokenSymbol: string;
|
|
273
|
+
sourceAmountUsd: string | null;
|
|
274
|
+
} | null;
|
|
253
275
|
}
|
|
254
|
-
declare function TransferCryptoSingleInput({ userId, publishableKey, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, }: TransferCryptoSingleInputProps): react_jsx_runtime.JSX.Element;
|
|
276
|
+
declare function TransferCryptoSingleInput({ userId, publishableKey, clientSecret, recipientAddress, destinationChainType, destinationChainId, destinationTokenAddress, defaultSourceChainType, defaultSourceChainId, defaultSourceTokenAddress, defaultSourceSymbol, depositConfirmationMode, onExecutionsChange, onDepositSuccess, onDepositError, wallets: externalWallets, onSourceTokenChange, checkoutQuote, }: TransferCryptoSingleInputProps): react_jsx_runtime.JSX.Element;
|
|
255
277
|
|
|
256
278
|
interface TransferCryptoDoubleInputProps {
|
|
257
279
|
userId: string;
|
|
@@ -425,8 +447,36 @@ interface ConfirmingViewProps {
|
|
|
425
447
|
onClose: () => void;
|
|
426
448
|
executions?: AutoSwapResponse[];
|
|
427
449
|
isPolling?: boolean;
|
|
450
|
+
onNewDeposit?: () => void;
|
|
451
|
+
onDone?: () => void;
|
|
452
|
+
paymentIntentStatus?: string;
|
|
453
|
+
/** Live amount_received_usd from the payment intent (updates via polling). */
|
|
454
|
+
amountReceivedUsd?: string;
|
|
455
|
+
/** Snapshot of amount_received_usd taken when the transaction was submitted. */
|
|
456
|
+
amountReceivedUsdAtSubmission?: string | null;
|
|
457
|
+
}
|
|
458
|
+
declare function ConfirmingView({ isConfirming, onClose, executions, isPolling, onNewDeposit, onDone, paymentIntentStatus, amountReceivedUsd, amountReceivedUsdAtSubmission, }: ConfirmingViewProps): react_jsx_runtime.JSX.Element;
|
|
459
|
+
|
|
460
|
+
interface CheckoutModalProps {
|
|
461
|
+
open: boolean;
|
|
462
|
+
onOpenChange: (open: boolean) => void;
|
|
463
|
+
clientSecret: string;
|
|
464
|
+
publishableKey: string;
|
|
465
|
+
modalTitle?: string;
|
|
466
|
+
/** Enable browser wallet connection option. Defaults to false */
|
|
467
|
+
enableConnectWallet?: boolean;
|
|
468
|
+
theme?: "light" | "dark" | "auto";
|
|
469
|
+
onCheckoutSuccess?: (data: {
|
|
470
|
+
paymentIntentId: string;
|
|
471
|
+
status: string;
|
|
472
|
+
}) => void;
|
|
473
|
+
onCheckoutError?: (error: {
|
|
474
|
+
message: string;
|
|
475
|
+
error?: unknown;
|
|
476
|
+
code?: string;
|
|
477
|
+
}) => void;
|
|
428
478
|
}
|
|
429
|
-
declare function
|
|
479
|
+
declare function CheckoutModal({ open, onOpenChange, clientSecret, publishableKey, modalTitle, enableConnectWallet, theme, onCheckoutSuccess, onCheckoutError, }: CheckoutModalProps): react_jsx_runtime.JSX.Element;
|
|
430
480
|
|
|
431
481
|
interface WithdrawTransactionInfo {
|
|
432
482
|
/** Source (sending) chain type */
|
|
@@ -543,6 +593,18 @@ declare function sendSolanaWithdraw(params: {
|
|
|
543
593
|
amountBaseUnit: string;
|
|
544
594
|
publishableKey: string;
|
|
545
595
|
}): Promise<string>;
|
|
596
|
+
declare const HYPERCORE_CHAIN_ID = "1337";
|
|
597
|
+
declare function isHypercoreChain(chainId: string): boolean;
|
|
598
|
+
declare function sendHypercoreWithdraw(params: {
|
|
599
|
+
provider: EvmWalletProvider;
|
|
600
|
+
fromAddress: string;
|
|
601
|
+
depositWalletAddress: string;
|
|
602
|
+
sourceTokenAddress: string;
|
|
603
|
+
amount: string;
|
|
604
|
+
tokenSymbol: string;
|
|
605
|
+
publishableKey: string;
|
|
606
|
+
}): Promise<void>;
|
|
607
|
+
|
|
546
608
|
declare function detectBrowserWallet(chainType: string, senderAddress?: string): Promise<DetectedWallet | null>;
|
|
547
609
|
|
|
548
610
|
interface WithdrawFormProps {
|
|
@@ -723,6 +785,42 @@ interface AllowedCountryResult {
|
|
|
723
785
|
*/
|
|
724
786
|
declare function useAllowedCountry(publishableKey: string): AllowedCountryResult;
|
|
725
787
|
|
|
788
|
+
interface UsePaymentIntentParams {
|
|
789
|
+
clientSecret: string;
|
|
790
|
+
publishableKey: string;
|
|
791
|
+
/** Whether the query should execute. Defaults to true. */
|
|
792
|
+
enabled?: boolean;
|
|
793
|
+
/** Polling interval in ms. Defaults to 5000 (5s). Set to 0 to disable. */
|
|
794
|
+
pollingInterval?: number;
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Hook to retrieve and poll a payment intent via react-query.
|
|
798
|
+
*
|
|
799
|
+
* Fetches the payment intent on mount and polls at the configured interval
|
|
800
|
+
* so `amount_received_usd` and `status` stay up-to-date in the UI.
|
|
801
|
+
*/
|
|
802
|
+
declare function usePaymentIntent(params: UsePaymentIntentParams): _tanstack_react_query.UseQueryResult<PaymentIntent, Error>;
|
|
803
|
+
|
|
804
|
+
interface UseDepositQuoteParams {
|
|
805
|
+
publishableKey: string;
|
|
806
|
+
sourceChainType: string;
|
|
807
|
+
sourceChainId: string;
|
|
808
|
+
sourceTokenAddress: string;
|
|
809
|
+
destinationAmount: string;
|
|
810
|
+
destinationChainType: string;
|
|
811
|
+
destinationChainId: string;
|
|
812
|
+
destinationTokenAddress: string;
|
|
813
|
+
enabled?: boolean;
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Hook to fetch a deposit quote via react-query.
|
|
817
|
+
*
|
|
818
|
+
* Returns the estimated source token amount needed to receive a specific
|
|
819
|
+
* destination amount, accounting for bridge fees and slippage.
|
|
820
|
+
* Server-side cached for 1 minute; client re-fetches on param change.
|
|
821
|
+
*/
|
|
822
|
+
declare function useDepositQuote(params: UseDepositQuoteParams): _tanstack_react_query.UseQueryResult<DepositQuote, Error>;
|
|
823
|
+
|
|
726
824
|
interface UseWithdrawPollingOptions {
|
|
727
825
|
userId: string | undefined;
|
|
728
826
|
publishableKey: string;
|
|
@@ -1066,4 +1164,4 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
1066
1164
|
*/
|
|
1067
1165
|
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
1068
1166
|
|
|
1069
|
-
export { type AllowedCountryResult, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type BuyWithCardProps, type CardTokens, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, type DepositModalInitialScreen, type DepositModalProps, DepositPollingUi, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, type DetectedWallet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EvmWalletProvider, type FontConfig, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SolanaWalletProvider, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buttonVariants, cn, colors, defaultColors, detectBrowserWallet, getColors, mergeColors, resolveComponentTokens, sendEvmWithdraw, sendSolanaWithdraw, truncateAddress, useAddressBalance, useAllowedCountry, useDepositPolling, useSourceTokenValidation, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };
|
|
1167
|
+
export { type AllowedCountryResult, type BrowserWalletAmountQuickSelect, Button, type ButtonProps, type ButtonTokens, BuyWithCard, type BuyWithCardProps, type CardTokens, CheckoutModal, type CheckoutModalProps, type ComponentConfig, type ComponentOverrides, type ComponentTokens, ConfirmingView, type ContainerTokens, CurrencyListItem, CurrencyListSection, CurrencyModal, type CustomThemeColors, type DepositConfirmationMode, DepositDetailContent, DepositExecutionItem, DepositHeader, DepositModal, type DepositModalInitialScreen, type DepositModalProps, DepositPollingUi, DepositSuccessToast, DepositTrackerButton, DepositWithCardButton, DepositsModal, type DetectedWallet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type EvmWalletProvider, type FontConfig, HYPERCORE_CHAIN_ID, type HeaderTokens, type InputTokens, type ListTokens, type ResolvedFonts, type SearchTokens, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SolanaWalletProvider, StyledQRCode, type ThemeColors, type ThemeConfig, type ThemeMode, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransferCryptoButton, TransferCryptoDoubleInput, TransferCryptoSingleInput, type UseDepositQuoteParams, type UsePaymentIntentParams, WithdrawConfirmingView, WithdrawDoubleInput, WithdrawExecutionItem, WithdrawForm, WithdrawModal, type WithdrawModalProps, WithdrawTokenSelector, type WithdrawTransactionInfo, buttonVariants, cn, colors, defaultColors, detectBrowserWallet, getColors, isHypercoreChain, mergeColors, resolveComponentTokens, sendEvmWithdraw, sendHypercoreWithdraw, sendSolanaWithdraw, truncateAddress, useAddressBalance, useAllowedCountry, useDepositPolling, useDepositQuote, usePaymentIntent, useSourceTokenValidation, useSupportedDestinationTokens, useTheme, useVerifyRecipientAddress, useWithdrawPolling };
|