-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTypes.mo
130 lines (108 loc) · 2.9 KB
/
Types.mo
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// https://github.com/dfinity/examples/blob/master/motoko/dip-721-nft-container/src/Types.mo
import Nat "mo:base/Nat";
import Nat8 "mo:base/Nat8";
import Nat16 "mo:base/Nat16";
import Nat32 "mo:base/Nat32";
import Nat64 "mo:base/Nat64";
import Blob "mo:base/Blob";
import Principal "mo:base/Principal";
import List "mo:base/List";
import AssocList "mo:base/AssocList";
module {
public type Dip721NonFungibleToken = {
logo: LogoResult;
name: Text;
symbol: Text;
maxLimit : Nat16;
};
public type ApiError = {
#Unauthorized;
#InvalidTokenId;
#ZeroAddress;
#Other: Text;
};
public type Result<S, E> = {
#Ok : S;
#Err : E;
};
public type OwnerResult = Result<Principal, ApiError>;
public type TxReceipt = Result<Nat, ApiError>;
public type TransactionId = Nat;
public type TokenId = Nat64;
public type InterfaceId = {
#Approval;
#TransactionHistory;
#Mint;
#Burn;
#TransferNotification;
};
public type LogoResult = {
logo_type: Text;
data: Text;
};
public type Nft = {
owner: Principal;
id: TokenId;
metadata: MetadataDesc;
};
public type NftResult = Result<Nft, ApiError>;
public type ExtendedMetadataResult = Result<{
metadata_desc: MetadataDesc;
token_id: TokenId;
}, ApiError>;
public type MetadataResult = Result<MetadataDesc, ApiError>;
public type MetadataDesc = [MetadataPart];
public type MetadataPart = {
purpose: MetadataPurpose;
key_val_data: [MetadataKeyVal];
data: Blob;
};
public type MetadataPurpose = {
#Preview;
#Rendered;
};
public type MetadataKeyVal = {
key: Text;
val: MetadataVal;
};
public type MetadataVal = {
#TextContent : Text;
#BlobContent : Blob;
#NatContent : Nat;
#Nat8Content: Nat8;
#Nat16Content: Nat16;
#Nat32Content: Nat32;
#Nat64Content: Nat64;
#PrincipalContent: Principal; // added
#TextArrayContent: [Text]; // added
#TextToTextAssocListContent: AssocList.AssocList<Text, Text>; // added
};
public type HiddenNftRecord = {
id: TokenId;
deleted_by: Principal;
deletion_time: Nat64;
};
public type MintReceipt = Result<MintReceiptPart, ApiError>;
public type MintReceiptPart = {
token_id: TokenId;
id: Nat;
};
public type UpdateMetadataValuesInput = {
id: TokenId;
updatedOwnerName: Text;
updatedOwnerContactInfo: Text;
updatedSpaceDescription: Text;
updatedSpaceName: Text;
updatedAboutDescription : Text;
updatedSpaceData: ?Text;
};
public type SignUpFormInput = {
emailAddress: Text; // provided by user on signup
pageSubmittedFrom: Text; // capture for analytics
};
public type EmailSubscriber = {
emailAddress: Text;
pageSubmittedFrom: Text;
subscribedAt: Nat64;
};
};