Skip to content

Commit

Permalink
revoke nft controller
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperBatata committed Oct 8, 2023
1 parent f59770e commit 1207360
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/kotlin/id/walt/nftkit/rest/NftController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,27 @@ object NftController {
it.description("")
}.json<MintingResponse>("200") { it.description("Transaction ID and token ID") }

fun revoke(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.revokeToken(Common.getEVMChain(chain.uppercase()), contractAddress, BigInteger.valueOf(tokenId.toLong()), signedAccount)
ctx.json(
result
)
}

fun revokeDocs() = document().operation {
it.summary("NFT revoking")
.operationId("revokeNft").addTagsItem(TAG1)
}.pathParam<String>("chain") {
it.schema<EVMChain> { }
}.pathParam<String>("contractAddress") {
}.pathParam<String>("tokenId") {
}.queryParam<String>("signedAccount") {
}.json<TransactionResponse>("200") { it.description("Transaction ID") }

fun getNftMetadatUri(ctx: Context) {
val chain = ctx.pathParam("chain")
Expand Down

0 comments on commit 1207360

Please sign in to comment.