genlayer-js 0.18.4 → 0.18.6

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/CLAUDE.md +66 -0
  3. package/README.md +52 -1
  4. package/dist/chains/index.cjs +2 -2
  5. package/dist/chains/index.d.cts +2 -2
  6. package/dist/chains/index.d.ts +2 -2
  7. package/dist/chains/index.js +1 -1
  8. package/dist/{chains-BIe_Q0mF.d.cts → chains-B7B7UXdn.d.cts} +6 -2
  9. package/dist/{chains-BIe_Q0mF.d.ts → chains-B7B7UXdn.d.ts} +6 -2
  10. package/dist/{chunk-NO75TOQL.js → chunk-KVHGQTAI.js} +539 -4
  11. package/dist/{chunk-SMGWE7OH.cjs → chunk-QAAO2WJL.cjs} +540 -5
  12. package/dist/index-3leEwFoq.d.cts +1389 -0
  13. package/dist/index-BBh1NZjP.d.ts +1389 -0
  14. package/dist/{index-C5zeayBB.d.cts → index-BVDASTaU.d.cts} +1 -1
  15. package/dist/{index-BpFWfpio.d.ts → index-ucNO2REF.d.ts} +1 -1
  16. package/dist/index.cjs +551 -38
  17. package/dist/index.d.cts +17 -5
  18. package/dist/index.d.ts +17 -5
  19. package/dist/index.js +528 -15
  20. package/dist/types/index.cjs +2 -2
  21. package/dist/types/index.d.cts +2 -2
  22. package/dist/types/index.d.ts +2 -2
  23. package/dist/types/index.js +1 -1
  24. package/package.json +1 -1
  25. package/src/abi/index.ts +1 -0
  26. package/src/abi/staking.ts +525 -0
  27. package/src/chains/localnet.ts +2 -1
  28. package/src/chains/studionet.ts +1 -0
  29. package/src/chains/testnetAsimov.ts +10 -3
  30. package/src/client/client.ts +17 -15
  31. package/src/index.ts +1 -0
  32. package/src/staking/actions.ts +609 -0
  33. package/src/staking/index.ts +2 -0
  34. package/src/staking/utils.ts +22 -0
  35. package/src/types/chains.ts +6 -2
  36. package/src/types/clients.ts +6 -6
  37. package/src/types/index.ts +1 -0
  38. package/src/types/staking.ts +228 -0
  39. package/tsconfig.vitest-temp.json +41 -0
  40. package/dist/index-B2AY6_eD.d.ts +0 -407
  41. package/dist/index-BYma5s90.d.cts +0 -407
  42. /package/dist/{chunk-FPZNF3JH.cjs → chunk-W4V73RPN.cjs} +0 -0
  43. /package/dist/{chunk-47QDX7IX.js → chunk-ZHBOSLFN.js} +0 -0
@@ -12,7 +12,7 @@
12
12
 
13
13
 
14
14
 
15
- var _chunkFPZNF3JHcjs = require('../chunk-FPZNF3JH.cjs');
15
+ var _chunkW4V73RPNcjs = require('../chunk-W4V73RPN.cjs');
16
16
  require('../chunk-75ZPJI57.cjs');
17
17
 
18
18
 
@@ -28,4 +28,4 @@ require('../chunk-75ZPJI57.cjs');
28
28
 
29
29
 
30
30
 
