@jup-ag/plugin 1.0.2 → 1.0.3

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/dist/index.js CHANGED
@@ -85,7 +85,7 @@ var require_package = __commonJS({
85
85
  "package.json"(exports2, module2) {
86
86
  module2.exports = {
87
87
  name: "@jup-ag/plugin",
88
- version: "1.0.2",
88
+ version: "1.0.3",
89
89
  private: false,
90
90
  license: "MIT",
91
91
  scripts: {
@@ -1914,20 +1914,6 @@ var TransactionFee = ({ gasFee, gasless }) => {
1914
1914
  };
1915
1915
  var TransactionFee_default = TransactionFee;
1916
1916
 
1917
- // src/components/PriceInfo/index.tsx
1918
- var import_react_query5 = require("@tanstack/react-query");
1919
-
1920
- // src/queries/queries.ts
1921
- var import_react_query4 = require("@tanstack/react-query");
1922
- var UltraQueries = {
1923
- routers: (0, import_react_query4.queryOptions)({
1924
- queryKey: ["routers"],
1925
- queryFn: ultraSwapService.getRouters,
1926
- gcTime: Infinity,
1927
- staleTime: Infinity
1928
- })
1929
- };
1930
-
1931
1917
  // src/components/PriceInfo/index.tsx
1932
1918
  var import_jsx_runtime24 = require("react/jsx-runtime");
1933
1919
  var Index = ({
@@ -1945,14 +1931,6 @@ var Index = ({
1945
1931
  // If there's no selectedRoute, we will use first route value to temporarily calculate
1946
1932
  outputDecimal: toTokenInfo.decimals
1947
1933
  };
1948
- const { data: routerInfo } = (0, import_react_query5.useQuery)(__spreadProps(__spreadValues({}, UltraQueries.routers), {
1949
- select: (data) => {
1950
- if (!quoteResponse) {
1951
- return null;
1952
- }
1953
- return data.find((router2) => router2.id === quoteResponse.quoteResponse.router);
1954
- }
1955
- }));
1956
1934
  const priceImpact = formatNumber.format(
1957
1935
  new import_decimal6.default((quoteResponse == null ? void 0 : quoteResponse.quoteResponse.priceImpactPct) || 0).mul(100).toDP(2)
1958
1936
  );
@@ -1996,13 +1974,6 @@ var Index = ({
1996
1974
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Price Impact" }) }),
1997
1975
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-primary-text", children: priceImpactText })
1998
1976
  ] }),
1999
- router && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between text-xs", children: [
2000
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-primary-text/50", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Router" }) }),
2001
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center gap-1", children: routerInfo && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2002
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("img", { src: routerInfo.icon, alt: quoteResponse.quoteResponse.router, width: 10, height: 10 }),
2003
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-primary-text", children: routerInfo.name })
2004
- ] }) })
2005
- ] }),
2006
1977
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center justify-between text-xs", children: [
2007
1978
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-primary-text/50", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Fee" }) }),
2008
1979
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "text-primary-text", children: [
@@ -2059,7 +2030,7 @@ var SwitchPairButton_default = SwitchPairButton;
2059
2030
  var import_decimal7 = __toESM(require("decimal.js"));
2060
2031
 
2061
2032
  // src/components/JupShield.tsx
2062
- var import_react_query6 = require("@tanstack/react-query");
2033
+ var import_react_query4 = require("@tanstack/react-query");
2063
2034
 
2064
2035
  // src/hooks/useMobile.ts
2065
2036
  var import_react15 = require("react");
@@ -2317,12 +2288,12 @@ var Warnings = ({
2317
2288
  };
2318
2289
  var JupShield = ({ tokenAddress }) => {
2319
2290
  const isMobile = useMobile();
2320
- const { data, isFetching } = (0, import_react_query6.useQuery)({
2291
+ const { data, isFetching } = (0, import_react_query4.useQuery)({
2321
2292
  queryKey: ["shield", tokenAddress],
2322
2293
  queryFn: () => ultraSwapService.getShield([tokenAddress]),
2323
2294
  gcTime: 5 * 6e4,
2324
2295
  staleTime: 5 * 6e4,
2325
- placeholderData: import_react_query6.keepPreviousData,
2296
+ placeholderData: import_react_query4.keepPreviousData,
2326
2297
  select: (data2) => {
2327
2298
  const warnings = data2.warnings[tokenAddress];
2328
2299
  return {
@@ -2377,7 +2348,7 @@ var JupShield_default = JupShield;
2377
2348
 
2378
2349
  // src/queries/useUltraSwapMutation.ts
2379
2350
  var import_wallet_adapter2 = require("@jup-ag/wallet-adapter");
2380
- var import_react_query7 = require("@tanstack/react-query");
2351
+ var import_react_query5 = require("@tanstack/react-query");
2381
2352
  var import_buffer = require("buffer");
2382
2353
  var import_web34 = require("@solana/web3.js");
2383
2354
 
@@ -2403,7 +2374,7 @@ var UltraSwapError = class extends Error {
2403
2374
  };
2404
2375
  function useUltraSwapMutation() {
2405
2376
  const { wallet, signTransaction } = useWalletPassThrough();
2406
- return (0, import_react_query7.useMutation)({
2377
+ return (0, import_react_query5.useMutation)({
2407
2378
  mutationFn: (_0) => __async(this, [_0], function* ({
2408
2379
  setTxStatus,
2409
2380
  setLastSwapResult,
@@ -3029,9 +3000,9 @@ var CheckedBadge = ({ width = 24, height = 24 }) => {
3029
3000
  var CheckedBadge_default = CheckedBadge;
3030
3001
 
3031
3002
  // src/queries/useLstApy.ts
3032
- var import_react_query8 = require("@tanstack/react-query");
3003
+ var import_react_query6 = require("@tanstack/react-query");
3033
3004
  function useLstApyFetcher() {
3034
- return (0, import_react_query8.useQuery)({
3005
+ return (0, import_react_query6.useQuery)({
3035
3006
  queryKey: ["lst-apy"],
3036
3007
  queryFn: () => __async(this, null, function* () {
3037
3008
  const lstApy = yield fetch(`https://worker.jup.ag/lst-apys`);
@@ -3039,14 +3010,14 @@ function useLstApyFetcher() {
3039
3010
  return apyResult;
3040
3011
  }),
3041
3012
  retry: 3,
3042
- placeholderData: import_react_query8.keepPreviousData,
3013
+ placeholderData: import_react_query6.keepPreviousData,
3043
3014
  staleTime: 3e5
3044
3015
  // 5m
3045
3016
  });
3046
3017
  }
3047
3018
 
3048
3019
  // src/components/FormPairRow.tsx
3049
- var import_react_query9 = require("@tanstack/react-query");
3020
+ var import_react_query7 = require("@tanstack/react-query");
3050
3021
  var import_jsx_runtime39 = require("react/jsx-runtime");
3051
3022
  var PAIR_ROW_HEIGHT = 72;
3052
3023
  var LSTTag = ({ mintAddress }) => {
@@ -3119,7 +3090,7 @@ var FormPairRow = (props) => {
3119
3090
  showExplorer = true,
3120
3091
  enableUnknownTokenWarning = true
3121
3092
  } = props;
3122
- const queryClient = (0, import_react_query9.useQueryClient)();
3093
+ const queryClient = (0, import_react_query7.useQueryClient)();
3123
3094
  const onClick = import_react21.default.useCallback(() => {
3124
3095
  queryClient.setQueryData([...ASSET_QUERY_KEY, item.id], [item]);
3125
3096
  onSubmit(item);
@@ -3159,12 +3130,12 @@ var FormPairRow_default = FormPairRow;
3159
3130
 
3160
3131
  // src/hooks/useSearch.ts
3161
3132
  var import_react22 = require("react");
3162
- var import_react_query10 = require("@tanstack/react-query");
3133
+ var import_react_query8 = require("@tanstack/react-query");
3163
3134
  var CHUNK_SIZE = 100;
3164
3135
  var useSearch = (mintAddresses, options = {}) => {
3165
3136
  var _a2, _b;
3166
3137
  const mintAddressesString = (0, import_react22.useMemo)(() => mintAddresses.join(","), [mintAddresses]);
3167
- return (0, import_react_query10.useQuery)({
3138
+ return (0, import_react_query8.useQuery)({
3168
3139
  queryKey: ["search", mintAddressesString],
3169
3140
  queryFn: () => __async(void 0, null, function* () {
3170
3141
  if (mintAddresses.length === 0) {
@@ -3895,14 +3866,14 @@ var ContextProvider = (props) => {
3895
3866
  };
3896
3867
 
3897
3868
  // src/index.tsx
3898
- var import_react_query11 = require("@tanstack/react-query");
3869
+ var import_react_query9 = require("@tanstack/react-query");
3899
3870
  var import_react29 = require("react");
3900
3871
  var import_jsx_runtime49 = require("react/jsx-runtime");
3901
3872
  var App = () => {
3902
- const queryClient = (0, import_react29.useMemo)(() => new import_react_query11.QueryClient(), []);
3873
+ const queryClient = (0, import_react29.useMemo)(() => new import_react_query9.QueryClient(), []);
3903
3874
  const [props] = (0, import_jotai4.useAtom)(appProps);
3904
3875
  if (!props) return null;
3905
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react_query11.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ContextProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WalletPassthroughProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ScreenProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Jupiter_default, __spreadValues({}, props)) }) }) })) });
3876
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react_query9.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ContextProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WalletPassthroughProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ScreenProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Jupiter_default, __spreadValues({}, props)) }) }) })) });
3906
3877
  };
3907
3878
  var RenderJupiter = () => {
3908
3879
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_jotai4.Provider, { store: typeof window !== "undefined" ? window.Jupiter.store : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(App, {}) });