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

Merge changes for v1.0-beta-12 #30

Merged
merged 3 commits into from
Feb 18, 2025
Merged
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You can include the library from either Maven Central or Jitpack.
You can include the library in the common source set like this:
```kotlin
dependencies {
implementation("io.github.kotlingeekdev:rhodium:1.0-beta-11")
implementation("io.github.kotlingeekdev:rhodium:1.0-beta-12")

}
```
Expand Down Expand Up @@ -74,7 +74,7 @@ then, in your module's `build.gradle(.kts)`, you need to add:
// build.gradle.kts
dependencies {
//...
implementation("com.github.KotlinGeekDev.Rhodium:rhodium:1.0-beta-11")
implementation("com.github.KotlinGeekDev.Rhodium:rhodium:1.0-beta-12")


}
Expand All @@ -85,7 +85,7 @@ If you're including it in an Android app, you can just add:
// app/build.gradle.kts
dependencies {
//...
implementation("com.github.KotlinGeekDev.Rhodium:rhodium-android:1.0-beta-11")
implementation("com.github.KotlinGeekDev.Rhodium:rhodium-android:1.0-beta-12")

}
```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ allprojects {
val isJitpack = System.getenv("JITPACK") == "true"

group = "io.github.kotlingeekdev"
version = "1.0-beta-11"
version = "1.0-beta-12"


// val javadocJar = tasks.register<Jar>("javadocJar") {
Expand Down
52 changes: 20 additions & 32 deletions rhodium-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kotlin {
languageVersion.set(KotlinVersion.KOTLIN_1_8)
}

jvm("baseJvm") {
jvm("commonJvm") {

@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
Expand Down Expand Up @@ -118,37 +118,31 @@ kotlin {
implementation(kotlin("test-annotations-common"))
}

val commonJvmMain = create("commonJvmMain") {
val commonJvmMain by getting {
dependsOn(commonMain.get())
}
commonJvmMain.dependencies {
implementation("dev.whyoleg.cryptography:cryptography-provider-jdk:$kotlinCryptoVersion")

implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
implementation("ch.qos.logback:logback-classic:1.4.14")
}
dependencies {
implementation("dev.whyoleg.cryptography:cryptography-provider-jdk:$kotlinCryptoVersion")

val commonJvmTest = create("commonJvmTest") {
dependsOn(commonTest.get())
}
commonJvmTest.dependencies {
implementation(kotlin("test-junit5"))

implementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
implementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
implementation("org.assertj:assertj-core:3.23.1")
runtimeOnly("fr.acinq.secp256k1:secp256k1-kmp-jni-jvm-linux:0.15.0")
runtimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
runtimeOnly("org.junit.vintage:junit-vintage-engine:$junitJupiterVersion")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
//implementation("fr.acinq.secp256k1:secp256k1-kmp-jvm:0.6.4")
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-jvm:0.15.0")
}
}

val baseJvmMain by getting {
dependsOn(commonJvmMain)
val commonJvmTest by getting {
dependsOn(commonTest.get())

dependencies {
//implementation("fr.acinq.secp256k1:secp256k1-kmp-jvm:0.6.4")
implementation("fr.acinq.secp256k1:secp256k1-kmp-jni-jvm:0.15.0")
implementation(kotlin("test-junit5"))

implementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
implementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
implementation("org.assertj:assertj-core:3.23.1")
runtimeOnly("fr.acinq.secp256k1:secp256k1-kmp-jni-jvm-linux:0.15.0")
runtimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
runtimeOnly("org.junit.vintage:junit-vintage-engine:$junitJupiterVersion")
}
}

Expand All @@ -164,16 +158,10 @@ kotlin {
}

androidInstrumentedTest.configure {
//dependsOn(commonJvmTest)
}

val androidUnitTest by getting {
dependsOn(commonJvmTest)
}



val baseJvmTest by getting {
val androidUnitTest by getting {
dependsOn(commonJvmTest)
}

Expand Down
8 changes: 4 additions & 4 deletions rhodium-core/src/commonMain/kotlin/rhodium/net/NostrUtils.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package rhodium.net

import rhodium.nostr.Nip05ValidationError
import rhodium.nostr.arraySerializer
import rhodium.nostr.eventMapper
import io.ktor.client.*
import io.ktor.client.plugins.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
import kotlinx.serialization.json.jsonArray
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
import rhodium.nostr.Nip05ValidationError
import rhodium.nostr.arraySerializer
import rhodium.nostr.eventMapper

object NostrUtils {

Expand All @@ -21,7 +21,7 @@ object NostrUtils {
if (nameWithDomain.size > 2 || nameWithDomain.isEmpty()) {
throw Nip05ValidationError("Likely a malformed address.")
}
else if (nameWithDomain.size == 1 || nameWithDomain[0].contentEquals("_")) {
else if (nameWithDomain.size == 1) {
val domain = nameWithDomain[0]
if (!UrlUtil.isValidUrl(domain)) throw Nip05ValidationError("Invalid identifier.")
val urlToUse = "https://${domain}/.well-known/nostr.json?name=_"
Expand Down