-
Notifications
You must be signed in to change notification settings - Fork 28
/
listing.go
48 lines (39 loc) · 940 Bytes
/
listing.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
package types
import (
"github.com/OmniFlix/omniflixhub/v4/x/marketplace/exported"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/gogoproto/proto"
)
var (
_ proto.Message = &Listing{}
_ exported.ListingI = &Listing{}
)
func NewListing(id, nftId, denomId string, price sdk.Coin, owner sdk.AccAddress, splitShares []WeightedAddress) Listing {
return Listing{
Id: id,
NftId: nftId,
DenomId: denomId,
Price: price,
Owner: owner.String(),
SplitShares: splitShares,
}
}
func (l Listing) GetId() string {
return l.Id
}
func (l Listing) GetDenomId() string {
return l.DenomId
}
func (l Listing) GetNftId() string {
return l.NftId
}
func (l Listing) GetPrice() sdk.Coin {
return l.Price
}
func (l Listing) GetOwner() sdk.AccAddress {
owner, _ := sdk.AccAddressFromBech32(l.Owner)
return owner
}
func (l Listing) GetSplitShares() interface{} {
return l.SplitShares
}