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