Skip to content

Commit

Permalink
#33 - normalize aptos address to 32 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Mar 22, 2024
1 parent a78b2fa commit f953bf2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/hooks/useAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import { useWallet as useSolanaWallet } from '@solana/wallet-adapter-react'
import { useAccount } from 'wagmi'
import { useWallet as useAlgorandWallet } from '@components/Ecosystem/AlgorandProvider'

const PREFIX_0X = '0x'

export function useAptosAddress(): string | undefined {
const { account } = useAptosWallet()
return account?.address
if (account && account.address) {
return `${PREFIX_0X}${account.address
.replace(PREFIX_0X, '')
.padStart(32, '0')}`
}
}

export function useCosmosAddress(
Expand Down

0 comments on commit f953bf2

Please sign in to comment.