@unifold/connect-react 0.1.79 → 0.1.80
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 +29 -6
- package/dist/index.d.ts +29 -6
- package/dist/index.js +4051 -317
- package/dist/index.mjs +3912 -179
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -21,9 +21,9 @@ interface UnifoldConnectProviderConfig {
|
|
|
21
21
|
queryClient?: QueryClient;
|
|
22
22
|
config?: {
|
|
23
23
|
/**
|
|
24
|
-
* UI language as a BCP-47 tag (e.g. "en", "zh", "
|
|
25
|
-
* omitted, the browser locale is auto-detected. Unsupported locales
|
|
26
|
-
* back to English.
|
|
24
|
+
* UI language as a BCP-47 tag (e.g. "en", "zh", "fr", "ja", "ko", "th").
|
|
25
|
+
* When omitted, the browser locale is auto-detected. Unsupported locales
|
|
26
|
+
* fall back to English.
|
|
27
27
|
*/
|
|
28
28
|
locale?: string;
|
|
29
29
|
modalTitle?: string;
|
|
@@ -89,7 +89,7 @@ interface UnifoldConnectProviderConfig {
|
|
|
89
89
|
enableApplePay?: boolean;
|
|
90
90
|
/** Main menu — Apple Pay row title. @default `"Pay with Apple Pay"` (localized when omitted) */
|
|
91
91
|
applePayTitle?: string;
|
|
92
|
-
/** Main menu — Apple Pay row subtitle. @default `"Instant"` (localized when omitted) */
|
|
92
|
+
/** Main menu — Apple Pay row subtitle. @default `"Instant • Debit card only"` (localized when omitted) */
|
|
93
93
|
applePaySubTitle?: string;
|
|
94
94
|
/**
|
|
95
95
|
* Enable "Pay with Google Pay" (headless Coinbase) option. Overrides
|
|
@@ -100,7 +100,7 @@ interface UnifoldConnectProviderConfig {
|
|
|
100
100
|
enableGooglePay?: boolean;
|
|
101
101
|
/** Main menu — Google Pay row title. @default `"Pay with Google Pay"` (localized when omitted) */
|
|
102
102
|
googlePayTitle?: string;
|
|
103
|
-
/** Main menu — Google Pay row subtitle. @default `"Instant"` (localized when omitted) */
|
|
103
|
+
/** Main menu — Google Pay row subtitle. @default `"Instant • Debit card only"` (localized when omitted) */
|
|
104
104
|
googlePaySubTitle?: string;
|
|
105
105
|
/** Simple accent/primary color override (applies to both light and dark modes) */
|
|
106
106
|
accentColor?: string;
|
|
@@ -314,14 +314,37 @@ interface WithdrawConfig {
|
|
|
314
314
|
defaultDestinationSymbol?: string;
|
|
315
315
|
/**
|
|
316
316
|
* The user's wallet address (the sender). Used to:
|
|
317
|
-
* 1. Fetch balance for
|
|
317
|
+
* 1. Fetch balance for max / over-balance (unless `balanceInBaseUnit` is provided)
|
|
318
318
|
* 2. Detect if a matching browser wallet is connected
|
|
319
319
|
*/
|
|
320
320
|
senderAddress: string;
|
|
321
|
+
/**
|
|
322
|
+
* Sender token balance in smallest units (e.g. `"1500000"` for 1.5 USDC).
|
|
323
|
+
* When provided, the modal skips `/addresses/balance` and uses this as the
|
|
324
|
+
* source of truth for max withdraw, over-balance checks, and amount conversion.
|
|
325
|
+
*/
|
|
326
|
+
balanceInBaseUnit?: string;
|
|
327
|
+
/**
|
|
328
|
+
* USD value of {@link WithdrawConfig.balanceInBaseUnit}. When provided with
|
|
329
|
+
* `balanceInBaseUnit`, used for fiat display, max, and crypto↔USD conversion
|
|
330
|
+
* with no extra network calls. When omitted, the modal prices the token
|
|
331
|
+
* (stablecoins assume $1) to compute USD.
|
|
332
|
+
*/
|
|
333
|
+
balanceUsd?: string | number;
|
|
334
|
+
/**
|
|
335
|
+
* Source token decimals (e.g. `6` for USDC). Used with `balanceInBaseUnit`
|
|
336
|
+
* to format the human amount without waiting on the token catalog. Falls
|
|
337
|
+
* back to catalog decimals when omitted.
|
|
338
|
+
*/
|
|
339
|
+
sourceTokenDecimals?: number;
|
|
321
340
|
/**
|
|
322
341
|
* Callback invoked with transaction details when the user confirms withdrawal.
|
|
323
342
|
* The host app is responsible for signing and submitting the transaction — the
|
|
324
343
|
* SDK does not have access to the user's private key.
|
|
344
|
+
*
|
|
345
|
+
* Move `txInfo.amountBaseUnit` to `txInfo.withdrawIntentAddress`. That address
|
|
346
|
+
* is not always on `sourceChainType`: withdrawing off a chain Unifold can't
|
|
347
|
+
* monitor (N1) hands back a Solana address to bridge to instead.
|
|
325
348
|
*/
|
|
326
349
|
withdraw: (txInfo: WithdrawTransactionInfo) => void | Promise<void>;
|
|
327
350
|
onSuccess?: (data: WithdrawResult) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ interface UnifoldConnectProviderConfig {
|
|
|
21
21
|
queryClient?: QueryClient;
|
|
22
22
|
config?: {
|
|
23
23
|
/**
|
|
24
|
-
* UI language as a BCP-47 tag (e.g. "en", "zh", "
|
|
25
|
-
* omitted, the browser locale is auto-detected. Unsupported locales
|
|
26
|
-
* back to English.
|
|
24
|
+
* UI language as a BCP-47 tag (e.g. "en", "zh", "fr", "ja", "ko", "th").
|
|
25
|
+
* When omitted, the browser locale is auto-detected. Unsupported locales
|
|
26
|
+
* fall back to English.
|
|
27
27
|
*/
|
|
28
28
|
locale?: string;
|
|
29
29
|
modalTitle?: string;
|
|
@@ -89,7 +89,7 @@ interface UnifoldConnectProviderConfig {
|
|
|
89
89
|
enableApplePay?: boolean;
|
|
90
90
|
/** Main menu — Apple Pay row title. @default `"Pay with Apple Pay"` (localized when omitted) */
|
|
91
91
|
applePayTitle?: string;
|
|
92
|
-
/** Main menu — Apple Pay row subtitle. @default `"Instant"` (localized when omitted) */
|
|
92
|
+
/** Main menu — Apple Pay row subtitle. @default `"Instant • Debit card only"` (localized when omitted) */
|
|
93
93
|
applePaySubTitle?: string;
|
|
94
94
|
/**
|
|
95
95
|
* Enable "Pay with Google Pay" (headless Coinbase) option. Overrides
|
|
@@ -100,7 +100,7 @@ interface UnifoldConnectProviderConfig {
|
|
|
100
100
|
enableGooglePay?: boolean;
|
|
101
101
|
/** Main menu — Google Pay row title. @default `"Pay with Google Pay"` (localized when omitted) */
|
|
102
102
|
googlePayTitle?: string;
|
|
103
|
-
/** Main menu — Google Pay row subtitle. @default `"Instant"` (localized when omitted) */
|
|
103
|
+
/** Main menu — Google Pay row subtitle. @default `"Instant • Debit card only"` (localized when omitted) */
|
|
104
104
|
googlePaySubTitle?: string;
|
|
105
105
|
/** Simple accent/primary color override (applies to both light and dark modes) */
|
|
106
106
|
accentColor?: string;
|
|
@@ -314,14 +314,37 @@ interface WithdrawConfig {
|
|
|
314
314
|
defaultDestinationSymbol?: string;
|
|
315
315
|
/**
|
|
316
316
|
* The user's wallet address (the sender). Used to:
|
|
317
|
-
* 1. Fetch balance for
|
|
317
|
+
* 1. Fetch balance for max / over-balance (unless `balanceInBaseUnit` is provided)
|
|
318
318
|
* 2. Detect if a matching browser wallet is connected
|
|
319
319
|
*/
|
|
320
320
|
senderAddress: string;
|
|
321
|
+
/**
|
|
322
|
+
* Sender token balance in smallest units (e.g. `"1500000"` for 1.5 USDC).
|
|
323
|
+
* When provided, the modal skips `/addresses/balance` and uses this as the
|
|
324
|
+
* source of truth for max withdraw, over-balance checks, and amount conversion.
|
|
325
|
+
*/
|
|
326
|
+
balanceInBaseUnit?: string;
|
|
327
|
+
/**
|
|
328
|
+
* USD value of {@link WithdrawConfig.balanceInBaseUnit}. When provided with
|
|
329
|
+
* `balanceInBaseUnit`, used for fiat display, max, and crypto↔USD conversion
|
|
330
|
+
* with no extra network calls. When omitted, the modal prices the token
|
|
331
|
+
* (stablecoins assume $1) to compute USD.
|
|
332
|
+
*/
|
|
333
|
+
balanceUsd?: string | number;
|
|
334
|
+
/**
|
|
335
|
+
* Source token decimals (e.g. `6` for USDC). Used with `balanceInBaseUnit`
|
|
336
|
+
* to format the human amount without waiting on the token catalog. Falls
|
|
337
|
+
* back to catalog decimals when omitted.
|
|
338
|
+
*/
|
|
339
|
+
sourceTokenDecimals?: number;
|
|
321
340
|
/**
|
|
322
341
|
* Callback invoked with transaction details when the user confirms withdrawal.
|
|
323
342
|
* The host app is responsible for signing and submitting the transaction — the
|
|
324
343
|
* SDK does not have access to the user's private key.
|
|
344
|
+
*
|
|
345
|
+
* Move `txInfo.amountBaseUnit` to `txInfo.withdrawIntentAddress`. That address
|
|
346
|
+
* is not always on `sourceChainType`: withdrawing off a chain Unifold can't
|
|
347
|
+
* monitor (N1) hands back a Solana address to bridge to instead.
|
|
325
348
|
*/
|
|
326
349
|
withdraw: (txInfo: WithdrawTransactionInfo) => void | Promise<void>;
|
|
327
350
|
onSuccess?: (data: WithdrawResult) => void;
|