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

jsMain.jslibs.secretjs.encryption.module_secretjs.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
@file:Suppress(
    "INTERFACE_WITH_SUPERCLASS",
    "OVERRIDING_FINAL_MEMBER",
    "RETURN_TYPE_MISMATCH_ON_OVERRIDE",
    "CONFLICTING_OVERLOADS"
)
@file:JsModule("secretjs")
@file:JsNonModule

package jslibs.secretjs

import org.khronos.webgl.Uint8Array
import kotlin.js.Promise

external interface EncryptionUtils {
    var getPubkey: () -> Promise
    var decrypt: (ciphertext: Uint8Array, nonce: Uint8Array) -> Promise
    var encrypt: (contractCodeHash: String, msg: Any?) -> Promise
    var getTxEncryptionKey: (nonce: Uint8Array) -> Promise
}

external interface `T$2` {
    var privkey: Uint8Array
    var pubkey: Uint8Array
}

open external class EncryptionUtilsImpl(
    registrationQuerier: Any,
    seed: Uint8Array = definedExternally,
    chainId: String = definedExternally
) : EncryptionUtils {
    open var registrationQuerier: Any
    open var seed: Any
    open var privkey: Any
    open var pubkey: Uint8Array
    open var consensusIoPubKey: Any
    open var getConsensusIoPubKey: Any
    override var getTxEncryptionKey: (nonce: Uint8Array) -> Promise
    override var encrypt: (contractCodeHash: String, msg: Any?) -> Promise
    override var decrypt: (ciphertext: Uint8Array, nonce: Uint8Array) -> Promise
    override var getPubkey: () -> Promise

    companion object {
        fun GenerateNewKeyPair(): `T$2`
        fun GenerateNewSeed(): Uint8Array
        fun GenerateNewKeyPairFromSeed(seed: Uint8Array): `T$2`
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy