@gitmyabi/joyso 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -0
- package/contracts/Joyso_json.d.ts +1338 -0
- package/contracts/Joyso_json.js +1323 -0
- package/contracts/Joyso_json.ts +1762 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,1762 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Joyso_json ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const Joyso_jsonAbi = [
|
|
10
|
+
{
|
|
11
|
+
"constant": false,
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"name": "inputs",
|
|
15
|
+
"type": "uint256[]"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"name": "matchTokenOrderByAdmin_k44j",
|
|
19
|
+
"outputs": [],
|
|
20
|
+
"payable": false,
|
|
21
|
+
"stateMutability": "nonpayable",
|
|
22
|
+
"type": "function"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"constant": false,
|
|
26
|
+
"inputs": [
|
|
27
|
+
{
|
|
28
|
+
"name": "inputs",
|
|
29
|
+
"type": "uint256[]"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"name": "matchByAdmin_TwH36",
|
|
33
|
+
"outputs": [],
|
|
34
|
+
"payable": false,
|
|
35
|
+
"stateMutability": "nonpayable",
|
|
36
|
+
"type": "function"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"constant": false,
|
|
40
|
+
"inputs": [
|
|
41
|
+
{
|
|
42
|
+
"name": "inputs",
|
|
43
|
+
"type": "uint256[]"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"name": "withdrawByAdmin_Unau",
|
|
47
|
+
"outputs": [],
|
|
48
|
+
"payable": false,
|
|
49
|
+
"stateMutability": "nonpayable",
|
|
50
|
+
"type": "function"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"constant": false,
|
|
54
|
+
"inputs": [
|
|
55
|
+
{
|
|
56
|
+
"name": "inputs",
|
|
57
|
+
"type": "uint256[]"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"name": "migrateByAdmin_DQV",
|
|
61
|
+
"outputs": [],
|
|
62
|
+
"payable": false,
|
|
63
|
+
"stateMutability": "nonpayable",
|
|
64
|
+
"type": "function"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"constant": false,
|
|
68
|
+
"inputs": [
|
|
69
|
+
{
|
|
70
|
+
"name": "tokenAddress",
|
|
71
|
+
"type": "address"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "index",
|
|
75
|
+
"type": "uint256"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"name": "registerToken",
|
|
79
|
+
"outputs": [],
|
|
80
|
+
"payable": false,
|
|
81
|
+
"stateMutability": "nonpayable",
|
|
82
|
+
"type": "function"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"constant": true,
|
|
86
|
+
"inputs": [],
|
|
87
|
+
"name": "userCount",
|
|
88
|
+
"outputs": [
|
|
89
|
+
{
|
|
90
|
+
"name": "",
|
|
91
|
+
"type": "uint256"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"payable": false,
|
|
95
|
+
"stateMutability": "view",
|
|
96
|
+
"type": "function"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"constant": false,
|
|
100
|
+
"inputs": [
|
|
101
|
+
{
|
|
102
|
+
"name": "token",
|
|
103
|
+
"type": "address"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "account",
|
|
107
|
+
"type": "address"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "amount",
|
|
111
|
+
"type": "uint256"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"name": "transferForAdmin",
|
|
115
|
+
"outputs": [],
|
|
116
|
+
"payable": false,
|
|
117
|
+
"stateMutability": "nonpayable",
|
|
118
|
+
"type": "function"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"constant": false,
|
|
122
|
+
"inputs": [
|
|
123
|
+
{
|
|
124
|
+
"name": "admin",
|
|
125
|
+
"type": "address"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "isAdd",
|
|
129
|
+
"type": "bool"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"name": "addToAdmin",
|
|
133
|
+
"outputs": [],
|
|
134
|
+
"payable": false,
|
|
135
|
+
"stateMutability": "nonpayable",
|
|
136
|
+
"type": "function"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"constant": true,
|
|
140
|
+
"inputs": [],
|
|
141
|
+
"name": "joysoWallet",
|
|
142
|
+
"outputs": [
|
|
143
|
+
{
|
|
144
|
+
"name": "",
|
|
145
|
+
"type": "address"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"payable": false,
|
|
149
|
+
"stateMutability": "view",
|
|
150
|
+
"type": "function"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"constant": true,
|
|
154
|
+
"inputs": [
|
|
155
|
+
{
|
|
156
|
+
"name": "",
|
|
157
|
+
"type": "address"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"name": "isAdmin",
|
|
161
|
+
"outputs": [
|
|
162
|
+
{
|
|
163
|
+
"name": "",
|
|
164
|
+
"type": "bool"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"payable": false,
|
|
168
|
+
"stateMutability": "view",
|
|
169
|
+
"type": "function"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"constant": true,
|
|
173
|
+
"inputs": [
|
|
174
|
+
{
|
|
175
|
+
"name": "",
|
|
176
|
+
"type": "address"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"name": "userNonce",
|
|
180
|
+
"outputs": [
|
|
181
|
+
{
|
|
182
|
+
"name": "",
|
|
183
|
+
"type": "uint256"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"payable": false,
|
|
187
|
+
"stateMutability": "view",
|
|
188
|
+
"type": "function"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"constant": false,
|
|
192
|
+
"inputs": [
|
|
193
|
+
{
|
|
194
|
+
"name": "token",
|
|
195
|
+
"type": "address"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "amount",
|
|
199
|
+
"type": "uint256"
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"name": "depositToken",
|
|
203
|
+
"outputs": [],
|
|
204
|
+
"payable": false,
|
|
205
|
+
"stateMutability": "nonpayable",
|
|
206
|
+
"type": "function"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"constant": true,
|
|
210
|
+
"inputs": [],
|
|
211
|
+
"name": "lockPeriod",
|
|
212
|
+
"outputs": [
|
|
213
|
+
{
|
|
214
|
+
"name": "",
|
|
215
|
+
"type": "uint256"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"payable": false,
|
|
219
|
+
"stateMutability": "view",
|
|
220
|
+
"type": "function"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"constant": true,
|
|
224
|
+
"inputs": [
|
|
225
|
+
{
|
|
226
|
+
"name": "",
|
|
227
|
+
"type": "bytes32"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"name": "usedHash",
|
|
231
|
+
"outputs": [
|
|
232
|
+
{
|
|
233
|
+
"name": "",
|
|
234
|
+
"type": "bool"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"payable": false,
|
|
238
|
+
"stateMutability": "view",
|
|
239
|
+
"type": "function"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"constant": true,
|
|
243
|
+
"inputs": [
|
|
244
|
+
{
|
|
245
|
+
"name": "",
|
|
246
|
+
"type": "address"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"name": "userLock",
|
|
250
|
+
"outputs": [
|
|
251
|
+
{
|
|
252
|
+
"name": "",
|
|
253
|
+
"type": "uint256"
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"payable": false,
|
|
257
|
+
"stateMutability": "view",
|
|
258
|
+
"type": "function"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"constant": false,
|
|
262
|
+
"inputs": [
|
|
263
|
+
{
|
|
264
|
+
"name": "token",
|
|
265
|
+
"type": "address"
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
"name": "collectFee",
|
|
269
|
+
"outputs": [],
|
|
270
|
+
"payable": false,
|
|
271
|
+
"stateMutability": "nonpayable",
|
|
272
|
+
"type": "function"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"constant": false,
|
|
276
|
+
"inputs": [],
|
|
277
|
+
"name": "unlockMe",
|
|
278
|
+
"outputs": [],
|
|
279
|
+
"payable": false,
|
|
280
|
+
"stateMutability": "nonpayable",
|
|
281
|
+
"type": "function"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"constant": true,
|
|
285
|
+
"inputs": [],
|
|
286
|
+
"name": "owner",
|
|
287
|
+
"outputs": [
|
|
288
|
+
{
|
|
289
|
+
"name": "",
|
|
290
|
+
"type": "address"
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"payable": false,
|
|
294
|
+
"stateMutability": "view",
|
|
295
|
+
"type": "function"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"constant": true,
|
|
299
|
+
"inputs": [
|
|
300
|
+
{
|
|
301
|
+
"name": "",
|
|
302
|
+
"type": "uint256"
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
"name": "userId2Address",
|
|
306
|
+
"outputs": [
|
|
307
|
+
{
|
|
308
|
+
"name": "",
|
|
309
|
+
"type": "address"
|
|
310
|
+
}
|
|
311
|
+
],
|
|
312
|
+
"payable": false,
|
|
313
|
+
"stateMutability": "view",
|
|
314
|
+
"type": "function"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"constant": false,
|
|
318
|
+
"inputs": [
|
|
319
|
+
{
|
|
320
|
+
"name": "enabled",
|
|
321
|
+
"type": "bool"
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
"name": "setTradeEventEnabled",
|
|
325
|
+
"outputs": [],
|
|
326
|
+
"payable": false,
|
|
327
|
+
"stateMutability": "nonpayable",
|
|
328
|
+
"type": "function"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"constant": false,
|
|
332
|
+
"inputs": [],
|
|
333
|
+
"name": "depositEther",
|
|
334
|
+
"outputs": [],
|
|
335
|
+
"payable": true,
|
|
336
|
+
"stateMutability": "payable",
|
|
337
|
+
"type": "function"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"constant": true,
|
|
341
|
+
"inputs": [],
|
|
342
|
+
"name": "joyToken",
|
|
343
|
+
"outputs": [
|
|
344
|
+
{
|
|
345
|
+
"name": "",
|
|
346
|
+
"type": "address"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"payable": false,
|
|
350
|
+
"stateMutability": "view",
|
|
351
|
+
"type": "function"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"constant": false,
|
|
355
|
+
"inputs": [
|
|
356
|
+
{
|
|
357
|
+
"name": "periodInDays",
|
|
358
|
+
"type": "uint256"
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
"name": "changeLockPeriod",
|
|
362
|
+
"outputs": [],
|
|
363
|
+
"payable": false,
|
|
364
|
+
"stateMutability": "nonpayable",
|
|
365
|
+
"type": "function"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"constant": true,
|
|
369
|
+
"inputs": [
|
|
370
|
+
{
|
|
371
|
+
"name": "",
|
|
372
|
+
"type": "address"
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
"name": "tokenAddress2Id",
|
|
376
|
+
"outputs": [
|
|
377
|
+
{
|
|
378
|
+
"name": "",
|
|
379
|
+
"type": "uint256"
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
"payable": false,
|
|
383
|
+
"stateMutability": "view",
|
|
384
|
+
"type": "function"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"constant": true,
|
|
388
|
+
"inputs": [
|
|
389
|
+
{
|
|
390
|
+
"name": "token",
|
|
391
|
+
"type": "address"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "account",
|
|
395
|
+
"type": "address"
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
"name": "getBalance",
|
|
399
|
+
"outputs": [
|
|
400
|
+
{
|
|
401
|
+
"name": "",
|
|
402
|
+
"type": "uint256"
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
"payable": false,
|
|
406
|
+
"stateMutability": "view",
|
|
407
|
+
"type": "function"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"constant": true,
|
|
411
|
+
"inputs": [],
|
|
412
|
+
"name": "tradeEventEnabled",
|
|
413
|
+
"outputs": [
|
|
414
|
+
{
|
|
415
|
+
"name": "",
|
|
416
|
+
"type": "bool"
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"payable": false,
|
|
420
|
+
"stateMutability": "view",
|
|
421
|
+
"type": "function"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"constant": false,
|
|
425
|
+
"inputs": [
|
|
426
|
+
{
|
|
427
|
+
"name": "inputs",
|
|
428
|
+
"type": "uint256[]"
|
|
429
|
+
}
|
|
430
|
+
],
|
|
431
|
+
"name": "cancelByAdmin",
|
|
432
|
+
"outputs": [],
|
|
433
|
+
"payable": false,
|
|
434
|
+
"stateMutability": "nonpayable",
|
|
435
|
+
"type": "function"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"constant": false,
|
|
439
|
+
"inputs": [
|
|
440
|
+
{
|
|
441
|
+
"name": "newOwner",
|
|
442
|
+
"type": "address"
|
|
443
|
+
}
|
|
444
|
+
],
|
|
445
|
+
"name": "transferOwnership",
|
|
446
|
+
"outputs": [],
|
|
447
|
+
"payable": false,
|
|
448
|
+
"stateMutability": "nonpayable",
|
|
449
|
+
"type": "function"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"constant": false,
|
|
453
|
+
"inputs": [
|
|
454
|
+
{
|
|
455
|
+
"name": "token",
|
|
456
|
+
"type": "address"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"name": "amount",
|
|
460
|
+
"type": "uint256"
|
|
461
|
+
}
|
|
462
|
+
],
|
|
463
|
+
"name": "withdraw",
|
|
464
|
+
"outputs": [],
|
|
465
|
+
"payable": false,
|
|
466
|
+
"stateMutability": "nonpayable",
|
|
467
|
+
"type": "function"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"constant": true,
|
|
471
|
+
"inputs": [
|
|
472
|
+
{
|
|
473
|
+
"name": "",
|
|
474
|
+
"type": "bytes32"
|
|
475
|
+
}
|
|
476
|
+
],
|
|
477
|
+
"name": "orderFills",
|
|
478
|
+
"outputs": [
|
|
479
|
+
{
|
|
480
|
+
"name": "",
|
|
481
|
+
"type": "uint256"
|
|
482
|
+
}
|
|
483
|
+
],
|
|
484
|
+
"payable": false,
|
|
485
|
+
"stateMutability": "view",
|
|
486
|
+
"type": "function"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"constant": false,
|
|
490
|
+
"inputs": [],
|
|
491
|
+
"name": "lockMe",
|
|
492
|
+
"outputs": [],
|
|
493
|
+
"payable": false,
|
|
494
|
+
"stateMutability": "nonpayable",
|
|
495
|
+
"type": "function"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"constant": true,
|
|
499
|
+
"inputs": [
|
|
500
|
+
{
|
|
501
|
+
"name": "",
|
|
502
|
+
"type": "uint256"
|
|
503
|
+
}
|
|
504
|
+
],
|
|
505
|
+
"name": "tokenId2Address",
|
|
506
|
+
"outputs": [
|
|
507
|
+
{
|
|
508
|
+
"name": "",
|
|
509
|
+
"type": "address"
|
|
510
|
+
}
|
|
511
|
+
],
|
|
512
|
+
"payable": false,
|
|
513
|
+
"stateMutability": "view",
|
|
514
|
+
"type": "function"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"constant": true,
|
|
518
|
+
"inputs": [
|
|
519
|
+
{
|
|
520
|
+
"name": "",
|
|
521
|
+
"type": "address"
|
|
522
|
+
}
|
|
523
|
+
],
|
|
524
|
+
"name": "userAddress2Id",
|
|
525
|
+
"outputs": [
|
|
526
|
+
{
|
|
527
|
+
"name": "",
|
|
528
|
+
"type": "uint256"
|
|
529
|
+
}
|
|
530
|
+
],
|
|
531
|
+
"payable": false,
|
|
532
|
+
"stateMutability": "view",
|
|
533
|
+
"type": "function"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"inputs": [
|
|
537
|
+
{
|
|
538
|
+
"name": "_joysoWallet",
|
|
539
|
+
"type": "address"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"name": "_joyToken",
|
|
543
|
+
"type": "address"
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"payable": false,
|
|
547
|
+
"stateMutability": "nonpayable",
|
|
548
|
+
"type": "constructor"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"anonymous": false,
|
|
552
|
+
"inputs": [
|
|
553
|
+
{
|
|
554
|
+
"indexed": false,
|
|
555
|
+
"name": "token",
|
|
556
|
+
"type": "address"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"indexed": false,
|
|
560
|
+
"name": "user",
|
|
561
|
+
"type": "address"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"indexed": false,
|
|
565
|
+
"name": "amount",
|
|
566
|
+
"type": "uint256"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"indexed": false,
|
|
570
|
+
"name": "balance",
|
|
571
|
+
"type": "uint256"
|
|
572
|
+
}
|
|
573
|
+
],
|
|
574
|
+
"name": "Deposit",
|
|
575
|
+
"type": "event"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"anonymous": false,
|
|
579
|
+
"inputs": [
|
|
580
|
+
{
|
|
581
|
+
"indexed": false,
|
|
582
|
+
"name": "token",
|
|
583
|
+
"type": "address"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"indexed": false,
|
|
587
|
+
"name": "user",
|
|
588
|
+
"type": "address"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"indexed": false,
|
|
592
|
+
"name": "amount",
|
|
593
|
+
"type": "uint256"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
"indexed": false,
|
|
597
|
+
"name": "balance",
|
|
598
|
+
"type": "uint256"
|
|
599
|
+
}
|
|
600
|
+
],
|
|
601
|
+
"name": "Withdraw",
|
|
602
|
+
"type": "event"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"anonymous": false,
|
|
606
|
+
"inputs": [
|
|
607
|
+
{
|
|
608
|
+
"indexed": false,
|
|
609
|
+
"name": "user",
|
|
610
|
+
"type": "address"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"indexed": false,
|
|
614
|
+
"name": "id",
|
|
615
|
+
"type": "uint256"
|
|
616
|
+
}
|
|
617
|
+
],
|
|
618
|
+
"name": "NewUser",
|
|
619
|
+
"type": "event"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"anonymous": false,
|
|
623
|
+
"inputs": [
|
|
624
|
+
{
|
|
625
|
+
"indexed": false,
|
|
626
|
+
"name": "user",
|
|
627
|
+
"type": "address"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"indexed": false,
|
|
631
|
+
"name": "timeLock",
|
|
632
|
+
"type": "uint256"
|
|
633
|
+
}
|
|
634
|
+
],
|
|
635
|
+
"name": "Lock",
|
|
636
|
+
"type": "event"
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"anonymous": false,
|
|
640
|
+
"inputs": [
|
|
641
|
+
{
|
|
642
|
+
"indexed": false,
|
|
643
|
+
"name": "user",
|
|
644
|
+
"type": "address"
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
"indexed": false,
|
|
648
|
+
"name": "baseAmount",
|
|
649
|
+
"type": "uint256"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"indexed": false,
|
|
653
|
+
"name": "tokenAmount",
|
|
654
|
+
"type": "uint256"
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
"indexed": false,
|
|
658
|
+
"name": "isBuy",
|
|
659
|
+
"type": "bool"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"indexed": false,
|
|
663
|
+
"name": "fee",
|
|
664
|
+
"type": "uint256"
|
|
665
|
+
}
|
|
666
|
+
],
|
|
667
|
+
"name": "TradeSuccess",
|
|
668
|
+
"type": "event"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"anonymous": false,
|
|
672
|
+
"inputs": [
|
|
673
|
+
{
|
|
674
|
+
"indexed": true,
|
|
675
|
+
"name": "previousOwner",
|
|
676
|
+
"type": "address"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
"indexed": true,
|
|
680
|
+
"name": "newOwner",
|
|
681
|
+
"type": "address"
|
|
682
|
+
}
|
|
683
|
+
],
|
|
684
|
+
"name": "OwnershipTransferred",
|
|
685
|
+
"type": "event"
|
|
686
|
+
}
|
|
687
|
+
] as const satisfies Abi;
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Type-safe ABI for Joyso_json
|
|
691
|
+
*/
|
|
692
|
+
export type Joyso_jsonAbi = typeof Joyso_jsonAbi;
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Contract instance type for Joyso_json
|
|
696
|
+
*/
|
|
697
|
+
// Use any for contract type to avoid complex viem type issues
|
|
698
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
699
|
+
export type Joyso_jsonContract = any;
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Joyso_json Contract Class
|
|
703
|
+
*
|
|
704
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
705
|
+
*
|
|
706
|
+
* @example
|
|
707
|
+
* ```typescript
|
|
708
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
709
|
+
* import { mainnet } from 'viem/chains';
|
|
710
|
+
* import { Joyso_json } from 'Joyso_json';
|
|
711
|
+
*
|
|
712
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
713
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
714
|
+
*
|
|
715
|
+
* const contract = new Joyso_json('0x...', { publicClient, walletClient });
|
|
716
|
+
*
|
|
717
|
+
* // Read functions
|
|
718
|
+
* const result = await contract.balanceOf('0x...');
|
|
719
|
+
*
|
|
720
|
+
* // Write functions
|
|
721
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
722
|
+
*
|
|
723
|
+
* // Simulate transactions (dry-run)
|
|
724
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
725
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
726
|
+
*
|
|
727
|
+
* // Watch events
|
|
728
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
729
|
+
* console.log('Transfer event:', event);
|
|
730
|
+
* });
|
|
731
|
+
* ```
|
|
732
|
+
*/
|
|
733
|
+
export class Joyso_json {
|
|
734
|
+
private contract: Joyso_jsonContract;
|
|
735
|
+
private contractAddress: Address;
|
|
736
|
+
private publicClient: PublicClient;
|
|
737
|
+
|
|
738
|
+
constructor(
|
|
739
|
+
address: Address,
|
|
740
|
+
clients: {
|
|
741
|
+
publicClient: PublicClient;
|
|
742
|
+
walletClient?: WalletClient;
|
|
743
|
+
}
|
|
744
|
+
) {
|
|
745
|
+
this.contractAddress = address;
|
|
746
|
+
this.publicClient = clients.publicClient;
|
|
747
|
+
this.contract = getContract({
|
|
748
|
+
address,
|
|
749
|
+
abi: Joyso_jsonAbi,
|
|
750
|
+
client: {
|
|
751
|
+
public: clients.publicClient,
|
|
752
|
+
wallet: clients.walletClient,
|
|
753
|
+
},
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Get the contract address
|
|
759
|
+
*/
|
|
760
|
+
get address(): Address {
|
|
761
|
+
return this.contractAddress;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Get the underlying viem contract instance
|
|
766
|
+
*/
|
|
767
|
+
getContract(): Joyso_jsonContract {
|
|
768
|
+
return this.contract;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* userCount
|
|
773
|
+
* view
|
|
774
|
+
*/
|
|
775
|
+
async userCount(): Promise<bigint> {
|
|
776
|
+
return this.contract.read.userCount() as Promise<bigint>;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* joysoWallet
|
|
781
|
+
* view
|
|
782
|
+
*/
|
|
783
|
+
async joysoWallet(): Promise<`0x${string}`> {
|
|
784
|
+
return this.contract.read.joysoWallet() as Promise<`0x${string}`>;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* isAdmin
|
|
789
|
+
* view
|
|
790
|
+
*/
|
|
791
|
+
async isAdmin(arg0: `0x${string}`): Promise<boolean> {
|
|
792
|
+
return this.contract.read.isAdmin([arg0] as const) as Promise<boolean>;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* userNonce
|
|
797
|
+
* view
|
|
798
|
+
*/
|
|
799
|
+
async userNonce(arg0: `0x${string}`): Promise<bigint> {
|
|
800
|
+
return this.contract.read.userNonce([arg0] as const) as Promise<bigint>;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* lockPeriod
|
|
805
|
+
* view
|
|
806
|
+
*/
|
|
807
|
+
async lockPeriod(): Promise<bigint> {
|
|
808
|
+
return this.contract.read.lockPeriod() as Promise<bigint>;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* usedHash
|
|
813
|
+
* view
|
|
814
|
+
*/
|
|
815
|
+
async usedHash(arg0: `0x${string}`): Promise<boolean> {
|
|
816
|
+
return this.contract.read.usedHash([arg0] as const) as Promise<boolean>;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* userLock
|
|
821
|
+
* view
|
|
822
|
+
*/
|
|
823
|
+
async userLock(arg0: `0x${string}`): Promise<bigint> {
|
|
824
|
+
return this.contract.read.userLock([arg0] as const) as Promise<bigint>;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* owner
|
|
829
|
+
* view
|
|
830
|
+
*/
|
|
831
|
+
async owner(): Promise<`0x${string}`> {
|
|
832
|
+
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* userId2Address
|
|
837
|
+
* view
|
|
838
|
+
*/
|
|
839
|
+
async userId2Address(arg0: bigint): Promise<`0x${string}`> {
|
|
840
|
+
return this.contract.read.userId2Address([arg0] as const) as Promise<`0x${string}`>;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* joyToken
|
|
845
|
+
* view
|
|
846
|
+
*/
|
|
847
|
+
async joyToken(): Promise<`0x${string}`> {
|
|
848
|
+
return this.contract.read.joyToken() as Promise<`0x${string}`>;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* tokenAddress2Id
|
|
853
|
+
* view
|
|
854
|
+
*/
|
|
855
|
+
async tokenAddress2Id(arg0: `0x${string}`): Promise<bigint> {
|
|
856
|
+
return this.contract.read.tokenAddress2Id([arg0] as const) as Promise<bigint>;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* getBalance
|
|
861
|
+
* view
|
|
862
|
+
*/
|
|
863
|
+
async getBalance(token: `0x${string}`, account: `0x${string}`): Promise<bigint> {
|
|
864
|
+
return this.contract.read.getBalance([token, account] as const) as Promise<bigint>;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* tradeEventEnabled
|
|
869
|
+
* view
|
|
870
|
+
*/
|
|
871
|
+
async tradeEventEnabled(): Promise<boolean> {
|
|
872
|
+
return this.contract.read.tradeEventEnabled() as Promise<boolean>;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* orderFills
|
|
877
|
+
* view
|
|
878
|
+
*/
|
|
879
|
+
async orderFills(arg0: `0x${string}`): Promise<bigint> {
|
|
880
|
+
return this.contract.read.orderFills([arg0] as const) as Promise<bigint>;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/**
|
|
884
|
+
* tokenId2Address
|
|
885
|
+
* view
|
|
886
|
+
*/
|
|
887
|
+
async tokenId2Address(arg0: bigint): Promise<`0x${string}`> {
|
|
888
|
+
return this.contract.read.tokenId2Address([arg0] as const) as Promise<`0x${string}`>;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* userAddress2Id
|
|
893
|
+
* view
|
|
894
|
+
*/
|
|
895
|
+
async userAddress2Id(arg0: `0x${string}`): Promise<bigint> {
|
|
896
|
+
return this.contract.read.userAddress2Id([arg0] as const) as Promise<bigint>;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* matchTokenOrderByAdmin_k44j
|
|
901
|
+
* nonpayable
|
|
902
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
903
|
+
*/
|
|
904
|
+
async matchTokenOrderByAdmin_k44j(inputs: bigint[], options?: {
|
|
905
|
+
accessList?: import('viem').AccessList;
|
|
906
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
907
|
+
chain?: import('viem').Chain | null;
|
|
908
|
+
dataSuffix?: `0x${string}`;
|
|
909
|
+
gas?: bigint;
|
|
910
|
+
gasPrice?: bigint;
|
|
911
|
+
maxFeePerGas?: bigint;
|
|
912
|
+
maxPriorityFeePerGas?: bigint;
|
|
913
|
+
nonce?: number;
|
|
914
|
+
value?: bigint;
|
|
915
|
+
}): Promise<`0x${string}`> {
|
|
916
|
+
if (!this.contract.write) {
|
|
917
|
+
throw new Error('Wallet client is required for write operations');
|
|
918
|
+
}
|
|
919
|
+
return this.contract.write.matchTokenOrderByAdmin_k44j([inputs] as const, options) as Promise<`0x${string}`>;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* matchByAdmin_TwH36
|
|
924
|
+
* nonpayable
|
|
925
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
926
|
+
*/
|
|
927
|
+
async matchByAdmin_TwH36(inputs: bigint[], options?: {
|
|
928
|
+
accessList?: import('viem').AccessList;
|
|
929
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
930
|
+
chain?: import('viem').Chain | null;
|
|
931
|
+
dataSuffix?: `0x${string}`;
|
|
932
|
+
gas?: bigint;
|
|
933
|
+
gasPrice?: bigint;
|
|
934
|
+
maxFeePerGas?: bigint;
|
|
935
|
+
maxPriorityFeePerGas?: bigint;
|
|
936
|
+
nonce?: number;
|
|
937
|
+
value?: bigint;
|
|
938
|
+
}): Promise<`0x${string}`> {
|
|
939
|
+
if (!this.contract.write) {
|
|
940
|
+
throw new Error('Wallet client is required for write operations');
|
|
941
|
+
}
|
|
942
|
+
return this.contract.write.matchByAdmin_TwH36([inputs] as const, options) as Promise<`0x${string}`>;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* withdrawByAdmin_Unau
|
|
947
|
+
* nonpayable
|
|
948
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
949
|
+
*/
|
|
950
|
+
async withdrawByAdmin_Unau(inputs: bigint[], options?: {
|
|
951
|
+
accessList?: import('viem').AccessList;
|
|
952
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
953
|
+
chain?: import('viem').Chain | null;
|
|
954
|
+
dataSuffix?: `0x${string}`;
|
|
955
|
+
gas?: bigint;
|
|
956
|
+
gasPrice?: bigint;
|
|
957
|
+
maxFeePerGas?: bigint;
|
|
958
|
+
maxPriorityFeePerGas?: bigint;
|
|
959
|
+
nonce?: number;
|
|
960
|
+
value?: bigint;
|
|
961
|
+
}): Promise<`0x${string}`> {
|
|
962
|
+
if (!this.contract.write) {
|
|
963
|
+
throw new Error('Wallet client is required for write operations');
|
|
964
|
+
}
|
|
965
|
+
return this.contract.write.withdrawByAdmin_Unau([inputs] as const, options) as Promise<`0x${string}`>;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
/**
|
|
969
|
+
* migrateByAdmin_DQV
|
|
970
|
+
* nonpayable
|
|
971
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
972
|
+
*/
|
|
973
|
+
async migrateByAdmin_DQV(inputs: bigint[], options?: {
|
|
974
|
+
accessList?: import('viem').AccessList;
|
|
975
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
976
|
+
chain?: import('viem').Chain | null;
|
|
977
|
+
dataSuffix?: `0x${string}`;
|
|
978
|
+
gas?: bigint;
|
|
979
|
+
gasPrice?: bigint;
|
|
980
|
+
maxFeePerGas?: bigint;
|
|
981
|
+
maxPriorityFeePerGas?: bigint;
|
|
982
|
+
nonce?: number;
|
|
983
|
+
value?: bigint;
|
|
984
|
+
}): Promise<`0x${string}`> {
|
|
985
|
+
if (!this.contract.write) {
|
|
986
|
+
throw new Error('Wallet client is required for write operations');
|
|
987
|
+
}
|
|
988
|
+
return this.contract.write.migrateByAdmin_DQV([inputs] as const, options) as Promise<`0x${string}`>;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* registerToken
|
|
993
|
+
* nonpayable
|
|
994
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
995
|
+
*/
|
|
996
|
+
async registerToken(tokenAddress: `0x${string}`, index: bigint, options?: {
|
|
997
|
+
accessList?: import('viem').AccessList;
|
|
998
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
999
|
+
chain?: import('viem').Chain | null;
|
|
1000
|
+
dataSuffix?: `0x${string}`;
|
|
1001
|
+
gas?: bigint;
|
|
1002
|
+
gasPrice?: bigint;
|
|
1003
|
+
maxFeePerGas?: bigint;
|
|
1004
|
+
maxPriorityFeePerGas?: bigint;
|
|
1005
|
+
nonce?: number;
|
|
1006
|
+
value?: bigint;
|
|
1007
|
+
}): Promise<`0x${string}`> {
|
|
1008
|
+
if (!this.contract.write) {
|
|
1009
|
+
throw new Error('Wallet client is required for write operations');
|
|
1010
|
+
}
|
|
1011
|
+
return this.contract.write.registerToken([tokenAddress, index] as const, options) as Promise<`0x${string}`>;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* transferForAdmin
|
|
1016
|
+
* nonpayable
|
|
1017
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1018
|
+
*/
|
|
1019
|
+
async transferForAdmin(token: `0x${string}`, account: `0x${string}`, amount: bigint, options?: {
|
|
1020
|
+
accessList?: import('viem').AccessList;
|
|
1021
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1022
|
+
chain?: import('viem').Chain | null;
|
|
1023
|
+
dataSuffix?: `0x${string}`;
|
|
1024
|
+
gas?: bigint;
|
|
1025
|
+
gasPrice?: bigint;
|
|
1026
|
+
maxFeePerGas?: bigint;
|
|
1027
|
+
maxPriorityFeePerGas?: bigint;
|
|
1028
|
+
nonce?: number;
|
|
1029
|
+
value?: bigint;
|
|
1030
|
+
}): Promise<`0x${string}`> {
|
|
1031
|
+
if (!this.contract.write) {
|
|
1032
|
+
throw new Error('Wallet client is required for write operations');
|
|
1033
|
+
}
|
|
1034
|
+
return this.contract.write.transferForAdmin([token, account, amount] as const, options) as Promise<`0x${string}`>;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* addToAdmin
|
|
1039
|
+
* nonpayable
|
|
1040
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1041
|
+
*/
|
|
1042
|
+
async addToAdmin(admin: `0x${string}`, isAdd: boolean, options?: {
|
|
1043
|
+
accessList?: import('viem').AccessList;
|
|
1044
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1045
|
+
chain?: import('viem').Chain | null;
|
|
1046
|
+
dataSuffix?: `0x${string}`;
|
|
1047
|
+
gas?: bigint;
|
|
1048
|
+
gasPrice?: bigint;
|
|
1049
|
+
maxFeePerGas?: bigint;
|
|
1050
|
+
maxPriorityFeePerGas?: bigint;
|
|
1051
|
+
nonce?: number;
|
|
1052
|
+
value?: bigint;
|
|
1053
|
+
}): Promise<`0x${string}`> {
|
|
1054
|
+
if (!this.contract.write) {
|
|
1055
|
+
throw new Error('Wallet client is required for write operations');
|
|
1056
|
+
}
|
|
1057
|
+
return this.contract.write.addToAdmin([admin, isAdd] as const, options) as Promise<`0x${string}`>;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* depositToken
|
|
1062
|
+
* nonpayable
|
|
1063
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1064
|
+
*/
|
|
1065
|
+
async depositToken(token: `0x${string}`, amount: bigint, options?: {
|
|
1066
|
+
accessList?: import('viem').AccessList;
|
|
1067
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1068
|
+
chain?: import('viem').Chain | null;
|
|
1069
|
+
dataSuffix?: `0x${string}`;
|
|
1070
|
+
gas?: bigint;
|
|
1071
|
+
gasPrice?: bigint;
|
|
1072
|
+
maxFeePerGas?: bigint;
|
|
1073
|
+
maxPriorityFeePerGas?: bigint;
|
|
1074
|
+
nonce?: number;
|
|
1075
|
+
value?: bigint;
|
|
1076
|
+
}): Promise<`0x${string}`> {
|
|
1077
|
+
if (!this.contract.write) {
|
|
1078
|
+
throw new Error('Wallet client is required for write operations');
|
|
1079
|
+
}
|
|
1080
|
+
return this.contract.write.depositToken([token, amount] as const, options) as Promise<`0x${string}`>;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* collectFee
|
|
1085
|
+
* nonpayable
|
|
1086
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1087
|
+
*/
|
|
1088
|
+
async collectFee(token: `0x${string}`, options?: {
|
|
1089
|
+
accessList?: import('viem').AccessList;
|
|
1090
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1091
|
+
chain?: import('viem').Chain | null;
|
|
1092
|
+
dataSuffix?: `0x${string}`;
|
|
1093
|
+
gas?: bigint;
|
|
1094
|
+
gasPrice?: bigint;
|
|
1095
|
+
maxFeePerGas?: bigint;
|
|
1096
|
+
maxPriorityFeePerGas?: bigint;
|
|
1097
|
+
nonce?: number;
|
|
1098
|
+
value?: bigint;
|
|
1099
|
+
}): Promise<`0x${string}`> {
|
|
1100
|
+
if (!this.contract.write) {
|
|
1101
|
+
throw new Error('Wallet client is required for write operations');
|
|
1102
|
+
}
|
|
1103
|
+
return this.contract.write.collectFee([token] as const, options) as Promise<`0x${string}`>;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* unlockMe
|
|
1108
|
+
* nonpayable
|
|
1109
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1110
|
+
*/
|
|
1111
|
+
async unlockMe(options?: {
|
|
1112
|
+
accessList?: import('viem').AccessList;
|
|
1113
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1114
|
+
chain?: import('viem').Chain | null;
|
|
1115
|
+
dataSuffix?: `0x${string}`;
|
|
1116
|
+
gas?: bigint;
|
|
1117
|
+
gasPrice?: bigint;
|
|
1118
|
+
maxFeePerGas?: bigint;
|
|
1119
|
+
maxPriorityFeePerGas?: bigint;
|
|
1120
|
+
nonce?: number;
|
|
1121
|
+
value?: bigint;
|
|
1122
|
+
}): Promise<`0x${string}`> {
|
|
1123
|
+
if (!this.contract.write) {
|
|
1124
|
+
throw new Error('Wallet client is required for write operations');
|
|
1125
|
+
}
|
|
1126
|
+
return this.contract.write.unlockMe(options) as Promise<`0x${string}`>;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* setTradeEventEnabled
|
|
1131
|
+
* nonpayable
|
|
1132
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1133
|
+
*/
|
|
1134
|
+
async setTradeEventEnabled(enabled: boolean, options?: {
|
|
1135
|
+
accessList?: import('viem').AccessList;
|
|
1136
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1137
|
+
chain?: import('viem').Chain | null;
|
|
1138
|
+
dataSuffix?: `0x${string}`;
|
|
1139
|
+
gas?: bigint;
|
|
1140
|
+
gasPrice?: bigint;
|
|
1141
|
+
maxFeePerGas?: bigint;
|
|
1142
|
+
maxPriorityFeePerGas?: bigint;
|
|
1143
|
+
nonce?: number;
|
|
1144
|
+
value?: bigint;
|
|
1145
|
+
}): Promise<`0x${string}`> {
|
|
1146
|
+
if (!this.contract.write) {
|
|
1147
|
+
throw new Error('Wallet client is required for write operations');
|
|
1148
|
+
}
|
|
1149
|
+
return this.contract.write.setTradeEventEnabled([enabled] as const, options) as Promise<`0x${string}`>;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* depositEther
|
|
1154
|
+
* payable
|
|
1155
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1156
|
+
*/
|
|
1157
|
+
async depositEther(options?: {
|
|
1158
|
+
accessList?: import('viem').AccessList;
|
|
1159
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1160
|
+
chain?: import('viem').Chain | null;
|
|
1161
|
+
dataSuffix?: `0x${string}`;
|
|
1162
|
+
gas?: bigint;
|
|
1163
|
+
gasPrice?: bigint;
|
|
1164
|
+
maxFeePerGas?: bigint;
|
|
1165
|
+
maxPriorityFeePerGas?: bigint;
|
|
1166
|
+
nonce?: number;
|
|
1167
|
+
value?: bigint;
|
|
1168
|
+
}): Promise<`0x${string}`> {
|
|
1169
|
+
if (!this.contract.write) {
|
|
1170
|
+
throw new Error('Wallet client is required for write operations');
|
|
1171
|
+
}
|
|
1172
|
+
return this.contract.write.depositEther(options) as Promise<`0x${string}`>;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* changeLockPeriod
|
|
1177
|
+
* nonpayable
|
|
1178
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1179
|
+
*/
|
|
1180
|
+
async changeLockPeriod(periodInDays: bigint, options?: {
|
|
1181
|
+
accessList?: import('viem').AccessList;
|
|
1182
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1183
|
+
chain?: import('viem').Chain | null;
|
|
1184
|
+
dataSuffix?: `0x${string}`;
|
|
1185
|
+
gas?: bigint;
|
|
1186
|
+
gasPrice?: bigint;
|
|
1187
|
+
maxFeePerGas?: bigint;
|
|
1188
|
+
maxPriorityFeePerGas?: bigint;
|
|
1189
|
+
nonce?: number;
|
|
1190
|
+
value?: bigint;
|
|
1191
|
+
}): Promise<`0x${string}`> {
|
|
1192
|
+
if (!this.contract.write) {
|
|
1193
|
+
throw new Error('Wallet client is required for write operations');
|
|
1194
|
+
}
|
|
1195
|
+
return this.contract.write.changeLockPeriod([periodInDays] as const, options) as Promise<`0x${string}`>;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* cancelByAdmin
|
|
1200
|
+
* nonpayable
|
|
1201
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1202
|
+
*/
|
|
1203
|
+
async cancelByAdmin(inputs: bigint[], options?: {
|
|
1204
|
+
accessList?: import('viem').AccessList;
|
|
1205
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1206
|
+
chain?: import('viem').Chain | null;
|
|
1207
|
+
dataSuffix?: `0x${string}`;
|
|
1208
|
+
gas?: bigint;
|
|
1209
|
+
gasPrice?: bigint;
|
|
1210
|
+
maxFeePerGas?: bigint;
|
|
1211
|
+
maxPriorityFeePerGas?: bigint;
|
|
1212
|
+
nonce?: number;
|
|
1213
|
+
value?: bigint;
|
|
1214
|
+
}): Promise<`0x${string}`> {
|
|
1215
|
+
if (!this.contract.write) {
|
|
1216
|
+
throw new Error('Wallet client is required for write operations');
|
|
1217
|
+
}
|
|
1218
|
+
return this.contract.write.cancelByAdmin([inputs] as const, options) as Promise<`0x${string}`>;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* transferOwnership
|
|
1223
|
+
* nonpayable
|
|
1224
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1225
|
+
*/
|
|
1226
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1227
|
+
accessList?: import('viem').AccessList;
|
|
1228
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1229
|
+
chain?: import('viem').Chain | null;
|
|
1230
|
+
dataSuffix?: `0x${string}`;
|
|
1231
|
+
gas?: bigint;
|
|
1232
|
+
gasPrice?: bigint;
|
|
1233
|
+
maxFeePerGas?: bigint;
|
|
1234
|
+
maxPriorityFeePerGas?: bigint;
|
|
1235
|
+
nonce?: number;
|
|
1236
|
+
value?: bigint;
|
|
1237
|
+
}): Promise<`0x${string}`> {
|
|
1238
|
+
if (!this.contract.write) {
|
|
1239
|
+
throw new Error('Wallet client is required for write operations');
|
|
1240
|
+
}
|
|
1241
|
+
return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* withdraw
|
|
1246
|
+
* nonpayable
|
|
1247
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1248
|
+
*/
|
|
1249
|
+
async withdraw(token: `0x${string}`, amount: bigint, options?: {
|
|
1250
|
+
accessList?: import('viem').AccessList;
|
|
1251
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1252
|
+
chain?: import('viem').Chain | null;
|
|
1253
|
+
dataSuffix?: `0x${string}`;
|
|
1254
|
+
gas?: bigint;
|
|
1255
|
+
gasPrice?: bigint;
|
|
1256
|
+
maxFeePerGas?: bigint;
|
|
1257
|
+
maxPriorityFeePerGas?: bigint;
|
|
1258
|
+
nonce?: number;
|
|
1259
|
+
value?: bigint;
|
|
1260
|
+
}): Promise<`0x${string}`> {
|
|
1261
|
+
if (!this.contract.write) {
|
|
1262
|
+
throw new Error('Wallet client is required for write operations');
|
|
1263
|
+
}
|
|
1264
|
+
return this.contract.write.withdraw([token, amount] as const, options) as Promise<`0x${string}`>;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* lockMe
|
|
1269
|
+
* nonpayable
|
|
1270
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1271
|
+
*/
|
|
1272
|
+
async lockMe(options?: {
|
|
1273
|
+
accessList?: import('viem').AccessList;
|
|
1274
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1275
|
+
chain?: import('viem').Chain | null;
|
|
1276
|
+
dataSuffix?: `0x${string}`;
|
|
1277
|
+
gas?: bigint;
|
|
1278
|
+
gasPrice?: bigint;
|
|
1279
|
+
maxFeePerGas?: bigint;
|
|
1280
|
+
maxPriorityFeePerGas?: bigint;
|
|
1281
|
+
nonce?: number;
|
|
1282
|
+
value?: bigint;
|
|
1283
|
+
}): Promise<`0x${string}`> {
|
|
1284
|
+
if (!this.contract.write) {
|
|
1285
|
+
throw new Error('Wallet client is required for write operations');
|
|
1286
|
+
}
|
|
1287
|
+
return this.contract.write.lockMe(options) as Promise<`0x${string}`>;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1294
|
+
*
|
|
1295
|
+
* @example
|
|
1296
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1297
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1298
|
+
* console.log('Would succeed:', result.result);
|
|
1299
|
+
*/
|
|
1300
|
+
get simulate() {
|
|
1301
|
+
const contract = this.contract;
|
|
1302
|
+
if (!contract.simulate) {
|
|
1303
|
+
throw new Error('Public client is required for simulation');
|
|
1304
|
+
}
|
|
1305
|
+
return {
|
|
1306
|
+
/**
|
|
1307
|
+
* Simulate matchTokenOrderByAdmin_k44j
|
|
1308
|
+
* Returns gas estimate and result without sending transaction
|
|
1309
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1310
|
+
*/
|
|
1311
|
+
async matchTokenOrderByAdmin_k44j(inputs: bigint[], options?: {
|
|
1312
|
+
accessList?: import('viem').AccessList;
|
|
1313
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1314
|
+
chain?: import('viem').Chain | null;
|
|
1315
|
+
dataSuffix?: `0x${string}`;
|
|
1316
|
+
gas?: bigint;
|
|
1317
|
+
gasPrice?: bigint;
|
|
1318
|
+
maxFeePerGas?: bigint;
|
|
1319
|
+
maxPriorityFeePerGas?: bigint;
|
|
1320
|
+
nonce?: number;
|
|
1321
|
+
value?: bigint;
|
|
1322
|
+
}): Promise<void> {
|
|
1323
|
+
return contract.simulate.matchTokenOrderByAdmin_k44j([inputs] as const, options) as Promise<void>;
|
|
1324
|
+
},
|
|
1325
|
+
/**
|
|
1326
|
+
* Simulate matchByAdmin_TwH36
|
|
1327
|
+
* Returns gas estimate and result without sending transaction
|
|
1328
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1329
|
+
*/
|
|
1330
|
+
async matchByAdmin_TwH36(inputs: bigint[], options?: {
|
|
1331
|
+
accessList?: import('viem').AccessList;
|
|
1332
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1333
|
+
chain?: import('viem').Chain | null;
|
|
1334
|
+
dataSuffix?: `0x${string}`;
|
|
1335
|
+
gas?: bigint;
|
|
1336
|
+
gasPrice?: bigint;
|
|
1337
|
+
maxFeePerGas?: bigint;
|
|
1338
|
+
maxPriorityFeePerGas?: bigint;
|
|
1339
|
+
nonce?: number;
|
|
1340
|
+
value?: bigint;
|
|
1341
|
+
}): Promise<void> {
|
|
1342
|
+
return contract.simulate.matchByAdmin_TwH36([inputs] as const, options) as Promise<void>;
|
|
1343
|
+
},
|
|
1344
|
+
/**
|
|
1345
|
+
* Simulate withdrawByAdmin_Unau
|
|
1346
|
+
* Returns gas estimate and result without sending transaction
|
|
1347
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1348
|
+
*/
|
|
1349
|
+
async withdrawByAdmin_Unau(inputs: bigint[], options?: {
|
|
1350
|
+
accessList?: import('viem').AccessList;
|
|
1351
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1352
|
+
chain?: import('viem').Chain | null;
|
|
1353
|
+
dataSuffix?: `0x${string}`;
|
|
1354
|
+
gas?: bigint;
|
|
1355
|
+
gasPrice?: bigint;
|
|
1356
|
+
maxFeePerGas?: bigint;
|
|
1357
|
+
maxPriorityFeePerGas?: bigint;
|
|
1358
|
+
nonce?: number;
|
|
1359
|
+
value?: bigint;
|
|
1360
|
+
}): Promise<void> {
|
|
1361
|
+
return contract.simulate.withdrawByAdmin_Unau([inputs] as const, options) as Promise<void>;
|
|
1362
|
+
},
|
|
1363
|
+
/**
|
|
1364
|
+
* Simulate migrateByAdmin_DQV
|
|
1365
|
+
* Returns gas estimate and result without sending transaction
|
|
1366
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1367
|
+
*/
|
|
1368
|
+
async migrateByAdmin_DQV(inputs: bigint[], options?: {
|
|
1369
|
+
accessList?: import('viem').AccessList;
|
|
1370
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1371
|
+
chain?: import('viem').Chain | null;
|
|
1372
|
+
dataSuffix?: `0x${string}`;
|
|
1373
|
+
gas?: bigint;
|
|
1374
|
+
gasPrice?: bigint;
|
|
1375
|
+
maxFeePerGas?: bigint;
|
|
1376
|
+
maxPriorityFeePerGas?: bigint;
|
|
1377
|
+
nonce?: number;
|
|
1378
|
+
value?: bigint;
|
|
1379
|
+
}): Promise<void> {
|
|
1380
|
+
return contract.simulate.migrateByAdmin_DQV([inputs] as const, options) as Promise<void>;
|
|
1381
|
+
},
|
|
1382
|
+
/**
|
|
1383
|
+
* Simulate registerToken
|
|
1384
|
+
* Returns gas estimate and result without sending transaction
|
|
1385
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1386
|
+
*/
|
|
1387
|
+
async registerToken(tokenAddress: `0x${string}`, index: bigint, options?: {
|
|
1388
|
+
accessList?: import('viem').AccessList;
|
|
1389
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1390
|
+
chain?: import('viem').Chain | null;
|
|
1391
|
+
dataSuffix?: `0x${string}`;
|
|
1392
|
+
gas?: bigint;
|
|
1393
|
+
gasPrice?: bigint;
|
|
1394
|
+
maxFeePerGas?: bigint;
|
|
1395
|
+
maxPriorityFeePerGas?: bigint;
|
|
1396
|
+
nonce?: number;
|
|
1397
|
+
value?: bigint;
|
|
1398
|
+
}): Promise<void> {
|
|
1399
|
+
return contract.simulate.registerToken([tokenAddress, index] as const, options) as Promise<void>;
|
|
1400
|
+
},
|
|
1401
|
+
/**
|
|
1402
|
+
* Simulate transferForAdmin
|
|
1403
|
+
* Returns gas estimate and result without sending transaction
|
|
1404
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1405
|
+
*/
|
|
1406
|
+
async transferForAdmin(token: `0x${string}`, account: `0x${string}`, amount: bigint, options?: {
|
|
1407
|
+
accessList?: import('viem').AccessList;
|
|
1408
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1409
|
+
chain?: import('viem').Chain | null;
|
|
1410
|
+
dataSuffix?: `0x${string}`;
|
|
1411
|
+
gas?: bigint;
|
|
1412
|
+
gasPrice?: bigint;
|
|
1413
|
+
maxFeePerGas?: bigint;
|
|
1414
|
+
maxPriorityFeePerGas?: bigint;
|
|
1415
|
+
nonce?: number;
|
|
1416
|
+
value?: bigint;
|
|
1417
|
+
}): Promise<void> {
|
|
1418
|
+
return contract.simulate.transferForAdmin([token, account, amount] as const, options) as Promise<void>;
|
|
1419
|
+
},
|
|
1420
|
+
/**
|
|
1421
|
+
* Simulate addToAdmin
|
|
1422
|
+
* Returns gas estimate and result without sending transaction
|
|
1423
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1424
|
+
*/
|
|
1425
|
+
async addToAdmin(admin: `0x${string}`, isAdd: boolean, options?: {
|
|
1426
|
+
accessList?: import('viem').AccessList;
|
|
1427
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1428
|
+
chain?: import('viem').Chain | null;
|
|
1429
|
+
dataSuffix?: `0x${string}`;
|
|
1430
|
+
gas?: bigint;
|
|
1431
|
+
gasPrice?: bigint;
|
|
1432
|
+
maxFeePerGas?: bigint;
|
|
1433
|
+
maxPriorityFeePerGas?: bigint;
|
|
1434
|
+
nonce?: number;
|
|
1435
|
+
value?: bigint;
|
|
1436
|
+
}): Promise<void> {
|
|
1437
|
+
return contract.simulate.addToAdmin([admin, isAdd] as const, options) as Promise<void>;
|
|
1438
|
+
},
|
|
1439
|
+
/**
|
|
1440
|
+
* Simulate depositToken
|
|
1441
|
+
* Returns gas estimate and result without sending transaction
|
|
1442
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1443
|
+
*/
|
|
1444
|
+
async depositToken(token: `0x${string}`, amount: bigint, options?: {
|
|
1445
|
+
accessList?: import('viem').AccessList;
|
|
1446
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1447
|
+
chain?: import('viem').Chain | null;
|
|
1448
|
+
dataSuffix?: `0x${string}`;
|
|
1449
|
+
gas?: bigint;
|
|
1450
|
+
gasPrice?: bigint;
|
|
1451
|
+
maxFeePerGas?: bigint;
|
|
1452
|
+
maxPriorityFeePerGas?: bigint;
|
|
1453
|
+
nonce?: number;
|
|
1454
|
+
value?: bigint;
|
|
1455
|
+
}): Promise<void> {
|
|
1456
|
+
return contract.simulate.depositToken([token, amount] as const, options) as Promise<void>;
|
|
1457
|
+
},
|
|
1458
|
+
/**
|
|
1459
|
+
* Simulate collectFee
|
|
1460
|
+
* Returns gas estimate and result without sending transaction
|
|
1461
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1462
|
+
*/
|
|
1463
|
+
async collectFee(token: `0x${string}`, options?: {
|
|
1464
|
+
accessList?: import('viem').AccessList;
|
|
1465
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1466
|
+
chain?: import('viem').Chain | null;
|
|
1467
|
+
dataSuffix?: `0x${string}`;
|
|
1468
|
+
gas?: bigint;
|
|
1469
|
+
gasPrice?: bigint;
|
|
1470
|
+
maxFeePerGas?: bigint;
|
|
1471
|
+
maxPriorityFeePerGas?: bigint;
|
|
1472
|
+
nonce?: number;
|
|
1473
|
+
value?: bigint;
|
|
1474
|
+
}): Promise<void> {
|
|
1475
|
+
return contract.simulate.collectFee([token] as const, options) as Promise<void>;
|
|
1476
|
+
},
|
|
1477
|
+
/**
|
|
1478
|
+
* Simulate unlockMe
|
|
1479
|
+
* Returns gas estimate and result without sending transaction
|
|
1480
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1481
|
+
*/
|
|
1482
|
+
async unlockMe(options?: {
|
|
1483
|
+
accessList?: import('viem').AccessList;
|
|
1484
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1485
|
+
chain?: import('viem').Chain | null;
|
|
1486
|
+
dataSuffix?: `0x${string}`;
|
|
1487
|
+
gas?: bigint;
|
|
1488
|
+
gasPrice?: bigint;
|
|
1489
|
+
maxFeePerGas?: bigint;
|
|
1490
|
+
maxPriorityFeePerGas?: bigint;
|
|
1491
|
+
nonce?: number;
|
|
1492
|
+
value?: bigint;
|
|
1493
|
+
}): Promise<void> {
|
|
1494
|
+
return contract.simulate.unlockMe(options) as Promise<void>;
|
|
1495
|
+
},
|
|
1496
|
+
/**
|
|
1497
|
+
* Simulate setTradeEventEnabled
|
|
1498
|
+
* Returns gas estimate and result without sending transaction
|
|
1499
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1500
|
+
*/
|
|
1501
|
+
async setTradeEventEnabled(enabled: boolean, options?: {
|
|
1502
|
+
accessList?: import('viem').AccessList;
|
|
1503
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1504
|
+
chain?: import('viem').Chain | null;
|
|
1505
|
+
dataSuffix?: `0x${string}`;
|
|
1506
|
+
gas?: bigint;
|
|
1507
|
+
gasPrice?: bigint;
|
|
1508
|
+
maxFeePerGas?: bigint;
|
|
1509
|
+
maxPriorityFeePerGas?: bigint;
|
|
1510
|
+
nonce?: number;
|
|
1511
|
+
value?: bigint;
|
|
1512
|
+
}): Promise<void> {
|
|
1513
|
+
return contract.simulate.setTradeEventEnabled([enabled] as const, options) as Promise<void>;
|
|
1514
|
+
},
|
|
1515
|
+
/**
|
|
1516
|
+
* Simulate depositEther
|
|
1517
|
+
* Returns gas estimate and result without sending transaction
|
|
1518
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1519
|
+
*/
|
|
1520
|
+
async depositEther(options?: {
|
|
1521
|
+
accessList?: import('viem').AccessList;
|
|
1522
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1523
|
+
chain?: import('viem').Chain | null;
|
|
1524
|
+
dataSuffix?: `0x${string}`;
|
|
1525
|
+
gas?: bigint;
|
|
1526
|
+
gasPrice?: bigint;
|
|
1527
|
+
maxFeePerGas?: bigint;
|
|
1528
|
+
maxPriorityFeePerGas?: bigint;
|
|
1529
|
+
nonce?: number;
|
|
1530
|
+
value?: bigint;
|
|
1531
|
+
}): Promise<void> {
|
|
1532
|
+
return contract.simulate.depositEther(options) as Promise<void>;
|
|
1533
|
+
},
|
|
1534
|
+
/**
|
|
1535
|
+
* Simulate changeLockPeriod
|
|
1536
|
+
* Returns gas estimate and result without sending transaction
|
|
1537
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1538
|
+
*/
|
|
1539
|
+
async changeLockPeriod(periodInDays: bigint, options?: {
|
|
1540
|
+
accessList?: import('viem').AccessList;
|
|
1541
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1542
|
+
chain?: import('viem').Chain | null;
|
|
1543
|
+
dataSuffix?: `0x${string}`;
|
|
1544
|
+
gas?: bigint;
|
|
1545
|
+
gasPrice?: bigint;
|
|
1546
|
+
maxFeePerGas?: bigint;
|
|
1547
|
+
maxPriorityFeePerGas?: bigint;
|
|
1548
|
+
nonce?: number;
|
|
1549
|
+
value?: bigint;
|
|
1550
|
+
}): Promise<void> {
|
|
1551
|
+
return contract.simulate.changeLockPeriod([periodInDays] as const, options) as Promise<void>;
|
|
1552
|
+
},
|
|
1553
|
+
/**
|
|
1554
|
+
* Simulate cancelByAdmin
|
|
1555
|
+
* Returns gas estimate and result without sending transaction
|
|
1556
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1557
|
+
*/
|
|
1558
|
+
async cancelByAdmin(inputs: bigint[], options?: {
|
|
1559
|
+
accessList?: import('viem').AccessList;
|
|
1560
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1561
|
+
chain?: import('viem').Chain | null;
|
|
1562
|
+
dataSuffix?: `0x${string}`;
|
|
1563
|
+
gas?: bigint;
|
|
1564
|
+
gasPrice?: bigint;
|
|
1565
|
+
maxFeePerGas?: bigint;
|
|
1566
|
+
maxPriorityFeePerGas?: bigint;
|
|
1567
|
+
nonce?: number;
|
|
1568
|
+
value?: bigint;
|
|
1569
|
+
}): Promise<void> {
|
|
1570
|
+
return contract.simulate.cancelByAdmin([inputs] as const, options) as Promise<void>;
|
|
1571
|
+
},
|
|
1572
|
+
/**
|
|
1573
|
+
* Simulate transferOwnership
|
|
1574
|
+
* Returns gas estimate and result without sending transaction
|
|
1575
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1576
|
+
*/
|
|
1577
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
1578
|
+
accessList?: import('viem').AccessList;
|
|
1579
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1580
|
+
chain?: import('viem').Chain | null;
|
|
1581
|
+
dataSuffix?: `0x${string}`;
|
|
1582
|
+
gas?: bigint;
|
|
1583
|
+
gasPrice?: bigint;
|
|
1584
|
+
maxFeePerGas?: bigint;
|
|
1585
|
+
maxPriorityFeePerGas?: bigint;
|
|
1586
|
+
nonce?: number;
|
|
1587
|
+
value?: bigint;
|
|
1588
|
+
}): Promise<void> {
|
|
1589
|
+
return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
|
|
1590
|
+
},
|
|
1591
|
+
/**
|
|
1592
|
+
* Simulate withdraw
|
|
1593
|
+
* Returns gas estimate and result without sending transaction
|
|
1594
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1595
|
+
*/
|
|
1596
|
+
async withdraw(token: `0x${string}`, amount: bigint, options?: {
|
|
1597
|
+
accessList?: import('viem').AccessList;
|
|
1598
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1599
|
+
chain?: import('viem').Chain | null;
|
|
1600
|
+
dataSuffix?: `0x${string}`;
|
|
1601
|
+
gas?: bigint;
|
|
1602
|
+
gasPrice?: bigint;
|
|
1603
|
+
maxFeePerGas?: bigint;
|
|
1604
|
+
maxPriorityFeePerGas?: bigint;
|
|
1605
|
+
nonce?: number;
|
|
1606
|
+
value?: bigint;
|
|
1607
|
+
}): Promise<void> {
|
|
1608
|
+
return contract.simulate.withdraw([token, amount] as const, options) as Promise<void>;
|
|
1609
|
+
},
|
|
1610
|
+
/**
|
|
1611
|
+
* Simulate lockMe
|
|
1612
|
+
* Returns gas estimate and result without sending transaction
|
|
1613
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1614
|
+
*/
|
|
1615
|
+
async lockMe(options?: {
|
|
1616
|
+
accessList?: import('viem').AccessList;
|
|
1617
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1618
|
+
chain?: import('viem').Chain | null;
|
|
1619
|
+
dataSuffix?: `0x${string}`;
|
|
1620
|
+
gas?: bigint;
|
|
1621
|
+
gasPrice?: bigint;
|
|
1622
|
+
maxFeePerGas?: bigint;
|
|
1623
|
+
maxPriorityFeePerGas?: bigint;
|
|
1624
|
+
nonce?: number;
|
|
1625
|
+
value?: bigint;
|
|
1626
|
+
}): Promise<void> {
|
|
1627
|
+
return contract.simulate.lockMe(options) as Promise<void>;
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* Watch contract events
|
|
1634
|
+
*
|
|
1635
|
+
* @example
|
|
1636
|
+
* // Watch all Transfer events
|
|
1637
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1638
|
+
* console.log('Transfer:', event);
|
|
1639
|
+
* });
|
|
1640
|
+
*
|
|
1641
|
+
* // Stop watching
|
|
1642
|
+
* unwatch();
|
|
1643
|
+
*/
|
|
1644
|
+
get watch() {
|
|
1645
|
+
return {
|
|
1646
|
+
/**
|
|
1647
|
+
* Watch Deposit events
|
|
1648
|
+
* @param callback Function to call when event is emitted
|
|
1649
|
+
* @param filter Optional filter for indexed parameters
|
|
1650
|
+
* @returns Unwatch function to stop listening
|
|
1651
|
+
*/
|
|
1652
|
+
Deposit: (callback: (event: { token: `0x${string}`; user: `0x${string}`; amount: bigint; balance: bigint }) => void) => {
|
|
1653
|
+
return this.publicClient.watchContractEvent({
|
|
1654
|
+
address: this.contractAddress,
|
|
1655
|
+
abi: Joyso_jsonAbi,
|
|
1656
|
+
eventName: 'Deposit',
|
|
1657
|
+
|
|
1658
|
+
onLogs: (logs: any[]) => {
|
|
1659
|
+
logs.forEach((log: any) => {
|
|
1660
|
+
callback(log.args as any);
|
|
1661
|
+
});
|
|
1662
|
+
},
|
|
1663
|
+
}) as () => void;
|
|
1664
|
+
},
|
|
1665
|
+
/**
|
|
1666
|
+
* Watch Withdraw events
|
|
1667
|
+
* @param callback Function to call when event is emitted
|
|
1668
|
+
* @param filter Optional filter for indexed parameters
|
|
1669
|
+
* @returns Unwatch function to stop listening
|
|
1670
|
+
*/
|
|
1671
|
+
Withdraw: (callback: (event: { token: `0x${string}`; user: `0x${string}`; amount: bigint; balance: bigint }) => void) => {
|
|
1672
|
+
return this.publicClient.watchContractEvent({
|
|
1673
|
+
address: this.contractAddress,
|
|
1674
|
+
abi: Joyso_jsonAbi,
|
|
1675
|
+
eventName: 'Withdraw',
|
|
1676
|
+
|
|
1677
|
+
onLogs: (logs: any[]) => {
|
|
1678
|
+
logs.forEach((log: any) => {
|
|
1679
|
+
callback(log.args as any);
|
|
1680
|
+
});
|
|
1681
|
+
},
|
|
1682
|
+
}) as () => void;
|
|
1683
|
+
},
|
|
1684
|
+
/**
|
|
1685
|
+
* Watch NewUser events
|
|
1686
|
+
* @param callback Function to call when event is emitted
|
|
1687
|
+
* @param filter Optional filter for indexed parameters
|
|
1688
|
+
* @returns Unwatch function to stop listening
|
|
1689
|
+
*/
|
|
1690
|
+
NewUser: (callback: (event: { user: `0x${string}`; id: bigint }) => void) => {
|
|
1691
|
+
return this.publicClient.watchContractEvent({
|
|
1692
|
+
address: this.contractAddress,
|
|
1693
|
+
abi: Joyso_jsonAbi,
|
|
1694
|
+
eventName: 'NewUser',
|
|
1695
|
+
|
|
1696
|
+
onLogs: (logs: any[]) => {
|
|
1697
|
+
logs.forEach((log: any) => {
|
|
1698
|
+
callback(log.args as any);
|
|
1699
|
+
});
|
|
1700
|
+
},
|
|
1701
|
+
}) as () => void;
|
|
1702
|
+
},
|
|
1703
|
+
/**
|
|
1704
|
+
* Watch Lock events
|
|
1705
|
+
* @param callback Function to call when event is emitted
|
|
1706
|
+
* @param filter Optional filter for indexed parameters
|
|
1707
|
+
* @returns Unwatch function to stop listening
|
|
1708
|
+
*/
|
|
1709
|
+
Lock: (callback: (event: { user: `0x${string}`; timeLock: bigint }) => void) => {
|
|
1710
|
+
return this.publicClient.watchContractEvent({
|
|
1711
|
+
address: this.contractAddress,
|
|
1712
|
+
abi: Joyso_jsonAbi,
|
|
1713
|
+
eventName: 'Lock',
|
|
1714
|
+
|
|
1715
|
+
onLogs: (logs: any[]) => {
|
|
1716
|
+
logs.forEach((log: any) => {
|
|
1717
|
+
callback(log.args as any);
|
|
1718
|
+
});
|
|
1719
|
+
},
|
|
1720
|
+
}) as () => void;
|
|
1721
|
+
},
|
|
1722
|
+
/**
|
|
1723
|
+
* Watch TradeSuccess events
|
|
1724
|
+
* @param callback Function to call when event is emitted
|
|
1725
|
+
* @param filter Optional filter for indexed parameters
|
|
1726
|
+
* @returns Unwatch function to stop listening
|
|
1727
|
+
*/
|
|
1728
|
+
TradeSuccess: (callback: (event: { user: `0x${string}`; baseAmount: bigint; tokenAmount: bigint; isBuy: boolean; fee: bigint }) => void) => {
|
|
1729
|
+
return this.publicClient.watchContractEvent({
|
|
1730
|
+
address: this.contractAddress,
|
|
1731
|
+
abi: Joyso_jsonAbi,
|
|
1732
|
+
eventName: 'TradeSuccess',
|
|
1733
|
+
|
|
1734
|
+
onLogs: (logs: any[]) => {
|
|
1735
|
+
logs.forEach((log: any) => {
|
|
1736
|
+
callback(log.args as any);
|
|
1737
|
+
});
|
|
1738
|
+
},
|
|
1739
|
+
}) as () => void;
|
|
1740
|
+
},
|
|
1741
|
+
/**
|
|
1742
|
+
* Watch OwnershipTransferred events
|
|
1743
|
+
* @param callback Function to call when event is emitted
|
|
1744
|
+
* @param filter Optional filter for indexed parameters
|
|
1745
|
+
* @returns Unwatch function to stop listening
|
|
1746
|
+
*/
|
|
1747
|
+
OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
|
|
1748
|
+
return this.publicClient.watchContractEvent({
|
|
1749
|
+
address: this.contractAddress,
|
|
1750
|
+
abi: Joyso_jsonAbi,
|
|
1751
|
+
eventName: 'OwnershipTransferred',
|
|
1752
|
+
args: filter,
|
|
1753
|
+
onLogs: (logs: any[]) => {
|
|
1754
|
+
logs.forEach((log: any) => {
|
|
1755
|
+
callback(log.args as any);
|
|
1756
|
+
});
|
|
1757
|
+
},
|
|
1758
|
+
}) as () => void;
|
|
1759
|
+
}
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
}
|