@funkit/connect 12.20.0 → 12.21.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/clients/{chunk-N46CL4ZT.js → chunk-4NWQR25X.js} +1 -1
  3. package/dist/clients/{chunk-VFKEUHZT.js → chunk-6XJV626L.js} +1 -1
  4. package/dist/clients/chunk-B67ESBGC.js +108 -0
  5. package/dist/clients/{chunk-TLFE74BL.js → chunk-DAMICUCH.js} +3 -3
  6. package/dist/clients/{chunk-2BBOZQLZ.js → chunk-FIJU6HZM.js} +1 -1
  7. package/dist/clients/{chunk-TFIJZTGQ.js → chunk-MTKOZB6U.js} +1 -1
  8. package/dist/clients/{chunk-5NYKSTGH.js → chunk-S4SMCBQ4.js} +1 -1
  9. package/dist/clients/{chunk-Y7ONHWCW.js → chunk-T4Q43DNC.js} +2 -2
  10. package/dist/clients/{chunk-R5VAX6YA.js → chunk-YSQX5Z3F.js} +41 -25
  11. package/dist/clients/fanatics.d.ts +5 -7
  12. package/dist/clients/fanatics.js +4 -4
  13. package/dist/clients/internal/nado/withdrawalCallback.js +4 -4
  14. package/dist/clients/internal/nado/withdrawalErrors.js +2 -2
  15. package/dist/clients/internal/nado/withdrawalForm.js +4 -4
  16. package/dist/clients/internal/nado/withdrawalStatus.js +4 -4
  17. package/dist/clients/lighter.js +5 -5
  18. package/dist/clients/lighterRh.js +1 -1
  19. package/dist/clients/mallard.js +3 -3
  20. package/dist/clients/nado.js +4 -4
  21. package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -3
  22. package/dist/clients/polymarket/index.js +3 -3
  23. package/dist/clients/polymarket/polymarket.d.ts +22 -22
  24. package/dist/clients/polymarket/polymarket.js +2 -2
  25. package/dist/components/Avatar/emojiAvatarForAddress.d.ts +35 -35
  26. package/dist/components/Box/Box.d.ts +63 -63
  27. package/dist/components/ConnectButton/ConnectButton.d.ts +16 -15
  28. package/dist/components/Dialog/Dialog.d.ts +12 -4
  29. package/dist/components/Dialog/hooks.d.ts +3 -3
  30. package/dist/components/FreeUsdcBanner/FreeUsdcBanner.d.ts +2 -2
  31. package/dist/components/FunBottomBar/FunBottomBar.d.ts +3 -1
  32. package/dist/components/FunInfoBanner/InfoBanner.d.ts +1 -1
  33. package/dist/components/FunInput/FunInput.d.ts +1 -1
  34. package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
  35. package/dist/components/FunTooltip/FunTooltip.d.ts +2 -2
  36. package/dist/components/HighPriceImpactAlert/HighPriceImpactAlert.d.ts +7 -0
  37. package/dist/components/Icons/GreenRoundCheckmark.d.ts +2 -1
  38. package/dist/components/Icons/StatusIcons.css.d.ts +2 -2
  39. package/dist/components/Icons/StatusIcons.d.ts +2 -2
  40. package/dist/components/LargeAmountInput/LargeAmountInput.d.ts +3 -1
  41. package/dist/components/ModalSelection/ModalSelection.d.ts +4 -4
  42. package/dist/components/TokenSwapWidget/TokenSwapCard/TokenSwapCard.d.ts +5 -2
  43. package/dist/components/TokenSwapWidget/TokenSwapWidget.d.ts +2 -0
  44. package/dist/consts/checkout.d.ts +8 -8
  45. package/dist/consts/polymarket.d.ts +2 -2
  46. package/dist/consts/quote.d.ts +25 -15
  47. package/dist/css/cssObjectFromTheme.d.ts +1 -1
  48. package/dist/css/sprinkles.css.d.ts +78 -78
  49. package/dist/domains/bridge.d.ts +1 -1
  50. package/dist/domains/convert/assets.d.ts +6 -0
  51. package/dist/domains/convert/screen.d.ts +4 -0
  52. package/dist/domains/priceImpact.d.ts +14 -0
  53. package/dist/hooks/queries/useMeldLimits.d.ts +45 -45
  54. package/dist/hooks/queries/useWithdrawalQuote.d.ts +62 -62
  55. package/dist/hooks/track/useTrack.d.ts +1 -1
  56. package/dist/hooks/useCheckoutQuoteNotification.d.ts +3 -3
  57. package/dist/hooks/useConvertBalances.d.ts +1 -1
  58. package/dist/hooks/useConvertQuote.d.ts +1 -1
  59. package/dist/hooks/useDynamicRoutes.d.ts +1 -1
  60. package/dist/hooks/useFrogAccount.d.ts +77 -77
  61. package/dist/hooks/useIsomorphicEffect.d.ts +2 -2
  62. package/dist/hooks/usePaymentMethodIcon.d.ts +1 -1
  63. package/dist/hooks/usePaymentSources.d.ts +1 -1
  64. package/dist/hooks/usePolymarketAccountBalances.d.ts +1 -1
  65. package/dist/index.d.ts +2 -0
  66. package/dist/index.js +1437 -1157
  67. package/dist/modals/CheckoutModal/Convert/ConvertChainRail.d.ts +13 -0
  68. package/dist/modals/CheckoutModal/Convert/ConvertSelectDestinationStep.d.ts +6 -4
  69. package/dist/modals/CheckoutModal/SwappedIframe/SwappedIframe.d.ts +13 -2
  70. package/dist/modals/PolymarketPerpsTransfer/PolymarketPerpsTransferScreen.d.ts +6 -1
  71. package/dist/modals/PolymarketPerpsTransfer/usePerpsTransferForm.d.ts +6 -1
  72. package/dist/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.css.d.ts +1 -1
  73. package/dist/modals/WithdrawalModal/LighterWithdrawal.d.ts +1 -1
  74. package/dist/modals/WithdrawalModal/useMultiSourceWithdrawal.d.ts +1 -1
  75. package/dist/providers/FunkitCheckoutContext/types.d.ts +3 -0
  76. package/dist/providers/FunkitStatsigProvider.d.ts +1 -1
  77. package/dist/providers/GeneralWalletProvider.d.ts +21 -21
  78. package/dist/providers/ModalSizeContext.d.ts +4 -4
  79. package/dist/themes/baseTheme.d.ts +1 -1
  80. package/dist/themes/darkTheme.d.ts +6 -4
  81. package/dist/themes/lightTheme.d.ts +6 -4
  82. package/dist/utils/checkout.d.ts +1 -1
  83. package/dist/utils/customer.d.ts +96 -96
  84. package/dist/utils/datadogBrowserLogsTransport.d.ts +11 -5
  85. package/dist/utils/datadogPageExit.d.ts +5 -0
  86. package/dist/utils/funError.d.ts +26 -0
  87. package/dist/utils/funLogger.d.ts +2 -1
  88. package/dist/utils/shakeElement.d.ts +7 -0
  89. package/dist/wallets/computeWalletConnectMetaData.d.ts +1 -1
  90. package/dist/wallets/walletConnectors/index.js +34 -34
  91. package/package.json +9 -9
  92. package/dist/clients/chunk-GTPMJGCF.js +0 -52
  93. package/dist/modals/CheckoutModal/Convert/ConvertChainPills.d.ts +0 -14
