@gitmyabi/stakingmanager 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.
@@ -0,0 +1,256 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * TransparentUpgradeableProxy_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const TransparentUpgradeableProxy_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "_logic",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "address",
19
+ "name": "admin_",
20
+ "type": "address"
21
+ },
22
+ {
23
+ "internalType": "bytes",
24
+ "name": "_data",
25
+ "type": "bytes"
26
+ }
27
+ ],
28
+ "stateMutability": "payable",
29
+ "type": "constructor"
30
+ },
31
+ {
32
+ "anonymous": false,
33
+ "inputs": [
34
+ {
35
+ "indexed": false,
36
+ "internalType": "address",
37
+ "name": "previousAdmin",
38
+ "type": "address"
39
+ },
40
+ {
41
+ "indexed": false,
42
+ "internalType": "address",
43
+ "name": "newAdmin",
44
+ "type": "address"
45
+ }
46
+ ],
47
+ "name": "AdminChanged",
48
+ "type": "event"
49
+ },
50
+ {
51
+ "anonymous": false,
52
+ "inputs": [
53
+ {
54
+ "indexed": true,
55
+ "internalType": "address",
56
+ "name": "beacon",
57
+ "type": "address"
58
+ }
59
+ ],
60
+ "name": "BeaconUpgraded",
61
+ "type": "event"
62
+ },
63
+ {
64
+ "anonymous": false,
65
+ "inputs": [
66
+ {
67
+ "indexed": true,
68
+ "internalType": "address",
69
+ "name": "implementation",
70
+ "type": "address"
71
+ }
72
+ ],
73
+ "name": "Upgraded",
74
+ "type": "event"
75
+ },
76
+ {
77
+ "stateMutability": "payable",
78
+ "type": "fallback"
79
+ },
80
+ {
81
+ "stateMutability": "payable",
82
+ "type": "receive"
83
+ }
84
+ ] as const satisfies Abi;
85
+
86
+ /**
87
+ * Type-safe ABI for TransparentUpgradeableProxy_json
88
+ */
89
+ export type TransparentUpgradeableProxy_jsonAbi = typeof TransparentUpgradeableProxy_jsonAbi;
90
+
91
+ /**
92
+ * Contract instance type for TransparentUpgradeableProxy_json
93
+ */
94
+ // Use any for contract type to avoid complex viem type issues
95
+ // The runtime behavior is type-safe through viem's ABI typing
96
+ export type TransparentUpgradeableProxy_jsonContract = any;
97
+
98
+ /**
99
+ * TransparentUpgradeableProxy_json Contract Class
100
+ *
101
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * import { createPublicClient, createWalletClient, http } from 'viem';
106
+ * import { mainnet } from 'viem/chains';
107
+ * import { TransparentUpgradeableProxy_json } from 'TransparentUpgradeableProxy_json';
108
+ *
109
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
110
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
111
+ *
112
+ * const contract = new TransparentUpgradeableProxy_json('0x...', { publicClient, walletClient });
113
+ *
114
+ * // Read functions
115
+ * const result = await contract.balanceOf('0x...');
116
+ *
117
+ * // Write functions
118
+ * const hash = await contract.transfer('0x...', 1000n);
119
+ *
120
+ * // Simulate transactions (dry-run)
121
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
122
+ * console.log('Gas estimate:', simulation.request.gas);
123
+ *
124
+ * // Watch events
125
+ * const unwatch = contract.watch.Transfer((event) => {
126
+ * console.log('Transfer event:', event);
127
+ * });
128
+ * ```
129
+ */
130
+ export class TransparentUpgradeableProxy_json {
131
+ private contract: TransparentUpgradeableProxy_jsonContract;
132
+ private contractAddress: Address;
133
+ private publicClient: PublicClient;
134
+
135
+ constructor(
136
+ address: Address,
137
+ clients: {
138
+ publicClient: PublicClient;
139
+ walletClient?: WalletClient;
140
+ }
141
+ ) {
142
+ this.contractAddress = address;
143
+ this.publicClient = clients.publicClient;
144
+ this.contract = getContract({
145
+ address,
146
+ abi: TransparentUpgradeableProxy_jsonAbi,
147
+ client: {
148
+ public: clients.publicClient,
149
+ wallet: clients.walletClient,
150
+ },
151
+ });
152
+ }
153
+
154
+ /**
155
+ * Get the contract address
156
+ */
157
+ get address(): Address {
158
+ return this.contractAddress;
159
+ }
160
+
161
+ /**
162
+ * Get the underlying viem contract instance
163
+ */
164
+ getContract(): TransparentUpgradeableProxy_jsonContract {
165
+ return this.contract;
166
+ }
167
+
168
+ // No read functions
169
+
170
+ // No write functions
171
+
172
+
173
+
174
+ /**
175
+ * Simulate contract write operations (dry-run without sending transaction)
176
+ *
177
+ * Note: This contract has no write functions, so simulate returns an empty object.
178
+ */
179
+ get simulate() {
180
+ return {};
181
+ }
182
+
183
+ /**
184
+ * Watch contract events
185
+ *
186
+ * @example
187
+ * // Watch all Transfer events
188
+ * const unwatch = contract.watch.Transfer((event) => {
189
+ * console.log('Transfer:', event);
190
+ * });
191
+ *
192
+ * // Stop watching
193
+ * unwatch();
194
+ */
195
+ get watch() {
196
+ return {
197
+ /**
198
+ * Watch AdminChanged events
199
+ * @param callback Function to call when event is emitted
200
+ * @param filter Optional filter for indexed parameters
201
+ * @returns Unwatch function to stop listening
202
+ */
203
+ AdminChanged: (callback: (event: { previousAdmin: `0x${string}`; newAdmin: `0x${string}` }) => void) => {
204
+ return this.publicClient.watchContractEvent({
205
+ address: this.contractAddress,
206
+ abi: TransparentUpgradeableProxy_jsonAbi,
207
+ eventName: 'AdminChanged',
208
+
209
+ onLogs: (logs: any[]) => {
210
+ logs.forEach((log: any) => {
211
+ callback(log.args as any);
212
+ });
213
+ },
214
+ }) as () => void;
215
+ },
216
+ /**
217
+ * Watch BeaconUpgraded events
218
+ * @param callback Function to call when event is emitted
219
+ * @param filter Optional filter for indexed parameters
220
+ * @returns Unwatch function to stop listening
221
+ */
222
+ BeaconUpgraded: (callback: (event: { beacon: `0x${string}` }) => void, filter?: { beacon: `0x${string}` }) => {
223
+ return this.publicClient.watchContractEvent({
224
+ address: this.contractAddress,
225
+ abi: TransparentUpgradeableProxy_jsonAbi,
226
+ eventName: 'BeaconUpgraded',
227
+ args: filter,
228
+ onLogs: (logs: any[]) => {
229
+ logs.forEach((log: any) => {
230
+ callback(log.args as any);
231
+ });
232
+ },
233
+ }) as () => void;
234
+ },
235
+ /**
236
+ * Watch Upgraded events
237
+ * @param callback Function to call when event is emitted
238
+ * @param filter Optional filter for indexed parameters
239
+ * @returns Unwatch function to stop listening
240
+ */
241
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
242
+ return this.publicClient.watchContractEvent({
243
+ address: this.contractAddress,
244
+ abi: TransparentUpgradeableProxy_jsonAbi,
245
+ eventName: 'Upgraded',
246
+ args: filter,
247
+ onLogs: (logs: any[]) => {
248
+ logs.forEach((log: any) => {
249
+ callback(log.args as any);
250
+ });
251
+ },
252
+ }) as () => void;
253
+ }
254
+ };
255
+ }
256
+ }
@@ -0,0 +1,4 @@
1
+ export { TransparentUpgradeableProxy_jsonAbi, TransparentUpgradeableProxy_json } from './TransparentUpgradeableProxy_json';
2
+ export type { TransparentUpgradeableProxy_jsonAbi as TransparentUpgradeableProxy_jsonAbiType, TransparentUpgradeableProxy_jsonContract } from './TransparentUpgradeableProxy_json';
3
+ export { stakingManagerV2_jsonAbi, stakingManagerV2_json } from './stakingManagerV2_json';
4
+ export type { stakingManagerV2_jsonAbi as stakingManagerV2_jsonAbiType, stakingManagerV2_jsonContract } from './stakingManagerV2_json';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stakingManagerV2_json = exports.stakingManagerV2_jsonAbi = exports.TransparentUpgradeableProxy_json = exports.TransparentUpgradeableProxy_jsonAbi = void 0;
4
+ // Auto-generated exports for all contracts
5
+ var TransparentUpgradeableProxy_json_1 = require("./TransparentUpgradeableProxy_json");
6
+ Object.defineProperty(exports, "TransparentUpgradeableProxy_jsonAbi", { enumerable: true, get: function () { return TransparentUpgradeableProxy_json_1.TransparentUpgradeableProxy_jsonAbi; } });
7
+ Object.defineProperty(exports, "TransparentUpgradeableProxy_json", { enumerable: true, get: function () { return TransparentUpgradeableProxy_json_1.TransparentUpgradeableProxy_json; } });
8
+ var stakingManagerV2_json_1 = require("./stakingManagerV2_json");
9
+ Object.defineProperty(exports, "stakingManagerV2_jsonAbi", { enumerable: true, get: function () { return stakingManagerV2_json_1.stakingManagerV2_jsonAbi; } });
10
+ Object.defineProperty(exports, "stakingManagerV2_json", { enumerable: true, get: function () { return stakingManagerV2_json_1.stakingManagerV2_json; } });
@@ -0,0 +1,5 @@
1
+ // Auto-generated exports for all contracts
2
+ export { TransparentUpgradeableProxy_jsonAbi, TransparentUpgradeableProxy_json } from './TransparentUpgradeableProxy_json';
3
+ export type { TransparentUpgradeableProxy_jsonAbi as TransparentUpgradeableProxy_jsonAbiType, TransparentUpgradeableProxy_jsonContract } from './TransparentUpgradeableProxy_json';
4
+ export { stakingManagerV2_jsonAbi, stakingManagerV2_json } from './stakingManagerV2_json';
5
+ export type { stakingManagerV2_jsonAbi as stakingManagerV2_jsonAbiType, stakingManagerV2_jsonContract } from './stakingManagerV2_json';