@gitmyabi/resilientoracle 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/resilientoracle
2
+
3
+ Auto-generated TypeScript type bindings for **ResilientOracle**
4
+
5
+ - **Build ID**: `etherscan-resilientoracle-d2ce3fb0-1788164218592`
6
+ - **Build Number**: 1
7
+ - **Commit**: `fc6e3a3`
8
+ - **Branch**: `etherscan`
9
+ - **Target**: `ethers-v6`
10
+ - **Contracts**: 2
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @gitmyabi/resilientoracle@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/resilientoracle';
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/resilientoracle';
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/resilientoracle';
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,357 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * OptimizedTransparentUpgradeableProxy_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const OptimizedTransparentUpgradeableProxy_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: "beacon";
44
+ readonly type: "address";
45
+ }];
46
+ readonly name: "BeaconUpgraded";
47
+ readonly type: "event";
48
+ }, {
49
+ readonly anonymous: false;
50
+ readonly inputs: readonly [{
51
+ readonly indexed: true;
52
+ readonly internalType: "address";
53
+ readonly name: "implementation";
54
+ readonly type: "address";
55
+ }];
56
+ readonly name: "Upgraded";
57
+ readonly type: "event";
58
+ }, {
59
+ readonly stateMutability: "payable";
60
+ readonly type: "fallback";
61
+ }, {
62
+ readonly inputs: readonly [];
63
+ readonly name: "admin";
64
+ readonly outputs: readonly [{
65
+ readonly internalType: "address";
66
+ readonly name: "admin_";
67
+ readonly type: "address";
68
+ }];
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: "implementation_";
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 OptimizedTransparentUpgradeableProxy_json
111
+ */
112
+ export type OptimizedTransparentUpgradeableProxy_jsonAbi = typeof OptimizedTransparentUpgradeableProxy_jsonAbi;
113
+ /**
114
+ * Contract instance type for OptimizedTransparentUpgradeableProxy_json
115
+ */
116
+ export type OptimizedTransparentUpgradeableProxy_jsonContract = any;
117
+ /**
118
+ * OptimizedTransparentUpgradeableProxy_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 { OptimizedTransparentUpgradeableProxy_json } from 'OptimizedTransparentUpgradeableProxy_json';
127
+ *
128
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
129
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
130
+ *
131
+ * const contract = new OptimizedTransparentUpgradeableProxy_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 OptimizedTransparentUpgradeableProxy_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(): OptimizedTransparentUpgradeableProxy_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
+ * implementation
184
+ * nonpayable
185
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
186
+ */
187
+ implementation(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
+ * upgradeTo
201
+ * nonpayable
202
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
203
+ */
204
+ upgradeTo(newImplementation: `0x${string}`, 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
+ * upgradeToAndCall
218
+ * payable
219
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
220
+ */
221
+ upgradeToAndCall(newImplementation: `0x${string}`, data: `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
+ * Simulate contract write operations (dry-run without sending transaction)
235
+ *
236
+ * @example
237
+ * const result = await contract.simulate.transfer('0x...', 1000n);
238
+ * console.log('Gas estimate:', result.request.gas);
239
+ * console.log('Would succeed:', result.result);
240
+ */
241
+ get simulate(): {
242
+ /**
243
+ * Simulate admin
244
+ * Returns gas estimate and result without sending transaction
245
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
246
+ */
247
+ admin(options?: {
248
+ accessList?: import("viem").AccessList;
249
+ authorizationList?: import("viem").AuthorizationList;
250
+ chain?: import("viem").Chain | null;
251
+ dataSuffix?: `0x${string}`;
252
+ gas?: bigint;
253
+ gasPrice?: bigint;
254
+ maxFeePerGas?: bigint;
255
+ maxPriorityFeePerGas?: bigint;
256
+ nonce?: number;
257
+ value?: bigint;
258
+ }): Promise<`0x${string}`>;
259
+ /**
260
+ * Simulate implementation
261
+ * Returns gas estimate and result without sending transaction
262
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
263
+ */
264
+ implementation(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 upgradeTo
278
+ * Returns gas estimate and result without sending transaction
279
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
280
+ */
281
+ upgradeTo(newImplementation: `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 upgradeToAndCall
295
+ * Returns gas estimate and result without sending transaction
296
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
297
+ */
298
+ upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, 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<void>;
310
+ };
311
+ /**
312
+ * Watch contract events
313
+ *
314
+ * @example
315
+ * // Watch all Transfer events
316
+ * const unwatch = contract.watch.Transfer((event) => {
317
+ * console.log('Transfer:', event);
318
+ * });
319
+ *
320
+ * // Stop watching
321
+ * unwatch();
322
+ */
323
+ get watch(): {
324
+ /**
325
+ * Watch AdminChanged events
326
+ * @param callback Function to call when event is emitted
327
+ * @param filter Optional filter for indexed parameters
328
+ * @returns Unwatch function to stop listening
329
+ */
330
+ AdminChanged: (callback: (event: {
331
+ previousAdmin: `0x${string}`;
332
+ newAdmin: `0x${string}`;
333
+ }) => void) => () => void;
334
+ /**
335
+ * Watch BeaconUpgraded events
336
+ * @param callback Function to call when event is emitted
337
+ * @param filter Optional filter for indexed parameters
338
+ * @returns Unwatch function to stop listening
339
+ */
340
+ BeaconUpgraded: (callback: (event: {
341
+ beacon: `0x${string}`;
342
+ }) => void, filter?: {
343
+ beacon: `0x${string}`;
344
+ }) => () => void;
345
+ /**
346
+ * Watch Upgraded events
347
+ * @param callback Function to call when event is emitted
348
+ * @param filter Optional filter for indexed parameters
349
+ * @returns Unwatch function to stop listening
350
+ */
351
+ Upgraded: (callback: (event: {
352
+ implementation: `0x${string}`;
353
+ }) => void, filter?: {
354
+ implementation: `0x${string}`;
355
+ }) => () => void;
356
+ };
357
+ }