@@ -1,16 +1,22 @@
1
- import type { LogRecord, LogTransport, TrackingConsent } from '@funkit/connect-core';
1
+ import { type DatadogRouteDecision, type LogRecord, type LogTransport, type TrackingConsent } from '@funkit/connect-core';
2
2
  /**
3
3
  * Web `LogTransport` backed by `@datadog/browser-logs`. Owns Datadog
4
4
  * initialization, global-context/consent wiring, and the browser-only emit.
5
5
  *
6
6
  * This is the platform half of the logger that stays in `@funkit/connect` when
7
7
  * `FunLogger` moves to `@funkit/connect-core`; React Native ships a Datadog
8
- * React Native transport (`@datadog/mobile-react-native`) instead. Constructing
9
- * it runs `datadogLogs.init` once (the global singleton does this on import,
10
- * matching prior behavior).
8
+ * React Native transport (`@datadog/mobile-react-native`) instead.
9
+ *
10
+ * `datadogLogs.init` runs only from `setRoute`, once a route is set. Until
11
+ * then the Datadog SDK queues every log in memory and sends nothing.
11
12
  */
12
13
  export declare class DatadogBrowserLogsTransport implements LogTransport {
13
- constructor();
14
+ private decision;
15
+ /**
16
+ * Starts Datadog on the first call. A later call switches the route for
17
+ * every request after it: Datadog asks for the request URL each time.
18
+ */
19
+ setRoute(decision: DatadogRouteDecision): void;
14
20
  setEnv(environment: string): void;
15
21
  setTrackingConsent(consent: TrackingConsent): void;
16
22
  log({ level, title, context, error }: LogRecord): void;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Calls `onExit` when the page is closing or being hidden, the last moments a
3
+ * browser reliably runs JavaScript. Returns an unsubscribe function.
4
+ */
5
+ export declare function subscribeToPageExit(onExit: () => void): () => void;
@@ -0,0 +1,26 @@
1
+ type ErrorConstructorArgs = ConstructorParameters<ErrorConstructor>;
2
+ /**
3
+ * The options `Error` itself accepts, resolved against the integrator's
4
+ * TypeScript lib: `ErrorOptions` (with `cause`) from ES2022, `never` before it.
5
+ */
6
+ export type FunErrorOptions = 2 extends ErrorConstructorArgs['length'] ? NonNullable<ErrorConstructorArgs[1]> : never;
7
+ /**
8
+ * An error whose `message` is safe to show to the user. Throw it from an
9
+ * integrator callback (for example a Polymarket account's `transfer`) to show
10
+ * `message` in place of the SDK's generic error copy. The integrator owns the
11
+ * wording and localization. Pass the underlying error as `cause` so it reaches
12
+ * the logs.
13
+ *
14
+ * @example
15
+ * throw new FunError(t('walletDisconnected'), { cause: error })
16
+ */
17
+ export declare class FunError extends Error {
18
+ constructor(message: string, options?: FunErrorOptions);
19
+ }
20
+ export declare function isFunError(error: unknown): error is FunError;
21
+ /**
22
+ * The user-facing message of a {@link FunError}, or `null` for any other
23
+ * error or an empty message (the caller then shows its generic copy).
24
+ */
25
+ export declare function getFunErrorDisplayMessage(error: unknown): string | null;
26
+ export {};
@@ -1,3 +1,4 @@
1
1
  import { FunLogger } from '@funkit/connect-core';
2
2
  declare const logger: FunLogger;
3
- export { logger, FunLogger };
3
+ declare const datadogRouter: import("@funkit/connect-core").DatadogRouter;
4
+ export { logger, FunLogger, datadogRouter };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shakes `element` side to side, e.g. to turn down a press. Does nothing
3
+ * under reduced motion, during a shake, or without the Web Animations API.
4
+ * - Not a CSS class on a timer: a timer started at the commit can remove the
5
+ * class before a slow device paints the first frame.
6
+ */
7
+ export declare function shakeElement(element: HTMLElement): void;
@@ -5,5 +5,5 @@ interface ComputeMetaDataParameters {
5
5
  appUrl?: string;
6
6
  appIcon?: string;
7
7
  }
8
- export declare const computeWalletConnectMetaData: ({ appName, appDescription, appUrl, appIcon, }: ComputeMetaDataParameters) => FunkitConnectWalletConnectParameters["metadata"];
8
+ export declare const computeWalletConnectMetaData: ({ appName, appDescription, appUrl, appIcon, }: ComputeMetaDataParameters) => FunkitConnectWalletConnectParameters['metadata'];
9
9
  export {};
@@ -1,31 +1,31 @@
1
1
  "use client";
2
- import {
3
- zealWallet
4
- } from "./chunk-GLX5FULK.js";
5
2
  import {
6
3
  xdefiWallet
7
4
  } from "./chunk-HXX4PRE2.js";
5
+ import {
6
+ zealWallet
7
+ } from "./chunk-GLX5FULK.js";
8
8
  import {
9
9
  zerionWallet
10
10
  } from "./chunk-34B7OJNT.js";
11
11
  import {
12
12
  subWallet
13
13
  } from "./chunk-XODA5ESL.js";
14
- import {
15
- tahoWallet
16
- } from "./chunk-U74RFZOL.js";
17
14
  import {
18
15
  talismanWallet
19
16
  } from "./chunk-IAYYWCVB.js";
17
+ import {
18
+ tahoWallet
19
+ } from "./chunk-U74RFZOL.js";
20
20
  import {
21
21
  tokenPocketWallet
22
22
  } from "./chunk-NXWG6FG2.js";
23
- import {
24
- trustWallet
25
- } from "./chunk-SR5CZR3L.js";
26
23
  import {
27
24
  tokenaryWallet
28
25
  } from "./chunk-TPM5PUJD.js";
26
+ import {
27
+ trustWallet
28
+ } from "./chunk-SR5CZR3L.js";
29
29
  import {
30
30
  uniswapWallet
31
31
  } from "./chunk-UNDWHCDH.js";
@@ -33,8 +33,8 @@ import {
33
33
  walletConnectWallet
34
34
  } from "./chunk-DUX4XCDV.js";
35
35
  import {
36
- oneKeyWallet
37
- } from "./chunk-KN32ITJ7.js";
36
+ phantomWallet
37
+ } from "./chunk-Q27YVDDH.js";
38
38
  import {
39
39
  rabbyWallet
40
40
  } from "./chunk-RQ2GXOJL.js";
