Skip to content

Commit

Permalink
feat: modify confirmation checker to get blockchain api url from the …
Browse files Browse the repository at this point in the history
…env file
  • Loading branch information
Polybius93 committed Mar 19, 2024
1 parent 4ab3297 commit 128941b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function VaultExpandedInformationTransactionRow({
color={'accent.cyan.01'}
fontSize={'xs'}
textDecoration={'underline'}
onClick={() => window.open(`${bitcoinExplorerAPIURL}${value}`, '_blank')}
onClick={() => window.open(`${bitcoinExplorerAPIURL}/tx/${value}`, '_blank')}
_hover={{ cursor: 'pointer' }}
>
View in TX explorer
Expand Down
7 changes: 5 additions & 2 deletions src/app/hooks/use-confirmation-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import { Vault, VaultState } from '@models/vault';

export function useConfirmationChecker(vault?: Vault): number {
const txID = vault?.state === VaultState.FUNDING ? vault?.fundingTX : vault?.closingTX;
const bitcoinExplorerTXURL = `https://devnet.dlc.link/electrs/tx/${txID}`;
const bitcoinExplorerHeightURL = `https://devnet.dlc.link/electrs/blocks/tip/height`;

const bitcoinBlockchainAPIURL = import.meta.env.VITE_BITCOIN_BLOCKCHAIN_API_URL;

const bitcoinExplorerTXURL = `${bitcoinBlockchainAPIURL}/tx/${txID}`;
const bitcoinExplorerHeightURL = `${bitcoinBlockchainAPIURL}/blocks/tip/height`;
const fetchInterval = useRef<number | undefined>(undefined);

const [transactionProgress, setTransactionProgress] = useState(0);
Expand Down

0 comments on commit 128941b

Please sign in to comment.