@funkit/connect 10.3.0 → 10.4.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 +23 -0
- package/dist/clients/chunk-2YWQL3AO.js +46 -0
- package/dist/clients/chunk-APQYFP6X.js +207 -0
- package/dist/clients/chunk-BNMZM23Q.js +42 -0
- package/dist/clients/chunk-II5CZTBC.js +18 -0
- package/dist/clients/chunk-KNHO756P.js +28 -0
- package/dist/clients/chunk-L2KSNS7H.js +112 -0
- package/dist/clients/{chunk-3STGJU6Z.js → chunk-M6C7MBQN.js} +1 -1
- package/dist/clients/chunk-OZ3KD24N.js +107 -0
- package/dist/clients/{chunk-RWCJ4XGX.js → chunk-RCMAGKMG.js} +30 -1
- package/dist/clients/internal/nado/consts.d.ts +16 -0
- package/dist/clients/internal/nado/consts.js +13 -0
- package/dist/clients/internal/nado/encoding.d.ts +22 -0
- package/dist/clients/internal/nado/encoding.js +32 -0
- package/dist/clients/internal/nado/errors.d.ts +55 -0
- package/dist/clients/internal/nado/errors.js +15 -0
- package/dist/clients/internal/nado/fetch.d.ts +15 -0
- package/dist/clients/internal/nado/fetch.js +9 -0
- package/dist/clients/internal/nado/gateway.d.ts +83 -0
- package/dist/clients/internal/nado/gateway.js +23 -0
- package/dist/clients/internal/nado/hooks.d.ts +360 -0
- package/dist/clients/internal/nado/hooks.js +132 -0
- package/dist/clients/internal/nado/indexer.d.ts +43 -0
- package/dist/clients/internal/nado/indexer.js +13 -0
- package/dist/clients/internal/nado/products.d.ts +36 -0
- package/dist/clients/internal/nado/products.js +19 -0
- package/dist/clients/internal/nado/typedData.d.ts +80 -0
- package/dist/clients/internal/nado/typedData.js +43 -0
- package/dist/clients/lighter.js +117 -40
- package/dist/clients/mallard.js +8 -23
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +2 -2
- package/dist/clients/polymarket/index.js +2 -2
- package/dist/components/ChainIcon/ChainIcon.d.ts +16 -0
- package/dist/components/FreeUsdcBanner/FreeUsdcBanner.d.ts +1 -1
- package/dist/components/FunAssetAvatar/FunAssetAvatar.d.ts +1 -2
- package/dist/hooks/useChainMetadata.d.ts +11 -0
- package/dist/hooks/usePaymentMethodTabs.d.ts +8 -2
- package/dist/hooks/useSwappedIframeLifecycle.d.ts +5 -2
- package/dist/hooks/useSwappedPreload.d.ts +7 -11
- package/dist/hooks/useUserIpInfo.d.ts +1 -19
- package/dist/index.js +2710 -2638
- package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +3 -0
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframe.d.ts +4 -1
- package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframeController.d.ts +3 -0
- package/dist/modals/CheckoutModal/isWithdrawalStep.d.ts +3 -2
- package/dist/providers/FunkitCheckoutContext/types.d.ts +34 -13
- package/dist/providers/FunkitConfigContext.d.ts +4 -0
- package/dist/providers/SwappedProvider.d.ts +5 -3
- package/dist/utils/tokenIconUrl.d.ts +5 -0
- package/dist/wallets/walletConnectors/index.js +28 -28
- package/package.json +3 -2
- package/dist/hooks/useSkipSwappedPreload.d.ts +0 -7
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BoxProps } from '../Box/Box';
|
|
3
|
+
interface ChainIconProps {
|
|
4
|
+
chainId: number;
|
|
5
|
+
size: (BoxProps['height'] & BoxProps['width']) | number;
|
|
6
|
+
borderColor?: BoxProps['borderColor'];
|
|
7
|
+
/** Renders the chain's brand background color behind transparent icons. */
|
|
8
|
+
withIconBackground?: boolean;
|
|
9
|
+
testId?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Round chain icon resolved via useChainMetadata, degrading to FALLBACK_ASSET on
|
|
13
|
+
* load failure. Renders nothing for chains unknown to every source.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ChainIcon({ chainId, size, borderColor, withIconBackground, testId, }: ChainIconProps): React.JSX.Element | null;
|
|
16
|
+
export {};
|
|
@@ -7,9 +7,8 @@ interface FunAssetAvatarProps {
|
|
|
7
7
|
assetIconSize?: BoxProps['height'] & BoxProps['width'];
|
|
8
8
|
chainId?: string | number;
|
|
9
9
|
prioritizeDefaults?: boolean;
|
|
10
|
-
hideIfUnknown?: boolean;
|
|
11
10
|
largeChainIcon?: boolean;
|
|
12
11
|
isChainIconHidden?: boolean;
|
|
13
12
|
}
|
|
14
|
-
export declare function FunAssetAvatar({ assetSrc, assetTicker, assetName, assetIconSize, chainId, prioritizeDefaults,
|
|
13
|
+
export declare function FunAssetAvatar({ assetSrc, assetTicker, assetName, assetIconSize, chainId, prioritizeDefaults, largeChainIcon, isChainIconHidden, }: FunAssetAvatarProps): React.JSX.Element;
|
|
15
14
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ChainMetadata {
|
|
2
|
+
name: string;
|
|
3
|
+
iconUrl: string | (() => Promise<string>);
|
|
4
|
+
iconBackground?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Resolves a chain's display name and icon. Name priority: curated metadata,
|
|
8
|
+
* then the supported-assets API, then customer-supplied chains.
|
|
9
|
+
* Returns null for chains unknown to every source.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useChainMetadata(): (chainId: number) => ChainMetadata | null;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type PaymentMethodType } from '../hooks/usePaymentSources';
|
|
2
|
-
export declare function usePaymentMethodTabs({
|
|
3
|
-
|
|
2
|
+
export declare function usePaymentMethodTabs({ isCashier, }: {
|
|
3
|
+
/**
|
|
4
|
+
* Explicit cashier intent (`props.formFactor === 'cashier'`), which the props
|
|
5
|
+
* union guarantees carries a `withdrawalConfig`. Gated further by the
|
|
6
|
+
* `enablecashierformfactor` Statsig config so the cashier can roll out per
|
|
7
|
+
* customer on top of the integrator's opt-in.
|
|
8
|
+
*/
|
|
9
|
+
isCashier: boolean;
|
|
4
10
|
}): {
|
|
5
11
|
defaultTab: PaymentMethodType;
|
|
6
12
|
isWithdrawalTabEnabled: boolean;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { FormOfPaymentType } from '@funkit/api-base';
|
|
2
|
+
import { type SwappedMode } from '../providers/SwappedProvider';
|
|
2
3
|
/**
|
|
3
4
|
* Shared lifecycle hook for Swapped iframe containers (deposit + withdrawal).
|
|
4
|
-
* Handles activate/deactivate on mount/unmount and timeout error detection
|
|
5
|
+
* Handles activate/deactivate on mount/unmount and timeout error detection for
|
|
6
|
+
* the slot identified by `mode`.
|
|
5
7
|
*
|
|
6
8
|
* `onTimeout` is stabilized internally via useEffectEvent — callers do not
|
|
7
9
|
* need to memoize it.
|
|
8
10
|
*/
|
|
9
|
-
export declare function useSwappedIframeLifecycle({ fopType, onTimeout, }: {
|
|
11
|
+
export declare function useSwappedIframeLifecycle({ fopType, onTimeout, mode, }: {
|
|
10
12
|
fopType: FormOfPaymentType;
|
|
11
13
|
onTimeout: () => void;
|
|
14
|
+
mode: SwappedMode;
|
|
12
15
|
}): void;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { GetFopsResponse } from '@funkit/api-base';
|
|
2
|
+
import { type SwappedMode } from '../providers/SwappedProvider';
|
|
2
3
|
/**
|
|
3
|
-
* Feeds fops data into the SwappedProvider for single-iframe
|
|
4
|
-
* Extracts the first (highest priority) embeddedFlowUrl and sets it
|
|
4
|
+
* Feeds fops data into the given SwappedProvider slot for single-iframe
|
|
5
|
+
* preloading. Extracts the first (highest priority) embeddedFlowUrl and sets it
|
|
6
|
+
* on the slot for `mode` (deposit or withdrawal).
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* SourceChange uses this around the leaving-tab overlay to prevent the stale
|
|
9
|
-
* tab's preload from racing the active tab's.
|
|
10
|
-
*
|
|
11
|
-
* Pass `disabled=true` to bypass the effect entirely (no setIframeUrl call at all,
|
|
12
|
-
* not even null). Use when another component owns the preload for the active context
|
|
13
|
-
* (e.g. SourceChange defers to WithdrawalMethodSelect on the withdraw tab).
|
|
8
|
+
* Deposit and withdrawal own separate slots, so their preloads never race — a
|
|
9
|
+
* leaving tab feeding one slot can't clobber the active tab's other slot.
|
|
14
10
|
*/
|
|
15
|
-
export declare function useSwappedPreload(fopsData: GetFopsResponse | undefined,
|
|
11
|
+
export declare function useSwappedPreload(fopsData: GetFopsResponse | undefined, mode: SwappedMode): void;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface UserIpInfoFromMoonpay {
|
|
3
|
-
/** https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 */
|
|
4
|
-
alpha2: 'AU' | 'CA' | 'US' | string;
|
|
5
|
-
state: string;
|
|
6
|
-
alpha3: string;
|
|
7
|
-
country: string;
|
|
8
|
-
ipAddress: string;
|
|
9
|
-
isAllowed: boolean;
|
|
10
|
-
isBuyAllowed: boolean;
|
|
11
|
-
isNftAllowed: boolean;
|
|
12
|
-
isSellAllowed: boolean;
|
|
13
|
-
isBalanceLedgerWithdrawAllowed: boolean;
|
|
14
|
-
isLowLimitEnabled: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function useUserIpInfo(): {
|
|
17
|
-
userIpInfo: FunkitUserIpInfo | undefined;
|
|
18
|
-
isLoadingGeoCheck: boolean;
|
|
19
|
-
};
|
|
1
|
+
export declare function useUserIpInfo(): import("@funkit/connect-core").UseUserIpInfoResult;
|