-
Notifications
You must be signed in to change notification settings - Fork 13
/
collectibe_token.go
37 lines (32 loc) · 1.19 KB
/
collectibe_token.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
package mixin
import (
"context"
"time"
)
type CollectibleTokenMeta struct {
Group string `json:"group,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
IconURL string `json:"icon_url,omitempty"`
MediaURL string `json:"media_url,omitempty"`
Mime string `json:"mime,omitempty"`
Hash Hash `json:"hash,omitempty"`
}
type CollectibleToken struct {
Type string `json:"type,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
TokenID string `json:"token_id,omitempty"`
Group string `json:"group,omitempty"`
Token string `json:"token,omitempty"`
MixinID Hash `json:"mixin_id,omitempty"`
NFO TransactionExtra `json:"nfo,omitempty"`
Meta CollectibleTokenMeta `json:"meta,omitempty"`
}
// ReadCollectiblesToken return the detail of CollectibleToken
func (c *Client) ReadCollectiblesToken(ctx context.Context, id string) (*CollectibleToken, error) {
var token CollectibleToken
if err := c.Get(ctx, "/collectibles/tokens/"+id, nil, &token); err != nil {
return nil, err
}
return &token, nil
}