@@ -44,12 +44,12 @@ import {
44
44
  import {
45
45
  ramperWallet
46
46
  } from "./chunk-GPXIBTWN.js";
47
- import {
48
- safeWallet
49
- } from "./chunk-IR3PJMVM.js";
50
47
  import {
51
48
  roninWallet
52
49
  } from "./chunk-IA5432IR.js";
50
+ import {
51
+ safeWallet
52
+ } from "./chunk-IR3PJMVM.js";
53
53
  import {
54
54
  safeheronWallet
55
55
  } from "./chunk-UN3ONVNC.js";
@@ -65,12 +65,12 @@ import {
65
65
  import {
66
66
  mewWallet
67
67
  } from "./chunk-DSPQXAB2.js";
68
- import {
69
- okxWallet
70
- } from "./chunk-CU5J53XR.js";
71
68
  import {
72
69
  oktoWallet
73
70
  } from "./chunk-V4M3SNPS.js";
71
+ import {
72
+ okxWallet
73
+ } from "./chunk-CU5J53XR.js";
74
74
  import {
75
75
  omniWallet
76
76
  } from "./chunk-2TAUCVX7.js";
@@ -78,20 +78,20 @@ import {
78
78
  oneInchWallet
79
79
  } from "./chunk-GFS2AVAH.js";
80
80
  import {
81
- phantomWallet
82
- } from "./chunk-Q27YVDDH.js";
83
- import {
84
- dawnWallet
85
- } from "./chunk-LV6YV3DE.js";
81
+ oneKeyWallet
82
+ } from "./chunk-KN32ITJ7.js";
86
83
  import {
87
84
  foxWallet
88
85
  } from "./chunk-U52QO5HF.js";
89
86
  import {
90
- frontierWallet
91
- } from "./chunk-IWOMSW64.js";
87
+ enkryptWallet
88
+ } from "./chunk-Z6LDN2AN.js";
92
89
  import {
93
90
  frameWallet
94
91
  } from "./chunk-B572YIAQ.js";
