@unifold/connect-react 0.1.67 → 0.1.68-beta.1

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 CHANGED
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
4
  import { ChainType, DepositConfirmationMode, DepositMethod, DepositModalInitialScreen, ThemeMode, ThemeConfig, FontConfig, ComponentConfig, WithdrawTransactionInfo, AllowedCountryResult } from '@unifold/ui-react';
5
5
  export { AllowedCountryResult, BrowserWalletAmountQuickSelect, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ConfirmingView, ContainerTokens, CustomThemeColors, DepositConfirmationMode, DepositModalInitialScreen as DepositInitialScreen, DepositMethod, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, UseSupportedDepositTokensOptions, WithdrawTransactionInfo, useSupportedDepositTokens } from '@unifold/ui-react';
6
- import { EvmContractCall, DirectExecutionSucceededEvent, DepositEvent, WithdrawDirectExecutionSucceededEvent, WithdrawEvent } from '@unifold/core';
7
- export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, DepositEvent, DepositEventType, DepositQuote, DepositQuoteRequest, DestinationToken, DestinationTokenChain, DirectExecution, DirectExecutionResponse, ExecutionStatus, FeaturedToken, FiatCurrenciesResponse, FiatCurrency, I18nStrings, IconUrl, IpAddressResponse, LockedQuoteLimits, LockedQuotePreview, LockedQuotePreviewRequest, OnrampQuote, OnrampQuotesRequest, OnrampQuotesResponse, OnrampSessionCreatedData, OnrampSessionCreatedEvent, OnrampSessionRequest, OnrampSessionResponse, PaymentIntent, PaymentIntentDepositAddress, PaymentIntentStatus, PaymentIntentType, PaymentNetwork, ProjectConfigResponse, QueryExecutionsRequest, QueryExecutionsResponse, SOLANA_USDC_ADDRESS, SendSolanaTransactionRequest, SendSolanaTransactionResponse, SourceToken, SourceTokenNetwork, SupportedChain, SupportedDepositTokensResponse, SupportedDestinationTokensResponse, SupportedSourceTokensQuery, SupportedSourceTokensResponse, SupportedToken, TokenChain, TokenChainIconUrl, TokenChainsResponse, UserIpInfo, Wallet, WithdrawDirectExecutionSucceededEvent, WithdrawEvent, WithdrawEventType, createDepositAddress, createOnrampSession, generatePrefixedKSUID, getApiBaseUrl, getChainName, getDefaultOnrampToken, getDepositQuote, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getWalletByChainType, i18n, queryExecutions, retrievePaymentIntent, sendSolanaTransaction, setApiConfig, useUserIp } from '@unifold/core';
6
+ import { CheckoutMethod, CheckoutPaymentIntent, CheckoutEvent, EvmContractCall, DirectExecutionSucceededEvent, DepositEvent, WithdrawDirectExecutionSucceededEvent, WithdrawEvent } from '@unifold/core';
7
+ export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CheckoutEvent, CheckoutEventType, CheckoutMethod, CheckoutPaymentIntent, CheckoutPaymentIntentData, CheckoutPaymentIntentSucceededEvent, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, DepositEvent, DepositEventType, DepositQuote, DepositQuoteRequest, DestinationToken, DestinationTokenChain, DirectExecution, DirectExecutionResponse, ExecutionStatus, FeaturedToken, FiatCurrenciesResponse, FiatCurrency, I18nStrings, IconUrl, IpAddressResponse, LockedQuoteLimits, LockedQuotePreview, LockedQuotePreviewRequest, OnrampQuote, OnrampQuotesRequest, OnrampQuotesResponse, OnrampSessionCreatedData, OnrampSessionCreatedEvent, OnrampSessionRequest, OnrampSessionResponse, PaymentIntent, PaymentIntentDepositAddress, PaymentIntentStatus, PaymentIntentType, PaymentNetwork, ProjectConfigResponse, QueryExecutionsRequest, QueryExecutionsResponse, SOLANA_USDC_ADDRESS, SendSolanaTransactionRequest, SendSolanaTransactionResponse, SourceToken, SourceTokenNetwork, StripeAccessTokenResponse, StripeAuthIntentResponse, StripeConfigResponse, StripeConfirmRequest, StripeConsumerWallet, StripeCreateSessionRequest, StripeCryptoCustomer, StripeCustomerVerification, StripeDefaultTokenResponse, StripeListResponse, StripeOnrampSession, StripeOnrampTransactionDetails, StripePaymentToken, StripeQuoteRequest, StripeQuotesResponse, SupportedChain, SupportedDepositTokensResponse, SupportedDestinationTokensResponse, SupportedSourceTokensQuery, SupportedSourceTokensResponse, SupportedToken, TokenChain, TokenChainIconUrl, TokenChainsResponse, UserIpInfo, Wallet, WithdrawDirectExecutionSucceededEvent, WithdrawEvent, WithdrawEventType, createDepositAddress, createOnrampSession, generatePrefixedKSUID, getApiBaseUrl, getChainName, getDefaultOnrampToken, getDepositQuote, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getWalletByChainType, i18n, queryExecutions, retrievePaymentIntent, sendSolanaTransaction, setApiConfig, stripeConfirmSession, stripeCreateAuthIntent, stripeCreateSession, stripeExchangeTokens, stripeGetConfig, stripeGetCustomer, stripeGetDefaultToken, stripeGetQuotes, stripeGetSession, stripeListPaymentTokens, stripeListWallets, stripeRefreshQuote, stripeRefreshToken, useUserIp } from '@unifold/core';
8
8
 