31
- exports.CalldataAddress = _chunkFPZNF3JHcjs.CalldataAddress; exports.DECIDED_STATES = _chunkFPZNF3JHcjs.DECIDED_STATES; exports.TransactionHashVariant = _chunkFPZNF3JHcjs.TransactionHashVariant; exports.TransactionResult = _chunkFPZNF3JHcjs.TransactionResult; exports.TransactionResultNameToNumber = _chunkFPZNF3JHcjs.TransactionResultNameToNumber; exports.TransactionStatus = _chunkFPZNF3JHcjs.TransactionStatus; exports.VoteType = _chunkFPZNF3JHcjs.VoteType; exports.isDecidedState = _chunkFPZNF3JHcjs.isDecidedState; exports.transactionResultNumberToName = _chunkFPZNF3JHcjs.transactionResultNumberToName; exports.transactionsStatusNameToNumber = _chunkFPZNF3JHcjs.transactionsStatusNameToNumber; exports.transactionsStatusNumberToName = _chunkFPZNF3JHcjs.transactionsStatusNumberToName; exports.voteTypeNameToNumber = _chunkFPZNF3JHcjs.voteTypeNameToNumber; exports.voteTypeNumberToName = _chunkFPZNF3JHcjs.voteTypeNumberToName;
31
+ exports.CalldataAddress = _chunkW4V73RPNcjs.CalldataAddress; exports.DECIDED_STATES = _chunkW4V73RPNcjs.DECIDED_STATES; exports.TransactionHashVariant = _chunkW4V73RPNcjs.TransactionHashVariant; exports.TransactionResult = _chunkW4V73RPNcjs.TransactionResult; exports.TransactionResultNameToNumber = _chunkW4V73RPNcjs.TransactionResultNameToNumber; exports.TransactionStatus = _chunkW4V73RPNcjs.TransactionStatus; exports.VoteType = _chunkW4V73RPNcjs.VoteType; exports.isDecidedState = _chunkW4V73RPNcjs.isDecidedState; exports.transactionResultNumberToName = _chunkW4V73RPNcjs.transactionResultNumberToName; exports.transactionsStatusNameToNumber = _chunkW4V73RPNcjs.transactionsStatusNameToNumber; exports.transactionsStatusNumberToName = _chunkW4V73RPNcjs.transactionsStatusNumberToName; exports.voteTypeNameToNumber = _chunkW4V73RPNcjs.voteTypeNameToNumber; exports.voteTypeNumberToName = _chunkW4V73RPNcjs.voteTypeNumberToName;
@@ -1,3 +1,3 @@
1
1
  export { Account, Address } from 'viem';
