@suilend/sui-fe-next 0.1.53 → 0.1.55

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.
@@ -9,6 +9,8 @@ interface SettingsContext {
9
9
  setExplorerId: (id: ExplorerId) => void;
10
10
  gasBudget: string;
11
11
  setGasBudget: (value: string) => void;
12
+ isUsingLedger: boolean;
13
+ setIsUsingLedger: (value: boolean) => void;
12
14
  suiClient: SuiClient;
13
15
  }
14
16
  declare const SettingsContext: import("react").Context<SettingsContext>;
@@ -29,6 +29,10 @@ var defaultContextValue = {
29
29
  setGasBudget: function () {
30
30
  throw Error("SettingsContextProvider not initialized");
31
31
  },
32
+ isUsingLedger: false,
33
+ setIsUsingLedger: function () {
34
+ throw Error("SettingsContextProvider not initialized");
35
+ },
32
36
  suiClient: new SuiClient({ url: getFullnodeUrl("mainnet") }),
33
37
  };
34
38
  var SettingsContext = createContext(defaultContextValue);
@@ -2,7 +2,6 @@ import { Transaction } from "@mysten/sui/transactions";
2
2
  declare const useLedgerHashDialog: () => {
3
3
  ledgerHash: string | undefined;
4
4
  isLedgerHashDialogOpen: boolean;
5
- doNotShowLedgerHashDialogAgain: () => void;
6
5
  openLedgerHashDialog: (transaction: Transaction) => Promise<void>;
7
6
  closeLedgerHashDialog: () => void;
8
7
  };
@@ -35,15 +35,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import { useCallback, useState } from "react";
38
- import { useLocalStorage } from "usehooks-ts";
39
38
  import { getLedgerHash } from "@suilend/sui-fe";
40
39
  import { useSettingsContext, useWalletContext } from "../contexts";
41
40
  var useLedgerHashDialog = function () {
42
- var suiClient = useSettingsContext().suiClient;
41
+ var _a = useSettingsContext(), isUsingLedger = _a.isUsingLedger, suiClient = _a.suiClient;
43
42
  var address = useWalletContext().address;
44
- var _a = useState(undefined), ledgerHash = _a[0], setLedgerHash = _a[1];
45
- var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
46
- var _c = useLocalStorage("useLedgerHashDialog_doNotShowAgain", false), doNotShowAgain = _c[0], setDoNotShowAgain = _c[1];
43
+ var _b = useState(undefined), ledgerHash = _b[0], setLedgerHash = _b[1];
44
+ var _c = useState(false), isOpen = _c[0], setIsOpen = _c[1];
47
45
  var open = useCallback(function (transaction) { return __awaiter(void 0, void 0, void 0, function () {
48
46
  var transactionLedgerHash;
49
47
  return __generator(this, function (_a) {
@@ -51,7 +49,7 @@ var useLedgerHashDialog = function () {
51
49
  case 0:
52
50
  if (!address)
53
51
  return [2 /*return*/];
54
- if (doNotShowAgain)
52
+ if (!isUsingLedger)
55
53
  return [2 /*return*/];
56
54
  return [4 /*yield*/, getLedgerHash(address, transaction, suiClient)];
57
55
  case 1:
@@ -61,14 +59,13 @@ var useLedgerHashDialog = function () {
61
59
  return [2 /*return*/];
62
60
  }
63
61
  });
64
- }); }, [address, doNotShowAgain, suiClient]);
62
+ }); }, [address, isUsingLedger, suiClient]);
65
63
  var close = useCallback(function () {
66
64
  setIsOpen(false);
67
65
  }, []);
