Skip to content

Commit

Permalink
Merge pull request #141 from walt-id/feat/opa-algorand
Browse files Browse the repository at this point in the history
add opa support to algorand
  • Loading branch information
SuperBatata authored Sep 1, 2023
2 parents 93e6f43 + db735a0 commit ff97b50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/kotlin/id/walt/nftkit/opa/DynamicPolicy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ object DynamicPolicy {
nftMetadata.uniqueNftMetadata.attributes?.forEach { data.put(it.name, it.value) }


}else if (nftMetadata.algorandNftMetadata != null){
data.put("name", nftMetadata.algorandNftMetadata.name)
data.put("description", nftMetadata.algorandNftMetadata.description)
data.put("image", nftMetadata.algorandNftMetadata.image)
data.put("unitname", nftMetadata.algorandNftMetadata.unitName)
}
return data
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ object VerificationService {
return DynamicPolicy.doVerify(policy!!.input, policy.policy, policy.policyQuery, nftMetadata)
}

Common.isAlgorand(chain) -> {
val algorandNftmetadata= AlgorandNftService.getNftMetadata(tokenId ,AlgorandChain.valueOf(chain.toString()) )
val nftMetadata = NftMetadataWrapper(null,null,null,null,null , algorandNftmetadata)
return DynamicPolicy.doVerify(policy!!.input, policy.policy, policy.policyQuery, nftMetadata)
}

else -> {throw Exception("Chain is not supported")}
}
}
Expand Down

0 comments on commit ff97b50

Please sign in to comment.