-
Notifications
You must be signed in to change notification settings - Fork 47
/
price.go
53 lines (44 loc) · 1.27 KB
/
price.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package types
import (
sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
)
type StreamRecordChange struct {
Addr sdk.AccAddress
RateChange sdkmath.Int
StaticBalanceChange sdkmath.Int
LockBalanceChange sdkmath.Int
}
func NewDefaultStreamRecordChangeWithAddr(addr sdk.AccAddress) *StreamRecordChange {
return &StreamRecordChange{
Addr: addr,
RateChange: sdkmath.ZeroInt(),
StaticBalanceChange: sdkmath.ZeroInt(),
LockBalanceChange: sdkmath.ZeroInt(),
}
}
func (change *StreamRecordChange) WithRateChange(rateChange sdkmath.Int) *StreamRecordChange {
change.RateChange = rateChange
return change
}
func (change *StreamRecordChange) WithStaticBalanceChange(staticBalanceChange sdkmath.Int) *StreamRecordChange {
change.StaticBalanceChange = staticBalanceChange
return change
}
func (change *StreamRecordChange) WithLockBalanceChange(lockBalanceChange sdkmath.Int) *StreamRecordChange {
change.LockBalanceChange = lockBalanceChange
return change
}
type StoragePriceParams struct {
PrimarySp string
PriceTime int64
}
type StoragePrice struct {
ReadPrice sdk.Dec
PrimaryStorePrice sdk.Dec
SecondaryStorePrice sdk.Dec
}
type UserFlows struct {
From sdk.AccAddress
Flows []OutFlow
}