Skip to content

Commit

Permalink
fix: converting bech32 to b256 on faucet link (#1402)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigobranas authored Jul 8, 2024
1 parent d4f89b1 commit b8b0370
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/great-rules-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels-wallet": minor
---

Converted the address from bech32 to b256 on faucet link
5 changes: 4 additions & 1 deletion packages/app/src/systems/Faucet/hooks/useOpenFaucet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Address } from 'fuels';
import { useCallback } from 'react';
import { IS_CRX, VITE_FUEL_FAUCET_URL } from '~/config';
import { useAccounts } from '~/systems/Account';
Expand All @@ -8,8 +9,10 @@ export function useOpenFaucet() {
const { account } = useAccounts();

const openFaucet = useCallback(() => {
if (!account || !account.address) return VITE_FUEL_FAUCET_URL;
const address = Address.fromDynamicInput(account.address).toB256();
const url = stringifyUrl(VITE_FUEL_FAUCET_URL, {
address: account?.address,
address,
});

if (IS_CRX) {
Expand Down

0 comments on commit b8b0370

Please sign in to comment.