68
66
  return {
69
67
  ledgerHash: ledgerHash,
70
68
  isLedgerHashDialogOpen: isOpen,
71
- doNotShowLedgerHashDialogAgain: function () { return setDoNotShowAgain(true); },
72
69
  openLedgerHashDialog: open,
73
70
  closeLedgerHashDialog: close,
74
71
  };
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@suilend/sui-fe-next","version":"0.1.53","private":false,"description":"A collection of TypeScript frontend components and hooks","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./contexts/SettingsContext":"./contexts/SettingsContext.jsx","./contexts/WalletContext":"./contexts/WalletContext.jsx","./contexts":"./contexts/index.js","./fetchers":"./fetchers/index.js","./fetchers/useFetchBalances":"./fetchers/useFetchBalances.js","./hooks":"./hooks/index.js","./hooks/keypair":"./hooks/keypair.js","./hooks/useCoinMetadataMap":"./hooks/useCoinMetadataMap.js","./hooks/useIsAndroid":"./hooks/useIsAndroid.jsx","./hooks/useIsTouchscreen":"./hooks/useIsTouchscreen.jsx","./hooks/useIsiOS":"./hooks/useIsiOS.jsx","./hooks/useLedgerHashDialog":"./hooks/useLedgerHashDialog.js","./hooks/useRefreshOnBalancesChange":"./hooks/useRefreshOnBalancesChange.js","./lib":"./lib/index.js","./lib/router":"./lib/router.js","./lib/toasts":"./lib/toasts.jsx"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@sentry/nextjs":"^8.38.0","@tanstack/react-query":"^5.60.2","bignumber.js":"^9.1.2","launchdarkly-react-client-sdk":"^3.6.0","lodash":"^4.17.21","mixpanel-browser":"^2.56.0","next":"^15.0.3","react":"18.3.1","react-dom":"18.3.1","react-responsive":"^10.0.0","shio-sdk":"^1.0.8","sonner":"1.4.41","swr":"^2.2.5","tailwind-merge":"^2.5.4","usehooks-ts":"^3.1.1"},"devDependencies":{"@tsconfig/next":"^2.0.3","@types/lodash":"^4.17.13","@types/mixpanel-browser":"^2.50.2","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-next":"^15.0.3","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/dapp-kit":"0.16.0","@mysten/sui":"1.28.2","@mysten/wallet-standard":"0.14.7","@suilend/sui-fe":"^0.3.9"}}
1
+ {"name":"@suilend/sui-fe-next","version":"0.1.55","private":false,"description":"A collection of TypeScript frontend components and hooks","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./contexts/SettingsContext":"./contexts/SettingsContext.jsx","./contexts/WalletContext":"./contexts/WalletContext.jsx","./contexts":"./contexts/index.js","./fetchers":"./fetchers/index.js","./fetchers/useFetchBalances":"./fetchers/useFetchBalances.js","./hooks":"./hooks/index.js","./hooks/keypair":"./hooks/keypair.js","./hooks/useCoinMetadataMap":"./hooks/useCoinMetadataMap.js","./hooks/useIsAndroid":"./hooks/useIsAndroid.jsx","./hooks/useIsTouchscreen":"./hooks/useIsTouchscreen.jsx","./hooks/useIsiOS":"./hooks/useIsiOS.jsx","./hooks/useLedgerHashDialog":"./hooks/useLedgerHashDialog.js","./hooks/useRefreshOnBalancesChange":"./hooks/useRefreshOnBalancesChange.js","./lib":"./lib/index.js","./lib/router":"./lib/router.js","./lib/toasts":"./lib/toasts.jsx"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@sentry/nextjs":"^8.38.0","@tanstack/react-query":"^5.60.2","bignumber.js":"^9.1.2","launchdarkly-react-client-sdk":"^3.6.0","lodash":"^4.17.21","mixpanel-browser":"^2.56.0","next":"^15.0.3","react":"18.3.1","react-dom":"18.3.1","react-responsive":"^10.0.0","shio-sdk":"^1.0.8","sonner":"1.4.41","swr":"^2.2.5","tailwind-merge":"^2.5.4","usehooks-ts":"^3.1.1"},"devDependencies":{"@tsconfig/next":"^2.0.3","@types/lodash":"^4.17.13","@types/mixpanel-browser":"^2.50.2","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-next":"^15.0.3","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/dapp-kit":"0.16.0","@mysten/sui":"1.28.2","@mysten/wallet-standard":"0.14.7","@suilend/sui-fe":"^0.3.9"}}