Skip to content

Commit

Permalink
unequip nft controller
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperBatata committed Oct 9, 2023
1 parent 1207360 commit a03c9f5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/kotlin/id/walt/nftkit/rest/NftController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,28 @@ object NftController {
}.queryParam<String>("signedAccount") {
}.json<TransactionResponse>("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<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")
val contractAddress = ctx.pathParam("contractAddress")
Expand Down

0 comments on commit a03c9f5

Please sign in to comment.