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

Payjoin [WIP] #1889

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
79cac41
update fee rates
OmarHatem28 Aug 14, 2024
0c0b06f
periodically update fees
OmarHatem28 Aug 14, 2024
8dd8c6e
minor enhancements
OmarHatem28 Aug 14, 2024
8dcce2a
minor enhancements
OmarHatem28 Aug 15, 2024
0fddb68
some improvements
OmarHatem28 Aug 15, 2024
be0093e
handle empty hex as null
OmarHatem28 Aug 16, 2024
fa49373
update flutter and app deps
OmarHatem28 Aug 16, 2024
deb1321
update android compile sdk for older packages
OmarHatem28 Aug 16, 2024
a066615
minor improvement
OmarHatem28 Aug 16, 2024
31618a5
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
OmarHatem28 Aug 16, 2024
a9b7491
Merge branch 'generic_fixes' of https://github.com/cake-tech/cake_wal…
OmarHatem28 Aug 17, 2024
516c85e
update build_runner
OmarHatem28 Aug 19, 2024
ef0c776
fix build runner issues
OmarHatem28 Aug 20, 2024
6a24764
fix deps
OmarHatem28 Aug 20, 2024
dec7d2b
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
OmarHatem28 Aug 20, 2024
432f783
fix deps
OmarHatem28 Aug 20, 2024
299484d
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
OmarHatem28 Aug 21, 2024
c05c927
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
OmarHatem28 Aug 22, 2024
0db1f26
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
OmarHatem28 Aug 22, 2024
66d0f4b
update gradle files
fossephate Aug 22, 2024
a955a59
Receive Payjoin v2
J0J0XMR Aug 24, 2024
9f14b82
Send Payjoin v2
J0J0XMR Aug 28, 2024
816ef42
Add missing methods for Payjoin
J0J0XMR Sep 4, 2024
3d5c3eb
Add amount to Payjoin URI
J0J0XMR Sep 4, 2024
222aeb8
Payjoin error message
J0J0XMR Sep 5, 2024
71ba1a1
Add PjURI support on Send screen
J0J0XMR Sep 6, 2024
8b3f132
Create PSBT & code clean up
J0J0XMR Sep 21, 2024
cbb4e7b
Konstantin: Add PSBT scripts
J0J0XMR Oct 26, 2024
8282bac
PSBTv0 sign & convert
J0J0XMR Oct 26, 2024
195239f
Skip address validate on PjURI
J0J0XMR Oct 28, 2024
25ae7c4
Add bitcoin.dart
J0J0XMR Nov 11, 2024
59ca8b1
DEBUG PSBT & TEMP REPOS
J0J0XMR Nov 11, 2024
7364c7d
API changes for v0.21
J0J0XMR Dec 10, 2024
15e70fe
Fix PjURI amount not filling on send page
J0J0XMR Dec 11, 2024
faf1219
TEMP REPO
J0J0XMR Dec 14, 2024
34f5b2a
Merge branch 'main' into payjoin-merge
J0J0XMR Dec 17, 2024
aea307e
Fix UnimplementedError for sender
J0J0XMR Dec 19, 2024
138c0bd
Update deps
J0J0XMR Dec 17, 2024
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
14 changes: 6 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,9 +22,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
Expand Down
25 changes: 25 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,31 @@ rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
afterEvaluate { project ->
if (project.extensions.findByName("android") != null) {
Integer pluginCompileSdk = project.android.compileSdk
if (pluginCompileSdk != null && pluginCompileSdk < 31) {
project.logger.error(
"Warning: Overriding compileSdk version in Flutter plugin: "
+ project.name
+ " from "
+ pluginCompileSdk
+ " to 31 (to work around https://issuetracker.google.com/issues/199180389)."
+ "\nIf there is not a new version of " + project.name + ", consider filing an issue against "
+ project.name
+ " to increase their compileSdk to the latest (otherwise try updating to the latest version)."
)
project.android {
compileSdk 31
}
}
}
}

project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(":app")
}
subprojects {
project.evaluationDependsOn(':app')
}
Expand Down
30 changes: 20 additions & 10 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.21" apply false
}

include ":app"
18 changes: 11 additions & 7 deletions cw_bitcoin/lib/bitcoin_address_record.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ abstract class BaseBitcoinAddressRecord {
_isUsed = isUsed;

@override
bool operator ==(Object o) => o is BaseBitcoinAddressRecord && address == o.address;
bool operator ==(Object o) =>
o is BaseBitcoinAddressRecord && address == o.address;

final String address;
bool isHidden;
Expand Down Expand Up @@ -65,9 +66,12 @@ class BitcoinAddressRecord extends BaseBitcoinAddressRecord {
String? scriptHash,
required super.network,
}) : scriptHash = scriptHash ??
(network != null ? BitcoinAddressUtils.scriptHash(address, network: network) : null);
(network != null
? BitcoinAddressUtils.scriptHash(address, network: network)
: null);

factory BitcoinAddressRecord.fromJSON(String jsonSource, {BasedUtxoNetwork? network}) {
factory BitcoinAddressRecord.fromJSON(String jsonSource,
{BasedUtxoNetwork? network}) {
final decoded = json.decode(jsonSource) as Map;

return BitcoinAddressRecord(
Expand All @@ -79,8 +83,8 @@ class BitcoinAddressRecord extends BaseBitcoinAddressRecord {
name: decoded['name'] as String? ?? '',
balance: decoded['balance'] as int? ?? 0,
type: decoded['type'] != null && decoded['type'] != ''
? BitcoinAddressType.values
.firstWhere((type) => type.toString() == decoded['type'] as String)
? BitcoinAddressType.values.firstWhere(
(type) => type.toString() == decoded['type'] as String)
: SegwitAddresType.p2wpkh,
scriptHash: decoded['scriptHash'] as String?,
network: network,
Expand Down Expand Up @@ -140,8 +144,8 @@ class BitcoinSilentPaymentAddressRecord extends BaseBitcoinAddressRecord {
: BasedUtxoNetwork.fromName(decoded['network'] as String),
silentPaymentTweak: decoded['silent_payment_tweak'] as String?,
type: decoded['type'] != null && decoded['type'] != ''
? BitcoinAddressType.values
.firstWhere((type) => type.toString() == decoded['type'] as String)
? BitcoinAddressType.values.firstWhere(
(type) => type.toString() == decoded['type'] as String)
: SilentPaymentsAddresType.p2sp,
);
}
Expand Down
Loading