@zero-tech/zauction-sdk 0.2.10 → 0.2.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/package.json +3 -2
  2. package/src/actions/acceptBid.ts +167 -0
  3. package/src/actions/approveDomainTransfer.ts +25 -0
  4. package/src/actions/approveSpender.ts +27 -0
  5. package/src/actions/buyNow.ts +109 -0
  6. package/src/actions/cancelBid.ts +37 -0
  7. package/src/actions/getBuyNowListing.ts +65 -0
  8. package/src/actions/getPaymentTokenAllowance.ts +30 -0
  9. package/src/actions/index.ts +11 -0
  10. package/src/actions/isZAuctionApproved.ts +20 -0
  11. package/src/actions/placeBid.ts +102 -0
  12. package/src/actions/setBuyNowPrice.ts +56 -0
  13. package/src/actions/setNetworkPaymentToken.ts +46 -0
  14. package/src/api/actions/encodeBid.ts +44 -0
  15. package/src/api/actions/encodeCancelMessage.ts +24 -0
  16. package/src/api/actions/helpers.ts +61 -0
  17. package/src/api/actions/index.ts +6 -0
  18. package/src/api/actions/listBidsForAccount.ts +24 -0
  19. package/src/api/actions/listBidsForTokens.ts +39 -0
  20. package/src/api/actions/submitBid.ts +28 -0
  21. package/src/api/actions/submitCancelMessage.ts +30 -0
  22. package/src/api/client.ts +78 -0
  23. package/src/api/index.ts +1 -0
  24. package/src/api/types.ts +47 -0
  25. package/src/contracts/index.ts +53 -0
  26. package/src/contracts/types/IERC20.d.ts +294 -0
  27. package/src/contracts/types/IERC721.d.ts +472 -0
  28. package/src/contracts/types/IZNSHub.d.ts +578 -0
  29. package/src/contracts/types/ZAuction.d.ts +1487 -0
  30. package/src/contracts/types/ZAuctionV1.d.ts +440 -0
  31. package/src/contracts/types/commons.ts +36 -0
  32. package/src/contracts/types/factories/IERC20__factory.ts +203 -0
  33. package/src/contracts/types/factories/IERC721__factory.ts +308 -0
  34. package/src/contracts/types/factories/IZNSHub__factory.ts +311 -0
  35. package/src/contracts/types/factories/ZAuctionV1__factory.ts +326 -0
  36. package/src/contracts/types/factories/ZAuction__factory.ts +1033 -0
  37. package/src/contracts/types/index.ts +14 -0
  38. package/src/index.ts +468 -0
  39. package/src/subgraph/actions/index.ts +4 -0
  40. package/src/subgraph/actions/listAllBuyNowListings.ts +69 -0
  41. package/src/subgraph/actions/listAllSales.ts +57 -0
  42. package/src/subgraph/actions/listBuyNowSales.ts +44 -0
  43. package/src/subgraph/actions/listSales.ts +33 -0
  44. package/src/subgraph/client.ts +62 -0
  45. package/src/subgraph/helpers/index.ts +39 -0
  46. package/src/subgraph/index.ts +1 -0
  47. package/src/subgraph/queries.ts +75 -0
  48. package/src/subgraph/types.ts +58 -0
  49. package/src/types.ts +181 -0
  50. package/src/utilities/index.ts +2 -0
  51. package/src/utilities/logging.ts +27 -0
