@gitmyabi/bmt 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.
package/README.md CHANGED
@@ -1,3 +1,108 @@
1
- # Temporary Holding Version
1
+ # @gitmyabi/bmt
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Auto-generated TypeScript type bindings for **BMT**
4
+
5
+ - **Build ID**: `etherscan-bmt-f028adee-1793442908170`
6
+ - **Build Number**: 1
7
+ - **Commit**: `75f5ac2`
8
+ - **Branch**: `etherscan`
9
+ - **Target**: `ethers-v6`
10
+ - **Contracts**: 1
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @gitmyabi/bmt@1.0.0
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### Class-based API (TypeChain-like)
21
+
22
+ ```typescript
23
+ import { createPublicClient, createWalletClient, http } from 'viem';
24
+ import { mainnet } from 'viem/chains';
25
+ import { YourContract } from '@gitmyabi/bmt';
26
+
27
+ const publicClient = createPublicClient({ chain: mainnet, transport: http() });
28
+ const walletClient = createWalletClient({ chain: mainnet, transport: http() });
29
+
30
+ // Create contract instance
31
+ const contract = new YourContract('0x...', { publicClient, walletClient });
32
+
33
+ // Read functions - call directly like TypeChain!
34
+ const result = await contract.yourMethod(param1, param2);
35
+
36
+ // Write functions - also call directly!
37
+ const hash = await contract.transfer('0x...', 1000n);
38
+ ```
39
+
40
+ ### With viem directly
41
+
42
+ ```typescript
43
+ import { createPublicClient, http } from 'viem';
44
+ import { mainnet } from 'viem/chains';
45
+ import { YourContractAbi } from '@gitmyabi/bmt';
46
+
47
+ const client = createPublicClient({
48
+ chain: mainnet,
49
+ transport: http(),
50
+ });
51
+
52
+ // Fully typed contract read
53
+ const result = await client.readContract({
54
+ address: '0x...',
55
+ abi: YourContractAbi,
56
+ functionName: 'yourMethod',
57
+ args: [param1, param2],
58
+ });
59
+
60
+ // Fully typed contract write
61
+ const hash = await client.writeContract({
62
+ address: '0x...',
63
+ abi: YourContractAbi,
64
+ functionName: 'yourMethod',
65
+ args: [param1, param2],
66
+ });
67
+ ```
68
+
69
+ ### With wagmi
70
+
71
+ ```typescript
72
+ import { useReadContract, useWriteContract } from 'wagmi';
73
+ import { YourContractAbi } from '@gitmyabi/bmt';
74
+
75
+ function MyComponent() {
76
+ const { data } = useReadContract({
77
+ address: '0x...',
78
+ abi: YourContractAbi,
79
+ functionName: 'yourMethod',
80
+ args: [param1, param2],
81
+ });
82
+
83
+ const { writeContract } = useWriteContract();
84
+
85
+ const handleWrite = () => {
86
+ writeContract({
87
+ address: '0x...',
88
+ abi: YourContractAbi,
89
+ functionName: 'yourMethod',
90
+ args: [param1, param2],
91
+ });
92
+ };
93
+
94
+ return <button onClick={handleWrite}>Call Contract</button>;
95
+ }
96
+ ```
97
+
98
+ ## Type Safety
99
+
100
+ This package provides full TypeScript type safety for all contract methods, events, and parameters using viem's type system. All ABIs are exported as `const` assertions for maximum type inference.
101
+
102
+ ## Generated Contracts
103
+
104
+ This package includes type bindings for 1 contract(s) generated from ABI artifacts.
105
+
106
+ ## License
107
+
108
+ MIT
@@ -0,0 +1,570 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * BMToken_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const BMToken_jsonAbi: readonly [{
8
+ readonly constant: true;
9
+ readonly inputs: readonly [];
10
+ readonly name: "name";
11
+ readonly outputs: readonly [{
12
+ readonly name: "";
13
+ readonly type: "string";
14
+ }];
15
+ readonly payable: false;
16
+ readonly stateMutability: "view";
17
+ readonly type: "function";
18
+ }, {
19
+ readonly constant: false;
20
+ readonly inputs: readonly [{
21
+ readonly name: "where";
22
+ readonly type: "address";
23
+ }, {
24
+ readonly name: "amount";
25
+ readonly type: "uint256";
26
+ }];
27
+ readonly name: "approve";
28
+ readonly outputs: readonly [{
29
+ readonly name: "";
30
+ readonly type: "bool";
31
+ }];
32
+ readonly payable: false;
33
+ readonly stateMutability: "nonpayable";
34
+ readonly type: "function";
35
+ }, {
36
+ readonly constant: true;
37
+ readonly inputs: readonly [];
38
+ readonly name: "totalSupply";
39
+ readonly outputs: readonly [{
40
+ readonly name: "";
41
+ readonly type: "uint256";
42
+ }];
43
+ readonly payable: false;
44
+ readonly stateMutability: "view";
45
+ readonly type: "function";
46
+ }, {
47
+ readonly constant: false;
48
+ readonly inputs: readonly [{
49
+ readonly name: "src";
50
+ readonly type: "address";
51
+ }, {
52
+ readonly name: "where";
53
+ readonly type: "address";
54
+ }, {
55
+ readonly name: "amount";
56
+ readonly type: "uint256";
57
+ }];
58
+ readonly name: "transferFrom";
59
+ readonly outputs: readonly [{
60
+ readonly name: "";
61
+ readonly type: "bool";
62
+ }];
63
+ readonly payable: false;
64
+ readonly stateMutability: "nonpayable";
65
+ readonly type: "function";
66
+ }, {
67
+ readonly constant: false;
68
+ readonly inputs: readonly [{
69
+ readonly name: "new_address";
70
+ readonly type: "address";
71
+ }];
72
+ readonly name: "setICOContract";
73
+ readonly outputs: readonly [];
74
+ readonly payable: false;
75
+ readonly stateMutability: "nonpayable";
76
+ readonly type: "function";
77
+ }, {
78
+ readonly constant: true;
79
+ readonly inputs: readonly [];
80
+ readonly name: "decimals";
81
+ readonly outputs: readonly [{
82
+ readonly name: "";
83
+ readonly type: "uint256";
84
+ }];
85
+ readonly payable: false;
86
+ readonly stateMutability: "view";
87
+ readonly type: "function";
88
+ }, {
89
+ readonly constant: true;
90
+ readonly inputs: readonly [{
91
+ readonly name: "src";
92
+ readonly type: "address";
93
+ }];
94
+ readonly name: "balanceOf";
95
+ readonly outputs: readonly [{
96
+ readonly name: "";
97
+ readonly type: "uint256";
98
+ }];
99
+ readonly payable: false;
100
+ readonly stateMutability: "view";
101
+ readonly type: "function";
102
+ }, {
103
+ readonly constant: true;
104
+ readonly inputs: readonly [];
105
+ readonly name: "owner";
106
+ readonly outputs: readonly [{
107
+ readonly name: "";
108
+ readonly type: "address";
109
+ }];
110
+ readonly payable: false;
111
+ readonly stateMutability: "view";
112
+ readonly type: "function";
113
+ }, {
114
+ readonly constant: true;
115
+ readonly inputs: readonly [];
116
+ readonly name: "symbol";
117
+ readonly outputs: readonly [{
118
+ readonly name: "";
119
+ readonly type: "string";
120
+ }];
121
+ readonly payable: false;
122
+ readonly stateMutability: "view";
123
+ readonly type: "function";
124
+ }, {
125
+ readonly constant: false;
126
+ readonly inputs: readonly [{
127
+ readonly name: "new_owner";
128
+ readonly type: "address";
129
+ }];
130
+ readonly name: "changeOwner";
131
+ readonly outputs: readonly [];
132
+ readonly payable: false;
133
+ readonly stateMutability: "nonpayable";
134
+ readonly type: "function";
135
+ }, {
136
+ readonly constant: false;
137
+ readonly inputs: readonly [{
138
+ readonly name: "where";
139
+ readonly type: "address";
140
+ }, {
141
+ readonly name: "amount";
142
+ readonly type: "uint256";
143
+ }];
144
+ readonly name: "transfer";
145
+ readonly outputs: readonly [{
146
+ readonly name: "";
147
+ readonly type: "bool";
148
+ }];
149
+ readonly payable: false;
150
+ readonly stateMutability: "nonpayable";
151
+ readonly type: "function";
152
+ }, {
153
+ readonly constant: true;
154
+ readonly inputs: readonly [{
155
+ readonly name: "src";
156
+ readonly type: "address";
157
+ }, {
158
+ readonly name: "where";
159
+ readonly type: "address";
160
+ }];
161
+ readonly name: "allowance";
162
+ readonly outputs: readonly [{
163
+ readonly name: "";
164
+ readonly type: "uint256";
165
+ }];
166
+ readonly payable: false;
167
+ readonly stateMutability: "view";
168
+ readonly type: "function";
169
+ }, {
170
+ readonly constant: false;
171
+ readonly inputs: readonly [{
172
+ readonly name: "holder";
173
+ readonly type: "address";
174
+ }, {
175
+ readonly name: "amount";
176
+ readonly type: "uint256";
177
+ }];
178
+ readonly name: "mintTokens";
179
+ readonly outputs: readonly [];
180
+ readonly payable: false;
181
+ readonly stateMutability: "nonpayable";
182
+ readonly type: "function";
183
+ }, {
184
+ readonly inputs: readonly [];
185
+ readonly payable: false;
186
+ readonly stateMutability: "nonpayable";
187
+ readonly type: "constructor";
188
+ }, {
189
+ readonly anonymous: false;
190
+ readonly inputs: readonly [{
191
+ readonly indexed: true;
192
+ readonly name: "from";
193
+ readonly type: "address";
194
+ }, {
195
+ readonly indexed: true;
196
+ readonly name: "to";
197
+ readonly type: "address";
198
+ }, {
199
+ readonly indexed: false;
200
+ readonly name: "value";
201
+ readonly type: "uint256";
202
+ }];
203
+ readonly name: "Transfer";
204
+ readonly type: "event";
205
+ }, {
206
+ readonly anonymous: false;
207
+ readonly inputs: readonly [{
208
+ readonly indexed: true;
209
+ readonly name: "owner";
210
+ readonly type: "address";
211
+ }, {
212
+ readonly indexed: true;
213
+ readonly name: "spender";
214
+ readonly type: "address";
215
+ }, {
216
+ readonly indexed: false;
217
+ readonly name: "value";
218
+ readonly type: "uint256";
219
+ }];
220
+ readonly name: "Approval";
221
+ readonly type: "event";
222
+ }];
223
+ /**
224
+ * Type-safe ABI for BMToken_json
225
+ */
226
+ export type BMToken_jsonAbi = typeof BMToken_jsonAbi;
227
+ /**
228
+ * Contract instance type for BMToken_json
229
+ */
230
+ export type BMToken_jsonContract = any;
231
+ /**
232
+ * BMToken_json Contract Class
233
+ *
234
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
235
+ *
236
+ * @example
237
+ * ```typescript
238
+ * import { createPublicClient, createWalletClient, http } from 'viem';
239
+ * import { mainnet } from 'viem/chains';
240
+ * import { BMToken_json } from 'BMToken_json';
241
+ *
242
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
243
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
244
+ *
245
+ * const contract = new BMToken_json('0x...', { publicClient, walletClient });
246
+ *
247
+ * // Read functions
248
+ * const result = await contract.balanceOf('0x...');
249
+ *
250
+ * // Write functions
251
+ * const hash = await contract.transfer('0x...', 1000n);
252
+ *
253
+ * // Simulate transactions (dry-run)
254
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
255
+ * console.log('Gas estimate:', simulation.request.gas);
256
+ *
257
+ * // Watch events
258
+ * const unwatch = contract.watch.Transfer((event) => {
259
+ * console.log('Transfer event:', event);
260
+ * });
261
+ * ```
262
+ */
263
+ export declare class BMToken_json {
264
+ private contract;
265
+ private contractAddress;
266
+ private publicClient;
267
+ constructor(address: Address, clients: {
268
+ publicClient: PublicClient;
269
+ walletClient?: WalletClient;
270
+ });
271
+ /**
272
+ * Get the contract address
273
+ */
274
+ get address(): Address;
275
+ /**
276
+ * Get the underlying viem contract instance
277
+ */
278
+ getContract(): BMToken_jsonContract;
279
+ /**
280
+ * name
281
+ * view
282
+ */
283
+ name(): Promise<string>;
284
+ /**
285
+ * totalSupply
286
+ * view
287
+ */
288
+ totalSupply(): Promise<bigint>;
289
+ /**
290
+ * decimals
291
+ * view
292
+ */
293
+ decimals(): Promise<bigint>;
294
+ /**
295
+ * balanceOf
296
+ * view
297
+ */
298
+ balanceOf(src: `0x${string}`): Promise<bigint>;
299
+ /**
300
+ * owner
301
+ * view
302
+ */
303
+ owner(): Promise<`0x${string}`>;
304
+ /**
305
+ * symbol
306
+ * view
307
+ */
308
+ symbol(): Promise<string>;
309
+ /**
310
+ * allowance
311
+ * view
312
+ */
313
+ allowance(src: `0x${string}`, where: `0x${string}`): Promise<bigint>;
314
+ /**
315
+ * approve
316
+ * nonpayable
317
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
318
+ */
319
+ approve(where: `0x${string}`, amount: bigint, options?: {
320
+ accessList?: import('viem').AccessList;
321
+ authorizationList?: import('viem').AuthorizationList;
322
+ chain?: import('viem').Chain | null;
323
+ dataSuffix?: `0x${string}`;
324
+ gas?: bigint;
325
+ gasPrice?: bigint;
326
+ maxFeePerGas?: bigint;
327
+ maxPriorityFeePerGas?: bigint;
328
+ nonce?: number;
329
+ value?: bigint;
330
+ }): Promise<`0x${string}`>;
331
+ /**
332
+ * transferFrom
333
+ * nonpayable
334
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
335
+ */
336
+ transferFrom(src: `0x${string}`, where: `0x${string}`, amount: bigint, options?: {
337
+ accessList?: import('viem').AccessList;
338
+ authorizationList?: import('viem').AuthorizationList;
339
+ chain?: import('viem').Chain | null;
340
+ dataSuffix?: `0x${string}`;
341
+ gas?: bigint;
342
+ gasPrice?: bigint;
343
+ maxFeePerGas?: bigint;
344
+ maxPriorityFeePerGas?: bigint;
345
+ nonce?: number;
346
+ value?: bigint;
347
+ }): Promise<`0x${string}`>;
348
+ /**
349
+ * setICOContract
350
+ * nonpayable
351
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
352
+ */
353
+ setICOContract(new_address: `0x${string}`, options?: {
354
+ accessList?: import('viem').AccessList;
355
+ authorizationList?: import('viem').AuthorizationList;
356
+ chain?: import('viem').Chain | null;
357
+ dataSuffix?: `0x${string}`;
358
+ gas?: bigint;
359
+ gasPrice?: bigint;
360
+ maxFeePerGas?: bigint;
361
+ maxPriorityFeePerGas?: bigint;
362
+ nonce?: number;
363
+ value?: bigint;
364
+ }): Promise<`0x${string}`>;
365
+ /**
366
+ * changeOwner
367
+ * nonpayable
368
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
369
+ */
370
+ changeOwner(new_owner: `0x${string}`, options?: {
371
+ accessList?: import('viem').AccessList;
372
+ authorizationList?: import('viem').AuthorizationList;
373
+ chain?: import('viem').Chain | null;
374
+ dataSuffix?: `0x${string}`;
375
+ gas?: bigint;
376
+ gasPrice?: bigint;
377
+ maxFeePerGas?: bigint;
378
+ maxPriorityFeePerGas?: bigint;
379
+ nonce?: number;
380
+ value?: bigint;
381
+ }): Promise<`0x${string}`>;
382
+ /**
383
+ * transfer
384
+ * nonpayable
385
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
386
+ */
387
+ transfer(where: `0x${string}`, amount: bigint, options?: {
388
+ accessList?: import('viem').AccessList;
389
+ authorizationList?: import('viem').AuthorizationList;
390
+ chain?: import('viem').Chain | null;
391
+ dataSuffix?: `0x${string}`;
392
+ gas?: bigint;
393
+ gasPrice?: bigint;
394
+ maxFeePerGas?: bigint;
395
+ maxPriorityFeePerGas?: bigint;
396
+ nonce?: number;
397
+ value?: bigint;
398
+ }): Promise<`0x${string}`>;
399
+ /**
400
+ * mintTokens
401
+ * nonpayable
402
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
403
+ */
404
+ mintTokens(holder: `0x${string}`, amount: bigint, options?: {
405
+ accessList?: import('viem').AccessList;
406
+ authorizationList?: import('viem').AuthorizationList;
407
+ chain?: import('viem').Chain | null;
408
+ dataSuffix?: `0x${string}`;
409
+ gas?: bigint;
410
+ gasPrice?: bigint;
411
+ maxFeePerGas?: bigint;
412
+ maxPriorityFeePerGas?: bigint;
413
+ nonce?: number;
414
+ value?: bigint;
415
+ }): Promise<`0x${string}`>;
416
+ /**
417
+ * Simulate contract write operations (dry-run without sending transaction)
418
+ *
419
+ * @example
420
+ * const result = await contract.simulate.transfer('0x...', 1000n);
421
+ * console.log('Gas estimate:', result.request.gas);
422
+ * console.log('Would succeed:', result.result);
423
+ */
424
+ get simulate(): {
425
+ /**
426
+ * Simulate approve
427
+ * Returns gas estimate and result without sending transaction
428
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
429
+ */
430
+ approve(where: `0x${string}`, amount: bigint, options?: {
431
+ accessList?: import("viem").AccessList;
432
+ authorizationList?: import("viem").AuthorizationList;
433
+ chain?: import("viem").Chain | null;
434
+ dataSuffix?: `0x${string}`;
435
+ gas?: bigint;
436
+ gasPrice?: bigint;
437
+ maxFeePerGas?: bigint;
438
+ maxPriorityFeePerGas?: bigint;
439
+ nonce?: number;
440
+ value?: bigint;
441
+ }): Promise<boolean>;
442
+ /**
443
+ * Simulate transferFrom
444
+ * Returns gas estimate and result without sending transaction
445
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
446
+ */
447
+ transferFrom(src: `0x${string}`, where: `0x${string}`, amount: bigint, options?: {
448
+ accessList?: import("viem").AccessList;
449
+ authorizationList?: import("viem").AuthorizationList;
450
+ chain?: import("viem").Chain | null;
451
+ dataSuffix?: `0x${string}`;
452
+ gas?: bigint;
453
+ gasPrice?: bigint;
454
+ maxFeePerGas?: bigint;
455
+ maxPriorityFeePerGas?: bigint;
456
+ nonce?: number;
457
+ value?: bigint;
458
+ }): Promise<boolean>;
459
+ /**
460
+ * Simulate setICOContract
461
+ * Returns gas estimate and result without sending transaction
462
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
463
+ */
464
+ setICOContract(new_address: `0x${string}`, options?: {
465
+ accessList?: import("viem").AccessList;
466
+ authorizationList?: import("viem").AuthorizationList;
467
+ chain?: import("viem").Chain | null;
468
+ dataSuffix?: `0x${string}`;
469
+ gas?: bigint;
470
+ gasPrice?: bigint;
471
+ maxFeePerGas?: bigint;
472
+ maxPriorityFeePerGas?: bigint;
473
+ nonce?: number;
474
+ value?: bigint;
475
+ }): Promise<void>;
476
+ /**
477
+ * Simulate changeOwner
478
+ * Returns gas estimate and result without sending transaction
479
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
480
+ */
481
+ changeOwner(new_owner: `0x${string}`, options?: {
482
+ accessList?: import("viem").AccessList;
483
+ authorizationList?: import("viem").AuthorizationList;
484
+ chain?: import("viem").Chain | null;
485
+ dataSuffix?: `0x${string}`;
486
+ gas?: bigint;
487
+ gasPrice?: bigint;
488
+ maxFeePerGas?: bigint;
489
+ maxPriorityFeePerGas?: bigint;
490
+ nonce?: number;
491
+ value?: bigint;
492
+ }): Promise<void>;
493
+ /**
494
+ * Simulate transfer
495
+ * Returns gas estimate and result without sending transaction
496
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
497
+ */
498
+ transfer(where: `0x${string}`, amount: bigint, 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<boolean>;
510
+ /**
511
+ * Simulate mintTokens
512
+ * Returns gas estimate and result without sending transaction
513
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
514
+ */
515
+ mintTokens(holder: `0x${string}`, amount: 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
+ /**
529
+ * Watch contract events
530
+ *
531
+ * @example
532
+ * // Watch all Transfer events
533
+ * const unwatch = contract.watch.Transfer((event) => {
534
+ * console.log('Transfer:', event);
535
+ * });
536
+ *
537
+ * // Stop watching
538
+ * unwatch();
539
+ */
540
+ get watch(): {
541
+ /**
542
+ * Watch Transfer events
543
+ * @param callback Function to call when event is emitted
544
+ * @param filter Optional filter for indexed parameters
545
+ * @returns Unwatch function to stop listening
546
+ */
547
+ Transfer: (callback: (event: {
548
+ from: `0x${string}`;
549
+ to: `0x${string}`;
550
+ value: bigint;
551
+ }) => void, filter?: {
552
+ from: `0x${string}`;
553
+ to: `0x${string}`;
554
+ }) => () => void;
555
+ /**
556
+ * Watch Approval events
557
+ * @param callback Function to call when event is emitted
558
+ * @param filter Optional filter for indexed parameters
559
+ * @returns Unwatch function to stop listening
560
+ */
561
+ Approval: (callback: (event: {
562
+ owner: `0x${string}`;
563
+ spender: `0x${string}`;
564
+ value: bigint;
565
+ }) => void, filter?: {
566
+ owner: `0x${string}`;
567
+ spender: `0x${string}`;
568
+ }) => () => void;
569
+ };
570
+ }