@suilend/sui-fe-next 0.1.49 → 0.1.51
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/contexts/WalletContext.jsx +9 -7
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/keypair.d.ts +5 -0
- package/hooks/keypair.js +19 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -462,13 +462,14 @@ function Inner(_a) {
|
|
|
462
462
|
switch (_a.label) {
|
|
463
463
|
case 0:
|
|
464
464
|
_address = impersonatedAddress !== null && impersonatedAddress !== void 0 ? impersonatedAddress : account === null || account === void 0 ? void 0 : account.address;
|
|
465
|
+
_a.label = 1;
|
|
466
|
+
case 1:
|
|
467
|
+
_a.trys.push([1, 3, , 4]);
|
|
468
|
+
// Gas budget
|
|
465
469
|
if (setGasBudget && gasBudget !== "")
|
|
466
470
|
transaction.setGasBudget(+new BigNumber(gasBudget)
|
|
467
471
|
.times(Math.pow(10, SUI_DECIMALS))
|
|
468
472
|
.integerValue(BigNumber.ROUND_DOWN));
|
|
469
|
-
_a.label = 1;
|
|
470
|
-
case 1:
|
|
471
|
-
_a.trys.push([1, 3, , 4]);
|
|
472
473
|
return [4 /*yield*/, suiClient.devInspectTransactionBlock({
|
|
473
474
|
sender: _address !== null && _address !== void 0 ? _address : "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
474
475
|
transactionBlock: transaction,
|
|
@@ -499,10 +500,6 @@ function Inner(_a) {
|
|
|
499
500
|
return __generator(this, function (_c) {
|
|
500
501
|
switch (_c.label) {
|
|
501
502
|
case 0:
|
|
502
|
-
if (gasBudget !== "")
|
|
503
|
-
transaction.setGasBudget(+new BigNumber(gasBudget)
|
|
504
|
-
.times(Math.pow(10, SUI_DECIMALS))
|
|
505
|
-
.integerValue(BigNumber.ROUND_DOWN));
|
|
506
503
|
_address = impersonatedAddress !== null && impersonatedAddress !== void 0 ? impersonatedAddress : account === null || account === void 0 ? void 0 : account.address;
|
|
507
504
|
if (_address) {
|
|
508
505
|
try {
|
|
@@ -513,6 +510,11 @@ function Inner(_a) {
|
|
|
513
510
|
_c.label = 1;
|
|
514
511
|
case 1:
|
|
515
512
|
_c.trys.push([1, 9, , 10]);
|
|
513
|
+
// Gas budget
|
|
514
|
+
if (gasBudget !== "")
|
|
515
|
+
transaction.setGasBudget(+new BigNumber(gasBudget)
|
|
516
|
+
.times(Math.pow(10, SUI_DECIMALS))
|
|
517
|
+
.integerValue(BigNumber.ROUND_DOWN));
|
|
516
518
|
return [4 /*yield*/, signTransaction({
|
|
517
519
|
transaction: transaction,
|
|
518
520
|
chain: "sui:mainnet",
|
package/hooks/index.d.ts
CHANGED
package/hooks/index.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LastSignedTransaction } from "@suilend/sui-fe";
|
|
2
|
+
export declare const useLastSignedTransaction: <T>(prefix: string) => {
|
|
3
|
+
lastSignedTransactionRef: import("react").MutableRefObject<LastSignedTransaction<T> | undefined>;
|
|
4
|
+
setLastSignedTransaction: (value: LastSignedTransaction<T> | undefined) => void;
|
|
5
|
+
};
|
package/hooks/keypair.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
// LAST SIGNED TRANSACTION
|
|
3
|
+
export var useLastSignedTransaction = function (prefix) {
|
|
4
|
+
var lastSignedTransactionRef = useRef((function () {
|
|
5
|
+
var value = window.localStorage.getItem("".concat(prefix, "-lastSignedTransaction"));
|
|
6
|
+
return value !== null
|
|
7
|
+
? JSON.parse(value)
|
|
8
|
+
: undefined;
|
|
9
|
+
})());
|
|
10
|
+
var setLastSignedTransaction = function (value) {
|
|
11
|
+
console.log("[setLastSignedTransaction]", value);
|
|
12
|
+
lastSignedTransactionRef.current = value;
|
|
13
|
+
if (value === undefined)
|
|
14
|
+
window.localStorage.removeItem("".concat(prefix, "-lastSignedTransaction"));
|
|
15
|
+
else
|
|
16
|
+
window.localStorage.setItem("".concat(prefix, "-lastSignedTransaction"), JSON.stringify(value));
|
|
17
|
+
};
|
|
18
|
+
return { lastSignedTransactionRef: lastSignedTransactionRef, setLastSignedTransaction: setLastSignedTransaction };
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sui-fe-next","version":"0.1.
|
|
1
|
+
{"name":"@suilend/sui-fe-next","version":"0.1.51","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/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.3"}}
|