@jup-ag/plugin 1.0.7 → 1.0.9
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/global.css +29 -0
- package/dist/index.css +22 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +71 -90
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
88
|
+
version: "1.0.9",
|
|
89
89
|
private: false,
|
|
90
90
|
license: "MIT",
|
|
91
91
|
scripts: {
|
|
@@ -1031,15 +1031,26 @@ var FormattedUltraQuoteResponse = (0, import_superstruct.type)({
|
|
|
1031
1031
|
|
|
1032
1032
|
// src/queries/useQuoteQuery.ts
|
|
1033
1033
|
var import_superstruct2 = require("superstruct");
|
|
1034
|
-
var useQuoteQuery = (
|
|
1035
|
-
const { amount } =
|
|
1034
|
+
var useQuoteQuery = (initialParams, shouldRefetch = true) => {
|
|
1035
|
+
const { amount } = initialParams;
|
|
1036
1036
|
return (0, import_react_query.useQuery)({
|
|
1037
|
-
queryKey: ["quote",
|
|
1037
|
+
queryKey: ["quote", initialParams],
|
|
1038
1038
|
queryFn: (_0) => __async(void 0, [_0], function* ({ signal }) {
|
|
1039
1039
|
if (Number(amount) === 0) {
|
|
1040
1040
|
return null;
|
|
1041
1041
|
}
|
|
1042
1042
|
try {
|
|
1043
|
+
let params = initialParams;
|
|
1044
|
+
if (params.excludeDexes && params.excludeDexes.length > 0) {
|
|
1045
|
+
params = __spreadProps(__spreadValues({}, initialParams), {
|
|
1046
|
+
excludeRouters: [
|
|
1047
|
+
"okx",
|
|
1048
|
+
"dflow",
|
|
1049
|
+
"hashflow",
|
|
1050
|
+
"jupiterz"
|
|
1051
|
+
]
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1043
1054
|
const response = yield ultraSwapService.getQuote(params, signal);
|
|
1044
1055
|
const quoteResponse = (0, import_superstruct2.create)(response, FormattedUltraQuoteResponse, "conver FormattedUltraQuoteResponse Error");
|
|
1045
1056
|
return {
|
|
@@ -1240,7 +1251,8 @@ var SwapContextProvider = (props) => {
|
|
|
1240
1251
|
taker: walletPublicKey,
|
|
1241
1252
|
swapMode: isToPairFocused.current ? "ExactOut" : "ExactIn",
|
|
1242
1253
|
referralAccount: formProps.referralAccount,
|
|
1243
|
-
referralFee: formProps.referralFee
|
|
1254
|
+
referralFee: formProps.referralFee,
|
|
1255
|
+
excludeDexes: formProps.excludeDexes
|
|
1244
1256
|
},
|
|
1245
1257
|
// Stop refetching when transaction is in progress
|
|
1246
1258
|
!txStatus
|
|
@@ -1518,7 +1530,7 @@ var Header = () => {
|
|
|
1518
1530
|
var Header_default = Header;
|
|
1519
1531
|
|
|
1520
1532
|
// src/components/screens/InitialScreen.tsx
|
|
1521
|
-
var
|
|
1533
|
+
var import_react25 = require("react");
|
|
1522
1534
|
|
|
1523
1535
|
// src/components/Form.tsx
|
|
1524
1536
|
var import_react19 = require("react");
|
|
@@ -2360,7 +2372,6 @@ var JupShield = ({ tokenAddress }) => {
|
|
|
2360
2372
|
var JupShield_default = JupShield;
|
|
2361
2373
|
|
|
2362
2374
|
// src/queries/useUltraSwapMutation.ts
|
|
2363
|
-
var import_wallet_adapter2 = require("@jup-ag/wallet-adapter");
|
|
2364
2375
|
var import_react_query5 = require("@tanstack/react-query");
|
|
2365
2376
|
var import_buffer = require("buffer");
|
|
2366
2377
|
var import_web34 = require("@solana/web3.js");
|
|
@@ -2441,8 +2452,9 @@ function useUltraSwapMutation() {
|
|
|
2441
2452
|
}),
|
|
2442
2453
|
onError: (error, variables) => __async(this, null, function* () {
|
|
2443
2454
|
const { setTxStatus, setLastSwapResult, quoteResponseMeta } = variables;
|
|
2444
|
-
|
|
2445
|
-
|
|
2455
|
+
const { name } = error;
|
|
2456
|
+
if (name === "WalletSignTransactionError") {
|
|
2457
|
+
const message = "Transaction cancelled";
|
|
2446
2458
|
setLastSwapResult({
|
|
2447
2459
|
swapResult: {
|
|
2448
2460
|
error: new TransactionError(message)
|
|
@@ -2460,7 +2472,7 @@ function useUltraSwapMutation() {
|
|
|
2460
2472
|
});
|
|
2461
2473
|
return;
|
|
2462
2474
|
}
|
|
2463
|
-
if ("json" in error) {
|
|
2475
|
+
if (typeof error === "object" && error !== null && "json" in error) {
|
|
2464
2476
|
const json = yield error.json();
|
|
2465
2477
|
setLastSwapResult({
|
|
2466
2478
|
swapResult: {
|
|
@@ -2472,7 +2484,14 @@ function useUltraSwapMutation() {
|
|
|
2472
2484
|
txid: json.txid || "",
|
|
2473
2485
|
status: "fail"
|
|
2474
2486
|
});
|
|
2487
|
+
return;
|
|
2475
2488
|
}
|
|
2489
|
+
setLastSwapResult({
|
|
2490
|
+
swapResult: {
|
|
2491
|
+
error: new TransactionError("Unknown error")
|
|
2492
|
+
},
|
|
2493
|
+
quoteReponse: quoteResponseMeta
|
|
2494
|
+
});
|
|
2476
2495
|
})
|
|
2477
2496
|
});
|
|
2478
2497
|
}
|
|
@@ -2817,7 +2836,7 @@ var Form = ({ setSelectPairSelector }) => {
|
|
|
2817
2836
|
var Form_default = Form;
|
|
2818
2837
|
|
|
2819
2838
|
// src/components/FormPairSelector.tsx
|
|
2820
|
-
var
|
|
2839
|
+
var import_react24 = require("react");
|
|
2821
2840
|
var import_react_virtualized_auto_sizer = __toESM(require("react-virtualized-auto-sizer"));
|
|
2822
2841
|
var import_react_window = require("react-window");
|
|
2823
2842
|
|
|
@@ -3040,6 +3059,7 @@ function useLstApyFetcher() {
|
|
|
3040
3059
|
// src/components/FormPairRow.tsx
|
|
3041
3060
|
var import_react_query7 = require("@tanstack/react-query");
|
|
3042
3061
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3062
|
+
var import_react22 = require("react");
|
|
3043
3063
|
var PAIR_ROW_HEIGHT = 72;
|
|
3044
3064
|
var LSTTag = ({ mintAddress }) => {
|
|
3045
3065
|
const { data: lstApy } = useLstApyFetcher();
|
|
@@ -3051,66 +3071,27 @@ var LSTTag = ({ mintAddress }) => {
|
|
|
3051
3071
|
}
|
|
3052
3072
|
return;
|
|
3053
3073
|
}, [lstApy, mintAddress]);
|
|
3074
|
+
if (!apy) return null;
|
|
3054
3075
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "rounded-md text-xxs leading-none transition-all py-0.5 px-1 text-primary/50 border border-primary/50 font-semibold", children: [
|
|
3055
3076
|
"LST ",
|
|
3056
3077
|
apy ? `${apy}%` : ""
|
|
3057
3078
|
] });
|
|
3058
3079
|
};
|
|
3059
3080
|
var MultiTags = ({ item }) => {
|
|
3081
|
+
var _a2, _b;
|
|
3060
3082
|
const { data: balances } = useBalances();
|
|
3061
|
-
const
|
|
3062
|
-
const
|
|
3063
|
-
const
|
|
3064
|
-
isVerified: false,
|
|
3065
|
-
isLST: false,
|
|
3066
|
-
// isUnknown: false,
|
|
3067
|
-
isToken2022: false,
|
|
3068
|
-
isFrozen: false
|
|
3069
|
-
});
|
|
3070
|
-
(0, import_react21.useEffect)(() => {
|
|
3071
|
-
if (isLoaded.current || isLoading.current) return;
|
|
3072
|
-
isLoading.current = true;
|
|
3073
|
-
setTimeout(() => {
|
|
3074
|
-
var _a2, _b;
|
|
3075
|
-
const result = {
|
|
3076
|
-
isVerified: checkIsStrictOrVerified(item),
|
|
3077
|
-
isLST: Boolean((_a2 = item.tags) == null ? void 0 : _a2.includes("lst")),
|
|
3078
|
-
// isUnknown: checkIsUnknownToken(item),
|
|
3079
|
-
isToken2022: Boolean(checkIsToken2022(item)),
|
|
3080
|
-
isFrozen: ((_b = balances == null ? void 0 : balances[item.id]) == null ? void 0 : _b.isFrozen) || false
|
|
3081
|
-
};
|
|
3082
|
-
setRenderedTag(result);
|
|
3083
|
-
isLoading.current = false;
|
|
3084
|
-
isLoaded.current = true;
|
|
3085
|
-
}, 0);
|
|
3086
|
-
}, []);
|
|
3087
|
-
const remainingTags = [];
|
|
3088
|
-
if (!renderedTag) return null;
|
|
3089
|
-
const { isToken2022, isFrozen, isLST } = renderedTag;
|
|
3083
|
+
const isFrozen = ((_a2 = balances == null ? void 0 : balances[item.id]) == null ? void 0 : _a2.isFrozen) || false;
|
|
3084
|
+
const isToken2022 = checkIsToken2022(item);
|
|
3085
|
+
const isLST = (_b = item.tags) == null ? void 0 : _b.includes("lst");
|
|
3090
3086
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex justify-end gap-x-1", children: [
|
|
3091
3087
|
isFrozen && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "border rounded-md text-xxs leading-none transition-all py-0.5 px-1 border-warning/50 text-warning/50", children: "Frozen" }),
|
|
3092
3088
|
isToken2022 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "rounded-md text-xxs leading-none transition-all py-0.5 px-1 bg-black/10 font-semibold text-primary-text/20", children: "Token2022" }),
|
|
3093
|
-
remainingTags == null ? void 0 : remainingTags.map((tag, idx) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3094
|
-
"div",
|
|
3095
|
-
{
|
|
3096
|
-
className: "rounded-md text-xxs leading-none transition-all py-0.5 px-1 bg-black/10 font-semibold text-primary-text/20",
|
|
3097
|
-
children: tag
|
|
3098
|
-
},
|
|
3099
|
-
idx
|
|
3100
|
-
)),
|
|
3101
3089
|
isLST && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(LSTTag, { mintAddress: item.id })
|
|
3102
|
-
] });
|
|
3090
|
+
] }, item.id);
|
|
3103
3091
|
};
|
|
3104
3092
|
var FormPairRow = (props) => {
|
|
3105
3093
|
var _a2;
|
|
3106
|
-
const {
|
|
3107
|
-
item,
|
|
3108
|
-
style,
|
|
3109
|
-
onSubmit,
|
|
3110
|
-
suppressCloseModal,
|
|
3111
|
-
showExplorer = true,
|
|
3112
|
-
enableUnknownTokenWarning = true
|
|
3113
|
-
} = props;
|
|
3094
|
+
const { item, style, onSubmit, suppressCloseModal, showExplorer = true, enableUnknownTokenWarning = true } = props;
|
|
3114
3095
|
const queryClient = (0, import_react_query7.useQueryClient)();
|
|
3115
3096
|
const onClick = import_react21.default.useCallback(() => {
|
|
3116
3097
|
queryClient.setQueryData([...ASSET_QUERY_KEY, item.id], [item]);
|
|
@@ -3141,7 +3122,7 @@ var FormPairRow = (props) => {
|
|
|
3141
3122
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "text-xs text-primary-text/50 text-right h-full flex flex-col justify-evenly", children: [
|
|
3142
3123
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Coinbalance_default, { mintAddress: item.id, hideZeroBalance: true }),
|
|
3143
3124
|
usdValueDisplay ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { children: usdValueDisplay }) : null,
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3125
|
+
/* @__PURE__ */ (0, import_react22.createElement)(MultiTags, __spreadProps(__spreadValues({}, props), { key: item.id }))
|
|
3145
3126
|
] })
|
|
3146
3127
|
] })
|
|
3147
3128
|
}
|
|
@@ -3150,12 +3131,12 @@ var FormPairRow = (props) => {
|
|
|
3150
3131
|
var FormPairRow_default = FormPairRow;
|
|
3151
3132
|
|
|
3152
3133
|
// src/hooks/useSearch.ts
|
|
3153
|
-
var
|
|
3134
|
+
var import_react23 = require("react");
|
|
3154
3135
|
var import_react_query8 = require("@tanstack/react-query");
|
|
3155
3136
|
var CHUNK_SIZE = 100;
|
|
3156
3137
|
var useSearch = (mintAddresses, options = {}) => {
|
|
3157
3138
|
var _a2, _b;
|
|
3158
|
-
const mintAddressesString = (0,
|
|
3139
|
+
const mintAddressesString = (0, import_react23.useMemo)(() => mintAddresses.join(","), [mintAddresses]);
|
|
3159
3140
|
return (0, import_react_query8.useQuery)({
|
|
3160
3141
|
queryKey: ["search", mintAddressesString],
|
|
3161
3142
|
queryFn: () => __async(void 0, null, function* () {
|
|
@@ -3181,40 +3162,40 @@ var useSearch = (mintAddresses, options = {}) => {
|
|
|
3181
3162
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3182
3163
|
var PAIR_ROW_HEIGHT2 = 72;
|
|
3183
3164
|
var SEARCH_BOX_HEIGHT = 56;
|
|
3184
|
-
var rowRenderer = (0,
|
|
3165
|
+
var rowRenderer = (0, import_react24.memo)((props) => {
|
|
3185
3166
|
const { data, index, style } = props;
|
|
3186
3167
|
const item = data.searchResult[index];
|
|
3187
3168
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormPairRow_default, { item, style, onSubmit: data.onSubmit }, item.address);
|
|
3188
3169
|
}, import_react_window.areEqual);
|
|
3189
3170
|
var FormPairSelector = ({ onSubmit, onClose }) => {
|
|
3190
|
-
const [search, setSearch] = (0,
|
|
3171
|
+
const [search, setSearch] = (0, import_react24.useState)("");
|
|
3191
3172
|
const { data: balances = {} } = useBalances();
|
|
3192
3173
|
const { data: blueChipTokens = [] } = useSearch([]);
|
|
3193
3174
|
const { data: searchTokens = [], isLoading } = useSearch([search], { staleTime: 5 * 60 * 1e3 });
|
|
3194
3175
|
const { data: userBalanceTokens = [] } = useSearch([Object.keys(balances).join(",")]);
|
|
3195
|
-
const searchResult = (0,
|
|
3176
|
+
const searchResult = (0, import_react24.useMemo)(() => {
|
|
3196
3177
|
if (!search) {
|
|
3197
3178
|
return sortByUserBalance([...userBalanceTokens, ...blueChipTokens], balances);
|
|
3198
3179
|
} else {
|
|
3199
3180
|
return sortByUserBalance(searchTokens, balances);
|
|
3200
3181
|
}
|
|
3201
3182
|
}, [blueChipTokens, balances, searchTokens, search, userBalanceTokens]);
|
|
3202
|
-
const triggerSearch = (0,
|
|
3183
|
+
const triggerSearch = (0, import_react24.useCallback)(
|
|
3203
3184
|
(0, import_lodash2.default)((value) => __async(void 0, null, function* () {
|
|
3204
3185
|
setSearch(value);
|
|
3205
3186
|
}), 200),
|
|
3206
3187
|
[blueChipTokens]
|
|
3207
3188
|
);
|
|
3208
|
-
const onChange = (0,
|
|
3189
|
+
const onChange = (0, import_react24.useCallback)(
|
|
3209
3190
|
(e) => {
|
|
3210
3191
|
setSearch("");
|
|
3211
3192
|
triggerSearch(e.target.value);
|
|
3212
3193
|
},
|
|
3213
3194
|
[triggerSearch]
|
|
3214
3195
|
);
|
|
3215
|
-
const listRef = (0,
|
|
3216
|
-
const inputRef = (0,
|
|
3217
|
-
(0,
|
|
3196
|
+
const listRef = (0, import_react24.createRef)();
|
|
3197
|
+
const inputRef = (0, import_react24.createRef)();
|
|
3198
|
+
(0, import_react24.useEffect)(() => {
|
|
3218
3199
|
var _a2;
|
|
3219
3200
|
return (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
3220
3201
|
}, [inputRef]);
|
|
@@ -3273,9 +3254,9 @@ var FormPairSelector_default = FormPairSelector;
|
|
|
3273
3254
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3274
3255
|
var InitialScreen = () => {
|
|
3275
3256
|
const { form, setForm, loading } = useSwapContext();
|
|
3276
|
-
const [isDisabled, setIsDisabled] = (0,
|
|
3277
|
-
const [selectPairSelector, setSelectPairSelector] = (0,
|
|
3278
|
-
const onSelectMint = (0,
|
|
3257
|
+
const [isDisabled, setIsDisabled] = (0, import_react25.useState)(false);
|
|
3258
|
+
const [selectPairSelector, setSelectPairSelector] = (0, import_react25.useState)(null);
|
|
3259
|
+
const onSelectMint = (0, import_react25.useCallback)(
|
|
3279
3260
|
(tokenInfo) => __async(void 0, null, function* () {
|
|
3280
3261
|
if (selectPairSelector === "fromMint") {
|
|
3281
3262
|
setForm((prev) => __spreadValues(__spreadProps(__spreadValues({}, prev), {
|
|
@@ -3308,7 +3289,7 @@ var InitialScreen = () => {
|
|
|
3308
3289
|
var InitialScreen_default = InitialScreen;
|
|
3309
3290
|
|
|
3310
3291
|
// src/components/screens/SwappingScreen.tsx
|
|
3311
|
-
var
|
|
3292
|
+
var import_react26 = require("react");
|
|
3312
3293
|
|
|
3313
3294
|
// src/icons/SuccessIcon.tsx
|
|
3314
3295
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
@@ -3358,7 +3339,7 @@ var SwappingScreen = () => {
|
|
|
3358
3339
|
refresh
|
|
3359
3340
|
} = useSwapContext();
|
|
3360
3341
|
const { screen: screen2, setScreen } = useScreenState();
|
|
3361
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
3342
|
+
const [errorMessage, setErrorMessage] = (0, import_react26.useState)("");
|
|
3362
3343
|
const onSwapMore = () => {
|
|
3363
3344
|
reset();
|
|
3364
3345
|
setErrorMessage("");
|
|
@@ -3371,7 +3352,7 @@ var SwappingScreen = () => {
|
|
|
3371
3352
|
setScreen("Initial");
|
|
3372
3353
|
refresh();
|
|
3373
3354
|
};
|
|
3374
|
-
(0,
|
|
3355
|
+
(0, import_react26.useEffect)(() => {
|
|
3375
3356
|
var _a2, _b, _c, _d;
|
|
3376
3357
|
if (screen2 !== "Swapping") return;
|
|
3377
3358
|
if ((lastSwapResult == null ? void 0 : lastSwapResult.swapResult) && "error" in (lastSwapResult == null ? void 0 : lastSwapResult.swapResult)) {
|
|
@@ -3403,7 +3384,7 @@ var SwappingScreen = () => {
|
|
|
3403
3384
|
};
|
|
3404
3385
|
const { explorer, getExplorer } = usePreferredExplorer();
|
|
3405
3386
|
const SuccessContent = () => {
|
|
3406
|
-
const { inputAmount, outputAmount, explorerLink } = (0,
|
|
3387
|
+
const { inputAmount, outputAmount, explorerLink } = (0, import_react26.useMemo)(() => {
|
|
3407
3388
|
return {
|
|
3408
3389
|
inputAmount: (lastSwapResult == null ? void 0 : lastSwapResult.swapResult) && "inputAmount" in (lastSwapResult == null ? void 0 : lastSwapResult.swapResult) ? lastSwapResult == null ? void 0 : lastSwapResult.swapResult.inputAmount : 0,
|
|
3409
3390
|
outputAmount: (lastSwapResult == null ? void 0 : lastSwapResult.swapResult) && "outputAmount" in (lastSwapResult == null ? void 0 : lastSwapResult.swapResult) ? lastSwapResult == null ? void 0 : lastSwapResult.swapResult.outputAmount : 0,
|
|
@@ -3521,8 +3502,8 @@ var SwappingScreen = () => {
|
|
|
3521
3502
|
var SwappingScreen_default = SwappingScreen;
|
|
3522
3503
|
|
|
3523
3504
|
// src/components/screens/WalletScreen.tsx
|
|
3524
|
-
var
|
|
3525
|
-
var
|
|
3505
|
+
var import_wallet_adapter2 = require("@jup-ag/wallet-adapter");
|
|
3506
|
+
var import_react27 = require("react");
|
|
3526
3507
|
|
|
3527
3508
|
// src/icons/CloseIcon.tsx
|
|
3528
3509
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
@@ -3541,7 +3522,7 @@ var CloseIcon_default = CloseIcon;
|
|
|
3541
3522
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3542
3523
|
var WalletScreen = () => {
|
|
3543
3524
|
const { setScreen } = useScreenState();
|
|
3544
|
-
const { handleConnectClick } = (0,
|
|
3525
|
+
const { handleConnectClick } = (0, import_wallet_adapter2.useUnifiedWalletContext)();
|
|
3545
3526
|
const { wallets } = useWalletPassThrough();
|
|
3546
3527
|
const handleConnect = (event, wallet) => __async(void 0, null, function* () {
|
|
3547
3528
|
try {
|
|
@@ -3552,10 +3533,10 @@ var WalletScreen = () => {
|
|
|
3552
3533
|
setScreen("Initial");
|
|
3553
3534
|
}
|
|
3554
3535
|
});
|
|
3555
|
-
const numberOfWallets = (0,
|
|
3536
|
+
const numberOfWallets = (0, import_react27.useMemo)(() => {
|
|
3556
3537
|
return wallets == null ? void 0 : wallets.length;
|
|
3557
3538
|
}, [wallets]);
|
|
3558
|
-
const hasWallet = (0,
|
|
3539
|
+
const hasWallet = (0, import_react27.useMemo)(() => {
|
|
3559
3540
|
return numberOfWallets > 0;
|
|
3560
3541
|
}, [numberOfWallets]);
|
|
3561
3542
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "text-primary-text p-2", children: [
|
|
@@ -3794,9 +3775,9 @@ var JupiterApp = (props) => {
|
|
|
3794
3775
|
var Jupiter_default = JupiterApp;
|
|
3795
3776
|
|
|
3796
3777
|
// src/contexts/ContextProvider.tsx
|
|
3797
|
-
var
|
|
3798
|
-
var
|
|
3799
|
-
var
|
|
3778
|
+
var import_wallet_adapter3 = require("@jup-ag/wallet-adapter");
|
|
3779
|
+
var import_react28 = __toESM(require("react"));
|
|
3780
|
+
var import_react29 = require("react");
|
|
3800
3781
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3801
3782
|
var noop = () => {
|
|
3802
3783
|
};
|
|
@@ -3808,19 +3789,19 @@ var WalletContextProvider = ({
|
|
|
3808
3789
|
if (typeof window === "undefined") return void 0;
|
|
3809
3790
|
return window.Jupiter.enableWalletPassthrough;
|
|
3810
3791
|
})();
|
|
3811
|
-
const wallets = (0,
|
|
3792
|
+
const wallets = (0, import_react29.useMemo)(() => {
|
|
3812
3793
|
if (enableWalletPassthrough) {
|
|
3813
3794
|
return [];
|
|
3814
3795
|
}
|
|
3815
3796
|
return [];
|
|
3816
3797
|
}, [enableWalletPassthrough]);
|
|
3817
|
-
const [showWalletStatus, setShowWalletStatus] = (0,
|
|
3798
|
+
const [showWalletStatus, setShowWalletStatus] = (0, import_react28.useState)({
|
|
3818
3799
|
show: false,
|
|
3819
3800
|
message: ""
|
|
3820
3801
|
});
|
|
3821
|
-
const ShouldWrapWalletProvider = (0,
|
|
3822
|
-
return enableWalletPassthrough ?
|
|
3823
|
-
|
|
3802
|
+
const ShouldWrapWalletProvider = (0, import_react29.useMemo)(() => {
|
|
3803
|
+
return enableWalletPassthrough ? import_react28.default.Fragment : ({ children: children2 }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3804
|
+
import_wallet_adapter3.UnifiedWalletProvider,
|
|
3824
3805
|
{
|
|
3825
3806
|
wallets,
|
|
3826
3807
|
config: {
|
|
@@ -3888,10 +3869,10 @@ var ContextProvider = (props) => {
|
|
|
3888
3869
|
|
|
3889
3870
|
// src/index.tsx
|
|
3890
3871
|
var import_react_query9 = require("@tanstack/react-query");
|
|
3891
|
-
var
|
|
3872
|
+
var import_react30 = require("react");
|
|
3892
3873
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3893
3874
|
var App = () => {
|
|
3894
|
-
const queryClient = (0,
|
|
3875
|
+
const queryClient = (0, import_react30.useMemo)(() => new import_react_query9.QueryClient(), []);
|
|
3895
3876
|
const [props] = (0, import_jotai4.useAtom)(appProps);
|
|
3896
3877
|
if (!props) return null;
|
|
3897
3878
|
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)) }) }) })) });
|