@suilend/sui-fe-next 2.0.19 → 2.0.20
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 +23 -8
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -682,7 +682,7 @@ function Inner(_a) {
|
|
|
682
682
|
});
|
|
683
683
|
}); }, [suiClient]);
|
|
684
684
|
var signExecuteAndWaitForTransaction = useCallback(function (transaction, onSetGasBudget, onSign, onExecute) { return __awaiter(_this, void 0, void 0, function () {
|
|
685
|
-
var _address, provider, txBytes, txBase64, params, res_1, signAndExecErr_1, signRes, execRes, msafeWallet, msafeFeature, msafeAccount, usedSignOnly, signedTransaction, res1, err_5, message, res, digest, err_6;
|
|
685
|
+
var _address, provider, txBytes, txBase64, params, topic, signClient, res_1, signAndExecErr_1, signRes, execRes, msafeWallet, msafeFeature, msafeAccount, usedSignOnly, signedTransaction, res1, err_5, message, res, digest, err_6;
|
|
686
686
|
var _a, _b;
|
|
687
687
|
return __generator(this, function (_c) {
|
|
688
688
|
switch (_c.label) {
|
|
@@ -718,17 +718,25 @@ function Inner(_a) {
|
|
|
718
718
|
transaction: txBase64,
|
|
719
719
|
address: wcRawAddress !== null && wcRawAddress !== void 0 ? wcRawAddress : sessionAddress,
|
|
720
720
|
};
|
|
721
|
-
|
|
721
|
+
topic = (_a = provider.session) === null || _a === void 0 ? void 0 : _a.topic;
|
|
722
|
+
console.log("[WalletContext] WalletConnect — session topic:", topic);
|
|
722
723
|
console.log("[WalletContext] WalletConnect — session namespaces:", JSON.stringify((_b = provider.session) === null || _b === void 0 ? void 0 : _b.namespaces));
|
|
723
724
|
console.log("[WalletContext] WalletConnect — request params:", params);
|
|
725
|
+
if (!topic)
|
|
726
|
+
throw new Error("WalletConnect session not found");
|
|
727
|
+
signClient = provider.client;
|
|
724
728
|
_c.label = 4;
|
|
725
729
|
case 4:
|
|
726
730
|
_c.trys.push([4, 7, , 8]);
|
|
727
|
-
console.log("[WalletContext] WalletConnect — trying sui_signAndExecuteTransaction");
|
|
728
|
-
return [4 /*yield*/,
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
731
|
+
console.log("[WalletContext] WalletConnect — trying sui_signAndExecuteTransaction via SignClient");
|
|
732
|
+
return [4 /*yield*/, signClient.request({
|
|
733
|
+
topic: topic,
|
|
734
|
+
chainId: "sui:mainnet",
|
|
735
|
+
request: {
|
|
736
|
+
method: WC_SUI_METHODS.SIGN_AND_EXECUTE_TRANSACTION,
|
|
737
|
+
params: params,
|
|
738
|
+
},
|
|
739
|
+
})];
|
|
732
740
|
case 5:
|
|
733
741
|
res_1 = _c.sent();
|
|
734
742
|
console.log("[WalletContext] WalletConnect — sui_signAndExecuteTransaction succeeded, digest:", res_1.digest);
|
|
@@ -741,7 +749,14 @@ function Inner(_a) {
|
|
|
741
749
|
case 8:
|
|
742
750
|
// Fallback: sign-only, then dApp-side execute
|
|
743
751
|
console.log("[WalletContext] WalletConnect — trying sui_signTransaction (sign-only fallback)");
|
|
744
|
-
return [4 /*yield*/,
|
|
752
|
+
return [4 /*yield*/, signClient.request({
|
|
753
|
+
topic: topic,
|
|
754
|
+
chainId: "sui:mainnet",
|
|
755
|
+
request: {
|
|
756
|
+
method: WC_SUI_METHODS.SIGN_TRANSACTION,
|
|
757
|
+
params: params,
|
|
758
|
+
},
|
|
759
|
+
})];
|
|
745
760
|
case 9:
|
|
746
761
|
signRes = _c.sent();
|
|
747
762
|
console.log("[WalletContext] WalletConnect — sui_signTransaction succeeded, executing on-chain");
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sui-fe-next","version":"2.0.
|
|
1
|
+
{"name":"@suilend/sui-fe-next","version":"2.0.20","private":false,"description":"A collection of TypeScript frontend components and hooks","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./contexts/WalletContext":"./contexts/WalletContext.jsx","./contexts/SettingsContext":"./contexts/SettingsContext.jsx","./contexts":"./contexts/index.js","./fetchers":"./fetchers/index.js","./fetchers/useFetchBalances":"./fetchers/useFetchBalances.js","./hooks/useRefreshOnBalancesChange":"./hooks/useRefreshOnBalancesChange.js","./hooks/useLedgerHashDialog":"./hooks/useLedgerHashDialog.js","./hooks/useIsAndroid":"./hooks/useIsAndroid.jsx","./hooks/useCoinMetadataMap":"./hooks/useCoinMetadataMap.js","./hooks":"./hooks/index.js","./hooks/useIsTouchscreen":"./hooks/useIsTouchscreen.jsx","./hooks/useIsiOS":"./hooks/useIsiOS.jsx","./hooks/keypair":"./hooks/keypair.js","./lib/track":"./lib/track.js","./lib":"./lib/index.js","./lib/router":"./lib/router.js","./lib/toasts":"./lib/toasts.jsx","./lib/connector":"./lib/connector.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix src/","prettier":"prettier --write src/","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ./release.js && 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":{"@reown/appkit":"1.8.2","@tanstack/react-query":"^5.60.2","@wallet-standard/app":"^1.1.0","@walletconnect/universal-provider":"2.21.1","bignumber.js":"^9.1.2","launchdarkly-react-client-sdk":"^3.6.0","lodash":"^4.17.21","mixpanel-browser":"^2.72.0","next":"^15.0.3","react":"18.3.1","react-dom":"18.3.1","react-responsive":"^10.0.0","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/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-core":"1.0.3","@mysten/dapp-kit-react":"1.0.1","@mysten/sui":"2.3.1","@mysten/wallet-standard":"0.20.0","@suilend/sui-fe":"^2.0.10"}}
|