@wireio/stake 0.4.3 → 0.5.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/lib/stake.browser.js +12682 -6721
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +158 -13
- package/lib/stake.js +12356 -6388
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +12682 -6721
- package/lib/stake.m.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/ethereum/ABI/common/Base58.sol/Base58.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/Base58.sol/Base58.json +164 -0
- package/src/assets/ethereum/ABI/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/OpenZepArtifacts.sol/__Dummy_OZ_UUPS__.json +76 -0
- package/src/assets/ethereum/ABI/common/RestrictedCallers.sol/RestrictedCallers.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/RestrictedCallers.sol/RestrictedCallers.json +10 -0
- package/src/assets/ethereum/ABI/common/iodata.sol/iodata.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/iodata.sol/iodata.json +618 -0
- package/src/assets/ethereum/ABI/common/iodata_util.sol/iodata_util.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/iodata_util.sol/iodata_util.json +40 -0
- package/src/assets/ethereum/ABI/common/sysio_data.sol/sysio_data.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_data.sol/sysio_data.json +10 -0
- package/src/assets/ethereum/ABI/common/sysio_errors.sol/sysio_errors.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_errors.sol/sysio_errors.json +10 -0
- package/src/assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_merkle.sol/sysio_merkle.json +233 -0
- package/src/assets/ethereum/ABI/common/sysio_name.sol/sysio_name.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_name.sol/sysio_name.json +49 -0
- package/src/assets/ethereum/ABI/common/sysio_pubkey.sol/sysio_pubkey.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_pubkey.sol/sysio_pubkey.json +64 -0
- package/src/assets/ethereum/ABI/common/sysio_read.sol/sysio_read.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_read.sol/sysio_read.json +1458 -0
- package/src/assets/ethereum/ABI/common/sysio_tester.sol/SysioTester.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_tester.sol/SysioTester.json +1532 -0
- package/src/assets/ethereum/ABI/common/sysio_verify.sol/sysio_verify.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_verify.sol/sysio_verify.json +1525 -0
- package/src/assets/ethereum/ABI/common/sysio_write.sol/sysio_write.dbg.json +4 -0
- package/src/assets/ethereum/ABI/common/sysio_write.sol/sysio_write.json +1076 -0
- package/src/assets/ethereum/ABI/liqEth/BeaconState.sol/BeaconState.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/DepositManager.sol/DepositManager.json +28 -2
- package/src/assets/ethereum/ABI/liqEth/LiqEthAuthority.sol/LiqEthAuthority.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IAccounting.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositContract.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IDepositManager.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/ILiqEthUpgradeable.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IRewardsERC20Pausable.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IStakingModule.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IValidatorBalanceVerifier.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/IWithdrawalRecord.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthCommon.sol/LiqEthCommon.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/LiqEthManaged.sol/LiqEthManaged.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/RewardsERC20.sol/RewardsERC20Upgradeable.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/RewardsERC20Pausable.sol/RewardsERC20PausableUpgradeable.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/Yield.sol/YieldOracle.json +2 -2
- package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/accounting.sol/Accounting.json +2 -15
- package/src/assets/ethereum/ABI/liqEth/liqEth.sol/LiqEthToken.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/stakingModule.sol/StakingModule.json +6 -25
- package/src/assets/ethereum/ABI/liqEth/withdrawalQueue.sol/WithdrawalQueue.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/Uint64BE.json +2 -2
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.dbg.json +1 -1
- package/src/assets/ethereum/ABI/liqEth/withdrawalVault.sol/WithdrawalVault.json +6 -25
- package/src/assets/ethereum/ABI/outpost/BAR.sol/BAR.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/Depositor.sol/Depositor.json +26 -26
- package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/AggregatorV3Interface.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/EthUsdPriceConsumer.sol/EthUsdPriceConsumer.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPP.sol/OPP.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPP.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPEndpoint.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPInbound.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPReceiver.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/IOPPSender.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPCommon.sol/OPPCommon.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPEndpoint.sol/OPPEndpoint.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPEndpointManaged.sol/OPPEndpointManaged.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPEndpointOwnable.sol/OPPEndpointOwnable.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPErrors.sol/OPPErrors.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPInbound.sol/OPPInbound.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPReceiver.sol/OPPReceiver.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OPPSender.sol/OPPSender.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OutpostErrors.sol/OutpostErrors.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OutpostManaged.sol/OutpostManaged.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OutpostManager.sol/OutpostManager.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OutpostManagerAuthority.sol/OutpostManagerAuthority.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostManager.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/IOutpostUpgradeable.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OutpostManagerCommon.sol/OutpostManagerCommon.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/OutpostOwnable.sol/OutpostOwnable.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/Pool.sol/Pool.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/Pool.sol/Pool.json +2 -2
- package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/Pretoken.sol/Pretoken.json +9 -9
- package/src/assets/ethereum/ABI/outpost/ReceiptNFT.sol/ReceiptNFT.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/interfaces/IPretoken.sol/IPretoken.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/interfaces/IWarrant.sol/IWarrant.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/token/ERC721EthEquivalentVotesUpgradeable.sol/ERC721EthEquivalentVotesUpgradeable.dbg.json +1 -1
- package/src/assets/ethereum/ABI/outpost/token/IERC721EthEquivalent.sol/IERC721EthEquivalent.dbg.json +1 -1
- package/src/networks/ethereum/clients/convert.client.ts +2 -2
- package/src/networks/ethereum/clients/pretoken.client.ts +6 -4
- package/src/networks/ethereum/clients/stake.client.ts +2 -2
- package/src/networks/ethereum/contract.ts +102 -49
- package/src/networks/ethereum/ethereum.ts +64 -52
- package/src/networks/ethereum/types.ts +26 -17
- package/src/networks/ethereum/utils.ts +8 -8
- package/src/networks/solana/clients/distribution.client.ts +36 -1
- package/src/networks/solana/solana.ts +131 -7
- package/src/networks/solana/types.ts +129 -0
- package/src/types.ts +6 -2
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/BeaconRoots.json +0 -10
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZ.json +0 -10
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZExtras.json +0 -10
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/SSZVec48.json +0 -10
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.dbg.json +0 -4
- package/src/assets/ethereum/ABI/liqEth/ValidatorBalanceVerifier.sol/ValidatorBalanceVerifier.json +0 -291
- package/src/assets/ethereum/ABI/outpost/Aggregator.sol/Aggregator.json +0 -82
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Transaction,
|
|
8
8
|
TransactionSignature,
|
|
9
9
|
} from '@solana/web3.js';
|
|
10
|
-
import { AnchorProvider } from '@coral-xyz/anchor';
|
|
10
|
+
import { AnchorProvider, BN } from '@coral-xyz/anchor';
|
|
11
11
|
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
12
12
|
import {
|
|
13
13
|
ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
} from './constants';
|
|
45
45
|
|
|
46
46
|
import { buildSolanaTrancheSnapshot } from './utils';
|
|
47
|
-
import { SolanaTransaction } from './types';
|
|
47
|
+
import { PayRateEntry, SolanaTransaction } from './types';
|
|
48
48
|
|
|
49
49
|
const commitment: Commitment = 'confirmed';
|
|
50
50
|
|
|
@@ -479,11 +479,127 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
479
479
|
return Promise.resolve(0);
|
|
480
480
|
}
|
|
481
481
|
|
|
482
|
-
//
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
482
|
+
// ---------------------------------------------
|
|
483
|
+
// Deposit fee calculation (SOL -> liqSOL)
|
|
484
|
+
// ---------------------------------------------
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Estimate the protocol deposit fee in lamports for a given SOL amount,
|
|
488
|
+
* based on recent pay rates and globalConfig.depositFeeMultiplier.
|
|
489
|
+
*
|
|
490
|
+
* - amountLamports: deposit notional in lamports
|
|
491
|
+
* - windowSize: how many recent payRate entries to average (default 5)
|
|
492
|
+
*
|
|
493
|
+
* Returns 0n if payRateHistory or globalConfig is missing, or if
|
|
494
|
+
* there are no valid pay-rate entries yet.
|
|
495
|
+
*/
|
|
496
|
+
async getDepositFee(
|
|
497
|
+
amountLamports: bigint,
|
|
498
|
+
windowSize = 5,
|
|
499
|
+
): Promise<bigint> {
|
|
500
|
+
if (amountLamports <= BigInt(0)) {
|
|
501
|
+
return BigInt(0);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
const [history, globalConfig] = await Promise.all([
|
|
505
|
+
this.distributionClient.getPayRateHistory(),
|
|
506
|
+
this.distributionClient.getGlobalConfig(),
|
|
507
|
+
]);
|
|
508
|
+
|
|
509
|
+
if (!history || !globalConfig) {
|
|
510
|
+
return BigInt(0);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const entries = history.entries ?? [];
|
|
514
|
+
if (!entries.length) {
|
|
515
|
+
return BigInt(0);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const maxEntries =
|
|
519
|
+
typeof history.maxEntries === 'number'
|
|
520
|
+
? history.maxEntries
|
|
521
|
+
: entries.length;
|
|
522
|
+
|
|
523
|
+
const totalEntriesAdded = new BN(
|
|
524
|
+
history.totalEntriesAdded.toString(),
|
|
525
|
+
);
|
|
526
|
+
|
|
527
|
+
const COUNT = Math.max(1, Math.min(windowSize, maxEntries, entries.length));
|
|
528
|
+
|
|
529
|
+
// ---------------------------------------------
|
|
530
|
+
// Walk the circular buffer from "most recent"
|
|
531
|
+
// back through COUNT entries, using the same
|
|
532
|
+
// logic as your coworker script.
|
|
533
|
+
// ---------------------------------------------
|
|
534
|
+
|
|
535
|
+
let avgPayRate = new BN(0);
|
|
536
|
+
|
|
537
|
+
if (COUNT > 0) {
|
|
538
|
+
let idx: number;
|
|
539
|
+
|
|
540
|
+
if (totalEntriesAdded.isZero()) {
|
|
541
|
+
// "Not wrapped yet" case
|
|
542
|
+
idx = 0;
|
|
543
|
+
} else if (history.currentIndex === 0) {
|
|
544
|
+
idx = maxEntries - 1;
|
|
545
|
+
} else {
|
|
546
|
+
idx = history.currentIndex - 1;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
let sum = new BN(0);
|
|
550
|
+
let valid = 0;
|
|
551
|
+
const zero = new BN(0);
|
|
552
|
+
|
|
553
|
+
for (let i = 0; i < COUNT; i++) {
|
|
554
|
+
const entry: PayRateEntry | undefined = entries[idx];
|
|
555
|
+
if (entry) {
|
|
556
|
+
const rate = new BN(entry.scaledRate.toString());
|
|
557
|
+
if (rate.gt(zero)) {
|
|
558
|
+
sum = sum.add(rate);
|
|
559
|
+
valid += 1;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// Same wrap logic as the coworker’s script:
|
|
564
|
+
if (totalEntriesAdded.isZero()) {
|
|
565
|
+
// simple forward iteration if never wrapped
|
|
566
|
+
idx = (idx + 1) % maxEntries;
|
|
567
|
+
} else {
|
|
568
|
+
// walk backwards through the ring buffer
|
|
569
|
+
idx = idx === 0 ? maxEntries - 1 : idx - 1;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
if (valid > 0) {
|
|
574
|
+
avgPayRate = this.ceilDiv(sum, new BN(valid));
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// If no valid pay-rate entries, no fee
|
|
579
|
+
if (avgPayRate.isZero()) {
|
|
580
|
+
return BigInt(0);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// depositFeeMultiplier may be BN or number depending on your type
|
|
584
|
+
const rawMultiplier: any = (globalConfig as any).depositFeeMultiplier;
|
|
585
|
+
const multiplier = new BN(
|
|
586
|
+
rawMultiplier?.toString?.() ?? rawMultiplier ?? 0,
|
|
587
|
+
);
|
|
588
|
+
if (multiplier.isZero()) {
|
|
589
|
+
return BigInt(0);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
const amountBn = new BN(amountLamports.toString());
|
|
593
|
+
|
|
594
|
+
// 10^12 scale (matches scaledRate / index scale)
|
|
595
|
+
const SCALE = new BN('1000000000000');
|
|
596
|
+
|
|
597
|
+
const feeBn = this.ceilDiv(
|
|
598
|
+
avgPayRate.mul(multiplier).mul(amountBn),
|
|
599
|
+
SCALE,
|
|
600
|
+
);
|
|
601
|
+
|
|
602
|
+
return BigInt(feeBn.toString());
|
|
487
603
|
}
|
|
488
604
|
|
|
489
605
|
/**
|
|
@@ -623,4 +739,12 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
623
739
|
);
|
|
624
740
|
}
|
|
625
741
|
}
|
|
742
|
+
|
|
743
|
+
private ceilDiv(n: BN, d: BN): BN {
|
|
744
|
+
if (d.isZero()) {
|
|
745
|
+
throw new Error('Division by zero in ceilDiv');
|
|
746
|
+
}
|
|
747
|
+
return n.add(d.subn(1)).div(d);
|
|
748
|
+
}
|
|
749
|
+
|
|
626
750
|
}
|
|
@@ -271,6 +271,135 @@ export type GlobalState = {
|
|
|
271
271
|
bump: number;
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* IDL: `globalConfig`
|
|
277
|
+
*
|
|
278
|
+
* Zero-copy global config PDA.
|
|
279
|
+
* Authority is taken from StakeControllerState, not stored here.
|
|
280
|
+
*/
|
|
281
|
+
export type GlobalConfig = {
|
|
282
|
+
/** PDA bump */
|
|
283
|
+
bump: number;
|
|
284
|
+
|
|
285
|
+
/** 7-byte padding (unused) */
|
|
286
|
+
padding: number[]; // u8[7]
|
|
287
|
+
|
|
288
|
+
/** Minimum SOL amount a user can deposit (lamports, u64) */
|
|
289
|
+
minUserDeposit: BN;
|
|
290
|
+
|
|
291
|
+
/** Minimum SOL amount for an unstake/withdrawal request (lamports, u64) */
|
|
292
|
+
minUnstakeRequest: BN;
|
|
293
|
+
|
|
294
|
+
/** Minimum stake delta to trigger a stake rebalance order (lamports, u64) */
|
|
295
|
+
minRebalanceStakeDelta: BN;
|
|
296
|
+
|
|
297
|
+
/** Minimum unstake delta to trigger an unstake rebalance order (lamports, u64) */
|
|
298
|
+
minRebalanceUnstakeDelta: BN;
|
|
299
|
+
|
|
300
|
+
/** Minimum transient stake to include in effective stake calculations (lamports, u64) */
|
|
301
|
+
transientThreshold: BN;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Minimum slots that must have elapsed in the epoch before late epoch operations can execute (u64)
|
|
305
|
+
*/
|
|
306
|
+
minLateEpochSlotGate: BN;
|
|
307
|
+
|
|
308
|
+
/** Reserved u64[2] */
|
|
309
|
+
reservedU64: BN[];
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Epochs a validator must wait in the graveyard before it is booted.
|
|
313
|
+
* This begins after the last recorded state change (u16)
|
|
314
|
+
*/
|
|
315
|
+
cooldownEpochs: number;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Multiplier for deposit fee calculation (u16).
|
|
319
|
+
* Typically: avg_pay_rate * expected_warmup_epochs
|
|
320
|
+
*/
|
|
321
|
+
depositFeeMultiplier: number;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Minimum VPP score required to enter the active validator set,
|
|
325
|
+
* fallback when the validator set is very small (u16)
|
|
326
|
+
*/
|
|
327
|
+
minVppEntry: number;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* VPP score threshold below which a validator is removed from active set,
|
|
331
|
+
* fallback threshold (u16)
|
|
332
|
+
*/
|
|
333
|
+
minVppExit: number;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Max validators for "tiny" network band (uses fixed VPP thresholds) (u16)
|
|
337
|
+
*/
|
|
338
|
+
tinyNetworkThreshold: number;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Max validators for "small" network band (uses percentile-based selection) (u16)
|
|
342
|
+
*/
|
|
343
|
+
smallNetworkThreshold: number;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Max validators for "medium" network band (uses percentile-based selection) (u16)
|
|
347
|
+
*/
|
|
348
|
+
mediumNetworkThreshold: number;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Fixed rank threshold to enter active set in large networks (0-indexed, u16)
|
|
352
|
+
*/
|
|
353
|
+
largeNetworkEntryRank: number;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Fixed rank threshold to exit active set in large networks (0-indexed, u16)
|
|
357
|
+
*/
|
|
358
|
+
largeNetworkExitRank: number;
|
|
359
|
+
|
|
360
|
+
/** Reserved u16[3] */
|
|
361
|
+
reservedU16: number[];
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Percentile rank required to enter active set in small networks (u8)
|
|
365
|
+
*/
|
|
366
|
+
smallNetworkEntryPercent: number;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Percentile rank below which validators exit in small networks (u8)
|
|
370
|
+
*/
|
|
371
|
+
smallNetworkExitPercent: number;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Percentile rank required to enter active set in medium networks (u8)
|
|
375
|
+
*/
|
|
376
|
+
mediumNetworkEntryPercent: number;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Percentile rank below which validators exit in medium networks (u8)
|
|
380
|
+
*/
|
|
381
|
+
mediumNetworkExitPercent: number;
|
|
382
|
+
|
|
383
|
+
/** Reserved u8[2] */
|
|
384
|
+
reservedU8: number[];
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Feature flags (u16 bitfield):
|
|
388
|
+
* Bit 0: DepositsEnabled
|
|
389
|
+
* Bit 1: WithdrawalsEnabled
|
|
390
|
+
* Bit 2: ClaimWithdrawalsEnabled
|
|
391
|
+
* Bit 3: ProcessStakeOrdersEnabled
|
|
392
|
+
* Bit 4: ProcessUnstakeOrdersEnabled
|
|
393
|
+
* Bit 5: ProcessPayCycleEnabled
|
|
394
|
+
* Bit 6: RebalancingEnabled
|
|
395
|
+
* Bits 7–15: Reserved
|
|
396
|
+
*/
|
|
397
|
+
featureFlags: number;
|
|
398
|
+
|
|
399
|
+
/** Reserved flags (u16[1]) */
|
|
400
|
+
reservedFlags: number[];
|
|
401
|
+
};
|
|
402
|
+
|
|
274
403
|
/**
|
|
275
404
|
* ============================================================
|
|
276
405
|
* Outpost / Pretoken Accounts
|
package/src/types.ts
CHANGED
|
@@ -26,7 +26,11 @@ export interface IStakingClient {
|
|
|
26
26
|
// Estimated total APY for staking yeild
|
|
27
27
|
getSystemAPY(): Promise<number>;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Protocol fee charged for deposit from Native to LIQ
|
|
31
|
+
* in Solana: amount in lamports
|
|
32
|
+
* in Ethereum: amount in wei
|
|
33
|
+
*/
|
|
30
34
|
getDepositFee(amount: bigint): Promise<bigint>;
|
|
31
35
|
|
|
32
36
|
/**
|
|
@@ -210,7 +214,7 @@ export interface TrancheSnapshot {
|
|
|
210
214
|
/** Tranche curve config (per-chain) */
|
|
211
215
|
// TODO make a constant?
|
|
212
216
|
supplyGrowthBps: number; // e.g. 100 = +1% per tranche
|
|
213
|
-
|
|
217
|
+
priceIncrementUsd: number; // e.g. 200 = +2% per tranche
|
|
214
218
|
|
|
215
219
|
totalPretokensSold: bigint; // total pretokens sold across all tranches (1e8 scale)
|
|
216
220
|
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "BeaconRoots",
|
|
4
|
-
"sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
|
|
5
|
-
"abi": [],
|
|
6
|
-
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212205929e6d47abd57360b3b4a693fd02ffc914ee421946709f79543eb45d9d83cf464736f6c63430008190033",
|
|
7
|
-
"deployedBytecode": "0x600080fdfea26469706673582212205929e6d47abd57360b3b4a693fd02ffc914ee421946709f79543eb45d9d83cf464736f6c63430008190033",
|
|
8
|
-
"linkReferences": {},
|
|
9
|
-
"deployedLinkReferences": {}
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "SSZ",
|
|
4
|
-
"sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
|
|
5
|
-
"abi": [],
|
|
6
|
-
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212208e86ba8a0ca879e7aaa6715b41e1830cf4b6301e2c95453171a9c2f0e1487d9464736f6c63430008190033",
|
|
7
|
-
"deployedBytecode": "0x600080fdfea26469706673582212208e86ba8a0ca879e7aaa6715b41e1830cf4b6301e2c95453171a9c2f0e1487d9464736f6c63430008190033",
|
|
8
|
-
"linkReferences": {},
|
|
9
|
-
"deployedLinkReferences": {}
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "SSZExtras",
|
|
4
|
-
"sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
|
|
5
|
-
"abi": [],
|
|
6
|
-
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea26469706673582212206bffbfe494c06c048356d1409faeae745422d98713ff3b960f4da6ba1bdd203364736f6c63430008190033",
|
|
7
|
-
"deployedBytecode": "0x600080fdfea26469706673582212206bffbfe494c06c048356d1409faeae745422d98713ff3b960f4da6ba1bdd203364736f6c63430008190033",
|
|
8
|
-
"linkReferences": {},
|
|
9
|
-
"deployedLinkReferences": {}
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "SSZVec48",
|
|
4
|
-
"sourceName": "contracts/liqEth/ValidatorBalanceVerifier.sol",
|
|
5
|
-
"abi": [],
|
|
6
|
-
"bytecode": "0x60808060405234601757603a9081601d823930815050f35b600080fdfe600080fdfea264697066735822122024a0384f9481f6f7a712a90218373b99bd388332bb381d7c3078087bbdf6bb3c64736f6c63430008190033",
|
|
7
|
-
"deployedBytecode": "0x600080fdfea264697066735822122024a0384f9481f6f7a712a90218373b99bd388332bb381d7c3078087bbdf6bb3c64736f6c63430008190033",
|
|
8
|
-
"linkReferences": {},
|
|
9
|
-
"deployedLinkReferences": {}
|
|
10
|
-
}
|