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