Skip to content

implement-payjoin #1949

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

Merged
merged 82 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
d62b420
Initial Payjoin
konstantinullrich Dec 16, 2024
1f916e7
Initial Payjoin
konstantinullrich Dec 17, 2024
d48bab6
More payjoin stuff
konstantinullrich Dec 17, 2024
b354d43
Minor fixes
konstantinullrich Dec 20, 2024
808bb44
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich Dec 30, 2024
9866e69
Minor fixes
konstantinullrich Jan 8, 2025
27eb0a7
Minor cleanup
konstantinullrich Jan 8, 2025
ba163ff
Minor cleanup
konstantinullrich Jan 8, 2025
6c9e99e
Minor cleanup
konstantinullrich Jan 8, 2025
a9a3043
Minor cleanup
konstantinullrich Jan 8, 2025
70843b4
Minor cleanup
konstantinullrich Jan 8, 2025
9d2c60a
Minor cleanup
konstantinullrich Jan 8, 2025
5c12d89
Fix minor bug causes by data inconsistency in the btc utxos
konstantinullrich Jan 10, 2025
0ebda53
Minor cleanup
konstantinullrich Jan 12, 2025
932eea3
Minor cleanup
konstantinullrich Jan 13, 2025
e34616a
Minor cleanup
konstantinullrich Jan 13, 2025
1b5faaf
Minor cleanup
konstantinullrich Jan 13, 2025
64fa393
Initial Payjoin
konstantinullrich Dec 16, 2024
669c4af
Initial Payjoin
konstantinullrich Dec 17, 2024
700a2ed
More payjoin stuff
konstantinullrich Dec 17, 2024
451c8f4
Minor fixes
konstantinullrich Dec 20, 2024
f8807d7
Minor fixes
konstantinullrich Jan 8, 2025
91a480e
Minor cleanup
konstantinullrich Jan 8, 2025
b049a01
Minor cleanup
konstantinullrich Jan 8, 2025
bd410c2
Minor cleanup
konstantinullrich Jan 8, 2025
abcb9f7
Minor cleanup
konstantinullrich Jan 8, 2025
dd06864
Minor cleanup
konstantinullrich Jan 8, 2025
986d3b4
Minor cleanup
konstantinullrich Jan 8, 2025
910b58d
Fix minor bug causes by data inconsistency in the btc utxos
konstantinullrich Jan 10, 2025
856ad8d
Minor cleanup
konstantinullrich Jan 12, 2025
677c8e5
Minor cleanup
konstantinullrich Jan 13, 2025
eac63dc
Minor cleanup
konstantinullrich Jan 13, 2025
1e5fa42
Minor cleanup
konstantinullrich Jan 13, 2025
28a6641
Merge remote-tracking branch 'origin/implement-payjoin' into implemen…
konstantinullrich Jan 13, 2025
705664c
Fix Rebase issues
konstantinullrich Jan 13, 2025
cdd3b17
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich Jan 16, 2025
11f87a5
Move PJ Receiver to isolate
konstantinullrich Jan 21, 2025
4c4fd8e
Add Payjoin Setting
konstantinullrich Jan 23, 2025
8f4dad9
Payjoin Sender are now isolated
konstantinullrich Jan 27, 2025
421364e
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich Jan 28, 2025
406ac21
Added Payjoin sessions to tx overview. Fix Fee issue with payjoin
konstantinullrich Feb 4, 2025
a4093cf
Clean up code
konstantinullrich Feb 6, 2025
42e9bc1
Fix taproot for payjoin
konstantinullrich Feb 7, 2025
596de98
Fix CI Errors
konstantinullrich Feb 7, 2025
efc8fd3
Merge branch 'main' into implement-payjoin
konstantinullrich Feb 7, 2025
7dfa57d
Add Payjoin UI elements and details page
konstantinullrich Feb 11, 2025
16400ed
Add Payjoin UI elements and details page
konstantinullrich Feb 12, 2025
45899b8
Fix Translations
konstantinullrich Feb 12, 2025
0f13ea7
feat: Detect Payjoin URIs in pasted text and show to the User sending…
konstantinullrich Feb 19, 2025
56fcdf6
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich Feb 19, 2025
04147a5
feat: rename pjUri to payjoinURI for more code clarity
konstantinullrich Feb 20, 2025
8d96682
Update res/values/strings_pl.arb
OmarHatem28 Mar 4, 2025
bc07860
Update cw_bitcoin/lib/payjoin/manager.dart
OmarHatem28 Mar 4, 2025
5abd070
Update cw_bitcoin/lib/payjoin/manager.dart
OmarHatem28 Mar 4, 2025
dad1404
Merge branch 'main' into implement-payjoin
OmarHatem28 Mar 4, 2025
7a56e28
feat: Disable Payjoin per default
konstantinullrich Mar 13, 2025
016fdad
feat: Disable Payjoin fully if disabled or no Inputs available
konstantinullrich Mar 13, 2025
19079ff
feat: Resume Payjoin if app comes back to foreground
konstantinullrich Mar 13, 2025
41145e1
chore: Revert overly aggressive code formats
konstantinullrich Mar 14, 2025
c879647
feat: show correct Payjoin amount for receivers
konstantinullrich Mar 17, 2025
086d30c
feat: Improved payjoin status
konstantinullrich Mar 18, 2025
df345ec
feat: Show payjoin errors on payjoin details screen
konstantinullrich Mar 18, 2025
d9c9db2
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich Mar 18, 2025
85464f4
deps: update flutter to 3.27.4
MrCyjaneK Mar 19, 2025
1dadf33
Merge branch 'main' into implement-payjoin
konstantinullrich Mar 19, 2025
66778d8
feat: Revert localisations
konstantinullrich Mar 19, 2025
cc87b70
Merge branch 'main' into implement-payjoin
konstantinullrich Mar 31, 2025
c05a248
bug: Remove duplicate transaction id on payjoin details
konstantinullrich Mar 31, 2025
9c27c67
Merge branch 'main' into implement-payjoin
konstantinullrich Apr 2, 2025
1badf98
style: remove double await in payjoin sender
konstantinullrich Apr 2, 2025
9a25444
refactor(cw_bitcoin): Refactor method signatures and convert construc…
konstantinullrich Apr 17, 2025
c55f984
refactor(cw_bitcoin): Refactor wallet service and PSBT signer for cle…
konstantinullrich Apr 17, 2025
e4daab5
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich Apr 17, 2025
ff1ee19
fix: Resume Payjoin Sessions and load PJUri after sleep
konstantinullrich May 5, 2025
15743d3
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich May 5, 2025
16d7940
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich May 6, 2025
220fe9d
feat: Add "Copy Payjoin URL button" to receive screen
konstantinullrich May 6, 2025
65bbdaa
fix: Add "Payjoin enabled"-Box below QR Code on the receive screen
konstantinullrich May 8, 2025
07cf416
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich May 8, 2025
da47255
fix: Set payjoin_enabled color to black independent of the theme
konstantinullrich May 8, 2025
b3c0e4c
refactor: Payjoin session management and cleanup unused code.
konstantinullrich May 12, 2025
b9cdb57
Merge branch 'refs/heads/main' into implement-payjoin
konstantinullrich May 12, 2025
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
Binary file added assets/images/payjoin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 29 additions & 15 deletions cw_bitcoin/lib/address_from_output.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,36 @@ import 'package:bitcoin_base/bitcoin_base.dart';

