UNPKG

@reservoir0x/relay-kit-ui

Version:

Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.

23 lines 815 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = require("react"); const wagmi_1 = require("wagmi"); function default_1(wallet, linkedWallets) { const [address, setAddress] = (0, react_1.useState)(); const { address: wagmiAddress } = (0, wagmi_1.useAccount)(); (0, react_1.useEffect)(() => { const getWalletAddress = async (wallet) => { if (wallet) { const walletAddress = await wallet.address(); setAddress(walletAddress); } else { setAddress(undefined); } }; getWalletAddress(wallet); }, [wallet, linkedWallets]); return wallet ? address : wagmiAddress; } exports.default = default_1; //# sourceMappingURL=useWalletAddress.js.map