commonMain.io.ipfs.kotlin.commands.Pins.kt Maven / Gradle / Ivy
package io.ipfs.kotlin.commands
import io.ipfs.kotlin.IPFSConnection
import io.ktor.client.statement.*
class Pins(val ipfs: IPFSConnection) {
suspend fun add(hash: String): Boolean {
val resultString = ipfs.callCmd("pin/add/$hash").let { it.bodyAsText() }
val resultBoolean = resultString.contains(hash)
if (!resultBoolean) {
ipfs.setErrorByJSON(resultString)
}
return resultBoolean
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy