Skip to content

Commit

Permalink
Fix a potential jvm compat issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jklein24 committed Sep 21, 2023
1 parent e50fd82 commit c11acc5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.lightspark.sdk.model.*
import com.lightspark.sdk.util.serializerFormat
import java.security.MessageDigest
import kotlinx.coroutines.flow.Flow
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.*

private const val SCHEMA_ENDPOINT = "graphql/server/2023-09-13"
Expand Down Expand Up @@ -92,7 +93,7 @@ class LightsparkCoroutinesClient private constructor(
AccountDashboardQuery,
{
add("network", bitcoinNetwork.rawValue)
nodeIds?.let { add("nodeIds", nodeIds) }
nodeIds?.let { add("nodeIds", serializerFormat.encodeToString(nodeIds)) }
},
) {
val account =
Expand Down Expand Up @@ -563,7 +564,7 @@ class LightsparkCoroutinesClient private constructor(
CreateApiTokenMutation,
{
add("name", name)
add("permissions", permissions.map { it.rawValue })
add("permissions", serializerFormat.encodeToString(permissions.map { it.rawValue }))
},
) {
val tokenJson = requireNotNull(it["create_api_token"]) { "No token found in response" }
Expand Down

0 comments on commit c11acc5

Please sign in to comment.