com.swmansion.starknet.extensions.JsonExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of starknet Show documentation
Show all versions of starknet Show documentation
Starknet SDK for JVM languages
package com.swmansion.starknet.extensions
import com.swmansion.starknet.data.types.Felt
import kotlinx.serialization.json.*
@JvmSynthetic
internal fun JsonObjectBuilder.put(key: String, value: Felt?): JsonElement? =
put(key, JsonPrimitive(value?.hexString() ?: Felt.ZERO.hexString()))
@JvmSynthetic
internal fun JsonArrayBuilder.add(value: Felt): Boolean = add(JsonPrimitive(value.hexString()))
© 2015 - 2024 Weber Informatics LLC | Privacy Policy