92
+ import {
93
+ frontierWallet
94
+ } from "./chunk-IWOMSW64.js";
95
95
  import {
96
96
  gateWallet
97
97
  } from "./chunk-YRMBR6NA.js";
@@ -122,24 +122,27 @@ import {
122
122
  import {
123
123
  customWallet
124
124
  } from "./chunk-VKM5M5UK.js";
125
+ import {
126
+ dawnWallet
127
+ } from "./chunk-LV6YV3DE.js";
125
128
  import {
126
129
  desigWallet
127
130
  } from "./chunk-DFHP75HV.js";
128
131
  import {
129
- enkryptWallet
130
- } from "./chunk-Z6LDN2AN.js";
132
+ argentWallet
133
+ } from "./chunk-XSDTNMQY.js";
134
+ import {
135
+ bifrostWallet
136
+ } from "./chunk-ALGPGI6V.js";
131
137
  import {
132
138
  bitgetWallet
133
139
  } from "./chunk-HOCKAU5H.js";
134
140
  import {
135
- bifrostWallet
136
- } from "./chunk-ALGPGI6V.js";
141
+ bitskiWallet
142
+ } from "./chunk-NPITCCJE.js";
137
143
  import {
138
144
  bitverseWallet
139
145
  } from "./chunk-5AEWIKRA.js";
140
- import {
141
- argentWallet
142
- } from "./chunk-XSDTNMQY.js";
143
146
  import {
144
147
  bloomWallet
145
148
  } from "./chunk-PNHDOC77.js";
@@ -147,9 +150,6 @@ import "./chunk-AALSJCUR.js";
147
150
  import {
148
151
  braveWallet
149
152
  } from "./chunk-U2XXV45G.js";
150
- import {
151
- bitskiWallet
152
- } from "./chunk-NPITCCJE.js";
153
153
  import "./chunk-EYWGX5LT.js";
