Skip to content

Commit

Permalink
feat: updated dlc handlers (#224)
Browse files Browse the repository at this point in the history
* feat: update dlc-btc-lib, make changes according to lib changes, unify and cleanup wallet handlers
  • Loading branch information
Polybius93 authored Dec 17, 2024
1 parent 2a2c239 commit ee2bc04
Show file tree
Hide file tree
Showing 16 changed files with 672 additions and 615 deletions.
2 changes: 1 addition & 1 deletion config.devnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"bitcoinNetworkPreFix": "bcrt1",
"bitcoinBlockchainURL": "https://devnet.dlc.link/electrs",
"bitcoinBlockchainExplorerURL": "https://devnet.dlc.link/electrs",
"bitcoinBlockchainFeeEstimateURL": "https://devnet.dlc.link/electrs/fee-estimates",
"bitcoinBlockchainFeeEstimateURL": "",
"rippleIssuerAddress": "rLTBw1MEy45uE5qmkWseinbj7h4zmdQuR8",
"xrplWebsocket": "wss://s.altnet.rippletest.net:51233",
"ledgerApp": "Bitcoin Test",
Expand Down
2 changes: 1 addition & 1 deletion config.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"bitcoinNetworkPreFix": "bc1",
"bitcoinBlockchainURL": "https://blockstream.info/api",
"bitcoinBlockchainExplorerURL": "https://mempool.space",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space/api/v1/fees/recommended",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space",
"rippleIssuerAddress": "rGcyRGrZPaJAZbZDi4NqRFLA5GQH63iFpD",
"xrplWebsocket": "wss://xrpl.ws/",
"ledgerApp": "Bitcoin",
Expand Down
2 changes: 1 addition & 1 deletion config.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"bitcoinNetworkPreFix": "tb1",
"bitcoinBlockchainURL": "https://blockstream.info/testnet/api",
"bitcoinBlockchainExplorerURL": "https://mempool.space/testnet",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space/testnet/api/v1/fees/recommended",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space/testnet",
"rippleIssuerAddress": "ra3oyRVfy4yD4NJPrVcewvDtisZ3FhkcYL",
"xrplWebsocket": "wss://testnet.xrpl-labs.com/",
"ledgerApp": "Bitcoin Test",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"concurrently": "^8.2.2",
"d3": "^7.9.0",
"decimal.js": "^10.4.3",
"dlc-btc-lib": "2.4.18",
"dlc-btc-lib": "2.5.1",
"dotenv": "^16.3.1",
"ethers": "5.7.2",
"formik": "^2.4.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { VStack, useToast } from '@chakra-ui/react';
import { ModalComponentProps } from '@components/modals/components/modal-container';
import { ModalLayout } from '@components/modals/components/modal.layout';
import { useLeather } from '@hooks/use-leather';
import { useUnisat } from '@hooks/use-unisat';
import { useUnisatFordefi } from '@hooks/use-unisat-fordefi';
import { BitcoinWalletType, bitcoinWallets } from '@models/wallet';
import { modalActions } from '@store/slices/modal/modal.actions';

Expand All @@ -18,7 +18,7 @@ export function SelectBitcoinWalletModal({
const dispatch = useDispatch();
const toast = useToast();
const { connectLeatherWallet } = useLeather();
const { connectUnisatWallet } = useUnisat();
const { connectUnisatOrFordefiWallet } = useUnisatFordefi();

async function handleLogin(walletType: BitcoinWalletType) {
switch (walletType) {
Expand All @@ -37,7 +37,7 @@ export function SelectBitcoinWalletModal({
break;
case BitcoinWalletType.Unisat:
try {
await connectUnisatWallet();
await connectUnisatOrFordefiWallet();
} catch (error: any) {
toast({
title: 'Failed to connect to Unisat Wallet',
Expand All @@ -50,7 +50,7 @@ export function SelectBitcoinWalletModal({
break;
case BitcoinWalletType.Fordefi:
try {
await connectUnisatWallet(true);
await connectUnisatOrFordefiWallet(true);
} catch (error: any) {
toast({
title: 'Failed to connect to Unisat Wallet',
Expand Down
Loading

0 comments on commit ee2bc04

Please sign in to comment.