diff --git a/backend/app/Savor22b/GraphTypes/Query/Query.cs b/backend/app/Savor22b/GraphTypes/Query/Query.cs index 59d26785..0df31acb 100644 --- a/backend/app/Savor22b/GraphTypes/Query/Query.cs +++ b/backend/app/Savor22b/GraphTypes/Query/Query.cs @@ -27,6 +27,27 @@ public Query(BlockChain blockChain, Swarm? swarm = null) _blockChain = blockChain; _swarm = swarm; + Field( + "userState", + description: "The specified address's user state", + arguments: new QueryArguments( + new QueryArgument> + { + Name = "address", + Description = "The account holder's 40-hex address", + } + ), + resolve: context => + { + var accountAddress = new Address(context.GetArgument("address")); + var rootStateEncoded = blockChain.GetState(accountAddress); + RootState rootState = rootStateEncoded is Bencodex.Types.Dictionary bdict + ? new RootState(bdict) + : new RootState(); + return rootState; + } + ); + Field( "asset", description: "The specified address's balance in MNT.",