genlayer-js 0.18.7 → 0.18.9
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/CHANGELOG.md +4 -0
- package/dist/chains/index.cjs +2 -2
- package/dist/chains/index.js +1 -1
- package/dist/{chunk-I23SLL2A.cjs → chunk-SC2VXHL3.cjs} +102 -2
- package/dist/{chunk-RW6PLN5W.js → chunk-V3MYVW3P.js} +102 -2
- package/dist/{index-DM646L5c.d.cts → index-D9ONjYgl.d.cts} +162 -22
- package/dist/{index-9QkkDjYm.d.ts → index-ZDqJWXj0.d.ts} +162 -22
- package/dist/index.cjs +133 -94
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +88 -49
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/abi/staking.ts +122 -0
- package/src/client/client.ts +3 -7
- package/src/contracts/actions.ts +60 -41
- package/src/staking/actions.ts +49 -11
- package/src/types/staking.ts +4 -7
- package/src/types/transactions.ts +16 -14
package/CHANGELOG.md
CHANGED
package/dist/chains/index.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkSC2VXHL3cjs = require('../chunk-SC2VXHL3.cjs');
|
|
6
6
|
require('../chunk-75ZPJI57.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.localnet =
|
|
11
|
+
exports.localnet = _chunkSC2VXHL3cjs.localnet; exports.studionet = _chunkSC2VXHL3cjs.studionet; exports.testnetAsimov = _chunkSC2VXHL3cjs.testnetAsimov;
|
package/dist/chains/index.js
CHANGED
|
@@ -8048,6 +8048,9 @@ var VALIDATOR_WALLET_ABI = [
|
|
|
8048
8048
|
{ name: "TransferFailed", type: "error", inputs: [] },
|
|
8049
8049
|
{ name: "OperatorTransferNotReady", type: "error", inputs: [] },
|
|
8050
8050
|
{ name: "NoPendingOperator", type: "error", inputs: [] },
|
|
8051
|
+
// OpenZeppelin Ownable errors
|
|
8052
|
+
{ name: "OwnableUnauthorizedAccount", type: "error", inputs: [{ name: "account", type: "address" }] },
|
|
8053
|
+
{ name: "OwnableInvalidOwner", type: "error", inputs: [{ name: "owner", type: "address" }] },
|
|
8051
8054
|
// Functions
|
|
8052
8055
|
{
|
|
8053
8056
|
name: "operator",
|
|
@@ -8109,6 +8112,67 @@ var VALIDATOR_WALLET_ABI = [
|
|
|
8109
8112
|
{ name: "extraCid", type: "bytes" }
|
|
8110
8113
|
],
|
|
8111
8114
|
outputs: []
|
|
8115
|
+
},
|
|
8116
|
+
// Staking functions (forwarded to staking contract)
|
|
8117
|
+
{
|
|
8118
|
+
name: "validatorDeposit",
|
|
8119
|
+
type: "function",
|
|
8120
|
+
stateMutability: "payable",
|
|
8121
|
+
inputs: [],
|
|
8122
|
+
outputs: []
|
|
8123
|
+
},
|
|
8124
|
+
{
|
|
8125
|
+
name: "validatorExit",
|
|
8126
|
+
type: "function",
|
|
8127
|
+
stateMutability: "nonpayable",
|
|
8128
|
+
inputs: [{ name: "_shares", type: "uint256" }],
|
|
8129
|
+
outputs: []
|
|
8130
|
+
},
|
|
8131
|
+
{
|
|
8132
|
+
name: "validatorClaim",
|
|
8133
|
+
type: "function",
|
|
8134
|
+
stateMutability: "nonpayable",
|
|
8135
|
+
inputs: [],
|
|
8136
|
+
outputs: []
|
|
8137
|
+
},
|
|
8138
|
+
// Two-step operator transfer
|
|
8139
|
+
{
|
|
8140
|
+
name: "initiateOperatorTransfer",
|
|
8141
|
+
type: "function",
|
|
8142
|
+
stateMutability: "nonpayable",
|
|
8143
|
+
inputs: [{ name: "_newOperator", type: "address" }],
|
|
8144
|
+
outputs: []
|
|
8145
|
+
},
|
|
8146
|
+
{
|
|
8147
|
+
name: "completeOperatorTransfer",
|
|
8148
|
+
type: "function",
|
|
8149
|
+
stateMutability: "nonpayable",
|
|
8150
|
+
inputs: [],
|
|
8151
|
+
outputs: []
|
|
8152
|
+
},
|
|
8153
|
+
{
|
|
8154
|
+
name: "cancelOperatorTransfer",
|
|
8155
|
+
type: "function",
|
|
8156
|
+
stateMutability: "nonpayable",
|
|
8157
|
+
inputs: [],
|
|
8158
|
+
outputs: []
|
|
8159
|
+
},
|
|
8160
|
+
{
|
|
8161
|
+
name: "getPendingOperator",
|
|
8162
|
+
type: "function",
|
|
8163
|
+
stateMutability: "view",
|
|
8164
|
+
inputs: [],
|
|
8165
|
+
outputs: [
|
|
8166
|
+
{ name: "", type: "address" },
|
|
8167
|
+
{ name: "", type: "uint256" }
|
|
8168
|
+
]
|
|
8169
|
+
},
|
|
8170
|
+
{
|
|
8171
|
+
name: "getOperator",
|
|
8172
|
+
type: "function",
|
|
8173
|
+
stateMutability: "view",
|
|
8174
|
+
inputs: [],
|
|
8175
|
+
outputs: [{ name: "", type: "address" }]
|
|
8112
8176
|
}
|
|
8113
8177
|
];
|
|
8114
8178
|
var STAKING_ABI = [
|
|
@@ -8289,6 +8353,13 @@ var STAKING_ABI = [
|
|
|
8289
8353
|
inputs: [],
|
|
8290
8354
|
outputs: [{ name: "", type: "uint256" }]
|
|
8291
8355
|
},
|
|
8356
|
+
{
|
|
8357
|
+
name: "finalized",
|
|
8358
|
+
type: "function",
|
|
8359
|
+
stateMutability: "view",
|
|
8360
|
+
inputs: [],
|
|
8361
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
8362
|
+
},
|
|
8292
8363
|
{
|
|
8293
8364
|
name: "validatorMinStake",
|
|
8294
8365
|
type: "function",
|
|
@@ -8336,7 +8407,8 @@ var STAKING_ABI = [
|
|
|
8336
8407
|
{ name: "vcount", type: "uint256" },
|
|
8337
8408
|
{ name: "claimed", type: "uint256" },
|
|
8338
8409
|
{ name: "stakeDeposit", type: "uint256" },
|
|
8339
|
-
{ name: "stakeWithdrawal", type: "uint256" }
|
|
8410
|
+
{ name: "stakeWithdrawal", type: "uint256" },
|
|
8411
|
+
{ name: "slashed", type: "uint256" }
|
|
8340
8412
|
]
|
|
8341
8413
|
}
|
|
8342
8414
|
]
|
|
@@ -8360,7 +8432,8 @@ var STAKING_ABI = [
|
|
|
8360
8432
|
{ name: "vcount", type: "uint256" },
|
|
8361
8433
|
{ name: "claimed", type: "uint256" },
|
|
8362
8434
|
{ name: "stakeDeposit", type: "uint256" },
|
|
8363
|
-
{ name: "stakeWithdrawal", type: "uint256" }
|
|
8435
|
+
{ name: "stakeWithdrawal", type: "uint256" },
|
|
8436
|
+
{ name: "slashed", type: "uint256" }
|
|
8364
8437
|
]
|
|
8365
8438
|
}
|
|
8366
8439
|
]
|
|
@@ -8600,6 +8673,33 @@ var STAKING_ABI = [
|
|
|
8600
8673
|
{ name: "validator", type: "address", indexed: false },
|
|
8601
8674
|
{ name: "amount", type: "uint256", indexed: false }
|
|
8602
8675
|
]
|
|
8676
|
+
},
|
|
8677
|
+
{
|
|
8678
|
+
name: "ValidatorPrime",
|
|
8679
|
+
type: "event",
|
|
8680
|
+
inputs: [
|
|
8681
|
+
{ name: "validator", type: "address", indexed: false },
|
|
8682
|
+
{ name: "epoch", type: "uint256", indexed: false },
|
|
8683
|
+
{ name: "validatorRewards", type: "uint256", indexed: false },
|
|
8684
|
+
{ name: "delegatorRewards", type: "uint256", indexed: false }
|
|
8685
|
+
]
|
|
8686
|
+
},
|
|
8687
|
+
// External contracts getter
|
|
8688
|
+
{
|
|
8689
|
+
name: "contracts",
|
|
8690
|
+
type: "function",
|
|
8691
|
+
stateMutability: "view",
|
|
8692
|
+
inputs: [],
|
|
8693
|
+
outputs: [
|
|
8694
|
+
{ name: "gen", type: "address" },
|
|
8695
|
+
{ name: "transactions", type: "address" },
|
|
8696
|
+
{ name: "idleness", type: "address" },
|
|
8697
|
+
{ name: "tribunal", type: "address" },
|
|
8698
|
+
{ name: "slashing", type: "address" },
|
|
8699
|
+
{ name: "consensus", type: "address" },
|
|
8700
|
+
{ name: "validatorWalletFactory", type: "address" },
|
|
8701
|
+
{ name: "nftMinter", type: "address" }
|
|
8702
|
+
]
|
|
8603
8703
|
}
|
|
8604
8704
|
];
|
|
8605
8705
|
|
|
@@ -8048,6 +8048,9 @@ var VALIDATOR_WALLET_ABI = [
|
|
|
8048
8048
|
{ name: "TransferFailed", type: "error", inputs: [] },
|
|
8049
8049
|
{ name: "OperatorTransferNotReady", type: "error", inputs: [] },
|
|
8050
8050
|
{ name: "NoPendingOperator", type: "error", inputs: [] },
|
|
8051
|
+
// OpenZeppelin Ownable errors
|
|
8052
|
+
{ name: "OwnableUnauthorizedAccount", type: "error", inputs: [{ name: "account", type: "address" }] },
|
|
8053
|
+
{ name: "OwnableInvalidOwner", type: "error", inputs: [{ name: "owner", type: "address" }] },
|
|
8051
8054
|
// Functions
|
|
8052
8055
|
{
|
|
8053
8056
|
name: "operator",
|
|
@@ -8109,6 +8112,67 @@ var VALIDATOR_WALLET_ABI = [
|
|
|
8109
8112
|
{ name: "extraCid", type: "bytes" }
|
|
8110
8113
|
],
|
|
8111
8114
|
outputs: []
|
|
8115
|
+
},
|
|
8116
|
+
// Staking functions (forwarded to staking contract)
|
|
8117
|
+
{
|
|
8118
|
+
name: "validatorDeposit",
|
|
8119
|
+
type: "function",
|
|
8120
|
+
stateMutability: "payable",
|
|
8121
|
+
inputs: [],
|
|
8122
|
+
outputs: []
|
|
8123
|
+
},
|
|
8124
|
+
{
|
|
8125
|
+
name: "validatorExit",
|
|
8126
|
+
type: "function",
|
|
8127
|
+
stateMutability: "nonpayable",
|
|
8128
|
+
inputs: [{ name: "_shares", type: "uint256" }],
|
|
8129
|
+
outputs: []
|
|
8130
|
+
},
|
|
8131
|
+
{
|
|
8132
|
+
name: "validatorClaim",
|
|
8133
|
+
type: "function",
|
|
8134
|
+
stateMutability: "nonpayable",
|
|
8135
|
+
inputs: [],
|
|
8136
|
+
outputs: []
|
|
8137
|
+
},
|
|
8138
|
+
// Two-step operator transfer
|
|
8139
|
+
{
|
|
8140
|
+
name: "initiateOperatorTransfer",
|
|
8141
|
+
type: "function",
|
|
8142
|
+
stateMutability: "nonpayable",
|
|
8143
|
+
inputs: [{ name: "_newOperator", type: "address" }],
|
|
8144
|
+
outputs: []
|
|
8145
|
+
},
|
|
8146
|
+
{
|
|
8147
|
+
name: "completeOperatorTransfer",
|
|
8148
|
+
type: "function",
|
|
8149
|
+
stateMutability: "nonpayable",
|
|
8150
|
+
inputs: [],
|
|
8151
|
+
outputs: []
|
|
8152
|
+
},
|
|
8153
|
+
{
|
|
8154
|
+
name: "cancelOperatorTransfer",
|
|
8155
|
+
type: "function",
|
|
8156
|
+
stateMutability: "nonpayable",
|
|
8157
|
+
inputs: [],
|
|
8158
|
+
outputs: []
|
|
8159
|
+
},
|
|
8160
|
+
{
|
|
8161
|
+
name: "getPendingOperator",
|
|
8162
|
+
type: "function",
|
|
8163
|
+
stateMutability: "view",
|
|
8164
|
+
inputs: [],
|
|
8165
|
+
outputs: [
|
|
8166
|
+
{ name: "", type: "address" },
|
|
8167
|
+
{ name: "", type: "uint256" }
|
|
8168
|
+
]
|
|
8169
|
+
},
|
|
8170
|
+
{
|
|
8171
|
+
name: "getOperator",
|
|
8172
|
+
type: "function",
|
|
8173
|
+
stateMutability: "view",
|
|
8174
|
+
inputs: [],
|
|
8175
|
+
outputs: [{ name: "", type: "address" }]
|
|
8112
8176
|
}
|
|
8113
8177
|
];
|
|
8114
8178
|
var STAKING_ABI = [
|
|
@@ -8289,6 +8353,13 @@ var STAKING_ABI = [
|
|
|
8289
8353
|
inputs: [],
|
|
8290
8354
|
outputs: [{ name: "", type: "uint256" }]
|
|
8291
8355
|
},
|
|
8356
|
+
{
|
|
8357
|
+
name: "finalized",
|
|
8358
|
+
type: "function",
|
|
8359
|
+
stateMutability: "view",
|
|
8360
|
+
inputs: [],
|
|
8361
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
8362
|
+
},
|
|
8292
8363
|
{
|
|
8293
8364
|
name: "validatorMinStake",
|
|
8294
8365
|
type: "function",
|
|
@@ -8336,7 +8407,8 @@ var STAKING_ABI = [
|
|
|
8336
8407
|
{ name: "vcount", type: "uint256" },
|
|
8337
8408
|
{ name: "claimed", type: "uint256" },
|
|
8338
8409
|
{ name: "stakeDeposit", type: "uint256" },
|
|
8339
|
-
{ name: "stakeWithdrawal", type: "uint256" }
|
|
8410
|
+
{ name: "stakeWithdrawal", type: "uint256" },
|
|
8411
|
+
{ name: "slashed", type: "uint256" }
|
|
8340
8412
|
]
|
|
8341
8413
|
}
|
|
8342
8414
|
]
|
|
@@ -8360,7 +8432,8 @@ var STAKING_ABI = [
|
|
|
8360
8432
|
{ name: "vcount", type: "uint256" },
|
|
8361
8433
|
{ name: "claimed", type: "uint256" },
|
|
8362
8434
|
{ name: "stakeDeposit", type: "uint256" },
|
|
8363
|
-
{ name: "stakeWithdrawal", type: "uint256" }
|
|
8435
|
+
{ name: "stakeWithdrawal", type: "uint256" },
|
|
8436
|
+
{ name: "slashed", type: "uint256" }
|
|
8364
8437
|
]
|
|
8365
8438
|
}
|
|
8366
8439
|
]
|
|
@@ -8600,6 +8673,33 @@ var STAKING_ABI = [
|
|
|
8600
8673
|
{ name: "validator", type: "address", indexed: false },
|
|
8601
8674
|
{ name: "amount", type: "uint256", indexed: false }
|
|
8602
8675
|
]
|
|
8676
|
+
},
|
|
8677
|
+
{
|
|
8678
|
+
name: "ValidatorPrime",
|
|
8679
|
+
type: "event",
|
|
8680
|
+
inputs: [
|
|
8681
|
+
{ name: "validator", type: "address", indexed: false },
|
|
8682
|
+
{ name: "epoch", type: "uint256", indexed: false },
|
|
8683
|
+
{ name: "validatorRewards", type: "uint256", indexed: false },
|
|
8684
|
+
{ name: "delegatorRewards", type: "uint256", indexed: false }
|
|
8685
|
+
]
|
|
8686
|
+
},
|
|
8687
|
+
// External contracts getter
|
|
8688
|
+
{
|
|
8689
|
+
name: "contracts",
|
|
8690
|
+
type: "function",
|
|
8691
|
+
stateMutability: "view",
|
|
8692
|
+
inputs: [],
|
|
8693
|
+
outputs: [
|
|
8694
|
+
{ name: "gen", type: "address" },
|
|
8695
|
+
{ name: "transactions", type: "address" },
|
|
8696
|
+
{ name: "idleness", type: "address" },
|
|
8697
|
+
{ name: "tribunal", type: "address" },
|
|
8698
|
+
{ name: "slashing", type: "address" },
|
|
8699
|
+
{ name: "consensus", type: "address" },
|
|
8700
|
+
{ name: "validatorWalletFactory", type: "address" },
|
|
8701
|
+
{ name: "nftMinter", type: "address" }
|
|
8702
|
+
]
|
|
8603
8703
|
}
|
|
8604
8704
|
];
|
|
8605
8705
|
|
|
@@ -140,6 +140,20 @@ type DecodedCallData = {
|
|
|
140
140
|
leaderOnly?: boolean;
|
|
141
141
|
type: TransactionType;
|
|
142
142
|
};
|
|
143
|
+
interface LeaderReceipt {
|
|
144
|
+
calldata: string;
|
|
145
|
+
class_name: string;
|
|
146
|
+
contract_state: string;
|
|
147
|
+
eq_outputs: Record<string, unknown>;
|
|
148
|
+
error: string | null;
|
|
149
|
+
execution_result: string;
|
|
150
|
+
gas_used: number;
|
|
151
|
+
mode: string;
|
|
152
|
+
node_config: Record<string, unknown>;
|
|
153
|
+
pending_transactions: unknown[];
|
|
154
|
+
vote: string;
|
|
155
|
+
result: string;
|
|
156
|
+
}
|
|
143
157
|
type GenLayerTransaction = {
|
|
144
158
|
currentTimestamp?: string;
|
|
145
159
|
from_address?: Address;
|
|
@@ -187,20 +201,7 @@ type GenLayerTransaction = {
|
|
|
187
201
|
};
|
|
188
202
|
consensus_data?: {
|
|
189
203
|
final: boolean;
|
|
190
|
-
leader_receipt?:
|
|
191
|
-
calldata: string;
|
|
192
|
-
class_name: string;
|
|
193
|
-
contract_state: string;
|
|
194
|
-
eq_outputs: Record<string, unknown>;
|
|
195
|
-
error: string | null;
|
|
196
|
-
execution_result: string;
|
|
197
|
-
gas_used: number;
|
|
198
|
-
mode: string;
|
|
199
|
-
node_config: Record<string, unknown>;
|
|
200
|
-
pending_transactions: unknown[];
|
|
201
|
-
vote: string;
|
|
202
|
-
result: string;
|
|
203
|
-
}[];
|
|
204
|
+
leader_receipt?: LeaderReceipt[];
|
|
204
205
|
validators?: Record<string, unknown>[];
|
|
205
206
|
votes?: Record<string, string>;
|
|
206
207
|
};
|
|
@@ -308,6 +309,20 @@ declare const VALIDATOR_WALLET_ABI: readonly [{
|
|
|
308
309
|
readonly name: "NoPendingOperator";
|
|
309
310
|
readonly type: "error";
|
|
310
311
|
readonly inputs: readonly [];
|
|
312
|
+
}, {
|
|
313
|
+
readonly name: "OwnableUnauthorizedAccount";
|
|
314
|
+
readonly type: "error";
|
|
315
|
+
readonly inputs: readonly [{
|
|
316
|
+
readonly name: "account";
|
|
317
|
+
readonly type: "address";
|
|
318
|
+
}];
|
|
319
|
+
}, {
|
|
320
|
+
readonly name: "OwnableInvalidOwner";
|
|
321
|
+
readonly type: "error";
|
|
322
|
+
readonly inputs: readonly [{
|
|
323
|
+
readonly name: "owner";
|
|
324
|
+
readonly type: "address";
|
|
325
|
+
}];
|
|
311
326
|
}, {
|
|
312
327
|
readonly name: "operator";
|
|
313
328
|
readonly type: "function";
|
|
@@ -405,6 +420,69 @@ declare const VALIDATOR_WALLET_ABI: readonly [{
|
|
|
405
420
|
readonly type: "bytes";
|
|
406
421
|
}];
|
|
407
422
|
readonly outputs: readonly [];
|
|
423
|
+
}, {
|
|
424
|
+
readonly name: "validatorDeposit";
|
|
425
|
+
readonly type: "function";
|
|
426
|
+
readonly stateMutability: "payable";
|
|
427
|
+
readonly inputs: readonly [];
|
|
428
|
+
readonly outputs: readonly [];
|
|
429
|
+
}, {
|
|
430
|
+
readonly name: "validatorExit";
|
|
431
|
+
readonly type: "function";
|
|
432
|
+
readonly stateMutability: "nonpayable";
|
|
433
|
+
readonly inputs: readonly [{
|
|
434
|
+
readonly name: "_shares";
|
|
435
|
+
readonly type: "uint256";
|
|
436
|
+
}];
|
|
437
|
+
readonly outputs: readonly [];
|
|
438
|
+
}, {
|
|
439
|
+
readonly name: "validatorClaim";
|
|
440
|
+
readonly type: "function";
|
|
441
|
+
readonly stateMutability: "nonpayable";
|
|
442
|
+
readonly inputs: readonly [];
|
|
443
|
+
readonly outputs: readonly [];
|
|
444
|
+
}, {
|
|
445
|
+
readonly name: "initiateOperatorTransfer";
|
|
446
|
+
readonly type: "function";
|
|
447
|
+
readonly stateMutability: "nonpayable";
|
|
448
|
+
readonly inputs: readonly [{
|
|
449
|
+
readonly name: "_newOperator";
|
|
450
|
+
readonly type: "address";
|
|
451
|
+
}];
|
|
452
|
+
readonly outputs: readonly [];
|
|
453
|
+
}, {
|
|
454
|
+
readonly name: "completeOperatorTransfer";
|
|
455
|
+
readonly type: "function";
|
|
456
|
+
readonly stateMutability: "nonpayable";
|
|
457
|
+
readonly inputs: readonly [];
|
|
458
|
+
readonly outputs: readonly [];
|
|
459
|
+
}, {
|
|
460
|
+
readonly name: "cancelOperatorTransfer";
|
|
461
|
+
readonly type: "function";
|
|
462
|
+
readonly stateMutability: "nonpayable";
|
|
463
|
+
readonly inputs: readonly [];
|
|
464
|
+
readonly outputs: readonly [];
|
|
465
|
+
}, {
|
|
466
|
+
readonly name: "getPendingOperator";
|
|
467
|
+
readonly type: "function";
|
|
468
|
+
readonly stateMutability: "view";
|
|
469
|
+
readonly inputs: readonly [];
|
|
470
|
+
readonly outputs: readonly [{
|
|
471
|
+
readonly name: "";
|
|
472
|
+
readonly type: "address";
|
|
473
|
+
}, {
|
|
474
|
+
readonly name: "";
|
|
475
|
+
readonly type: "uint256";
|
|
476
|
+
}];
|
|
477
|
+
}, {
|
|
478
|
+
readonly name: "getOperator";
|
|
479
|
+
readonly type: "function";
|
|
480
|
+
readonly stateMutability: "view";
|
|
481
|
+
readonly inputs: readonly [];
|
|
482
|
+
readonly outputs: readonly [{
|
|
483
|
+
readonly name: "";
|
|
484
|
+
readonly type: "address";
|
|
485
|
+
}];
|
|
408
486
|
}];
|
|
409
487
|
declare const STAKING_ABI: readonly [{
|
|
410
488
|
readonly name: "OnlyGEN";
|
|
@@ -778,6 +856,15 @@ declare const STAKING_ABI: readonly [{
|
|
|
778
856
|
readonly name: "";
|
|
779
857
|
readonly type: "uint256";
|
|
780
858
|
}];
|
|
859
|
+
}, {
|
|
860
|
+
readonly name: "finalized";
|
|
861
|
+
readonly type: "function";
|
|
862
|
+
readonly stateMutability: "view";
|
|
863
|
+
readonly inputs: readonly [];
|
|
864
|
+
readonly outputs: readonly [{
|
|
865
|
+
readonly name: "";
|
|
866
|
+
readonly type: "uint256";
|
|
867
|
+
}];
|
|
781
868
|
}, {
|
|
782
869
|
readonly name: "validatorMinStake";
|
|
783
870
|
readonly type: "function";
|
|
@@ -852,6 +939,9 @@ declare const STAKING_ABI: readonly [{
|
|
|
852
939
|
}, {
|
|
853
940
|
readonly name: "stakeWithdrawal";
|
|
854
941
|
readonly type: "uint256";
|
|
942
|
+
}, {
|
|
943
|
+
readonly name: "slashed";
|
|
944
|
+
readonly type: "uint256";
|
|
855
945
|
}];
|
|
856
946
|
}];
|
|
857
947
|
}, {
|
|
@@ -892,6 +982,9 @@ declare const STAKING_ABI: readonly [{
|
|
|
892
982
|
}, {
|
|
893
983
|
readonly name: "stakeWithdrawal";
|
|
894
984
|
readonly type: "uint256";
|
|
985
|
+
}, {
|
|
986
|
+
readonly name: "slashed";
|
|
987
|
+
readonly type: "uint256";
|
|
895
988
|
}];
|
|
896
989
|
}];
|
|
897
990
|
}, {
|
|
@@ -1225,6 +1318,56 @@ declare const STAKING_ABI: readonly [{
|
|
|
1225
1318
|
readonly type: "uint256";
|
|
1226
1319
|
readonly indexed: false;
|
|
1227
1320
|
}];
|
|
1321
|
+
}, {
|
|
1322
|
+
readonly name: "ValidatorPrime";
|
|
1323
|
+
readonly type: "event";
|
|
1324
|
+
readonly inputs: readonly [{
|
|
1325
|
+
readonly name: "validator";
|
|
1326
|
+
readonly type: "address";
|
|
1327
|
+
readonly indexed: false;
|
|
1328
|
+
}, {
|
|
1329
|
+
readonly name: "epoch";
|
|
1330
|
+
readonly type: "uint256";
|
|
1331
|
+
readonly indexed: false;
|
|
1332
|
+
}, {
|
|
1333
|
+
readonly name: "validatorRewards";
|
|
1334
|
+
readonly type: "uint256";
|
|
1335
|
+
readonly indexed: false;
|
|
1336
|
+
}, {
|
|
1337
|
+
readonly name: "delegatorRewards";
|
|
1338
|
+
readonly type: "uint256";
|
|
1339
|
+
readonly indexed: false;
|
|
1340
|
+
}];
|
|
1341
|
+
}, {
|
|
1342
|
+
readonly name: "contracts";
|
|
1343
|
+
readonly type: "function";
|
|
1344
|
+
readonly stateMutability: "view";
|
|
1345
|
+
readonly inputs: readonly [];
|
|
1346
|
+
readonly outputs: readonly [{
|
|
1347
|
+
readonly name: "gen";
|
|
1348
|
+
readonly type: "address";
|
|
1349
|
+
}, {
|
|
1350
|
+
readonly name: "transactions";
|
|
1351
|
+
readonly type: "address";
|
|
1352
|
+
}, {
|
|
1353
|
+
readonly name: "idleness";
|
|
1354
|
+
readonly type: "address";
|
|
1355
|
+
}, {
|
|
1356
|
+
readonly name: "tribunal";
|
|
1357
|
+
readonly type: "address";
|
|
1358
|
+
}, {
|
|
1359
|
+
readonly name: "slashing";
|
|
1360
|
+
readonly type: "address";
|
|
1361
|
+
}, {
|
|
1362
|
+
readonly name: "consensus";
|
|
1363
|
+
readonly type: "address";
|
|
1364
|
+
}, {
|
|
1365
|
+
readonly name: "validatorWalletFactory";
|
|
1366
|
+
readonly type: "address";
|
|
1367
|
+
}, {
|
|
1368
|
+
readonly name: "nftMinter";
|
|
1369
|
+
readonly type: "address";
|
|
1370
|
+
}];
|
|
1228
1371
|
}];
|
|
1229
1372
|
|
|
1230
1373
|
type WalletClientWithAccount = Client<Transport, Chain, Account>;
|
|
@@ -1324,23 +1467,18 @@ interface EpochData {
|
|
|
1324
1467
|
claimed: bigint;
|
|
1325
1468
|
stakeDeposit: bigint;
|
|
1326
1469
|
stakeWithdrawal: bigint;
|
|
1470
|
+
slashed: bigint;
|
|
1327
1471
|
}
|
|
1328
1472
|
interface EpochInfo {
|
|
1329
1473
|
currentEpoch: bigint;
|
|
1474
|
+
lastFinalizedEpoch: bigint;
|
|
1330
1475
|
validatorMinStake: string;
|
|
1331
1476
|
validatorMinStakeRaw: bigint;
|
|
1332
1477
|
delegatorMinStake: string;
|
|
1333
1478
|
delegatorMinStakeRaw: bigint;
|
|
1334
1479
|
activeValidatorsCount: bigint;
|
|
1335
1480
|
epochMinDuration: bigint;
|
|
1336
|
-
currentEpochStart: Date;
|
|
1337
|
-
currentEpochEnd: Date | null;
|
|
1338
1481
|
nextEpochEstimate: Date | null;
|
|
1339
|
-
inflation: string;
|
|
1340
|
-
inflationRaw: bigint;
|
|
1341
|
-
totalWeight: bigint;
|
|
1342
|
-
totalClaimed: string;
|
|
1343
|
-
totalClaimedRaw: bigint;
|
|
1344
1482
|
}
|
|
1345
1483
|
interface StakingTransactionResult {
|
|
1346
1484
|
transactionHash: `0x${string}`;
|
|
@@ -1417,8 +1555,10 @@ interface StakingActions {
|
|
|
1417
1555
|
getValidatorInfo: (validator: Address) => Promise<ValidatorInfo>;
|
|
1418
1556
|
getStakeInfo: (delegator: Address, validator: Address) => Promise<StakeInfo>;
|
|
1419
1557
|
getEpochInfo: () => Promise<EpochInfo>;
|
|
1558
|
+
getEpochData: (epochNumber: bigint) => Promise<EpochData>;
|
|
1420
1559
|
getActiveValidators: () => Promise<Address[]>;
|
|
1421
1560
|
getActiveValidatorsCount: () => Promise<bigint>;
|
|
1561
|
+
getSlashingAddress: () => Promise<Address>;
|
|
1422
1562
|
getStakingContract: () => StakingContract;
|
|
1423
1563
|
parseStakingAmount: (amount: string | bigint) => bigint;
|
|
1424
1564
|
formatStakingAmount: (amount: bigint) => string;
|
|
@@ -1540,4 +1680,4 @@ type GenLayerClient<TGenLayerChain extends GenLayerChain> = Omit<Client<Transpor
|
|
|
1540
1680
|
}) => Promise<any>;
|
|
1541
1681
|
} & StakingActions;
|
|
1542
1682
|
|
|
1543
|
-
export { type
|
|
1683
|
+
export { type ValidatorPrimeOptions as $, type ValidatorView as A, type ValidatorIdentity as B, type CalldataEncodable as C, type DecodedDeployData as D, type ValidatorInfo as E, type PendingWithdrawal as F, type GenLayerClient as G, type Hash as H, type BannedValidatorInfo as I, type StakeInfo as J, type EpochData as K, type LeaderReceipt as L, type MethodDescription as M, type Network as N, type EpochInfo as O, type PendingDeposit as P, type StakingTransactionResult as Q, type ValidatorJoinResult as R, STAKING_ABI as S, type TransactionDataElement as T, type DelegatorJoinResult as U, VALIDATOR_WALLET_ABI as V, type WithdrawalCommit as W, type ValidatorJoinOptions as X, type ValidatorDepositOptions as Y, type ValidatorExitOptions as Z, type ValidatorClaimOptions as _, type DecodedCallData as a, type SetOperatorOptions as a0, type SetIdentityOptions as a1, type DelegatorJoinOptions as a2, type DelegatorExitOptions as a3, type DelegatorClaimOptions as a4, type StakingActions as a5, type GenLayerRawTransaction as b, type GenLayerTransaction as c, CalldataAddress as d, type GenLayerMethod as e, type ContractParamsArraySchemaElement as f, type ContractParamsSchema as g, type ContractMethodBase as h, type ContractMethod as i, type ContractSchema as j, type TransactionHash as k, TransactionStatus as l, TransactionResult as m, transactionsStatusNameToNumber as n, DECIDED_STATES as o, isDecidedState as p, transactionResultNumberToName as q, TransactionResultNameToNumber as r, VoteType as s, transactionsStatusNumberToName as t, voteTypeNameToNumber as u, voteTypeNumberToName as v, type TransactionType as w, TransactionHashVariant as x, type SnapSource as y, type StakingContract as z };
|