9
9
  interface UnifoldConnectProviderConfig {
10
10
  publishableKey: string;
@@ -45,6 +45,19 @@ interface UnifoldConnectProviderConfig {
45
45
  enableConnectExchange?: boolean;
46
46
  /** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
47
47
  enableCashApp?: boolean;
48
+ /** Enable "Pay with Link" headless onramp option. Defaults to false. */
49
+ enableStripeLink?: boolean;
50
+ /**
51
+ * Enable "Pay with Apple Pay" (headless Coinbase) option. Overrides
52
+ * dashboard default. Resolves as flag ?? dashboard `apple_pay.enabled` ??
53
+ * true. The server still gates per-region (US-only, NY excluded at
54
+ * launch) at order-creation time.
55
+ */
56
+ enableApplePay?: boolean;
57
+ /** Main menu — Apple Pay row title. @default `"Pay with Apple Pay"` */
58
+ applePayTitle?: string;
59
+ /** Main menu — Apple Pay row subtitle. @default `"Instant"` */
60
+ applePaySubTitle?: string;
48
61
  /** Simple accent/primary color override (applies to both light and dark modes) */
49
62
  accentColor?: string;
50
63
  /** Full theme color customization per mode */
@@ -72,7 +85,7 @@ interface UnifoldConnectProviderConfig {
72
85
  /** Deposit with Card onramp: hide wallet address disclaimer. @default false */
73
86
  hideDisplayDescription?: boolean;
74
87
  /** Connect Wallet → Enter amount: `percentage` (10%, 25%, 50%, 75%, MAX) or `usd` ($25…). @default `percentage` */
75
- browserWalletAmountQuickSelect?: "usd" | "percentage";
88
+ browserWalletAmountQuickSelect?: 'usd' | 'percentage';
76
89
  };
77
90
  }
78
91
  interface DepositResult {
@@ -96,6 +109,15 @@ interface DepositConfig {
96
109
  destinationTokenSymbol: string;
97
110
  /** Address that receives the deposited funds. */
98
111
  recipientAddress: string;
112
+ /**
113
+ * Pre-trusted email for the host platform's signed-in user. When provided,
114
+ * Apple Pay (headless Coinbase) skips both the localStorage email check and
115
+ * the email-OTP screen — it passes `email_already_verified: true` and uses
116
+ * this address directly. Phone OTP is still required (Coinbase mandates
117
+ * phone re-verification every 60 days). Has no effect on the other deposit
118
+ * flows.
119
+ */
120
+ externalUserEmail?: string;
99
121
  /**
100
122
  * Array of contract calls to execute on the destination chain when delivering funds.
101
123
  * Each entry specifies a target contract address, hex-encoded data, and optional value in wei (defaults to "0").
@@ -117,6 +139,8 @@ interface DepositConfig {
117
139
  defaultSourceSymbol?: string;
118
140
  /** How to confirm deposit: 'auto_ui' (default), 'auto_silent', or 'manual' */
119
141
  depositConfirmationMode?: DepositConfirmationMode;
142
+ /** User's email address — used to pre-fill onramp provider flows (Stripe Link, Banxa, etc.) */
143
+ email?: string;
120
144
  onSuccess?: (data: DepositResult) => void;
121
145
  onError?: (error: DepositError) => void;
122
146
  /** Called when the user dismisses the deposit dialog (X button, Escape key, or programmatic close) */
@@ -138,11 +162,20 @@ interface DepositConfig {
138
162
  interface CheckoutResult {
139
163
  paymentIntentId: string;
140
164
  status: string;
165
+ method?: CheckoutMethod;
166
+ /**
167
+ * Full payment intent details at the time of success, mapped to SDK camelCase.
168
+ * Mirrors the `DepositResult.execution` field on the deposit side.
169
+ * Always populated for the terminal `succeeded` callback; may be undefined for
170
+ * intermediate `processing` callbacks fired right after a wallet confirmation.
171
+ */
172
+ paymentIntent?: CheckoutPaymentIntent;
141
173
  }
142
174
  interface CheckoutError {
143
175
  message: string;
144
176
  error?: unknown;
145
177
  code?: string;
178
+ method?: CheckoutMethod;
146
179
  }
147
180
  interface WithdrawResult {
148
181
  message: string;
@@ -173,6 +206,8 @@ interface CheckoutConfig {
173
206
  /** Optional callbacks (fired immediately when events occur) */
174
207
  onSuccess?: (data: CheckoutResult) => void;
175
208
  onError?: (error: CheckoutError) => void;
209
+ /** Called when checkout lifecycle events occur. */
210
+ onEvent?: (event: CheckoutEvent) => void;
176
211
  /** Called when the user dismisses the checkout dialog */
177
212
  onClose?: () => void;
178
213
  }
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ import React from 'react';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
4
  import { ChainType, DepositConfirmationMode, DepositMethod, DepositModalInitialScreen, ThemeMode, ThemeConfig, FontConfig, ComponentConfig, WithdrawTransactionInfo, AllowedCountryResult } from '@unifold/ui-react';
5
5
  export { AllowedCountryResult, BrowserWalletAmountQuickSelect, Button, ButtonProps, ButtonTokens, CardTokens, ComponentConfig, ComponentTokens, ConfirmingView, ContainerTokens, CustomThemeColors, DepositConfirmationMode, DepositModalInitialScreen as DepositInitialScreen, DepositMethod, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, UseSupportedDepositTokensOptions, WithdrawTransactionInfo, useSupportedDepositTokens } from '@unifold/ui-react';
6
- import { EvmContractCall, DirectExecutionSucceededEvent, DepositEvent, WithdrawDirectExecutionSucceededEvent, WithdrawEvent } from '@unifold/core';
7
- export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, DepositEvent, DepositEventType, DepositQuote, DepositQuoteRequest, DestinationToken, DestinationTokenChain, DirectExecution, DirectExecutionResponse, ExecutionStatus, FeaturedToken, FiatCurrenciesResponse, FiatCurrency, I18nStrings, IconUrl, IpAddressResponse, LockedQuoteLimits, LockedQuotePreview, LockedQuotePreviewRequest, OnrampQuote, OnrampQuotesRequest, OnrampQuotesResponse, OnrampSessionCreatedData, OnrampSessionCreatedEvent, OnrampSessionRequest, OnrampSessionResponse, PaymentIntent, PaymentIntentDepositAddress, PaymentIntentStatus, PaymentIntentType, PaymentNetwork, ProjectConfigResponse, QueryExecutionsRequest, QueryExecutionsResponse, SOLANA_USDC_ADDRESS, SendSolanaTransactionRequest, SendSolanaTransactionResponse, SourceToken, SourceTokenNetwork, SupportedChain, SupportedDepositTokensResponse, SupportedDestinationTokensResponse, SupportedSourceTokensQuery, SupportedSourceTokensResponse, SupportedToken, TokenChain, TokenChainIconUrl, TokenChainsResponse, UserIpInfo, Wallet, WithdrawDirectExecutionSucceededEvent, WithdrawEvent, WithdrawEventType, createDepositAddress, createOnrampSession, generatePrefixedKSUID, getApiBaseUrl, getChainName, getDefaultOnrampToken, getDepositQuote, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getWalletByChainType, i18n, queryExecutions, retrievePaymentIntent, sendSolanaTransaction, setApiConfig, useUserIp } from '@unifold/core';
6
+ import { CheckoutMethod, CheckoutPaymentIntent, CheckoutEvent, EvmContractCall, DirectExecutionSucceededEvent, DepositEvent, WithdrawDirectExecutionSucceededEvent, WithdrawEvent } from '@unifold/core';
7
+ export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CheckoutEvent, CheckoutEventType, CheckoutMethod, CheckoutPaymentIntent, CheckoutPaymentIntentData, CheckoutPaymentIntentSucceededEvent, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, DepositEvent, DepositEventType, DepositQuote, DepositQuoteRequest, DestinationToken, DestinationTokenChain, DirectExecution, DirectExecutionResponse, ExecutionStatus, FeaturedToken, FiatCurrenciesResponse, FiatCurrency, I18nStrings, IconUrl, IpAddressResponse, LockedQuoteLimits, LockedQuotePreview, LockedQuotePreviewRequest, OnrampQuote, OnrampQuotesRequest, OnrampQuotesResponse, OnrampSessionCreatedData, OnrampSessionCreatedEvent, OnrampSessionRequest, OnrampSessionResponse, PaymentIntent, PaymentIntentDepositAddress, PaymentIntentStatus, PaymentIntentType, PaymentNetwork, ProjectConfigResponse, QueryExecutionsRequest, QueryExecutionsResponse, SOLANA_USDC_ADDRESS, SendSolanaTransactionRequest, SendSolanaTransactionResponse, SourceToken, SourceTokenNetwork, StripeAccessTokenResponse, StripeAuthIntentResponse, StripeConfigResponse, StripeConfirmRequest, StripeConsumerWallet, StripeCreateSessionRequest, StripeCryptoCustomer, StripeCustomerVerification, StripeDefaultTokenResponse, StripeListResponse, StripeOnrampSession, StripeOnrampTransactionDetails, StripePaymentToken, StripeQuoteRequest, StripeQuotesResponse, SupportedChain, SupportedDepositTokensResponse, SupportedDestinationTokensResponse, SupportedSourceTokensQuery, SupportedSourceTokensResponse, SupportedToken, TokenChain, TokenChainIconUrl, TokenChainsResponse, UserIpInfo, Wallet, WithdrawDirectExecutionSucceededEvent, WithdrawEvent, WithdrawEventType, createDepositAddress, createOnrampSession, generatePrefixedKSUID, getApiBaseUrl, getChainName, getDefaultOnrampToken, getDepositQuote, getFiatCurrencies, getIconUrl, getIconUrlWithCdn, getIpAddress, getOnrampQuotes, getPreferredIconUrl, getProjectConfig, getSupportedDepositTokens, getSupportedDestinationTokens, getTokenChains, getWalletByChainType, i18n, queryExecutions, retrievePaymentIntent, sendSolanaTransaction, setApiConfig, stripeConfirmSession, stripeCreateAuthIntent, stripeCreateSession, stripeExchangeTokens, stripeGetConfig, stripeGetCustomer, stripeGetDefaultToken, stripeGetQuotes, stripeGetSession, stripeListPaymentTokens, stripeListWallets, stripeRefreshQuote, stripeRefreshToken, useUserIp } from '@unifold/core';
8
8
 
9
9
  interface UnifoldConnectProviderConfig {
10
10
  publishableKey: string;
@@ -45,6 +45,19 @@ interface UnifoldConnectProviderConfig {
45
45
  enableConnectExchange?: boolean;
46
46
  /** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
47
47
  enableCashApp?: boolean;
48
+ /** Enable "Pay with Link" headless onramp option. Defaults to false. */
49
+ enableStripeLink?: boolean;
50
+ /**
51
+ * Enable "Pay with Apple Pay" (headless Coinbase) option. Overrides
52
+ * dashboard default. Resolves as flag ?? dashboard `apple_pay.enabled` ??
53
+ * true. The server still gates per-region (US-only, NY excluded at
54
+ * launch) at order-creation time.
55
+ */
56
+ enableApplePay?: boolean;
57
+ /** Main menu — Apple Pay row title. @default `"Pay with Apple Pay"` */
58
+ applePayTitle?: string;
59
+ /** Main menu — Apple Pay row subtitle. @default `"Instant"` */
60
+ applePaySubTitle?: string;
48
61
  /** Simple accent/primary color override (applies to both light and dark modes) */
49
62
  accentColor?: string;
50
63
  /** Full theme color customization per mode */
@@ -72,7 +85,7 @@ interface UnifoldConnectProviderConfig {
72
85
  /** Deposit with Card onramp: hide wallet address disclaimer. @default false */
73
86
  hideDisplayDescription?: boolean;
74
87
  /** Connect Wallet → Enter amount: `percentage` (10%, 25%, 50%, 75%, MAX) or `usd` ($25…). @default `percentage` */
75
- browserWalletAmountQuickSelect?: "usd" | "percentage";
88
+ browserWalletAmountQuickSelect?: 'usd' | 'percentage';
76
89
  };
77
90
  }
78
91
  interface DepositResult {
@@ -96,6 +109,15 @@ interface DepositConfig {
96
109
  destinationTokenSymbol: string;
97
110
  /** Address that receives the deposited funds. */
98
111
  recipientAddress: string;
112
+ /**
113
+ * Pre-trusted email for the host platform's signed-in user. When provided,
114
+ * Apple Pay (headless Coinbase) skips both the localStorage email check and
115
+ * the email-OTP screen — it passes `email_already_verified: true` and uses
116
+ * this address directly. Phone OTP is still required (Coinbase mandates
117
+ * phone re-verification every 60 days). Has no effect on the other deposit
118
+ * flows.
119
+ */
120
+ externalUserEmail?: string;
99
121
  /**
100
122
  * Array of contract calls to execute on the destination chain when delivering funds.
101
123
  * Each entry specifies a target contract address, hex-encoded data, and optional value in wei (defaults to "0").
@@ -117,6 +139,8 @@ interface DepositConfig {
117
139
  defaultSourceSymbol?: string;
118
140
  /** How to confirm deposit: 'auto_ui' (default), 'auto_silent', or 'manual' */
119
141
  depositConfirmationMode?: DepositConfirmationMode;
142
+ /** User's email address — used to pre-fill onramp provider flows (Stripe Link, Banxa, etc.) */
143
+ email?: string;
120
144
  onSuccess?: (data: DepositResult) => void;
121
145
  onError?: (error: DepositError) => void;
122
146
  /** Called when the user dismisses the deposit dialog (X button, Escape key, or programmatic close) */
@@ -138,11 +162,20 @@ interface DepositConfig {
138
162
  interface CheckoutResult {
139
163
  paymentIntentId: string;
140
164
  status: string;
165
+ method?: CheckoutMethod;
166
+ /**
167
+ * Full payment intent details at the time of success, mapped to SDK camelCase.
168
+ * Mirrors the `DepositResult.execution` field on the deposit side.
169
+ * Always populated for the terminal `succeeded` callback; may be undefined for
170
+ * intermediate `processing` callbacks fired right after a wallet confirmation.
171
+ */
172
+ paymentIntent?: CheckoutPaymentIntent;
141
173
  }
142
174
  interface CheckoutError {
143
175
  message: string;
144
176
  error?: unknown;
145
177
  code?: string;
178
+ method?: CheckoutMethod;
146
179
  }
147
180
  interface WithdrawResult {
148
181
  message: string;
@@ -173,6 +206,8 @@ interface CheckoutConfig {
173
206
  /** Optional callbacks (fired immediately when events occur) */
174
207
  onSuccess?: (data: CheckoutResult) => void;
175
208
  onError?: (error: CheckoutError) => void;
209
+ /** Called when checkout lifecycle events occur. */
210
+ onEvent?: (event: CheckoutEvent) => void;
176
211
  /** Called when the user dismisses the checkout dialog */
177
212
  onClose?: () => void;
178
213
  }