@@ -0,0 +1,308 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import { Contract, Signer, utils } from "ethers";
6
+ import { Provider } from "@ethersproject/providers";
7
+ import type { IERC721, IERC721Interface } from "../IERC721";
8
+
9
+ const _abi = [
10
+ {
11
+ anonymous: false,
12
+ inputs: [
13
+ {
14
+ indexed: true,
15
+ internalType: "address",
16
+ name: "owner",
17
+ type: "address",
18
+ },
19
+ {
20
+ indexed: true,
21
+ internalType: "address",
22
+ name: "approved",
23
+ type: "address",
24
+ },
25
+ {
26
+ indexed: true,
27
+ internalType: "uint256",
28
+ name: "tokenId",
29
+ type: "uint256",
30
+ },
31
+ ],
32
+ name: "Approval",
33
+ type: "event",
34
+ },
35
+ {
36
+ anonymous: false,
37
+ inputs: [
38
+ {
39
+ indexed: true,
40
+ internalType: "address",
41
+ name: "owner",
42
+ type: "address",
43
+ },
44
+ {
45
+ indexed: true,
46
+ internalType: "address",
47
+ name: "operator",
48
+ type: "address",
49
+ },
50
+ {
51
+ indexed: false,
52
+ internalType: "bool",
53
+ name: "approved",
54
+ type: "bool",
55
+ },
56
+ ],
57
+ name: "ApprovalForAll",
58
+ type: "event",
59
+ },
60
+ {
61
+ anonymous: false,
62
+ inputs: [
63
+ {
64
+ indexed: true,
65
+ internalType: "address",
66
+ name: "from",
67
+ type: "address",
68
+ },
69
+ {
70
+ indexed: true,
71
+ internalType: "address",
72
+ name: "to",
73
+ type: "address",
74
+ },
75
+ {
76
+ indexed: true,
77
+ internalType: "uint256",
78
+ name: "tokenId",
79
+ type: "uint256",
80
+ },
81
+ ],
82
+ name: "Transfer",
83
+ type: "event",
84
+ },
85
+ {
86
+ inputs: [
87
+ {
88
+ internalType: "address",
89
+ name: "to",
90
+ type: "address",
91
+ },
92
+ {
93
+ internalType: "uint256",
94
+ name: "tokenId",
95
+ type: "uint256",
96
+ },
97
+ ],
98
+ name: "approve",
99
+ outputs: [],
100
+ stateMutability: "nonpayable",
101
+ type: "function",
102
+ },
103
+ {
104
+ inputs: [
105
+ {
106
+ internalType: "address",
107
+ name: "owner",
108
+ type: "address",
109
+ },
110
+ ],
111
+ name: "balanceOf",
112
+ outputs: [
113
+ {
114
+ internalType: "uint256",
115
+ name: "balance",
116
+ type: "uint256",
117
+ },
118
+ ],
119
+ stateMutability: "view",
120
+ type: "function",
121
+ },
122
+ {
123
+ inputs: [
124
+ {
125
+ internalType: "uint256",
126
+ name: "tokenId",
127
+ type: "uint256",
128
+ },
129
+ ],
130
+ name: "getApproved",
131
+ outputs: [
132
+ {
133
+ internalType: "address",
134
+ name: "operator",
135
+ type: "address",
136
+ },
137
+ ],
138
+ stateMutability: "view",
139
+ type: "function",
140
+ },
141
+ {
142
+ inputs: [
143
+ {
144
+ internalType: "address",
145
+ name: "owner",
146
+ type: "address",
147
+ },
148
+ {
149
+ internalType: "address",
150
+ name: "operator",
151
+ type: "address",
152
+ },
153
+ ],
154
+ name: "isApprovedForAll",
155
+ outputs: [
156
+ {
157
+ internalType: "bool",
158
+ name: "",
159
+ type: "bool",
160
+ },
161
+ ],
162
+ stateMutability: "view",
163
+ type: "function",
164
+ },
165
+ {
166
+ inputs: [
167
+ {
168
+ internalType: "uint256",
169
+ name: "tokenId",
170
+ type: "uint256",
171
+ },
172
+ ],
173
+ name: "ownerOf",
174
+ outputs: [
175
+ {
176
+ internalType: "address",
177
+ name: "owner",
178
+ type: "address",
179
+ },
180
+ ],
181
+ stateMutability: "view",
182
+ type: "function",
183
+ },
184
+ {
185
+ inputs: [
186
+ {
187
+ internalType: "address",
188
+ name: "from",
189
+ type: "address",
190
+ },
191
+ {
192
+ internalType: "address",
193
+ name: "to",
194
+ type: "address",
195
+ },
196
+ {
197
+ internalType: "uint256",
198
+ name: "tokenId",
199
+ type: "uint256",
200
+ },
201
+ ],
202
+ name: "safeTransferFrom",
203
+ outputs: [],
204
+ stateMutability: "nonpayable",
205
+ type: "function",
206
+ },
207
+ {
208
+ inputs: [
209
+ {
210
+ internalType: "address",
211
+ name: "from",
212
+ type: "address",
213
+ },
214
+ {
215
+ internalType: "address",
216
+ name: "to",
217
+ type: "address",
218
+ },
219
+ {
220
+ internalType: "uint256",
221
+ name: "tokenId",
222
+ type: "uint256",
223
+ },
224
+ {
225
+ internalType: "bytes",
226
+ name: "data",
227
+ type: "bytes",
228
+ },
229
+ ],
230
+ name: "safeTransferFrom",
231
+ outputs: [],
232
+ stateMutability: "nonpayable",
233
+ type: "function",
234
+ },
235
+ {
236
+ inputs: [
237
+ {
238
+ internalType: "address",
239
+ name: "operator",
240
+ type: "address",
241
+ },
242
+ {
243
+ internalType: "bool",
244
+ name: "_approved",
245
+ type: "bool",
246
+ },
247
+ ],
248
+ name: "setApprovalForAll",
249
+ outputs: [],
250
+ stateMutability: "nonpayable",
251
+ type: "function",
252
+ },
253
+ {
254
+ inputs: [
255
+ {
256
+ internalType: "bytes4",
257
+ name: "interfaceId",
258
+ type: "bytes4",
259
+ },
260
+ ],
261
+ name: "supportsInterface",
262
+ outputs: [
263
+ {
264
+ internalType: "bool",
265
+ name: "",
266
+ type: "bool",
267
+ },
268
+ ],
269
+ stateMutability: "view",
270
+ type: "function",
271
+ },
272
+ {
273
+ inputs: [
274
+ {
275
+ internalType: "address",
276
+ name: "from",
277
+ type: "address",
278
+ },
279
+ {
280
+ internalType: "address",
281
+ name: "to",
282
+ type: "address",
283
+ },
284
+ {
285
+ internalType: "uint256",
286
+ name: "tokenId",
287
+ type: "uint256",
288
+ },
289
+ ],
290
+ name: "transferFrom",
291
+ outputs: [],
292
+ stateMutability: "nonpayable",
293
+ type: "function",
294
+ },
295
+ ];
296
+
297
+ export class IERC721__factory {
298
+ static readonly abi = _abi;
299
+ static createInterface(): IERC721Interface {
300
+ return new utils.Interface(_abi) as IERC721Interface;
301
+ }
302
+ static connect(
303
+ address: string,
304
+ signerOrProvider: Signer | Provider
305
+ ): IERC721 {
306
+ return new Contract(address, _abi, signerOrProvider) as IERC721;
307
+ }
308
+ }
@@ -0,0 +1,311 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import { Contract, Signer, utils } from "ethers";
6
+ import { Provider } from "@ethersproject/providers";
7
+ import type { IZNSHub, IZNSHubInterface } from "../IZNSHub";
8
+
9
+ const _abi = [
10
+ {
11
+ inputs: [
12
+ {
13
+ internalType: "uint256",
14
+ name: "rootDomainId",
15
+ type: "uint256",
16
+ },
17
+ {
18
+ internalType: "address",
19
+ name: "registrar",
20
+ type: "address",
21
+ },
22
+ ],
23
+ name: "addRegistrar",
24
+ outputs: [],
25
+ stateMutability: "nonpayable",
26
+ type: "function",
27
+ },
28
+ {
29
+ inputs: [
30
+ {
31
+ internalType: "uint256",
32
+ name: "id",
33
+ type: "uint256",
34
+ },
35
+ {
36
+ internalType: "string",
37
+ name: "name",
38
+ type: "string",
39
+ },
40
+ {
41
+ internalType: "uint256",
42
+ name: "nameHash",
43
+ type: "uint256",
44
+ },
45
+ {
46
+ internalType: "uint256",
47
+ name: "parent",
48
+ type: "uint256",
49
+ },
50
+ {
51
+ internalType: "address",
52
+ name: "minter",
53
+ type: "address",
54
+ },
55
+ {
56
+ internalType: "address",
57
+ name: "controller",
58
+ type: "address",
59
+ },
60
+ {
61
+ internalType: "string",
62
+ name: "metadataUri",
63
+ type: "string",
64
+ },
65
+ {
66
+ internalType: "uint256",
67
+ name: "royaltyAmount",
68
+ type: "uint256",
69
+ },
70
+ ],
71
+ name: "domainCreated",
72
+ outputs: [],
73
+ stateMutability: "nonpayable",
74
+ type: "function",
75
+ },
76
+ {
77
+ inputs: [
78
+ {
79
+ internalType: "address",
80
+ name: "registrar",
81
+ type: "address",
82
+ },
83
+ ],
84
+ name: "authorizedRegistrars",
85
+ outputs: [
86
+ {
87
+ internalType: "bool",
88
+ name: "",
89
+ type: "bool",
90
+ },
91
+ ],
92
+ stateMutability: "view",
93
+ type: "function",
94
+ },
95
+ {
96
+ inputs: [
97
+ {
98
+ internalType: "uint256",
99
+ name: "domainId",
100
+ type: "uint256",
101
+ },
102
+ ],
103
+ name: "domainExists",
104
+ outputs: [
105
+ {
106
+ internalType: "bool",
107
+ name: "",
108
+ type: "bool",
109
+ },
110
+ ],
111
+ stateMutability: "view",
112
+ type: "function",
113
+ },
114
+ {
115
+ inputs: [
116
+ {
117
+ internalType: "address",
118
+ name: "from",
119
+ type: "address",
120
+ },
121
+ {
122
+ internalType: "address",
123
+ name: "to",
124
+ type: "address",
125
+ },
126
+ {
127
+ internalType: "uint256",
128
+ name: "tokenId",
129
+ type: "uint256",
130
+ },
131
+ ],
132
+ name: "domainTransferred",
133
+ outputs: [],
134
+ stateMutability: "nonpayable",
135
+ type: "function",
136
+ },
137
+ {
138
+ inputs: [
139
+ {
140
+ internalType: "uint256",
141
+ name: "domainId",
142
+ type: "uint256",
143
+ },
144
+ ],
145
+ name: "getRegistrarForDomain",
146
+ outputs: [
147
+ {
148
+ internalType: "contract IRegistrar",
149
+ name: "",
150
+ type: "address",
151
+ },
152
+ ],
153
+ stateMutability: "view",
154
+ type: "function",
155
+ },
156
+ {
157
+ inputs: [
158
+ {
159
+ internalType: "address",
160
+ name: "controller",
161
+ type: "address",
162
+ },
163
+ ],
164
+ name: "isController",
165
+ outputs: [
166
+ {
167
+ internalType: "bool",
168
+ name: "",
169
+ type: "bool",
170
+ },
171
+ ],
172
+ stateMutability: "nonpayable",
173
+ type: "function",
174
+ },
175
+ {
176
+ inputs: [
177
+ {
178
+ internalType: "uint256",
179
+ name: "id",
180
+ type: "uint256",
181
+ },
182
+ {
183
+ internalType: "string",
184
+ name: "uri",
185
+ type: "string",
186
+ },
187
+ ],
188
+ name: "metadataChanged",
189
+ outputs: [],
190
+ stateMutability: "nonpayable",
191
+ type: "function",
192
+ },
193
+ {
194
+ inputs: [
195
+ {
196
+ internalType: "uint256",
197
+ name: "id",
198
+ type: "uint256",
199
+ },
200
+ {
201
+ internalType: "address",
202
+ name: "locker",
203
+ type: "address",
204
+ },
205
+ {
206
+ internalType: "bool",
207
+ name: "isLocked",
208
+ type: "bool",
209
+ },
210
+ ],
211
+ name: "metadataLockChanged",
212
+ outputs: [],
213
+ stateMutability: "nonpayable",
214
+ type: "function",
215
+ },
216
+ {
217
+ inputs: [],
218
+ name: "owner",
219
+ outputs: [
220
+ {
221
+ internalType: "address",
222
+ name: "",
223
+ type: "address",
224
+ },
225
+ ],
226
+ stateMutability: "view",
227
+ type: "function",
228
+ },
229
+ {
230
+ inputs: [
231
+ {
232
+ internalType: "uint256",
233
+ name: "domainId",
234
+ type: "uint256",
235
+ },
236
+ ],
237
+ name: "ownerOf",
238
+ outputs: [
239
+ {
240
+ internalType: "address",
241
+ name: "",
242
+ type: "address",
243
+ },
244
+ ],
245
+ stateMutability: "view",
246
+ type: "function",
247
+ },
248
+ {
249
+ inputs: [
250
+ {
251
+ internalType: "uint256",
252
+ name: "id",
253
+ type: "uint256",
254
+ },
255
+ ],
256
+ name: "parentOf",
257
+ outputs: [
258
+ {
259
+ internalType: "uint256",
260
+ name: "",
261
+ type: "uint256",
262
+ },
263
+ ],
264
+ stateMutability: "view",
265
+ type: "function",
266
+ },
267
+ {
268
+ inputs: [],
269
+ name: "registrarBeacon",
270
+ outputs: [
271
+ {
272
+ internalType: "address",
273
+ name: "",
274
+ type: "address",
275
+ },
276
+ ],
277
+ stateMutability: "view",
278
+ type: "function",
279
+ },
280
+ {
281
+ inputs: [
282
+ {
283
+ internalType: "uint256",
284
+ name: "id",
285
+ type: "uint256",
286
+ },
287
+ {
288
+ internalType: "uint256",
289
+ name: "amount",
290
+ type: "uint256",
291
+ },
292
+ ],
293
+ name: "royaltiesAmountChanged",
294
+ outputs: [],
295
+ stateMutability: "nonpayable",
296
+ type: "function",
297
+ },
298
+ ];
299
+
300
+ export class IZNSHub__factory {
301
+ static readonly abi = _abi;
302
+ static createInterface(): IZNSHubInterface {
303
+ return new utils.Interface(_abi) as IZNSHubInterface;
304
+ }
305
+ static connect(
306
+ address: string,
307
+ signerOrProvider: Signer | Provider
308
+ ): IZNSHub {
309
+ return new Contract(address, _abi, signerOrProvider) as IZNSHub;
310
+ }
311
+ }