genlayer-js 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chains/index.cjs +2 -2
- package/dist/chains/index.js +1 -1
- package/dist/{chunk-BU7ME7KN.js → chunk-C4Z24PT6.js} +14 -0
- package/dist/{chunk-3UA74NI6.cjs → chunk-NOMVZBCR.cjs} +14 -0
- package/dist/{index-DIh568LH.d.cts → index-DOok9G7O.d.cts} +22 -0
- package/dist/{index-BJ_hU-bk.d.ts → index-DbrlrnTQ.d.ts} +22 -0
- package/dist/index.cjs +42 -34
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -4
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/chains/index.cjs
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkNOMVZBCRcjs = require('../chunk-NOMVZBCR.cjs');
|
|
7
7
|
require('../chunk-75ZPJI57.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.localnet =
|
|
13
|
+
exports.localnet = _chunkNOMVZBCRcjs.localnet; exports.studionet = _chunkNOMVZBCRcjs.studionet; exports.testnetAsimov = _chunkNOMVZBCRcjs.testnetAsimov; exports.testnetBradbury = _chunkNOMVZBCRcjs.testnetBradbury;
|
package/dist/chains/index.js
CHANGED
|
@@ -9498,6 +9498,20 @@ var STAKING_ABI = [
|
|
|
9498
9498
|
inputs: [{ name: "_validator", type: "address" }],
|
|
9499
9499
|
outputs: [{ name: "", type: "uint256" }]
|
|
9500
9500
|
},
|
|
9501
|
+
{
|
|
9502
|
+
name: "validatorMinStake",
|
|
9503
|
+
type: "function",
|
|
9504
|
+
stateMutability: "view",
|
|
9505
|
+
inputs: [],
|
|
9506
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
9507
|
+
},
|
|
9508
|
+
{
|
|
9509
|
+
name: "delegatorMinStake",
|
|
9510
|
+
type: "function",
|
|
9511
|
+
stateMutability: "view",
|
|
9512
|
+
inputs: [],
|
|
9513
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
9514
|
+
},
|
|
9501
9515
|
{
|
|
9502
9516
|
name: "validatorsCount",
|
|
9503
9517
|
type: "function",
|
|
@@ -9498,6 +9498,20 @@ var STAKING_ABI = [
|
|
|
9498
9498
|
inputs: [{ name: "_validator", type: "address" }],
|
|
9499
9499
|
outputs: [{ name: "", type: "uint256" }]
|
|
9500
9500
|
},
|
|
9501
|
+
{
|
|
9502
|
+
name: "validatorMinStake",
|
|
9503
|
+
type: "function",
|
|
9504
|
+
stateMutability: "view",
|
|
9505
|
+
inputs: [],
|
|
9506
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
9507
|
+
},
|
|
9508
|
+
{
|
|
9509
|
+
name: "delegatorMinStake",
|
|
9510
|
+
type: "function",
|
|
9511
|
+
stateMutability: "view",
|
|
9512
|
+
inputs: [],
|
|
9513
|
+
outputs: [{ name: "", type: "uint256" }]
|
|
9514
|
+
},
|
|
9501
9515
|
{
|
|
9502
9516
|
name: "validatorsCount",
|
|
9503
9517
|
type: "function",
|
|
@@ -2503,6 +2503,24 @@ declare const STAKING_ABI: readonly [{
|
|
|
2503
2503
|
readonly name: "";
|
|
2504
2504
|
readonly type: "uint256";
|
|
2505
2505
|
}];
|
|
2506
|
+
}, {
|
|
2507
|
+
readonly name: "validatorMinStake";
|
|
2508
|
+
readonly type: "function";
|
|
2509
|
+
readonly stateMutability: "view";
|
|
2510
|
+
readonly inputs: readonly [];
|
|
2511
|
+
readonly outputs: readonly [{
|
|
2512
|
+
readonly name: "";
|
|
2513
|
+
readonly type: "uint256";
|
|
2514
|
+
}];
|
|
2515
|
+
}, {
|
|
2516
|
+
readonly name: "delegatorMinStake";
|
|
2517
|
+
readonly type: "function";
|
|
2518
|
+
readonly stateMutability: "view";
|
|
2519
|
+
readonly inputs: readonly [];
|
|
2520
|
+
readonly outputs: readonly [{
|
|
2521
|
+
readonly name: "";
|
|
2522
|
+
readonly type: "uint256";
|
|
2523
|
+
}];
|
|
2506
2524
|
}, {
|
|
2507
2525
|
readonly name: "validatorsCount";
|
|
2508
2526
|
readonly type: "function";
|
|
@@ -2637,6 +2655,10 @@ interface EpochInfo {
|
|
|
2637
2655
|
activeValidatorsCount: bigint;
|
|
2638
2656
|
epochMinDuration: bigint;
|
|
2639
2657
|
nextEpochEstimate: Date | null;
|
|
2658
|
+
validatorMinStake: string;
|
|
2659
|
+
validatorMinStakeRaw: bigint;
|
|
2660
|
+
delegatorMinStake: string;
|
|
2661
|
+
delegatorMinStakeRaw: bigint;
|
|
2640
2662
|
}
|
|
2641
2663
|
interface StakingTransactionResult {
|
|
2642
2664
|
transactionHash: `0x${string}`;
|
|
@@ -2503,6 +2503,24 @@ declare const STAKING_ABI: readonly [{
|
|
|
2503
2503
|
readonly name: "";
|
|
2504
2504
|
readonly type: "uint256";
|
|
2505
2505
|
}];
|
|
2506
|
+
}, {
|
|
2507
|
+
readonly name: "validatorMinStake";
|
|
2508
|
+
readonly type: "function";
|
|
2509
|
+
readonly stateMutability: "view";
|
|
2510
|
+
readonly inputs: readonly [];
|
|
2511
|
+
readonly outputs: readonly [{
|
|
2512
|
+
readonly name: "";
|
|
2513
|
+
readonly type: "uint256";
|
|
2514
|
+
}];
|
|
2515
|
+
}, {
|
|
2516
|
+
readonly name: "delegatorMinStake";
|
|
2517
|
+
readonly type: "function";
|
|
2518
|
+
readonly stateMutability: "view";
|
|
2519
|
+
readonly inputs: readonly [];
|
|
2520
|
+
readonly outputs: readonly [{
|
|
2521
|
+
readonly name: "";
|
|
2522
|
+
readonly type: "uint256";
|
|
2523
|
+
}];
|
|
2506
2524
|
}, {
|
|
2507
2525
|
readonly name: "validatorsCount";
|
|
2508
2526
|
readonly type: "function";
|
|
@@ -2637,6 +2655,10 @@ interface EpochInfo {
|
|
|
2637
2655
|
activeValidatorsCount: bigint;
|
|
2638
2656
|
epochMinDuration: bigint;
|
|
2639
2657
|
nextEpochEstimate: Date | null;
|
|
2658
|
+
validatorMinStake: string;
|
|
2659
|
+
validatorMinStakeRaw: bigint;
|
|
2660
|
+
delegatorMinStake: string;
|
|
2661
|
+
delegatorMinStakeRaw: bigint;
|
|
2640
2662
|
}
|
|
2641
2663
|
interface StakingTransactionResult {
|
|
2642
2664
|
transactionHash: `0x${string}`;
|
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNOMVZBCRcjs = require('./chunk-NOMVZBCR.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -32,7 +32,7 @@ var _viem = require('viem');
|
|
|
32
32
|
function accountActions(client) {
|
|
33
33
|
return {
|
|
34
34
|
fundAccount: async ({ address, amount }) => {
|
|
35
|
-
if (_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]) !==
|
|
35
|
+
if (_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]) !== _chunkNOMVZBCRcjs.localnet.id) {
|
|
36
36
|
throw new Error("Client is not connected to the localnet");
|
|
37
37
|
}
|
|
38
38
|
return client.request({
|
|
@@ -416,8 +416,8 @@ function serialize(data) {
|
|
|
416
416
|
// src/abi/index.ts
|
|
417
417
|
var abi_exports = {};
|
|
418
418
|
_chunk75ZPJI57cjs.__export.call(void 0, abi_exports, {
|
|
419
|
-
STAKING_ABI: () =>
|
|
420
|
-
VALIDATOR_WALLET_ABI: () =>
|
|
419
|
+
STAKING_ABI: () => _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
420
|
+
VALIDATOR_WALLET_ABI: () => _chunkNOMVZBCRcjs.VALIDATOR_WALLET_ABI,
|
|
421
421
|
calldata: () => calldata,
|
|
422
422
|
transactions: () => transactions
|
|
423
423
|
});
|
|
@@ -530,7 +530,7 @@ function extractGenCallResult(result) {
|
|
|
530
530
|
var contractActions = (client, publicClient) => {
|
|
531
531
|
return {
|
|
532
532
|
getContractCode: async (address) => {
|
|
533
|
-
if (client.chain.id !==
|
|
533
|
+
if (client.chain.id !== _chunkNOMVZBCRcjs.localnet.id) {
|
|
534
534
|
throw new Error("Getting contract code is not supported on this network");
|
|
535
535
|
}
|
|
536
536
|
const result = await client.request({
|
|
@@ -541,7 +541,7 @@ var contractActions = (client, publicClient) => {
|
|
|
541
541
|
return new TextDecoder().decode(codeBytes);
|
|
542
542
|
},
|
|
543
543
|
getContractSchema: async (address) => {
|
|
544
|
-
if (client.chain.id !==
|
|
544
|
+
if (client.chain.id !== _chunkNOMVZBCRcjs.localnet.id) {
|
|
545
545
|
throw new Error("Contract schema is not supported on this network");
|
|
546
546
|
}
|
|
547
547
|
const schema = await client.request({
|
|
@@ -551,7 +551,7 @@ var contractActions = (client, publicClient) => {
|
|
|
551
551
|
return schema;
|
|
552
552
|
},
|
|
553
553
|
getContractSchemaForCode: async (contractCode) => {
|
|
554
|
-
if (client.chain.id !==
|
|
554
|
+
if (client.chain.id !== _chunkNOMVZBCRcjs.localnet.id) {
|
|
555
555
|
throw new Error("Contract schema is not supported on this network");
|
|
556
556
|
}
|
|
557
557
|
const schema = await client.request({
|
|
@@ -1236,7 +1236,7 @@ var receiptActions = (client, publicClient) => ({
|
|
|
1236
1236
|
const requestedStatus = _chunkW4V73RPNcjs.transactionsStatusNameToNumber[status];
|
|
1237
1237
|
if (transactionStatusString === requestedStatus || status === "ACCEPTED" /* ACCEPTED */ && _chunkW4V73RPNcjs.isDecidedState.call(void 0, transactionStatusString)) {
|
|
1238
1238
|
let finalTransaction = transaction;
|
|
1239
|
-
if (client.chain.id ===
|
|
1239
|
+
if (client.chain.id === _chunkNOMVZBCRcjs.localnet.id) {
|
|
1240
1240
|
finalTransaction = decodeLocalnetTransaction(transaction);
|
|
1241
1241
|
}
|
|
1242
1242
|
if (!fullTransaction) {
|
|
@@ -1328,10 +1328,10 @@ var snapID = {
|
|
|
1328
1328
|
|
|
1329
1329
|
// src/wallet/connect.ts
|
|
1330
1330
|
var networks = {
|
|
1331
|
-
localnet:
|
|
1332
|
-
studionet:
|
|
1333
|
-
testnetAsimov:
|
|
1334
|
-
testnetBradbury:
|
|
1331
|
+
localnet: _chunkNOMVZBCRcjs.localnet,
|
|
1332
|
+
studionet: _chunkNOMVZBCRcjs.studionet,
|
|
1333
|
+
testnetAsimov: _chunkNOMVZBCRcjs.testnetAsimov,
|
|
1334
|
+
testnetBradbury: _chunkNOMVZBCRcjs.testnetBradbury
|
|
1335
1335
|
};
|
|
1336
1336
|
var connect = async (client, network = "studionet", snapSource = "npm") => {
|
|
1337
1337
|
if (!window.ethereum) {
|
|
@@ -1447,7 +1447,7 @@ function formatStakingAmount(amount) {
|
|
|
1447
1447
|
// src/staking/actions.ts
|
|
1448
1448
|
var FALLBACK_GAS = 1000000n;
|
|
1449
1449
|
var GAS_BUFFER_MULTIPLIER = 2n;
|
|
1450
|
-
var COMBINED_ERROR_ABI = [...
|
|
1450
|
+
var COMBINED_ERROR_ABI = [..._chunkNOMVZBCRcjs.STAKING_ABI, ..._chunkNOMVZBCRcjs.VALIDATOR_WALLET_ABI];
|
|
1451
1451
|
function extractRevertReason(err) {
|
|
1452
1452
|
if (err instanceof _viem.BaseError) {
|
|
1453
1453
|
const rawError = err.walk((e) => e instanceof _viem.RawContractError);
|
|
@@ -1579,7 +1579,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1579
1579
|
const address = getStakingAddress();
|
|
1580
1580
|
return _viem.getContract.call(void 0, {
|
|
1581
1581
|
address,
|
|
1582
|
-
abi:
|
|
1582
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1583
1583
|
client: { public: publicClient, wallet: client }
|
|
1584
1584
|
});
|
|
1585
1585
|
};
|
|
@@ -1587,7 +1587,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1587
1587
|
const address = getStakingAddress();
|
|
1588
1588
|
return _viem.getContract.call(void 0, {
|
|
1589
1589
|
address,
|
|
1590
|
-
abi:
|
|
1590
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1591
1591
|
client: publicClient
|
|
1592
1592
|
});
|
|
1593
1593
|
};
|
|
@@ -1596,11 +1596,11 @@ var stakingActions = (client, publicClient) => {
|
|
|
1596
1596
|
const amount = parseStakingAmount(options.amount);
|
|
1597
1597
|
const stakingAddress = getStakingAddress();
|
|
1598
1598
|
const data = options.operator ? _viem.encodeFunctionData.call(void 0, {
|
|
1599
|
-
abi:
|
|
1599
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1600
1600
|
functionName: "validatorJoin",
|
|
1601
1601
|
args: [options.operator]
|
|
1602
1602
|
}) : _viem.encodeFunctionData.call(void 0, {
|
|
1603
|
-
abi:
|
|
1603
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1604
1604
|
functionName: "validatorJoin"
|
|
1605
1605
|
});
|
|
1606
1606
|
const result = await executeWrite({ to: stakingAddress, data, value: amount });
|
|
@@ -1609,7 +1609,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1609
1609
|
let eventFound = false;
|
|
1610
1610
|
for (const log of receipt.logs) {
|
|
1611
1611
|
try {
|
|
1612
|
-
const decoded = _viem.decodeEventLog.call(void 0, { abi:
|
|
1612
|
+
const decoded = _viem.decodeEventLog.call(void 0, { abi: _chunkNOMVZBCRcjs.STAKING_ABI, data: log.data, topics: log.topics });
|
|
1613
1613
|
if (decoded.eventName === "ValidatorJoin") {
|
|
1614
1614
|
validatorWallet = decoded.args.validator;
|
|
1615
1615
|
eventFound = true;
|
|
@@ -1636,7 +1636,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1636
1636
|
validatorDeposit: async (options) => {
|
|
1637
1637
|
const amount = parseStakingAmount(options.amount);
|
|
1638
1638
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1639
|
-
abi:
|
|
1639
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1640
1640
|
functionName: "validatorDeposit"
|
|
1641
1641
|
});
|
|
1642
1642
|
return executeWrite({ to: getStakingAddress(), data, value: amount });
|
|
@@ -1644,7 +1644,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1644
1644
|
validatorExit: async (options) => {
|
|
1645
1645
|
const shares = typeof options.shares === "string" ? BigInt(options.shares) : options.shares;
|
|
1646
1646
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1647
|
-
abi:
|
|
1647
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1648
1648
|
functionName: "validatorExit",
|
|
1649
1649
|
args: [shares]
|
|
1650
1650
|
});
|
|
@@ -1656,7 +1656,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1656
1656
|
}
|
|
1657
1657
|
const validatorAddress = _optionalChain([options, 'optionalAccess', _117 => _117.validator]) || client.account.address;
|
|
1658
1658
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1659
|
-
abi:
|
|
1659
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1660
1660
|
functionName: "validatorClaim",
|
|
1661
1661
|
args: [validatorAddress]
|
|
1662
1662
|
});
|
|
@@ -1665,7 +1665,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1665
1665
|
},
|
|
1666
1666
|
validatorPrime: async (options) => {
|
|
1667
1667
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1668
|
-
abi:
|
|
1668
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1669
1669
|
functionName: "validatorPrime",
|
|
1670
1670
|
args: [options.validator]
|
|
1671
1671
|
});
|
|
@@ -1673,7 +1673,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1673
1673
|
},
|
|
1674
1674
|
setOperator: async (options) => {
|
|
1675
1675
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1676
|
-
abi:
|
|
1676
|
+
abi: _chunkNOMVZBCRcjs.VALIDATOR_WALLET_ABI,
|
|
1677
1677
|
functionName: "setOperator",
|
|
1678
1678
|
args: [options.operator]
|
|
1679
1679
|
});
|
|
@@ -1689,7 +1689,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
1691
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1692
|
-
abi:
|
|
1692
|
+
abi: _chunkNOMVZBCRcjs.VALIDATOR_WALLET_ABI,
|
|
1693
1693
|
functionName: "setIdentity",
|
|
1694
1694
|
args: [
|
|
1695
1695
|
options.moniker,
|
|
@@ -1708,7 +1708,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1708
1708
|
delegatorJoin: async (options) => {
|
|
1709
1709
|
const amount = parseStakingAmount(options.amount);
|
|
1710
1710
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1711
|
-
abi:
|
|
1711
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1712
1712
|
functionName: "delegatorJoin",
|
|
1713
1713
|
args: [options.validator]
|
|
1714
1714
|
});
|
|
@@ -1724,7 +1724,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1724
1724
|
delegatorExit: async (options) => {
|
|
1725
1725
|
const shares = typeof options.shares === "string" ? BigInt(options.shares) : options.shares;
|
|
1726
1726
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1727
|
-
abi:
|
|
1727
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1728
1728
|
functionName: "delegatorExit",
|
|
1729
1729
|
args: [options.validator, shares]
|
|
1730
1730
|
});
|
|
@@ -1736,7 +1736,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
const delegatorAddress = options.delegator || client.account.address;
|
|
1738
1738
|
const data = _viem.encodeFunctionData.call(void 0, {
|
|
1739
|
-
abi:
|
|
1739
|
+
abi: _chunkNOMVZBCRcjs.STAKING_ABI,
|
|
1740
1740
|
functionName: "delegatorClaim",
|
|
1741
1741
|
args: [delegatorAddress, options.validator]
|
|
1742
1742
|
});
|
|
@@ -1754,7 +1754,7 @@ var stakingActions = (client, publicClient) => {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
const walletContract = _viem.getContract.call(void 0, {
|
|
1756
1756
|
address: validator,
|
|
1757
|
-
abi:
|
|
1757
|
+
abi: _chunkNOMVZBCRcjs.VALIDATOR_WALLET_ABI,
|
|
1758
1758
|
client: publicClient
|
|
1759
1759
|
});
|
|
1760
1760
|
const [view, owner, operator, identityRaw, currentEpoch] = await Promise.all([
|
|
@@ -1887,7 +1887,9 @@ var stakingActions = (client, publicClient) => {
|
|
|
1887
1887
|
epochMinDuration,
|
|
1888
1888
|
epochZeroMinDuration,
|
|
1889
1889
|
epochOdd,
|
|
1890
|
-
epochEven
|
|
1890
|
+
epochEven,
|
|
1891
|
+
valMinStake,
|
|
1892
|
+
delMinStake
|
|
1891
1893
|
] = await Promise.all([
|
|
1892
1894
|
contract.read.epoch(),
|
|
1893
1895
|
contract.read.finalized(),
|
|
@@ -1895,7 +1897,9 @@ var stakingActions = (client, publicClient) => {
|
|
|
1895
1897
|
contract.read.epochMinDuration(),
|
|
1896
1898
|
contract.read.epochZeroMinDuration(),
|
|
1897
1899
|
contract.read.epochOdd(),
|
|
1898
|
-
contract.read.epochEven()
|
|
1900
|
+
contract.read.epochEven(),
|
|
1901
|
+
contract.read.validatorMinStake(),
|
|
1902
|
+
contract.read.delegatorMinStake()
|
|
1899
1903
|
]);
|
|
1900
1904
|
const raw = epoch % 2n === 0n ? epochEven : epochOdd;
|
|
1901
1905
|
const currentEpochData = {
|
|
@@ -1923,7 +1927,11 @@ var stakingActions = (client, publicClient) => {
|
|
|
1923
1927
|
lastFinalizedEpoch: finalized,
|
|
1924
1928
|
activeValidatorsCount: activeCount,
|
|
1925
1929
|
epochMinDuration,
|
|
1926
|
-
nextEpochEstimate
|
|
1930
|
+
nextEpochEstimate,
|
|
1931
|
+
validatorMinStake: formatStakingAmount(valMinStake),
|
|
1932
|
+
validatorMinStakeRaw: valMinStake,
|
|
1933
|
+
delegatorMinStake: formatStakingAmount(delMinStake),
|
|
1934
|
+
delegatorMinStakeRaw: delMinStake
|
|
1927
1935
|
};
|
|
1928
1936
|
},
|
|
1929
1937
|
getEpochData: async (epochNumber) => {
|
|
@@ -2049,8 +2057,8 @@ var getCustomTransportConfig = (config, chainConfig) => {
|
|
|
2049
2057
|
}
|
|
2050
2058
|
};
|
|
2051
2059
|
};
|
|
2052
|
-
var createClient = (config = { chain:
|
|
2053
|
-
const chainConfig = config.chain ||
|
|
2060
|
+
var createClient = (config = { chain: _chunkNOMVZBCRcjs.localnet }) => {
|
|
2061
|
+
const chainConfig = config.chain || _chunkNOMVZBCRcjs.localnet;
|
|
2054
2062
|
if (config.endpoint) {
|
|
2055
2063
|
chainConfig.rpcUrls.default.http = [config.endpoint];
|
|
2056
2064
|
}
|
|
@@ -2187,4 +2195,4 @@ function validateValueAgainstType(value, type) {
|
|
|
2187
2195
|
|
|
2188
2196
|
|
|
2189
2197
|
|
|
2190
|
-
exports.abi = abi_exports; exports.buildGenVmPositionalArgs = buildGenVmPositionalArgs; exports.chains =
|
|
2198
|
+
exports.abi = abi_exports; exports.buildGenVmPositionalArgs = buildGenVmPositionalArgs; exports.chains = _chunkNOMVZBCRcjs.chains_exports; exports.createAccount = createAccount; exports.createClient = createClient; exports.decodeInputData = decodeInputData; exports.decodeLocalnetTransaction = decodeLocalnetTransaction; exports.decodeTransaction = decodeTransaction; exports.formatStakingAmount = formatStakingAmount; exports.generatePrivateKey = generatePrivateKey; exports.parseStakingAmount = parseStakingAmount; exports.simplifyTransactionReceipt = simplifyTransactionReceipt;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
2
|
import { Account, Address, Hex } from 'viem';
|
|
3
3
|
import { G as GenLayerChain } from './chains-DqSbucSW.cjs';
|
|
4
|
-
import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement, S as STAKING_ABI, V as VALIDATOR_WALLET_ABI, d as ContractSchema } from './index-
|
|
4
|
+
import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement, S as STAKING_ABI, V as VALIDATOR_WALLET_ABI, d as ContractSchema } from './index-DOok9G7O.cjs';
|
|
5
5
|
import * as abitype from 'abitype';
|
|
6
6
|
import * as viem__types_types_authorization from 'viem/_types/types/authorization';
|
|
7
7
|
import * as viem_accounts from 'viem/accounts';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
2
|
import { Account, Address, Hex } from 'viem';
|
|
3
3
|
import { G as GenLayerChain } from './chains-DqSbucSW.js';
|
|
4
|
-
import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement, S as STAKING_ABI, V as VALIDATOR_WALLET_ABI, d as ContractSchema } from './index-
|
|
4
|
+
import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement, S as STAKING_ABI, V as VALIDATOR_WALLET_ABI, d as ContractSchema } from './index-DbrlrnTQ.js';
|
|
5
5
|
import * as abitype from 'abitype';
|
|
6
6
|
import * as viem__types_types_authorization from 'viem/_types/types/authorization';
|
|
7
7
|
import * as viem_accounts from 'viem/accounts';
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
studionet,
|
|
7
7
|
testnetAsimov,
|
|
8
8
|
testnetBradbury
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-C4Z24PT6.js";
|
|
10
10
|
import {
|
|
11
11
|
CalldataAddress,
|
|
12
12
|
isDecidedState,
|
|
@@ -1887,7 +1887,9 @@ var stakingActions = (client, publicClient) => {
|
|
|
1887
1887
|
epochMinDuration,
|
|
1888
1888
|
epochZeroMinDuration,
|
|
1889
1889
|
epochOdd,
|
|
1890
|
-
epochEven
|
|
1890
|
+
epochEven,
|
|
1891
|
+
valMinStake,
|
|
1892
|
+
delMinStake
|
|
1891
1893
|
] = await Promise.all([
|
|
1892
1894
|
contract.read.epoch(),
|
|
1893
1895
|
contract.read.finalized(),
|
|
@@ -1895,7 +1897,9 @@ var stakingActions = (client, publicClient) => {
|
|
|
1895
1897
|
contract.read.epochMinDuration(),
|
|
1896
1898
|
contract.read.epochZeroMinDuration(),
|
|
1897
1899
|
contract.read.epochOdd(),
|
|
1898
|
-
contract.read.epochEven()
|
|
1900
|
+
contract.read.epochEven(),
|
|
1901
|
+
contract.read.validatorMinStake(),
|
|
1902
|
+
contract.read.delegatorMinStake()
|
|
1899
1903
|
]);
|
|
1900
1904
|
const raw = epoch % 2n === 0n ? epochEven : epochOdd;
|
|
1901
1905
|
const currentEpochData = {
|
|
@@ -1923,7 +1927,11 @@ var stakingActions = (client, publicClient) => {
|
|
|
1923
1927
|
lastFinalizedEpoch: finalized,
|
|
1924
1928
|
activeValidatorsCount: activeCount,
|
|
1925
1929
|
epochMinDuration,
|
|
1926
|
-
nextEpochEstimate
|
|
1930
|
+
nextEpochEstimate,
|
|
1931
|
+
validatorMinStake: formatStakingAmount(valMinStake),
|
|
1932
|
+
validatorMinStakeRaw: valMinStake,
|
|
1933
|
+
delegatorMinStake: formatStakingAmount(delMinStake),
|
|
1934
|
+
delegatorMinStakeRaw: delMinStake
|
|
1927
1935
|
};
|
|
1928
1936
|
},
|
|
1929
1937
|
getEpochData: async (epochNumber) => {
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Account, Address } from 'viem';
|
|
2
|
-
export { I as BannedValidatorInfo, e as CalldataAddress, C as CalldataEncodable, j as ContractMethod, i as ContractMethodBase, g as ContractParamsArraySchemaElement, h as ContractParamsSchema, d as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, a4 as DelegatorClaimOptions, a3 as DelegatorExitOptions, a2 as DelegatorJoinOptions, U as DelegatorJoinResult, K as EpochData, O as EpochInfo, G as GenLayerClient, f as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, L as LeaderReceipt, M as MethodDescription, N as Network, P as PendingDeposit, F as PendingWithdrawal, a1 as SetIdentityOptions, a0 as SetOperatorOptions, y as SnapSource, J as StakeInfo, a5 as StakingActions, z as StakingContract, Q as StakingTransactionResult, k as TransactionHash, x as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, w as TransactionType, _ as ValidatorClaimOptions, Y as ValidatorDepositOptions, Z as ValidatorExitOptions, B as ValidatorIdentity, E as ValidatorInfo, X as ValidatorJoinOptions, R 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-
|
|
2
|
+
export { I as BannedValidatorInfo, e as CalldataAddress, C as CalldataEncodable, j as ContractMethod, i as ContractMethodBase, g as ContractParamsArraySchemaElement, h as ContractParamsSchema, d as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, a4 as DelegatorClaimOptions, a3 as DelegatorExitOptions, a2 as DelegatorJoinOptions, U as DelegatorJoinResult, K as EpochData, O as EpochInfo, G as GenLayerClient, f as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, L as LeaderReceipt, M as MethodDescription, N as Network, P as PendingDeposit, F as PendingWithdrawal, a1 as SetIdentityOptions, a0 as SetOperatorOptions, y as SnapSource, J as StakeInfo, a5 as StakingActions, z as StakingContract, Q as StakingTransactionResult, k as TransactionHash, x as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, w as TransactionType, _ as ValidatorClaimOptions, Y as ValidatorDepositOptions, Z as ValidatorExitOptions, B as ValidatorIdentity, E as ValidatorInfo, X as ValidatorJoinOptions, R 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-DOok9G7O.cjs';
|
|
3
3
|
export { G as GenLayerChain } from '../chains-DqSbucSW.cjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Account, Address } from 'viem';
|
|
2
|
-
export { I as BannedValidatorInfo, e as CalldataAddress, C as CalldataEncodable, j as ContractMethod, i as ContractMethodBase, g as ContractParamsArraySchemaElement, h as ContractParamsSchema, d as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, a4 as DelegatorClaimOptions, a3 as DelegatorExitOptions, a2 as DelegatorJoinOptions, U as DelegatorJoinResult, K as EpochData, O as EpochInfo, G as GenLayerClient, f as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, L as LeaderReceipt, M as MethodDescription, N as Network, P as PendingDeposit, F as PendingWithdrawal, a1 as SetIdentityOptions, a0 as SetOperatorOptions, y as SnapSource, J as StakeInfo, a5 as StakingActions, z as StakingContract, Q as StakingTransactionResult, k as TransactionHash, x as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, w as TransactionType, _ as ValidatorClaimOptions, Y as ValidatorDepositOptions, Z as ValidatorExitOptions, B as ValidatorIdentity, E as ValidatorInfo, X as ValidatorJoinOptions, R 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-
|
|
2
|
+
export { I as BannedValidatorInfo, e as CalldataAddress, C as CalldataEncodable, j as ContractMethod, i as ContractMethodBase, g as ContractParamsArraySchemaElement, h as ContractParamsSchema, d as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, a4 as DelegatorClaimOptions, a3 as DelegatorExitOptions, a2 as DelegatorJoinOptions, U as DelegatorJoinResult, K as EpochData, O as EpochInfo, G as GenLayerClient, f as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, L as LeaderReceipt, M as MethodDescription, N as Network, P as PendingDeposit, F as PendingWithdrawal, a1 as SetIdentityOptions, a0 as SetOperatorOptions, y as SnapSource, J as StakeInfo, a5 as StakingActions, z as StakingContract, Q as StakingTransactionResult, k as TransactionHash, x as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, w as TransactionType, _ as ValidatorClaimOptions, Y as ValidatorDepositOptions, Z as ValidatorExitOptions, B as ValidatorIdentity, E as ValidatorInfo, X as ValidatorJoinOptions, R 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-DbrlrnTQ.js';
|
|
3
3
|
export { G as GenLayerChain } from '../chains-DqSbucSW.js';
|