@funkit/connect 9.8.0 → 9.9.0
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/CHANGELOG.md +19 -0
- package/dist/__generated__/default_feature_gates.d.ts +2 -0
- package/dist/components/ApprovalMethodToggle/ApprovalMethodToggle.d.ts +19 -0
- package/dist/components/Dropdown/BaseActiveDropdownItem.d.ts +2 -1
- package/dist/components/Dropdown/BaseDropdown.d.ts +4 -2
- package/dist/domains/quote.d.ts +9 -1
- package/dist/hooks/useCheckoutDirectExecution.d.ts +7 -0
- package/dist/index.js +1247 -1060
- package/dist/providers/FunkitCheckoutContext/index.d.ts +1 -0
- package/dist/providers/FunkitQuoteContext.d.ts +6 -0
- package/dist/wallets/walletConnectors/index.js +18 -18
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 9.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- cb719cf: Add source-side authorization toggle ("Sign message" vs "Approve transaction") to the checkout confirmation screen for Wallet/direct-execution flows, behind the `enable-permit-toggle` Statsig gate.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 82368fd: api-base: thread client `checkoutId` through POST /checkout
|
|
12
|
+
- cb719cf: Add labelSize, labelStyle, dropdownWidth, and dropdownAlign override props to BaseDropdown components
|
|
13
|
+
- 82368fd: fix: regenerate checkoutItem.id on SWAPPED_NEW_DEPOSIT so repeat fiat deposits in one modal session produce distinct client metadata ids
|
|
14
|
+
- cb719cf: Address review feedback on permit toggle: move usePermit derivation to FunkitQuoteContext, add missing translations, useCallback on handleSelect, clean up test mocks.
|
|
15
|
+
- Updated dependencies [82368fd]
|
|
16
|
+
- Updated dependencies [9684ac0]
|
|
17
|
+
- Updated dependencies [cb719cf]
|
|
18
|
+
- Updated dependencies [9684ac0]
|
|
19
|
+
- @funkit/api-base@4.2.0
|
|
20
|
+
- @funkit/fun-relay@2.7.0
|
|
21
|
+
|
|
3
22
|
## 9.8.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
readonly 'compliance-review-blocker': false;
|
|
3
3
|
readonly 'enable-across-wallet-flow': false;
|
|
4
|
+
readonly 'enable-permit-toggle': false;
|
|
5
|
+
readonly 'enable-swapped-exchanges': false;
|
|
4
6
|
readonly 'exact-in': false;
|
|
5
7
|
readonly 'faster-notifications': false;
|
|
6
8
|
readonly 'new-token-transfer-config': false;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ApprovalMethod } from '../../providers/FunkitQuoteContext';
|
|
3
|
+
interface ApprovalMethodToggleProps {
|
|
4
|
+
value: ApprovalMethod;
|
|
5
|
+
onChange: (next: ApprovalMethod) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
testId?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A small dropdown selector for the user's preferred source-side
|
|
11
|
+
* authorization method ("Approve transaction" vs "Signed message").
|
|
12
|
+
*
|
|
13
|
+
* Pure presentation: state lives in `useApprovalMethodSelection`. The
|
|
14
|
+
* component is screen-agnostic so it can be mounted on either
|
|
15
|
+
* `ConfirmationStep` (non-native flow) or `InputAmount` (native flow,
|
|
16
|
+
* future) without changes.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ApprovalMethodToggle({ value, onChange, disabled, testId, }: ApprovalMethodToggleProps): React.JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -14,9 +14,10 @@ export interface BaseActiveDropdownItemProps {
|
|
|
14
14
|
color?: BoxProps['color'];
|
|
15
15
|
arrowColor?: BoxProps['color'];
|
|
16
16
|
background?: BoxProps['background'];
|
|
17
|
+
labelStyle?: React.CSSProperties;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Represents the component used to open the dropdown, usually displayed all the time.
|
|
20
21
|
*/
|
|
21
|
-
declare function BaseActiveDropdownItem({ iconComponent, label, isOpened, onClick, horizontalIconGap, alwaysVisibleLabel, tagComponent, tagPosition, size, color, arrowColor, background, }: BaseActiveDropdownItemProps): React.JSX.Element;
|
|
22
|
+
declare function BaseActiveDropdownItem({ iconComponent, label, isOpened, onClick, horizontalIconGap, alwaysVisibleLabel, tagComponent, tagPosition, size, color, arrowColor, background, labelStyle, }: BaseActiveDropdownItemProps): React.JSX.Element;
|
|
22
23
|
export default BaseActiveDropdownItem;
|
|
@@ -11,7 +11,7 @@ export declare const HORIZONTAL_ICON_GAP = "4";
|
|
|
11
11
|
export declare const HORIZONTAL_OUTER_PADDING_X = "12";
|
|
12
12
|
export interface BaseDropdownProps<T = string, G extends string = never> {
|
|
13
13
|
value: string;
|
|
14
|
-
activeItemProps?: Partial<Pick<BaseActiveDropdownItemProps, 'iconComponent' | 'label' | 'color' | 'alwaysVisibleLabel' | 'tagComponent' | 'tagPosition' | 'background'>>;
|
|
14
|
+
activeItemProps?: Partial<Pick<BaseActiveDropdownItemProps, 'iconComponent' | 'label' | 'color' | 'alwaysVisibleLabel' | 'tagComponent' | 'tagPosition' | 'background' | 'labelStyle'>>;
|
|
15
15
|
/**
|
|
16
16
|
* List of groups to show and the corresponding labels, in the expected order.
|
|
17
17
|
*
|
|
@@ -65,7 +65,9 @@ export interface BaseDropdownProps<T = string, G extends string = never> {
|
|
|
65
65
|
* This values should be set so that the last dropdown item is partially visible to indicate that there are more options.
|
|
66
66
|
*/
|
|
67
67
|
maxDropdownHeight?: number;
|
|
68
|
+
dropdownWidth?: number;
|
|
69
|
+
dropdownAlign?: 'start' | 'center' | 'end';
|
|
68
70
|
testId?: string;
|
|
69
71
|
}
|
|
70
|
-
declare function BaseDropdown<T extends string = string, G extends string = never>({ activeItemProps, value, options, groups, additionalGroup, additionalGroupLabel, allowUnselect, unselectLabel, onOptionSelected, onOpen, renderDropdownOption, searchableOptions, searchPlaceholder, placeholder, resetSearchOnClose, openToTopOnMobile, alwaysOpenToTop, openDropdownFullWidth, isLoading, preloadIconUrls, horizontalIconGap, openDropdownBackgroundColor, size, label, maxDropdownHeight, testId, }: BaseDropdownProps<T, G>): React.JSX.Element;
|
|
72
|
+
declare function BaseDropdown<T extends string = string, G extends string = never>({ activeItemProps, value, options, groups, additionalGroup, additionalGroupLabel, allowUnselect, unselectLabel, onOptionSelected, onOpen, renderDropdownOption, searchableOptions, searchPlaceholder, placeholder, resetSearchOnClose, openToTopOnMobile, alwaysOpenToTop, openDropdownFullWidth, isLoading, preloadIconUrls, horizontalIconGap, openDropdownBackgroundColor, size, label, maxDropdownHeight, dropdownWidth, dropdownAlign, testId, }: BaseDropdownProps<T, G>): React.JSX.Element;
|
|
71
73
|
export default BaseDropdown;
|
package/dist/domains/quote.d.ts
CHANGED
|
@@ -13,7 +13,15 @@ export interface FunkitCheckoutQuoteResult extends Omit<ApiFunkitCheckoutQuoteRe
|
|
|
13
13
|
finalSpreadUsd: string;
|
|
14
14
|
finalFeesBreakdown: CheckoutFees;
|
|
15
15
|
}
|
|
16
|
-
export declare function getCheckoutBaseQuote(checkoutItem: FunkitActiveCheckoutItem, userId: string, walletAddress: Address, apiKey: string, wagmiConfig: Config, directExecutionInfo: FunkitDirectExecutionInfo, senderAddress?: Address, isWithdrawal?: boolean, quoteBuilder?: QuoteBuilder
|
|
16
|
+
export declare function getCheckoutBaseQuote(checkoutItem: FunkitActiveCheckoutItem, userId: string, walletAddress: Address, apiKey: string, wagmiConfig: Config, directExecutionInfo: FunkitDirectExecutionInfo, senderAddress?: Address, isWithdrawal?: boolean, quoteBuilder?: QuoteBuilder,
|
|
17
|
+
/**
|
|
18
|
+
* User-driven preference for the source-side authorization step. Forwarded
|
|
19
|
+
* to the direct-execution branch (`getDirectExecutionQuote` →
|
|
20
|
+
* `getCheckoutQuoteV2`) where Relay's `usePermit` flag actually flows. The
|
|
21
|
+
* legacy `getApiCheckoutQuote` branch ignores this; the permit toggle is
|
|
22
|
+
* scoped to Wallet (Relay direct-execution) only.
|
|
23
|
+
*/
|
|
24
|
+
usePermit?: boolean): Promise<CheckoutQuoteResponse>;
|
|
17
25
|
export declare function getQuoteFinalEstimation(baseQuote: CheckoutQuoteResponse, checkoutItem: FunkitActiveCheckoutItem, newPaymentMethodInfo: PaymentMethodInfo, wagmiConfig: Config, apiKey: string, loginType: LoginType, isWithdrawal?: boolean, brokerageQuote?: BluvoBrokerageQuote): Promise<{
|
|
18
26
|
finalEstimation: FunkitCheckoutQuoteResult;
|
|
19
27
|
brokerage?: BrokerageDetails;
|
|
@@ -15,6 +15,13 @@ interface DirectExecutionQuoteRequestParamsBase {
|
|
|
15
15
|
toTokenAddress: Address;
|
|
16
16
|
recipientAddress: Address;
|
|
17
17
|
senderAddress?: Address;
|
|
18
|
+
/**
|
|
19
|
+
* Explicit permit preference for the source-side authorization step.
|
|
20
|
+
* Forwarded as `usePermit` on the v2 quote request body. When defined,
|
|
21
|
+
* takes priority over the legacy auto-gasless-fallback (see frog's
|
|
22
|
+
* getUsePermit for the full resolution order).
|
|
23
|
+
*/
|
|
24
|
+
usePermit?: boolean;
|
|
18
25
|
}
|
|
19
26
|
interface RegularDEQuoteRequest extends DirectExecutionQuoteRequestParamsBase {
|
|
20
27
|
toTokenAmount: number;
|