@funkit/connect 6.14.23-next.2 → 6.15.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.
@@ -1,16 +1,11 @@
1
- import type { Operation } from '@funkit/core';
2
1
  import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
3
2
  import { type CheckoutQuoteResult } from '~/providers/FunkitQuoteContext';
4
3
  import { type PaymentMethodInfo } from '../../domains/paymentMethods';
5
- import { LoginType } from '../../providers/GeneralWalletProvider';
6
4
  export interface SourceAssetConfirmed {
7
5
  isQuoteSuccess: boolean;
8
6
  maxTargetAssetAmount: number | undefined;
9
7
  }
10
8
  export declare function preparePaymentMethodInfo(selectedPaymentMethodInfo: PaymentMethodInfo | null): PaymentMethodInfo;
11
- export declare function fetchSponsorInitialTransferGasLimit(selectedPaymentMethodInfo: PaymentMethodInfo | null, loginType: LoginType, generateCheckoutTransferOpItems: (toAddress: string, tokenAmount: number | string) => Promise<{
12
- transferOp: Operation | null;
13
- }>): Promise<number>;
14
9
  /**
15
10
  *
16
11
  * Note: this hook is EXTREMELY confusing in what is doing
@@ -0,0 +1,57 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import type { Address } from 'viem';
3
+ import { type PaymentMethodInfo } from '../../domains/paymentMethods';
4
+ import type { AssetHoldingsItem } from '../../utils/assets';
5
+ import type { WithdrawalClient } from '../../wallets/Wallet';
6
+ import { type FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
7
+ import type { FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, FunkitWithdrawalConfig, UseFunkitCheckoutProps, UseFunkitCheckoutPropsWithFullConfig } from './types';
8
+ export * from './types';
9
+ interface FunkitCheckoutContextInterface {
10
+ checkoutItem: FunkitActiveCheckoutItem | null;
11
+ getCheckoutProgress(checkoutId: string): CheckoutProgress | undefined;
12
+ setCheckoutProgress(checkoutId: string, progress: CheckoutProgress): void;
13
+ initNewCheckout(initSettings: UseFunkitCheckoutPropsWithFullConfig): string;
14
+ updateModalTitleMeta(newMeta: string): void;
15
+ updateSourceAsset(selectedSource: Omit<AssetHoldingsItem, 'amount' | 'usdAmount' | 'chainSymbolKey'>): void;
16
+ updateTargetAssetAmount(newTargetAssetAmount: number): void;
17
+ updateTargetAsset(asset: {
18
+ targetAsset: Address;
19
+ targetChain: string;
20
+ targetAssetTicker: string;
21
+ targetAssetMinAmount: number | undefined;
22
+ iconSrc: string | undefined;
23
+ }): void;
24
+ updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
25
+ updateCustomRecipient: (recipient: Address) => void;
26
+ confirmCheckout(shouldBatchOpBypassInit: boolean, quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void, withdrawalClient?: WithdrawalClient): Promise<Address>;
27
+ cancelCheckout(depositAddress: Address): Promise<boolean>;
28
+ /** @deprecated to be removed after quote migration is finished (historically named setCheckoutQuote) */
29
+ setCheckout: (checkout: FunkitActiveCheckoutItem) => void;
30
+ setCompletedTimestamp(timestampMs: number): void;
31
+ withdrawalItem: FunkitActiveWithdrawalItem | null;
32
+ initNewWithdrawal(initSettings: Partial<UseFunkitCheckoutPropsWithFullConfig>, config: UseFunkitCheckoutPropsWithFullConfig): string;
33
+ updateWithdrawalSourceAssetAmount(newSourceAmount: number): void;
34
+ }
35
+ export type CheckoutProgressStep = 1 | 2;
36
+ export type CheckoutProgress = {
37
+ step: CheckoutProgressStep;
38
+ };
39
+ export declare function FunkitCheckoutProvider({ children }: {
40
+ children: ReactNode;
41
+ }): React.JSX.Element;
42
+ export declare function useCheckoutContext(): FunkitCheckoutContextInterface;
43
+ /**
44
+ * External hook for user to kickstart a checkout in their app
45
+ */
46
+ export declare function useFunkitCheckout(props: UseFunkitCheckoutPropsWithFullConfig): {
47
+ beginCheckout: (config?: Partial<FunkitCheckoutConfig>) => Promise<{
48
+ isActivated: boolean;
49
+ }>;
50
+ beginWithdrawal: (config: FunkitWithdrawalConfig) => void;
51
+ };
52
+ export declare function useFunkitCheckout(props: UseFunkitCheckoutProps): {
53
+ beginCheckout: (config: FunkitCheckoutConfig) => Promise<{
54
+ isActivated: boolean;
55
+ }>;
56
+ beginWithdrawal: (config: FunkitWithdrawalConfig) => void;
57
+ };
@@ -3,7 +3,7 @@ import type { FunkitCheckoutQuoteResult } from '~/domains/quote';
3
3
  import { CheckoutModalEvent } from '~/hooks/track/CheckoutModalEvent';
