@funkit/connect 7.1.0-next.3 → 7.1.0-next.7

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,5 +1,6 @@
1
1
  import type { TFunction } from 'i18next';
2
2
  import type { Address } from 'viem';
3
+ import { type Config } from 'wagmi';
3
4
  import type { ErrorNotification } from '~/components/FunNotification/FunNotification';
4
5
  export interface CheckoutConfirmationError extends ErrorNotification {
5
6
  durationMs?: number;
@@ -11,7 +12,8 @@ export declare enum ConfirmationErrorCode {
11
12
  RISK_ERROR = "RISK_ERROR",
12
13
  SIGNATURE_DENIED = "SIGNATURE_DENIED",
13
14
  SWITCH_CHAIN_ERROR = "SWITCH_CHAIN_ERROR",
14
- WALLET_CLIENT_UNDEFINED = "WALLET_CLIENT_UNDEFINED"
15
+ WALLET_CLIENT_UNDEFINED = "WALLET_CLIENT_UNDEFINED",
16
+ INSUFFICIENT_GAS = "INSUFFICIENT_GAS"
15
17
  }
16
18
  interface UseCheckoutConfirmationOptions {
17
19
  onError(error: CheckoutConfirmationError): void;
@@ -23,6 +25,6 @@ interface UseCheckoutConfirmationResult {
23
25
  handleCheckoutConfirmation(): Promise<void>;
24
26
  isConfirming: boolean;
25
27
  }
26
- export declare function toCheckoutConfirmationError(t: TFunction, error: unknown): CheckoutConfirmationError;
28
+ export declare function toCheckoutConfirmationError(t: TFunction, error: unknown, wagmiConfig: Config): Promise<CheckoutConfirmationError>;
27
29
  export declare function useCheckoutConfirmation({ onError, onSuccess, }: UseCheckoutConfirmationOptions): UseCheckoutConfirmationResult;
28
30
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { ExchangeRates } from '@funkit/api-base';
2
2
  import React from 'react';
3
- import type { FunkitTextCustomizationsConfig } from '~/providers/FunkitConfigContext';
3
+ import { type FunkitTextCustomizationsConfig } from '~/providers/FunkitConfigContext';
4
4
  import type { AssetHoldingsItem } from '~/utils/assets';
5
5
  import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
6
6
  import { FunCheckoutStep, type ModalStepComponentProps } from '../stepTransition';
@@ -23,6 +23,7 @@ export interface AmountInputInitOptions {
23
23
  fiatCurrencyExchangeRate: number | undefined;
24
24
  /** Whether meld is enabled */
25
25
  meldEnabled: boolean;
26
+ apiKey: string;
26
27
  }
27
28
  export interface AmountInputState {
28
29
  /** Current amount, in target asset. Undefined if input is empty */
@@ -105,6 +106,6 @@ export type AmountInputError = {
105
106
  * Return half the balance and round up to nearest 10, 100, 1000 etc
106
107
  */
107
108
  export declare function calcInitialFiatAmount(balance: number): number;
108
- export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethodInfo, quickOptions, sourceHolding, unitPrice: realUnitPrice, fiatCurrencyExchangeRate, meldEnabled, }: AmountInputInitOptions): AmountInputState;
109
+ export declare function initializeState({ checkoutConfig, defaultAmount, fiatCurrency, locale, maxUsd, minUsd, paymentMethodInfo, quickOptions, sourceHolding, unitPrice: realUnitPrice, fiatCurrencyExchangeRate, meldEnabled, apiKey, }: AmountInputInitOptions): AmountInputState;
109
110
  export declare function reduceState(state: AmountInputState, action: AmountInputAction): AmountInputState;
110
111
  export declare function getDerivedState(state: AmountInputState, targetAssetTicker: string): AmountInputDerivedState;
@@ -95,6 +95,7 @@ export type CheckoutModalState<S extends FunCheckoutStep = FunCheckoutStep> = {
95
95
  [FunCheckoutStep.BROKERAGE_SUCCESS]: BrokerageSuccessState;
96
96
  }[T] & {
97
97
  step: T;
98
+ previousStep?: FunCheckoutStep | null;
98
99
  };
99
100
  }[S];
100
101
  export type NextPayload<S extends FunCheckoutStep = FunCheckoutStep> = {
@@ -92,9 +92,6 @@ import {
92
92
  import {
93
93
  imTokenWallet
94
94
  } from "./chunk-COZ7MIQS.js";
95
- import {
96
- ledgerWallet
97
- } from "./chunk-BRBKM4PW.js";
98
95
  import {
99
96
  injectedWallet
100
97
  } from "./chunk-XWUJE7MW.js";
@@ -102,8 +99,11 @@ import {
102
99
  kresusWallet
103
100
  } from "./chunk-MJXPRJZT.js";
104
101
  import {
105
- bloomWallet
106
- } from "./chunk-S27IADFU.js";
102
+ ledgerWallet
103
+ } from "./chunk-BRBKM4PW.js";
104
+ import {
105
+ bybitWallet
106
+ } from "./chunk-2STUC6QL.js";
107
107
  import {
108
108
  clvWallet
109
109
  } from "./chunk-M3NZ6R2E.js";
@@ -125,12 +125,12 @@ import {
125
125
  import {
126
126
  enkryptWallet
127
127
  } from "./chunk-OLOIXTYS.js";
128
- import {
129
- bifrostWallet
130
- } from "./chunk-A5N6B5UW.js";
131
128
  import {
132
129
  argentWallet
133
130
  } from "./chunk-WSQ2YJO2.js";
131
+ import {
132
+ bifrostWallet
133
+ } from "./chunk-A5N6B5UW.js";
134
134
  import {
135
135
  bitgetWallet
136
136
  } from "./chunk-TDAVGY5F.js";
@@ -140,13 +140,13 @@ import {
140
140
  import {
141
141
  bitverseWallet
142
142
  } from "./chunk-3HZRRP4Y.js";
143
+ import {
144
+ bloomWallet
145
+ } from "./chunk-S27IADFU.js";
146
+ import "./chunk-23WIEY36.js";
143
147
  import {
144
148
  braveWallet
145
149
  } from "./chunk-BPZ2XJO2.js";
146
- import {
147
- bybitWallet
148
- } from "./chunk-2STUC6QL.js";
149
- import "./chunk-23WIEY36.js";
150
150
  import "./chunk-DNSG5Q7V.js";
151
151
  export {
152
152
  argentWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "7.1.0-next.3",
3
+ "version": "7.1.0-next.7",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -101,7 +101,7 @@
101
101
  "use-debounce": "^10.0.5",
102
102
  "uuid": "^9.0.1",
103
103
  "@funkit/api-base": "1.12.22-next.1",
104
- "@funkit/chains": "0.5.2-next.0",
104
+ "@funkit/chains": "0.5.2-next.1",
105
105
  "@funkit/fun-relay": "2.1.16-next.2",
106
106
  "@funkit/utils": "1.1.22-next.0"
107
107
  },