hedera-docs
hedera-docs copied to clipboard
test: Create and Transfer Your First NFT
- [x] Java
- [x] JavaScript
- [x] Go
https://docs.hedera.com/hedera/tutorials/token/create-and-transfer-your-first-nft
resolved in 3060364
"balanceCheckTx.tokens._map.get(tokenId.toString())" is maybe problematic.
- balanceCheckTx.tokens is a TokenBalanceMap, which internally wraps a _map (a Map<string, Long>).
- Accessing .tokens._map.get(tokenId.toString()) is poking directly into the private implementation (_map is meant to be internal).
Recommendation was to use the API:
const balance = balanceCheckTx.tokens.get(tokenId);
console.log(Balance for ${tokenId.toString()}: ${balance.toString()});