commonMain.io.eqoty.secretk.encoding.MakeSignBytes.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client-jvm Show documentation
Show all versions of client-jvm Show documentation
A Kotlin multiplatform REST client utilizing secret network's gRPC gateway endpoints.
package io.eqoty.secretk.encoding
import com.ionspin.kotlin.bignum.integer.BigInteger
import com.ionspin.kotlin.crypto.util.encodeToUByteArray
import io.eqoty.secretk.types.StdFee
import io.eqoty.secretk.types.response.TypeValue
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
inline fun makeSignBytes(
msgs: List>,
fee: StdFee,
chainId: String,
memo: String,
accountNumber: BigInteger,
sequence: BigInteger,
): UByteArray {
val signJson = SignJson(
// eslint-disable-next-line @typescript-eslint/camelcase
account_number = accountNumber.toString(),
// eslint-disable-next-line @typescript-eslint/camelcase
chain_id = chainId,
fee = fee,
memo = memo,
msgs = msgs,
sequence = sequence.toString(),
)
//val signMsg = sortJson(signJson);
val test = Json.encodeToString(signJson)
return test.encodeToUByteArray()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy