@gitmyabi/cf 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/cf
2
+
3
+ Auto-generated TypeScript type bindings for **CF**
4
+
5
+ - **Build ID**: `etherscan-cf-343a1cae-1790104007878`
6
+ - **Build Number**: 1
7
+ - **Commit**: `11d8f0e`
8
+ - **Branch**: `etherscan`
9
+ - **Target**: `ethers-v6`
10
+ - **Contracts**: 2
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @gitmyabi/cf@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/cf';
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/cf';
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/cf';
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 2 contract(s) generated from ABI artifacts.
105
+
106
+ ## License
107
+
108
+ MIT
@@ -0,0 +1,380 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * AdminUpgradeabilityProxy_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const AdminUpgradeabilityProxy_jsonAbi: readonly [{
8
+ readonly inputs: readonly [{
9
+ readonly internalType: "address";
10
+ readonly name: "_logic";
11
+ readonly type: "address";
12
+ }, {
13
+ readonly internalType: "address";
14
+ readonly name: "_admin";
15
+ readonly type: "address";
16
+ }, {
17
+ readonly internalType: "bytes";
18
+ readonly name: "_data";
19
+ readonly type: "bytes";
20
+ }];
21
+ readonly stateMutability: "payable";
22
+ readonly type: "constructor";
23
+ }, {
24
+ readonly anonymous: false;
25
+ readonly inputs: readonly [{
26
+ readonly indexed: false;
27
+ readonly internalType: "address";
28
+ readonly name: "previousAdmin";
29
+ readonly type: "address";
30
+ }, {
31
+ readonly indexed: false;
32
+ readonly internalType: "address";
33
+ readonly name: "newAdmin";
34
+ readonly type: "address";
35
+ }];
36
+ readonly name: "AdminChanged";
37
+ readonly type: "event";
38
+ }, {
39
+ readonly anonymous: false;
40
+ readonly inputs: readonly [{
41
+ readonly indexed: true;
42
+ readonly internalType: "address";
43
+ readonly name: "implementation";
44
+ readonly type: "address";
45
+ }];
46
+ readonly name: "Upgraded";
47
+ readonly type: "event";
48
+ }, {
49
+ readonly stateMutability: "payable";
50
+ readonly type: "fallback";
51
+ }, {
52
+ readonly inputs: readonly [];
53
+ readonly name: "admin";
54
+ readonly outputs: readonly [{
55
+ readonly internalType: "address";
56
+ readonly name: "";
57
+ readonly type: "address";
58
+ }];
59
+ readonly stateMutability: "nonpayable";
60
+ readonly type: "function";
61
+ }, {
62
+ readonly inputs: readonly [{
63
+ readonly internalType: "address";
64
+ readonly name: "newAdmin";
65
+ readonly type: "address";
66
+ }];
67
+ readonly name: "changeAdmin";
68
+ readonly outputs: readonly [];
69
+ readonly stateMutability: "nonpayable";
70
+ readonly type: "function";
71
+ }, {
72
+ readonly inputs: readonly [];
73
+ readonly name: "implementation";
74
+ readonly outputs: readonly [{
75
+ readonly internalType: "address";
76
+ readonly name: "";
77
+ readonly type: "address";
78
+ }];
79
+ readonly stateMutability: "nonpayable";
80
+ readonly type: "function";
81
+ }, {
82
+ readonly inputs: readonly [{
83
+ readonly internalType: "address";
84
+ readonly name: "newImplementation";
85
+ readonly type: "address";
86
+ }];
87
+ readonly name: "upgradeTo";
88
+ readonly outputs: readonly [];
89
+ readonly stateMutability: "nonpayable";
90
+ readonly type: "function";
91
+ }, {
92
+ readonly inputs: readonly [{
93
+ readonly internalType: "address";
94
+ readonly name: "newImplementation";
95
+ readonly type: "address";
96
+ }, {
97
+ readonly internalType: "bytes";
98
+ readonly name: "data";
99
+ readonly type: "bytes";
100
+ }];
101
+ readonly name: "upgradeToAndCall";
102
+ readonly outputs: readonly [];
103
+ readonly stateMutability: "payable";
104
+ readonly type: "function";
105
+ }, {
106
+ readonly stateMutability: "payable";
107
+ readonly type: "receive";
108
+ }];
109
+ /**
110
+ * Type-safe ABI for AdminUpgradeabilityProxy_json
111
+ */
112
+ export type AdminUpgradeabilityProxy_jsonAbi = typeof AdminUpgradeabilityProxy_jsonAbi;
113
+ /**
114
+ * Contract instance type for AdminUpgradeabilityProxy_json
115
+ */
116
+ export type AdminUpgradeabilityProxy_jsonContract = any;
117
+ /**
118
+ * AdminUpgradeabilityProxy_json Contract Class
119
+ *
120
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * import { createPublicClient, createWalletClient, http } from 'viem';
125
+ * import { mainnet } from 'viem/chains';
126
+ * import { AdminUpgradeabilityProxy_json } from 'AdminUpgradeabilityProxy_json';
127
+ *
128
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
129
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
130
+ *
131
+ * const contract = new AdminUpgradeabilityProxy_json('0x...', { publicClient, walletClient });
132
+ *
133
+ * // Read functions
134
+ * const result = await contract.balanceOf('0x...');
135
+ *
136
+ * // Write functions
137
+ * const hash = await contract.transfer('0x...', 1000n);
138
+ *
139
+ * // Simulate transactions (dry-run)
140
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
141
+ * console.log('Gas estimate:', simulation.request.gas);
142
+ *
143
+ * // Watch events
144
+ * const unwatch = contract.watch.Transfer((event) => {
145
+ * console.log('Transfer event:', event);
146
+ * });
147
+ * ```
148
+ */
149
+ export declare class AdminUpgradeabilityProxy_json {
150
+ private contract;
151
+ private contractAddress;
152
+ private publicClient;
153
+ constructor(address: Address, clients: {
154
+ publicClient: PublicClient;
155
+ walletClient?: WalletClient;
156
+ });
157
+ /**
158
+ * Get the contract address
159
+ */
160
+ get address(): Address;
161
+ /**
162
+ * Get the underlying viem contract instance
163
+ */
164
+ getContract(): AdminUpgradeabilityProxy_jsonContract;
165
+ /**
166
+ * admin
167
+ * nonpayable
168
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
169
+ */
170
+ admin(options?: {
171
+ accessList?: import('viem').AccessList;
172
+ authorizationList?: import('viem').AuthorizationList;
173
+ chain?: import('viem').Chain | null;
174
+ dataSuffix?: `0x${string}`;
175
+ gas?: bigint;
176
+ gasPrice?: bigint;
177
+ maxFeePerGas?: bigint;
178
+ maxPriorityFeePerGas?: bigint;
179
+ nonce?: number;
180
+ value?: bigint;
181
+ }): Promise<`0x${string}`>;
182
+ /**
183
+ * changeAdmin
184
+ * nonpayable
185
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
186
+ */
187
+ changeAdmin(newAdmin: `0x${string}`, options?: {
188
+ accessList?: import('viem').AccessList;
189
+ authorizationList?: import('viem').AuthorizationList;
190
+ chain?: import('viem').Chain | null;
191
+ dataSuffix?: `0x${string}`;
192
+ gas?: bigint;
193
+ gasPrice?: bigint;
194
+ maxFeePerGas?: bigint;
195
+ maxPriorityFeePerGas?: bigint;
196
+ nonce?: number;
197
+ value?: bigint;
198
+ }): Promise<`0x${string}`>;
199
+ /**
200
+ * implementation
201
+ * nonpayable
202
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
203
+ */
204
+ implementation(options?: {
205
+ accessList?: import('viem').AccessList;
206
+ authorizationList?: import('viem').AuthorizationList;
207
+ chain?: import('viem').Chain | null;
208
+ dataSuffix?: `0x${string}`;
209
+ gas?: bigint;
210
+ gasPrice?: bigint;
211
+ maxFeePerGas?: bigint;
212
+ maxPriorityFeePerGas?: bigint;
213
+ nonce?: number;
214
+ value?: bigint;
215
+ }): Promise<`0x${string}`>;
216
+ /**
217
+ * upgradeTo
218
+ * nonpayable
219
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
220
+ */
221
+ upgradeTo(newImplementation: `0x${string}`, options?: {
222
+ accessList?: import('viem').AccessList;
223
+ authorizationList?: import('viem').AuthorizationList;
224
+ chain?: import('viem').Chain | null;
225
+ dataSuffix?: `0x${string}`;
226
+ gas?: bigint;
227
+ gasPrice?: bigint;
228
+ maxFeePerGas?: bigint;
229
+ maxPriorityFeePerGas?: bigint;
230
+ nonce?: number;
231
+ value?: bigint;
232
+ }): Promise<`0x${string}`>;
233
+ /**
234
+ * upgradeToAndCall
235
+ * payable
236
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
237
+ */
238
+ upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
239
+ accessList?: import('viem').AccessList;
240
+ authorizationList?: import('viem').AuthorizationList;
241
+ chain?: import('viem').Chain | null;
242
+ dataSuffix?: `0x${string}`;
243
+ gas?: bigint;
244
+ gasPrice?: bigint;
245
+ maxFeePerGas?: bigint;
246
+ maxPriorityFeePerGas?: bigint;
247
+ nonce?: number;
248
+ value?: bigint;
249
+ }): Promise<`0x${string}`>;
250
+ /**
251
+ * Simulate contract write operations (dry-run without sending transaction)
252
+ *
253
+ * @example
254
+ * const result = await contract.simulate.transfer('0x...', 1000n);
255
+ * console.log('Gas estimate:', result.request.gas);
256
+ * console.log('Would succeed:', result.result);
257
+ */
258
+ get simulate(): {
259
+ /**
260
+ * Simulate admin
261
+ * Returns gas estimate and result without sending transaction
262
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
263
+ */
264
+ admin(options?: {
265
+ accessList?: import("viem").AccessList;
266
+ authorizationList?: import("viem").AuthorizationList;
267
+ chain?: import("viem").Chain | null;
268
+ dataSuffix?: `0x${string}`;
269
+ gas?: bigint;
270
+ gasPrice?: bigint;
271
+ maxFeePerGas?: bigint;
272
+ maxPriorityFeePerGas?: bigint;
273
+ nonce?: number;
274
+ value?: bigint;
275
+ }): Promise<`0x${string}`>;
276
+ /**
277
+ * Simulate changeAdmin
278
+ * Returns gas estimate and result without sending transaction
279
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
280
+ */
281
+ changeAdmin(newAdmin: `0x${string}`, options?: {
282
+ accessList?: import("viem").AccessList;
283
+ authorizationList?: import("viem").AuthorizationList;
284
+ chain?: import("viem").Chain | null;
285
+ dataSuffix?: `0x${string}`;
286
+ gas?: bigint;
287
+ gasPrice?: bigint;
288
+ maxFeePerGas?: bigint;
289
+ maxPriorityFeePerGas?: bigint;
290
+ nonce?: number;
291
+ value?: bigint;
292
+ }): Promise<void>;
293
+ /**
294
+ * Simulate implementation
295
+ * Returns gas estimate and result without sending transaction
296
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
297
+ */
298
+ implementation(options?: {
299
+ accessList?: import("viem").AccessList;
300
+ authorizationList?: import("viem").AuthorizationList;
301
+ chain?: import("viem").Chain | null;
302
+ dataSuffix?: `0x${string}`;
303
+ gas?: bigint;
304
+ gasPrice?: bigint;
305
+ maxFeePerGas?: bigint;
306
+ maxPriorityFeePerGas?: bigint;
307
+ nonce?: number;
308
+ value?: bigint;
309
+ }): Promise<`0x${string}`>;
310
+ /**
311
+ * Simulate upgradeTo
312
+ * Returns gas estimate and result without sending transaction
313
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
314
+ */
315
+ upgradeTo(newImplementation: `0x${string}`, options?: {
316
+ accessList?: import("viem").AccessList;
317
+ authorizationList?: import("viem").AuthorizationList;
318
+ chain?: import("viem").Chain | null;
319
+ dataSuffix?: `0x${string}`;
320
+ gas?: bigint;
321
+ gasPrice?: bigint;
322
+ maxFeePerGas?: bigint;
323
+ maxPriorityFeePerGas?: bigint;
324
+ nonce?: number;
325
+ value?: bigint;
326
+ }): Promise<void>;
327
+ /**
328
+ * Simulate upgradeToAndCall
329
+ * Returns gas estimate and result without sending transaction
330
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
331
+ */
332
+ upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
333
+ accessList?: import("viem").AccessList;
334
+ authorizationList?: import("viem").AuthorizationList;
335
+ chain?: import("viem").Chain | null;
336
+ dataSuffix?: `0x${string}`;
337
+ gas?: bigint;
338
+ gasPrice?: bigint;
339
+ maxFeePerGas?: bigint;
340
+ maxPriorityFeePerGas?: bigint;
341
+ nonce?: number;
342
+ value?: bigint;
343
+ }): Promise<void>;
344
+ };
345
+ /**
346
+ * Watch contract events
347
+ *
348
+ * @example
349
+ * // Watch all Transfer events
350
+ * const unwatch = contract.watch.Transfer((event) => {
351
+ * console.log('Transfer:', event);
352
+ * });
353
+ *
354
+ * // Stop watching
355
+ * unwatch();
356
+ */
357
+ get watch(): {
358
+ /**
359
+ * Watch AdminChanged events
360
+ * @param callback Function to call when event is emitted
361
+ * @param filter Optional filter for indexed parameters
362
+ * @returns Unwatch function to stop listening
363
+ */
364
+ AdminChanged: (callback: (event: {
365
+ previousAdmin: `0x${string}`;
366
+ newAdmin: `0x${string}`;
367
+ }) => void) => () => void;
368
+ /**
369
+ * Watch Upgraded events
370
+ * @param callback Function to call when event is emitted
371
+ * @param filter Optional filter for indexed parameters
372
+ * @returns Unwatch function to stop listening
373
+ */
374
+ Upgraded: (callback: (event: {
375
+ implementation: `0x${string}`;
376
+ }) => void, filter?: {
377
+ implementation: `0x${string}`;
378
+ }) => () => void;
379
+ };
380
+ }