@funkit/connect 7.0.2 → 7.0.3-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 7.0.3-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 28136c9: feat(connect): migrate MeldQuickOptions flag to statsig
8
+ - 39406ab: fix(connect): fix undefined error when reading destinationAmount
9
+ - 6f66084: add islighter flow
10
+ - b1c4d85: feat(connect): support for `dynamicRoutingId` param
11
+ - 188da7b: remove genActionParam check in init
12
+ - 62a557d: tradefox theme implemented
13
+ - 115d875: fix(connect): update statsig user when api key changes
14
+ - 9257a9b: remove tick size read in connect
15
+ - Updated dependencies [173d602]
16
+ - Updated dependencies [6d91583]
17
+ - Updated dependencies [9257a9b]
18
+ - @funkit/fun-relay@2.1.16-next.1
19
+ - @funkit/utils@1.1.22-next.0
20
+ - @funkit/api-base@1.12.22-next.0
21
+
22
+ ## 7.0.3-next.0
23
+
24
+ ### Patch Changes
25
+
26
+ - a3a4275: feat(connect): enable monad for hyena + based
27
+ - 361d54c: feat(connect): rounding to the nearest tick size
28
+ - 8feddc9: set default modal size medium
29
+ - f7fa2bc: disable non mainnet eth for lighter eth
30
+ - d0fdef4: add insufficient eth message
31
+ - 087557e: feat(connect): migrate showpoweredtagline flag to statsig
32
+ - e3f0125: add new check for isLighterEthSpot
33
+ - Updated dependencies [3601d23]
34
+ - Updated dependencies [f0f39af]
35
+ - @funkit/fun-relay@2.1.16-next.0
36
+ - @funkit/chains@0.5.2-next.0
37
+
3
38
  ## 7.0.2
4
39
 
5
40
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  readonly addressblacklist: {
3
- readonly value: readonly ["0x7b97b46D35a28B561d47F50CFB9a2735E506e59d", "0x409ad08cc6CA757f69Fb80250a424B9eFeB99807", "0x02A86f51aA7B8b1c17c30364748d5Ae4a0727E23", "0x64131b60502C01362639CC5cfE1a1efB6Be1165A", "0xb84440Ee8BAD69c14755bBb7093f861c3512E3D1"];
3
+ readonly value: readonly ["0x7b97b46D35a28B561d47F50CFB9a2735E506e59d", "0x409ad08cc6CA757f69Fb80250a424B9eFeB99807", "0x02A86f51aA7B8b1c17c30364748d5Ae4a0727E23", "0x64131b60502C01362639CC5cfE1a1efB6Be1165A"];
4
4
  };