String addressFromOutputScript(Script script, BasedUtxoNetwork network) {
try {
switch (script.getAddressType()) {
case P2pkhAddressType.p2pkh:
return P2pkhAddress.fromScriptPubkey(script: script).toAddress(network);
case P2shAddressType.p2pkInP2sh:
return P2shAddress.fromScriptPubkey(script: script).toAddress(network);
case SegwitAddresType.p2wpkh:
return P2wpkhAddress.fromScriptPubkey(script: script).toAddress(network);
case P2shAddressType.p2pkhInP2sh:
return P2shAddress.fromScriptPubkey(script: script).toAddress(network);
case SegwitAddresType.p2wsh:
return P2wshAddress.fromScriptPubkey(script: script).toAddress(network);
case SegwitAddresType.p2tr:
return P2trAddress.fromScriptPubkey(script: script).toAddress(network);
default:
}
return addressFromScript(script, network).toAddress(network);
} catch (_) {}

return '';
}

BitcoinBaseAddress addressFromScript(Script script,
[BasedUtxoNetwork network = BitcoinNetwork.mainnet]) {
final addressType = script.getAddressType();
if (addressType == null) {
throw ArgumentError("Invalid script");
}

switch (addressType) {
case P2pkhAddressType.p2pkh:
return P2pkhAddress.fromScriptPubkey(
script: script, network: BitcoinNetwork.mainnet);
case P2shAddressType.p2pkhInP2sh:
return P2shAddress.fromScriptPubkey(
Copy link
Contributor

Choose a reason for hiding this comment

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

this should also have p2pkInP2sh right?

script: script, network: BitcoinNetwork.mainnet);
case SegwitAddresType.p2wpkh:
return P2wpkhAddress.fromScriptPubkey(
script: script, network: BitcoinNetwork.mainnet);
case SegwitAddresType.p2wsh:
return P2wshAddress.fromScriptPubkey(
script: script, network: BitcoinNetwork.mainnet);
case SegwitAddresType.p2tr:
return P2trAddress.fromScriptPubkey(
script: script, network: BitcoinNetwork.mainnet);
}

throw ArgumentError("Invalid script");
}
10 changes: 8 additions & 2 deletions cw_bitcoin/lib/bitcoin_transaction_credentials.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ import 'package:cw_core/output_info.dart';
import 'package:cw_core/unspent_coin_type.dart';

class BitcoinTransactionCredentials {
BitcoinTransactionCredentials(this.outputs,
{required this.priority, this.feeRate, this.coinTypeToSpendFrom = UnspentCoinType.any});
BitcoinTransactionCredentials(
this.outputs, {
required this.priority,
this.feeRate,
this.coinTypeToSpendFrom = UnspentCoinType.any,
this.payjoinUri,
});

final List<OutputInfo> outputs;
final BitcoinTransactionPriority? priority;
final int? feeRate;
final UnspentCoinType coinTypeToSpendFrom;
final String? payjoinUri;
}
Loading
Loading