@iota/dapp-kit 0.1.2 → 0.2.0
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/CHANGELOG.md +15 -0
- package/dist/cjs/components/AccountDropdownMenu.css +58 -31
- package/dist/cjs/components/AccountDropdownMenu.css.css +27 -18
- package/dist/cjs/components/AccountDropdownMenu.css.css.map +3 -3
- package/dist/cjs/components/AccountDropdownMenu.css.d.ts +1 -0
- package/dist/cjs/components/AccountDropdownMenu.css.js +6 -4
- package/dist/cjs/components/AccountDropdownMenu.css.js.map +2 -2
- package/dist/cjs/components/AccountDropdownMenu.css.map +3 -3
- package/dist/cjs/components/AccountDropdownMenu.js +44 -104
- package/dist/cjs/components/AccountDropdownMenu.js.map +4 -4
- package/dist/cjs/components/ConnectButton.css +195 -191
- package/dist/cjs/components/ConnectButton.css.map +3 -3
- package/dist/cjs/components/ConnectButton.js +693 -418
- package/dist/cjs/components/ConnectButton.js.map +4 -4
- package/dist/cjs/components/WalletProvider.js +119 -34
- package/dist/cjs/components/WalletProvider.js.map +3 -3
- package/dist/cjs/components/connect-modal/ConnectModal.css +177 -224
- package/dist/cjs/components/connect-modal/ConnectModal.css.css +32 -69
- package/dist/cjs/components/connect-modal/ConnectModal.css.css.map +3 -3
- package/dist/cjs/components/connect-modal/ConnectModal.css.d.ts +1 -5
- package/dist/cjs/components/connect-modal/ConnectModal.css.js +7 -15
- package/dist/cjs/components/connect-modal/ConnectModal.css.js.map +2 -2
- package/dist/cjs/components/connect-modal/ConnectModal.css.map +3 -3
- package/dist/cjs/components/connect-modal/ConnectModal.js +705 -403
- package/dist/cjs/components/connect-modal/ConnectModal.js.map +4 -4
- package/dist/cjs/components/connect-modal/InfoSection.css +11 -7
- package/dist/cjs/components/connect-modal/InfoSection.css.map +3 -3
- package/dist/cjs/components/connect-modal/InfoSection.js +1 -1
- package/dist/cjs/components/connect-modal/InfoSection.js.map +2 -2
- package/dist/cjs/components/connect-modal/views/GetTheWallet.css +78 -0
- package/dist/cjs/components/connect-modal/views/GetTheWallet.css.css +35 -0
- package/dist/cjs/components/connect-modal/views/GetTheWallet.css.css.map +7 -0
- package/dist/cjs/components/connect-modal/views/GetTheWallet.css.d.ts +5 -0
- package/dist/cjs/components/connect-modal/views/{GettingStarted.css.js → GetTheWallet.css.js} +13 -9
- package/dist/cjs/components/connect-modal/views/GetTheWallet.css.js.map +7 -0
- package/dist/cjs/components/connect-modal/views/GetTheWallet.css.map +7 -0
- package/dist/cjs/components/connect-modal/views/GetTheWallet.d.ts +1 -0
- package/dist/cjs/components/connect-modal/views/GetTheWallet.js +524 -0
- package/dist/cjs/components/connect-modal/views/GetTheWallet.js.map +7 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.css +179 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.css.css +51 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.css.css.map +7 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.css.d.ts +8 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.css.js +41 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.css.js.map +7 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.css.map +7 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.d.ts +7 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.js +325 -0
- package/dist/cjs/components/connect-modal/views/WalletConnect.js.map +7 -0
- package/dist/cjs/components/connect-modal/views/index.css +214 -0
- package/dist/cjs/components/connect-modal/views/index.css.map +7 -0
- package/dist/cjs/components/connect-modal/views/index.d.ts +2 -0
- package/dist/cjs/components/connect-modal/views/index.js +790 -0
- package/dist/cjs/components/connect-modal/views/index.js.map +7 -0
- package/dist/cjs/components/connect-modal/wallet-list/WalletList.css +22 -10
- package/dist/cjs/components/connect-modal/wallet-list/WalletList.css.css +5 -2
- package/dist/cjs/components/connect-modal/wallet-list/WalletList.css.css.map +3 -3
- package/dist/cjs/components/connect-modal/wallet-list/WalletList.css.js.map +1 -1
- package/dist/cjs/components/connect-modal/wallet-list/WalletList.css.map +3 -3
- package/dist/cjs/components/connect-modal/wallet-list/WalletList.d.ts +4 -4
- package/dist/cjs/components/connect-modal/wallet-list/WalletList.js +38 -61
- package/dist/cjs/components/connect-modal/wallet-list/WalletList.js.map +4 -4
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css +17 -8
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.css +17 -8
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.css.map +3 -3
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.d.ts +1 -0
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.js +4 -2
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.js.map +2 -2
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.map +3 -3
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.js +32 -5
- package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.js.map +4 -4
- package/dist/cjs/components/icons/ArrowRightIcon.d.ts +2 -0
- package/dist/cjs/components/icons/{BackIcon.js → ArrowRightIcon.js} +23 -12
- package/dist/cjs/components/icons/ArrowRightIcon.js.map +7 -0
- package/dist/cjs/components/icons/ArrowTopRightIcon.d.ts +2 -0
- package/dist/cjs/components/icons/ArrowTopRightIcon.js +47 -0
- package/dist/cjs/components/icons/ArrowTopRightIcon.js.map +7 -0
- package/dist/cjs/components/icons/IotaIcon.js +391 -12
- package/dist/cjs/components/icons/IotaIcon.js.map +2 -2
- package/dist/cjs/components/styling/InjectedThemeStyles.js +13 -8
- package/dist/cjs/components/styling/InjectedThemeStyles.js.map +2 -2
- package/dist/cjs/components/styling/StyleMarker.css +16 -1
- package/dist/cjs/components/styling/StyleMarker.css.css +16 -1
- package/dist/cjs/components/styling/StyleMarker.css.css.map +3 -3
- package/dist/cjs/components/styling/StyleMarker.css.map +3 -3
- package/dist/cjs/components/styling/StyleMarker.js +2 -2
- package/dist/cjs/components/styling/StyleMarker.js.map +1 -1
- package/dist/cjs/components/ui/Button.css +4 -5
- package/dist/cjs/components/ui/Button.css.css +4 -5
- package/dist/cjs/components/ui/Button.css.css.map +3 -3
- package/dist/cjs/components/ui/Button.css.d.ts +0 -1
- package/dist/cjs/components/ui/Button.css.js.map +1 -1
- package/dist/cjs/components/ui/Button.css.map +3 -3
- package/dist/cjs/components/ui/Button.js.map +1 -1
- package/dist/cjs/components/ui/IconButton.css +1 -5
- package/dist/cjs/components/ui/IconButton.css.css +1 -5
- package/dist/cjs/components/ui/IconButton.css.css.map +3 -3
- package/dist/cjs/components/ui/IconButton.css.js.map +1 -1
- package/dist/cjs/components/ui/IconButton.css.map +3 -3
- package/dist/cjs/components/ui/IconButton.js.map +1 -1
- package/dist/cjs/components/ui/Text.css +11 -7
- package/dist/cjs/components/ui/Text.css.css +11 -7
- package/dist/cjs/components/ui/Text.css.css.map +3 -3
- package/dist/cjs/components/ui/Text.css.d.ts +3 -0
- package/dist/cjs/components/ui/Text.css.js +1 -1
- package/dist/cjs/components/ui/Text.css.js.map +2 -2
- package/dist/cjs/components/ui/Text.css.map +3 -3
- package/dist/cjs/components/ui/Text.js +1 -1
- package/dist/cjs/components/ui/Text.js.map +2 -2
- package/dist/cjs/constants/walletDefaults.d.ts +1 -0
- package/dist/cjs/constants/walletDefaults.js +4 -1
- package/dist/cjs/constants/walletDefaults.js.map +2 -2
- package/dist/cjs/index.css +246 -242
- package/dist/cjs/index.css.map +3 -3
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1010 -634
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/themes/darkTheme.d.ts +2 -0
- package/dist/cjs/themes/darkTheme.js +88 -0
- package/dist/cjs/themes/darkTheme.js.map +7 -0
- package/dist/cjs/themes/lightTheme.js +30 -25
- package/dist/cjs/themes/lightTheme.js.map +2 -2
- package/dist/cjs/themes/themeContract.d.ts +22 -12
- package/dist/cjs/themes/themeContract.js +13 -8
- package/dist/cjs/themes/themeContract.js.map +2 -2
- package/dist/esm/components/AccountDropdownMenu.css +58 -31
- package/dist/esm/components/AccountDropdownMenu.css.css +27 -18
- package/dist/esm/components/AccountDropdownMenu.css.css.map +3 -3
- package/dist/esm/components/AccountDropdownMenu.css.d.ts +1 -0
- package/dist/esm/components/AccountDropdownMenu.css.js +6 -4
- package/dist/esm/components/AccountDropdownMenu.css.js.map +2 -2
- package/dist/esm/components/AccountDropdownMenu.css.map +3 -3
- package/dist/esm/components/AccountDropdownMenu.js +33 -93
- package/dist/esm/components/AccountDropdownMenu.js.map +4 -4
- package/dist/esm/components/ConnectButton.css +195 -191
- package/dist/esm/components/ConnectButton.css.map +3 -3
- package/dist/esm/components/ConnectButton.js +677 -402
- package/dist/esm/components/ConnectButton.js.map +4 -4
- package/dist/esm/components/WalletProvider.js +119 -34
- package/dist/esm/components/WalletProvider.js.map +3 -3
- package/dist/esm/components/connect-modal/ConnectModal.css +177 -224
- package/dist/esm/components/connect-modal/ConnectModal.css.css +32 -69
- package/dist/esm/components/connect-modal/ConnectModal.css.css.map +3 -3
- package/dist/esm/components/connect-modal/ConnectModal.css.d.ts +1 -5
- package/dist/esm/components/connect-modal/ConnectModal.css.js +7 -15
- package/dist/esm/components/connect-modal/ConnectModal.css.js.map +2 -2
- package/dist/esm/components/connect-modal/ConnectModal.css.map +3 -3
- package/dist/esm/components/connect-modal/ConnectModal.js +701 -399
- package/dist/esm/components/connect-modal/ConnectModal.js.map +4 -4
- package/dist/esm/components/connect-modal/InfoSection.css +11 -7
- package/dist/esm/components/connect-modal/InfoSection.css.map +3 -3
- package/dist/esm/components/connect-modal/InfoSection.js +1 -1
- package/dist/esm/components/connect-modal/InfoSection.js.map +2 -2
- package/dist/esm/components/connect-modal/views/GetTheWallet.css +78 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.css.css +35 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.css.css.map +7 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.css.d.ts +5 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.css.js +14 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.css.js.map +7 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.css.map +7 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.d.ts +1 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.js +491 -0
- package/dist/esm/components/connect-modal/views/GetTheWallet.js.map +7 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.css +179 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.css.css +51 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.css.css.map +7 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.css.d.ts +8 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.css.js +20 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.css.js.map +7 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.css.map +7 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.d.ts +7 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.js +294 -0
- package/dist/esm/components/connect-modal/views/WalletConnect.js.map +7 -0
- package/dist/esm/components/connect-modal/views/index.css +214 -0
- package/dist/esm/components/connect-modal/views/index.css.map +7 -0
- package/dist/esm/components/connect-modal/views/index.d.ts +2 -0
- package/dist/esm/components/connect-modal/views/index.js +757 -0
- package/dist/esm/components/connect-modal/views/index.js.map +7 -0
- package/dist/esm/components/connect-modal/wallet-list/WalletList.css +22 -10
- package/dist/esm/components/connect-modal/wallet-list/WalletList.css.css +5 -2
- package/dist/esm/components/connect-modal/wallet-list/WalletList.css.css.map +3 -3
- package/dist/esm/components/connect-modal/wallet-list/WalletList.css.js.map +1 -1
- package/dist/esm/components/connect-modal/wallet-list/WalletList.css.map +3 -3
- package/dist/esm/components/connect-modal/wallet-list/WalletList.d.ts +4 -4
- package/dist/esm/components/connect-modal/wallet-list/WalletList.js +38 -61
- package/dist/esm/components/connect-modal/wallet-list/WalletList.js.map +4 -4
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css +17 -8
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.css +17 -8
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.css.map +3 -3
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.d.ts +1 -0
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.js +4 -2
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.js.map +2 -2
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.map +3 -3
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.js +32 -5
- package/dist/esm/components/connect-modal/wallet-list/WalletListItem.js.map +4 -4
- package/dist/esm/components/icons/ArrowRightIcon.d.ts +2 -0
- package/dist/esm/components/icons/ArrowRightIcon.js +26 -0
- package/dist/esm/components/icons/ArrowRightIcon.js.map +7 -0
- package/dist/esm/components/icons/ArrowTopRightIcon.d.ts +2 -0
- package/dist/esm/components/icons/ArrowTopRightIcon.js +26 -0
- package/dist/esm/components/icons/ArrowTopRightIcon.js.map +7 -0
- package/dist/esm/components/icons/IotaIcon.js +391 -12
- package/dist/esm/components/icons/IotaIcon.js.map +2 -2
- package/dist/esm/components/styling/InjectedThemeStyles.js +13 -8
- package/dist/esm/components/styling/InjectedThemeStyles.js.map +2 -2
- package/dist/esm/components/styling/StyleMarker.css +16 -1
- package/dist/esm/components/styling/StyleMarker.css.css +16 -1
- package/dist/esm/components/styling/StyleMarker.css.css.map +3 -3
- package/dist/esm/components/styling/StyleMarker.css.js +2 -2
- package/dist/esm/components/styling/StyleMarker.css.js.map +1 -1
- package/dist/esm/components/styling/StyleMarker.css.map +3 -3
- package/dist/esm/components/styling/StyleMarker.js +2 -2
- package/dist/esm/components/styling/StyleMarker.js.map +1 -1
- package/dist/esm/components/ui/Button.css +4 -5
- package/dist/esm/components/ui/Button.css.css +4 -5
- package/dist/esm/components/ui/Button.css.css.map +3 -3
- package/dist/esm/components/ui/Button.css.d.ts +0 -1
- package/dist/esm/components/ui/Button.css.js.map +1 -1
- package/dist/esm/components/ui/Button.css.map +3 -3
- package/dist/esm/components/ui/Button.js.map +1 -1
- package/dist/esm/components/ui/IconButton.css +1 -5
- package/dist/esm/components/ui/IconButton.css.css +1 -5
- package/dist/esm/components/ui/IconButton.css.css.map +3 -3
- package/dist/esm/components/ui/IconButton.css.js.map +1 -1
- package/dist/esm/components/ui/IconButton.css.map +3 -3
- package/dist/esm/components/ui/IconButton.js.map +1 -1
- package/dist/esm/components/ui/Text.css +11 -7
- package/dist/esm/components/ui/Text.css.css +11 -7
- package/dist/esm/components/ui/Text.css.css.map +3 -3
- package/dist/esm/components/ui/Text.css.d.ts +3 -0
- package/dist/esm/components/ui/Text.css.js +1 -1
- package/dist/esm/components/ui/Text.css.js.map +2 -2
- package/dist/esm/components/ui/Text.css.map +3 -3
- package/dist/esm/components/ui/Text.js +1 -1
- package/dist/esm/components/ui/Text.js.map +2 -2
- package/dist/esm/constants/walletDefaults.d.ts +1 -0
- package/dist/esm/constants/walletDefaults.js +4 -1
- package/dist/esm/constants/walletDefaults.js.map +2 -2
- package/dist/esm/index.css +246 -242
- package/dist/esm/index.css.map +3 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +993 -617
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/themes/darkTheme.d.ts +2 -0
- package/dist/esm/themes/darkTheme.js +67 -0
- package/dist/esm/themes/darkTheme.js.map +7 -0
- package/dist/esm/themes/lightTheme.js +30 -25
- package/dist/esm/themes/lightTheme.js.map +2 -2
- package/dist/esm/themes/themeContract.d.ts +22 -12
- package/dist/esm/themes/themeContract.js +13 -8
- package/dist/esm/themes/themeContract.js.map +2 -2
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/AccountDropdownMenu.css.ts +17 -11
- package/src/components/AccountDropdownMenu.tsx +4 -16
- package/src/components/ConnectButton.tsx +1 -4
- package/src/components/WalletProvider.tsx +13 -2
- package/src/components/connect-modal/ConnectModal.css.ts +17 -58
- package/src/components/connect-modal/ConnectModal.tsx +16 -101
- package/src/components/connect-modal/views/GetTheWallet.css.ts +38 -0
- package/src/components/connect-modal/views/GetTheWallet.tsx +25 -0
- package/src/components/connect-modal/views/WalletConnect.css.ts +55 -0
- package/src/components/connect-modal/views/WalletConnect.tsx +79 -0
- package/src/components/connect-modal/views/index.ts +5 -0
- package/src/components/connect-modal/wallet-list/WalletList.css.ts +5 -1
- package/src/components/connect-modal/wallet-list/WalletList.tsx +11 -25
- package/src/components/connect-modal/wallet-list/WalletListItem.css.ts +14 -6
- package/src/components/connect-modal/wallet-list/WalletListItem.tsx +12 -9
- package/src/components/icons/ArrowRightIcon.tsx +23 -0
- package/src/components/icons/ArrowTopRightIcon.tsx +23 -0
- package/src/components/icons/IotaIcon.tsx +222 -6
- package/src/components/styling/StyleMarker.css.ts +15 -0
- package/src/components/ui/Button.css.ts +3 -5
- package/src/components/ui/IconButton.css.ts +0 -3
- package/src/components/ui/Text.css.ts +1 -1
- package/src/constants/walletDefaults.ts +5 -0
- package/src/index.ts +1 -1
- package/src/themes/darkTheme.ts +69 -0
- package/src/themes/lightTheme.ts +29 -24
- package/src/themes/themeContract.ts +11 -6
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.css +0 -146
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.css +0 -32
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.css.map +0 -7
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.d.ts +0 -5
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.js +0 -35
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.js.map +0 -7
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.map +0 -7
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.d.ts +0 -8
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.js +0 -173
- package/dist/cjs/components/connect-modal/views/ConnectionStatus.js.map +0 -7
- package/dist/cjs/components/connect-modal/views/GettingStarted.css +0 -145
- package/dist/cjs/components/connect-modal/views/GettingStarted.css.css +0 -23
- package/dist/cjs/components/connect-modal/views/GettingStarted.css.css.map +0 -7
- package/dist/cjs/components/connect-modal/views/GettingStarted.css.d.ts +0 -3
- package/dist/cjs/components/connect-modal/views/GettingStarted.css.js.map +0 -7
- package/dist/cjs/components/connect-modal/views/GettingStarted.css.map +0 -7
- package/dist/cjs/components/connect-modal/views/GettingStarted.d.ts +0 -1
- package/dist/cjs/components/connect-modal/views/GettingStarted.js +0 -172
- package/dist/cjs/components/connect-modal/views/GettingStarted.js.map +0 -7
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css +0 -95
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.css +0 -17
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.css.map +0 -7
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.d.ts +0 -2
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.js +0 -29
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.js.map +0 -7
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.map +0 -7
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.d.ts +0 -1
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.js +0 -135
- package/dist/cjs/components/connect-modal/views/WhatIsAWallet.js.map +0 -7
- package/dist/cjs/components/icons/BackIcon.d.ts +0 -2
- package/dist/cjs/components/icons/BackIcon.js.map +0 -7
- package/dist/cjs/hooks/useResolveIotaNSNames.d.ts +0 -3
- package/dist/cjs/hooks/useResolveIotaNSNames.js +0 -83
- package/dist/cjs/hooks/useResolveIotaNSNames.js.map +0 -7
- package/dist/esm/components/connect-modal/views/ConnectionStatus.css +0 -146
- package/dist/esm/components/connect-modal/views/ConnectionStatus.css.css +0 -32
- package/dist/esm/components/connect-modal/views/ConnectionStatus.css.css.map +0 -7
- package/dist/esm/components/connect-modal/views/ConnectionStatus.css.d.ts +0 -5
- package/dist/esm/components/connect-modal/views/ConnectionStatus.css.js +0 -14
- package/dist/esm/components/connect-modal/views/ConnectionStatus.css.js.map +0 -7
- package/dist/esm/components/connect-modal/views/ConnectionStatus.css.map +0 -7
- package/dist/esm/components/connect-modal/views/ConnectionStatus.d.ts +0 -8
- package/dist/esm/components/connect-modal/views/ConnectionStatus.js +0 -140
- package/dist/esm/components/connect-modal/views/ConnectionStatus.js.map +0 -7
- package/dist/esm/components/connect-modal/views/GettingStarted.css +0 -145
- package/dist/esm/components/connect-modal/views/GettingStarted.css.css +0 -23
- package/dist/esm/components/connect-modal/views/GettingStarted.css.css.map +0 -7
- package/dist/esm/components/connect-modal/views/GettingStarted.css.d.ts +0 -3
- package/dist/esm/components/connect-modal/views/GettingStarted.css.js +0 -10
- package/dist/esm/components/connect-modal/views/GettingStarted.css.js.map +0 -7
- package/dist/esm/components/connect-modal/views/GettingStarted.css.map +0 -7
- package/dist/esm/components/connect-modal/views/GettingStarted.d.ts +0 -1
- package/dist/esm/components/connect-modal/views/GettingStarted.js +0 -139
- package/dist/esm/components/connect-modal/views/GettingStarted.js.map +0 -7
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.css +0 -95
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.css +0 -17
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.css.map +0 -7
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.d.ts +0 -2
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.js +0 -8
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.js.map +0 -7
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.map +0 -7
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.d.ts +0 -1
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.js +0 -102
- package/dist/esm/components/connect-modal/views/WhatIsAWallet.js.map +0 -7
- package/dist/esm/components/icons/BackIcon.d.ts +0 -2
- package/dist/esm/components/icons/BackIcon.js +0 -15
- package/dist/esm/components/icons/BackIcon.js.map +0 -7
- package/dist/esm/hooks/useResolveIotaNSNames.d.ts +0 -3
- package/dist/esm/hooks/useResolveIotaNSNames.js +0 -60
- package/dist/esm/hooks/useResolveIotaNSNames.js.map +0 -7
- package/src/components/connect-modal/views/ConnectionStatus.css.ts +0 -36
- package/src/components/connect-modal/views/ConnectionStatus.tsx +0 -55
- package/src/components/connect-modal/views/GettingStarted.css.ts +0 -26
- package/src/components/connect-modal/views/GettingStarted.tsx +0 -40
- package/src/components/connect-modal/views/WhatIsAWallet.css.ts +0 -20
- package/src/components/connect-modal/views/WhatIsAWallet.tsx +0 -24
- package/src/components/icons/BackIcon.tsx +0 -18
- package/src/hooks/useResolveIotaNSNames.ts +0 -31
package/dist/esm/index.js
CHANGED
|
@@ -40,9 +40,9 @@ var __privateAdd = (obj, member, value) => {
|
|
|
40
40
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
// vanilla-extract-css-ns:src/components/styling/StyleMarker.css.ts.vanilla.css?source
|
|
43
|
+
// vanilla-extract-css-ns:src/components/styling/StyleMarker.css.ts.vanilla.css?source=#H4sIAAAAAAAAA51US4/TMBC+91fMcYtiqYXCIT0iIe6LxHkSe2Orrm2NJyRZxH9HtrttmrAL4hLJ4+8xL6cetCL18G4LPzcAjR9FNM/GdTU0nqQi0fjxuAFovfVUww+kByEkhiBOhkWORtF4OW0T6sk7Fk94NnZaYXkKviMMehIJ9iWjbqxontWKk26+K9NpjsJ5OqOdEXiya8bC5TGBbpwha/2rjTVOCf1nyswnwb5mVGEpZkUiBmxzH98gZuRjAW6Pm1+bukyj6Zm9KyPBEBQSulbV4LxTyaLB9tSR750Ul7kwoYsBSTledNQ4rcjwajqz+F2d8/iiktnVxXYWKetSwy4dAkqZKfl0RuqMy4driViqYzWykKr1hGy8u5W4NvA9p0RfIFclbyvobZGzJl4X40Vp5n6f2FVB7yvQ7yvQHyrQhwr0xwr0p6L4RieHdcfuK63FoJo089iSt7ZBypKDkaxr2B/C+ApMMGF7urzI/AoJpenjaplS2IjRInVly/+yGa+46f7c3N6/RumHVFZUDDvYwX4XxvJZ2N/cPpcfQdH8lvS2x//I/rJDhzBC9NbIRfa/AfAolD6tBAAA
|
|
44
44
|
var init_ = __esm({
|
|
45
|
-
"vanilla-extract-css-ns:src/components/styling/StyleMarker.css.ts.vanilla.css?source
|
|
45
|
+
"vanilla-extract-css-ns:src/components/styling/StyleMarker.css.ts.vanilla.css?source=#H4sIAAAAAAAAA51US4/TMBC+91fMcYtiqYXCIT0iIe6LxHkSe2Orrm2NJyRZxH9HtrttmrAL4hLJ4+8xL6cetCL18G4LPzcAjR9FNM/GdTU0nqQi0fjxuAFovfVUww+kByEkhiBOhkWORtF4OW0T6sk7Fk94NnZaYXkKviMMehIJ9iWjbqxontWKk26+K9NpjsJ5OqOdEXiya8bC5TGBbpwha/2rjTVOCf1nyswnwb5mVGEpZkUiBmxzH98gZuRjAW6Pm1+bukyj6Zm9KyPBEBQSulbV4LxTyaLB9tSR750Ul7kwoYsBSTledNQ4rcjwajqz+F2d8/iiktnVxXYWKetSwy4dAkqZKfl0RuqMy4driViqYzWykKr1hGy8u5W4NvA9p0RfIFclbyvobZGzJl4X40Vp5n6f2FVB7yvQ7yvQHyrQhwr0xwr0p6L4RieHdcfuK63FoJo089iSt7ZBypKDkaxr2B/C+ApMMGF7urzI/AoJpenjaplS2IjRInVly/+yGa+46f7c3N6/RumHVFZUDDvYwX4XxvJZ2N/cPpcfQdH8lvS2x//I/rJDhzBC9NbIRfa/AfAolD6tBAAA"() {
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -56,124 +56,12 @@ var require_StyleMarker_css = __commonJS({
|
|
|
56
56
|
|
|
57
57
|
// src/components/connect-modal/ConnectModal.tsx
|
|
58
58
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
59
|
-
import
|
|
60
|
-
import { useState } from "react";
|
|
61
|
-
|
|
62
|
-
// src/hooks/wallet/useConnectWallet.ts
|
|
63
|
-
import { isSupportedChain } from "@iota/wallet-standard";
|
|
64
|
-
import { useMutation } from "@tanstack/react-query";
|
|
65
|
-
|
|
66
|
-
// src/constants/walletMutationKeys.ts
|
|
67
|
-
var walletMutationKeys = {
|
|
68
|
-
all: { baseScope: "wallet" },
|
|
69
|
-
connectWallet: formMutationKeyFn("connect-wallet"),
|
|
70
|
-
autoconnectWallet: formMutationKeyFn("autoconnect-wallet"),
|
|
71
|
-
disconnectWallet: formMutationKeyFn("disconnect-wallet"),
|
|
72
|
-
signPersonalMessage: formMutationKeyFn("sign-personal-message"),
|
|
73
|
-
signTransactionBlock: formMutationKeyFn("sign-transaction-block"),
|
|
74
|
-
signAndExecuteTransactionBlock: formMutationKeyFn("sign-and-execute-transaction-block"),
|
|
75
|
-
switchAccount: formMutationKeyFn("switch-account")
|
|
76
|
-
};
|
|
77
|
-
function formMutationKeyFn(baseEntity) {
|
|
78
|
-
return function mutationKeyFn(additionalKeys = []) {
|
|
79
|
-
return [{ ...walletMutationKeys.all, baseEntity }, ...additionalKeys];
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// src/hooks/wallet/useWalletStore.ts
|
|
84
|
-
import { useContext } from "react";
|
|
85
|
-
import { useStore } from "zustand";
|
|
86
|
-
|
|
87
|
-
// src/contexts/walletContext.ts
|
|
88
|
-
import { createContext } from "react";
|
|
89
|
-
var WalletContext = createContext(null);
|
|
90
|
-
|
|
91
|
-
// src/hooks/wallet/useWalletStore.ts
|
|
92
|
-
function useWalletStore(selector) {
|
|
93
|
-
const store = useContext(WalletContext);
|
|
94
|
-
if (!store) {
|
|
95
|
-
throw new Error(
|
|
96
|
-
"Could not find WalletContext. Ensure that you have set up the WalletProvider."
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
return useStore(store, selector);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// src/hooks/wallet/useConnectWallet.ts
|
|
103
|
-
function useConnectWallet({
|
|
104
|
-
mutationKey,
|
|
105
|
-
...mutationOptions
|
|
106
|
-
} = {}) {
|
|
107
|
-
const setWalletConnected = useWalletStore((state) => state.setWalletConnected);
|
|
108
|
-
const setConnectionStatus = useWalletStore((state) => state.setConnectionStatus);
|
|
109
|
-
return useMutation({
|
|
110
|
-
mutationKey: walletMutationKeys.connectWallet(mutationKey),
|
|
111
|
-
mutationFn: async ({ wallet, accountAddress, ...connectArgs }) => {
|
|
112
|
-
try {
|
|
113
|
-
setConnectionStatus("connecting");
|
|
114
|
-
const connectResult = await wallet.features["standard:connect"].connect(connectArgs);
|
|
115
|
-
const connectedIotaAccounts = connectResult.accounts.filter(
|
|
116
|
-
(account) => account.chains.some(isSupportedChain)
|
|
117
|
-
);
|
|
118
|
-
const selectedAccount = getSelectedAccount(connectedIotaAccounts, accountAddress);
|
|
119
|
-
setWalletConnected(wallet, connectedIotaAccounts, selectedAccount);
|
|
120
|
-
return { accounts: connectedIotaAccounts };
|
|
121
|
-
} catch (error) {
|
|
122
|
-
setConnectionStatus("disconnected");
|
|
123
|
-
throw error;
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
...mutationOptions
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
function getSelectedAccount(connectedAccounts, accountAddress) {
|
|
130
|
-
if (connectedAccounts.length === 0) {
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
if (accountAddress) {
|
|
134
|
-
const selectedAccount = connectedAccounts.find(
|
|
135
|
-
(account) => account.address === accountAddress
|
|
136
|
-
);
|
|
137
|
-
return selectedAccount ?? connectedAccounts[0];
|
|
138
|
-
}
|
|
139
|
-
return connectedAccounts[0];
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// src/utils/walletUtils.ts
|
|
143
|
-
import { getWallets, isWalletWithRequiredFeatureSet } from "@iota/wallet-standard";
|
|
144
|
-
function getRegisteredWallets(preferredWallets, requiredFeatures) {
|
|
145
|
-
const walletsApi = getWallets();
|
|
146
|
-
const wallets = walletsApi.get();
|
|
147
|
-
const iotaWallets = wallets.filter(
|
|
148
|
-
(wallet) => isWalletWithRequiredFeatureSet(wallet, requiredFeatures)
|
|
149
|
-
);
|
|
150
|
-
return [
|
|
151
|
-
// Preferred wallets, in order:
|
|
152
|
-
...preferredWallets.map((name) => iotaWallets.find((wallet) => wallet.name === name)).filter(Boolean),
|
|
153
|
-
// Wallets in default order:
|
|
154
|
-
...iotaWallets.filter((wallet) => !preferredWallets.includes(wallet.name))
|
|
155
|
-
];
|
|
156
|
-
}
|
|
157
|
-
function getWalletUniqueIdentifier(wallet) {
|
|
158
|
-
return wallet?.id ?? wallet?.name;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// src/components/icons/BackIcon.tsx
|
|
162
|
-
import { jsx } from "react/jsx-runtime";
|
|
163
|
-
function BackIcon(props) {
|
|
164
|
-
return /* @__PURE__ */ jsx("svg", { width: 24, height: 24, fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx(
|
|
165
|
-
"path",
|
|
166
|
-
{
|
|
167
|
-
d: "M7.57 12.262c0 .341.13.629.403.895l5.175 5.059c.204.205.45.307.751.307.609 0 1.101-.485 1.101-1.087 0-.293-.123-.574-.349-.8L10.14 12.27l4.511-4.375A1.13 1.13 0 0 0 15 7.087C15 6.485 14.508 6 13.9 6c-.295 0-.54.103-.752.308l-5.175 5.058c-.28.28-.404.56-.404.896Z",
|
|
168
|
-
fill: "currentColor"
|
|
169
|
-
}
|
|
170
|
-
) });
|
|
171
|
-
}
|
|
59
|
+
import { useState as useState2 } from "react";
|
|
172
60
|
|
|
173
61
|
// src/components/icons/CloseIcon.tsx
|
|
174
|
-
import { jsx
|
|
62
|
+
import { jsx } from "react/jsx-runtime";
|
|
175
63
|
function CloseIcon(props) {
|
|
176
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ jsx("svg", { width: 10, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx(
|
|
177
65
|
"path",
|
|
178
66
|
{
|
|
179
67
|
d: "M9.708.292a.999.999 0 0 0-1.413 0l-3.289 3.29L1.717.291A.999.999 0 0 0 .305 1.705l3.289 3.289-3.29 3.289a.999.999 0 1 0 1.413 1.412l3.29-3.289 3.288 3.29a.999.999 0 0 0 1.413-1.413l-3.29-3.29 3.29-3.288a.999.999 0 0 0 0-1.413Z",
|
|
@@ -193,8 +81,8 @@ var styleDataAttribute = { [styleDataAttributeName]: "" };
|
|
|
193
81
|
|
|
194
82
|
// src/components/styling/StyleMarker.tsx
|
|
195
83
|
var import_StyleMarker_css = __toESM(require_StyleMarker_css());
|
|
196
|
-
import { jsx as
|
|
197
|
-
var StyleMarker = forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */
|
|
84
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
85
|
+
var StyleMarker = forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx2(Slot, { ref: forwardedRef, ...props, ...styleDataAttribute, children }));
|
|
198
86
|
StyleMarker.displayName = "StyleMarker";
|
|
199
87
|
|
|
200
88
|
// src/components/ui/Heading.tsx
|
|
@@ -207,7 +95,7 @@ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntim
|
|
|
207
95
|
var headingVariants = _7a468({ defaultClassName: "Heading__12b5l8i0", variantClassNames: { size: { sm: "Heading_headingVariants_size_sm__12b5l8i1", md: "Heading_headingVariants_size_md__12b5l8i2", lg: "Heading_headingVariants_size_lg__12b5l8i3", xl: "Heading_headingVariants_size_xl__12b5l8i4" }, weight: { normal: "Heading_headingVariants_weight_normal__12b5l8i5", bold: "Heading_headingVariants_weight_bold__12b5l8i6" }, truncate: { true: "Heading_headingVariants_truncate_true__12b5l8i7" } }, defaultVariants: { size: "lg", weight: "bold" }, compoundVariants: [] });
|
|
208
96
|
|
|
209
97
|
// src/components/ui/Heading.tsx
|
|
210
|
-
import { jsx as
|
|
98
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
211
99
|
var Heading = forwardRef2(
|
|
212
100
|
({
|
|
213
101
|
children,
|
|
@@ -219,13 +107,13 @@ var Heading = forwardRef2(
|
|
|
219
107
|
truncate,
|
|
220
108
|
...headingProps
|
|
221
109
|
}, forwardedRef) => {
|
|
222
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ jsx3(
|
|
223
111
|
Slot2,
|
|
224
112
|
{
|
|
225
113
|
...headingProps,
|
|
226
114
|
ref: forwardedRef,
|
|
227
115
|
className: clsx(headingVariants({ size, weight, truncate }), className),
|
|
228
|
-
children: asChild ? children : /* @__PURE__ */
|
|
116
|
+
children: asChild ? children : /* @__PURE__ */ jsx3(Tag, { children })
|
|
229
117
|
}
|
|
230
118
|
);
|
|
231
119
|
}
|
|
@@ -241,241 +129,190 @@ import { forwardRef as forwardRef3 } from "react";
|
|
|
241
129
|
var container = "IconButton_container__ap1qll0";
|
|
242
130
|
|
|
243
131
|
// src/components/ui/IconButton.tsx
|
|
244
|
-
import { jsx as
|
|
132
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
245
133
|
var IconButton = forwardRef3(
|
|
246
134
|
({ className, asChild = false, ...props }, forwardedRef) => {
|
|
247
135
|
const Comp = asChild ? Slot3 : "button";
|
|
248
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ jsx4(Comp, { ...props, className: clsx2(container, className), ref: forwardedRef });
|
|
249
137
|
}
|
|
250
138
|
);
|
|
251
139
|
IconButton.displayName = "Button";
|
|
252
140
|
|
|
253
141
|
// src/components/connect-modal/ConnectModal.css.ts
|
|
254
|
-
var
|
|
255
|
-
var
|
|
256
|
-
var content = "ConnectModal_content__17mljma2";
|
|
142
|
+
var closeButtonContainer = "ConnectModal_closeButtonContainer__17mljma5";
|
|
143
|
+
var content = "ConnectModal_content__17mljma3";
|
|
257
144
|
var overlay = "ConnectModal_overlay__17mljma0";
|
|
258
|
-
var
|
|
145
|
+
var separator = "ConnectModal_separator__17mljma2";
|
|
259
146
|
var title = "ConnectModal_title__17mljma1";
|
|
260
|
-
var
|
|
261
|
-
var walletListContainer = "ConnectModal_walletListContainer__17mljma9";
|
|
262
|
-
var walletListContainerWithViewSelected = "ConnectModal_walletListContainerWithViewSelected__17mljmaa";
|
|
263
|
-
var walletListContent = "ConnectModal_walletListContent__17mljma8";
|
|
264
|
-
var whatIsAWalletButton = "ConnectModal_whatIsAWalletButton__17mljma3";
|
|
265
|
-
|
|
266
|
-
// src/components/ui/Button.tsx
|
|
267
|
-
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
268
|
-
import clsx3 from "clsx";
|
|
269
|
-
import { forwardRef as forwardRef4 } from "react";
|
|
147
|
+
var walletListContent = "ConnectModal_walletListContent__17mljma6";
|
|
270
148
|
|
|
271
|
-
// src/
|
|
272
|
-
import {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
// src/components/ui/Button.tsx
|
|
276
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
277
|
-
var Button = forwardRef4(
|
|
278
|
-
({ className, variant, size, asChild = false, ...props }, forwardedRef) => {
|
|
279
|
-
const Comp = asChild ? Slot4 : "button";
|
|
280
|
-
return /* @__PURE__ */ jsx6(
|
|
281
|
-
Comp,
|
|
282
|
-
{
|
|
283
|
-
...props,
|
|
284
|
-
className: clsx3(buttonVariants({ variant, size }), className),
|
|
285
|
-
ref: forwardedRef
|
|
286
|
-
}
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
);
|
|
290
|
-
Button.displayName = "Button";
|
|
291
|
-
|
|
292
|
-
// src/components/ui/Text.tsx
|
|
293
|
-
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
294
|
-
import clsx4 from "clsx";
|
|
295
|
-
import { forwardRef as forwardRef5 } from "react";
|
|
149
|
+
// src/hooks/wallet/useWalletStore.ts
|
|
150
|
+
import { useContext } from "react";
|
|
151
|
+
import { useStore } from "zustand";
|
|
296
152
|
|
|
297
|
-
// src/
|
|
298
|
-
import {
|
|
299
|
-
var
|
|
153
|
+
// src/contexts/walletContext.ts
|
|
154
|
+
import { createContext } from "react";
|
|
155
|
+
var WalletContext = createContext(null);
|
|
300
156
|
|
|
301
|
-
// src/
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
({
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
asChild = false,
|
|
308
|
-
as: Tag = "div",
|
|
309
|
-
size,
|
|
310
|
-
weight,
|
|
311
|
-
color,
|
|
312
|
-
mono,
|
|
313
|
-
...textProps
|
|
314
|
-
}, forwardedRef) => {
|
|
315
|
-
return /* @__PURE__ */ jsx7(
|
|
316
|
-
Slot5,
|
|
317
|
-
{
|
|
318
|
-
...textProps,
|
|
319
|
-
ref: forwardedRef,
|
|
320
|
-
className: clsx4(textVariants({ size, weight, color, mono }), className),
|
|
321
|
-
children: asChild ? children : /* @__PURE__ */ jsx7(Tag, { children })
|
|
322
|
-
}
|
|
157
|
+
// src/hooks/wallet/useWalletStore.ts
|
|
158
|
+
function useWalletStore(selector) {
|
|
159
|
+
const store = useContext(WalletContext);
|
|
160
|
+
if (!store) {
|
|
161
|
+
throw new Error(
|
|
162
|
+
"Could not find WalletContext. Ensure that you have set up the WalletProvider."
|
|
323
163
|
);
|
|
324
164
|
}
|
|
325
|
-
);
|
|
326
|
-
|
|
165
|
+
return useStore(store, selector);
|
|
166
|
+
}
|
|
327
167
|
|
|
328
|
-
// src/
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
var retryButtonContainer = "ConnectionStatus_retryButtonContainer__c5q1ll4";
|
|
332
|
-
var title2 = "ConnectionStatus_title__c5q1ll2";
|
|
333
|
-
var walletIcon = "ConnectionStatus_walletIcon__c5q1ll1";
|
|
334
|
-
|
|
335
|
-
// src/components/connect-modal/views/ConnectionStatus.tsx
|
|
336
|
-
import { jsx as jsx8, jsxs } from "react/jsx-runtime";
|
|
337
|
-
function ConnectionStatus({
|
|
338
|
-
selectedWallet,
|
|
339
|
-
hadConnectionError,
|
|
340
|
-
onRetryConnection
|
|
341
|
-
}) {
|
|
342
|
-
return /* @__PURE__ */ jsxs("div", { className: container2, children: [
|
|
343
|
-
/* @__PURE__ */ jsx8(
|
|
344
|
-
"img",
|
|
345
|
-
{
|
|
346
|
-
className: walletIcon,
|
|
347
|
-
src: selectedWallet.icon,
|
|
348
|
-
alt: `${selectedWallet.name} logo`
|
|
349
|
-
}
|
|
350
|
-
),
|
|
351
|
-
/* @__PURE__ */ jsx8("div", { className: title2, children: /* @__PURE__ */ jsxs(Heading, { as: "h2", size: "xl", children: [
|
|
352
|
-
"Opening ",
|
|
353
|
-
selectedWallet.name
|
|
354
|
-
] }) }),
|
|
355
|
-
/* @__PURE__ */ jsx8("div", { className: connectionStatus, children: hadConnectionError ? /* @__PURE__ */ jsx8(Text, { color: "danger", children: "Connection failed" }) : /* @__PURE__ */ jsx8(Text, { color: "muted", children: "Confirm connection in the wallet..." }) }),
|
|
356
|
-
hadConnectionError ? /* @__PURE__ */ jsx8("div", { className: retryButtonContainer, children: /* @__PURE__ */ jsx8(
|
|
357
|
-
Button,
|
|
358
|
-
{
|
|
359
|
-
type: "button",
|
|
360
|
-
variant: "outline",
|
|
361
|
-
onClick: () => onRetryConnection(selectedWallet),
|
|
362
|
-
children: "Retry Connection"
|
|
363
|
-
}
|
|
364
|
-
) }) : null
|
|
365
|
-
] });
|
|
168
|
+
// src/hooks/wallet/useWallets.ts
|
|
169
|
+
function useWallets() {
|
|
170
|
+
return useWalletStore((state) => state.wallets);
|
|
366
171
|
}
|
|
367
172
|
|
|
368
|
-
// src/components/connect-modal/
|
|
369
|
-
|
|
173
|
+
// src/components/connect-modal/views/WalletConnect.tsx
|
|
174
|
+
import { useState } from "react";
|
|
370
175
|
|
|
371
|
-
// src/
|
|
372
|
-
import {
|
|
373
|
-
function
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
176
|
+
// src/utils/walletUtils.ts
|
|
177
|
+
import { getWallets, isWalletWithRequiredFeatureSet } from "@iota/wallet-standard";
|
|
178
|
+
function getRegisteredWallets(preferredWallets, requiredFeatures) {
|
|
179
|
+
const walletsApi = getWallets();
|
|
180
|
+
const wallets = walletsApi.get();
|
|
181
|
+
const iotaWallets = wallets.filter(
|
|
182
|
+
(wallet) => isWalletWithRequiredFeatureSet(wallet, requiredFeatures)
|
|
183
|
+
);
|
|
184
|
+
return [
|
|
185
|
+
// Preferred wallets, in order:
|
|
186
|
+
...preferredWallets.map((name) => iotaWallets.find((wallet) => wallet.name === name)).filter(Boolean),
|
|
187
|
+
// Wallets in default order:
|
|
188
|
+
...iotaWallets.filter((wallet) => !preferredWallets.includes(wallet.name))
|
|
189
|
+
];
|
|
378
190
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
var container4 = "GettingStarted_container__qu36t90";
|
|
382
|
-
var content2 = "GettingStarted_content__qu36t91";
|
|
383
|
-
var installButtonContainer = "GettingStarted_installButtonContainer__qu36t92";
|
|
384
|
-
|
|
385
|
-
// src/components/connect-modal/views/GettingStarted.tsx
|
|
386
|
-
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
387
|
-
function GettingStarted() {
|
|
388
|
-
return /* @__PURE__ */ jsxs3("div", { className: container4, children: [
|
|
389
|
-
/* @__PURE__ */ jsx10(Heading, { as: "h2", children: "Get Started with Iota" }),
|
|
390
|
-
/* @__PURE__ */ jsxs3("div", { className: content2, children: [
|
|
391
|
-
/* @__PURE__ */ jsx10(InfoSection, { title: "Install the Iota Wallet Extension", children: "We recommend pinning Iota Wallet to your taskbar for quicker access." }),
|
|
392
|
-
/* @__PURE__ */ jsx10(InfoSection, { title: "Create or Import a Wallet", children: "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone." }),
|
|
393
|
-
/* @__PURE__ */ jsx10(InfoSection, { title: "Refresh Your Browser", children: "Once you set up your wallet, refresh this window browser to load up the extension." }),
|
|
394
|
-
/* @__PURE__ */ jsx10("div", { className: installButtonContainer, children: /* @__PURE__ */ jsx10(Button, { variant: "outline", asChild: true, children: /* @__PURE__ */ jsx10(
|
|
395
|
-
"a",
|
|
396
|
-
{
|
|
397
|
-
href: "https://chrome.google.com/webstore/detail/iota-wallet/opcgpfmipidbgpenhmajoajpbobppdil",
|
|
398
|
-
target: "_blank",
|
|
399
|
-
rel: "noreferrer",
|
|
400
|
-
children: "Install Wallet Extension"
|
|
401
|
-
}
|
|
402
|
-
) }) })
|
|
403
|
-
] })
|
|
404
|
-
] });
|
|
191
|
+
function getWalletUniqueIdentifier(wallet) {
|
|
192
|
+
return wallet?.id ?? wallet?.name;
|
|
405
193
|
}
|
|
406
194
|
|
|
407
|
-
// src/
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
// src/components/connect-modal/views/WhatIsAWallet.tsx
|
|
412
|
-
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
413
|
-
function WhatIsAWallet() {
|
|
414
|
-
return /* @__PURE__ */ jsxs4("div", { className: container5, children: [
|
|
415
|
-
/* @__PURE__ */ jsx11(Heading, { as: "h2", children: "What is a Wallet" }),
|
|
416
|
-
/* @__PURE__ */ jsxs4("div", { className: content3, children: [
|
|
417
|
-
/* @__PURE__ */ jsx11(InfoSection, { title: "Easy Login", children: "No need to create new accounts and passwords for every website. Just connect your wallet and get going." }),
|
|
418
|
-
/* @__PURE__ */ jsx11(InfoSection, { title: "Store your Digital Assets", children: "Send, receive, store, and display your digital assets like NFTs & coins." })
|
|
419
|
-
] })
|
|
420
|
-
] });
|
|
421
|
-
}
|
|
195
|
+
// src/hooks/wallet/useConnectWallet.ts
|
|
196
|
+
import { isSupportedChain } from "@iota/wallet-standard";
|
|
197
|
+
import { useMutation } from "@tanstack/react-query";
|
|
422
198
|
|
|
423
|
-
// src/
|
|
424
|
-
|
|
425
|
-
|
|
199
|
+
// src/constants/walletMutationKeys.ts
|
|
200
|
+
var walletMutationKeys = {
|
|
201
|
+
all: { baseScope: "wallet" },
|
|
202
|
+
connectWallet: formMutationKeyFn("connect-wallet"),
|
|
203
|
+
autoconnectWallet: formMutationKeyFn("autoconnect-wallet"),
|
|
204
|
+
disconnectWallet: formMutationKeyFn("disconnect-wallet"),
|
|
205
|
+
signPersonalMessage: formMutationKeyFn("sign-personal-message"),
|
|
206
|
+
signTransactionBlock: formMutationKeyFn("sign-transaction-block"),
|
|
207
|
+
signAndExecuteTransactionBlock: formMutationKeyFn("sign-and-execute-transaction-block"),
|
|
208
|
+
switchAccount: formMutationKeyFn("switch-account")
|
|
209
|
+
};
|
|
210
|
+
function formMutationKeyFn(baseEntity) {
|
|
211
|
+
return function mutationKeyFn(additionalKeys = []) {
|
|
212
|
+
return [{ ...walletMutationKeys.all, baseEntity }, ...additionalKeys];
|
|
213
|
+
};
|
|
426
214
|
}
|
|
427
215
|
|
|
428
|
-
// src/
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
216
|
+
// src/hooks/wallet/useConnectWallet.ts
|
|
217
|
+
function useConnectWallet({
|
|
218
|
+
mutationKey,
|
|
219
|
+
...mutationOptions
|
|
220
|
+
} = {}) {
|
|
221
|
+
const setWalletConnected = useWalletStore((state) => state.setWalletConnected);
|
|
222
|
+
const setConnectionStatus = useWalletStore((state) => state.setConnectionStatus);
|
|
223
|
+
return useMutation({
|
|
224
|
+
mutationKey: walletMutationKeys.connectWallet(mutationKey),
|
|
225
|
+
mutationFn: async ({ wallet, accountAddress, ...connectArgs }) => {
|
|
226
|
+
try {
|
|
227
|
+
setConnectionStatus("connecting");
|
|
228
|
+
const connectResult = await wallet.features["standard:connect"].connect(connectArgs);
|
|
229
|
+
const connectedIotaAccounts = connectResult.accounts.filter(
|
|
230
|
+
(account) => account.chains.some(isSupportedChain)
|
|
231
|
+
);
|
|
232
|
+
const selectedAccount = getSelectedAccount(connectedIotaAccounts, accountAddress);
|
|
233
|
+
setWalletConnected(wallet, connectedIotaAccounts, selectedAccount);
|
|
234
|
+
return { accounts: connectedIotaAccounts };
|
|
235
|
+
} catch (error) {
|
|
236
|
+
setConnectionStatus("disconnected");
|
|
237
|
+
throw error;
|
|
440
238
|
}
|
|
441
|
-
|
|
442
|
-
|
|
239
|
+
},
|
|
240
|
+
...mutationOptions
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
function getSelectedAccount(connectedAccounts, accountAddress) {
|
|
244
|
+
if (connectedAccounts.length === 0) {
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
if (accountAddress) {
|
|
248
|
+
const selectedAccount = connectedAccounts.find(
|
|
249
|
+
(account) => account.address === accountAddress
|
|
250
|
+
);
|
|
251
|
+
return selectedAccount ?? connectedAccounts[0];
|
|
252
|
+
}
|
|
253
|
+
return connectedAccounts[0];
|
|
443
254
|
}
|
|
444
255
|
|
|
445
256
|
// src/components/connect-modal/wallet-list/WalletList.css.ts
|
|
446
|
-
var
|
|
257
|
+
var container2 = "WalletList_container__1tkdegw0";
|
|
447
258
|
|
|
448
259
|
// src/components/connect-modal/wallet-list/WalletListItem.tsx
|
|
449
|
-
import { clsx as
|
|
260
|
+
import { clsx as clsx3 } from "clsx";
|
|
450
261
|
|
|
451
262
|
// src/components/connect-modal/wallet-list/WalletListItem.css.ts
|
|
452
|
-
var
|
|
263
|
+
var container3 = "WalletListItem_container__1vrvezk0";
|
|
453
264
|
var selectedWalletItem = "WalletListItem_selectedWalletItem__1vrvezk2";
|
|
454
|
-
var
|
|
265
|
+
var walletIcon = "WalletListItem_walletIcon__1vrvezk4";
|
|
455
266
|
var walletItem = "WalletListItem_walletItem__1vrvezk1";
|
|
267
|
+
var walletName = "WalletListItem_walletName__1vrvezk3";
|
|
268
|
+
|
|
269
|
+
// src/components/icons/ArrowRightIcon.tsx
|
|
270
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
271
|
+
function ArrowRightIcon(props) {
|
|
272
|
+
return /* @__PURE__ */ jsx5(
|
|
273
|
+
"svg",
|
|
274
|
+
{
|
|
275
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
276
|
+
width: "24",
|
|
277
|
+
height: "24",
|
|
278
|
+
viewBox: "0 0 24 24",
|
|
279
|
+
fill: "none",
|
|
280
|
+
...props,
|
|
281
|
+
children: /* @__PURE__ */ jsx5(
|
|
282
|
+
"path",
|
|
283
|
+
{
|
|
284
|
+
fill: "currentColor",
|
|
285
|
+
d: "m10.707 6.293 5 5a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414-1.414L13.586 12 9.293 7.707a1 1 0 0 1 1.414-1.414Z"
|
|
286
|
+
}
|
|
287
|
+
)
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
}
|
|
456
291
|
|
|
457
292
|
// src/components/connect-modal/wallet-list/WalletListItem.tsx
|
|
458
|
-
import { jsx as
|
|
459
|
-
function WalletListItem({ name, icon, onClick, isSelected = false }) {
|
|
460
|
-
return /* @__PURE__ */
|
|
293
|
+
import { jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
294
|
+
function WalletListItem({ name, icon: icon3, onClick, isSelected = false }) {
|
|
295
|
+
return /* @__PURE__ */ jsx6("li", { className: container3, children: /* @__PURE__ */ jsxs(
|
|
461
296
|
"button",
|
|
462
297
|
{
|
|
463
|
-
className:
|
|
298
|
+
className: clsx3(walletItem, { [selectedWalletItem]: isSelected }),
|
|
464
299
|
type: "button",
|
|
465
300
|
onClick,
|
|
466
301
|
children: [
|
|
467
|
-
|
|
468
|
-
|
|
302
|
+
/* @__PURE__ */ jsxs("div", { className: clsx3(walletName), children: [
|
|
303
|
+
typeof icon3 === "string" ? /* @__PURE__ */ jsx6("img", { className: walletIcon, src: icon3, alt: `${name} logo` }) : icon3,
|
|
304
|
+
/* @__PURE__ */ jsx6(Heading, { size: "md", truncate: true, asChild: true, children: /* @__PURE__ */ jsx6("div", { children: name }) })
|
|
305
|
+
] }),
|
|
306
|
+
/* @__PURE__ */ jsx6(ArrowRightIcon, {})
|
|
469
307
|
]
|
|
470
308
|
}
|
|
471
309
|
) });
|
|
472
310
|
}
|
|
473
311
|
|
|
474
312
|
// src/components/connect-modal/wallet-list/WalletList.tsx
|
|
475
|
-
import { jsx as
|
|
476
|
-
function WalletList({ selectedWalletName,
|
|
477
|
-
|
|
478
|
-
return /* @__PURE__ */ jsx14("ul", { className: container6, children: wallets.length > 0 ? wallets.map((wallet) => /* @__PURE__ */ jsx14(
|
|
313
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
314
|
+
function WalletList({ selectedWalletName, onSelect, wallets }) {
|
|
315
|
+
return /* @__PURE__ */ jsx7("ul", { className: container2, children: wallets.map((wallet) => /* @__PURE__ */ jsx7(
|
|
479
316
|
WalletListItem,
|
|
480
317
|
{
|
|
481
318
|
name: wallet.name,
|
|
@@ -484,236 +321,611 @@ function WalletList({ selectedWalletName, onPlaceholderClick, onSelect }) {
|
|
|
484
321
|
onClick: () => onSelect(wallet)
|
|
485
322
|
},
|
|
486
323
|
getWalletUniqueIdentifier(wallet)
|
|
487
|
-
))
|
|
488
|
-
WalletListItem,
|
|
489
|
-
{
|
|
490
|
-
name: "Iota Wallet",
|
|
491
|
-
icon: /* @__PURE__ */ jsx14(IotaIcon, {}),
|
|
492
|
-
onClick: onPlaceholderClick,
|
|
493
|
-
isSelected: true
|
|
494
|
-
}
|
|
495
|
-
) });
|
|
324
|
+
)) });
|
|
496
325
|
}
|
|
497
326
|
|
|
498
|
-
// src/components/connect-modal/
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
327
|
+
// src/components/connect-modal/views/WalletConnect.css.ts
|
|
328
|
+
var confirmText = "WalletConnect_confirmText__uo0o3s6";
|
|
329
|
+
var errorContainer = "WalletConnect_errorContainer__uo0o3s2";
|
|
330
|
+
var errorMessage = "WalletConnect_errorMessage__uo0o3s3";
|
|
331
|
+
var openingText = "WalletConnect_openingText__uo0o3s5";
|
|
332
|
+
var separator2 = "WalletConnect_separator__uo0o3s7";
|
|
333
|
+
var successContainer = "WalletConnect_successContainer__uo0o3s4";
|
|
334
|
+
var walletConnectContainer = "WalletConnect_walletConnectContainer__uo0o3s0";
|
|
335
|
+
var walletConnectFooter = "WalletConnect_walletConnectFooter__uo0o3s1";
|
|
336
|
+
|
|
337
|
+
// src/components/ui/Button.tsx
|
|
338
|
+
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
339
|
+
import clsx4 from "clsx";
|
|
340
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
341
|
+
|
|
342
|
+
// src/components/ui/Button.css.ts
|
|
343
|
+
import { createRuntimeFn as _7a4682 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
344
|
+
var buttonVariants = _7a4682({ defaultClassName: "Button_buttonVariants__ctbx2n0", variantClassNames: { variant: { primary: "Button_buttonVariants_variant_primary__ctbx2n1", outline: "Button_buttonVariants_variant_outline__ctbx2n2" }, size: { md: "Button_buttonVariants_size_md__ctbx2n3", lg: "Button_buttonVariants_size_lg__ctbx2n4" } }, defaultVariants: { variant: "primary", size: "md" }, compoundVariants: [] });
|
|
345
|
+
|
|
346
|
+
// src/components/ui/Button.tsx
|
|
347
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
348
|
+
var Button = forwardRef4(
|
|
349
|
+
({ className, variant, size, asChild = false, ...props }, forwardedRef) => {
|
|
350
|
+
const Comp = asChild ? Slot4 : "button";
|
|
351
|
+
return /* @__PURE__ */ jsx8(
|
|
352
|
+
Comp,
|
|
353
|
+
{
|
|
354
|
+
...props,
|
|
355
|
+
className: clsx4(buttonVariants({ variant, size }), className),
|
|
356
|
+
ref: forwardedRef
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
);
|
|
361
|
+
Button.displayName = "Button";
|
|
362
|
+
|
|
363
|
+
// src/components/connect-modal/views/WalletConnect.tsx
|
|
364
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
365
|
+
function WalletConnectListView({ wallets, onOpenChange }) {
|
|
503
366
|
const [selectedWallet, setSelectedWallet] = useState();
|
|
504
367
|
const { mutate, isError } = useConnectWallet();
|
|
505
|
-
|
|
368
|
+
function handleSelectWallet(wallet) {
|
|
369
|
+
if (getWalletUniqueIdentifier(selectedWallet) !== getWalletUniqueIdentifier(wallet)) {
|
|
370
|
+
setSelectedWallet(wallet);
|
|
371
|
+
connectWallet(wallet);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function resetSelection() {
|
|
506
375
|
setSelectedWallet(void 0);
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
if (!open2) {
|
|
376
|
+
}
|
|
377
|
+
function handleOpenChange(open) {
|
|
378
|
+
if (!open) {
|
|
511
379
|
resetSelection();
|
|
512
380
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
const connectWallet = (wallet) => {
|
|
517
|
-
setCurrentView("connection-status");
|
|
381
|
+
onOpenChange(open);
|
|
382
|
+
}
|
|
383
|
+
function connectWallet(wallet) {
|
|
518
384
|
mutate(
|
|
519
385
|
{ wallet },
|
|
520
386
|
{
|
|
521
387
|
onSuccess: () => handleOpenChange(false)
|
|
522
388
|
}
|
|
523
389
|
);
|
|
524
|
-
};
|
|
525
|
-
let modalContent;
|
|
526
|
-
switch (currentView) {
|
|
527
|
-
case "what-is-a-wallet":
|
|
528
|
-
modalContent = /* @__PURE__ */ jsx15(WhatIsAWallet, {});
|
|
529
|
-
break;
|
|
530
|
-
case "getting-started":
|
|
531
|
-
modalContent = /* @__PURE__ */ jsx15(GettingStarted, {});
|
|
532
|
-
break;
|
|
533
|
-
case "connection-status":
|
|
534
|
-
modalContent = /* @__PURE__ */ jsx15(
|
|
535
|
-
ConnectionStatus,
|
|
536
|
-
{
|
|
537
|
-
selectedWallet,
|
|
538
|
-
hadConnectionError: isError,
|
|
539
|
-
onRetryConnection: connectWallet
|
|
540
|
-
}
|
|
541
|
-
);
|
|
542
|
-
break;
|
|
543
|
-
default:
|
|
544
|
-
modalContent = /* @__PURE__ */ jsx15(WhatIsAWallet, {});
|
|
545
390
|
}
|
|
546
|
-
return /* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
WalletList,
|
|
560
|
-
{
|
|
561
|
-
selectedWalletName: getWalletUniqueIdentifier(
|
|
562
|
-
selectedWallet
|
|
563
|
-
),
|
|
564
|
-
onPlaceholderClick: () => setCurrentView("getting-started"),
|
|
565
|
-
onSelect: (wallet) => {
|
|
566
|
-
if (getWalletUniqueIdentifier(selectedWallet) !== getWalletUniqueIdentifier(wallet)) {
|
|
567
|
-
setSelectedWallet(wallet);
|
|
568
|
-
connectWallet(wallet);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
)
|
|
573
|
-
] }),
|
|
574
|
-
/* @__PURE__ */ jsx15(
|
|
575
|
-
"button",
|
|
576
|
-
{
|
|
577
|
-
className: whatIsAWalletButton,
|
|
578
|
-
onClick: () => setCurrentView("what-is-a-wallet"),
|
|
579
|
-
type: "button",
|
|
580
|
-
children: "What is a Wallet?"
|
|
581
|
-
}
|
|
582
|
-
)
|
|
583
|
-
]
|
|
584
|
-
}
|
|
585
|
-
),
|
|
586
|
-
/* @__PURE__ */ jsxs7(
|
|
587
|
-
"div",
|
|
391
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
392
|
+
/* @__PURE__ */ jsx9("div", { className: walletConnectContainer, children: /* @__PURE__ */ jsx9(
|
|
393
|
+
WalletList,
|
|
394
|
+
{
|
|
395
|
+
selectedWalletName: getWalletUniqueIdentifier(selectedWallet),
|
|
396
|
+
onSelect: handleSelectWallet,
|
|
397
|
+
wallets
|
|
398
|
+
}
|
|
399
|
+
) }),
|
|
400
|
+
selectedWallet && /* @__PURE__ */ jsx9("div", { className: walletConnectFooter, children: isError ? /* @__PURE__ */ jsxs2("div", { className: errorContainer, children: [
|
|
401
|
+
/* @__PURE__ */ jsx9("p", { className: errorMessage, children: "Connection failed" }),
|
|
402
|
+
/* @__PURE__ */ jsx9(
|
|
403
|
+
Button,
|
|
588
404
|
{
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
children:
|
|
593
|
-
/* @__PURE__ */ jsx15("div", { className: backButtonContainer, children: /* @__PURE__ */ jsx15(
|
|
594
|
-
IconButton,
|
|
595
|
-
{
|
|
596
|
-
type: "button",
|
|
597
|
-
"aria-label": "Back",
|
|
598
|
-
onClick: () => resetSelection(),
|
|
599
|
-
children: /* @__PURE__ */ jsx15(BackIcon, {})
|
|
600
|
-
}
|
|
601
|
-
) }),
|
|
602
|
-
modalContent
|
|
603
|
-
]
|
|
405
|
+
size: "md",
|
|
406
|
+
variant: "outline",
|
|
407
|
+
onClick: () => connectWallet(selectedWallet),
|
|
408
|
+
children: "Retry"
|
|
604
409
|
}
|
|
605
|
-
)
|
|
606
|
-
|
|
607
|
-
|
|
410
|
+
)
|
|
411
|
+
] }) : /* @__PURE__ */ jsxs2("div", { className: successContainer, children: [
|
|
412
|
+
/* @__PURE__ */ jsxs2("p", { className: openingText, children: [
|
|
413
|
+
"Opening ",
|
|
414
|
+
selectedWallet.name,
|
|
415
|
+
"..."
|
|
416
|
+
] }),
|
|
417
|
+
/* @__PURE__ */ jsx9("div", { className: separator2 }),
|
|
418
|
+
/* @__PURE__ */ jsx9("p", { className: confirmText, children: "Please confirm the connection in your wallet" })
|
|
419
|
+
] }) })
|
|
608
420
|
] });
|
|
609
421
|
}
|
|
610
422
|
|
|
611
|
-
// src/
|
|
612
|
-
function
|
|
613
|
-
|
|
423
|
+
// src/utils/stateStorage.ts
|
|
424
|
+
function createInMemoryStore() {
|
|
425
|
+
const store = /* @__PURE__ */ new Map();
|
|
426
|
+
return {
|
|
427
|
+
getItem(key) {
|
|
428
|
+
return store.get(key);
|
|
429
|
+
},
|
|
430
|
+
setItem(key, value) {
|
|
431
|
+
store.set(key, value);
|
|
432
|
+
},
|
|
433
|
+
removeItem(key) {
|
|
434
|
+
store.delete(key);
|
|
435
|
+
}
|
|
436
|
+
};
|
|
614
437
|
}
|
|
615
438
|
|
|
616
|
-
// src/
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
439
|
+
// src/constants/walletDefaults.ts
|
|
440
|
+
var IOTA_WALLET_NAME = "Iota Wallet";
|
|
441
|
+
var DEFAULT_STORAGE = typeof window !== "undefined" && window.localStorage ? localStorage : createInMemoryStore();
|
|
442
|
+
var DEFAULT_STORAGE_KEY = "iota-dapp-kit:wallet-connection-info";
|
|
443
|
+
var DEFAULT_REQUIRED_FEATURES = [
|
|
444
|
+
"iota:signTransactionBlock"
|
|
445
|
+
];
|
|
446
|
+
var DEFAULT_PREFERRED_WALLETS = [IOTA_WALLET_NAME];
|
|
447
|
+
var WALLET_CHROME_EXTENSION_ID = "TODO";
|
|
448
|
+
var WALLET_DOWNLOAD_URL = "https://chromewebstore.google.com/detail/" + WALLET_CHROME_EXTENSION_ID;
|
|
449
|
+
|
|
450
|
+
// src/components/icons/ArrowTopRightIcon.tsx
|
|
451
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
452
|
+
function ArrowTopRightIcon(props) {
|
|
453
|
+
return /* @__PURE__ */ jsx10(
|
|
454
|
+
"svg",
|
|
455
|
+
{
|
|
456
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
457
|
+
width: "24",
|
|
458
|
+
height: "24",
|
|
459
|
+
viewBox: "0 0 24 24",
|
|
460
|
+
fill: "none",
|
|
461
|
+
...props,
|
|
462
|
+
children: /* @__PURE__ */ jsx10(
|
|
463
|
+
"path",
|
|
464
|
+
{
|
|
465
|
+
d: "M17.4825 6.29014C17.3873 6.19563 17.2778 6.12421 17.161 6.07588C17.0431 6.02699 16.9138 6 16.7782 6L8.70711 6C8.15482 6 7.70711 6.44772 7.70711 7C7.70711 7.55228 8.15482 8 8.70711 8L14.364 8L6.29289 16.0711C5.90237 16.4616 5.90237 17.0948 6.29289 17.4853C6.68342 17.8758 7.31658 17.8758 7.70711 17.4853L15.7782 9.41421V15.0711C15.7782 15.6234 16.2259 16.0711 16.7782 16.0711C17.3305 16.0711 17.7782 15.6234 17.7782 15.0711L17.7782 7.0008C17.7782 6.86458 17.7509 6.73391 17.7016 6.61556C17.6531 6.49895 17.5816 6.38966 17.487 6.29464L17.4853 6.29289L17.4825 6.29014Z",
|
|
466
|
+
fill: "currentColor"
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
}
|
|
626
472
|
|
|
627
|
-
// src/components/
|
|
628
|
-
import {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
473
|
+
// src/components/icons/IotaIcon.tsx
|
|
474
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
475
|
+
function IotaIcon(props) {
|
|
476
|
+
return /* @__PURE__ */ jsxs3(
|
|
477
|
+
"svg",
|
|
478
|
+
{
|
|
479
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
480
|
+
width: "24",
|
|
481
|
+
height: "24",
|
|
482
|
+
viewBox: "0 0 24 24",
|
|
483
|
+
fill: "none",
|
|
484
|
+
...props,
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ jsx11(
|
|
487
|
+
"path",
|
|
488
|
+
{
|
|
489
|
+
d: "M18.2698 2.25899C18.2698 2.95431 17.7023 3.51797 17.0023 3.51797C16.3024 3.51797 15.7349 2.95431 15.7349 2.25899C15.7349 1.56367 16.3024 1 17.0023 1C17.7023 1 18.2698 1.56367 18.2698 2.25899Z",
|
|
490
|
+
fill: "currentColor"
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
/* @__PURE__ */ jsx11(
|
|
494
|
+
"path",
|
|
495
|
+
{
|
|
496
|
+
d: "M19.6946 20.0436C19.6946 20.7389 19.1272 21.3026 18.4272 21.3026C17.7272 21.3026 17.1598 20.7389 17.1598 20.0436C17.1598 19.3483 17.7272 18.7846 18.4272 18.7846C19.1272 18.7846 19.6946 19.3483 19.6946 20.0436Z",
|
|
497
|
+
fill: "currentColor"
|
|
498
|
+
}
|
|
499
|
+
),
|
|
500
|
+
/* @__PURE__ */ jsx11(
|
|
501
|
+
"path",
|
|
502
|
+
{
|
|
503
|
+
d: "M17.3647 6.66519C17.952 6.66519 18.4282 6.19222 18.4282 5.60878C18.4282 5.02534 17.952 4.55236 17.3647 4.55236C16.7773 4.55236 16.3012 5.02534 16.3012 5.60878C16.3012 6.19222 16.7773 6.66519 17.3647 6.66519Z",
|
|
504
|
+
fill: "currentColor"
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
/* @__PURE__ */ jsx11(
|
|
508
|
+
"path",
|
|
509
|
+
{
|
|
510
|
+
d: "M21.2564 6.01379C21.2564 6.59723 20.7802 7.0702 20.1929 7.0702C19.6055 7.0702 19.1294 6.59723 19.1294 6.01379C19.1294 5.43034 19.6055 4.95737 20.1929 4.95737C20.7802 4.95737 21.2564 5.43034 21.2564 6.01379Z",
|
|
511
|
+
fill: "currentColor"
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
/* @__PURE__ */ jsx11(
|
|
515
|
+
"path",
|
|
516
|
+
{
|
|
517
|
+
d: "M17.0027 9.34312C17.5028 9.34312 17.9083 8.94036 17.9083 8.44353C17.9083 7.9467 17.5028 7.54394 17.0027 7.54394C16.5026 7.54394 16.0971 7.9467 16.0971 8.44353C16.0971 8.94036 16.5026 9.34312 17.0027 9.34312Z",
|
|
518
|
+
fill: "currentColor"
|
|
519
|
+
}
|
|
520
|
+
),
|
|
521
|
+
/* @__PURE__ */ jsx11(
|
|
522
|
+
"path",
|
|
523
|
+
{
|
|
524
|
+
d: "M20.7373 8.82346C20.7373 9.32029 20.3318 9.72305 19.8317 9.72305C19.3315 9.72305 18.9261 9.32029 18.9261 8.82346C18.9261 8.32663 19.3315 7.92388 19.8317 7.92388C20.3318 7.92388 20.7373 8.32663 20.7373 8.82346Z",
|
|
525
|
+
fill: "currentColor"
|
|
526
|
+
}
|
|
527
|
+
),
|
|
528
|
+
/* @__PURE__ */ jsx11(
|
|
529
|
+
"path",
|
|
530
|
+
{
|
|
531
|
+
d: "M22.0944 10.6007C22.5945 10.6007 23 10.1979 23 9.70111C23 9.20428 22.5945 8.80152 22.0944 8.80152C21.5942 8.80152 21.1888 9.20428 21.1888 9.70111C21.1888 10.1979 21.5942 10.6007 22.0944 10.6007Z",
|
|
532
|
+
fill: "currentColor"
|
|
533
|
+
}
|
|
534
|
+
),
|
|
535
|
+
/* @__PURE__ */ jsx11(
|
|
536
|
+
"path",
|
|
537
|
+
{
|
|
538
|
+
d: "M19.7849 11.0954C19.7849 11.5297 19.4305 11.8817 18.9933 11.8817C18.5562 11.8817 18.2018 11.5297 18.2018 11.0954C18.2018 10.6611 18.5562 10.3091 18.9933 10.3091C19.4305 10.3091 19.7849 10.6611 19.7849 11.0954Z",
|
|
539
|
+
fill: "currentColor"
|
|
540
|
+
}
|
|
541
|
+
),
|
|
542
|
+
/* @__PURE__ */ jsx11(
|
|
543
|
+
"path",
|
|
544
|
+
{
|
|
545
|
+
d: "M16.1651 11.4988C16.6023 11.4988 16.9567 11.1467 16.9567 10.7124C16.9567 10.2782 16.6023 9.92612 16.1651 9.92612C15.7279 9.92612 15.3735 10.2782 15.3735 10.7124C15.3735 11.1467 15.7279 11.4988 16.1651 11.4988Z",
|
|
546
|
+
fill: "currentColor"
|
|
547
|
+
}
|
|
548
|
+
),
|
|
549
|
+
/* @__PURE__ */ jsx11(
|
|
550
|
+
"path",
|
|
551
|
+
{
|
|
552
|
+
d: "M22.0722 11.9708C22.0722 12.405 21.7178 12.7571 21.2806 12.7571C20.8434 12.7571 20.489 12.405 20.489 11.9708C20.489 11.5365 20.8434 11.1845 21.2806 11.1845C21.7178 11.1845 22.0722 11.5365 22.0722 11.9708Z",
|
|
553
|
+
fill: "currentColor"
|
|
554
|
+
}
|
|
555
|
+
),
|
|
556
|
+
/* @__PURE__ */ jsx11(
|
|
557
|
+
"path",
|
|
558
|
+
{
|
|
559
|
+
d: "M17.8618 13.5243C18.2372 13.5243 18.5415 13.222 18.5415 12.849C18.5415 12.4761 18.2372 12.1738 17.8618 12.1738C17.4864 12.1738 17.182 12.4761 17.182 12.849C17.182 13.222 17.4864 13.5243 17.8618 13.5243Z",
|
|
560
|
+
fill: "currentColor"
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
/* @__PURE__ */ jsx11(
|
|
564
|
+
"path",
|
|
565
|
+
{
|
|
566
|
+
d: "M20.8296 13.7024C20.8296 14.0753 20.5252 14.3776 20.1498 14.3776C19.7744 14.3776 19.4701 14.0753 19.4701 13.7024C19.4701 13.3294 19.7744 13.0271 20.1498 13.0271C20.5252 13.0271 20.8296 13.3294 20.8296 13.7024Z",
|
|
567
|
+
fill: "currentColor"
|
|
568
|
+
}
|
|
569
|
+
),
|
|
570
|
+
/* @__PURE__ */ jsx11(
|
|
571
|
+
"path",
|
|
572
|
+
{
|
|
573
|
+
d: "M15.0558 13.12C15.4312 13.12 15.7356 12.8177 15.7356 12.4448C15.7356 12.0719 15.4312 11.7695 15.0558 11.7695C14.6804 11.7695 14.3761 12.0719 14.3761 12.4448C14.3761 12.8177 14.6804 13.12 15.0558 13.12Z",
|
|
574
|
+
fill: "currentColor"
|
|
575
|
+
}
|
|
576
|
+
),
|
|
577
|
+
/* @__PURE__ */ jsx11(
|
|
578
|
+
"path",
|
|
579
|
+
{
|
|
580
|
+
d: "M17.1825 14.0625C17.1825 14.3729 16.9292 14.6245 16.6168 14.6245C16.3043 14.6245 16.0511 14.3729 16.0511 14.0625C16.0511 13.7521 16.3043 13.5005 16.6168 13.5005C16.9292 13.5005 17.1825 13.7521 17.1825 14.0625Z",
|
|
581
|
+
fill: "currentColor"
|
|
582
|
+
}
|
|
583
|
+
),
|
|
584
|
+
/* @__PURE__ */ jsx11(
|
|
585
|
+
"path",
|
|
586
|
+
{
|
|
587
|
+
d: "M17.59 16.1771C17.8649 16.1771 18.0878 15.9557 18.0878 15.6826C18.0878 15.4095 17.8649 15.1882 17.59 15.1882C17.3151 15.1882 17.0923 15.4095 17.0923 15.6826C17.0923 15.9557 17.3151 16.1771 17.59 16.1771Z",
|
|
588
|
+
fill: "currentColor"
|
|
589
|
+
}
|
|
590
|
+
),
|
|
591
|
+
/* @__PURE__ */ jsx11(
|
|
592
|
+
"path",
|
|
593
|
+
{
|
|
594
|
+
d: "M16.7985 16.0872C16.7985 16.311 16.6159 16.4924 16.3906 16.4924C16.1654 16.4924 15.9828 16.311 15.9828 16.0872C15.9828 15.8635 16.1654 15.6821 16.3906 15.6821C16.6159 15.6821 16.7985 15.8635 16.7985 16.0872Z",
|
|
595
|
+
fill: "currentColor"
|
|
596
|
+
}
|
|
597
|
+
),
|
|
598
|
+
/* @__PURE__ */ jsx11(
|
|
599
|
+
"path",
|
|
600
|
+
{
|
|
601
|
+
d: "M15.3273 15.3222C15.6022 15.3222 15.825 15.1008 15.825 14.8278C15.825 14.5547 15.6022 14.3333 15.3273 14.3333C15.0524 14.3333 14.8295 14.5547 14.8295 14.8278C14.8295 15.1008 15.0524 15.3222 15.3273 15.3222Z",
|
|
602
|
+
fill: "currentColor"
|
|
603
|
+
}
|
|
604
|
+
),
|
|
605
|
+
/* @__PURE__ */ jsx11(
|
|
606
|
+
"path",
|
|
607
|
+
{
|
|
608
|
+
d: "M14.3535 13.6818C14.3535 13.9922 14.1003 14.2438 13.7878 14.2438C13.4754 14.2438 13.2221 13.9922 13.2221 13.6818C13.2221 13.3714 13.4754 13.1198 13.7878 13.1198C14.1003 13.1198 14.3535 13.3714 14.3535 13.6818Z",
|
|
609
|
+
fill: "currentColor"
|
|
610
|
+
}
|
|
611
|
+
),
|
|
612
|
+
/* @__PURE__ */ jsx11(
|
|
613
|
+
"path",
|
|
614
|
+
{
|
|
615
|
+
d: "M13.7663 10.0159C14.0788 10.0159 14.3321 9.76428 14.3321 9.45391C14.3321 9.14355 14.0788 8.89194 13.7663 8.89194C13.4539 8.89194 13.2006 9.14355 13.2006 9.45391C13.2006 9.76428 13.4539 10.0159 13.7663 10.0159Z",
|
|
616
|
+
fill: "currentColor"
|
|
617
|
+
}
|
|
618
|
+
),
|
|
619
|
+
/* @__PURE__ */ jsx11(
|
|
620
|
+
"path",
|
|
621
|
+
{
|
|
622
|
+
d: "M14.5115 7.54296C14.5115 7.81603 14.2886 8.03741 14.0137 8.03741C13.7388 8.03741 13.516 7.81603 13.516 7.54296C13.516 7.26988 13.7388 7.04851 14.0137 7.04851C14.2886 7.04851 14.5115 7.26988 14.5115 7.54296Z",
|
|
623
|
+
fill: "currentColor"
|
|
624
|
+
}
|
|
625
|
+
),
|
|
626
|
+
/* @__PURE__ */ jsx11(
|
|
627
|
+
"path",
|
|
628
|
+
{
|
|
629
|
+
d: "M14.5576 6.41961C14.7828 6.41961 14.9654 6.23823 14.9654 6.01447C14.9654 5.79072 14.7828 5.60933 14.5576 5.60933C14.3323 5.60933 14.1497 5.79072 14.1497 6.01447C14.1497 6.23823 14.3323 6.41961 14.5576 6.41961Z",
|
|
630
|
+
fill: "currentColor"
|
|
631
|
+
}
|
|
632
|
+
),
|
|
633
|
+
/* @__PURE__ */ jsx11(
|
|
634
|
+
"path",
|
|
635
|
+
{
|
|
636
|
+
d: "M14.1056 5.16003C14.1056 5.4331 13.8827 5.65448 13.6078 5.65448C13.3329 5.65448 13.1101 5.4331 13.1101 5.16003C13.1101 4.88695 13.3329 4.66558 13.6078 4.66558C13.8827 4.66558 14.1056 4.88695 14.1056 5.16003Z",
|
|
637
|
+
fill: "currentColor"
|
|
638
|
+
}
|
|
639
|
+
),
|
|
640
|
+
/* @__PURE__ */ jsx11(
|
|
641
|
+
"path",
|
|
642
|
+
{
|
|
643
|
+
d: "M18.8818 15.4808C19.1943 15.4808 19.4475 15.2292 19.4475 14.9189C19.4475 14.6085 19.1943 14.3569 18.8818 14.3569C18.5694 14.3569 18.3161 14.6085 18.3161 14.9189C18.3161 15.2292 18.5694 15.4808 18.8818 15.4808Z",
|
|
644
|
+
fill: "currentColor"
|
|
645
|
+
}
|
|
646
|
+
),
|
|
647
|
+
/* @__PURE__ */ jsx11(
|
|
648
|
+
"path",
|
|
649
|
+
{
|
|
650
|
+
d: "M12.8827 4.43881C12.8827 4.74918 12.6294 5.00078 12.3169 5.00078C12.0045 5.00078 11.7512 4.74918 11.7512 4.43881C11.7512 4.12845 12.0045 3.87684 12.3169 3.87684C12.6294 3.87684 12.8827 4.12845 12.8827 4.43881Z",
|
|
651
|
+
fill: "currentColor"
|
|
652
|
+
}
|
|
653
|
+
),
|
|
654
|
+
/* @__PURE__ */ jsx11(
|
|
655
|
+
"path",
|
|
656
|
+
{
|
|
657
|
+
d: "M12.7029 7.38447C13.0153 7.38447 13.2686 7.13287 13.2686 6.8225C13.2686 6.51214 13.0153 6.26053 12.7029 6.26053C12.3904 6.26053 12.1371 6.51214 12.1371 6.8225C12.1371 7.13287 12.3904 7.38447 12.7029 7.38447Z",
|
|
658
|
+
fill: "currentColor"
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
/* @__PURE__ */ jsx11(
|
|
662
|
+
"path",
|
|
663
|
+
{
|
|
664
|
+
d: "M12.7485 8.98132C12.7485 9.35424 12.4442 9.65656 12.0688 9.65656C11.6934 9.65656 11.389 9.35424 11.389 8.98132C11.389 8.6084 11.6934 8.30609 12.0688 8.30609C12.4442 8.30609 12.7485 8.6084 12.7485 8.98132Z",
|
|
665
|
+
fill: "currentColor"
|
|
666
|
+
}
|
|
667
|
+
),
|
|
668
|
+
/* @__PURE__ */ jsx11(
|
|
669
|
+
"path",
|
|
670
|
+
{
|
|
671
|
+
d: "M10.0077 9.65685C10.4448 9.65685 10.7992 9.3048 10.7992 8.87053C10.7992 8.43626 10.4448 8.08421 10.0077 8.08421C9.57049 8.08421 9.21609 8.43626 9.21609 8.87053C9.21609 9.3048 9.57049 9.65685 10.0077 9.65685Z",
|
|
672
|
+
fill: "currentColor"
|
|
673
|
+
}
|
|
674
|
+
),
|
|
675
|
+
/* @__PURE__ */ jsx11(
|
|
676
|
+
"path",
|
|
677
|
+
{
|
|
678
|
+
d: "M8.51443 9.29686C8.51443 9.79369 8.10898 10.1964 7.60883 10.1964C7.10868 10.1964 6.70323 9.79369 6.70323 9.29686C6.70323 8.80003 7.10868 8.39727 7.60883 8.39727C8.10898 8.39727 8.51443 8.80003 8.51443 9.29686Z",
|
|
679
|
+
fill: "currentColor"
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ jsx11(
|
|
683
|
+
"path",
|
|
684
|
+
{
|
|
685
|
+
d: "M4.98453 11.4774C5.57188 11.4774 6.04801 11.0044 6.04801 10.421C6.04801 9.83755 5.57188 9.36458 4.98453 9.36458C4.39719 9.36458 3.92105 9.83755 3.92105 10.421C3.92105 11.0044 4.39719 11.4774 4.98453 11.4774Z",
|
|
686
|
+
fill: "currentColor"
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
/* @__PURE__ */ jsx11(
|
|
690
|
+
"path",
|
|
691
|
+
{
|
|
692
|
+
d: "M3.53481 12.3773C3.53481 13.0726 2.96737 13.6363 2.2674 13.6363C1.56744 13.6363 1 13.0726 1 12.3773C1 11.682 1.56744 11.1183 2.2674 11.1183C2.96737 11.1183 3.53481 11.682 3.53481 12.3773Z",
|
|
693
|
+
fill: "currentColor"
|
|
694
|
+
}
|
|
695
|
+
),
|
|
696
|
+
/* @__PURE__ */ jsx11(
|
|
697
|
+
"path",
|
|
698
|
+
{
|
|
699
|
+
d: "M3.92108 8.846C4.50842 8.846 4.98455 8.37303 4.98455 7.78959C4.98455 7.20614 4.50842 6.73317 3.92108 6.73317C3.33373 6.73317 2.8576 7.20614 2.8576 7.78959C2.8576 8.37303 3.33373 8.846 3.92108 8.846Z",
|
|
700
|
+
fill: "currentColor"
|
|
701
|
+
}
|
|
702
|
+
),
|
|
703
|
+
/* @__PURE__ */ jsx11(
|
|
704
|
+
"path",
|
|
705
|
+
{
|
|
706
|
+
d: "M7.45097 6.66545C7.45097 7.16228 7.04552 7.56504 6.54537 7.56504C6.04522 7.56504 5.63977 7.16228 5.63977 6.66545C5.63977 6.16862 6.04522 5.76586 6.54537 5.76586C7.04552 5.76586 7.45097 6.16862 7.45097 6.66545Z",
|
|
707
|
+
fill: "currentColor"
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
/* @__PURE__ */ jsx11(
|
|
711
|
+
"path",
|
|
712
|
+
{
|
|
713
|
+
d: "M6.16173 5.18211C6.66188 5.18211 7.06733 4.77935 7.06733 4.28252C7.06733 3.78569 6.66188 3.38293 6.16173 3.38293C5.66158 3.38293 5.25613 3.78569 5.25613 4.28252C5.25613 4.77935 5.66158 5.18211 6.16173 5.18211Z",
|
|
714
|
+
fill: "currentColor"
|
|
715
|
+
}
|
|
716
|
+
),
|
|
717
|
+
/* @__PURE__ */ jsx11(
|
|
718
|
+
"path",
|
|
719
|
+
{
|
|
720
|
+
d: "M9.35214 3.85619C9.35214 4.29046 8.99774 4.64251 8.56057 4.64251C8.12339 4.64251 7.76899 4.29046 7.76899 3.85619C7.76899 3.42192 8.12339 3.06987 8.56057 3.06987C8.99774 3.06987 9.35214 3.42192 9.35214 3.85619Z",
|
|
721
|
+
fill: "currentColor"
|
|
722
|
+
}
|
|
723
|
+
),
|
|
724
|
+
/* @__PURE__ */ jsx11(
|
|
725
|
+
"path",
|
|
726
|
+
{
|
|
727
|
+
d: "M10.6194 4.64374C10.9948 4.64374 11.2991 4.34143 11.2991 3.9685C11.2991 3.59558 10.9948 3.29327 10.6194 3.29327C10.244 3.29327 9.93964 3.59558 9.93964 3.9685C9.93964 4.34143 10.244 4.64374 10.6194 4.64374Z",
|
|
728
|
+
fill: "currentColor"
|
|
729
|
+
}
|
|
730
|
+
),
|
|
731
|
+
/* @__PURE__ */ jsx11(
|
|
732
|
+
"path",
|
|
733
|
+
{
|
|
734
|
+
d: "M11.6828 6.3522C11.6828 6.72512 11.3784 7.02743 11.003 7.02743C10.6276 7.02743 10.3233 6.72512 10.3233 6.3522C10.3233 5.97927 10.6276 5.67696 11.003 5.67696C11.3784 5.67696 11.6828 5.97927 11.6828 6.3522Z",
|
|
735
|
+
fill: "currentColor"
|
|
736
|
+
}
|
|
737
|
+
),
|
|
738
|
+
/* @__PURE__ */ jsx11(
|
|
739
|
+
"path",
|
|
740
|
+
{
|
|
741
|
+
d: "M8.94421 7.04748C9.38139 7.04748 9.73579 6.69543 9.73579 6.26116C9.73579 5.82688 9.38139 5.47484 8.94421 5.47484C8.50703 5.47484 8.15263 5.82688 8.15263 6.26116C8.15263 6.69543 8.50703 7.04748 8.94421 7.04748Z",
|
|
742
|
+
fill: "currentColor"
|
|
743
|
+
}
|
|
744
|
+
),
|
|
745
|
+
/* @__PURE__ */ jsx11(
|
|
746
|
+
"path",
|
|
747
|
+
{
|
|
748
|
+
d: "M7.1115 12.6253C7.1115 12.849 6.9289 13.0304 6.70365 13.0304C6.4784 13.0304 6.2958 12.849 6.2958 12.6253C6.2958 12.4015 6.4784 12.2201 6.70365 12.2201C6.9289 12.2201 7.1115 12.4015 7.1115 12.6253Z",
|
|
749
|
+
fill: "currentColor"
|
|
750
|
+
}
|
|
751
|
+
),
|
|
752
|
+
/* @__PURE__ */ jsx11(
|
|
753
|
+
"path",
|
|
754
|
+
{
|
|
755
|
+
d: "M8.33273 12.8261C8.60763 12.8261 8.83048 12.6047 8.83048 12.3316C8.83048 12.0585 8.60763 11.8372 8.33273 11.8372C8.05782 11.8372 7.83497 12.0585 7.83497 12.3316C7.83497 12.6047 8.05782 12.8261 8.33273 12.8261Z",
|
|
756
|
+
fill: "currentColor"
|
|
757
|
+
}
|
|
758
|
+
),
|
|
759
|
+
/* @__PURE__ */ jsx11(
|
|
760
|
+
"path",
|
|
761
|
+
{
|
|
762
|
+
d: "M10.6874 11.5899C10.6874 11.9003 10.4342 12.1519 10.1217 12.1519C9.80928 12.1519 9.55599 11.9003 9.55599 11.5899C9.55599 11.2795 9.80928 11.0279 10.1217 11.0279C10.4342 11.0279 10.6874 11.2795 10.6874 11.5899Z",
|
|
763
|
+
fill: "currentColor"
|
|
764
|
+
}
|
|
765
|
+
),
|
|
766
|
+
/* @__PURE__ */ jsx11(
|
|
767
|
+
"path",
|
|
768
|
+
{
|
|
769
|
+
d: "M10.5519 13.9513C10.9273 13.9513 11.2316 13.649 11.2316 13.2761C11.2316 12.9031 10.9273 12.6008 10.5519 12.6008C10.1764 12.6008 9.87212 12.9031 9.87212 13.2761C9.87212 13.649 10.1764 13.9513 10.5519 13.9513Z",
|
|
770
|
+
fill: "currentColor"
|
|
771
|
+
}
|
|
772
|
+
),
|
|
773
|
+
/* @__PURE__ */ jsx11(
|
|
774
|
+
"path",
|
|
775
|
+
{
|
|
776
|
+
d: "M8.94418 13.8163C8.94418 14.1267 8.69089 14.3783 8.37845 14.3783C8.06601 14.3783 7.81272 14.1267 7.81272 13.8163C7.81272 13.5059 8.06601 13.2543 8.37845 13.2543C8.69089 13.2543 8.94418 13.5059 8.94418 13.8163Z",
|
|
777
|
+
fill: "currentColor"
|
|
778
|
+
}
|
|
779
|
+
),
|
|
780
|
+
/* @__PURE__ */ jsx11(
|
|
781
|
+
"path",
|
|
782
|
+
{
|
|
783
|
+
d: "M6.45595 14.3542C6.73085 14.3542 6.9537 14.1328 6.9537 13.8597C6.9537 13.5866 6.73085 13.3653 6.45595 13.3653C6.18105 13.3653 5.95819 13.5866 5.95819 13.8597C5.95819 14.1328 6.18105 14.3542 6.45595 14.3542Z",
|
|
784
|
+
fill: "currentColor"
|
|
785
|
+
}
|
|
786
|
+
),
|
|
787
|
+
/* @__PURE__ */ jsx11(
|
|
788
|
+
"path",
|
|
789
|
+
{
|
|
790
|
+
d: "M7.04361 15.3451C7.04361 15.6555 6.79033 15.9071 6.47788 15.9071C6.16544 15.9071 5.91216 15.6555 5.91216 15.3451C5.91216 15.0348 6.16544 14.7832 6.47788 14.7832C6.79033 14.7832 7.04361 15.0348 7.04361 15.3451Z",
|
|
791
|
+
fill: "currentColor"
|
|
792
|
+
}
|
|
793
|
+
),
|
|
794
|
+
/* @__PURE__ */ jsx11(
|
|
795
|
+
"path",
|
|
796
|
+
{
|
|
797
|
+
d: "M8.78634 16.1997C9.16176 16.1997 9.46609 15.8974 9.46609 15.5245C9.46609 15.1516 9.16176 14.8493 8.78634 14.8493C8.41093 14.8493 8.10659 15.1516 8.10659 15.5245C8.10659 15.8974 8.41093 16.1997 8.78634 16.1997Z",
|
|
798
|
+
fill: "currentColor"
|
|
799
|
+
}
|
|
800
|
+
),
|
|
801
|
+
/* @__PURE__ */ jsx11(
|
|
802
|
+
"path",
|
|
803
|
+
{
|
|
804
|
+
d: "M12.2709 15.1196C12.2709 15.5539 11.9165 15.906 11.4793 15.906C11.0421 15.906 10.6877 15.5539 10.6877 15.1196C10.6877 14.6854 11.0421 14.3333 11.4793 14.3333C11.9165 14.3333 12.2709 14.6854 12.2709 15.1196Z",
|
|
805
|
+
fill: "currentColor"
|
|
806
|
+
}
|
|
807
|
+
),
|
|
808
|
+
/* @__PURE__ */ jsx11(
|
|
809
|
+
"path",
|
|
810
|
+
{
|
|
811
|
+
d: "M13.0642 17.8635C13.5644 17.8635 13.9698 17.4607 13.9698 16.9639C13.9698 16.4671 13.5644 16.0643 13.0642 16.0643C12.5641 16.0643 12.1586 16.4671 12.1586 16.9639C12.1586 17.4607 12.5641 17.8635 13.0642 17.8635Z",
|
|
812
|
+
fill: "currentColor"
|
|
813
|
+
}
|
|
814
|
+
),
|
|
815
|
+
/* @__PURE__ */ jsx11(
|
|
816
|
+
"path",
|
|
817
|
+
{
|
|
818
|
+
d: "M10.5276 17.3445C10.5276 17.7788 10.1732 18.1308 9.73605 18.1308C9.29887 18.1308 8.94447 17.7788 8.94447 17.3445C8.94447 16.9103 9.29887 16.5582 9.73605 16.5582C10.1732 16.5582 10.5276 16.9103 10.5276 17.3445Z",
|
|
819
|
+
fill: "currentColor"
|
|
820
|
+
}
|
|
821
|
+
),
|
|
822
|
+
/* @__PURE__ */ jsx11(
|
|
823
|
+
"path",
|
|
824
|
+
{
|
|
825
|
+
d: "M7.8585 19.6612C8.29568 19.6612 8.65008 19.3092 8.65008 18.8749C8.65008 18.4406 8.29568 18.0886 7.8585 18.0886C7.42132 18.0886 7.06692 18.4406 7.06692 18.8749C7.06692 19.3092 7.42132 19.6612 7.8585 19.6612Z",
|
|
826
|
+
fill: "currentColor"
|
|
827
|
+
}
|
|
828
|
+
),
|
|
829
|
+
/* @__PURE__ */ jsx11(
|
|
830
|
+
"path",
|
|
831
|
+
{
|
|
832
|
+
d: "M10.3252 20.7404C10.3252 21.2372 9.91977 21.64 9.41962 21.64C8.91947 21.64 8.51402 21.2372 8.51402 20.7404C8.51402 20.2436 8.91947 19.8408 9.41962 19.8408C9.91977 19.8408 10.3252 20.2436 10.3252 20.7404Z",
|
|
833
|
+
fill: "currentColor"
|
|
834
|
+
}
|
|
835
|
+
),
|
|
836
|
+
/* @__PURE__ */ jsx11(
|
|
837
|
+
"path",
|
|
838
|
+
{
|
|
839
|
+
d: "M13.5843 22C14.1716 22 14.6477 21.527 14.6477 20.9436C14.6477 20.3601 14.1716 19.8872 13.5843 19.8872C12.9969 19.8872 12.5208 20.3601 12.5208 20.9436C12.5208 21.527 12.9969 22 13.5843 22Z",
|
|
840
|
+
fill: "currentColor"
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
/* @__PURE__ */ jsx11(
|
|
844
|
+
"path",
|
|
845
|
+
{
|
|
846
|
+
d: "M12.2051 19.2123C12.2051 19.7091 11.7996 20.1119 11.2995 20.1119C10.7993 20.1119 10.3939 19.7091 10.3939 19.2123C10.3939 18.7155 10.7993 18.3127 11.2995 18.3127C11.7996 18.3127 12.2051 18.7155 12.2051 19.2123Z",
|
|
847
|
+
fill: "currentColor"
|
|
848
|
+
}
|
|
849
|
+
),
|
|
850
|
+
/* @__PURE__ */ jsx11(
|
|
851
|
+
"path",
|
|
852
|
+
{
|
|
853
|
+
d: "M15.3275 19.7516C15.9149 19.7516 16.391 19.2786 16.391 18.6951C16.391 18.1117 15.9149 17.6387 15.3275 17.6387C14.7402 17.6387 14.2641 18.1117 14.2641 18.6951C14.2641 19.2786 14.7402 19.7516 15.3275 19.7516Z",
|
|
854
|
+
fill: "currentColor"
|
|
855
|
+
}
|
|
856
|
+
),
|
|
857
|
+
/* @__PURE__ */ jsx11(
|
|
858
|
+
"path",
|
|
859
|
+
{
|
|
860
|
+
d: "M7.58701 17.0534C7.58701 17.4263 7.28268 17.7286 6.90726 17.7286C6.53185 17.7286 6.22751 17.4263 6.22751 17.0534C6.22751 16.6804 6.53185 16.3781 6.90726 16.3781C7.28268 16.3781 7.58701 16.6804 7.58701 17.0534Z",
|
|
861
|
+
fill: "currentColor"
|
|
862
|
+
}
|
|
863
|
+
)
|
|
864
|
+
]
|
|
865
|
+
}
|
|
647
866
|
);
|
|
648
|
-
const currentNetwork = props.network ?? selectedNetwork;
|
|
649
|
-
const client = useMemo(() => {
|
|
650
|
-
return createClient2(currentNetwork, networks[currentNetwork]);
|
|
651
|
-
}, [createClient2, currentNetwork, networks]);
|
|
652
|
-
const ctx = useMemo(() => {
|
|
653
|
-
return {
|
|
654
|
-
client,
|
|
655
|
-
networks,
|
|
656
|
-
network: currentNetwork,
|
|
657
|
-
config: networks[currentNetwork] instanceof IotaClient ? null : networks[currentNetwork],
|
|
658
|
-
selectNetwork: (newNetwork) => {
|
|
659
|
-
if (currentNetwork === newNetwork) {
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
if (!network && newNetwork !== selectedNetwork) {
|
|
663
|
-
setSelectedNetwork(newNetwork);
|
|
664
|
-
}
|
|
665
|
-
onNetworkChange?.(newNetwork);
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
}, [client, networks, selectedNetwork, currentNetwork, network, onNetworkChange]);
|
|
669
|
-
return /* @__PURE__ */ jsx16(IotaClientContext.Provider, { value: ctx, children });
|
|
670
867
|
}
|
|
671
868
|
|
|
672
|
-
// src/
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
869
|
+
// src/components/connect-modal/views/GetTheWallet.css.ts
|
|
870
|
+
var button = "GetTheWallet_button__1iomrym3";
|
|
871
|
+
var container4 = "GetTheWallet_container__1iomrym0";
|
|
872
|
+
var content2 = "GetTheWallet_content__1iomrym1";
|
|
873
|
+
var icon = "GetTheWallet_icon__1iomrym4";
|
|
874
|
+
var text = "GetTheWallet_text__1iomrym2";
|
|
875
|
+
|
|
876
|
+
// src/components/connect-modal/views/GetTheWallet.tsx
|
|
877
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
878
|
+
function GetTheWalletView() {
|
|
879
|
+
return /* @__PURE__ */ jsxs4("div", { className: container4, children: [
|
|
880
|
+
/* @__PURE__ */ jsxs4("div", { className: content2, children: [
|
|
881
|
+
/* @__PURE__ */ jsx12(IotaIcon, { className: icon, width: 48, height: 48 }),
|
|
882
|
+
/* @__PURE__ */ jsx12("p", { className: text, children: "Don't have a wallet yet?" })
|
|
883
|
+
] }),
|
|
884
|
+
/* @__PURE__ */ jsx12("a", { href: WALLET_DOWNLOAD_URL, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxs4(Button, { size: "md", variant: "primary", className: button, children: [
|
|
885
|
+
"Get the IOTA wallet",
|
|
886
|
+
/* @__PURE__ */ jsx12(ArrowTopRightIcon, { width: 16, height: 16 })
|
|
887
|
+
] }) })
|
|
888
|
+
] });
|
|
684
889
|
}
|
|
685
890
|
|
|
686
|
-
// src/
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
891
|
+
// src/components/connect-modal/ConnectModal.tsx
|
|
892
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
893
|
+
function ConnectModal({ trigger, open, defaultOpen, onOpenChange }) {
|
|
894
|
+
const wallets = useWallets();
|
|
895
|
+
const [isModalOpen, setModalOpen] = useState2(open ?? defaultOpen);
|
|
896
|
+
const handleOpenChange = (open2) => {
|
|
897
|
+
setModalOpen(open2);
|
|
898
|
+
onOpenChange?.(open2);
|
|
899
|
+
};
|
|
900
|
+
return /* @__PURE__ */ jsxs5(Dialog.Root, { open: open ?? isModalOpen, onOpenChange: handleOpenChange, children: [
|
|
901
|
+
/* @__PURE__ */ jsx13(Dialog.Trigger, { asChild: true, children: trigger }),
|
|
902
|
+
/* @__PURE__ */ jsx13(Dialog.Portal, { children: /* @__PURE__ */ jsx13(StyleMarker, { children: /* @__PURE__ */ jsx13(Dialog.Overlay, { className: overlay, children: /* @__PURE__ */ jsxs5(Dialog.Content, { className: content, "aria-describedby": void 0, children: [
|
|
903
|
+
/* @__PURE__ */ jsxs5("div", { className: walletListContent, children: [
|
|
904
|
+
/* @__PURE__ */ jsx13(Dialog.Title, { className: title, asChild: true, children: /* @__PURE__ */ jsx13(Heading, { as: "h2", children: "Connect a Wallet" }) }),
|
|
905
|
+
/* @__PURE__ */ jsx13("div", { className: separator }),
|
|
906
|
+
wallets?.length ? /* @__PURE__ */ jsx13(
|
|
907
|
+
WalletConnectListView,
|
|
908
|
+
{
|
|
909
|
+
wallets,
|
|
910
|
+
onOpenChange: handleOpenChange
|
|
911
|
+
}
|
|
912
|
+
) : /* @__PURE__ */ jsx13(GetTheWalletView, {})
|
|
913
|
+
] }),
|
|
914
|
+
/* @__PURE__ */ jsx13(Dialog.Close, { className: closeButtonContainer, asChild: true, children: /* @__PURE__ */ jsx13(IconButton, { type: "button", "aria-label": "Close", children: /* @__PURE__ */ jsx13(CloseIcon, {}) }) })
|
|
915
|
+
] }) }) }) })
|
|
916
|
+
] });
|
|
697
917
|
}
|
|
698
918
|
|
|
699
|
-
// src/hooks/
|
|
700
|
-
function
|
|
701
|
-
return
|
|
702
|
-
"resolveNameServiceNames",
|
|
703
|
-
{
|
|
704
|
-
address,
|
|
705
|
-
limit: 1
|
|
706
|
-
},
|
|
707
|
-
{
|
|
708
|
-
...options,
|
|
709
|
-
refetchOnWindowFocus: false,
|
|
710
|
-
retry: false,
|
|
711
|
-
select: (data) => data.data.length > 0 ? data.data[0] : null,
|
|
712
|
-
enabled: !!address && options?.enabled !== false
|
|
713
|
-
}
|
|
714
|
-
);
|
|
919
|
+
// src/hooks/wallet/useCurrentAccount.ts
|
|
920
|
+
function useCurrentAccount() {
|
|
921
|
+
return useWalletStore((state) => state.currentAccount);
|
|
715
922
|
}
|
|
716
923
|
|
|
924
|
+
// src/components/AccountDropdownMenu.tsx
|
|
925
|
+
import { formatAddress } from "@iota/iota-sdk/utils";
|
|
926
|
+
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
927
|
+
import clsx6 from "clsx";
|
|
928
|
+
|
|
717
929
|
// src/hooks/wallet/useAccounts.ts
|
|
718
930
|
function useAccounts() {
|
|
719
931
|
return useWalletStore((state) => state.accounts);
|
|
@@ -735,11 +947,11 @@ var WalletAccountNotFoundError = class extends Error {
|
|
|
735
947
|
// src/hooks/wallet/useCurrentWallet.ts
|
|
736
948
|
function useCurrentWallet() {
|
|
737
949
|
const currentWallet = useWalletStore((state) => state.currentWallet);
|
|
738
|
-
const
|
|
739
|
-
switch (
|
|
950
|
+
const connectionStatus = useWalletStore((state) => state.connectionStatus);
|
|
951
|
+
switch (connectionStatus) {
|
|
740
952
|
case "connecting":
|
|
741
953
|
return {
|
|
742
|
-
connectionStatus
|
|
954
|
+
connectionStatus,
|
|
743
955
|
currentWallet: null,
|
|
744
956
|
isDisconnected: false,
|
|
745
957
|
isConnecting: true,
|
|
@@ -747,7 +959,7 @@ function useCurrentWallet() {
|
|
|
747
959
|
};
|
|
748
960
|
case "disconnected":
|
|
749
961
|
return {
|
|
750
|
-
connectionStatus
|
|
962
|
+
connectionStatus,
|
|
751
963
|
currentWallet: null,
|
|
752
964
|
isDisconnected: true,
|
|
753
965
|
isConnecting: false,
|
|
@@ -755,7 +967,7 @@ function useCurrentWallet() {
|
|
|
755
967
|
};
|
|
756
968
|
case "connected": {
|
|
757
969
|
return {
|
|
758
|
-
connectionStatus
|
|
970
|
+
connectionStatus,
|
|
759
971
|
currentWallet,
|
|
760
972
|
isDisconnected: false,
|
|
761
973
|
isConnecting: false,
|
|
@@ -822,16 +1034,17 @@ function useSwitchAccount({
|
|
|
822
1034
|
|
|
823
1035
|
// src/components/AccountDropdownMenu.css.ts
|
|
824
1036
|
var connectedAccount = "AccountDropdownMenu_connectedAccount__1x0gmpf0";
|
|
1037
|
+
var icon2 = "AccountDropdownMenu_icon__1x0gmpf2";
|
|
825
1038
|
var menuContainer = "AccountDropdownMenu_menuContainer__1x0gmpf1";
|
|
826
|
-
var menuContent = "
|
|
827
|
-
var menuItem = "
|
|
828
|
-
var
|
|
829
|
-
var switchAccountMenuItem = "
|
|
1039
|
+
var menuContent = "AccountDropdownMenu_menuContent__1x0gmpf3";
|
|
1040
|
+
var menuItem = "AccountDropdownMenu_menuItem__1x0gmpf4";
|
|
1041
|
+
var separator3 = "AccountDropdownMenu_separator__1x0gmpf6";
|
|
1042
|
+
var switchAccountMenuItem = "AccountDropdownMenu_switchAccountMenuItem__1x0gmpf5";
|
|
830
1043
|
|
|
831
1044
|
// src/components/icons/CheckIcon.tsx
|
|
832
|
-
import { jsx as
|
|
1045
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
833
1046
|
function CheckIcon(props) {
|
|
834
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ jsx14("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", ...props, children: /* @__PURE__ */ jsx14(
|
|
835
1048
|
"path",
|
|
836
1049
|
{
|
|
837
1050
|
fill: "currentColor",
|
|
@@ -841,9 +1054,9 @@ function CheckIcon(props) {
|
|
|
841
1054
|
}
|
|
842
1055
|
|
|
843
1056
|
// src/components/icons/ChevronIcon.tsx
|
|
844
|
-
import { jsx as
|
|
1057
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
845
1058
|
function ChevronIcon(props) {
|
|
846
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ jsx15("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", ...props, children: /* @__PURE__ */ jsx15(
|
|
847
1060
|
"path",
|
|
848
1061
|
{
|
|
849
1062
|
stroke: "#A0B6C3",
|
|
@@ -855,21 +1068,54 @@ function ChevronIcon(props) {
|
|
|
855
1068
|
) });
|
|
856
1069
|
}
|
|
857
1070
|
|
|
1071
|
+
// src/components/ui/Text.tsx
|
|
1072
|
+
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
1073
|
+
import clsx5 from "clsx";
|
|
1074
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
1075
|
+
|
|
1076
|
+
// src/components/ui/Text.css.ts
|
|
1077
|
+
import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
1078
|
+
var textVariants = _7a4683({ defaultClassName: "Text__aprhbd0", variantClassNames: { size: { sm: "Text_textVariants_size_sm__aprhbd1" }, weight: { normal: "Text_textVariants_weight_normal__aprhbd2", medium: "Text_textVariants_weight_medium__aprhbd3", bold: "Text_textVariants_weight_bold__aprhbd4" }, color: { body: "Text_textVariants_color_body__aprhbd5", muted: "Text_textVariants_color_muted__aprhbd6", danger: "Text_textVariants_color_danger__aprhbd7" }, mono: { true: "Text_textVariants_mono_true__aprhbd8" } }, defaultVariants: { size: "sm", weight: "normal" }, compoundVariants: [] });
|
|
1079
|
+
|
|
1080
|
+
// src/components/ui/Text.tsx
|
|
1081
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1082
|
+
var Text = forwardRef5(
|
|
1083
|
+
({
|
|
1084
|
+
children,
|
|
1085
|
+
className,
|
|
1086
|
+
asChild = false,
|
|
1087
|
+
as: Tag = "div",
|
|
1088
|
+
size,
|
|
1089
|
+
weight,
|
|
1090
|
+
color,
|
|
1091
|
+
mono,
|
|
1092
|
+
...textProps
|
|
1093
|
+
}, forwardedRef) => {
|
|
1094
|
+
return /* @__PURE__ */ jsx16(
|
|
1095
|
+
Slot5,
|
|
1096
|
+
{
|
|
1097
|
+
...textProps,
|
|
1098
|
+
ref: forwardedRef,
|
|
1099
|
+
className: clsx5(textVariants({ size, weight, color, mono }), className),
|
|
1100
|
+
children: asChild ? children : /* @__PURE__ */ jsx16(Tag, { children })
|
|
1101
|
+
}
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
);
|
|
1105
|
+
Text.displayName = "Text";
|
|
1106
|
+
|
|
858
1107
|
// src/components/AccountDropdownMenu.tsx
|
|
859
|
-
import { jsx as
|
|
1108
|
+
import { jsx as jsx17, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
860
1109
|
function AccountDropdownMenu({ currentAccount }) {
|
|
861
1110
|
const { mutate: disconnectWallet } = useDisconnectWallet();
|
|
862
|
-
const { data: domain } = useResolveIotaNSName(
|
|
863
|
-
currentAccount.label ? null : currentAccount.address
|
|
864
|
-
);
|
|
865
1111
|
const accounts = useAccounts();
|
|
866
|
-
return /* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
/* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ jsxs6(DropdownMenu.Root, { modal: false, children: [
|
|
1113
|
+
/* @__PURE__ */ jsx17(StyleMarker, { children: /* @__PURE__ */ jsx17(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { size: "md", className: connectedAccount, children: [
|
|
1114
|
+
/* @__PURE__ */ jsx17(Text, { children: currentAccount.label ?? formatAddress(currentAccount.address) }),
|
|
1115
|
+
/* @__PURE__ */ jsx17(ChevronIcon, { className: icon2 })
|
|
870
1116
|
] }) }) }),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
accounts.map((account) => /* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsx17(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx17(StyleMarker, { className: menuContainer, children: /* @__PURE__ */ jsxs6(DropdownMenu.Content, { className: menuContent, children: [
|
|
1118
|
+
accounts.map((account) => /* @__PURE__ */ jsx17(
|
|
873
1119
|
AccountDropdownMenuItem,
|
|
874
1120
|
{
|
|
875
1121
|
account,
|
|
@@ -877,11 +1123,11 @@ function AccountDropdownMenu({ currentAccount }) {
|
|
|
877
1123
|
},
|
|
878
1124
|
account.address
|
|
879
1125
|
)),
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ jsx17(DropdownMenu.Separator, { className: separator3 }),
|
|
1127
|
+
/* @__PURE__ */ jsx17(
|
|
882
1128
|
DropdownMenu.Item,
|
|
883
1129
|
{
|
|
884
|
-
className:
|
|
1130
|
+
className: clsx6(menuItem),
|
|
885
1131
|
onSelect: () => disconnectWallet(),
|
|
886
1132
|
children: "Disconnect"
|
|
887
1133
|
}
|
|
@@ -894,66 +1140,82 @@ function AccountDropdownMenuItem({
|
|
|
894
1140
|
active
|
|
895
1141
|
}) {
|
|
896
1142
|
const { mutate: switchAccount } = useSwitchAccount();
|
|
897
|
-
|
|
898
|
-
return /* @__PURE__ */ jsxs8(
|
|
1143
|
+
return /* @__PURE__ */ jsxs6(
|
|
899
1144
|
DropdownMenu.Item,
|
|
900
1145
|
{
|
|
901
|
-
className:
|
|
1146
|
+
className: clsx6(menuItem, switchAccountMenuItem),
|
|
902
1147
|
onSelect: () => switchAccount({ account }),
|
|
903
1148
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
active ? /* @__PURE__ */
|
|
1149
|
+
/* @__PURE__ */ jsx17(Text, { children: account.label ?? formatAddress(account.address) }),
|
|
1150
|
+
active ? /* @__PURE__ */ jsx17(CheckIcon, {}) : null
|
|
906
1151
|
]
|
|
907
1152
|
}
|
|
908
1153
|
);
|
|
909
1154
|
}
|
|
910
1155
|
|
|
911
1156
|
// src/components/ConnectButton.tsx
|
|
912
|
-
import { jsx as
|
|
913
|
-
function ConnectButton({
|
|
914
|
-
connectText = "Connect Wallet",
|
|
915
|
-
...buttonProps
|
|
916
|
-
}) {
|
|
1157
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1158
|
+
function ConnectButton({ connectText = "Connect", ...buttonProps }) {
|
|
917
1159
|
const currentAccount = useCurrentAccount();
|
|
918
|
-
return currentAccount ? /* @__PURE__ */
|
|
1160
|
+
return currentAccount ? /* @__PURE__ */ jsx18(AccountDropdownMenu, { currentAccount }) : /* @__PURE__ */ jsx18(
|
|
919
1161
|
ConnectModal,
|
|
920
1162
|
{
|
|
921
|
-
trigger: /* @__PURE__ */
|
|
1163
|
+
trigger: /* @__PURE__ */ jsx18(StyleMarker, { children: /* @__PURE__ */ jsx18(Button, { ...buttonProps, children: connectText }) })
|
|
922
1164
|
}
|
|
923
1165
|
);
|
|
924
1166
|
}
|
|
925
1167
|
|
|
926
|
-
// src/components/
|
|
927
|
-
import {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1168
|
+
// src/components/IotaClientProvider.tsx
|
|
1169
|
+
import { getNetwork, isIotaClient, Network, IotaClient } from "@iota/iota-sdk/client";
|
|
1170
|
+
import { createContext as createContext2, useMemo, useState as useState3 } from "react";
|
|
1171
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1172
|
+
var IotaClientContext = createContext2(null);
|
|
1173
|
+
var DEFAULT_NETWORKS = {
|
|
1174
|
+
localnet: { url: getNetwork(Network.Local).url }
|
|
1175
|
+
};
|
|
1176
|
+
var DEFAULT_CREATE_CLIENT = function createClient(_name, config) {
|
|
1177
|
+
if (isIotaClient(config)) {
|
|
1178
|
+
return config;
|
|
1179
|
+
}
|
|
1180
|
+
return new IotaClient(config);
|
|
1181
|
+
};
|
|
1182
|
+
function IotaClientProvider(props) {
|
|
1183
|
+
const { onNetworkChange, network, children } = props;
|
|
1184
|
+
const networks = props.networks ?? DEFAULT_NETWORKS;
|
|
1185
|
+
const createClient2 = props.createClient ?? DEFAULT_CREATE_CLIENT;
|
|
1186
|
+
const [selectedNetwork, setSelectedNetwork] = useState3(
|
|
1187
|
+
props.network ?? props.defaultNetwork ?? Object.keys(networks)[0]
|
|
1188
|
+
);
|
|
1189
|
+
const currentNetwork = props.network ?? selectedNetwork;
|
|
1190
|
+
const client = useMemo(() => {
|
|
1191
|
+
return createClient2(currentNetwork, networks[currentNetwork]);
|
|
1192
|
+
}, [createClient2, currentNetwork, networks]);
|
|
1193
|
+
const ctx = useMemo(() => {
|
|
1194
|
+
return {
|
|
1195
|
+
client,
|
|
1196
|
+
networks,
|
|
1197
|
+
network: currentNetwork,
|
|
1198
|
+
config: networks[currentNetwork] instanceof IotaClient ? null : networks[currentNetwork],
|
|
1199
|
+
selectNetwork: (newNetwork) => {
|
|
1200
|
+
if (currentNetwork === newNetwork) {
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1203
|
+
if (!network && newNetwork !== selectedNetwork) {
|
|
1204
|
+
setSelectedNetwork(newNetwork);
|
|
1205
|
+
}
|
|
1206
|
+
onNetworkChange?.(newNetwork);
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
}, [client, networks, selectedNetwork, currentNetwork, network, onNetworkChange]);
|
|
1210
|
+
return /* @__PURE__ */ jsx19(IotaClientContext.Provider, { value: ctx, children });
|
|
943
1211
|
}
|
|
944
1212
|
|
|
945
|
-
// src/
|
|
946
|
-
|
|
947
|
-
var DEFAULT_STORAGE = typeof window !== "undefined" && window.localStorage ? localStorage : createInMemoryStore();
|
|
948
|
-
var DEFAULT_STORAGE_KEY = "iota-dapp-kit:wallet-connection-info";
|
|
949
|
-
var DEFAULT_REQUIRED_FEATURES = [
|
|
950
|
-
"iota:signTransactionBlock"
|
|
951
|
-
];
|
|
952
|
-
var DEFAULT_PREFERRED_WALLETS = [IOTA_WALLET_NAME];
|
|
1213
|
+
// src/components/WalletProvider.tsx
|
|
1214
|
+
import { useRef } from "react";
|
|
953
1215
|
|
|
954
1216
|
// src/hooks/wallet/useAutoConnectWallet.ts
|
|
955
|
-
import { useQuery
|
|
956
|
-
import { useLayoutEffect, useState as
|
|
1217
|
+
import { useQuery } from "@tanstack/react-query";
|
|
1218
|
+
import { useLayoutEffect, useState as useState4 } from "react";
|
|
957
1219
|
function useAutoConnectWallet() {
|
|
958
1220
|
const { mutateAsync: connectWallet } = useConnectWallet();
|
|
959
1221
|
const autoConnectEnabled = useWalletStore((state) => state.autoConnectEnabled);
|
|
@@ -963,11 +1225,11 @@ function useAutoConnectWallet() {
|
|
|
963
1225
|
);
|
|
964
1226
|
const wallets = useWallets();
|
|
965
1227
|
const { isConnected } = useCurrentWallet();
|
|
966
|
-
const [clientOnly, setClientOnly] =
|
|
1228
|
+
const [clientOnly, setClientOnly] = useState4(false);
|
|
967
1229
|
useLayoutEffect(() => {
|
|
968
1230
|
setClientOnly(true);
|
|
969
1231
|
}, []);
|
|
970
|
-
const { data, isError } =
|
|
1232
|
+
const { data, isError } = useQuery({
|
|
971
1233
|
queryKey: [
|
|
972
1234
|
"@iota/dapp-kit",
|
|
973
1235
|
"autoconnect",
|
|
@@ -1030,6 +1292,23 @@ function useAutoConnectWallet() {
|
|
|
1030
1292
|
import { Ed25519Keypair } from "@iota/iota-sdk/keypairs/ed25519";
|
|
1031
1293
|
import { getWallets as getWallets2, ReadonlyWalletAccount, SUPPORTED_CHAINS } from "@iota/wallet-standard";
|
|
1032
1294
|
import { useEffect } from "react";
|
|
1295
|
+
|
|
1296
|
+
// src/hooks/useIotaClient.ts
|
|
1297
|
+
import { useContext as useContext2 } from "react";
|
|
1298
|
+
function useIotaClientContext() {
|
|
1299
|
+
const iotaClient = useContext2(IotaClientContext);
|
|
1300
|
+
if (!iotaClient) {
|
|
1301
|
+
throw new Error(
|
|
1302
|
+
"Could not find IotaClientContext. Ensure that you have set up the IotaClientProvider"
|
|
1303
|
+
);
|
|
1304
|
+
}
|
|
1305
|
+
return iotaClient;
|
|
1306
|
+
}
|
|
1307
|
+
function useIotaClient() {
|
|
1308
|
+
return useIotaClientContext().client;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
// src/hooks/wallet/useUnsafeBurnerWallet.ts
|
|
1033
1312
|
var WALLET_NAME = "Unsafe Burner Wallet";
|
|
1034
1313
|
function useUnsafeBurnerWallet(enabled) {
|
|
1035
1314
|
const iotaClient = useIotaClient();
|
|
@@ -1187,42 +1466,39 @@ function useWalletsChanged(preferredWallets, requiredFeatures) {
|
|
|
1187
1466
|
// src/themes/lightTheme.ts
|
|
1188
1467
|
var lightTheme = {
|
|
1189
1468
|
blurs: {
|
|
1190
|
-
modalOverlay: "blur(
|
|
1469
|
+
modalOverlay: "blur(12px)"
|
|
1191
1470
|
},
|
|
1192
1471
|
backgroundColors: {
|
|
1193
|
-
primaryButton: "#
|
|
1194
|
-
primaryButtonHover: "#
|
|
1195
|
-
outlineButtonHover: "#
|
|
1196
|
-
modalOverlay: "rgba(
|
|
1197
|
-
modalPrimary: "
|
|
1198
|
-
modalSecondary: "#
|
|
1472
|
+
primaryButton: "#DDE4F0",
|
|
1473
|
+
primaryButtonHover: "#002F6D14",
|
|
1474
|
+
outlineButtonHover: "#002F6D14",
|
|
1475
|
+
modalOverlay: "rgba(0, 47, 109, 0.72)",
|
|
1476
|
+
modalPrimary: "#ffffff",
|
|
1477
|
+
modalSecondary: "#e3eaf6",
|
|
1199
1478
|
iconButton: "transparent",
|
|
1200
|
-
iconButtonHover: "#F0F1F2",
|
|
1201
1479
|
dropdownMenu: "#FFFFFF",
|
|
1202
|
-
dropdownMenuSeparator: "#
|
|
1203
|
-
walletItemSelected: "
|
|
1204
|
-
walletItemHover: "
|
|
1480
|
+
dropdownMenuSeparator: "#002f6d14",
|
|
1481
|
+
walletItemSelected: "#EFF4FA",
|
|
1482
|
+
walletItemHover: "rgba(0, 103, 238, 0.12)",
|
|
1483
|
+
scrollThumb: "#cad4e2"
|
|
1205
1484
|
},
|
|
1206
1485
|
borderColors: {
|
|
1207
|
-
outlineButton: "#
|
|
1486
|
+
outlineButton: "#6E7787"
|
|
1208
1487
|
},
|
|
1209
1488
|
colors: {
|
|
1210
|
-
primaryButton: "#
|
|
1211
|
-
|
|
1212
|
-
iconButton: "#
|
|
1213
|
-
body: "#
|
|
1214
|
-
bodyMuted: "#
|
|
1215
|
-
bodyDanger: "#
|
|
1489
|
+
primaryButton: "#171D26",
|
|
1490
|
+
outlineButtonHover: "#E3EAF6",
|
|
1491
|
+
iconButton: "#171D26",
|
|
1492
|
+
body: "#171D26",
|
|
1493
|
+
bodyMuted: "#545E6E",
|
|
1494
|
+
bodyDanger: "#B51431"
|
|
1216
1495
|
},
|
|
1217
1496
|
radii: {
|
|
1218
1497
|
small: "6px",
|
|
1219
1498
|
medium: "8px",
|
|
1220
1499
|
large: "12px",
|
|
1221
|
-
xlarge: "16px"
|
|
1222
|
-
|
|
1223
|
-
shadows: {
|
|
1224
|
-
primaryButton: "0px 4px 12px rgba(0, 0, 0, 0.1)",
|
|
1225
|
-
walletItemSelected: "0px 2px 6px rgba(0, 0, 0, 0.05)"
|
|
1500
|
+
xlarge: "16px",
|
|
1501
|
+
full: "120px"
|
|
1226
1502
|
},
|
|
1227
1503
|
fontWeights: {
|
|
1228
1504
|
normal: "400",
|
|
@@ -1238,8 +1514,16 @@ var lightTheme = {
|
|
|
1238
1514
|
typography: {
|
|
1239
1515
|
fontFamily: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
1240
1516
|
fontStyle: "normal",
|
|
1241
|
-
lineHeight: "
|
|
1242
|
-
letterSpacing: "
|
|
1517
|
+
lineHeight: "24px",
|
|
1518
|
+
letterSpacing: "0.1px"
|
|
1519
|
+
},
|
|
1520
|
+
spacing: {
|
|
1521
|
+
xxsmall: "4px",
|
|
1522
|
+
xsmall: "8px",
|
|
1523
|
+
small: "12px",
|
|
1524
|
+
medium: "16px",
|
|
1525
|
+
large: "24px",
|
|
1526
|
+
xlarge: "32px"
|
|
1243
1527
|
}
|
|
1244
1528
|
};
|
|
1245
1529
|
|
|
@@ -1263,9 +1547,9 @@ function createWalletStore({
|
|
|
1263
1547
|
lastConnectedAccountAddress: null,
|
|
1264
1548
|
lastConnectedWalletName: null,
|
|
1265
1549
|
connectionStatus: "disconnected",
|
|
1266
|
-
setConnectionStatus(
|
|
1550
|
+
setConnectionStatus(connectionStatus) {
|
|
1267
1551
|
set(() => ({
|
|
1268
|
-
connectionStatus
|
|
1552
|
+
connectionStatus
|
|
1269
1553
|
}));
|
|
1270
1554
|
},
|
|
1271
1555
|
setWalletConnected(wallet, connectedAccounts, selectedAccount) {
|
|
@@ -1353,16 +1637,16 @@ var themeContractValues = {
|
|
|
1353
1637
|
modalPrimary: "",
|
|
1354
1638
|
modalSecondary: "",
|
|
1355
1639
|
iconButton: "",
|
|
1356
|
-
iconButtonHover: "",
|
|
1357
1640
|
dropdownMenu: "",
|
|
1358
|
-
dropdownMenuSeparator: ""
|
|
1641
|
+
dropdownMenuSeparator: "",
|
|
1642
|
+
scrollThumb: ""
|
|
1359
1643
|
},
|
|
1360
1644
|
borderColors: {
|
|
1361
1645
|
outlineButton: ""
|
|
1362
1646
|
},
|
|
1363
1647
|
colors: {
|
|
1364
1648
|
primaryButton: "",
|
|
1365
|
-
|
|
1649
|
+
outlineButtonHover: "",
|
|
1366
1650
|
body: "",
|
|
1367
1651
|
bodyMuted: "",
|
|
1368
1652
|
bodyDanger: "",
|
|
@@ -1372,11 +1656,8 @@ var themeContractValues = {
|
|
|
1372
1656
|
small: "",
|
|
1373
1657
|
medium: "",
|
|
1374
1658
|
large: "",
|
|
1375
|
-
xlarge: ""
|
|
1376
|
-
|
|
1377
|
-
shadows: {
|
|
1378
|
-
primaryButton: "",
|
|
1379
|
-
walletItemSelected: ""
|
|
1659
|
+
xlarge: "",
|
|
1660
|
+
full: ""
|
|
1380
1661
|
},
|
|
1381
1662
|
fontWeights: {
|
|
1382
1663
|
normal: "",
|
|
@@ -1394,6 +1675,14 @@ var themeContractValues = {
|
|
|
1394
1675
|
fontStyle: "",
|
|
1395
1676
|
lineHeight: "",
|
|
1396
1677
|
letterSpacing: ""
|
|
1678
|
+
},
|
|
1679
|
+
spacing: {
|
|
1680
|
+
xxsmall: "",
|
|
1681
|
+
xsmall: "",
|
|
1682
|
+
small: "",
|
|
1683
|
+
medium: "",
|
|
1684
|
+
large: "",
|
|
1685
|
+
xlarge: ""
|
|
1397
1686
|
}
|
|
1398
1687
|
};
|
|
1399
1688
|
var themeVars = createGlobalThemeContract(
|
|
@@ -1402,10 +1691,10 @@ var themeVars = createGlobalThemeContract(
|
|
|
1402
1691
|
);
|
|
1403
1692
|
|
|
1404
1693
|
// src/components/styling/InjectedThemeStyles.tsx
|
|
1405
|
-
import { jsx as
|
|
1694
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1406
1695
|
function InjectedThemeStyles({ theme }) {
|
|
1407
1696
|
const themeStyles = Array.isArray(theme) ? getDynamicThemeStyles(theme) : getStaticThemeStyles(theme);
|
|
1408
|
-
return /* @__PURE__ */
|
|
1697
|
+
return /* @__PURE__ */ jsx20(
|
|
1409
1698
|
"style",
|
|
1410
1699
|
{
|
|
1411
1700
|
dangerouslySetInnerHTML: {
|
|
@@ -1428,8 +1717,81 @@ function cssStringFromTheme(theme) {
|
|
|
1428
1717
|
return Object.entries(assignInlineVars(themeVars, theme)).map(([key, value]) => `${key}:${value};`).join("");
|
|
1429
1718
|
}
|
|
1430
1719
|
|
|
1720
|
+
// src/themes/darkTheme.ts
|
|
1721
|
+
var darkTheme = {
|
|
1722
|
+
blurs: {
|
|
1723
|
+
modalOverlay: "blur(12px)"
|
|
1724
|
+
},
|
|
1725
|
+
backgroundColors: {
|
|
1726
|
+
primaryButton: "#253041",
|
|
1727
|
+
primaryButtonHover: "#313D50",
|
|
1728
|
+
outlineButtonHover: "#313D50",
|
|
1729
|
+
modalOverlay: "rgba(0, 47, 109, 0.72)",
|
|
1730
|
+
modalPrimary: "#0f141c",
|
|
1731
|
+
modalSecondary: "#171d26",
|
|
1732
|
+
iconButton: "transparent",
|
|
1733
|
+
dropdownMenu: "#0f141c",
|
|
1734
|
+
dropdownMenuSeparator: "#bed8ff14",
|
|
1735
|
+
walletItemSelected: "#171D26",
|
|
1736
|
+
walletItemHover: "rgba(190, 216, 255, 0.12)",
|
|
1737
|
+
scrollThumb: "#3c4656"
|
|
1738
|
+
},
|
|
1739
|
+
borderColors: {
|
|
1740
|
+
outlineButton: "#8892A1"
|
|
1741
|
+
},
|
|
1742
|
+
colors: {
|
|
1743
|
+
primaryButton: "#E3EAF6",
|
|
1744
|
+
outlineButtonHover: "#171D26",
|
|
1745
|
+
iconButton: "#E3EAF6",
|
|
1746
|
+
body: "#E3EAF6",
|
|
1747
|
+
bodyMuted: "#8892A1",
|
|
1748
|
+
bodyDanger: "#FFB0BE"
|
|
1749
|
+
},
|
|
1750
|
+
radii: {
|
|
1751
|
+
small: "6px",
|
|
1752
|
+
medium: "8px",
|
|
1753
|
+
large: "12px",
|
|
1754
|
+
xlarge: "16px",
|
|
1755
|
+
full: "120px"
|
|
1756
|
+
},
|
|
1757
|
+
fontWeights: {
|
|
1758
|
+
normal: "400",
|
|
1759
|
+
medium: "500",
|
|
1760
|
+
bold: "600"
|
|
1761
|
+
},
|
|
1762
|
+
fontSizes: {
|
|
1763
|
+
small: "14px",
|
|
1764
|
+
medium: "16px",
|
|
1765
|
+
large: "18px",
|
|
1766
|
+
xlarge: "20px"
|
|
1767
|
+
},
|
|
1768
|
+
typography: {
|
|
1769
|
+
fontFamily: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
1770
|
+
fontStyle: "normal",
|
|
1771
|
+
lineHeight: "24px",
|
|
1772
|
+
letterSpacing: "0.1px"
|
|
1773
|
+
},
|
|
1774
|
+
spacing: {
|
|
1775
|
+
xxsmall: "4px",
|
|
1776
|
+
xsmall: "8px",
|
|
1777
|
+
small: "12px",
|
|
1778
|
+
medium: "16px",
|
|
1779
|
+
large: "24px",
|
|
1780
|
+
xlarge: "32px"
|
|
1781
|
+
}
|
|
1782
|
+
};
|
|
1783
|
+
|
|
1431
1784
|
// src/components/WalletProvider.tsx
|
|
1432
|
-
import { jsx as
|
|
1785
|
+
import { jsx as jsx21, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1786
|
+
var themeWithSelectorAndMediaQuery = [
|
|
1787
|
+
{
|
|
1788
|
+
selector: ".dark",
|
|
1789
|
+
variables: darkTheme
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
variables: lightTheme
|
|
1793
|
+
}
|
|
1794
|
+
];
|
|
1433
1795
|
function WalletProvider({
|
|
1434
1796
|
preferredWallets = DEFAULT_PREFERRED_WALLETS,
|
|
1435
1797
|
requiredFeatures = DEFAULT_REQUIRED_FEATURES,
|
|
@@ -1437,7 +1799,7 @@ function WalletProvider({
|
|
|
1437
1799
|
storageKey = DEFAULT_STORAGE_KEY,
|
|
1438
1800
|
enableUnsafeBurner = false,
|
|
1439
1801
|
autoConnect = false,
|
|
1440
|
-
theme =
|
|
1802
|
+
theme = themeWithSelectorAndMediaQuery,
|
|
1441
1803
|
children
|
|
1442
1804
|
}) {
|
|
1443
1805
|
const storeRef = useRef(
|
|
@@ -1448,14 +1810,14 @@ function WalletProvider({
|
|
|
1448
1810
|
storageKey
|
|
1449
1811
|
})
|
|
1450
1812
|
);
|
|
1451
|
-
return /* @__PURE__ */
|
|
1813
|
+
return /* @__PURE__ */ jsx21(WalletContext.Provider, { value: storeRef.current, children: /* @__PURE__ */ jsxs7(
|
|
1452
1814
|
WalletConnectionManager,
|
|
1453
1815
|
{
|
|
1454
1816
|
preferredWallets,
|
|
1455
1817
|
requiredFeatures,
|
|
1456
1818
|
enableUnsafeBurner,
|
|
1457
1819
|
children: [
|
|
1458
|
-
theme ? /* @__PURE__ */
|
|
1820
|
+
theme ? /* @__PURE__ */ jsx21(InjectedThemeStyles, { theme }) : null,
|
|
1459
1821
|
children
|
|
1460
1822
|
]
|
|
1461
1823
|
}
|
|
@@ -1532,6 +1894,20 @@ function useIotaClientMutation(method, options = {}) {
|
|
|
1532
1894
|
});
|
|
1533
1895
|
}
|
|
1534
1896
|
|
|
1897
|
+
// src/hooks/useIotaClientQuery.ts
|
|
1898
|
+
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
1899
|
+
function useIotaClientQuery(...args) {
|
|
1900
|
+
const [method, params, { queryKey = [], ...options } = {}] = args;
|
|
1901
|
+
const iotaContext = useIotaClientContext();
|
|
1902
|
+
return useQuery2({
|
|
1903
|
+
...options,
|
|
1904
|
+
queryKey: [iotaContext.network, method, params, ...queryKey],
|
|
1905
|
+
queryFn: async () => {
|
|
1906
|
+
return await iotaContext.client[method](params);
|
|
1907
|
+
}
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1535
1911
|
// src/hooks/useIotaClientQueries.ts
|
|
1536
1912
|
import { useQueries } from "@tanstack/react-query";
|
|
1537
1913
|
function useIotaClientQueries({
|
|
@@ -1701,6 +2077,7 @@ export {
|
|
|
1701
2077
|
IotaClientProvider,
|
|
1702
2078
|
WalletProvider,
|
|
1703
2079
|
createNetworkConfig,
|
|
2080
|
+
darkTheme,
|
|
1704
2081
|
lightTheme,
|
|
1705
2082
|
useAccounts,
|
|
1706
2083
|
useAutoConnectWallet,
|
|
@@ -1714,7 +2091,6 @@ export {
|
|
|
1714
2091
|
useIotaClientMutation,
|
|
1715
2092
|
useIotaClientQueries,
|
|
1716
2093
|
useIotaClientQuery,
|
|
1717
|
-
useResolveIotaNSName,
|
|
1718
2094
|
useSignAndExecuteTransactionBlock,
|
|
1719
2095
|
useSignPersonalMessage,
|
|
1720
2096
|
useSignTransactionBlock,
|