genlayer-js 0.18.8 → 0.18.10
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-WTAFQOXC.cjs → chunk-PPBY3UXF.cjs} +48 -7
- package/dist/{chunk-V4ZFI4GV.js → chunk-WZNF2WK4.js} +48 -7
- package/dist/{index-C3KT8eu_.d.cts → index-D9ONjYgl.d.cts} +99 -22
- package/dist/{index-BNui_XYa.d.ts → index-ZDqJWXj0.d.ts} +99 -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 +61 -0
- package/src/chains/testnetAsimov.ts +6 -4
- 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/tests/smoke.test.ts +59 -0
package/CHANGELOG.md
CHANGED
package/dist/chains/index.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkPPBY3UXFcjs = require('../chunk-PPBY3UXF.cjs');
|
|
6
6
|
require('../chunk-75ZPJI57.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.localnet =
|
|
11
|
+
exports.localnet = _chunkPPBY3UXFcjs.localnet; exports.studionet = _chunkPPBY3UXFcjs.studionet; exports.testnetAsimov = _chunkPPBY3UXFcjs.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",
|
|
@@ -8350,6 +8353,13 @@ var STAKING_ABI = [
|
|
|
8350
8353
|
inputs: [],
|
|
8351
8354
|
outputs: [{ name: "", type: "uint256" }]
|
|
8352
8355
|
},
|
|
8356
|
+
{
|
|
8357
|
+
name: "finalized",
|
|
8358
|
+
type: "function",
|
|
8359
|
+
stateMutability: "view",
|
|
8360
|
+
inputs: [],
|
|
8361
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
8362
|
+
},
|
|
8353
8363
|
{
|
|
8354
8364
|
name: "validatorMinStake",
|
|
8355
8365
|
type: "function",
|
|
@@ -8397,7 +8407,8 @@ var STAKING_ABI = [
|
|
|
8397
8407
|
{ name: "vcount", type: "uint256" },
|
|
8398
8408
|
{ name: "claimed", type: "uint256" },
|
|
8399
8409
|
{ name: "stakeDeposit", type: "uint256" },
|
|
8400
|
-
{ name: "stakeWithdrawal", type: "uint256" }
|
|
8410
|
+
{ name: "stakeWithdrawal", type: "uint256" },
|
|
8411
|
+
{ name: "slashed", type: "uint256" }
|
|
8401
8412
|
]
|
|
8402
8413
|
}
|
|
8403
8414
|
]
|
|
@@ -8421,7 +8432,8 @@ var STAKING_ABI = [
|
|
|
8421
8432
|
{ name: "vcount", type: "uint256" },
|
|
8422
8433
|
{ name: "claimed", type: "uint256" },
|
|
8423
8434
|
{ name: "stakeDeposit", type: "uint256" },
|
|
8424
|
-
{ name: "stakeWithdrawal", type: "uint256" }
|
|
8435
|
+
{ name: "stakeWithdrawal", type: "uint256" },
|
|
8436
|
+
{ name: "slashed", type: "uint256" }
|
|
8425
8437
|
]
|
|
8426
8438
|
}
|
|
8427
8439
|
]
|
|
@@ -8661,18 +8673,46 @@ var STAKING_ABI = [
|
|
|
8661
8673
|
{ name: "validator", type: "address", indexed: false },
|
|
8662
8674
|
{ name: "amount", type: "uint256", indexed: false }
|
|
8663
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
|
+
]
|
|
8664
8703
|
}
|
|
8665
8704
|
];
|
|
8666
8705
|
|
|
8667
8706
|
// src/chains/testnetAsimov.ts
|
|
8668
|
-
var TESTNET_JSON_RPC_URL = "https://
|
|
8707
|
+
var TESTNET_JSON_RPC_URL = "https://zksync-os-testnet-genlayer.zksync.dev";
|
|
8708
|
+
var TESTNET_WS_URL = "wss://zksync-os-testnet-alpha.zksync.dev/ws";
|
|
8669
8709
|
var STAKING_CONTRACT = {
|
|
8670
|
-
address: "
|
|
8710
|
+
address: "0x63Fa5E0bb10fb6fA98F44726C5518223F767687A",
|
|
8671
8711
|
abi: STAKING_ABI
|
|
8672
8712
|
};
|
|
8673
8713
|
var EXPLORER_URL2 = "https://explorer-asimov.genlayer.com/";
|
|
8674
8714
|
var CONSENSUS_MAIN_CONTRACT3 = {
|
|
8675
|
-
address: "
|
|
8715
|
+
address: "0x6CAFF6769d70824745AD895663409DC70aB5B28E",
|
|
8676
8716
|
abi: [
|
|
8677
8717
|
{
|
|
8678
8718
|
inputs: [],
|
|
@@ -10061,7 +10101,7 @@ var CONSENSUS_MAIN_CONTRACT3 = {
|
|
|
10061
10101
|
bytecode: ""
|
|
10062
10102
|
};
|
|
10063
10103
|
var CONSENSUS_DATA_CONTRACT3 = {
|
|
10064
|
-
address: "
|
|
10104
|
+
address: "0x0D9d1d74d72Fa5eB94bcf746C8FCcb312a722c9B",
|
|
10065
10105
|
abi: [
|
|
10066
10106
|
{
|
|
10067
10107
|
inputs: [],
|
|
@@ -12647,7 +12687,8 @@ var testnetAsimov = _viem.defineChain.call(void 0, {
|
|
|
12647
12687
|
name: "Genlayer Asimov Testnet",
|
|
12648
12688
|
rpcUrls: {
|
|
12649
12689
|
default: {
|
|
12650
|
-
http: [TESTNET_JSON_RPC_URL]
|
|
12690
|
+
http: [TESTNET_JSON_RPC_URL],
|
|
12691
|
+
webSocket: [TESTNET_WS_URL]
|
|
12651
12692
|
}
|
|
12652
12693
|
},
|
|
12653
12694
|
nativeCurrency: {
|
|
@@ -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",
|
|
@@ -8350,6 +8353,13 @@ var STAKING_ABI = [
|
|
|
8350
8353
|
inputs: [],
|
|
8351
8354
|
outputs: [{ name: "", type: "uint256" }]
|
|
8352
8355
|
},
|
|
8356
|
+
{
|
|
8357
|
+
name: "finalized",
|
|
8358
|
+
type: "function",
|
|
8359
|
+
stateMutability: "view",
|
|
8360
|
+
inputs: [],
|
|
8361
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
8362
|
+
},
|
|
8353
8363
|
{
|
|
8354
8364
|
name: "validatorMinStake",
|
|
8355
8365
|
type: "function",
|
|
@@ -8397,7 +8407,8 @@ var STAKING_ABI = [
|
|
|
8397
8407
|
{ name: "vcount", type: "uint256" },
|
|
8398
8408
|
{ name: "claimed", type: "uint256" },
|
|
8399
8409
|
{ name: "stakeDeposit", type: "uint256" },
|
|
8400
|
-
{ name: "stakeWithdrawal", type: "uint256" }
|
|
8410
|
+
{ name: "stakeWithdrawal", type: "uint256" },
|
|
8411
|
+
{ name: "slashed", type: "uint256" }
|
|
8401
8412
|
]
|
|
8402
8413
|
}
|
|
8403
8414
|
]
|
|
@@ -8421,7 +8432,8 @@ var STAKING_ABI = [
|
|
|
8421
8432
|
{ name: "vcount", type: "uint256" },
|
|
8422
8433
|
{ name: "claimed", type: "uint256" },
|
|
8423
8434
|
{ name: "stakeDeposit", type: "uint256" },
|
|
8424
|
-
{ name: "stakeWithdrawal", type: "uint256" }
|
|
8435
|
+
{ name: "stakeWithdrawal", type: "uint256" },
|
|
8436
|
+
{ name: "slashed", type: "uint256" }
|
|
8425
8437
|
]
|
|
8426
8438
|
}
|
|
8427
8439
|
]
|
|
@@ -8661,18 +8673,46 @@ var STAKING_ABI = [
|
|
|
8661
8673
|
{ name: "validator", type: "address", indexed: false },
|
|
8662
8674
|
{ name: "amount", type: "uint256", indexed: false }
|
|
8663
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
|
+
]
|
|
8664
8703
|
}
|
|
8665
8704
|
];
|
|
8666
8705
|
|
|
8667
8706
|
// src/chains/testnetAsimov.ts
|
|
8668
|
-
var TESTNET_JSON_RPC_URL = "https://
|
|
8707
|
+
var TESTNET_JSON_RPC_URL = "https://zksync-os-testnet-genlayer.zksync.dev";
|
|
8708
|
+
var TESTNET_WS_URL = "wss://zksync-os-testnet-alpha.zksync.dev/ws";
|
|
8669
8709
|
var STAKING_CONTRACT = {
|
|
8670
|
-
address: "
|
|
8710
|
+
address: "0x63Fa5E0bb10fb6fA98F44726C5518223F767687A",
|
|
8671
8711
|
abi: STAKING_ABI
|
|
8672
8712
|
};
|
|
8673
8713
|
var EXPLORER_URL2 = "https://explorer-asimov.genlayer.com/";
|
|
8674
8714
|
var CONSENSUS_MAIN_CONTRACT3 = {
|
|
8675
|
-
address: "
|
|
8715
|
+
address: "0x6CAFF6769d70824745AD895663409DC70aB5B28E",
|
|
8676
8716
|
abi: [
|
|
8677
8717
|
{
|
|
8678
8718
|
inputs: [],
|
|
@@ -10061,7 +10101,7 @@ var CONSENSUS_MAIN_CONTRACT3 = {
|
|
|
10061
10101
|
bytecode: ""
|
|
10062
10102
|
};
|
|
10063
10103
|
var CONSENSUS_DATA_CONTRACT3 = {
|
|
10064
|
-
address: "
|
|
10104
|
+
address: "0x0D9d1d74d72Fa5eB94bcf746C8FCcb312a722c9B",
|
|
10065
10105
|
abi: [
|
|
10066
10106
|
{
|
|
10067
10107
|
inputs: [],
|
|
@@ -12647,7 +12687,8 @@ var testnetAsimov = defineChain3({
|
|
|
12647
12687
|
name: "Genlayer Asimov Testnet",
|
|
12648
12688
|
rpcUrls: {
|
|
12649
12689
|
default: {
|
|
12650
|
-
http: [TESTNET_JSON_RPC_URL]
|
|
12690
|
+
http: [TESTNET_JSON_RPC_URL],
|
|
12691
|
+
webSocket: [TESTNET_WS_URL]
|
|
12651
12692
|
}
|
|
12652
12693
|
},
|
|
12653
12694
|
nativeCurrency: {
|
|
@@ -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";
|
|
@@ -841,6 +856,15 @@ declare const STAKING_ABI: readonly [{
|
|
|
841
856
|
readonly name: "";
|
|
842
857
|
readonly type: "uint256";
|
|
843
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
|
+
}];
|
|
844
868
|
}, {
|
|
845
869
|
readonly name: "validatorMinStake";
|
|
846
870
|
readonly type: "function";
|
|
@@ -915,6 +939,9 @@ declare const STAKING_ABI: readonly [{
|
|
|
915
939
|
}, {
|
|
916
940
|
readonly name: "stakeWithdrawal";
|
|
917
941
|
readonly type: "uint256";
|
|
942
|
+
}, {
|
|
943
|
+
readonly name: "slashed";
|
|
944
|
+
readonly type: "uint256";
|
|
918
945
|
}];
|
|
919
946
|
}];
|
|
920
947
|
}, {
|
|
@@ -955,6 +982,9 @@ declare const STAKING_ABI: readonly [{
|
|
|
955
982
|
}, {
|
|
956
983
|
readonly name: "stakeWithdrawal";
|
|
957
984
|
readonly type: "uint256";
|
|
985
|
+
}, {
|
|
986
|
+
readonly name: "slashed";
|
|
987
|
+
readonly type: "uint256";
|
|
958
988
|
}];
|
|
959
989
|
}];
|
|
960
990
|
}, {
|
|
@@ -1288,6 +1318,56 @@ declare const STAKING_ABI: readonly [{
|
|
|
1288
1318
|
readonly type: "uint256";
|
|
1289
1319
|
readonly indexed: false;
|
|
1290
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
|
+
}];
|
|
1291
1371
|
}];
|
|
1292
1372
|
|
|
1293
1373
|
type WalletClientWithAccount = Client<Transport, Chain, Account>;
|
|
@@ -1387,23 +1467,18 @@ interface EpochData {
|
|
|
1387
1467
|
claimed: bigint;
|
|
1388
1468
|
stakeDeposit: bigint;
|
|
1389
1469
|
stakeWithdrawal: bigint;
|
|
1470
|
+
slashed: bigint;
|
|
1390
1471
|
}
|
|
1391
1472
|
interface EpochInfo {
|
|
1392
1473
|
currentEpoch: bigint;
|
|
1474
|
+
lastFinalizedEpoch: bigint;
|
|
1393
1475
|
validatorMinStake: string;
|
|
1394
1476
|
validatorMinStakeRaw: bigint;
|
|
1395
1477
|
delegatorMinStake: string;
|
|
1396
1478
|
delegatorMinStakeRaw: bigint;
|
|
1397
1479
|
activeValidatorsCount: bigint;
|
|
1398
1480
|
epochMinDuration: bigint;
|
|
1399
|
-
currentEpochStart: Date;
|
|
1400
|
-
currentEpochEnd: Date | null;
|
|
1401
1481
|
nextEpochEstimate: Date | null;
|
|
1402
|
-
inflation: string;
|
|
1403
|
-
inflationRaw: bigint;
|
|
1404
|
-
totalWeight: bigint;
|
|
1405
|
-
totalClaimed: string;
|
|
1406
|
-
totalClaimedRaw: bigint;
|
|
1407
1482
|
}
|
|
1408
1483
|
interface StakingTransactionResult {
|
|
1409
1484
|
transactionHash: `0x${string}`;
|
|
@@ -1480,8 +1555,10 @@ interface StakingActions {
|
|
|
1480
1555
|
getValidatorInfo: (validator: Address) => Promise<ValidatorInfo>;
|
|
1481
1556
|
getStakeInfo: (delegator: Address, validator: Address) => Promise<StakeInfo>;
|
|
1482
1557
|
getEpochInfo: () => Promise<EpochInfo>;
|
|
1558
|
+
getEpochData: (epochNumber: bigint) => Promise<EpochData>;
|
|
1483
1559
|
getActiveValidators: () => Promise<Address[]>;
|
|
1484
1560
|
getActiveValidatorsCount: () => Promise<bigint>;
|
|
1561
|
+
getSlashingAddress: () => Promise<Address>;
|
|
1485
1562
|
getStakingContract: () => StakingContract;
|
|
1486
1563
|
parseStakingAmount: (amount: string | bigint) => bigint;
|
|
1487
1564
|
formatStakingAmount: (amount: bigint) => string;
|
|
@@ -1603,4 +1680,4 @@ type GenLayerClient<TGenLayerChain extends GenLayerChain> = Omit<Client<Transpor
|
|
|
1603
1680
|
}) => Promise<any>;
|
|
1604
1681
|
} & StakingActions;
|
|
1605
1682
|
|
|
1606
|
-
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 };
|
|
@@ -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";
|
|
@@ -841,6 +856,15 @@ declare const STAKING_ABI: readonly [{
|
|
|
841
856
|
readonly name: "";
|
|
842
857
|
readonly type: "uint256";
|
|
843
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
|
+
}];
|
|
844
868
|
}, {
|
|
845
869
|
readonly name: "validatorMinStake";
|
|
846
870
|
readonly type: "function";
|
|
@@ -915,6 +939,9 @@ declare const STAKING_ABI: readonly [{
|
|
|
915
939
|
}, {
|
|
916
940
|
readonly name: "stakeWithdrawal";
|
|
917
941
|
readonly type: "uint256";
|
|
942
|
+
}, {
|
|
943
|
+
readonly name: "slashed";
|
|
944
|
+
readonly type: "uint256";
|
|
918
945
|
}];
|
|
919
946
|
}];
|
|
920
947
|
}, {
|
|
@@ -955,6 +982,9 @@ declare const STAKING_ABI: readonly [{
|
|
|
955
982
|
}, {
|
|
956
983
|
readonly name: "stakeWithdrawal";
|
|
957
984
|
readonly type: "uint256";
|
|
985
|
+
}, {
|
|
986
|
+
readonly name: "slashed";
|
|
987
|
+
readonly type: "uint256";
|
|
958
988
|
}];
|
|
959
989
|
}];
|
|
960
990
|
}, {
|
|
@@ -1288,6 +1318,56 @@ declare const STAKING_ABI: readonly [{
|
|
|
1288
1318
|
readonly type: "uint256";
|
|
1289
1319
|
readonly indexed: false;
|
|
1290
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
|
+
}];
|
|
1291
1371
|
}];
|
|
1292
1372
|
|
|
1293
1373
|
type WalletClientWithAccount = Client<Transport, Chain, Account>;
|
|
@@ -1387,23 +1467,18 @@ interface EpochData {
|
|
|
1387
1467
|
claimed: bigint;
|
|
1388
1468
|
stakeDeposit: bigint;
|
|
1389
1469
|
stakeWithdrawal: bigint;
|
|
1470
|
+
slashed: bigint;
|
|
1390
1471
|
}
|
|
1391
1472
|
interface EpochInfo {
|
|
1392
1473
|
currentEpoch: bigint;
|
|
1474
|
+
lastFinalizedEpoch: bigint;
|
|
1393
1475
|
validatorMinStake: string;
|
|
1394
1476
|
validatorMinStakeRaw: bigint;
|
|
1395
1477
|
delegatorMinStake: string;
|
|
1396
1478
|
delegatorMinStakeRaw: bigint;
|
|
1397
1479
|
activeValidatorsCount: bigint;
|
|
1398
1480
|
epochMinDuration: bigint;
|
|
1399
|
-
currentEpochStart: Date;
|
|
1400
|
-
currentEpochEnd: Date | null;
|
|
1401
1481
|
nextEpochEstimate: Date | null;
|
|
1402
|
-
inflation: string;
|
|
1403
|
-
inflationRaw: bigint;
|
|
1404
|
-
totalWeight: bigint;
|
|
1405
|
-
totalClaimed: string;
|
|
1406
|
-
totalClaimedRaw: bigint;
|
|
1407
1482
|
}
|
|
1408
1483
|
interface StakingTransactionResult {
|
|
1409
1484
|
transactionHash: `0x${string}`;
|
|
@@ -1480,8 +1555,10 @@ interface StakingActions {
|
|
|
1480
1555
|
getValidatorInfo: (validator: Address) => Promise<ValidatorInfo>;
|
|
1481
1556
|
getStakeInfo: (delegator: Address, validator: Address) => Promise<StakeInfo>;
|
|
1482
1557
|
getEpochInfo: () => Promise<EpochInfo>;
|
|
1558
|
+
getEpochData: (epochNumber: bigint) => Promise<EpochData>;
|
|
1483
1559
|
getActiveValidators: () => Promise<Address[]>;
|
|
1484
1560
|
getActiveValidatorsCount: () => Promise<bigint>;
|
|
1561
|
+
getSlashingAddress: () => Promise<Address>;
|
|
1485
1562
|
getStakingContract: () => StakingContract;
|
|
1486
1563
|
parseStakingAmount: (amount: string | bigint) => bigint;
|
|
1487
1564
|
formatStakingAmount: (amount: bigint) => string;
|
|
@@ -1603,4 +1680,4 @@ type GenLayerClient<TGenLayerChain extends GenLayerChain> = Omit<Client<Transpor
|
|
|
1603
1680
|
}) => Promise<any>;
|
|
1604
1681
|
} & StakingActions;
|
|
1605
1682
|
|
|
1606
|
-
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 };
|