Пример #1
0
        public virtual BigInteger BalanceOf(StoreView snapshot, UInt160 account)
        {
            StorageItem storage = snapshot.Storages.TryGet(CreateAccountKey(account));

            if (storage is null)
            {
                return(BigInteger.Zero);
            }
            Nep5AccountState state = new Nep5AccountState(storage.Value);

            return(state.Balance);
        }
Пример #2
0
        protected virtual BigInteger BalanceOf(ApplicationEngine engine, UInt160 account)
        {
            StorageItem storage = engine.Service.Snapshot.Storages.TryGet(CreateAccountKey(account));

            if (storage is null)
            {
                return(BigInteger.Zero);
            }
            Nep5AccountState state = new Nep5AccountState(storage.Value);

            return(state.Balance);
        }