Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create an account stats struct #498

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions pkg/core/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Loading