154
154
  import "./chunk-B454LLKJ.js";
155
155
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "12.20.0",
3
+ "version": "12.21.0",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -124,11 +124,11 @@
124
124
  "ua-parser-js": "^1.0.37",
125
125
  "use-debounce": "^10.0.5",
126
126
  "uuid": "^11.1.1",
127
- "@funkit/api-base": "9.1.2",
128
- "@funkit/fun-relay": "3.3.0",
129
- "@funkit/utils": "5.1.0",
130
- "@funkit/connect-core": "11.0.0",
131
- "@funkit/chains": "2.6.0"
127
+ "@funkit/api-base": "10.0.0",
128
+ "@funkit/chains": "2.6.1",
129
+ "@funkit/fun-relay": "3.3.1",
130
+ "@funkit/connect-core": "12.0.0",
131
+ "@funkit/utils": "5.1.1"
132
132
  },
133
133
  "repository": {
134
134
  "type": "git",
@@ -142,9 +142,9 @@
142
142
  "build:watch": "node build.js --watch",
143
143
  "dev": "pnpm build:watch & pnpm typegen:watch",
144
144
  "prebuild": "rm -rf dist && pnpm typegen",
145
- "typecheck": "pnpm tsc --noEmit",
146
- "typegen": "tsc --project tsconfig.build.json --emitDeclarationOnly && tsc-alias",
147
- "typegen:watch": "tsc --project tsconfig.build.json --emitDeclarationOnly --watch & tsc-alias --project tsconfig.build.json --watch",
145
+ "typecheck": "pnpm tsrs --noEmit",
146
+ "typegen": "tsrs --project tsconfig.build.json --emitDeclarationOnly && tsc-alias",
147
+ "typegen:watch": "tsrs --project tsconfig.build.json --emitDeclarationOnly --watch & tsc-alias --project tsconfig.build.json --watch",
148
148
  "lint": "oxlint",
149
149
  "lint:fix": "oxlint --fix",
150
150
  "test": "vitest",
@@ -1,52 +0,0 @@
1
- "use client";
2
-
3
- // src/utils/funLogger.ts
4
- import { FunLogger } from "@funkit/connect-core";
5
-
6
- // src/utils/datadogBrowserLogsTransport.ts
7
- import { datadogLogs } from "@datadog/browser-logs";
8
- var DDOG_CLIENT_TOKEN = "pub4f86c6be8c792cb48dc156a8c17d9a47";
9
- var DatadogBrowserLogsTransport = class {
10
- constructor() {
11
- datadogLogs.init({
12
- clientToken: DDOG_CLIENT_TOKEN,
13
- site: "datadoghq.com",
14
- forwardErrorsToLogs: false,
15
- sessionSampleRate: 100,
16
- service: "connect-sdk",
17
- silentMultipleInit: true
18
- });
19
- }
20
- setEnv(environment) {
21
- datadogLogs.setGlobalContextProperty("env", environment);
22
- }
23
- setTrackingConsent(consent) {
24
- datadogLogs.setTrackingConsent(consent);
25
- }
26
- log({ level, title, context, error }) {
27
- if (typeof window === "undefined") {
28
- return;
29
- }
30
- switch (level) {
31
- case "info":
32
- datadogLogs.logger.info(title, context);
33
- break;
34
- case "debug":
35
- datadogLogs.logger.debug(title, context);
36
- break;
37
- case "warn":
38
- datadogLogs.logger.warn(title, context, error);
39
- break;
40
- case "error":
41
- datadogLogs.logger.error(title, context, error);
42
- break;
43
- }
44
- }
45
- };
46
-
47
- // src/utils/funLogger.ts
48
- var logger = new FunLogger(new DatadogBrowserLogsTransport());
49
-
50
- export {
51
- logger
52
- };
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- interface ConvertChainPillsProps {
3
- chainIds: string[];
4
- activeChainId: string | undefined;
5
- onChange: (chainId: string) => void;
6
- }
7
- /**
8
- * The destination screen's chain picker: one pill per chain, icon only, with
9
- * the active one widened to show its name. The highlight slides to the picked
10
- * pill and the widths ease, like the modal's header tabs. Scrolls sideways
11
- * when the chains don't fit, e.g. eight on a phone.
12
- */
13
- export declare function ConvertChainPills({ chainIds, activeChainId, onChange, }: ConvertChainPillsProps): React.JSX.Element;
14
- export {};