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