@gitmyabi/millionmoney 0.0.0-stage → 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.
@@ -0,0 +1,646 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * MillionMoney_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const MillionMoney_jsonAbi: readonly [{
8
+ readonly constant: true;
9
+ readonly inputs: readonly [{
10
+ readonly internalType: "address";
11
+ readonly name: "_user";
12
+ readonly type: "address";
13
+ }];
14
+ readonly name: "findFreeReferrer";
15
+ readonly outputs: readonly [{
16
+ readonly internalType: "address";
17
+ readonly name: "";
18
+ readonly type: "address";
19
+ }];
20
+ readonly payable: false;
21
+ readonly stateMutability: "view";
22
+ readonly type: "function";
23
+ }, {
24
+ readonly constant: false;
25
+ readonly inputs: readonly [];
26
+ readonly name: "syncClose";
27
+ readonly outputs: readonly [];
28
+ readonly payable: false;
29
+ readonly stateMutability: "nonpayable";
30
+ readonly type: "function";
31
+ }, {
32
+ readonly constant: true;
33
+ readonly inputs: readonly [{
34
+ readonly internalType: "address";
35
+ readonly name: "_user";
36
+ readonly type: "address";
37
+ }];
38
+ readonly name: "viewUserReferral";
39
+ readonly outputs: readonly [{
40
+ readonly internalType: "address[]";
41
+ readonly name: "";
42
+ readonly type: "address[]";
43
+ }];
44
+ readonly payable: false;
45
+ readonly stateMutability: "view";
46
+ readonly type: "function";
47
+ }, {
48
+ readonly constant: true;
49
+ readonly inputs: readonly [{
50
+ readonly internalType: "uint256";
51
+ readonly name: "";
52
+ readonly type: "uint256";
53
+ }];
54
+ readonly name: "LEVEL_PRICE";
55
+ readonly outputs: readonly [{
56
+ readonly internalType: "uint256";
57
+ readonly name: "";
58
+ readonly type: "uint256";
59
+ }];
60
+ readonly payable: false;
61
+ readonly stateMutability: "view";
62
+ readonly type: "function";
63
+ }, {
64
+ readonly constant: false;
65
+ readonly inputs: readonly [{
66
+ readonly internalType: "uint256";
67
+ readonly name: "_referrerID";
68
+ readonly type: "uint256";
69
+ }];
70
+ readonly name: "regUser";
71
+ readonly outputs: readonly [];
72
+ readonly payable: true;
73
+ readonly stateMutability: "payable";
74
+ readonly type: "function";
75
+ }, {
76
+ readonly constant: true;
77
+ readonly inputs: readonly [];
78
+ readonly name: "oldSC";
79
+ readonly outputs: readonly [{
80
+ readonly internalType: "contract MillionMoney";
81
+ readonly name: "";
82
+ readonly type: "address";
83
+ }];
84
+ readonly payable: false;
85
+ readonly stateMutability: "view";
86
+ readonly type: "function";
87
+ }, {
88
+ readonly constant: true;
89
+ readonly inputs: readonly [];
90
+ readonly name: "ownerWallet";
91
+ readonly outputs: readonly [{
92
+ readonly internalType: "address";
93
+ readonly name: "";
94
+ readonly type: "address";
95
+ }];
96
+ readonly payable: false;
97
+ readonly stateMutability: "view";
98
+ readonly type: "function";
99
+ }, {
100
+ readonly constant: true;
101
+ readonly inputs: readonly [{
102
+ readonly internalType: "uint256";
103
+ readonly name: "";
104
+ readonly type: "uint256";
105
+ }];
106
+ readonly name: "userList";
107
+ readonly outputs: readonly [{
108
+ readonly internalType: "address";
109
+ readonly name: "";
110
+ readonly type: "address";
111
+ }];
112
+ readonly payable: false;
113
+ readonly stateMutability: "view";
114
+ readonly type: "function";
115
+ }, {
116
+ readonly constant: true;
117
+ readonly inputs: readonly [];
118
+ readonly name: "currUserID";
119
+ readonly outputs: readonly [{
120
+ readonly internalType: "uint256";
121
+ readonly name: "";
122
+ readonly type: "uint256";
123
+ }];
124
+ readonly payable: false;
125
+ readonly stateMutability: "view";
126
+ readonly type: "function";
127
+ }, {
128
+ readonly constant: true;
129
+ readonly inputs: readonly [{
130
+ readonly internalType: "address";
131
+ readonly name: "";
132
+ readonly type: "address";
133
+ }];
134
+ readonly name: "users";
135
+ readonly outputs: readonly [{
136
+ readonly internalType: "bool";
137
+ readonly name: "isExist";
138
+ readonly type: "bool";
139
+ }, {
140
+ readonly internalType: "uint256";
141
+ readonly name: "id";
142
+ readonly type: "uint256";
143
+ }, {
144
+ readonly internalType: "uint256";
145
+ readonly name: "referrerID";
146
+ readonly type: "uint256";
147
+ }];
148
+ readonly payable: false;
149
+ readonly stateMutability: "view";
150
+ readonly type: "function";
151
+ }, {
152
+ readonly constant: true;
153
+ readonly inputs: readonly [{
154
+ readonly internalType: "address";
155
+ readonly name: "_user";
156
+ readonly type: "address";
157
+ }, {
158
+ readonly internalType: "uint256";
159
+ readonly name: "_level";
160
+ readonly type: "uint256";
161
+ }];
162
+ readonly name: "viewUserLevelExpired";
163
+ readonly outputs: readonly [{
164
+ readonly internalType: "uint256";
165
+ readonly name: "";
166
+ readonly type: "uint256";
167
+ }];
168
+ readonly payable: false;
169
+ readonly stateMutability: "view";
170
+ readonly type: "function";
171
+ }, {
172
+ readonly constant: false;
173
+ readonly inputs: readonly [{
174
+ readonly internalType: "uint256";
175
+ readonly name: "limit";
176
+ readonly type: "uint256";
177
+ }];
178
+ readonly name: "syncWithOldSC";
179
+ readonly outputs: readonly [];
180
+ readonly payable: false;
181
+ readonly stateMutability: "nonpayable";
182
+ readonly type: "function";
183
+ }, {
184
+ readonly constant: false;
185
+ readonly inputs: readonly [{
186
+ readonly internalType: "uint256";
187
+ readonly name: "_level";
188
+ readonly type: "uint256";
189
+ }];
190
+ readonly name: "buyLevel";
191
+ readonly outputs: readonly [];
192
+ readonly payable: true;
193
+ readonly stateMutability: "payable";
194
+ readonly type: "function";
195
+ }, {
196
+ readonly inputs: readonly [];
197
+ readonly payable: false;
198
+ readonly stateMutability: "nonpayable";
199
+ readonly type: "constructor";
200
+ }, {
201
+ readonly payable: true;
202
+ readonly stateMutability: "payable";
203
+ readonly type: "fallback";
204
+ }, {
205
+ readonly anonymous: false;
206
+ readonly inputs: readonly [{
207
+ readonly indexed: true;
208
+ readonly internalType: "address";
209
+ readonly name: "_user";
210
+ readonly type: "address";
211
+ }, {
212
+ readonly indexed: true;
213
+ readonly internalType: "address";
214
+ readonly name: "_referrer";
215
+ readonly type: "address";
216
+ }, {
217
+ readonly indexed: false;
218
+ readonly internalType: "uint256";
219
+ readonly name: "_time";
220
+ readonly type: "uint256";
221
+ }];
222
+ readonly name: "regLevelEvent";
223
+ readonly type: "event";
224
+ }, {
225
+ readonly anonymous: false;
226
+ readonly inputs: readonly [{
227
+ readonly indexed: true;
228
+ readonly internalType: "address";
229
+ readonly name: "_user";
230
+ readonly type: "address";
231
+ }, {
232
+ readonly indexed: false;
233
+ readonly internalType: "uint256";
234
+ readonly name: "_level";
235
+ readonly type: "uint256";
236
+ }, {
237
+ readonly indexed: false;
238
+ readonly internalType: "uint256";
239
+ readonly name: "_time";
240
+ readonly type: "uint256";
241
+ }];
242
+ readonly name: "buyLevelEvent";
243
+ readonly type: "event";
244
+ }, {
245
+ readonly anonymous: false;
246
+ readonly inputs: readonly [{
247
+ readonly indexed: true;
248
+ readonly internalType: "address";
249
+ readonly name: "_user";
250
+ readonly type: "address";
251
+ }, {
252
+ readonly indexed: false;
253
+ readonly internalType: "uint256";
254
+ readonly name: "_level";
255
+ readonly type: "uint256";
256
+ }, {
257
+ readonly indexed: false;
258
+ readonly internalType: "uint256";
259
+ readonly name: "_time";
260
+ readonly type: "uint256";
261
+ }];
262
+ readonly name: "prolongateLevelEvent";
263
+ readonly type: "event";
264
+ }, {
265
+ readonly anonymous: false;
266
+ readonly inputs: readonly [{
267
+ readonly indexed: true;
268
+ readonly internalType: "address";
269
+ readonly name: "_user";
270
+ readonly type: "address";
271
+ }, {
272
+ readonly indexed: true;
273
+ readonly internalType: "address";
274
+ readonly name: "_referral";
275
+ readonly type: "address";
276
+ }, {
277
+ readonly indexed: false;
278
+ readonly internalType: "uint256";
279
+ readonly name: "_level";
280
+ readonly type: "uint256";
281
+ }, {
282
+ readonly indexed: false;
283
+ readonly internalType: "uint256";
284
+ readonly name: "_time";
285
+ readonly type: "uint256";
286
+ }];
287
+ readonly name: "getMoneyForLevelEvent";
288
+ readonly type: "event";
289
+ }, {
290
+ readonly anonymous: false;
291
+ readonly inputs: readonly [{
292
+ readonly indexed: true;
293
+ readonly internalType: "address";
294
+ readonly name: "_user";
295
+ readonly type: "address";
296
+ }, {
297
+ readonly indexed: true;
298
+ readonly internalType: "address";
299
+ readonly name: "_referral";
300
+ readonly type: "address";
301
+ }, {
302
+ readonly indexed: false;
303
+ readonly internalType: "uint256";
304
+ readonly name: "_level";
305
+ readonly type: "uint256";
306
+ }, {
307
+ readonly indexed: false;
308
+ readonly internalType: "uint256";
309
+ readonly name: "_time";
310
+ readonly type: "uint256";
311
+ }];
312
+ readonly name: "lostMoneyForLevelEvent";
313
+ readonly type: "event";
314
+ }];
315
+ /**
316
+ * Type-safe ABI for MillionMoney_json
317
+ */
318
+ export type MillionMoney_jsonAbi = typeof MillionMoney_jsonAbi;
319
+ /**
320
+ * Contract instance type for MillionMoney_json
321
+ */
322
+ export type MillionMoney_jsonContract = any;
323
+ /**
324
+ * MillionMoney_json Contract Class
325
+ *
326
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
327
+ *
328
+ * @example
329
+ * ```typescript
330
+ * import { createPublicClient, createWalletClient, http } from 'viem';
331
+ * import { mainnet } from 'viem/chains';
332
+ * import { MillionMoney_json } from 'MillionMoney_json';
333
+ *
334
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
335
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
336
+ *
337
+ * const contract = new MillionMoney_json('0x...', { publicClient, walletClient });
338
+ *
339
+ * // Read functions
340
+ * const result = await contract.balanceOf('0x...');
341
+ *
342
+ * // Write functions
343
+ * const hash = await contract.transfer('0x...', 1000n);
344
+ *
345
+ * // Simulate transactions (dry-run)
346
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
347
+ * console.log('Gas estimate:', simulation.request.gas);
348
+ *
349
+ * // Watch events
350
+ * const unwatch = contract.watch.Transfer((event) => {
351
+ * console.log('Transfer event:', event);
352
+ * });
353
+ * ```
354
+ */
355
+ export declare class MillionMoney_json {
356
+ private contract;
357
+ private contractAddress;
358
+ private publicClient;
359
+ constructor(address: Address, clients: {
360
+ publicClient: PublicClient;
361
+ walletClient?: WalletClient;
362
+ });
363
+ /**
364
+ * Get the contract address
365
+ */
366
+ get address(): Address;
367
+ /**
368
+ * Get the underlying viem contract instance
369
+ */
370
+ getContract(): MillionMoney_jsonContract;
371
+ /**
372
+ * findFreeReferrer
373
+ * view
374
+ */
375
+ findFreeReferrer(_user: `0x${string}`): Promise<`0x${string}`>;
376
+ /**
377
+ * viewUserReferral
378
+ * view
379
+ */
380
+ viewUserReferral(_user: `0x${string}`): Promise<`0x${string}`[]>;
381
+ /**
382
+ * LEVEL_PRICE
383
+ * view
384
+ */
385
+ LEVEL_PRICE(arg0: bigint): Promise<bigint>;
386
+ /**
387
+ * oldSC
388
+ * view
389
+ */
390
+ oldSC(): Promise<`0x${string}`>;
391
+ /**
392
+ * ownerWallet
393
+ * view
394
+ */
395
+ ownerWallet(): Promise<`0x${string}`>;
396
+ /**
397
+ * userList
398
+ * view
399
+ */
400
+ userList(arg0: bigint): Promise<`0x${string}`>;
401
+ /**
402
+ * currUserID
403
+ * view
404
+ */
405
+ currUserID(): Promise<bigint>;
406
+ /**
407
+ * users
408
+ * view
409
+ */
410
+ users(arg0: `0x${string}`): Promise<[boolean, bigint, bigint]>;
411
+ /**
412
+ * viewUserLevelExpired
413
+ * view
414
+ */
415
+ viewUserLevelExpired(_user: `0x${string}`, _level: bigint): Promise<bigint>;
416
+ /**
417
+ * syncClose
418
+ * nonpayable
419
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
420
+ */
421
+ syncClose(options?: {
422
+ accessList?: import('viem').AccessList;
423
+ authorizationList?: import('viem').AuthorizationList;
424
+ chain?: import('viem').Chain | null;
425
+ dataSuffix?: `0x${string}`;
426
+ gas?: bigint;
427
+ gasPrice?: bigint;
428
+ maxFeePerGas?: bigint;
429
+ maxPriorityFeePerGas?: bigint;
430
+ nonce?: number;
431
+ value?: bigint;
432
+ }): Promise<`0x${string}`>;
433
+ /**
434
+ * regUser
435
+ * payable
436
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
437
+ */
438
+ regUser(_referrerID: bigint, options?: {
439
+ accessList?: import('viem').AccessList;
440
+ authorizationList?: import('viem').AuthorizationList;
441
+ chain?: import('viem').Chain | null;
442
+ dataSuffix?: `0x${string}`;
443
+ gas?: bigint;
444
+ gasPrice?: bigint;
445
+ maxFeePerGas?: bigint;
446
+ maxPriorityFeePerGas?: bigint;
447
+ nonce?: number;
448
+ value?: bigint;
449
+ }): Promise<`0x${string}`>;
450
+ /**
451
+ * syncWithOldSC
452
+ * nonpayable
453
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
454
+ */
455
+ syncWithOldSC(limit: bigint, options?: {
456
+ accessList?: import('viem').AccessList;
457
+ authorizationList?: import('viem').AuthorizationList;
458
+ chain?: import('viem').Chain | null;
459
+ dataSuffix?: `0x${string}`;
460
+ gas?: bigint;
461
+ gasPrice?: bigint;
462
+ maxFeePerGas?: bigint;
463
+ maxPriorityFeePerGas?: bigint;
464
+ nonce?: number;
465
+ value?: bigint;
466
+ }): Promise<`0x${string}`>;
467
+ /**
468
+ * buyLevel
469
+ * payable
470
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
471
+ */
472
+ buyLevel(_level: bigint, options?: {
473
+ accessList?: import('viem').AccessList;
474
+ authorizationList?: import('viem').AuthorizationList;
475
+ chain?: import('viem').Chain | null;
476
+ dataSuffix?: `0x${string}`;
477
+ gas?: bigint;
478
+ gasPrice?: bigint;
479
+ maxFeePerGas?: bigint;
480
+ maxPriorityFeePerGas?: bigint;
481
+ nonce?: number;
482
+ value?: bigint;
483
+ }): Promise<`0x${string}`>;
484
+ /**
485
+ * Simulate contract write operations (dry-run without sending transaction)
486
+ *
487
+ * @example
488
+ * const result = await contract.simulate.transfer('0x...', 1000n);
489
+ * console.log('Gas estimate:', result.request.gas);
490
+ * console.log('Would succeed:', result.result);
491
+ */
492
+ get simulate(): {
493
+ /**
494
+ * Simulate syncClose
495
+ * Returns gas estimate and result without sending transaction
496
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
497
+ */
498
+ syncClose(options?: {
499
+ accessList?: import("viem").AccessList;
500
+ authorizationList?: import("viem").AuthorizationList;
501
+ chain?: import("viem").Chain | null;
502
+ dataSuffix?: `0x${string}`;
503
+ gas?: bigint;
504
+ gasPrice?: bigint;
505
+ maxFeePerGas?: bigint;
506
+ maxPriorityFeePerGas?: bigint;
507
+ nonce?: number;
508
+ value?: bigint;
509
+ }): Promise<void>;
510
+ /**
511
+ * Simulate regUser
512
+ * Returns gas estimate and result without sending transaction
513
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
514
+ */
515
+ regUser(_referrerID: bigint, options?: {
516
+ accessList?: import("viem").AccessList;
517
+ authorizationList?: import("viem").AuthorizationList;
518
+ chain?: import("viem").Chain | null;
519
+ dataSuffix?: `0x${string}`;
520
+ gas?: bigint;
521
+ gasPrice?: bigint;
522
+ maxFeePerGas?: bigint;
523
+ maxPriorityFeePerGas?: bigint;
524
+ nonce?: number;
525
+ value?: bigint;
526
+ }): Promise<void>;
527
+ /**
528
+ * Simulate syncWithOldSC
529
+ * Returns gas estimate and result without sending transaction
530
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
531
+ */
532
+ syncWithOldSC(limit: bigint, options?: {
533
+ accessList?: import("viem").AccessList;
534
+ authorizationList?: import("viem").AuthorizationList;
535
+ chain?: import("viem").Chain | null;
536
+ dataSuffix?: `0x${string}`;
537
+ gas?: bigint;
538
+ gasPrice?: bigint;
539
+ maxFeePerGas?: bigint;
540
+ maxPriorityFeePerGas?: bigint;
541
+ nonce?: number;
542
+ value?: bigint;
543
+ }): Promise<void>;
544
+ /**
545
+ * Simulate buyLevel
546
+ * Returns gas estimate and result without sending transaction
547
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
548
+ */
549
+ buyLevel(_level: bigint, options?: {
550
+ accessList?: import("viem").AccessList;
551
+ authorizationList?: import("viem").AuthorizationList;
552
+ chain?: import("viem").Chain | null;
553
+ dataSuffix?: `0x${string}`;
554
+ gas?: bigint;
555
+ gasPrice?: bigint;
556
+ maxFeePerGas?: bigint;
557
+ maxPriorityFeePerGas?: bigint;
558
+ nonce?: number;
559
+ value?: bigint;
560
+ }): Promise<void>;
561
+ };
562
+ /**
563
+ * Watch contract events
564
+ *
565
+ * @example
566
+ * // Watch all Transfer events
567
+ * const unwatch = contract.watch.Transfer((event) => {
568
+ * console.log('Transfer:', event);
569
+ * });
570
+ *
571
+ * // Stop watching
572
+ * unwatch();
573
+ */
574
+ get watch(): {
575
+ /**
576
+ * Watch regLevelEvent events
577
+ * @param callback Function to call when event is emitted
578
+ * @param filter Optional filter for indexed parameters
579
+ * @returns Unwatch function to stop listening
580
+ */
581
+ regLevelEvent: (callback: (event: {
582
+ _user: `0x${string}`;
583
+ _referrer: `0x${string}`;
584
+ _time: bigint;
585
+ }) => void, filter?: {
586
+ _user: `0x${string}`;
587
+ _referrer: `0x${string}`;
588
+ }) => () => void;
589
+ /**
590
+ * Watch buyLevelEvent events
591
+ * @param callback Function to call when event is emitted
592
+ * @param filter Optional filter for indexed parameters
593
+ * @returns Unwatch function to stop listening
594
+ */
595
+ buyLevelEvent: (callback: (event: {
596
+ _user: `0x${string}`;
597
+ _level: bigint;
598
+ _time: bigint;
599
+ }) => void, filter?: {
600
+ _user: `0x${string}`;
601
+ }) => () => void;
602
+ /**
603
+ * Watch prolongateLevelEvent events
604
+ * @param callback Function to call when event is emitted
605
+ * @param filter Optional filter for indexed parameters
606
+ * @returns Unwatch function to stop listening
607
+ */
608
+ prolongateLevelEvent: (callback: (event: {
609
+ _user: `0x${string}`;
610
+ _level: bigint;
611
+ _time: bigint;
612
+ }) => void, filter?: {
613
+ _user: `0x${string}`;
614
+ }) => () => void;
615
+ /**
616
+ * Watch getMoneyForLevelEvent events
617
+ * @param callback Function to call when event is emitted
618
+ * @param filter Optional filter for indexed parameters
619
+ * @returns Unwatch function to stop listening
620
+ */
621
+ getMoneyForLevelEvent: (callback: (event: {
622
+ _user: `0x${string}`;
623
+ _referral: `0x${string}`;
624
+ _level: bigint;
625
+ _time: bigint;
626
+ }) => void, filter?: {
627
+ _user: `0x${string}`;
628
+ _referral: `0x${string}`;
629
+ }) => () => void;
630
+ /**
631
+ * Watch lostMoneyForLevelEvent events
632
+ * @param callback Function to call when event is emitted
633
+ * @param filter Optional filter for indexed parameters
634
+ * @returns Unwatch function to stop listening
635
+ */
636
+ lostMoneyForLevelEvent: (callback: (event: {
637
+ _user: `0x${string}`;
638
+ _referral: `0x${string}`;
639
+ _level: bigint;
640
+ _time: bigint;
641
+ }) => void, filter?: {
642
+ _user: `0x${string}`;
643
+ _referral: `0x${string}`;
644
+ }) => () => void;
645
+ };
646
+ }