tiwiflix-wallet-connector 1.6.1 → 1.6.2
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/index.esm.js +14 -4
- package/dist/index.js +14 -4
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7367,7 +7367,9 @@ const WalletSelectModal = ({ isOpen, onClose, onSelectWallet, availableWallets,
|
|
|
7367
7367
|
flexShrink: 0,
|
|
7368
7368
|
fontFamily: 'Lexend, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
7369
7369
|
pointerEvents: 'none',
|
|
7370
|
-
}, children: "Connected" })) :
|
|
7370
|
+
}, children: "Connected" })) : (
|
|
7371
|
+
// For TON wallets on mobile, do not show Detected/Install button
|
|
7372
|
+
!(isMobile && wallet.chainType === 'ton') ? (isInstalled ? (jsx("button", { style: {
|
|
7371
7373
|
fontSize: '11px',
|
|
7372
7374
|
fontWeight: '600',
|
|
7373
7375
|
color: '#2BEE6C',
|
|
@@ -7391,7 +7393,7 @@ const WalletSelectModal = ({ isOpen, onClose, onSelectWallet, availableWallets,
|
|
|
7391
7393
|
flexShrink: 0,
|
|
7392
7394
|
fontFamily: 'Lexend, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
7393
7395
|
pointerEvents: 'none',
|
|
7394
|
-
}, children: "Install" }))] }, wallet.type));
|
|
7396
|
+
}, children: "Install" }))) : null)] }, wallet.type));
|
|
7395
7397
|
})] }, chain))) }), jsx("div", { style: {
|
|
7396
7398
|
padding: '16px 20px',
|
|
7397
7399
|
borderTop: `1px solid ${colors.border}`,
|
|
@@ -7517,7 +7519,7 @@ const TWCBalanceModal = ({ isOpen, onClose, twcBalance, usdValue, colors, isDark
|
|
|
7517
7519
|
|
|
7518
7520
|
const tonApiCache = new Map();
|
|
7519
7521
|
const CACHE_DURATION = 30000; // 30 seconds
|
|
7520
|
-
const ConnectButton = ({ connector, onConnect, onDisconnect, onError, className, style, showBalance = false, modalPosition = 'center', theme = 'auto', buttonText = 'Connect Wallet
|
|
7522
|
+
const ConnectButton = ({ connector, onConnect, onDisconnect, onError, className, style, showBalance = false, modalPosition = 'center', theme = 'auto', buttonText = 'Connect Wallet', getExplorerUrl, }) => {
|
|
7521
7523
|
// Always fetch balance automatically when wallet is connected
|
|
7522
7524
|
// Balance is always fetched automatically from the chain
|
|
7523
7525
|
// Detect dark mode
|
|
@@ -7822,7 +7824,15 @@ const ConnectButton = ({ connector, onConnect, onDisconnect, onError, className,
|
|
|
7822
7824
|
try {
|
|
7823
7825
|
const chainId = await connector.getCurrentChain();
|
|
7824
7826
|
setCurrentChainId(chainId);
|
|
7825
|
-
|
|
7827
|
+
if (chainId !== 56) {
|
|
7828
|
+
// Automatically switch to BSC
|
|
7829
|
+
try {
|
|
7830
|
+
await connector.switchChain(56);
|
|
7831
|
+
}
|
|
7832
|
+
catch (err) {
|
|
7833
|
+
// Optionally handle error (user rejected, etc.)
|
|
7834
|
+
}
|
|
7835
|
+
}
|
|
7826
7836
|
setIsWrongNetwork(false);
|
|
7827
7837
|
}
|
|
7828
7838
|
catch (err) {
|
package/dist/index.js
CHANGED
|
@@ -7369,7 +7369,9 @@ const WalletSelectModal = ({ isOpen, onClose, onSelectWallet, availableWallets,
|
|
|
7369
7369
|
flexShrink: 0,
|
|
7370
7370
|
fontFamily: 'Lexend, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
7371
7371
|
pointerEvents: 'none',
|
|
7372
|
-
}, children: "Connected" })) :
|
|
7372
|
+
}, children: "Connected" })) : (
|
|
7373
|
+
// For TON wallets on mobile, do not show Detected/Install button
|
|
7374
|
+
!(isMobile && wallet.chainType === 'ton') ? (isInstalled ? (jsxRuntime.jsx("button", { style: {
|
|
7373
7375
|
fontSize: '11px',
|
|
7374
7376
|
fontWeight: '600',
|
|
7375
7377
|
color: '#2BEE6C',
|
|
@@ -7393,7 +7395,7 @@ const WalletSelectModal = ({ isOpen, onClose, onSelectWallet, availableWallets,
|
|
|
7393
7395
|
flexShrink: 0,
|
|
7394
7396
|
fontFamily: 'Lexend, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
7395
7397
|
pointerEvents: 'none',
|
|
7396
|
-
}, children: "Install" }))] }, wallet.type));
|
|
7398
|
+
}, children: "Install" }))) : null)] }, wallet.type));
|
|
7397
7399
|
})] }, chain))) }), jsxRuntime.jsx("div", { style: {
|
|
7398
7400
|
padding: '16px 20px',
|
|
7399
7401
|
borderTop: `1px solid ${colors.border}`,
|
|
@@ -7519,7 +7521,7 @@ const TWCBalanceModal = ({ isOpen, onClose, twcBalance, usdValue, colors, isDark
|
|
|
7519
7521
|
|
|
7520
7522
|
const tonApiCache = new Map();
|
|
7521
7523
|
const CACHE_DURATION = 30000; // 30 seconds
|
|
7522
|
-
const ConnectButton = ({ connector, onConnect, onDisconnect, onError, className, style, showBalance = false, modalPosition = 'center', theme = 'auto', buttonText = 'Connect Wallet
|
|
7524
|
+
const ConnectButton = ({ connector, onConnect, onDisconnect, onError, className, style, showBalance = false, modalPosition = 'center', theme = 'auto', buttonText = 'Connect Wallet', getExplorerUrl, }) => {
|
|
7523
7525
|
// Always fetch balance automatically when wallet is connected
|
|
7524
7526
|
// Balance is always fetched automatically from the chain
|
|
7525
7527
|
// Detect dark mode
|
|
@@ -7824,7 +7826,15 @@ const ConnectButton = ({ connector, onConnect, onDisconnect, onError, className,
|
|
|
7824
7826
|
try {
|
|
7825
7827
|
const chainId = await connector.getCurrentChain();
|
|
7826
7828
|
setCurrentChainId(chainId);
|
|
7827
|
-
|
|
7829
|
+
if (chainId !== 56) {
|
|
7830
|
+
// Automatically switch to BSC
|
|
7831
|
+
try {
|
|
7832
|
+
await connector.switchChain(56);
|
|
7833
|
+
}
|
|
7834
|
+
catch (err) {
|
|
7835
|
+
// Optionally handle error (user rejected, etc.)
|
|
7836
|
+
}
|
|
7837
|
+
}
|
|
7828
7838
|
setIsWrongNetwork(false);
|
|
7829
7839
|
}
|
|
7830
7840
|
catch (err) {
|
package/package.json
CHANGED