@unifold/connect-react 0.1.60 → 0.1.62

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/README.md CHANGED
@@ -138,7 +138,7 @@ Launches the deposit modal with the specified configuration. **Returns a Promise
138
138
  | `defaultSourceSymbol` | string | - | Source token symbol (e.g. `"USDC"`). Paired with chain type + chain ID. |
139
139
  | `onSuccess` | function | - | Success callback (fired immediately) |
140
140
  | `onError` | function | - | Error callback (fired immediately) |
141
- | `initialScreen` | `'main' \| 'transfer' \| 'card' \| 'tracker'` | - | `main` (default) = deposit menu. `transfer` / `card` use the **same geo/validation gates** as the menu. `tracker` opens the list **without** those gates. If not `main`, the header **back** is hidden (standalone); from `main`, back returns to the menu. Card quotes/onramp and tracker detail still show back for inner steps. |
141
+ | `initialScreen` | `'main' \| 'transfer' \| 'card' \| 'cashapp' \| 'tracker' \| 'pay_with_exchange' \| 'exchange_connect' \| 'wallet_connect'` | - | `main` (default) = deposit menu. `transfer` / `card` use the **same geo/validation gates** as the menu. `tracker` opens the list **without** those gates. `cashapp`, `pay_with_exchange`, `exchange_connect`, `wallet_connect` open their respective flows and **fall back to `main`** when the matching feature flag (`enableCashApp`, `enablePayWithExchange`, `enableConnectExchange`, `enableConnectWallet`) is disabled. If not `main`, the header **back** is hidden at the flow root (standalone); from `main`, back returns to the menu. Inner steps (card quotes/onramp, tracker detail, exchange pending, cashapp payment) still show back. |
142
142
 
143
143
  **Returns:** `Promise<DepositResult>`
144
144
 
package/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
4
  import { ChainType, DepositConfirmationMode, 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, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, UseSupportedDepositTokensOptions, WithdrawTransactionInfo, useSupportedDepositTokens } from '@unifold/ui-react';
6
- import { DepositEvent } from '@unifold/core';
6
+ import { EvmContractCall, DepositEvent } from '@unifold/core';
7
7
  export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, DepositEvent, DepositEventType, DepositQuote, DepositQuoteRequest, DestinationToken, DestinationTokenChain, 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, 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';
8
8
 
9
9
  interface UnifoldConnectProviderConfig {
@@ -85,6 +85,13 @@ interface DepositConfig {
85
85
  destinationTokenAddress: string;
86
86
  destinationTokenSymbol: string;
87
87
  recipientAddress: string;
88
+ /**
89
+ * Array of contract calls to execute on the destination chain when delivering funds.
90
+ * Each entry specifies a target contract address, hex-encoded data, and optional value in wei (defaults to "0").
91
+ * Only supported when destinationChainType is "ethereum" and
92
+ * destinationChainId is one of: "1", "8453", "42161", "4326".
93
+ */
94
+ contractCalls?: EvmContractCall[];
88
95
  /**
89
96
  * Pre-select source token/chain in the Transfer Crypto view.
90
97
  * All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
@@ -106,10 +113,14 @@ interface DepositConfig {
106
113
  /** Called when deposit lifecycle events occur. Use {@link DepositEventType} to narrow the event type. See {@link DepositEvent} for the full union. */
107
114
  onEvent?: (event: DepositEvent) => void;
108
115
  /**
109
- * Which screen opens first: menu (`main`, default), `transfer`, `card`, or `tracker`.
116
+ * Which screen opens first. One of: `main` (menu, default), `transfer`, `card`, `cashapp`,
117
+ * `tracker`, `pay_with_exchange` (Pay with Exchange), `exchange_connect` (Connect Exchange), or
118
+ * `wallet_connect` (Connect Wallet).
110
119
  * `transfer` and `card` run the same geo / recipient checks as the menu before the flow. `tracker` does not
111
- * (deposit history is always reachable). If not `main`, the header back control is hidden (nothing to return to);
112
- * card quotes/onramp and tracker detail still show back for inner navigation.
120
+ * (deposit history is always reachable). A screen falls back to `main` when its feature flag is disabled
121
+ * (e.g. `cashapp` without `enableCashApp`, `exchange_connect` without `enableConnectExchange`).
122
+ * If not `main`, the header back control is hidden at the flow's root (nothing to return to); inner steps
123
+ * (card quotes/onramp, tracker detail, exchange pending, cashapp payment, etc.) still show back for inner navigation.
113
124
  */
114
125
  initialScreen?: DepositModalInitialScreen;
115
126
  }
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
4
  import { ChainType, DepositConfirmationMode, 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, FontConfig, HeaderTokens, InputTokens, ListTokens, SearchTokens, ThemeColors, ThemeConfig, ThemeMode, UseSupportedDepositTokensOptions, WithdrawTransactionInfo, useSupportedDepositTokens } from '@unifold/ui-react';
6
- import { DepositEvent } from '@unifold/core';
6
+ import { EvmContractCall, DepositEvent } from '@unifold/core';
7
7
  export { ActionType, AutoSwapRequest, AutoSwapResponse, ChainType, CreateDepositAddressRequest, DefaultTokenChain, DefaultTokenMetadata, DefaultTokenResponse, DepositAddressResponse, DepositEvent, DepositEventType, DepositQuote, DepositQuoteRequest, DestinationToken, DestinationTokenChain, 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, 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';
8
8
 
9
9
  interface UnifoldConnectProviderConfig {
@@ -85,6 +85,13 @@ interface DepositConfig {
85
85
  destinationTokenAddress: string;
86
86
  destinationTokenSymbol: string;
87
87
  recipientAddress: string;
88
+ /**
89
+ * Array of contract calls to execute on the destination chain when delivering funds.
90
+ * Each entry specifies a target contract address, hex-encoded data, and optional value in wei (defaults to "0").
91
+ * Only supported when destinationChainType is "ethereum" and
92
+ * destinationChainId is one of: "1", "8453", "42161", "4326".
93
+ */
94
+ contractCalls?: EvmContractCall[];
88
95
  /**
89
96
  * Pre-select source token/chain in the Transfer Crypto view.
90
97
  * All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
@@ -106,10 +113,14 @@ interface DepositConfig {
106
113
  /** Called when deposit lifecycle events occur. Use {@link DepositEventType} to narrow the event type. See {@link DepositEvent} for the full union. */
107
114
  onEvent?: (event: DepositEvent) => void;
108
115
  /**
109
- * Which screen opens first: menu (`main`, default), `transfer`, `card`, or `tracker`.
116
+ * Which screen opens first. One of: `main` (menu, default), `transfer`, `card`, `cashapp`,
117
+ * `tracker`, `pay_with_exchange` (Pay with Exchange), `exchange_connect` (Connect Exchange), or
118
+ * `wallet_connect` (Connect Wallet).
110
119
  * `transfer` and `card` run the same geo / recipient checks as the menu before the flow. `tracker` does not
111
- * (deposit history is always reachable). If not `main`, the header back control is hidden (nothing to return to);
112
- * card quotes/onramp and tracker detail still show back for inner navigation.
120
+ * (deposit history is always reachable). A screen falls back to `main` when its feature flag is disabled
121
+ * (e.g. `cashapp` without `enableCashApp`, `exchange_connect` without `enableConnectExchange`).
122
+ * If not `main`, the header back control is hidden at the flow's root (nothing to return to); inner steps
123
+ * (card quotes/onramp, tracker detail, exchange pending, cashapp payment, etc.) still show back for inner navigation.
113
124
  */
114
125
  initialScreen?: DepositModalInitialScreen;
115
126
  }