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
|
@@ -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 };
|