From 9362f8f8d54f7f1dba6df5e7d3af2bb53856fa6a Mon Sep 17 00:00:00 2001 From: matijamarjanovic Date: Fri, 17 Jan 2025 19:16:34 +0100 Subject: [PATCH] get nft slug --- .../r/matijamarjanovic/gnocket/wallet_registry.gno | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/gno.land/r/matijamarjanovic/gnocket/wallet_registry.gno b/examples/gno.land/r/matijamarjanovic/gnocket/wallet_registry.gno index b3831b6e37b..3a3a95897e6 100644 --- a/examples/gno.land/r/matijamarjanovic/gnocket/wallet_registry.gno +++ b/examples/gno.land/r/matijamarjanovic/gnocket/wallet_registry.gno @@ -9,6 +9,7 @@ import ( "gno.land/r/matijamarjanovic/tokenhub" "gno.land/p/demo/ufmt" "gno.land/p/demo/grc/grc1155" + "gno.land/p/demo/grc/grc721" ) var ( @@ -73,10 +74,12 @@ func useWallet() { println("token_id", token_id, "token_balance", token_balance) } else if token_type == "NFT" { + key_parts := strings.Split(token_key, ".") + token_id := key_parts[len(key_parts)-1] tokenGetter := tokenhub.MustGetGRC721(token_key) nft_token := tokenGetter() - nft_token.SafeTransferFrom(caller, std.CurrentRealm().Addr(), "") // TODO: token_id - println("token_id", token_id, "token_balance", token_balance) + nft_token.SafeTransferFrom(caller, std.CurrentRealm().Addr(), grc721.TokenID(token_id)) + println("token_id", token_id) } return true