diff --git a/client/src/commonMain/kotlin/io/eqoty/secretk/client/RestClient.kt b/client/src/commonMain/kotlin/io/eqoty/secretk/client/RestClient.kt index a37edd0..deb9e46 100644 --- a/client/src/commonMain/kotlin/io/eqoty/secretk/client/RestClient.kt +++ b/client/src/commonMain/kotlin/io/eqoty/secretk/client/RestClient.kt @@ -131,6 +131,12 @@ internal class RestClient( return responseData.result } + suspend fun getLabelByContractAddr(addr: String): String { + val path = "/compute/v1beta1/label/$addr" + val response: LabelResponse = get(path) + return response.label + } + suspend fun getCodeInfoByCodeId(codeId: String): CodeInfo { val path = "/compute/v1beta1/code/$codeId" val responseData: CodeInfoResponse = get(path) diff --git a/client/src/commonMain/kotlin/io/eqoty/secretk/types/response/LabelResponse.kt b/client/src/commonMain/kotlin/io/eqoty/secretk/types/response/LabelResponse.kt new file mode 100644 index 0000000..84aaf7d --- /dev/null +++ b/client/src/commonMain/kotlin/io/eqoty/secretk/types/response/LabelResponse.kt @@ -0,0 +1,8 @@ +package io.eqoty.secretk.types.response + +import kotlinx.serialization.Serializable + +@Serializable +data class LabelResponse( + val label: String, +) \ No newline at end of file