Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for getting and accepting quotes #81

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ok300
Copy link
Contributor

@ok300 ok300 commented Nov 4, 2024

This PR adds the ability to get and accept quotes for Zero-Amount Chain Swaps.

Fixes #78

use bitcoin::{
hashes::sha256, hex::DisplayHex, taproot::TapLeaf, PublicKey, ScriptBuf, Transaction,
};
use bitcoin::{key, Amount};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is Amount being imported?

@@ -564,6 +564,28 @@ impl BoltzApiClientV2 {
let end_point = format!("chain/{}/transaction", chain);
Ok(serde_json::from_str(&self.post(&end_point, data)?)?)
}

/// Looks up the quote for a Zero-Amount Receive Chain Swap.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Looks up the quote for a Zero-Amount Receive Chain Swap.
/// Gets a quote for a Zero-Amount or over- or underpaid Chain Swap.

Ok(serde_json::from_str(&self.get(&end_point)?)?)
}

/// Accepts a specific quote for a Zero-Amount Receive Chain Swap.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Accepts a specific quote for a Zero-Amount Receive Chain Swap.
/// Accepts a specific quote for a Zero-Amount or over- or underpaid Chain Swap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for amount-less chain swaps
2 participants