diff --git a/packages/extension-koni-ui/src/Popup/Home/MyProfile/WalletInfoArea.tsx b/packages/extension-koni-ui/src/Popup/Home/MyProfile/WalletInfoArea.tsx index 288790b62c..cb7c510733 100644 --- a/packages/extension-koni-ui/src/Popup/Home/MyProfile/WalletInfoArea.tsx +++ b/packages/extension-koni-ui/src/Popup/Home/MyProfile/WalletInfoArea.tsx @@ -1,23 +1,37 @@ // Copyright 2019-2022 @subwallet/extension-ui authors & contributors // SPDX-License-Identifier: Apache-2.0 +import { BookaSdk } from '@subwallet/extension-koni-ui/connector/booka/sdk'; +import { MythicalWallet } from '@subwallet/extension-koni-ui/connector/booka/types'; import { ThemeProps } from '@subwallet/extension-koni-ui/types'; import { toDisplayNumber } from '@subwallet/extension-koni-ui/utils'; -import React from 'react'; +import React, { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; type Props = ThemeProps; +const apiSDK = BookaSdk.instance; const Component = ({ className }: Props): React.ReactElement => { const { t } = useTranslation(); + const [mythicalWallet, setMythicalWallet] = React.useState(apiSDK.getMythicalWallet()); + + useEffect(() => { + const walletSub = apiSDK.subscribeMythicalWallet().subscribe((data) => { + setMythicalWallet(data); + }); + + return () => { + walletSub.unsubscribe(); + }; + }, []); return (
{t('Your Wallet')}
-
XG35NNH7TR
+
${mythicalWallet?.address}