@funkit/connect 6.14.23-next.1 → 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: "";
@@ -217,7 +213,23 @@ export declare const flagConfig: {
217
213
  readonly values: string[];
218
214
  }];
219
215
  readonly value: true;
220
- }, Override<boolean>];
216
+ }, Override<boolean>, {
217
+ readonly if_all: [{
218
+ readonly pct: 10;
219
+ readonly type: "pctRollout";
220
+ readonly key: "userId";
221
+ }, {
222
+ readonly key: "apiKey";
223
+ readonly type: "isAnyOf";
224
+ readonly values: ["Y53dikxXdT4E3afI1l8BMBSWgyhKvf65k6Dut1k6"];
225
+ }];
226
+ readonly if_any: [{
227
+ readonly pct: 2;
228
+ readonly type: "pctRollout";
229
+ readonly key: "userId";
230
+ }];
231
+ readonly value: true;
232
+ }];
221
233
  };
222
234
  readonly enable_meld_payment: {
223
235
  readonly type: "boolean";
@@ -11,12 +11,12 @@ import {
11
11
  import {
12
12
  subWallet
13
13
  } from "./chunk-JWFF4AAL.js";
14
- import {
15
- tahoWallet
16
- } from "./chunk-ZZZRUXZE.js";
17
14
  import {
18
15
  talismanWallet
19
16
  } from "./chunk-DRO6WYMM.js";
17
+ import {
18
+ tahoWallet
19
+ } from "./chunk-ZZZRUXZE.js";
20
20
  import {
21
21
  tokenPocketWallet
22
22
  } from "./chunk-2L43XSW3.js";
@@ -62,45 +62,45 @@ import {
62
62
  import {
63
63
  metaMaskWallet
64
64
  } from "./chunk-2HYNUNAS.js";
65
- import {
66
- oktoWallet
67
- } from "./chunk-ADIXAKUL.js";
68
65
  import {
69
66
  mewWallet
70
67
  } from "./chunk-OL5ZO7E4.js";
71
68
  import {
72
- okxWallet
73
- } from "./chunk-TDIEHTMB.js";
69
+ oktoWallet
70
+ } from "./chunk-ADIXAKUL.js";
74
71
  import {
75
72
  omniWallet
76
73
  } from "./chunk-7CUY5G6R.js";
77
74
  import {
78
- oneKeyWallet
79
- } from "./chunk-SHBUZ7U7.js";
75
+ okxWallet
76
+ } from "./chunk-TDIEHTMB.js";
80
77
  import {
81
78
  oneInchWallet
82
79
  } from "./chunk-OESTDX6I.js";
80
+ import {
81
+ oneKeyWallet
82
+ } from "./chunk-SHBUZ7U7.js";
83
83
  import {
84
84
  foxWallet
85
85
  } from "./chunk-7QONTUXT.js";
86
- import {
87
- frontierWallet
88
- } from "./chunk-TCAGNB4B.js";
89
86
  import {
90
87
  frameWallet
91
88
  } from "./chunk-IFON7E6U.js";
89
+ import {
90
+ frontierWallet
91
+ } from "./chunk-TCAGNB4B.js";
92
92
  import {
93
93
  gateWallet
94
94
  } from "./chunk-FKJJQNKX.js";
95
95
  import {
96
96
  imTokenWallet
97
97
  } from "./chunk-COZ7MIQS.js";
98
- import {
99
- injectedWallet
100
- } from "./chunk-XWUJE7MW.js";
101
98
  import {
102
99
  kresusWallet
103
100
  } from "./chunk-MJXPRJZT.js";
101
+ import {
102
+ injectedWallet
103
+ } from "./chunk-XWUJE7MW.js";
104
104
  import {
105
105
  bybitWallet
106
106
  } from "./chunk-2STUC6QL.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.1",
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.0",
104
- "@funkit/core": "2.3.60-next.1",
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.1"
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",