From c333c42236a5d479031053a90dc4c04b0542940a Mon Sep 17 00:00:00 2001 From: matijamarjanovic Date: Sat, 18 Jan 2025 01:02:07 +0100 Subject: [PATCH] add different funcs for prevrealm and orig caller --- .../gno.land/r/matijamarjanovic/tokenhub/tokenhub.gno | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/gno.land/r/matijamarjanovic/tokenhub/tokenhub.gno b/examples/gno.land/r/matijamarjanovic/tokenhub/tokenhub.gno index 41fd7a11fb7..ec032c2dd3e 100644 --- a/examples/gno.land/r/matijamarjanovic/tokenhub/tokenhub.gno +++ b/examples/gno.land/r/matijamarjanovic/tokenhub/tokenhub.gno @@ -90,6 +90,7 @@ func RegisterGRC1155Token(mtGetter grc1155.MultiTokenGetter, tokenID string) err return nil } +// for realm use func GetMyBalancesAll() string { return getBalances(string(std.PrevRealm().Addr())) } @@ -98,6 +99,15 @@ func GetMyBalances() string { return getNonZeroBalances(string(std.PrevRealm().Addr())) } +// for user use +func GetMyBalancesAllOrigCaller() string { + return getBalances(string(std.GetOrigCaller())) +} + +func GetMyBalancesOrigCaller() string { + return getNonZeroBalances(string(std.GetOrigCaller())) +} + func GetGRC20(key string) grc20.TokenGetter { return grc20reg.Get(key) }