Skip to content

Commit

Permalink
changed assetCreation to support more parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperBatata committed Jul 29, 2023
1 parent 3cd4152 commit 9064a3c
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/main/kotlin/id/walt/nftkit/rest/AlgorandNftController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,24 @@ object AlgorandNftController{

fun assetCreation(ctx : Context){
val chain =ctx.pathParam("chain")
val result = AlgorandNftService.createAssetArc3(Common.getAlgorandChain(chain.uppercase()),ctx.pathParam("assetName"), ctx.pathParam("assetUnitName"), ctx.pathParam("url"))


val properties = ctx.bodyAsClass(Arc3Metadata::class.java)

// val result = AlgorandNftService.createAssetArc3(Common.getAlgorandChain(chain.uppercase()),ctx.pathParam("assetName"), ctx.pathParam("assetUnitName"), ctx.pathParam("url"))
// ctx.json(result)

val result = properties.let {
AlgorandNftService.createAssetArc3(
Common.getAlgorandChain(chain.uppercase()),
it.name,
it.unitName,
it.image,
it.description,
it.decimals,
it.properties
)
}
ctx.json(result)
}

Expand All @@ -51,7 +68,12 @@ object AlgorandNftController{

}
.pathParam<String>("chain") {
it.schema<AlgorandChain>{}}
it.schema<AlgorandChain>{}
}
.body<Arc3Metadata> {
it.description("Algorand Asset")

}
.json<AlgodResponse>(200.toString()) {
it.description("Algorand Asset")
}
Expand Down

0 comments on commit 9064a3c

Please sign in to comment.