All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.eqoty.secretk.encoding.MakeSignBytes.kt Maven / Gradle / Ivy

Go to download

A Kotlin multiplatform REST client utilizing secret network's gRPC gateway endpoints.

There is a newer version: 6.4.1-rc
Show newest version
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