Skip to content
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
47 changes: 47 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ members = [
[workspace.dependencies]
# Bitcoin Dev Kit
bdk = "0.28"
bdk_bitcoind_rpc = "0.22"
bdk_chain = "0.23.0"
bdk_core = "0.6.0"
bdk_electrum = { version = "0.23.0", default-features = false }
Expand Down
3 changes: 2 additions & 1 deletion dev-docs/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ OPTIONS:
--receive-address <monero-receive-address> The monero address where you would like to receive monero
--seller <seller> The seller's address. Must include a peer ID part, i.e. `/p2p/`

--electrum-rpc <bitcoin-electrum-rpc-url> Provide the Bitcoin Electrum RPC URL
--electrum-rpc <bitcoin-electrum-rpc-url> Provide the Bitcoin Electrum RPC URL. Supersedes --bitcoind-rpc
--bitcoind-rpc <bitcoind-rpc-url> Provide the bitcoind RPC URL. Superseded by --electrum-rpc
--bitcoin-target-block <bitcoin-target-block> Estimate Bitcoin fees such that transactions are confirmed within the specified number of blocks
--monero-daemon-address <monero-daemon-address> Specify to connect to a monero daemon of your choice: <host>:<port>
--tor-socks5-port <tor-socks5-port> Your local Tor socks5 proxy port [default: 9050]
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/becoming_a_maker/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ Below an explanation of what each option does:
### Bitcoin Section

The `bitcoin` section specifies a few details about the asb's interaction with the Bitcoin blockchain.
We do not recommend changing these settings, however we document them for completeness sake.
We do not recommend changing these settings, however we document them for completeness' sake.

```toml filename="config_mainnet.toml"
# ...

[bitcoin]
target_block = 1
electrum_rpc_urls = ["tcp://mainnet_electrs:50001"]
# bitcoind_rpc_urls = ["http://user:[email protected]:8332"]
use_mempool_space_fee_estimation = true
network = "Mainnet"

Expand Down
2 changes: 1 addition & 1 deletion monero-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ impl FfiWallet {
let history_handle = TransactionHistoryHandle(history_ptr);
let count = history_handle.count();

let mut transactions = Vec::new();
let mut transactions = Vec::with_capacity(count as _);
for i in 0..count {
if let Some(tx_info_handle) = history_handle.transaction(i) {
if let Some(serialized_tx) = tx_info_handle.serialize() {
Expand Down
16 changes: 13 additions & 3 deletions src-gui/src/models/tauriModelExt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
TauriBackgroundProgress,
TauriSwapProgressEvent,
SendMoneroDetails,
WithdrawBitcoinDetails,
ContextStatus,
QuoteWithAddress,
ExportBitcoinWalletResponse,
Expand Down Expand Up @@ -319,6 +320,10 @@ export type PendingSendMoneroApprovalRequest = PendingApprovalRequest & {
request: { type: "SendMonero"; content: SendMoneroDetails };
};

export type PendingWithdrawBitcoinApprovalRequest = PendingApprovalRequest & {
request: { type: "WithdrawBitcoin"; content: WithdrawBitcoinDetails };
};

export type PendingPasswordApprovalRequest = PendingApprovalRequest & {
request: { type: "PasswordRequest"; content: { wallet_path: string } };
};
Expand All @@ -335,16 +340,21 @@ export function isPendingSelectMakerApprovalEvent(
return event.request.type === "SelectMaker";
}

export function isPendingSendMoneroApprovalEvent(
export function isPendingSendCurrencyApprovalEvent(
event: ApprovalRequest,
): event is PendingSendMoneroApprovalRequest {
currency: "monero" | "bitcoin",
): event is
| PendingSendMoneroApprovalRequest
| PendingWithdrawBitcoinApprovalRequest {
// Check if the request is pending
if (event.request_status.state !== "Pending") {
return false;
}

const type = currency === "monero" ? "SendMonero" : "WithdrawBitcoin";

// Check if the request is a SendMonero request
return event.request.type === "SendMonero";
return event.request.type === type;
}

export function isPendingPasswordApprovalEvent(
Expand Down
6 changes: 5 additions & 1 deletion src-gui/src/renderer/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import {
approvalEventReceived,
backgroundProgressEventReceived,
} from "store/features/rpcSlice";
import { setBitcoinBalance } from "store/features/bitcoinWalletSlice";
import {
setBitcoinBalance,
setBitcoinHistory,
} from "store/features/bitcoinWalletSlice";
import { receivedCliLog } from "store/features/logsSlice";
import { poolStatusReceived } from "store/features/poolSlice";
import { swapProgressEventReceived } from "store/features/swapSlice";
Expand Down Expand Up @@ -135,6 +138,7 @@ listen<TauriEvent>(TAURI_UNIFIED_EVENT_CHANNEL_NAME, (event) => {

case "BalanceChange":
store.dispatch(setBitcoinBalance(eventData.balance));
store.dispatch(setBitcoinHistory(eventData.transactions));
break;

case "SwapDatabaseStateUpdate":
Expand Down
4 changes: 2 additions & 2 deletions src-gui/src/renderer/components/PromiseInvokeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export default function PromiseInvokeButton<T>({
<IconButton
onClick={handleClick}
disabled={isDisabled}
{...(rest as IconButtonProps)}
size="large"
sx={{
padding: "0.25rem",
}}
size="large"
{...(rest as IconButtonProps)}
>
{isLoading
? resolvedLoadingIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import { useEffect } from "react";
import { isTestnet } from "store/config";
import { isBtcAddressValid } from "utils/conversionUtils";

type BitcoinAddressTextFieldProps = {
type BitcoinAddressTextFieldProps = TextFieldProps & {
address: string;
onAddressChange: (address: string) => void;
helperText: string;
onAddressValidityChange?: (valid: boolean) => void;
helperText?: string;
allowEmpty?: boolean;
};

export default function BitcoinAddressTextField({
address,
onAddressChange,
onAddressValidityChange,
helperText,
allowEmpty = true,
onAddressValidityChange,
...props
}: BitcoinAddressTextFieldProps & TextFieldProps) {
}: BitcoinAddressTextFieldProps) {
const placeholder = isTestnet() ? "tb1q4aelwalu..." : "bc18ociqZ9mZ...";

function errorText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
List,
ListItemText,
TextField,
TextFieldProps,
} from "@mui/material";
import { TextFieldProps } from "@mui/material";
import { useEffect, useState } from "react";
import { getMoneroAddresses } from "renderer/rpc";
import { isTestnet } from "store/config";
Expand Down
73 changes: 0 additions & 73 deletions src-gui/src/renderer/components/modal/wallet/WithdrawDialog.tsx

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions src-gui/src/renderer/components/modal/wallet/WithdrawStepper.tsx

This file was deleted.

Loading