Skip to content

Commit

Permalink
add comments and setup for continuation of work
Browse files Browse the repository at this point in the history
  • Loading branch information
matijamarjanovic committed Jan 18, 2025
1 parent 73d6aca commit 495c1ae
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion examples/gno.land/r/matijamarjanovic/gnocket/wallet_registry.gno
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func NewWallet() *Wallet {
return wallet
}

// TODO: Add GetMyBalances() for user to get their balance

// TODO: Add SetPublic() for user to set their wallet public

func GetAllTokens() string {
return tokenhub.GetAllTokens()
}
Expand All @@ -61,10 +65,35 @@ func GetAllTokensNoNFTs() string {


func Render(path string) string {

userToDisplay := getAddressForUsername(path)
RenderUserPage(userToDisplay)

sb := strings.Builder{}
sb.WriteString("")

return sb.String()
}

func RenderUserPage(userToDisplay std.Address) string {

wallet := wallets.Get(string(userToDisplay))
if wallet.public {
//TODO : render wallet content for the public
}

return ""
}


func getAddressForUsername(addrOrName string) std.Address {
addr := std.Address(addrOrName)

if addr.IsValid() {
return addr
}
if user := users.GetUserByName(addrOrName); user != nil {
return user.Address
}

return ""
}

0 comments on commit 495c1ae

Please sign in to comment.