-
Notifications
You must be signed in to change notification settings - Fork 1
/
data.go
34 lines (30 loc) · 972 Bytes
/
data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package asset
import (
"math/big"
"github.com/xssnick/tonutils-go/tvm/cell"
)
// Data represents the structure of asset data
type Data struct {
SRate *big.Int
BRate *big.Int
TotalSupply *big.Int
TotalBorrow *big.Int
LastAccrual *big.Int
Balance *big.Int
TrackingSupplyIndex *big.Int
TrackingBorrowIndex *big.Int
AwaitedSupply *big.Int
}
func newData(assetData *cell.Slice) *Data {
return &Data{
SRate: assetData.MustLoadBigUInt(64),
BRate: assetData.MustLoadBigUInt(64),
TotalSupply: assetData.MustLoadBigUInt(64),
TotalBorrow: assetData.MustLoadBigUInt(64),
LastAccrual: assetData.MustLoadBigUInt(32),
Balance: assetData.MustLoadBigUInt(64),
TrackingSupplyIndex: assetData.MustLoadBigUInt(64),
TrackingBorrowIndex: assetData.MustLoadBigUInt(64),
AwaitedSupply: assetData.MustLoadBigUInt(64),
}
}