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