5
5
  readonly array_of_strings: {
6
6
  readonly value: readonly [];
@@ -14,11 +14,152 @@ declare const _default: {
14
14
  readonly brokerage_hide_you_receive: {
15
15
  readonly value: false;
16
16
  };
17
+ readonly chainidsortorder: {
18
+ readonly value: readonly ["1", "1151111081099710", "8453", "56", "137", "42161", "10"];
19
+ };
20
+ readonly checkoutnotificationsrefreshinterval: {
21
+ readonly value: {
22
+ readonly listRefresh: 5000;
23
+ readonly itemRefresh: 2000;
24
+ };
25
+ };
26
+ readonly checkouttimeestimateoverrides: {
27
+ readonly value: {
28
+ readonly balance: 60;
29
+ readonly brokerage: 120;
30
+ readonly card: 300;
31
+ readonly token_transfer: 60;
32
+ };
33
+ };
34
+ readonly dynamicrouting: {
35
+ readonly value: readonly [{
36
+ readonly routeId: "LIGHTER_ETH_SPOT";
37
+ readonly rules: readonly [{
38
+ readonly when: {
39
+ readonly chainId: "1";
40
+ readonly tokenAddress: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
41
+ };
42
+ readonly use: {
43
+ readonly path: "FUN_MAINNET_DEPOSIT";
44
+ readonly badge: "NATIVE";
45
+ };
46
+ }, {
47
+ readonly when: {
48
+ readonly chainId: "1";
49
+ readonly tokenAddress: "*";
50
+ };
51
+ readonly use: {
52
+ readonly path: "FUN_MAINNET_DEPOSIT";
53
+ };
54
+ }, {
55
+ readonly when: "*";
56
+ readonly use: {
57
+ readonly path: "RL_TRANSFER";
58
+ };
59
+ }];
60
+ }, {
61
+ readonly routeId: "LIGHTER_USDC_PERPS";
62
+ readonly rules: readonly [{
63
+ readonly when: {
64
+ readonly chainId: "1";
65
+ readonly tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
66
+ };
67
+ readonly use: {
68
+ readonly path: "FUN_MAINNET_DEPOSIT";
69
+ readonly badge: "NATIVE";
70
+ };
71
+ }, {
72
+ readonly when: {
73
+ readonly chainId: "1";
74
+ readonly tokenAddress: "*";
75
+ };
76
+ readonly use: {
77
+ readonly path: "FUN_MAINNET_DEPOSIT";
78
+ };
79
+ }, {
80
+ readonly when: "*";
81
+ readonly use: {
82
+ readonly path: "RL_TRANSFER";
83
+ };
84
+ }];
85
+ }, {
86
+ readonly routeId: "LIGHTER_USDC_PERPS_NEW_USER";
87
+ readonly rules: readonly [{
88
+ readonly when: {
89
+ readonly chainId: "1";
90
+ readonly tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
91
+ };
92
+ readonly use: {
93
+ readonly path: "FUN_MAINNET_DEPOSIT";
94
+ readonly badge: "NATIVE";
95
+ };
96
+ }, {
97
+ readonly when: "*";
98
+ readonly use: {
99
+ readonly path: "FUN_MAINNET_DEPOSIT";
100
+ };
101
+ }];
102
+ }, {
103
+ readonly routeId: "LIGHTER_ETH_SPOT_NEW_USER";
104
+ readonly rules: readonly [{
105
+ readonly when: {
106
+ readonly chainId: "1";
107
+ readonly tokenAddress: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
108
+ };
109
+ readonly use: {
110
+ readonly path: "FUN_MAINNET_DEPOSIT";
111
+ readonly badge: "NATIVE";
112
+ };
113
+ }, {
114
+ readonly when: "*";
115
+ readonly use: {
116
+ readonly path: "FUN_MAINNET_DEPOSIT";
117
+ };
118
+ }];
119
+ }];
120
+ };
121
+ readonly enablebitcoin: {
122
+ readonly value: true;
123
+ };
124
+ readonly enablebluvobrokerage: {
125
+ readonly value: false;
126
+ };
127
+ readonly enablefiatdeposit: {
128
+ readonly value: true;
129
+ };
130
+ readonly enablemeldpayment: {
131
+ readonly value: false;
132
+ };
133
+ readonly enabletokentransfer: {
134
+ readonly value: true;
135
+ };
136
+ readonly isrelaybypassenabled: {
137
+ readonly value: true;
138
+ };
139
+ readonly meldquickoptions: {
140
+ readonly value: {
141
+ readonly USD: readonly [100, 500, 1000];
142
+ readonly EUR: readonly [90, 435, 870];
143
+ readonly JPY: readonly [14500, 72500, 145000];
144
+ readonly KRW: readonly [137500, 690000, 1380000];
145
+ readonly GBP: readonly [75, 375, 745];
146
+ readonly CAD: readonly [135, 685, 1365];
147
+ readonly AUD: readonly [155, 770, 1540];
148
+ readonly CHF: readonly [80, 410, 820];
149
+ readonly BRL: readonly [550, 2750, 5500];
150
+ readonly INR: readonly [8600, 43000, 86000];
151
+ readonly PHP: readonly [5700, 28500, 57000];
152
+ readonly TRY: readonly [3950, 19800, 39500];
153
+ readonly RUB: readonly [7850, 39300, 78600];
154
+ readonly PLN: readonly [370, 1860, 3715];
155
+ readonly SGD: readonly [130, 645, 1285];
156
+ };
157
+ };
17
158
  readonly showinfobanner: {
18
159
  readonly value: {
19
160
  readonly message: "";
20
- readonly expireAtMs: 1;
21
- readonly type: "announcement";
161
+ readonly expireAtMs: 0;
162
+ readonly type: "alert";
22
163
  };
23
164
  };
24
165
  readonly showpoweredtagline: {
@@ -27,5 +168,42 @@ declare const _default: {
27
168
  readonly supportedexchangesv2: {
28
169
  readonly value: readonly [];
29
170
  };
171
+ readonly uda_params: {
172
+ readonly value: readonly [{
173
+ readonly dynamicRoutingId: "LIGHTER_ETH_SPOT";
174
+ readonly params: {
175
+ readonly targetChain: "3586256";
176
+ readonly targetAsset: "0x0000000000000000000000000000000000000001";
177
+ readonly targetAssetTicker: "ETH (Spot)";
178
+ readonly iconSrc: "https://sdk-cdn.fun.xyz/images/eth.svg";
179
+ };
180
+ }, {
181
+ readonly dynamicRoutingId: "LIGHTER_ETH_SPOT_NEW_USER";
182
+ readonly params: {
183
+ readonly targetChain: "1";
184
+ readonly targetAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
185
+ readonly targetAssetTicker: "USDC (Perps)";
186
+ readonly iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg";
187
+ readonly qrcodeActionType: "LIGHTER_USDC_DEPOSIT";
188
+ };
189
+ }, {
190
+ readonly dynamicRoutingId: "LIGHTER_USDC_PERPS";
191
+ readonly params: {
192
+ readonly targetChain: "3586256";
193
+ readonly targetAsset: "0x0000000000000000000000000000000000000000";
194
+ readonly targetAssetTicker: "USDC (Perps)";
195
+ readonly iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg";
196
+ };
197
+ }, {
198
+ readonly dynamicRoutingId: "LIGHTER_USDC_PERPS_NEW_USER";
199
+ readonly params: {
200
+ readonly targetChain: "1";
201
+ readonly targetAsset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
202
+ readonly targetAssetTicker: "USDC (Perps)";
203
+ readonly iconSrc: "https://sdk-cdn.fun.xyz/images/usdc.svg";
204
+ readonly qrcodeActionType: "LIGHTER_USDC_DEPOSIT";
205
+ };
206
+ }];
207
+ };
30
208
  };
31
209
  export default _default;
@@ -142,13 +142,13 @@ var lightTheme = ({
142
142
  // lightStroke
143
143
  modalFooterDivider: "#F7F7F7",
144
144
  // lightStroke
145
- spinnerBackground: "rgba(255, 255, 255, 0.3)",
145
+ spinnerBackground: customColors?.mediumStroke ?? "rgba(255, 255, 255, 0.3)",
146
146
  // 30% buttonTextPrimary
147
- spinnerIndicator: "#FFF",
147
+ spinnerIndicator: customColors?.primaryText ?? "#FFF",
148
148
  // 100% buttonTextPrimary
149
149
  spinnerBackgroundVerifyAccount: "rgba(255, 255, 255, 0.3)",
150
150
  // 30% buttonTextPrimary
151
- spinnerIndicatorVerifyAccount: "#FFF",
151
+ spinnerIndicatorVerifyAccount: customColors?.primaryText ?? "#FFF",
152
152
  // 100% buttonTextPrimary
153
153
  // Override colors
154
154
  ...customColors || {},
@@ -142,13 +142,13 @@ var darkTheme = ({
142
142
  // lightStroke
143
143
  modalFooterDivider: "#333333",
144
144
  // lightStroke
145
- spinnerBackground: "rgba(0, 0, 0, 0.3)",
145
+ spinnerBackground: customColors?.mediumStroke ?? "rgba(0, 0, 0, 0.3)",
146
146
  // 30% buttonTextPrimary
147
- spinnerIndicator: "#000",
147
+ spinnerIndicator: customColors?.primaryText ?? "#000",
148
148
  // 100% buttonTextPrimary
149
149
  spinnerBackgroundVerifyAccount: "rgba(0, 0, 0, 0.3)",
150
150
  // 30% buttonTextPrimary
151
- spinnerIndicatorVerifyAccount: "#000",
151
+ spinnerIndicatorVerifyAccount: customColors?.primaryText ?? "#000",
152
152
  // 100% buttonTextPrimary
153
153
  // Override colors
154
154
  ...customColors || {},
@@ -14,6 +14,8 @@ interface CustomStatusAnimationParams {
14
14
  withTopDivider: 'always' | 'never' | 'scroll' | undefined;
15
15
  /** ID of the element to scroll (main dialog content) when scrolling over the overflowed title */
16
16
  scrollableContent: string;
17
+ /** Whether this is a lighter native deposit checkout (eth mainnet) */
18
+ isLighterNativeDeposit?: boolean;
17
19
  }
18
20
  interface CustomStatusAnimationReturn {
19
21
  /** To be passed to scrolling container, to sync the scroll position */
@@ -27,5 +29,5 @@ interface CustomStatusAnimationReturn {
27
29
  * Hook for sharing the logic for the custom status icon animation in checkout details. This is very
28
30
  * much _not_ generic or intended to be reused anywhere, but the component itself is duplicated.
29
31
  */
30
- export declare function useCustomStatusAnimationAboveTopbar({ depositAddress, isActiveCheckout, isCheckoutDetailView, paddingTop, topbar, withTopDivider, scrollableContent, }: CustomStatusAnimationParams): CustomStatusAnimationReturn;
32
+ export declare function useCustomStatusAnimationAboveTopbar({ depositAddress, isActiveCheckout, isCheckoutDetailView, paddingTop, topbar, withTopDivider, scrollableContent, isLighterNativeDeposit, }: CustomStatusAnimationParams): CustomStatusAnimationReturn;
31
33
  export {};
@@ -2,7 +2,7 @@ import type { TFunction } from 'i18next';
2
2
  import React, { type ReactNode } from 'react';
3
3
  import type { CheckoutProgressStep } from '~/providers/FunkitCheckoutContext';
4
4
  interface TransactionStatusProps {
5
- isLayerZero: boolean;
5
+ isSlowTransaction: boolean;
6
6
  isWithdrawal: boolean;
7
7
  textConfigStatus?: TextConfigStatus;
8
8
  textConfigSteps?: TextConfigSteps;
@@ -32,5 +32,5 @@ export declare const getDefaultTextConfigSteps: (t: TFunction) => TextConfigStep
32
32
  export declare function TransactionStatusLoading({ expectedStatus, }: {
33
33
  expectedStatus: TransactionStatusProps['status'];
34
34
  }): React.JSX.Element;
35
- export declare function TransactionStatus({ isLayerZero, isWithdrawal, status, step, textConfigStatus, textConfigSteps, }: TransactionStatusProps): React.JSX.Element;
35
+ export declare function TransactionStatus({ isSlowTransaction, isWithdrawal, status, step, textConfigStatus, textConfigSteps, }: TransactionStatusProps): React.JSX.Element;
36
36
  export {};
@@ -1,3 +1,4 @@
1
+ import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
1
2
  export declare function isPolymarketCustomer(apiKey: string): apiKey is "Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6";
2
3
  export declare function isOstiumCustomer(apiKey: string): apiKey is "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN";
3
4
  export declare function isBankrCustomer(apiKey: string): apiKey is "vWe20Dfyui2ouvfOhtSTY3Czeo8lFdbo5xXQBALZ";
@@ -13,3 +14,5 @@ export declare function isHyenaCustomer(apiKey: string): apiKey is "pLQBJsA6zS9t
13
14
  export declare function isAvantisCustomer(apiKey: string): apiKey is "6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2";
14
15
  export declare function isPerplCustomer(apiKey: string): apiKey is "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu";
15
16
  export declare function isLighterxyzCustomer(apiKey: string): apiKey is "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2";
17
+ export declare function isLighterEthSpot(apiKey: string, checkoutConfig: FunkitCheckoutConfig | undefined): boolean | undefined;
18
+ export declare function isLighterNativeFlow(apiKey: string, checkoutConfig: FunkitCheckoutConfig | undefined): boolean;
@@ -19,9 +19,10 @@ interface AssetUsableToPayParms {
19
19
  assetUsdAmount: number | null;
20
20
  isAllowedForCheckout: boolean;
21
21
  minUsdRequired?: number;
22
+ isLighterNative: boolean;
22
23
  t: TFunction;
23
24
  }
24
- export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, isAllowedForCheckout, minUsdRequired, t, }: AssetUsableToPayParms) => {
25
+ export declare const isAssetUsableToPayForCheckout: ({ config, payerAddress, paymentMethod, targetChainId, targetTokenAddress, assetChainId, assetTokenAddress, assetUsdAmount, isAllowedForCheckout, minUsdRequired, isLighterNative, t, }: AssetUsableToPayParms) => {
25
26
  isUsable: boolean;
26
27
  reason: string;
27
28
  minUsdRequired?: number;
@@ -1,6 +1,6 @@
1
1
  import fallbackDynamicConfigs from '../../__generated__/default_configs';
2
2
  type FallbackDynamicConfigs = typeof fallbackDynamicConfigs;
3
3
  type DynamicConfigName = keyof FallbackDynamicConfigs;
4
- type DynamicConfigValue<Name extends DynamicConfigName> = FallbackDynamicConfigs[Name]['value'];
4
+ export type DynamicConfigValue<Name extends DynamicConfigName> = FallbackDynamicConfigs[Name]['value'];
5
5
  export declare const useDynamicConfig: <Name extends DynamicConfigName>(name: Name) => DynamicConfigValue<Name>;
6
6
  export {};
@@ -8,5 +8,7 @@ export interface TrackEventData {
8
8
  }
9
9
  export declare const useTrack: () => {
10
10
  logEvent: (eventNameOrTrackEventData: CheckoutModalEvent | TrackEventData) => void;
11
- updateUserAsync: (userInfo: FunkitUserInfo, apiKey: string) => Promise<import("@statsig/react-bindings").StatsigUpdateDetails>;
11
+ updateUserAsync: (userInfo: FunkitUserInfo & {
12
+ l2Address?: string;
13
+ }, apiKey: string) => Promise<import("@statsig/react-bindings").StatsigUpdateDetails>;
12
14
  };
@@ -1,24 +1,27 @@
1
1
  import { type CheckoutInitTokenTransferAddressParams, type CheckoutInitTokenTransferResponse, type FunAddress } from '@funkit/api-base';
2
2
  import { type FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
3
+ import { type UDAConfig } from './useUDAParams';
3
4
  interface UseCheckoutTransferInitResponse {
4
5
  transferInit: CheckoutInitTokenTransferResponse | undefined;
5
6
  recipientAddr: FunAddress;
6
7
  }
7
8
  type CheckoutTokenTransferParams = Omit<CheckoutInitTokenTransferAddressParams, 'logger' | 'clientMetadata'>;
8
9
  export declare function checkoutTransferFetch(params: CheckoutTokenTransferParams): Promise<CheckoutInitTokenTransferResponse>;
9
- export declare function getCheckoutTokenTransferParams({ checkoutConfig, userId, recipientAddr, apiKey, }: {
10
+ export declare function getCheckoutTokenTransferParams({ checkoutConfig, userId, recipientAddr, apiKey, udaParams, }: {
10
11
  checkoutConfig: FunkitCheckoutConfig | undefined;
11
12
  userId: string;
12
13
  recipientAddr: FunAddress;
13
14
  apiKey: string;
15
+ udaParams?: UDAConfig | undefined;
14
16
  }): {
15
17
  toChainId: string;
16
18
  toTokenAddress: `0x${string}`;
19
+ actionType: string | undefined;
17
20
  userId: string;
18
21
  apiKey: string;
19
22
  recipientAddr: FunAddress;
20
- actionType: string | undefined;
21
23
  } | undefined;
24
+ export declare function useIsQRCodeTransferEnabled(): boolean;
22
25
  /**
23
26
  * creates QR code transfer EOA
24
27
  */
@@ -0,0 +1,4 @@
1
+ import type { IndexedDynamicRoutingConfig } from '@funkit/fun-relay';
2
+ export declare const useDynamicRoutes: (_dynamicRoutingId?: string) => {
3
+ findPath: IndexedDynamicRoutingConfig[string]["findPath"];
4
+ };
@@ -0,0 +1,9 @@
1
+ import type { Address } from 'viem';
2
+ export interface UDAConfig {
3
+ targetChain: string;
4
+ targetAsset: Address;
5
+ targetAssetTicker: string;
6
+ iconSrc: string;
7
+ qrcodeActionType?: string;
8
+ }
9
+ export declare const useUDAParams: (_dynamicRoutingId?: string) => UDAConfig | undefined;