From 8ccaebcefd8d95459b8c9dcb619d4f7145ec5d69 Mon Sep 17 00:00:00 2001 From: Zakhar Petukhov Date: Tue, 1 Oct 2024 13:20:01 +0800 Subject: [PATCH] create an account stats struct --- pkg/core/account.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkg/core/account.go b/pkg/core/account.go index f4480611..57581f14 100644 --- a/pkg/core/account.go +++ b/pkg/core/account.go @@ -4,28 +4,28 @@ import ( "math/big" "github.com/tonkeeper/tongo/abi" + "github.com/tonkeeper/tongo/ton" "github.com/shopspring/decimal" - "github.com/tonkeeper/tongo" "github.com/tonkeeper/tongo/tlb" ) // Account holds low-level details about a particular account taken directly from the blockchain. type Account struct { - AccountAddress tongo.AccountID + AccountAddress ton.AccountID Status tlb.AccountStatus TonBalance int64 ExtraBalances map[uint32]decimal.Decimal LastTransactionLt uint64 - LastTransactionHash tongo.Bits256 + LastTransactionHash ton.Bits256 Code []byte Data []byte - FrozenHash *tongo.Bits256 + FrozenHash *ton.Bits256 Storage StorageInfo Interfaces []abi.ContractInterface LastActivityTime int64 GetMethods []string - Libraries map[tongo.Bits256]*SimpleLib + Libraries map[ton.Bits256]*SimpleLib } // StorageInfo is taken from TLB storage_stat:StorageInfo. @@ -52,6 +52,14 @@ type Contract struct { Balance int64 Code []byte Data []byte - Libraries map[tongo.Bits256]*SimpleLib + Libraries map[ton.Bits256]*SimpleLib LastTransactionLt uint64 } + +type AccountStats struct { + AccountID ton.AccountID + NftsCount int32 + JettonsCount int32 + MultisigCount int32 + StakingCount int32 +}