Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use yttrium via walletkit for chain abstraction #813

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion advanced/wallets/react-wallet-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"@noble/curves": "^1.6.0",
"@polkadot/keyring": "^10.1.2",
"@polkadot/types": "^9.3.3",
"@reown/walletkit": "1.0.0",
"@reown/appkit-experimental": "1.1.5",
"@reown/walletkit": "1.1.2-canary-wasm-5",
"@rhinestone/module-sdk": "0.1.25",
"@solana/web3.js": "1.89.2",
"@taquito/signer": "^15.1.0",
Expand Down
Binary file added advanced/wallets/react-wallet-v2/public/bridge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions advanced/wallets/react-wallet-v2/src/components/BridgeBadge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Icon } from '@mui/material'
import bridgeIcon from './../../public/bridge.png'

export default function BridgeBadge() {
return (
<div
style={{
width: 27,
height: 27,
borderRadius: 12,
backgroundColor: '#363636',
flexDirection: 'row',
justifyContent: 'space-evenly'
}}
>
<img
style={{
width: 16,
height: 16,
margin: 5
}}
src="./../../bridge.png"
/>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Hex } from 'viem'

export default function ChainAbstractionBalanceCard() {
const { eip155Address } = useSnapshot(SettingsStore.state)
const [balances, setBalances] = useState<Record<string, Record<string, number>>>({})
const [balances, setBalances] = useState<Record<string, Record<string, string>>>({})
const [totalBalance, setTotalBalance] = useState<Record<string, number>>({})
const [loading, setLoading] = useState(true)
useEffect(() => {
Expand All @@ -20,7 +20,7 @@ export default function ChainAbstractionBalanceCard() {

const fetchedBalances: Record<string, any> = {}
for (const asset of Object.keys(multibridgeSupportedAssets)) {
const assetBalances: Record<string, number> = {}
const assetBalances: Record<string, string> = {}
for (const chainId of Object.keys(multibridgeSupportedAssets[asset])) {
const tokenAddress = multibridgeSupportedAssets[asset][Number(chainId)]
const balance = await getErc20TokenBalance(
Expand All @@ -43,7 +43,7 @@ export default function ChainAbstractionBalanceCard() {
for (const asset of Object.keys(balances)) {
let total = 0
for (const chainBalance of Object.values(balances[asset])) {
total += chainBalance
total += parseFloat(chainBalance)
}
totalBalances[asset] = total
}
Expand Down
Loading