@wireio/stake 0.7.3 → 0.9.1
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 +628 -816
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +196 -549
- package/lib/stake.js +661 -816
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +628 -816
- package/lib/stake.m.js.map +1 -1
- package/package.json +2 -1
- package/src/assets/solana/idl/liqsol_core.json +114 -377
- package/src/assets/solana/idl/validator_leaderboard.json +0 -146
- package/src/assets/solana/types/liqsol_core.ts +114 -377
- package/src/assets/solana/types/validator_leaderboard.ts +0 -146
- package/src/networks/ethereum/clients/opp.client.ts +20 -21
- package/src/networks/ethereum/clients/receipt.client.ts +8 -1
- package/src/networks/ethereum/contract.ts +40 -5
- package/src/networks/ethereum/ethereum.ts +148 -139
- package/src/networks/ethereum/types.ts +1 -2
- package/src/networks/solana/clients/deposit.client.ts +260 -9
- package/src/networks/solana/clients/distribution.client.ts +1 -1
- package/src/networks/solana/clients/outpost.client.ts +1 -1
- package/src/networks/solana/constants.ts +1 -1
- package/src/networks/solana/solana.ts +439 -233
- package/src/networks/solana/types.ts +4 -4
- package/src/staker.ts +2 -2
- package/src/types.ts +8 -0
package/lib/stake.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _wireio_core from '@wireio/core';
|
|
|
2
2
|
import { ExternalNetwork, PublicKey, ChainID } from '@wireio/core';
|
|
3
3
|
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
4
4
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
5
|
-
import { PublicKey as PublicKey$1, Transaction, VersionedTransaction, TokenAmount, Connection,
|
|
5
|
+
import { PublicKey as PublicKey$1, Transaction, VersionedTransaction, TokenAmount, Connection, TransactionInstruction, Keypair, TransactionSignature } from '@solana/web3.js';
|
|
6
6
|
import { ethers, BigNumber, Signer, Contract } from 'ethers';
|
|
7
7
|
import { JsonFragment } from '@ethersproject/abi';
|
|
8
8
|
import { ErrorDescription } from '@ethersproject/abi/lib/interface';
|
|
@@ -12,6 +12,13 @@ type StakerConfig = {
|
|
|
12
12
|
network: ExternalNetwork;
|
|
13
13
|
provider?: BaseSignerWalletAdapter | ethers.providers.Web3Provider;
|
|
14
14
|
pubKey?: PublicKey;
|
|
15
|
+
extras?: {
|
|
16
|
+
squadsX?: SquadsXConfig;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type SquadsXConfig = {
|
|
20
|
+
multisigPDA: string;
|
|
21
|
+
vaultIndex?: number;
|
|
15
22
|
};
|
|
16
23
|
interface IStakingClient {
|
|
17
24
|
pubKey?: PublicKey;
|
|
@@ -261,7 +268,7 @@ declare class Staker {
|
|
|
261
268
|
setChain(chainID: ChainID): boolean;
|
|
262
269
|
}
|
|
263
270
|
|
|
264
|
-
declare const CONTRACT_NAMES: readonly ["LiqEthAuthority", "BeaconState", "WithdrawalQueue", "LiqEthToken", "Accounting", "DepositManager", "WithdrawalVault", "StakingModule", "YieldOracle", "OutpostManagerAuthority", "iodata", "Base58", "sysio_merkle", "ReceiptNFT", "
|
|
271
|
+
declare const CONTRACT_NAMES: readonly ["LiqEthAuthority", "BeaconState", "WithdrawalQueue", "LiqEthToken", "Accounting", "DepositManager", "WithdrawalVault", "StakingModule", "YieldOracle", "OutpostManagerAuthority", "iodata", "Base58", "sysio_merkle", "ReceiptNFT", "Pool", "OutpostManager", "sysio_write", "EthUsdPriceConsumer", "BAR", "OPPCommon", "OPP", "Pretoken", "OPPInbound", "Depositor", "MockAggregator"];
|
|
265
272
|
type ContractName = typeof CONTRACT_NAMES[number];
|
|
266
273
|
type AddressBook = Record<ContractName, string>;
|
|
267
274
|
interface Result {
|
|
@@ -372,7 +379,6 @@ declare class EthereumStakingClient implements IStakingClient {
|
|
|
372
379
|
Base58: ethers.Contract;
|
|
373
380
|
sysio_merkle: ethers.Contract;
|
|
374
381
|
ReceiptNFT: ethers.Contract;
|
|
375
|
-
MockAggregator: ethers.Contract;
|
|
376
382
|
Pool: ethers.Contract;
|
|
377
383
|
OutpostManager: ethers.Contract;
|
|
378
384
|
sysio_write: ethers.Contract;
|
|
@@ -383,6 +389,7 @@ declare class EthereumStakingClient implements IStakingClient {
|
|
|
383
389
|
Pretoken: ethers.Contract;
|
|
384
390
|
OPPInbound: ethers.Contract;
|
|
385
391
|
Depositor: ethers.Contract;
|
|
392
|
+
MockAggregator: ethers.Contract;
|
|
386
393
|
};
|
|
387
394
|
get network(): _wireio_core.ExternalNetwork;
|
|
388
395
|
constructor(config: StakerConfig);
|
|
@@ -462,7 +469,6 @@ declare class EthereumStakingClient implements IStakingClient {
|
|
|
462
469
|
minBufferWei?: bigint;
|
|
463
470
|
balanceOverrideLamports?: bigint;
|
|
464
471
|
}): Promise<bigint>;
|
|
465
|
-
private updateMockAggregatorPrice;
|
|
466
472
|
}
|
|
467
473
|
|
|
468
474
|
/**
|
|
@@ -865,7 +871,7 @@ type GlobalState = {
|
|
|
865
871
|
*/
|
|
866
872
|
roleWarmupDuration: BN;
|
|
867
873
|
/** Wire lifecycle state (preLaunch / postLaunch / refund) */
|
|
868
|
-
wireState: WireState;
|
|
874
|
+
wireState: WireState | any;
|
|
869
875
|
/** PDA bump */
|
|
870
876
|
bump: number;
|
|
871
877
|
};
|
|
@@ -1144,7 +1150,7 @@ type LeaderboardState = {
|
|
|
1144
1150
|
* Per-validator scores (i64 on-chain).
|
|
1145
1151
|
* Index corresponds to `registryIndex` in ValidatorRecord.
|
|
1146
1152
|
*/
|
|
1147
|
-
scores:
|
|
1153
|
+
scores: number[];
|
|
1148
1154
|
/**
|
|
1149
1155
|
* Sorted indices into `scores[]` / `voteAccounts[]`,
|
|
1150
1156
|
* typically highest score first.
|
|
@@ -1155,7 +1161,9 @@ type LeaderboardState = {
|
|
|
1155
1161
|
* `voteAccounts[i]` is the vote account for validator with
|
|
1156
1162
|
* `registryIndex == i`.
|
|
1157
1163
|
*/
|
|
1158
|
-
voteAccounts:
|
|
1164
|
+
voteAccounts: {
|
|
1165
|
+
bytes: number[];
|
|
1166
|
+
}[];
|
|
1159
1167
|
/**
|
|
1160
1168
|
* Number of active validators currently tracked in the leaderboard.
|
|
1161
1169
|
* Only the first `numValidators` entries of the arrays are meaningful.
|
|
@@ -1167,7 +1175,7 @@ type LeaderboardState = {
|
|
|
1167
1175
|
* Reserved padding / future-proofing on-chain (u64[8]).
|
|
1168
1176
|
* Not used by client logic, but surfaced for completeness.
|
|
1169
1177
|
*/
|
|
1170
|
-
padding:
|
|
1178
|
+
padding: number[];
|
|
1171
1179
|
};
|
|
1172
1180
|
/**
|
|
1173
1181
|
* Per-validator record tying Solana vote account to
|
|
@@ -1270,13 +1278,36 @@ declare namespace types {
|
|
|
1270
1278
|
declare class DepositClient {
|
|
1271
1279
|
private provider;
|
|
1272
1280
|
private program;
|
|
1281
|
+
get connection(): Connection;
|
|
1273
1282
|
get wallet(): WalletLike;
|
|
1274
1283
|
constructor(provider: AnchorProvider);
|
|
1275
1284
|
/**
|
|
1276
1285
|
* Build a deposit transaction:
|
|
1277
1286
|
* SOL -> liqSOL via liqsol_core::deposit.
|
|
1278
1287
|
*/
|
|
1279
|
-
buildDepositTx(amount: bigint, user?:
|
|
1288
|
+
buildDepositTx(amount: bigint, user?: PublicKey$1): Promise<TransactionInstruction>;
|
|
1289
|
+
buildSquadsDepositProposalTx(params: {
|
|
1290
|
+
connection: Connection;
|
|
1291
|
+
multisigPda: PublicKey$1;
|
|
1292
|
+
amountLamports: bigint;
|
|
1293
|
+
wallet: WalletLikeSigner;
|
|
1294
|
+
vaultIndex?: number;
|
|
1295
|
+
}): Promise<{
|
|
1296
|
+
tx: Transaction;
|
|
1297
|
+
transactionIndex: bigint;
|
|
1298
|
+
vaultPda: PublicKey$1;
|
|
1299
|
+
}>;
|
|
1300
|
+
buildSquadsDepositProposalTx2(params: {
|
|
1301
|
+
connection: Connection;
|
|
1302
|
+
multisigPda: PublicKey$1;
|
|
1303
|
+
amountLamports: bigint;
|
|
1304
|
+
wallet: WalletLikeSigner;
|
|
1305
|
+
vaultIndex?: number;
|
|
1306
|
+
}): Promise<{
|
|
1307
|
+
tx: Transaction;
|
|
1308
|
+
transactionIndex: bigint;
|
|
1309
|
+
vaultPda: PublicKey$1;
|
|
1310
|
+
}>;
|
|
1280
1311
|
/**
|
|
1281
1312
|
* Build a withdraw-request transaction:
|
|
1282
1313
|
* liqSOL -> SOL via liqsol_core::requestWithdraw.
|
|
@@ -1286,8 +1317,18 @@ declare class DepositClient {
|
|
|
1286
1317
|
* - increments totalEncumberedFunds in global state
|
|
1287
1318
|
* - mints an NFT receipt (liqReceiptData + NFT ATA for owner)
|
|
1288
1319
|
*/
|
|
1289
|
-
buildWithdrawTx(amount: bigint, user?:
|
|
1320
|
+
buildWithdrawTx(amount: bigint, user?: PublicKey$1): Promise<Transaction>;
|
|
1321
|
+
/**
|
|
1322
|
+
* Internal helper: build the liqsol_core::deposit instruction for a specific `user`.
|
|
1323
|
+
* This is the exact same account wiring as buildDepositTx(), but returns the IX
|
|
1324
|
+
* plus useful derived addresses/seed for Squads flows.
|
|
1325
|
+
*/
|
|
1326
|
+
private buildDepositIxForUser;
|
|
1290
1327
|
}
|
|
1328
|
+
type WalletLikeSigner = {
|
|
1329
|
+
publicKey: PublicKey$1;
|
|
1330
|
+
signTransaction: (tx: Transaction) => Promise<Transaction>;
|
|
1331
|
+
};
|
|
1291
1332
|
|
|
1292
1333
|
/**
|
|
1293
1334
|
* Distribution client – wraps the distribution portion of the liqsol_core
|
|
@@ -1404,68 +1445,6 @@ type LiqsolCore = {
|
|
|
1404
1445
|
"description": "Created with Anchor";
|
|
1405
1446
|
};
|
|
1406
1447
|
"instructions": [
|
|
1407
|
-
{
|
|
1408
|
-
"name": "accumulateUnstakeRequest";
|
|
1409
|
-
"docs": [
|
|
1410
|
-
"Accumulate unstake requests to be processed in next allocation cycle",
|
|
1411
|
-
"Multiple requests can be accumulated before calculating allocations",
|
|
1412
|
-
"Returns the target epoch when this unstake request will be processed",
|
|
1413
|
-
"We should not be able to call this without development feature enabled",
|
|
1414
|
-
""
|
|
1415
|
-
];
|
|
1416
|
-
"discriminator": [
|
|
1417
|
-
24,
|
|
1418
|
-
73,
|
|
1419
|
-
69,
|
|
1420
|
-
139,
|
|
1421
|
-
36,
|
|
1422
|
-
209,
|
|
1423
|
-
105,
|
|
1424
|
-
252
|
|
1425
|
-
];
|
|
1426
|
-
"accounts": [
|
|
1427
|
-
{
|
|
1428
|
-
"name": "admin";
|
|
1429
|
-
"writable": true;
|
|
1430
|
-
"signer": true;
|
|
1431
|
-
},
|
|
1432
|
-
{
|
|
1433
|
-
"name": "stakeAllocationState";
|
|
1434
|
-
"docs": [
|
|
1435
|
-
"Stake allocation state - to accumulate pending unstake requests"
|
|
1436
|
-
];
|
|
1437
|
-
"writable": true;
|
|
1438
|
-
},
|
|
1439
|
-
{
|
|
1440
|
-
"name": "stakeMetrics";
|
|
1441
|
-
"docs": [
|
|
1442
|
-
"Stake metrics - to validate total unstake amount is available"
|
|
1443
|
-
];
|
|
1444
|
-
},
|
|
1445
|
-
{
|
|
1446
|
-
"name": "maintenanceLedger";
|
|
1447
|
-
"docs": [
|
|
1448
|
-
"Maintenance ledger - to determine target processing epoch"
|
|
1449
|
-
];
|
|
1450
|
-
},
|
|
1451
|
-
{
|
|
1452
|
-
"name": "globalConfig";
|
|
1453
|
-
"docs": [
|
|
1454
|
-
"Global config for min_unstake_request setting"
|
|
1455
|
-
];
|
|
1456
|
-
},
|
|
1457
|
-
{
|
|
1458
|
-
"name": "clock";
|
|
1459
|
-
}
|
|
1460
|
-
];
|
|
1461
|
-
"args": [
|
|
1462
|
-
{
|
|
1463
|
-
"name": "amount";
|
|
1464
|
-
"type": "u64";
|
|
1465
|
-
}
|
|
1466
|
-
];
|
|
1467
|
-
"returns": "u64";
|
|
1468
|
-
},
|
|
1469
1448
|
{
|
|
1470
1449
|
"name": "addTopPerformersBatch";
|
|
1471
1450
|
"docs": [
|
|
@@ -1518,74 +1497,6 @@ type LiqsolCore = {
|
|
|
1518
1497
|
];
|
|
1519
1498
|
"args": [];
|
|
1520
1499
|
},
|
|
1521
|
-
{
|
|
1522
|
-
"name": "addValidatorV2";
|
|
1523
|
-
"docs": [
|
|
1524
|
-
"Add a new validator bbypassing the looking at leaderboard and getting validators form there"
|
|
1525
|
-
];
|
|
1526
|
-
"discriminator": [
|
|
1527
|
-
217,
|
|
1528
|
-
158,
|
|
1529
|
-
30,
|
|
1530
|
-
19,
|
|
1531
|
-
123,
|
|
1532
|
-
99,
|
|
1533
|
-
110,
|
|
1534
|
-
30
|
|
1535
|
-
];
|
|
1536
|
-
"accounts": [
|
|
1537
|
-
{
|
|
1538
|
-
"name": "authority";
|
|
1539
|
-
"writable": true;
|
|
1540
|
-
"signer": true;
|
|
1541
|
-
},
|
|
1542
|
-
{
|
|
1543
|
-
"name": "activeList";
|
|
1544
|
-
"docs": [
|
|
1545
|
-
"Active list - will add the validator here"
|
|
1546
|
-
];
|
|
1547
|
-
"writable": true;
|
|
1548
|
-
},
|
|
1549
|
-
{
|
|
1550
|
-
"name": "validatorInfo";
|
|
1551
|
-
"docs": [
|
|
1552
|
-
"Create the validator info account"
|
|
1553
|
-
];
|
|
1554
|
-
"writable": true;
|
|
1555
|
-
},
|
|
1556
|
-
{
|
|
1557
|
-
"name": "validatorTransient";
|
|
1558
|
-
"docs": [
|
|
1559
|
-
"Create the validator transient account"
|
|
1560
|
-
];
|
|
1561
|
-
"writable": true;
|
|
1562
|
-
},
|
|
1563
|
-
{
|
|
1564
|
-
"name": "stakeAllocationState";
|
|
1565
|
-
"docs": [
|
|
1566
|
-
"Stake allocation state - to update total_active_vpp when adding validator"
|
|
1567
|
-
];
|
|
1568
|
-
"writable": true;
|
|
1569
|
-
},
|
|
1570
|
-
{
|
|
1571
|
-
"name": "systemProgram";
|
|
1572
|
-
}
|
|
1573
|
-
];
|
|
1574
|
-
"args": [
|
|
1575
|
-
{
|
|
1576
|
-
"name": "voteAccount";
|
|
1577
|
-
"type": "pubkey";
|
|
1578
|
-
},
|
|
1579
|
-
{
|
|
1580
|
-
"name": "name";
|
|
1581
|
-
"type": "string";
|
|
1582
|
-
},
|
|
1583
|
-
{
|
|
1584
|
-
"name": "performanceScore";
|
|
1585
|
-
"type": "u8";
|
|
1586
|
-
}
|
|
1587
|
-
];
|
|
1588
|
-
},
|
|
1589
1500
|
{
|
|
1590
1501
|
"name": "aggregateStakeMetrics";
|
|
1591
1502
|
"docs": [
|
|
@@ -1624,43 +1535,6 @@ type LiqsolCore = {
|
|
|
1624
1535
|
];
|
|
1625
1536
|
"args": [];
|
|
1626
1537
|
},
|
|
1627
|
-
{
|
|
1628
|
-
"name": "blacklistValidator";
|
|
1629
|
-
"docs": [
|
|
1630
|
-
"Blacklist a validator (user-facing, maintenance will handle graveyard movement)",
|
|
1631
|
-
"UnderPerforming is set automatically when score is updated",
|
|
1632
|
-
"Another serious emergency stop function"
|
|
1633
|
-
];
|
|
1634
|
-
"discriminator": [
|
|
1635
|
-
125,
|
|
1636
|
-
42,
|
|
1637
|
-
36,
|
|
1638
|
-
229,
|
|
1639
|
-
27,
|
|
1640
|
-
38,
|
|
1641
|
-
226,
|
|
1642
|
-
62
|
|
1643
|
-
];
|
|
1644
|
-
"accounts": [
|
|
1645
|
-
{
|
|
1646
|
-
"name": "validatorInfo";
|
|
1647
|
-
"writable": true;
|
|
1648
|
-
},
|
|
1649
|
-
{
|
|
1650
|
-
"name": "stakeAllocationState";
|
|
1651
|
-
"docs": [
|
|
1652
|
-
"Stake allocation state - to update total_active_vpp when VPP changes"
|
|
1653
|
-
];
|
|
1654
|
-
"writable": true;
|
|
1655
|
-
}
|
|
1656
|
-
];
|
|
1657
|
-
"args": [
|
|
1658
|
-
{
|
|
1659
|
-
"name": "voteAccount";
|
|
1660
|
-
"type": "pubkey";
|
|
1661
|
-
}
|
|
1662
|
-
];
|
|
1663
|
-
},
|
|
1664
1538
|
{
|
|
1665
1539
|
"name": "bondRole";
|
|
1666
1540
|
"discriminator": [
|
|
@@ -4214,143 +4088,6 @@ type LiqsolCore = {
|
|
|
4214
4088
|
}
|
|
4215
4089
|
];
|
|
4216
4090
|
},
|
|
4217
|
-
{
|
|
4218
|
-
"name": "resetDistributionState";
|
|
4219
|
-
"discriminator": [
|
|
4220
|
-
159,
|
|
4221
|
-
183,
|
|
4222
|
-
162,
|
|
4223
|
-
74,
|
|
4224
|
-
228,
|
|
4225
|
-
135,
|
|
4226
|
-
157,
|
|
4227
|
-
79
|
|
4228
|
-
];
|
|
4229
|
-
"accounts": [
|
|
4230
|
-
{
|
|
4231
|
-
"name": "admin";
|
|
4232
|
-
"signer": true;
|
|
4233
|
-
},
|
|
4234
|
-
{
|
|
4235
|
-
"name": "distributionState";
|
|
4236
|
-
"writable": true;
|
|
4237
|
-
}
|
|
4238
|
-
];
|
|
4239
|
-
"args": [];
|
|
4240
|
-
},
|
|
4241
|
-
{
|
|
4242
|
-
"name": "resetGlobalState";
|
|
4243
|
-
"discriminator": [
|
|
4244
|
-
252,
|
|
4245
|
-
41,
|
|
4246
|
-
117,
|
|
4247
|
-
110,
|
|
4248
|
-
248,
|
|
4249
|
-
165,
|
|
4250
|
-
48,
|
|
4251
|
-
88
|
|
4252
|
-
];
|
|
4253
|
-
"accounts": [
|
|
4254
|
-
{
|
|
4255
|
-
"name": "admin";
|
|
4256
|
-
"signer": true;
|
|
4257
|
-
},
|
|
4258
|
-
{
|
|
4259
|
-
"name": "globalConfig";
|
|
4260
|
-
},
|
|
4261
|
-
{
|
|
4262
|
-
"name": "globalState";
|
|
4263
|
-
"writable": true;
|
|
4264
|
-
},
|
|
4265
|
-
{
|
|
4266
|
-
"name": "poolAuthority";
|
|
4267
|
-
},
|
|
4268
|
-
{
|
|
4269
|
-
"name": "liqsolMint";
|
|
4270
|
-
},
|
|
4271
|
-
{
|
|
4272
|
-
"name": "liqsolPoolAta";
|
|
4273
|
-
"writable": true;
|
|
4274
|
-
},
|
|
4275
|
-
{
|
|
4276
|
-
"name": "tokenProgram";
|
|
4277
|
-
},
|
|
4278
|
-
{
|
|
4279
|
-
"name": "associatedTokenProgram";
|
|
4280
|
-
}
|
|
4281
|
-
];
|
|
4282
|
-
"args": [];
|
|
4283
|
-
},
|
|
4284
|
-
{
|
|
4285
|
-
"name": "resetPriceHistory";
|
|
4286
|
-
"discriminator": [
|
|
4287
|
-
213,
|
|
4288
|
-
231,
|
|
4289
|
-
155,
|
|
4290
|
-
139,
|
|
4291
|
-
248,
|
|
4292
|
-
60,
|
|
4293
|
-
67,
|
|
4294
|
-
199
|
|
4295
|
-
];
|
|
4296
|
-
"accounts": [
|
|
4297
|
-
{
|
|
4298
|
-
"name": "admin";
|
|
4299
|
-
"writable": true;
|
|
4300
|
-
"signer": true;
|
|
4301
|
-
},
|
|
4302
|
-
{
|
|
4303
|
-
"name": "globalConfig";
|
|
4304
|
-
},
|
|
4305
|
-
{
|
|
4306
|
-
"name": "trancheState";
|
|
4307
|
-
"writable": true;
|
|
4308
|
-
},
|
|
4309
|
-
{
|
|
4310
|
-
"name": "priceHistory";
|
|
4311
|
-
"writable": true;
|
|
4312
|
-
},
|
|
4313
|
-
{
|
|
4314
|
-
"name": "systemProgram";
|
|
4315
|
-
}
|
|
4316
|
-
];
|
|
4317
|
-
"args": [];
|
|
4318
|
-
},
|
|
4319
|
-
{
|
|
4320
|
-
"name": "resetTrancheState";
|
|
4321
|
-
"discriminator": [
|
|
4322
|
-
106,
|
|
4323
|
-
102,
|
|
4324
|
-
143,
|
|
4325
|
-
40,
|
|
4326
|
-
152,
|
|
4327
|
-
173,
|
|
4328
|
-
165,
|
|
4329
|
-
168
|
|
4330
|
-
];
|
|
4331
|
-
"accounts": [
|
|
4332
|
-
{
|
|
4333
|
-
"name": "admin";
|
|
4334
|
-
"writable": true;
|
|
4335
|
-
"signer": true;
|
|
4336
|
-
},
|
|
4337
|
-
{
|
|
4338
|
-
"name": "globalConfig";
|
|
4339
|
-
},
|
|
4340
|
-
{
|
|
4341
|
-
"name": "trancheState";
|
|
4342
|
-
"writable": true;
|
|
4343
|
-
},
|
|
4344
|
-
{
|
|
4345
|
-
"name": "priceHistory";
|
|
4346
|
-
"writable": true;
|
|
4347
|
-
},
|
|
4348
|
-
{
|
|
4349
|
-
"name": "systemProgram";
|
|
4350
|
-
}
|
|
4351
|
-
];
|
|
4352
|
-
"args": [];
|
|
4353
|
-
},
|
|
4354
4091
|
{
|
|
4355
4092
|
"name": "setAdmin";
|
|
4356
4093
|
"discriminator": [
|
|
@@ -4374,77 +4111,36 @@ type LiqsolCore = {
|
|
|
4374
4111
|
},
|
|
4375
4112
|
{
|
|
4376
4113
|
"name": "newAuthority";
|
|
4377
|
-
"signer": true;
|
|
4378
|
-
}
|
|
4379
|
-
];
|
|
4380
|
-
"args": [];
|
|
4381
|
-
},
|
|
4382
|
-
{
|
|
4383
|
-
"name": "setCranky";
|
|
4384
|
-
"discriminator": [
|
|
4385
|
-
232,
|
|
4386
|
-
48,
|
|
4387
|
-
178,
|
|
4388
|
-
74,
|
|
4389
|
-
194,
|
|
4390
|
-
60,
|
|
4391
|
-
143,
|
|
4392
|
-
164
|
|
4393
|
-
];
|
|
4394
|
-
"accounts": [
|
|
4395
|
-
{
|
|
4396
|
-
"name": "globalConfig";
|
|
4397
|
-
"writable": true;
|
|
4398
|
-
},
|
|
4399
|
-
{
|
|
4400
|
-
"name": "admin";
|
|
4401
|
-
"signer": true;
|
|
4402
|
-
},
|
|
4403
|
-
{
|
|
4404
|
-
"name": "newAuthority";
|
|
4405
|
-
"signer": true;
|
|
4406
4114
|
}
|
|
4407
4115
|
];
|
|
4408
4116
|
"args": [];
|
|
4409
4117
|
},
|
|
4410
|
-
{
|
|
4411
|
-
"name": "
|
|
4412
|
-
"
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
224,
|
|
4422
|
-
227,
|
|
4423
|
-
106
|
|
4118
|
+
{
|
|
4119
|
+
"name": "setCranky";
|
|
4120
|
+
"discriminator": [
|
|
4121
|
+
232,
|
|
4122
|
+
48,
|
|
4123
|
+
178,
|
|
4124
|
+
74,
|
|
4125
|
+
194,
|
|
4126
|
+
60,
|
|
4127
|
+
143,
|
|
4128
|
+
164
|
|
4424
4129
|
];
|
|
4425
4130
|
"accounts": [
|
|
4426
4131
|
{
|
|
4427
|
-
"name": "
|
|
4132
|
+
"name": "globalConfig";
|
|
4428
4133
|
"writable": true;
|
|
4429
4134
|
},
|
|
4430
4135
|
{
|
|
4431
|
-
"name": "
|
|
4432
|
-
"
|
|
4433
|
-
"Stake allocation state - to update total_active_vpp when VPP changes"
|
|
4434
|
-
];
|
|
4435
|
-
"writable": true;
|
|
4436
|
-
}
|
|
4437
|
-
];
|
|
4438
|
-
"args": [
|
|
4439
|
-
{
|
|
4440
|
-
"name": "voteAccount";
|
|
4441
|
-
"type": "pubkey";
|
|
4136
|
+
"name": "admin";
|
|
4137
|
+
"signer": true;
|
|
4442
4138
|
},
|
|
4443
4139
|
{
|
|
4444
|
-
"name": "
|
|
4445
|
-
"type": "u16";
|
|
4140
|
+
"name": "newAuthority";
|
|
4446
4141
|
}
|
|
4447
4142
|
];
|
|
4143
|
+
"args": [];
|
|
4448
4144
|
},
|
|
4449
4145
|
{
|
|
4450
4146
|
"name": "setPaused";
|
|
@@ -4929,34 +4625,6 @@ type LiqsolCore = {
|
|
|
4929
4625
|
}
|
|
4930
4626
|
];
|
|
4931
4627
|
},
|
|
4932
|
-
{
|
|
4933
|
-
"name": "testClearActiveList";
|
|
4934
|
-
"discriminator": [
|
|
4935
|
-
17,
|
|
4936
|
-
195,
|
|
4937
|
-
59,
|
|
4938
|
-
174,
|
|
4939
|
-
184,
|
|
4940
|
-
137,
|
|
4941
|
-
149,
|
|
4942
|
-
144
|
|
4943
|
-
];
|
|
4944
|
-
"accounts": [
|
|
4945
|
-
{
|
|
4946
|
-
"name": "activeList";
|
|
4947
|
-
"writable": true;
|
|
4948
|
-
},
|
|
4949
|
-
{
|
|
4950
|
-
"name": "processingState";
|
|
4951
|
-
"writable": true;
|
|
4952
|
-
},
|
|
4953
|
-
{
|
|
4954
|
-
"name": "authority";
|
|
4955
|
-
"signer": true;
|
|
4956
|
-
}
|
|
4957
|
-
];
|
|
4958
|
-
"args": [];
|
|
4959
|
-
},
|
|
4960
4628
|
{
|
|
4961
4629
|
"name": "updateConfigBool";
|
|
4962
4630
|
"discriminator": [
|
|
@@ -5634,8 +5302,118 @@ type LiqsolCore = {
|
|
|
5634
5302
|
"errors": [
|
|
5635
5303
|
{
|
|
5636
5304
|
"code": 6000;
|
|
5637
|
-
"name": "
|
|
5638
|
-
"msg": "
|
|
5305
|
+
"name": "destinationAccountDoesNotExist";
|
|
5306
|
+
"msg": "Destination stake account does not exist";
|
|
5307
|
+
},
|
|
5308
|
+
{
|
|
5309
|
+
"code": 6001;
|
|
5310
|
+
"name": "sourceAccountDoesNotExist";
|
|
5311
|
+
"msg": "Source stake account does not exist";
|
|
5312
|
+
},
|
|
5313
|
+
{
|
|
5314
|
+
"code": 6002;
|
|
5315
|
+
"name": "invalidDestinationOwner";
|
|
5316
|
+
"msg": "Destination account not owned by stake program";
|
|
5317
|
+
},
|
|
5318
|
+
{
|
|
5319
|
+
"code": 6003;
|
|
5320
|
+
"name": "invalidSourceOwner";
|
|
5321
|
+
"msg": "Source account not owned by stake program";
|
|
5322
|
+
},
|
|
5323
|
+
{
|
|
5324
|
+
"code": 6004;
|
|
5325
|
+
"name": "clockBorrowFailed";
|
|
5326
|
+
"msg": "Failed to borrow clock data";
|
|
5327
|
+
},
|
|
5328
|
+
{
|
|
5329
|
+
"code": 6005;
|
|
5330
|
+
"name": "clockDeserializeFailed";
|
|
5331
|
+
"msg": "Failed to deserialize clock";
|
|
5332
|
+
},
|
|
5333
|
+
{
|
|
5334
|
+
"code": 6006;
|
|
5335
|
+
"name": "destinationAnalysisFailed";
|
|
5336
|
+
"msg": "Failed to analyze destination stake account";
|
|
5337
|
+
},
|
|
5338
|
+
{
|
|
5339
|
+
"code": 6007;
|
|
5340
|
+
"name": "sourceAnalysisFailed";
|
|
5341
|
+
"msg": "Failed to analyze source stake account";
|
|
5342
|
+
},
|
|
5343
|
+
{
|
|
5344
|
+
"code": 6008;
|
|
5345
|
+
"name": "destinationStillActivating";
|
|
5346
|
+
"msg": "Destination stake is still activating";
|
|
5347
|
+
},
|
|
5348
|
+
{
|
|
5349
|
+
"code": 6009;
|
|
5350
|
+
"name": "destinationDeactivating";
|
|
5351
|
+
"msg": "Destination stake is deactivating";
|
|
5352
|
+
},
|
|
5353
|
+
{
|
|
5354
|
+
"code": 6010;
|
|
5355
|
+
"name": "sourceStillActivating";
|
|
5356
|
+
"msg": "Source stake is still activating";
|
|
5357
|
+
},
|
|
5358
|
+
{
|
|
5359
|
+
"code": 6011;
|
|
5360
|
+
"name": "sourceDeactivating";
|
|
5361
|
+
"msg": "Source stake is deactivating";
|
|
5362
|
+
},
|
|
5363
|
+
{
|
|
5364
|
+
"code": 6012;
|
|
5365
|
+
"name": "destinationBorrowFailed";
|
|
5366
|
+
"msg": "Failed to borrow destination account data";
|
|
5367
|
+
},
|
|
5368
|
+
{
|
|
5369
|
+
"code": 6013;
|
|
5370
|
+
"name": "destinationParseFailed";
|
|
5371
|
+
"msg": "Failed to parse destination stake state";
|
|
5372
|
+
},
|
|
5373
|
+
{
|
|
5374
|
+
"code": 6014;
|
|
5375
|
+
"name": "sourceBorrowFailed";
|
|
5376
|
+
"msg": "Failed to borrow source account data";
|
|
5377
|
+
},
|
|
5378
|
+
{
|
|
5379
|
+
"code": 6015;
|
|
5380
|
+
"name": "sourceParseFailed";
|
|
5381
|
+
"msg": "Failed to parse source stake state";
|
|
5382
|
+
},
|
|
5383
|
+
{
|
|
5384
|
+
"code": 6016;
|
|
5385
|
+
"name": "differentValidators";
|
|
5386
|
+
"msg": "Stakes are delegated to different validators";
|
|
5387
|
+
},
|
|
5388
|
+
{
|
|
5389
|
+
"code": 6017;
|
|
5390
|
+
"name": "differentStakers";
|
|
5391
|
+
"msg": "Stakes have different staker authorities";
|
|
5392
|
+
},
|
|
5393
|
+
{
|
|
5394
|
+
"code": 6018;
|
|
5395
|
+
"name": "differentWithdrawers";
|
|
5396
|
+
"msg": "Stakes have different withdrawer authorities";
|
|
5397
|
+
},
|
|
5398
|
+
{
|
|
5399
|
+
"code": 6019;
|
|
5400
|
+
"name": "authoritiesNotFound";
|
|
5401
|
+
"msg": "Could not extract authorities from accounts";
|
|
5402
|
+
},
|
|
5403
|
+
{
|
|
5404
|
+
"code": 6020;
|
|
5405
|
+
"name": "mergeInstructionFailed";
|
|
5406
|
+
"msg": "Merge instruction failed";
|
|
5407
|
+
},
|
|
5408
|
+
{
|
|
5409
|
+
"code": 6021;
|
|
5410
|
+
"name": "epochRewardsActive";
|
|
5411
|
+
"msg": "Epoch rewards distribution is active - stake operations blocked";
|
|
5412
|
+
},
|
|
5413
|
+
{
|
|
5414
|
+
"code": 6022;
|
|
5415
|
+
"name": "differentCreditsObserved";
|
|
5416
|
+
"msg": "Stakes have different credits_observed - cannot merge until both earn same rewards";
|
|
5639
5417
|
}
|
|
5640
5418
|
];
|
|
5641
5419
|
"types": [
|
|
@@ -8362,152 +8140,6 @@ type ValidatorLeaderboard = {
|
|
|
8362
8140
|
];
|
|
8363
8141
|
"args": [];
|
|
8364
8142
|
},
|
|
8365
|
-
{
|
|
8366
|
-
"name": "testClearLeaderboard";
|
|
8367
|
-
"discriminator": [
|
|
8368
|
-
118,
|
|
8369
|
-
207,
|
|
8370
|
-
26,
|
|
8371
|
-
205,
|
|
8372
|
-
180,
|
|
8373
|
-
7,
|
|
8374
|
-
75,
|
|
8375
|
-
244
|
|
8376
|
-
];
|
|
8377
|
-
"accounts": [
|
|
8378
|
-
{
|
|
8379
|
-
"name": "leaderboardState";
|
|
8380
|
-
"writable": true;
|
|
8381
|
-
},
|
|
8382
|
-
{
|
|
8383
|
-
"name": "authority";
|
|
8384
|
-
"signer": true;
|
|
8385
|
-
}
|
|
8386
|
-
];
|
|
8387
|
-
"args": [];
|
|
8388
|
-
},
|
|
8389
|
-
{
|
|
8390
|
-
"name": "testForceRegisterValidator";
|
|
8391
|
-
"discriminator": [
|
|
8392
|
-
136,
|
|
8393
|
-
156,
|
|
8394
|
-
132,
|
|
8395
|
-
32,
|
|
8396
|
-
96,
|
|
8397
|
-
240,
|
|
8398
|
-
7,
|
|
8399
|
-
115
|
|
8400
|
-
];
|
|
8401
|
-
"accounts": [
|
|
8402
|
-
{
|
|
8403
|
-
"name": "registrant";
|
|
8404
|
-
"writable": true;
|
|
8405
|
-
"signer": true;
|
|
8406
|
-
},
|
|
8407
|
-
{
|
|
8408
|
-
"name": "voteAccount";
|
|
8409
|
-
},
|
|
8410
|
-
{
|
|
8411
|
-
"name": "validatorRecord";
|
|
8412
|
-
"writable": true;
|
|
8413
|
-
},
|
|
8414
|
-
{
|
|
8415
|
-
"name": "leaderboardState";
|
|
8416
|
-
"writable": true;
|
|
8417
|
-
},
|
|
8418
|
-
{
|
|
8419
|
-
"name": "systemProgram";
|
|
8420
|
-
},
|
|
8421
|
-
{
|
|
8422
|
-
"name": "clock";
|
|
8423
|
-
}
|
|
8424
|
-
];
|
|
8425
|
-
"args": [
|
|
8426
|
-
{
|
|
8427
|
-
"name": "vpp";
|
|
8428
|
-
"type": "u8";
|
|
8429
|
-
}
|
|
8430
|
-
];
|
|
8431
|
-
},
|
|
8432
|
-
{
|
|
8433
|
-
"name": "testForceUpdateVpp";
|
|
8434
|
-
"discriminator": [
|
|
8435
|
-
67,
|
|
8436
|
-
51,
|
|
8437
|
-
28,
|
|
8438
|
-
174,
|
|
8439
|
-
200,
|
|
8440
|
-
214,
|
|
8441
|
-
203,
|
|
8442
|
-
162
|
|
8443
|
-
];
|
|
8444
|
-
"accounts": [
|
|
8445
|
-
{
|
|
8446
|
-
"name": "registrant";
|
|
8447
|
-
"writable": true;
|
|
8448
|
-
"signer": true;
|
|
8449
|
-
},
|
|
8450
|
-
{
|
|
8451
|
-
"name": "voteAccount";
|
|
8452
|
-
},
|
|
8453
|
-
{
|
|
8454
|
-
"name": "validatorRecord";
|
|
8455
|
-
"writable": true;
|
|
8456
|
-
},
|
|
8457
|
-
{
|
|
8458
|
-
"name": "leaderboardState";
|
|
8459
|
-
"writable": true;
|
|
8460
|
-
}
|
|
8461
|
-
];
|
|
8462
|
-
"args": [
|
|
8463
|
-
{
|
|
8464
|
-
"name": "vpp";
|
|
8465
|
-
"type": "u8";
|
|
8466
|
-
}
|
|
8467
|
-
];
|
|
8468
|
-
},
|
|
8469
|
-
{
|
|
8470
|
-
"name": "testSeedRandomValidators";
|
|
8471
|
-
"discriminator": [
|
|
8472
|
-
48,
|
|
8473
|
-
155,
|
|
8474
|
-
181,
|
|
8475
|
-
112,
|
|
8476
|
-
163,
|
|
8477
|
-
242,
|
|
8478
|
-
43,
|
|
8479
|
-
146
|
|
8480
|
-
];
|
|
8481
|
-
"accounts": [
|
|
8482
|
-
{
|
|
8483
|
-
"name": "registrant";
|
|
8484
|
-
"writable": true;
|
|
8485
|
-
"signer": true;
|
|
8486
|
-
},
|
|
8487
|
-
{
|
|
8488
|
-
"name": "leaderboardState";
|
|
8489
|
-
"writable": true;
|
|
8490
|
-
}
|
|
8491
|
-
];
|
|
8492
|
-
"args": [
|
|
8493
|
-
{
|
|
8494
|
-
"name": "count";
|
|
8495
|
-
"type": "u16";
|
|
8496
|
-
},
|
|
8497
|
-
{
|
|
8498
|
-
"name": "seed";
|
|
8499
|
-
"type": "u64";
|
|
8500
|
-
},
|
|
8501
|
-
{
|
|
8502
|
-
"name": "minVpp";
|
|
8503
|
-
"type": "u8";
|
|
8504
|
-
},
|
|
8505
|
-
{
|
|
8506
|
-
"name": "maxVpp";
|
|
8507
|
-
"type": "u8";
|
|
8508
|
-
}
|
|
8509
|
-
];
|
|
8510
|
-
},
|
|
8511
8143
|
{
|
|
8512
8144
|
"name": "updateCommission";
|
|
8513
8145
|
"discriminator": [
|
|
@@ -9037,7 +8669,7 @@ declare class SolanaProgramService {
|
|
|
9037
8669
|
listProgramNames(): SolanaProgramName[];
|
|
9038
8670
|
}
|
|
9039
8671
|
|
|
9040
|
-
declare const SCALE:
|
|
8672
|
+
declare const SCALE: BN;
|
|
9041
8673
|
/**
|
|
9042
8674
|
* Solana implementation of IStakingClient.
|
|
9043
8675
|
*
|
|
@@ -9060,9 +8692,22 @@ declare class SolanaStakingClient implements IStakingClient {
|
|
|
9060
8692
|
outpostClient: OutpostClient;
|
|
9061
8693
|
tokenClient: TokenClient;
|
|
9062
8694
|
program: SolanaProgramService;
|
|
8695
|
+
private smartAccount?;
|
|
8696
|
+
private signer?;
|
|
9063
8697
|
get solPubKey(): PublicKey$1;
|
|
9064
8698
|
get network(): ExternalNetwork;
|
|
8699
|
+
get feePayer(): PublicKey$1;
|
|
8700
|
+
get squadsX(): SquadsXConfig | null;
|
|
9065
8701
|
constructor(config: StakerConfig);
|
|
8702
|
+
createVaultLiqsolAtaOneShot(params: {
|
|
8703
|
+
connection: Connection;
|
|
8704
|
+
payer: PublicKey$1;
|
|
8705
|
+
vaultPda: PublicKey$1;
|
|
8706
|
+
}): Promise<{
|
|
8707
|
+
tx: Transaction;
|
|
8708
|
+
vaultAta: PublicKey$1;
|
|
8709
|
+
} | null>;
|
|
8710
|
+
private prepSquadsIxs;
|
|
9066
8711
|
/**
|
|
9067
8712
|
* Deposit native SOL into liqSOL (liqsol_core::deposit).
|
|
9068
8713
|
* Handles tx build, sign, send, and confirmation.
|
|
@@ -9109,6 +8754,8 @@ declare class SolanaStakingClient implements IStakingClient {
|
|
|
9109
8754
|
* Used by balance-correction flows and debugging.
|
|
9110
8755
|
*/
|
|
9111
8756
|
getUserRecord(): Promise<DistributionUserRecord | null>;
|
|
8757
|
+
get squadsMultisigPDA(): PublicKey$1 | null;
|
|
8758
|
+
get squadsVaultPDA(): PublicKey$1 | null;
|
|
9112
8759
|
/**
|
|
9113
8760
|
* Unified, chain-agnostic tranche snapshot for Solana.
|
|
9114
8761
|
*
|
|
@@ -9361,4 +9008,4 @@ declare const lamportsToSol: (lamports: number | bigint) => number;
|
|
|
9361
9008
|
declare const solToLamports: (sol: number) => bigint;
|
|
9362
9009
|
|
|
9363
9010
|
export { ADDRESSES, CHAINLINK_FEED, CHAINLINK_PROGRAM, CONTRACTS, DEFAULT_AVERAGE_PAY_RATE, DEFAULT_PAY_RATE_LOOKBACK, DepositClient, DistributionClient, EPHEMERAL_RENT_EXEMPTION, ERC1155Abi, ERC20Abi, ERC721Abi, types$1 as ETH, EthereumContractService, EthereumStakingClient, INDEX_SCALE, INITIAL_TRANCHE_SUPPLY, LAMPORTS_PER_SOL, LIQSOL_CORE, LIQSOL_TOKEN, LeaderboardClient, OutpostClient, PAY_RATE_SCALE_FACTOR, PDA_SEEDS, PROGRAM_IDS, PurchaseAsset, ReceiptNFTKind, SCALE, types as SOL, SolanaStakingClient, Staker, TRANSFER_HOOK, TokenClient, VALIDATOR_LEADERBOARD, airdropSol, buildOutpostAccounts, buildSolanaTrancheLadder, buildSolanaTrancheSnapshot, calculateExpectedFee, ceilDiv, deriveBarConfigPda, deriveBondLevelPda, deriveBondedActorPda, deriveBucketAuthorityPda, deriveDepositAuthorityPda, deriveDistributionStatePda, deriveEphemeralStakeAddress, deriveExtraAccountMetaListPda, deriveGlobalConfigPda, deriveLeaderboardStatePda, deriveLiqReceiptDataPda, deriveLiqsolMintAuthorityPda, deriveLiqsolMintPda, deriveMaintenanceLedgerPda, deriveOutpostAccountPda, deriveOutpostGlobalStatePda, deriveOutpostPoolAuthorityPda, derivePayRateHistoryPda, derivePayoutStatePda, derivePriceHistoryPda, deriveReservePoolPda, deriveStakeAllocationStatePda, deriveStakeControllerStatePda, deriveStakeControllerVaultPda, deriveStakeMetricsPda, deriveTrancheStatePda, deriveUserPretokenRecordPda, deriveUserRecordPda, deriveValidatorRecordPda, deriveVaultPda, deriveWithdrawGlobalPda, deriveWithdrawMintAuthorityPda, deriveWithdrawMintMetadataPda, deriveWithdrawNftMintPda, generateRandomDepositAmount, generateTestKeypair, getAveragePayRate, getBucketLiqSolBalance, getEpochSnapshot, getErrorMessage, getLiqsolCoreProgram, getPayoutStateRaw, getReservePoolBalance, getStakeControllerStateRaw, getUserLiqSolBalance, getUserRecordRaw, lamportsToSol, msToEpochEnd, previewDepositEffects, scheduledInstruction, sleep, solToLamports, toBigint, tokensToShares, waitForConfirmation, waitUntilSafeToExecuteFunction };
|
|
9364
|
-
export type { BalanceView, ContractConfig, ContractOptions, Contracts, EpochSnapshot, IStakingClient, OPPAssertion, OutpostAccounts, Portfolio, PurchaseQuote, ScheduleConfig, StakerConfig, TrancheLadderItem, TrancheSnapshot, YieldView };
|
|
9011
|
+
export type { BalanceView, ContractConfig, ContractOptions, Contracts, EpochSnapshot, IStakingClient, OPPAssertion, OutpostAccounts, Portfolio, PurchaseQuote, ScheduleConfig, SquadsXConfig, StakerConfig, TrancheLadderItem, TrancheSnapshot, YieldView };
|