From a03c9f50e552e9c7bb0a2a5689c64b1aabc55f15 Mon Sep 17 00:00:00 2001 From: SuperBatata Date: Mon, 9 Oct 2023 23:14:06 +0100 Subject: [PATCH] unequip nft controller --- .../id/walt/nftkit/rest/NftController.kt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/kotlin/id/walt/nftkit/rest/NftController.kt b/src/main/kotlin/id/walt/nftkit/rest/NftController.kt index ae17cb8f..dca0a0e8 100644 --- a/src/main/kotlin/id/walt/nftkit/rest/NftController.kt +++ b/src/main/kotlin/id/walt/nftkit/rest/NftController.kt @@ -139,6 +139,28 @@ object NftController { }.queryParam("signedAccount") { }.json("200") { it.description("Transaction ID") } + fun unequip(ctx: Context){ + val chain = ctx.pathParam("chain") + val contractAddress = ctx.pathParam("contractAddress") + val tokenId = ctx.pathParam("tokenId") + val signedAccount = ctx.queryParam("signedAccount") + val result = + NftService.unequipToken(Common.getEVMChain(chain.uppercase()), contractAddress, BigInteger.valueOf(tokenId.toLong()), signedAccount) + ctx.json( + result + ) + } + + fun unequipDocs() = document().operation { + it.summary("NFT unequipping") + .operationId("unequipNft").addTagsItem(TAG1) + }.pathParam("chain") { + it.schema { } + }.pathParam("contractAddress") { + }.pathParam("tokenId") { + }.queryParam("signedAccount") { + }.json("200") { it.description("Transaction ID") } + fun getNftMetadatUri(ctx: Context) { val chain = ctx.pathParam("chain") val contractAddress = ctx.pathParam("contractAddress")