4
4
  import type { WithdrawModalEvent } from '~/hooks/track/WithdrawModalEvent';
5
5
  import type { TrackEventData } from '~/hooks/track/useTrack';
6
- import type { FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem } from './FunkitCheckoutContext';
6
+ import type { FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem } from './index';
7
7
  export declare const trackEventFromActiveItem: (activeItem: FunkitActiveCheckoutItem | FunkitActiveWithdrawalItem, eventName: CheckoutModalEvent | WithdrawModalEvent) => TrackEventData;
8
8
  export declare const trackEventFromDirectExecutionConfirmed: ({ txHash, checkoutItem, latestQuote, }: {
9
9
  txHash: RelayTxHash<RelayVmType>;
@@ -1,11 +1,9 @@
1
- import { type FunAddress } from '@funkit/api-base';
1
+ import type { FunAddress } from '@funkit/api-base';
2
2
  import type { ApiCheckoutClientMetadata, ApiFunkitCheckoutActionParams, ApiFunkitCheckoutConfig } from '@funkit/utils';
3
- import React, { type ReactNode } from 'react';
4
3
  import type { Address } from 'viem';
5
- import { type PaymentMethodInfo } from '../domains/paymentMethods';
6
- import type { AssetHoldingsItem } from '../utils/assets';
7
- import type { WithdrawalClient } from '../wallets/Wallet';
8
- import { type FunkitCheckoutQuoteResult } from './FunkitHistoryContext';
4
+ import type { PaymentMethodInfo } from '../../domains/paymentMethods';
5
+ import type { WithdrawalClient } from '../../wallets/Wallet';
6
+ import type { FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
9
7
  export type FunkitCheckoutActionParams = ApiFunkitCheckoutActionParams;
10
8
  export interface TokenInfo {
11
9
  tokenAddress: Address;
@@ -184,53 +182,3 @@ export interface FunkitActiveWithdrawalItem {
184
182
  initSettings: Partial<UseFunkitCheckoutPropsWithFullConfig>;
185
183
  withdrawalSourceTokenBalance: () => number;
186
184
  }
187
- interface FunkitCheckoutContextInterface {
188
- checkoutItem: FunkitActiveCheckoutItem | null;
189
- getCheckoutProgress(checkoutId: string): CheckoutProgress | undefined;
190
- setCheckoutProgress(checkoutId: string, progress: CheckoutProgress): void;
191
- initNewCheckout(initSettings: UseFunkitCheckoutPropsWithFullConfig): string;
192
- updateModalTitleMeta(newMeta: string): void;
193
- updateSourceAsset(selectedSource: Omit<AssetHoldingsItem, 'amount' | 'usdAmount' | 'chainSymbolKey'>): void;
194
- updateTargetAssetAmount(newTargetAssetAmount: number): void;
195
- updateTargetAsset(asset: {
196
- targetAsset: Address;
197
- targetChain: string;
198
- targetAssetTicker: string;
199
- targetAssetMinAmount: number | undefined;
200
- iconSrc: string | undefined;
201
- }): void;
202
- updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
203
- updateCustomRecipient: (recipient: Address) => void;
204
- confirmCheckout(shouldBatchOpBypassInit: boolean, quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void, withdrawalClient?: WithdrawalClient): Promise<Address>;
205
- cancelCheckout(depositAddress: Address): Promise<boolean>;
206
- /** @deprecated to be removed after quote migration is finished (historically named setCheckoutQuote) */
207
- setCheckout: (checkout: FunkitActiveCheckoutItem) => void;
208
- setCompletedTimestamp(timestampMs: number): void;
209
- withdrawalItem: FunkitActiveWithdrawalItem | null;
210
- initNewWithdrawal(initSettings: Partial<UseFunkitCheckoutPropsWithFullConfig>, config: UseFunkitCheckoutPropsWithFullConfig): string;
211
- updateWithdrawalSourceAssetAmount(newSourceAmount: number): void;
212
- }
213
- export type CheckoutProgressStep = 1 | 2;
214
- export type CheckoutProgress = {
215
- step: CheckoutProgressStep;
216
- };
217
- export declare function FunkitCheckoutProvider({ children }: {
218
- children: ReactNode;
219
- }): React.JSX.Element;
220
- export declare function useCheckoutContext(): FunkitCheckoutContextInterface;
221
- /**
222
- * External hook for user to kickstart a checkout in their app
223
- */
224
- export declare function useFunkitCheckout(props: UseFunkitCheckoutPropsWithFullConfig): {
225
- beginCheckout: (config?: Partial<FunkitCheckoutConfig>) => Promise<{
226
- isActivated: boolean;
227
- }>;
228
- beginWithdrawal: (config: FunkitWithdrawalConfig) => void;
229
- };
230
- export declare function useFunkitCheckout(props: UseFunkitCheckoutProps): {
231
- beginCheckout: (config: FunkitCheckoutConfig) => Promise<{
232
- isActivated: boolean;
233
- }>;
234
- beginWithdrawal: (config: FunkitWithdrawalConfig) => void;
235
- };
236
- export {};
@@ -37,7 +37,7 @@ interface CheckoutQuoteState {
37
37
  }
38
38
  interface FunkitQuoteContextInterface extends CheckoutQuoteState {
39
39
  clearCheckoutQuoteMessages: () => void;
40
- getCheckoutQuote: (sponsorInitialTransferGasLimit: number, newPaymentMethodInfo: PaymentMethodInfo, disableInformationStreaming?: boolean) => Promise<GetCheckoutQuoteResponse>;
40
+ getCheckoutQuote: (newPaymentMethodInfo: PaymentMethodInfo, disableInformationStreaming?: boolean) => Promise<GetCheckoutQuoteResponse>;
41
41
  setCheckoutQuote: Dispatch<React.SetStateAction<FunkitCheckoutQuoteResult | null>>;
42
42
  setQuoteProgress: (state: Omit<CheckoutQuoteState, 'latestQuote'>) => void;
43
43
  }
@@ -129,7 +129,7 @@ export declare function getQuoteExchangeRate(config: FunkitCheckoutConfig, baseQ
129
129
  */
130
130
  export declare function getMaxTargetAssetAmountEstimate(sourceAssetBalance: number, config: FunkitCheckoutConfig, quoteResult: FunkitCheckoutQuoteResult): number;
131
131
  export declare function getTokenDecimals(wagmiConfig: Config, chainId: string, tokenAddress: Address): Promise<number>;
132
- export declare function evaluateCheckoutGenerateActionsParams(config: FunkitCheckoutConfig | ServerCheckoutConfig): Promise<FunkitCheckoutActionParams[]>;
132
+ export declare function evaluateCheckoutGenerateActionsParams(config: FunkitCheckoutConfig): Promise<FunkitCheckoutActionParams[]>;
133
133
  export declare function isCheckoutCrFlow(config: FunkitCheckoutConfig): boolean;
134
134
  /**
135
135
  * @param config can be either be a config from live checkoutItem OR from checkout history's clientMetadata
@@ -49,7 +49,7 @@ export declare const flagConfig: {
49
49
  readonly if_any: [{
50
50
  readonly key: "apiKey";
51
51
  readonly type: "isAnyOf";
52
- readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "vWe20Dfyui2ouvfOhtSTY3Czeo8lFdbo5xXQBALZ", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "OXLUmejkh9PlNDS4gSvi9gcEWacOpTz2KUVepVf4", "BPVeP8zThG467vVIYzuiu5aVWAkS9KiR6tT1TdTP", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "2SrxurU07T2XPDxCAItjj4yYEMXlwV8K2kJB78AX", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc"];
52
+ readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6", "SMbBD7DS9b3EPcyBVg4a8az1rRWR9xB068chHoUN", "vWe20Dfyui2ouvfOhtSTY3Czeo8lFdbo5xXQBALZ", "clDebbfo9edXq1GydZ0CahSAfSimPj616lFa9p8e", "OXLUmejkh9PlNDS4gSvi9gcEWacOpTz2KUVepVf4", "BPVeP8zThG467vVIYzuiu5aVWAkS9KiR6tT1TdTP", "lUzTaIRxs95iin3pCAafB1ChA5akBiuQ1tjhXnau", "AH7lRIhbsL167nptv6eub9xDJXVHnYUm2vL7FLjK", "di9ZSqn1Ya68Y2XpBPUV1rCtNGXh8Xe5MGWzb1Xe", "2SrxurU07T2XPDxCAItjj4yYEMXlwV8K2kJB78AX", "5UzOrcAE2F3rcuMX2EeIlaYv5VUcDe6Lyh0PeZX2", "M3uox3cw0u8YCPV9cIREA6AugUMvPFTk6qOpm4um", "6TUi99Tq3O9MWj1IFX8Pv6spmPXzcvhy9NvBoeW2", "2hicPxo2vy2NMHcg2cEU9crOeKtDpc14NEfMCthc", "57G91zNoew4nYxIoqSCpS1vWr8JT3gGVasNqMwgG", "i6e1I8cfX625TTwRJlD2DshKyAoaUtO8aeoaR4i2", "wQDLu86Qab61vbtru7thf8Yj0xaeqVUH4ohoXESu", "53OWivH0fK2VIAuMZTycr52EnSEnPWj97Jy3Dpiz"];
53
53
  }];
54
54
  readonly value: true;
55
55
  }];
@@ -97,10 +97,6 @@ export declare const flagConfig: {
97
97
  readonly value: string;
98
98
  }];
99
99
  };
100
- readonly enable_frog_proxy_server: {
101
- readonly type: "boolean";
102
- readonly default_value: true;
103
- };
104
100
  readonly checkout_time_estimate_overrides: {
105
101
  readonly type: "string";
106
102
  readonly default_value: "";
@@ -219,7 +215,7 @@ export declare const flagConfig: {
219
215
  readonly value: true;
220
216
  }, Override<boolean>, {
221
217
  readonly if_all: [{
222
- readonly pct: 2;
218
+ readonly pct: 10;
223
219
  readonly type: "pctRollout";
224
220
  readonly key: "userId";
225
221
  }, {
@@ -11,15 +11,15 @@ import {
11
11
  import {
12
12
  subWallet
13
13
  } from "./chunk-JWFF4AAL.js";
14
+ import {
15
+ talismanWallet
16
+ } from "./chunk-DRO6WYMM.js";
14
17
  import {
15
18
  tahoWallet
16
19
  } from "./chunk-ZZZRUXZE.js";
17
20
  import {
18
21
  tokenPocketWallet
19
22
  } from "./chunk-2L43XSW3.js";
20
- import {
21
- talismanWallet
22
- } from "./chunk-DRO6WYMM.js";
23
23
  import {
24
24
  tokenaryWallet
25
25
  } from "./chunk-D6AOOO5F.js";
@@ -68,12 +68,12 @@ import {
68
68
  import {
69
69
  oktoWallet
70
70
  } from "./chunk-ADIXAKUL.js";
71
- import {
72
- okxWallet
73
- } from "./chunk-TDIEHTMB.js";
74
71
  import {
75
72
  omniWallet
76
73
  } from "./chunk-7CUY5G6R.js";
74
+ import {
75
+ okxWallet
76
+ } from "./chunk-TDIEHTMB.js";
77
77
  import {
78
78
  oneInchWallet
79
79
  } from "./chunk-OESTDX6I.js";
@@ -95,21 +95,21 @@ import {
95
95
  import {
96
96
  imTokenWallet
97
97
  } from "./chunk-COZ7MIQS.js";
98
+ import {
99
+ kresusWallet
100
+ } from "./chunk-MJXPRJZT.js";
98
101
  import {
99
102
  injectedWallet
100
103
  } from "./chunk-XWUJE7MW.js";
101
104
  import {
102
- kresusWallet
103
- } from "./chunk-MJXPRJZT.js";
105
+ bybitWallet
106
+ } from "./chunk-2STUC6QL.js";
104
107
  import {
105
108
  clvWallet
106
109
  } from "./chunk-M3NZ6R2E.js";
107
110
  import {
108
111
  coin98Wallet
109
112
  } from "./chunk-OBOVHCEI.js";
110
- import {
111
- bybitWallet
112
- } from "./chunk-2STUC6QL.js";
113
113
  import {
114
114
  coinbaseWallet
115
115
  } from "./chunk-H4IRCEZN.js";
@@ -125,9 +125,6 @@ import {
125
125
  import {
126
126
  enkryptWallet
127
127
  } from "./chunk-OLOIXTYS.js";
128
- import {
129
- argentWallet
130
- } from "./chunk-WSQ2YJO2.js";
131
128
  import {
132
129
  bifrostWallet
133
130
  } from "./chunk-A5N6B5UW.js";
@@ -140,6 +137,9 @@ import {
140
137
  import {
141
138
  bitverseWallet
142
139
  } from "./chunk-3HZRRP4Y.js";
140
+ import {
141
+ argentWallet
142
+ } from "./chunk-WSQ2YJO2.js";
143
143
  import {
144
144
  bloomWallet
145
145
  } from "./chunk-S27IADFU.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "6.14.23-next.2",
3
+ "version": "6.15.1",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -78,8 +78,8 @@
78
78
  "vitest": "^3.0.9"
79
79
  },
80
80
  "dependencies": {
81
- "@bluvo/react": "2.0.7",
82
- "@bluvo/sdk-ts": "2.0.7",
81
+ "@bluvo/react": "2.1.0",
82
+ "@bluvo/sdk-ts": "2.1.0",
83
83
  "@datadog/browser-logs": "5.22.0",
84
84
  "@number-flow/react": "^0.5.5",
85
85
  "@privy-io/js-sdk-core": "^0.21.0",
@@ -90,7 +90,6 @@
90
90
  "@vanilla-extract/dynamic": "2.1.0",
91
91
  "@vanilla-extract/sprinkles": "1.6.1",
92
92
  "@wagmi/core": "2.21.1",
93
- "bech32": "^2.0.0",
94
93
  "clsx": "2.1.1",
95
94
  "motion": "^12.0.11",
96
95
  "qrcode": "1.5.3",
@@ -99,12 +98,12 @@
99
98
  "ua-parser-js": "^1.0.37",
100
99
  "use-debounce": "^10.0.5",
101
100
  "uuid": "^9.0.1",
102
- "@funkit/api-base": "1.12.15-next.1",
103
- "@funkit/chains": "0.4.4-next.1",
104
- "@funkit/core": "2.3.60-next.2",
105
- "@funkit/fun-relay": "2.1.10-next.0",
106
- "@funkit/utils": "1.1.17-next.0",
107
- "@funkit/wagmi-tools": "3.0.83-next.2"
101
+ "@funkit/api-base": "1.12.15",
102
+ "@funkit/chains": "0.4.4",
103
+ "@funkit/core": "2.3.60",
104
+ "@funkit/fun-relay": "2.1.10",
105
+ "@funkit/utils": "1.1.17",
106
+ "@funkit/wagmi-tools": "3.0.83"
108
107
  },
109
108
  "repository": {
110
109
  "type": "git",