-
Notifications
You must be signed in to change notification settings - Fork 5
/
NftTest.java
221 lines (208 loc) · 6.6 KB
/
NftTest.java
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
package ai.bianjie.avatasdktest.evm;
import ai.bianjie.avatasdk.AvataClient;
import ai.bianjie.avatasdk.model.PublicResponse;
import ai.bianjie.avatasdk.model.evm.nft.*;
import ai.bianjie.avatasdktest.AvataClientTest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class NftTest {
private AvataClient client;
@BeforeEach
public void init() {
client = AvataClientTest.getAvataClient();
}
@Test
//请求创建 NFT 类别接口示例
void TestCreateClass() {
CreateNftClassReq req = new CreateNftClassReq();
req.setName("hhhh");
req.setSymbol("sdcs");
req.setOwner("0xd154Ed7CC897C71Bcd5765aBe6cb3F6bA195E5fA");
req.setEditableByOwner(1);
req.setEditableByClassOwner(1);
req.setOperationId("createnftclass");
try {
PublicResponse res = client.evm.nft.createNftClass(req);
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求查询 NFT 类别列表接口示例
void TestQueryNftClasses() {
QueryNftClassesReq req = new QueryNftClassesReq();
req.setPageKey("");
req.setLimit("");
req.setId("");
req.setName("");
req.setOwner("");
req.setTxHash("");
req.setStartDate("");
req.setEndDate("");
req.setCountTotal("1");
req.setId("");
try {
QueryNftClassesRes res = client.evm.nft.queryNftClasses(req);
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求查询 NFT 类别详情接口示例
void TestQueryNftClass() {
try {
QueryNftClassRes res = client.evm.nft.queryNftClass("");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求转让 NFT 类别接口示例
void TestTransferNftClass() {
TransferNftClassReq req = new TransferNftClassReq();
req.setRecipient("");
req.setOperationId("transfernftclass");
try {
PublicResponse res = client.evm.nft.transferNftClass(req,
"",
"");
System.out.println(res.getData());
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求发行 NFT 接口示例
void TestMintNft() {
MintNftReq req = new MintNftReq();
req.setUri("");
req.setUriHash("");
req.setRecipient("");
req.setOperationId("mintnft");
try {
PublicResponse res =client.evm.nft.mintNft(req,
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求转让 NFT 接口示例
void TestTransferNft() {
TransferNftReq req = new TransferNftReq();
req.setRecipient("");
req.setOperationId("transfernft");
try {
PublicResponse res = client.evm.nft.transferNft(req,
"",
"",
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求编辑 NFT 接口示例
void TestEditNft() {
EditNftReq req = new EditNftReq();
req.setUri("");
req.setUriHash("");
req.setOperationId("editnft");
try {
PublicResponse res =client.evm.nft.editNft(req,
"",
"",
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求销毁 NFT 接口示例
void TestDeleteNft() {
BurnNftReq req = new BurnNftReq();
req.setOperationId("burnnft");
try {
PublicResponse res =client.evm.nft.burnNft(req,
"",
"",
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求查询 NFT 列表接口示例
void TestQueryNfts() {
try {
QueryNftsReq req = new QueryNftsReq();
req.setPageKey("");
req.setLimit("");
req.setId("");
req.setClassId("");
req.setOwner("");
req.setTxHash("");
req.setStatus("");
req.setStartDate("");
req.setEndDate("");
req.setSortBy("");
req.setCountTotal("1");
QueryNftsRes res =client.evm.nft.queryNfts(req);
System.out.println(res.getData());
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求查询 NFT 详情接口示例
void TestQueryNft() {
try {
QueryNftRes res = client.evm.nft.queryNft(
"",
"");
System.out.println(res.getData());
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求查询 NFT 操作记录接口示例
void TestQueryNftHistory() {
try {
QueryNftHistoryReq req = new QueryNftHistoryReq();
req.setLimit("2");
QueryNftHistoryRes res =client.evm.nft.queryNftHistory(
"",
"", req);
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
}