-
Notifications
You must be signed in to change notification settings - Fork 6
/
g45_nft.go
51 lines (41 loc) · 1.05 KB
/
g45_nft.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
package g45_sc
import (
"github.com/g45t345rt/g45w/utils"
)
var G45_NFT_PRIVATE_SHA256 = "85ba16b77cbd4cfb3ba5690d74e849c2080905075bd87af29cbbb14f33bae2bd"
var G45_NFT_PUBLIC_SHA256 = ""
type G45_NFT struct {
SCID string
// Private bool
Minter string
MetadataFormat string
Metadata string
Collection string
Owner string
Timestamp uint64
}
func (asset *G45_NFT) Parse(scId string, values map[string]interface{}) (err error) {
asset.SCID = scId
asset.Timestamp = uint64(values["timestamp"].(float64))
asset.Collection, err = utils.DecodeString(values["collection"].(string))
if err != nil {
return
}
asset.MetadataFormat, err = utils.DecodeString(values["metadataFormat"].(string))
if err != nil {
return
}
asset.Metadata, err = utils.DecodeString(values["metadata"].(string))
if err != nil {
return
}
asset.Owner, err = utils.DecodeString(values["owner"].(string))
if err != nil {
return
}
asset.Minter, err = utils.DecodeAddress(values["minter"].(string))
if err != nil {
return
}
return
}