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