2
- export { d as CalldataAddress, C as CalldataEncodable, i as ContractMethod, h as ContractMethodBase, f as ContractParamsArraySchemaElement, g as ContractParamsSchema, j as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, e as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, k as TransactionHash, w as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, u as TransactionType, V as VoteType, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, s as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-BYma5s90.cjs';
3
- export { G as GenLayerChain } from '../chains-BIe_Q0mF.cjs';
2
+ export { I as BannedValidatorInfo, d as CalldataAddress, C as CalldataEncodable, i as ContractMethod, h as ContractMethodBase, f as ContractParamsArraySchemaElement, g as ContractParamsSchema, j as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, a3 as DelegatorClaimOptions, a2 as DelegatorExitOptions, a1 as DelegatorJoinOptions, R as DelegatorJoinResult, K as EpochData, L as EpochInfo, G as GenLayerClient, e as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, P as PendingDeposit, F as PendingWithdrawal, a0 as SetIdentityOptions, $ as SetOperatorOptions, y as SnapSource, J as StakeInfo, a4 as StakingActions, z as StakingContract, O as StakingTransactionResult, k as TransactionHash, x as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, w as TransactionType, Z as ValidatorClaimOptions, X as ValidatorDepositOptions, Y as ValidatorExitOptions, B as ValidatorIdentity, E as ValidatorInfo, U as ValidatorJoinOptions, Q as ValidatorJoinResult, _ as ValidatorPrimeOptions, A as ValidatorView, s as VoteType, W as WithdrawalCommit, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, u as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-3leEwFoq.cjs';
3
+ export { G as GenLayerChain } from '../chains-B7B7UXdn.cjs';
@@ -1,3 +1,3 @@
1
1
  export { Account, Address } from 'viem';
2
- export { d as CalldataAddress, C as CalldataEncodable, i as ContractMethod, h as ContractMethodBase, f as ContractParamsArraySchemaElement, g as ContractParamsSchema, j as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, e as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, k as TransactionHash, w as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, u as TransactionType, V as VoteType, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, s as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-B2AY6_eD.js';
3
- export { G as GenLayerChain } from '../chains-BIe_Q0mF.js';
2
+ export { I as BannedValidatorInfo, d as CalldataAddress, C as CalldataEncodable, i as ContractMethod, h as ContractMethodBase, f as ContractParamsArraySchemaElement, g as ContractParamsSchema, j as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, a3 as DelegatorClaimOptions, a2 as DelegatorExitOptions, a1 as DelegatorJoinOptions, R as DelegatorJoinResult, K as EpochData, L as EpochInfo, G as GenLayerClient, e as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, P as PendingDeposit, F as PendingWithdrawal, a0 as SetIdentityOptions, $ as SetOperatorOptions, y as SnapSource, J as StakeInfo, a4 as StakingActions, z as StakingContract, O as StakingTransactionResult, k as TransactionHash, x as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, w as TransactionType, Z as ValidatorClaimOptions, X as ValidatorDepositOptions, Y as ValidatorExitOptions, B as ValidatorIdentity, E as ValidatorInfo, U as ValidatorJoinOptions, Q as ValidatorJoinResult, _ as ValidatorPrimeOptions, A as ValidatorView, s as VoteType, W as WithdrawalCommit, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, u as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-BBh1NZjP.js';
3
+ export { G as GenLayerChain } from '../chains-B7B7UXdn.js';
@@ -12,7 +12,7 @@ import {
12
12
  transactionsStatusNumberToName,
13
13
  voteTypeNameToNumber,
14
14
  voteTypeNumberToName
15
- } from "../chunk-47QDX7IX.js";
15
+ } from "../chunk-ZHBOSLFN.js";
16
16
  import "../chunk-MLKGABMK.js";
17
17
  export {
18
18
  CalldataAddress,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "genlayer-js",
3
3
  "type": "module",
4
- "version": "0.18.4",
4
+ "version": "0.18.6",
5
5
  "description": "GenLayer JavaScript SDK",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
package/src/abi/index.ts CHANGED
@@ -3,3 +3,4 @@ import * as tx from "./transactions"
3
3
 
4
4
  export const calldata = cd;
5
5
  export const transactions = tx;
6
+ export {STAKING_ABI, VALIDATOR_WALLET_ABI} from "./staking";
@@ -0,0 +1,525 @@
1
+ // ValidatorWallet ABI for querying and managing validator wallet
2
+ export const VALIDATOR_WALLET_ABI = [
3
+ {
4
+ name: "operator",
5
+ type: "function",
6
+ stateMutability: "view",
7
+ inputs: [],
8
+ outputs: [{name: "", type: "address"}],
9
+ },
10
+ {
11
+ name: "owner",
12
+ type: "function",
13
+ stateMutability: "view",
14
+ inputs: [],
15
+ outputs: [{name: "", type: "address"}],
16
+ },
17
+ {
18
+ name: "getIdentity",
19
+ type: "function",
20
+ stateMutability: "view",
21
+ inputs: [],
22
+ outputs: [
23
+ {
24
+ name: "",
25
+ type: "tuple",
26
+ components: [
27
+ {name: "moniker", type: "string"},
28
+ {name: "logoUri", type: "string"},
29
+ {name: "website", type: "string"},
30
+ {name: "description", type: "string"},
31
+ {name: "email", type: "string"},
32
+ {name: "twitter", type: "string"},
33
+ {name: "telegram", type: "string"},
34
+ {name: "github", type: "string"},
35
+ {name: "extraCid", type: "bytes"},
36
+ ],
37
+ },
38
+ ],
39
+ },
40
+ {
41
+ name: "setOperator",
42
+ type: "function",
43
+ stateMutability: "nonpayable",
44
+ inputs: [{name: "_operator", type: "address"}],
45
+ outputs: [],
46
+ },
47
+ {
48
+ name: "setIdentity",
49
+ type: "function",
50
+ stateMutability: "nonpayable",
51
+ inputs: [
52
+ {name: "moniker", type: "string"},
53
+ {name: "logoUri", type: "string"},
54
+ {name: "website", type: "string"},
55
+ {name: "description", type: "string"},
56
+ {name: "email", type: "string"},
57
+ {name: "twitter", type: "string"},
58
+ {name: "telegram", type: "string"},
59
+ {name: "github", type: "string"},
60
+ {name: "extraCid", type: "bytes"},
61
+ ],
62
+ outputs: [],
63
+ },
64
+ ] as const;
65
+
66
+ export const STAKING_ABI = [
67
+ // Custom errors
68
+ {name: "BelowMinStake", type: "error", inputs: []},
69
+ {name: "AlreadyValidator", type: "error", inputs: []},
70
+ {name: "NotValidator", type: "error", inputs: []},
71
+ {name: "NotOwner", type: "error", inputs: []},
72
+ {name: "NotOperator", type: "error", inputs: []},
73
+ {name: "ValidatorBanned", type: "error", inputs: []},
74
+ {name: "ValidatorQuarantined", type: "error", inputs: []},
75
+ {name: "InsufficientShares", type: "error", inputs: []},
76
+ {name: "NothingToClaim", type: "error", inputs: []},
77
+ {name: "NotYetClaimable", type: "error", inputs: []},
78
+ {name: "ZeroAmount", type: "error", inputs: []},
79
+ {name: "InvalidOperator", type: "error", inputs: []},
80
+
81
+ // Validator functions
82
+ {
83
+ name: "validatorJoin",
84
+ type: "function",
85
+ stateMutability: "payable",
86
+ inputs: [],
87
+ outputs: [{name: "validator", type: "address"}],
88
+ },
89
+ {
90
+ name: "validatorJoin",
91
+ type: "function",
92
+ stateMutability: "payable",
93
+ inputs: [{name: "_operator", type: "address"}],
94
+ outputs: [{name: "validator", type: "address"}],
95
+ },
96
+ {
97
+ name: "validatorDeposit",
98
+ type: "function",
99
+ stateMutability: "payable",
100
+ inputs: [],
101
+ outputs: [],
102
+ },
103
+ {
104
+ name: "validatorExit",
105
+ type: "function",
106
+ stateMutability: "nonpayable",
107
+ inputs: [{name: "_sharesWithdrawal", type: "uint256"}],
108
+ outputs: [],
109
+ },
110
+ {
111
+ name: "validatorClaim",
112
+ type: "function",
113
+ stateMutability: "nonpayable",
114
+ inputs: [{name: "_validator", type: "address"}],
115
+ outputs: [{name: "", type: "uint256"}],
116
+ },
117
+ {
118
+ name: "validatorPrime",
119
+ type: "function",
120
+ stateMutability: "nonpayable",
121
+ inputs: [{name: "_validator", type: "address"}],
122
+ outputs: [],
123
+ },
124
+ // Delegator functions
125
+ {
126
+ name: "delegatorJoin",
127
+ type: "function",
128
+ stateMutability: "payable",
129
+ inputs: [{name: "_validator", type: "address"}],
130
+ outputs: [],
131
+ },
132
+ {
133
+ name: "delegatorExit",
134
+ type: "function",
135
+ stateMutability: "nonpayable",
136
+ inputs: [
137
+ {name: "_validator", type: "address"},
138
+ {name: "_sharesExit", type: "uint256"},
139
+ ],
140
+ outputs: [],
141
+ },
142
+ {
143
+ name: "delegatorClaim",
144
+ type: "function",
145
+ stateMutability: "nonpayable",
146
+ inputs: [
147
+ {name: "_delegator", type: "address"},
148
+ {name: "_validator", type: "address"},
149
+ ],
150
+ outputs: [],
151
+ },
152
+ // View functions
153
+ {
154
+ name: "isValidator",
155
+ type: "function",
156
+ stateMutability: "view",
157
+ inputs: [{name: "_address", type: "address"}],
158
+ outputs: [{name: "", type: "bool"}],
159
+ },
160
+ {
161
+ name: "validatorView",
162
+ type: "function",
163
+ stateMutability: "view",
164
+ inputs: [{name: "_validator", type: "address"}],
165
+ outputs: [
166
+ {
167
+ name: "",
168
+ type: "tuple",
169
+ components: [
170
+ {name: "left", type: "address"},
171
+ {name: "right", type: "address"},
172
+ {name: "parent", type: "address"},
173
+ {name: "eBanned", type: "uint256"},
174
+ {name: "ePrimed", type: "uint256"},
175
+ {name: "vStake", type: "uint256"},
176
+ {name: "vShares", type: "uint256"},
177
+ {name: "dStake", type: "uint256"},
178
+ {name: "dShares", type: "uint256"},
179
+ {name: "vDeposit", type: "uint256"},
180
+ {name: "vWithdrawal", type: "uint256"},
181
+ {name: "live", type: "bool"},
182
+ ],
183
+ },
184
+ ],
185
+ },
186
+ {
187
+ name: "sharesOf",
188
+ type: "function",
189
+ stateMutability: "view",
190
+ inputs: [
191
+ {name: "_delegator", type: "address"},
192
+ {name: "_validator", type: "address"},
193
+ ],
194
+ outputs: [{name: "", type: "uint256"}],
195
+ },
196
+ {
197
+ name: "stakeOf",
198
+ type: "function",
199
+ stateMutability: "view",
200
+ inputs: [
201
+ {name: "_delegator", type: "address"},
202
+ {name: "_validator", type: "address"},
203
+ ],
204
+ outputs: [{name: "", type: "uint256"}],
205
+ },
206
+ {
207
+ name: "epoch",
208
+ type: "function",
209
+ stateMutability: "view",
210
+ inputs: [],
211
+ outputs: [{name: "", type: "uint256"}],
212
+ },
213
+ {
214
+ name: "validatorMinStake",
215
+ type: "function",
216
+ stateMutability: "view",
217
+ inputs: [],
218
+ outputs: [{name: "", type: "uint256"}],
219
+ },
220
+ {
221
+ name: "delegatorMinStake",
222
+ type: "function",
223
+ stateMutability: "view",
224
+ inputs: [],
225
+ outputs: [{name: "", type: "uint256"}],
226
+ },
227
+ {
228
+ name: "activeValidators",
229
+ type: "function",
230
+ stateMutability: "view",
231
+ inputs: [],
232
+ outputs: [{name: "", type: "address[]"}],
233
+ },
234
+ {
235
+ name: "activeValidatorsCount",
236
+ type: "function",
237
+ stateMutability: "view",
238
+ inputs: [],
239
+ outputs: [{name: "", type: "uint256"}],
240
+ },
241
+ {
242
+ name: "epochOdd",
243
+ type: "function",
244
+ stateMutability: "view",
245
+ inputs: [],
246
+ outputs: [
247
+ {
248
+ name: "",
249
+ type: "tuple",
250
+ components: [
251
+ {name: "start", type: "uint256"},
252
+ {name: "end", type: "uint256"},
253
+ {name: "inflation", type: "uint256"},
254
+ {name: "weight", type: "uint256"},
255
+ {name: "weightDeposit", type: "uint256"},
256
+ {name: "weightWithdrawal", type: "uint256"},
257
+ {name: "vcount", type: "uint256"},
258
+ {name: "claimed", type: "uint256"},
259
+ {name: "stakeDeposit", type: "uint256"},
260
+ {name: "stakeWithdrawal", type: "uint256"},
261
+ ],
262
+ },
263
+ ],
264
+ },
265
+ {
266
+ name: "epochEven",
267
+ type: "function",
268
+ stateMutability: "view",
269
+ inputs: [],
270
+ outputs: [
271
+ {
272
+ name: "",
273
+ type: "tuple",
274
+ components: [
275
+ {name: "start", type: "uint256"},
276
+ {name: "end", type: "uint256"},
277
+ {name: "inflation", type: "uint256"},
278
+ {name: "weight", type: "uint256"},
279
+ {name: "weightDeposit", type: "uint256"},
280
+ {name: "weightWithdrawal", type: "uint256"},
281
+ {name: "vcount", type: "uint256"},
282
+ {name: "claimed", type: "uint256"},
283
+ {name: "stakeDeposit", type: "uint256"},
284
+ {name: "stakeWithdrawal", type: "uint256"},
285
+ ],
286
+ },
287
+ ],
288
+ },
289
+ {
290
+ name: "epochMinDuration",
291
+ type: "function",
292
+ stateMutability: "view",
293
+ inputs: [],
294
+ outputs: [{name: "", type: "uint256"}],
295
+ },
296
+ {
297
+ name: "epochZeroMinDuration",
298
+ type: "function",
299
+ stateMutability: "view",
300
+ inputs: [],
301
+ outputs: [{name: "", type: "uint256"}],
302
+ },
303
+ {
304
+ name: "getQuarantinedValidators",
305
+ type: "function",
306
+ stateMutability: "view",
307
+ inputs: [],
308
+ outputs: [{name: "", type: "address[]"}],
309
+ },
310
+ {
311
+ name: "getAllQuarantinedValidators",
312
+ type: "function",
313
+ stateMutability: "view",
314
+ inputs: [
315
+ {name: "_startIndex", type: "uint256"},
316
+ {name: "_size", type: "uint256"},
317
+ ],
318
+ outputs: [
319
+ {
320
+ name: "validatorList",
321
+ type: "tuple[]",
322
+ components: [
323
+ {name: "validator", type: "address"},
324
+ {name: "untilEpochBanned", type: "uint256"},
325
+ {name: "permanentlyBanned", type: "bool"},
326
+ ],
327
+ },
328
+ ],
329
+ },
330
+ {
331
+ name: "getAllBannedValidators",
332
+ type: "function",
333
+ stateMutability: "view",
334
+ inputs: [
335
+ {name: "_startIndex", type: "uint256"},
336
+ {name: "_size", type: "uint256"},
337
+ ],
338
+ outputs: [
339
+ {
340
+ name: "validatorList",
341
+ type: "tuple[]",
342
+ components: [
343
+ {name: "validator", type: "address"},
344
+ {name: "untilEpochBanned", type: "uint256"},
345
+ {name: "permanentlyBanned", type: "bool"},
346
+ ],
347
+ },
348
+ ],
349
+ },
350
+ // Deposit query functions
351
+ {
352
+ name: "validatorDepositLen",
353
+ type: "function",
354
+ stateMutability: "view",
355
+ inputs: [{name: "_validator", type: "address"}],
356
+ outputs: [{name: "len_", type: "uint256"}],
357
+ },
358
+ {
359
+ name: "validatorDeposit",
360
+ type: "function",
361
+ stateMutability: "view",
362
+ inputs: [
363
+ {name: "_validator", type: "address"},
364
+ {name: "_index", type: "uint256"},
365
+ ],
366
+ outputs: [
367
+ {name: "epoch_", type: "uint256"},
368
+ {
369
+ name: "commit_",
370
+ type: "tuple",
371
+ components: [
372
+ {name: "input", type: "uint256"},
373
+ {name: "output", type: "uint256"},
374
+ {name: "epoch", type: "uint256"},
375
+ {name: "linkToNextCommit", type: "uint256"},
376
+ ],
377
+ },
378
+ ],
379
+ },
380
+ {
381
+ name: "delegatorDepositLen",
382
+ type: "function",
383
+ stateMutability: "view",
384
+ inputs: [
385
+ {name: "_delegator", type: "address"},
386
+ {name: "_validator", type: "address"},
387
+ ],
388
+ outputs: [{name: "", type: "uint256"}],
389
+ },
390
+ {
391
+ name: "delegatorDeposit",
392
+ type: "function",
393
+ stateMutability: "view",
394
+ inputs: [
395
+ {name: "_delegator", type: "address"},
396
+ {name: "_validator", type: "address"},
397
+ {name: "_index", type: "uint256"},
398
+ ],
399
+ outputs: [
400
+ {
401
+ name: "claim_",
402
+ type: "tuple",
403
+ components: [
404
+ {name: "quantity", type: "uint256"},
405
+ {name: "commit", type: "uint256"},
406
+ ],
407
+ },
408
+ {
409
+ name: "commit_",
410
+ type: "tuple",
411
+ components: [
412
+ {name: "input", type: "uint256"},
413
+ {name: "output", type: "uint256"},
414
+ {name: "epoch", type: "uint256"},
415
+ {name: "linkToNextCommit", type: "uint256"},
416
+ ],
417
+ },
418
+ ],
419
+ },
420
+ // Withdrawal query functions
421
+ {
422
+ name: "validatorWithdrawalLen",
423
+ type: "function",
424
+ stateMutability: "view",
425
+ inputs: [{name: "_validator", type: "address"}],
426
+ outputs: [{name: "len_", type: "uint256"}],
427
+ },
428
+ {
429
+ name: "validatorWithdrawal",
430
+ type: "function",
431
+ stateMutability: "view",
432
+ inputs: [
433
+ {name: "_validator", type: "address"},
434
+ {name: "_index", type: "uint256"},
435
+ ],
436
+ outputs: [
437
+ {name: "epoch_", type: "uint256"},
438
+ {
439
+ name: "commit_",
440
+ type: "tuple",
441
+ components: [
442
+ {name: "input", type: "uint256"},
443
+ {name: "output", type: "uint256"},
444
+ {name: "epoch", type: "uint256"},
445
+ {name: "linkToNextCommit", type: "uint256"},
446
+ ],
447
+ },
448
+ ],
449
+ },
450
+ {
451
+ name: "delegatorWithdrawalLen",
452
+ type: "function",
453
+ stateMutability: "view",
454
+ inputs: [
455
+ {name: "_delegator", type: "address"},
456
+ {name: "_validator", type: "address"},
457
+ ],
458
+ outputs: [{name: "", type: "uint256"}],
459
+ },
460
+ {
461
+ name: "delegatorWithdrawal",
462
+ type: "function",
463
+ stateMutability: "view",
464
+ inputs: [
465
+ {name: "_delegator", type: "address"},
466
+ {name: "_validator", type: "address"},
467
+ {name: "_index", type: "uint256"},
468
+ ],
469
+ outputs: [
470
+ {
471
+ name: "claim_",
472
+ type: "tuple",
473
+ components: [
474
+ {name: "quantity", type: "uint256"},
475
+ {name: "commit", type: "uint256"},
476
+ ],
477
+ },
478
+ {
479
+ name: "commit_",
480
+ type: "tuple",
481
+ components: [
482
+ {name: "input", type: "uint256"},
483
+ {name: "output", type: "uint256"},
484
+ {name: "epoch", type: "uint256"},
485
+ {name: "linkToNextCommit", type: "uint256"},
486
+ ],
487
+ },
488
+ ],
489
+ },
490
+ // Events (none indexed to match deployed contract)
491
+ {
492
+ name: "ValidatorJoin",
493
+ type: "event",
494
+ inputs: [
495
+ {name: "operator", type: "address", indexed: false},
496
+ {name: "validator", type: "address", indexed: false},
497
+ {name: "amount", type: "uint256", indexed: false},
498
+ ],
499
+ },
500
+ {
501
+ name: "ValidatorDeposit",
502
+ type: "event",
503
+ inputs: [
504
+ {name: "validator", type: "address", indexed: false},
505
+ {name: "amount", type: "uint256", indexed: false},
506
+ ],
507
+ },
508
+ {
509
+ name: "ValidatorExit",
510
+ type: "event",
511
+ inputs: [
512
+ {name: "validator", type: "address", indexed: false},
513
+ {name: "shares", type: "uint256", indexed: false},
514
+ ],
515
+ },
516
+ {
517
+ name: "DelegatorJoin",
518
+ type: "event",
519
+ inputs: [
520
+ {name: "delegator", type: "address", indexed: false},
521
+ {name: "validator", type: "address", indexed: false},
522
+ {name: "amount", type: "uint256", indexed: false},
523
+ ],
524
+ },
525
+ ] as const;
@@ -3988,7 +3988,7 @@ const CONSENSUS_DATA_CONTRACT = {
3988
3988
  };
3989
3989
 
3990
3990
  export const localnet: GenLayerChain = defineChain({
3991
- id: 61_999,
3991
+ id: 61_127,
3992
3992
  isStudio: true,
3993
3993
  name: "Genlayer Localnet",
3994
3994
  rpcUrls: {
@@ -4010,6 +4010,7 @@ export const localnet: GenLayerChain = defineChain({
4010
4010
  testnet: true,
4011
4011
  consensusMainContract: CONSENSUS_MAIN_CONTRACT,
4012
4012
  consensusDataContract: CONSENSUS_DATA_CONTRACT,
4013
+ stakingContract: null,
4013
4014
  defaultNumberOfInitialValidators: 5,
4014
4015
  defaultConsensusMaxRotations: 3,
4015
4016
  });
@@ -4011,6 +4011,7 @@ export const studionet: GenLayerChain = defineChain({
4011
4011
  testnet: true,
4012
4012
  consensusMainContract: CONSENSUS_MAIN_CONTRACT,
4013
4013
  consensusDataContract: CONSENSUS_DATA_CONTRACT,
4014
+ stakingContract: null,
4014
4015
  defaultNumberOfInitialValidators: 5,
4015
4016
  defaultConsensusMaxRotations: 3,
4016
4017
  });
@@ -1,11 +1,17 @@
1
1
  import {Address, defineChain} from "viem";
2
2
  import {GenLayerChain} from "@/types";
3
+ import {STAKING_ABI} from "@/abi/staking";
3
4
 
4
5
  // chains/localnet.ts
5
- const TESTNET_JSON_RPC_URL = " http://34.32.169.58:9151";
6
+ const TESTNET_JSON_RPC_URL = "https://genlayer-testnet.rpc.caldera.xyz/http";
7
+
8
+ const STAKING_CONTRACT = {
9
+ address: "0x03f410748EBdb4026a6b8299E9B6603A273709D1" as Address,
10
+ abi: STAKING_ABI,
11
+ };
6
12
  const EXPLORER_URL = "https://explorer-asimov.genlayer.com/";
7
13
  const CONSENSUS_MAIN_CONTRACT = {
8
- address: "0xe30293d600fF9B2C865d91307826F28006A458f4" as Address,
14
+ address: "0x67fd4aC71530FB220E0B7F90668BAF977B88fF07" as Address,
9
15
  abi: [
10
16
  {
11
17
  inputs: [],
@@ -1395,7 +1401,7 @@ const CONSENSUS_MAIN_CONTRACT = {
1395
1401
  };
1396
1402
 
1397
1403
  const CONSENSUS_DATA_CONTRACT = {
1398
- address: "0x2a50afD9d3E0ACC824aC4850d7B4c5561aB5D27a" as Address,
1404
+ address: "0xB6E1316E57d47d82FDcEa5002028a554754EF243" as Address,
1399
1405
  abi: [
1400
1406
  {
1401
1407
  inputs: [],
@@ -3999,6 +4005,7 @@ export const testnetAsimov: GenLayerChain = defineChain({
3999
4005
  testnet: true,
4000
4006
  consensusMainContract: CONSENSUS_MAIN_CONTRACT,
4001
4007
  consensusDataContract: CONSENSUS_DATA_CONTRACT,
4008
+ stakingContract: STAKING_CONTRACT,
4002
4009
  defaultNumberOfInitialValidators: 5,
4003
4010
  defaultConsensusMaxRotations: 3,
4004
4011
  });