@rash2x/bridge-widget 0.4.5 → 0.4.6
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/evaa-bridge.cjs +1 -1
- package/dist/evaa-bridge.mjs +1 -1
- package/dist/{index-D8wi96xC.js → index-BG-E-qt2.js} +24 -15
- package/dist/{index-D8wi96xC.js.map → index-BG-E-qt2.js.map} +1 -1
- package/dist/{index-Byi5_0tY.js → index-DqeErSqM.js} +2 -2
- package/dist/{index-Byi5_0tY.js.map → index-DqeErSqM.js.map} +1 -1
- package/dist/{index-CqOdLtGY.cjs → index-kqLPlOw1.cjs} +24 -15
- package/dist/{index-CqOdLtGY.cjs.map → index-kqLPlOw1.cjs.map} +1 -1
- package/dist/{index-9pqdx6qK.cjs → index-uh5JIOC8.cjs} +2 -2
- package/dist/{index-9pqdx6qK.cjs.map → index-uh5JIOC8.cjs.map} +1 -1
- package/package.json +1 -1
|
@@ -22749,7 +22749,7 @@ class WalletConnectModal {
|
|
|
22749
22749
|
}
|
|
22750
22750
|
async initUi() {
|
|
22751
22751
|
if (typeof window !== "undefined") {
|
|
22752
|
-
await Promise.resolve().then(() => require("./index-
|
|
22752
|
+
await Promise.resolve().then(() => require("./index-uh5JIOC8.cjs"));
|
|
22753
22753
|
const modal = document.createElement("wcm-modal");
|
|
22754
22754
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
22755
22755
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -23056,13 +23056,17 @@ const WalletSelectModal = () => {
|
|
|
23056
23056
|
const connectedWallets = walletConfigs.reduce((acc, { strategy, walletId, name, icon }) => {
|
|
23057
23057
|
const account = strategy?.getAccount();
|
|
23058
23058
|
if (strategy?.isConnected() && account) {
|
|
23059
|
-
|
|
23060
|
-
|
|
23061
|
-
|
|
23062
|
-
|
|
23063
|
-
|
|
23064
|
-
|
|
23065
|
-
|
|
23059
|
+
if (walletId === "tronlink" && tronWalletConnect.isConnected) {
|
|
23060
|
+
return acc;
|
|
23061
|
+
} else {
|
|
23062
|
+
acc.push({
|
|
23063
|
+
id: walletId,
|
|
23064
|
+
name,
|
|
23065
|
+
icon,
|
|
23066
|
+
address: account,
|
|
23067
|
+
onDisconnect: () => strategy.disconnect()
|
|
23068
|
+
});
|
|
23069
|
+
}
|
|
23066
23070
|
}
|
|
23067
23071
|
return acc;
|
|
23068
23072
|
}, []);
|
|
@@ -23080,7 +23084,7 @@ const WalletSelectModal = () => {
|
|
|
23080
23084
|
if (isEvmConnector && metaMaskWallet?.isConnected()) {
|
|
23081
23085
|
return true;
|
|
23082
23086
|
}
|
|
23083
|
-
if (walletId === "tronwc" && tronWalletConnect.isConnected) {
|
|
23087
|
+
if ((walletId === "tronwc" || walletId === "tronlink") && tronWalletConnect.isConnected) {
|
|
23084
23088
|
return true;
|
|
23085
23089
|
}
|
|
23086
23090
|
return connectedWallets.some((w2) => w2.id === walletId);
|
|
@@ -25108,6 +25112,7 @@ function ChainStrategyProvider({
|
|
|
25108
25112
|
() => new TronChainStrategy({
|
|
25109
25113
|
tronAddress: tronWallet.address,
|
|
25110
25114
|
tronConnected: tronWallet.connected,
|
|
25115
|
+
isWalletConnect: tronWallet.isWalletConnect,
|
|
25111
25116
|
tronSelect: tronWallet.select,
|
|
25112
25117
|
tronConnect: tronWallet.connect,
|
|
25113
25118
|
tronDisconnect: tronWallet.disconnect
|
|
@@ -25115,6 +25120,7 @@ function ChainStrategyProvider({
|
|
|
25115
25120
|
[
|
|
25116
25121
|
tronWallet.address,
|
|
25117
25122
|
tronWallet.connected,
|
|
25123
|
+
tronWallet.isWalletConnect,
|
|
25118
25124
|
tronWallet.select,
|
|
25119
25125
|
tronWallet.connect,
|
|
25120
25126
|
tronWallet.disconnect
|
|
@@ -25782,6 +25788,9 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
25782
25788
|
connect: tronConnect,
|
|
25783
25789
|
disconnect: tronDisconnect
|
|
25784
25790
|
} = tronwalletAdapterReactHooks.useWallet();
|
|
25791
|
+
const tronWalletConnect = useTronWalletConnectContext();
|
|
25792
|
+
const isTronConnected = tronConnected || tronWalletConnect.isConnected;
|
|
25793
|
+
const tronWalletAddress = tronAddress || tronWalletConnect.address;
|
|
25785
25794
|
const { setTonConnected, setMetaMaskConnected, setTronConnected } = useConnectedWalletsStore();
|
|
25786
25795
|
react.useEffect(() => {
|
|
25787
25796
|
setTonConnected(!!tonAddress);
|
|
@@ -25790,11 +25799,11 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
25790
25799
|
setMetaMaskConnected(!!evmIsConnected);
|
|
25791
25800
|
}, [evmIsConnected, setMetaMaskConnected]);
|
|
25792
25801
|
react.useEffect(() => {
|
|
25793
|
-
setTronConnected(!!
|
|
25794
|
-
}, [
|
|
25802
|
+
setTronConnected(!!isTronConnected);
|
|
25803
|
+
}, [isTronConnected, setTronConnected]);
|
|
25795
25804
|
useAutoSelectNetwork({
|
|
25796
25805
|
tonAddress,
|
|
25797
|
-
tronConnected,
|
|
25806
|
+
tronConnected: isTronConnected,
|
|
25798
25807
|
evmIsConnected
|
|
25799
25808
|
});
|
|
25800
25809
|
return /* @__PURE__ */ jsxRuntime.jsx(BridgeI18nProvider, { defaultLanguage: props.defaultLanguage, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -25812,8 +25821,8 @@ const EvaaBridgeWithProviders = (props) => {
|
|
|
25812
25821
|
address: tonAddress
|
|
25813
25822
|
},
|
|
25814
25823
|
tronWallet: {
|
|
25815
|
-
address:
|
|
25816
|
-
connected:
|
|
25824
|
+
address: tronWalletAddress,
|
|
25825
|
+
connected: isTronConnected,
|
|
25817
25826
|
select: tronSelect,
|
|
25818
25827
|
connect: tronConnect,
|
|
25819
25828
|
disconnect: tronDisconnect
|
|
@@ -26092,4 +26101,4 @@ exports.useSwapModel = useSwapModel;
|
|
|
26092
26101
|
exports.useTokensStore = useTokensStore;
|
|
26093
26102
|
exports.useTransactionStore = useTransactionStore;
|
|
26094
26103
|
exports.useTronWalletConnect = useTronWalletConnect;
|
|
26095
|
-
//# sourceMappingURL=index-
|
|
26104
|
+
//# sourceMappingURL=index-kqLPlOw1.cjs.map
|