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