commonMain.io.eqoty.secretk.wallet.Signature.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.wallet
import io.eqoty.secretk.types.StdSignature
import io.eqoty.secretk.utils.toByteString
fun encodeSecp256k1Signature(pubkey: UByteArray, signature: UByteArray): StdSignature {
if (signature.size != 64) {
throw Error(
"Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.",
)
}
return StdSignature(
// eslint-disable-next-line @typescript-eslint/camelcase
pubKey = encodeSecp256k1Pubkey(pubkey),
signature = signature.toByteString().base64()
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy