Skip to content

Commit

Permalink
Merge pull request #41 from lightsparkdev/release/core-v0.3.2
Browse files Browse the repository at this point in the history
Merge release/core-v0.3.2 into main
  • Loading branch information
jklein24 authored Aug 18, 2023
2 parents d81be2f + 162db76 commit fa11681
Show file tree
Hide file tree
Showing 103 changed files with 1,422 additions and 245 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/core-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/core-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/crypto-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/crypto-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/docs-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ name: Publish SDK Docs

on:
workflow_run:
workflows: [ SDK Core Publish, Lightspark SDK Publish, Wallet SDK Publish ]
workflows:
[
SDK Core Publish,
Lightspark SDK Publish,
Wallet SDK Publish,
Crypto SDK Publish,
]
types:
- completed

Expand All @@ -16,11 +22,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
java-version: "18"
distribution: "temurin"
- name: "Configure AWS credentials"
uses: "aws-actions/configure-aws-credentials@v1"
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lightspark-sdk-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lightspark-sdk-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-branch-cut.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wallet-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wallet-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 18
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '18'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
Expand Down
12 changes: 6 additions & 6 deletions androidwalletdemo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ try {

android {
namespace = "com.lightspark.androidwalletdemo"
compileSdk = 33
compileSdk = 34

defaultConfig {
applicationId = "com.lightspark.androidwalletdemo"
minSdk = 24
targetSdk = 33
targetSdk = 34
versionCode = versionProperties.getProperty("version_code").toInt()
versionName = versionProperties.getProperty("version_name")

Expand All @@ -45,17 +45,17 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_18
}
kotlinOptions {
jvmTarget = "17"
jvmTarget = "18"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.0"
kotlinCompilerExtensionVersion = "1.5.1"
}
packagingOptions {
resources {
Expand Down
6 changes: 3 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ android {
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_18
}
dependencies {
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:${libs.versions.dokka.get()}")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
coreLibraryDesugaring(libs.desugar.jdk.libs)
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GROUP=com.lightspark
POM_ARTIFACT_ID=lightspark-core
# Don't bump this manually. Run `scripts/versions.main.kt <new_version>` to bump the version instead.
VERSION_NAME=0.3.1
VERSION_NAME=0.3.2

POM_DESCRIPTION=The Lightspark shared utilities library for Kotlin and Java.
POM_INCEPTION_YEAR=2023
6 changes: 3 additions & 3 deletions crypto/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ android {
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_18
}
dependencies {
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:${libs.versions.dokka.get()}")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
coreLibraryDesugaring(libs.desugar.jdk.libs)
}
}
24 changes: 13 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
[versions]
# Core SDK deps (or common):
acinqSecp256k1 = "0.10.0"
androidGradlePlugin = "8.0.0"
androidGradlePlugin = "8.1.0"
appAuth = "0.11.1"
buildKonfig = "0.13.3"
dataStore = "1.0.0"
desugar_jdk_libs = "2.0.3"
dokka = "1.8.10"
downloadFile = "5.4.0"
gradleS3 = "1.2.1"
jna = "5.13.0"
kase64 = "1.0.6"
kotest = "5.5.4"
kotlin = "1.8.0"
kotlin = "1.9.0"
kotlinCompilerExtension = "1.4.0"
kotlinCoroutines = "1.6.4"
kotlinxDateTime = "0.4.0"
kotlinSerializationJson = "1.4.1"
krypt = "0.3.1"
ktlint = "11.3.1"
ktor = "2.2.3"
lightsparkCore = "0.3.1"
lightsparkCore = "0.3.2"
mavenPublish = "0.25.2"

# Android Wallet demo deps:
accompanist = "0.28.0"
activityCompose = "1.6.1"
barcodeScanning = "17.0.3"
cameraX = "1.3.0-alpha02"
composeBom = "2023.01.00"
coreKtx = "1.9.0"
activityCompose = "1.7.2"
barcodeScanning = "17.2.0"
cameraX = "1.3.0-beta02"
composeBom = "2023.08.00"
coreKtx = "1.10.1"
espresso = "3.5.1"
hilt = "2.45"
hilt = "2.47"
hiltComposeNavigation = "1.0.0"
junit = "4.13.2"
junitExt = "1.1.5"
lifecycleRuntimeKtx = "2.5.1"
navigationCompose = "2.5.3"
lifecycleRuntimeKtx = "2.6.1"
navigationCompose = "2.7.0"
retrofit = "2.9.0"
qrCode = "1.0.1"
zxing = "3.5.1"
Expand All @@ -45,6 +46,7 @@ activity-compose = { module = "androidx.activity:activity-compose", version.ref
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleRuntimeKtx" }
desugar_jdk_libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar_jdk_libs" }
navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }

gradleClasspath-android = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
Expand Down
8 changes: 4 additions & 4 deletions lightspark-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,18 @@ mavenPublishing {}
android {
namespace = "com.lightspark.sdk"
version = VERSION_NAME
compileSdk = 33
compileSdk = 34
defaultConfig {
minSdk = 24
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_18
}
dependencies {
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:${libs.versions.dokka.get()}")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
coreLibraryDesugaring(libs.desugar.jdk.libs)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.lightspark.sdk.model.BitcoinNetwork
import com.lightspark.sdk.model.CreateApiTokenOutput
import com.lightspark.sdk.model.CurrencyAmount
import com.lightspark.sdk.model.FeeEstimate
import com.lightspark.sdk.model.Invoice
import com.lightspark.sdk.model.InvoiceData
import com.lightspark.sdk.model.InvoiceType
import com.lightspark.sdk.model.OutgoingPayment
Expand All @@ -21,7 +22,6 @@ import java.util.concurrent.CompletableFuture
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.future.future
import kotlinx.coroutines.runBlocking

/**
* Main entry point for the Lightspark SDK using the Java Futures API.
Expand Down Expand Up @@ -117,15 +117,17 @@ class LightsparkFuturesClient(config: ClientConfig) {
* @param amountMsats The amount of the invoice in milli-satoshis.
* @param memo Optional memo to include in the invoice.
* @param type The type of invoice to create. Defaults to [InvoiceType.STANDARD].
* @param expirySecs The number of seconds until the invoice expires. Defaults to 1 day.
*/
@JvmOverloads
fun createInvoice(
nodeId: String,
amountMsats: Long,
memo: String? = null,
type: InvoiceType = InvoiceType.STANDARD,
): CompletableFuture<InvoiceData> =
coroutineScope.future { coroutinesClient.createInvoice(nodeId, amountMsats, memo, type) }
expirySecs: Int? = null,
): CompletableFuture<Invoice> =
coroutineScope.future { coroutinesClient.createInvoice(nodeId, amountMsats, memo, type, expirySecs) }

/**
* Creates a Lightning invoice for the given node. This should only be used for generating invoices for LNURLs, with
Expand All @@ -135,14 +137,16 @@ class LightsparkFuturesClient(config: ClientConfig) {
* @param amountMsats The amount of the invoice in milli-satoshis.
* @param metadata The LNURL metadata payload field from the initial payreq response. This will be hashed and
* present in the h-tag (SHA256 purpose of payment) of the resulting Bolt 11 invoice.
* @param expirySecs The number of seconds until the invoice expires. Defaults to 1 day.
*/
@JvmOverloads
fun createLnurlInvoice(
nodeId: String,
amountMsats: Long,
metadata: String
): CompletableFuture<InvoiceData> =
coroutineScope.future { coroutinesClient.createLnurlInvoice(nodeId, amountMsats, metadata) }
metadata: String,
expirySecs: Int? = null,
): CompletableFuture<Invoice> =
coroutineScope.future { coroutinesClient.createLnurlInvoice(nodeId, amountMsats, metadata, expirySecs) }

/**
* Pay a lightning invoice for the given node.
Expand Down
Loading

0 comments on commit fa11681

Please sign in to comment.