@kamino-finance/klend-sdk 5.10.28-beta.1 → 5.11.0-beta.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/classes/action.d.ts +22 -14
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +585 -132
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/index.d.ts +0 -3
- package/dist/classes/index.d.ts.map +1 -1
- package/dist/classes/index.js +0 -3
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/manager.js +1 -1
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/obligation.d.ts +1 -6
- package/dist/classes/obligation.d.ts.map +1 -1
- package/dist/classes/obligation.js +2 -4
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/types.d.ts +1 -13
- package/dist/classes/types.d.ts.map +1 -1
- package/dist/idl.json +71 -5
- package/dist/idl_codegen/accounts/Obligation.d.ts +6 -0
- package/dist/idl_codegen/accounts/Obligation.d.ts.map +1 -1
- package/dist/idl_codegen/accounts/Obligation.js +8 -1
- package/dist/idl_codegen/accounts/Obligation.js.map +1 -1
- package/dist/idl_codegen/errors/custom.d.ts +35 -3
- package/dist/idl_codegen/errors/custom.d.ts.map +1 -1
- package/dist/idl_codegen/errors/custom.js +61 -5
- package/dist/idl_codegen/errors/custom.js.map +1 -1
- package/dist/idl_codegen/instructions/repayAndWithdrawAndRedeem.d.ts +9 -0
- package/dist/idl_codegen/instructions/repayAndWithdrawAndRedeem.d.ts.map +1 -1
- package/dist/idl_codegen/instructions/repayAndWithdrawAndRedeem.js +22 -1
- package/dist/idl_codegen/instructions/repayAndWithdrawAndRedeem.js.map +1 -1
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js +1 -1
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js.map +1 -1
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.js +1 -1
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.js.map +1 -1
- package/dist/idl_codegen/zero_padding/ObligationZP.d.ts +2 -0
- package/dist/idl_codegen/zero_padding/ObligationZP.d.ts.map +1 -1
- package/dist/idl_codegen/zero_padding/ObligationZP.js +6 -1
- package/dist/idl_codegen/zero_padding/ObligationZP.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.d.ts +3 -2
- package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.js +7 -6
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.d.ts +5 -0
- package/dist/lending_operations/swap_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.js +4 -2
- package/dist/lending_operations/swap_collateral_operations.js.map +1 -1
- package/dist/leverage/calcs.d.ts +1 -1
- package/dist/leverage/calcs.d.ts.map +1 -1
- package/dist/leverage/calcs.js +10 -12
- package/dist/leverage/calcs.js.map +1 -1
- package/dist/leverage/operations.d.ts +8 -8
- package/dist/leverage/operations.d.ts.map +1 -1
- package/dist/leverage/operations.js +27 -24
- package/dist/leverage/operations.js.map +1 -1
- package/dist/leverage/types.d.ts +4 -1
- package/dist/leverage/types.d.ts.map +1 -1
- package/dist/utils/seeds.d.ts +5 -0
- package/dist/utils/seeds.d.ts.map +1 -1
- package/dist/utils/seeds.js +10 -1
- package/dist/utils/seeds.js.map +1 -1
- package/dist/utils/userMetadata.d.ts.map +1 -1
- package/dist/utils/userMetadata.js +6 -9
- package/dist/utils/userMetadata.js.map +1 -1
- package/package.json +4 -4
- package/src/classes/action.ts +749 -146
- package/src/classes/index.ts +0 -3
- package/src/classes/manager.ts +1 -1
- package/src/classes/obligation.ts +4 -8
- package/src/classes/types.ts +1 -17
- package/src/client.ts +7 -3
- package/src/idl.json +71 -5
- package/src/idl_codegen/accounts/Obligation.ts +12 -1
- package/src/idl_codegen/errors/custom.ts +66 -4
- package/src/idl_codegen/instructions/repayAndWithdrawAndRedeem.ts +31 -1
- package/src/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.ts +1 -1
- package/src/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.ts +1 -1
- package/src/idl_codegen/zero_padding/ObligationZP.ts +6 -1
- package/src/lending_operations/repay_with_collateral_operations.ts +11 -3
- package/src/lending_operations/swap_collateral_operations.ts +11 -0
- package/src/leverage/calcs.ts +13 -16
- package/src/leverage/operations.ts +38 -11
- package/src/leverage/types.ts +4 -1
- package/src/utils/seeds.ts +13 -0
- package/src/utils/userMetadata.ts +19 -24
- package/dist/classes/stakePool.d.ts +0 -8
- package/dist/classes/stakePool.d.ts.map +0 -1
- package/dist/classes/stakePool.js +0 -18
- package/dist/classes/stakePool.js.map +0 -1
- package/dist/classes/standardStakePool.d.ts +0 -174
- package/dist/classes/standardStakePool.d.ts.map +0 -1
- package/dist/classes/standardStakePool.js +0 -275
- package/dist/classes/standardStakePool.js.map +0 -1
- package/dist/classes/unstakingPool.d.ts +0 -117
- package/dist/classes/unstakingPool.d.ts.map +0 -1
- package/dist/classes/unstakingPool.js +0 -448
- package/dist/classes/unstakingPool.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/accounts/PoolState.d.ts +0 -50
- package/dist/idl_codegen_unstaking_pool/accounts/PoolState.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/accounts/PoolState.js +0 -156
- package/dist/idl_codegen_unstaking_pool/accounts/PoolState.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/accounts/index.d.ts +0 -3
- package/dist/idl_codegen_unstaking_pool/accounts/index.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/accounts/index.js +0 -6
- package/dist/idl_codegen_unstaking_pool/accounts/index.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/errors/anchor.d.ts +0 -435
- package/dist/idl_codegen_unstaking_pool/errors/anchor.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/errors/anchor.js +0 -767
- package/dist/idl_codegen_unstaking_pool/errors/anchor.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/errors/custom.d.ts +0 -163
- package/dist/idl_codegen_unstaking_pool/errors/custom.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/errors/custom.js +0 -290
- package/dist/idl_codegen_unstaking_pool/errors/custom.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/errors/index.d.ts +0 -6
- package/dist/idl_codegen_unstaking_pool/errors/index.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/errors/index.js +0 -75
- package/dist/idl_codegen_unstaking_pool/errors/index.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/burn.d.ts +0 -21
- package/dist/idl_codegen_unstaking_pool/instructions/burn.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/burn.js +0 -73
- package/dist/idl_codegen_unstaking_pool/instructions/burn.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/collect.d.ts +0 -16
- package/dist/idl_codegen_unstaking_pool/instructions/collect.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/collect.js +0 -29
- package/dist/idl_codegen_unstaking_pool/instructions/collect.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/index.d.ts +0 -11
- package/dist/idl_codegen_unstaking_pool/instructions/index.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/index.js +0 -14
- package/dist/idl_codegen_unstaking_pool/instructions/index.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/initializePool.d.ts +0 -15
- package/dist/idl_codegen_unstaking_pool/instructions/initializePool.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/initializePool.js +0 -28
- package/dist/idl_codegen_unstaking_pool/instructions/initializePool.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/mint.d.ts +0 -21
- package/dist/idl_codegen_unstaking_pool/instructions/mint.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/mint.js +0 -77
- package/dist/idl_codegen_unstaking_pool/instructions/mint.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/updatePoolConfig.d.ts +0 -13
- package/dist/idl_codegen_unstaking_pool/instructions/updatePoolConfig.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/instructions/updatePoolConfig.js +0 -58
- package/dist/idl_codegen_unstaking_pool/instructions/updatePoolConfig.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/programId.d.ts +0 -4
- package/dist/idl_codegen_unstaking_pool/programId.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/programId.js +0 -9
- package/dist/idl_codegen_unstaking_pool/programId.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/types/PoolConfigField.d.ts +0 -32
- package/dist/idl_codegen_unstaking_pool/types/PoolConfigField.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/types/PoolConfigField.js +0 -105
- package/dist/idl_codegen_unstaking_pool/types/PoolConfigField.js.map +0 -1
- package/dist/idl_codegen_unstaking_pool/types/index.d.ts +0 -5
- package/dist/idl_codegen_unstaking_pool/types/index.d.ts.map +0 -1
- package/dist/idl_codegen_unstaking_pool/types/index.js +0 -39
- package/dist/idl_codegen_unstaking_pool/types/index.js.map +0 -1
- package/src/classes/stakePool.ts +0 -21
- package/src/classes/standardStakePool.ts +0 -358
- package/src/classes/unstakingPool.ts +0 -577
- package/src/idl_codegen_unstaking_pool/accounts/PoolState.ts +0 -163
- package/src/idl_codegen_unstaking_pool/accounts/index.ts +0 -2
- package/src/idl_codegen_unstaking_pool/errors/anchor.ts +0 -764
- package/src/idl_codegen_unstaking_pool/errors/custom.ts +0 -288
- package/src/idl_codegen_unstaking_pool/errors/index.ts +0 -49
- package/src/idl_codegen_unstaking_pool/instructions/burn.ts +0 -60
- package/src/idl_codegen_unstaking_pool/instructions/collect.ts +0 -43
- package/src/idl_codegen_unstaking_pool/instructions/index.ts +0 -10
- package/src/idl_codegen_unstaking_pool/instructions/initializePool.ts +0 -41
- package/src/idl_codegen_unstaking_pool/instructions/mint.ts +0 -64
- package/src/idl_codegen_unstaking_pool/instructions/updatePoolConfig.ts +0 -40
- package/src/idl_codegen_unstaking_pool/programId.ts +0 -7
- package/src/idl_codegen_unstaking_pool/types/PoolConfigField.ts +0 -85
- package/src/idl_codegen_unstaking_pool/types/index.ts +0 -6
- package/src/idl_unstaking_pool.json +0 -456
package/src/leverage/calcs.ts
CHANGED
|
@@ -65,8 +65,7 @@ export async function calculateMultiplyEffects(
|
|
|
65
65
|
debtBorrowFactorPct,
|
|
66
66
|
priceCollToDebt,
|
|
67
67
|
priceDebtToColl,
|
|
68
|
-
}: LeverageFormsCalcsArgs
|
|
69
|
-
logEstimations = false
|
|
68
|
+
}: LeverageFormsCalcsArgs
|
|
70
69
|
): Promise<FormsCalcsResult> {
|
|
71
70
|
// calculate estimations for deposit operation
|
|
72
71
|
const {
|
|
@@ -108,20 +107,18 @@ export async function calculateMultiplyEffects(
|
|
|
108
107
|
flashLoanFee: flashBorrowReserveFlashLoanFeePercentage, // TODO: is this the right flash borrow?
|
|
109
108
|
});
|
|
110
109
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
);
|
|
124
|
-
}
|
|
110
|
+
console.log(
|
|
111
|
+
'Estimations',
|
|
112
|
+
toJson({
|
|
113
|
+
activeTab,
|
|
114
|
+
depositModeEstimatedDepositAmount,
|
|
115
|
+
depositModeEstimatedBorrowAmount,
|
|
116
|
+
withdrawModeEstimatedDepositTokenWithdrawn,
|
|
117
|
+
withdrawModeEstimatedBorrowTokenWithdrawn,
|
|
118
|
+
adjustModeEstimatedDepositAmount,
|
|
119
|
+
adjustModeEstimateBorrowAmount,
|
|
120
|
+
})
|
|
121
|
+
);
|
|
125
122
|
|
|
126
123
|
let [isClosingPosition, totalDeposited, totalBorrowed] = [false, new Decimal(0), new Decimal(0)];
|
|
127
124
|
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
DepositLeverageInitialInputs,
|
|
50
50
|
DepositWithLeverageProps,
|
|
51
51
|
DepositWithLeverageSwapInputsProps,
|
|
52
|
-
|
|
52
|
+
DepositLeverageIxsResponse,
|
|
53
53
|
PriceAinBProvider,
|
|
54
54
|
SwapInputs,
|
|
55
55
|
SwapIxs,
|
|
@@ -82,6 +82,7 @@ export async function getDepositWithLeverageSwapInputs<QuoteResponse>({
|
|
|
82
82
|
priceAinB,
|
|
83
83
|
isKtoken,
|
|
84
84
|
quoter,
|
|
85
|
+
useV2Ixs,
|
|
85
86
|
elevationGroupOverride,
|
|
86
87
|
}: DepositWithLeverageSwapInputsProps<QuoteResponse>): Promise<{
|
|
87
88
|
swapInputs: SwapInputs;
|
|
@@ -147,6 +148,7 @@ export async function getDepositWithLeverageSwapInputs<QuoteResponse>({
|
|
|
147
148
|
},
|
|
148
149
|
strategy,
|
|
149
150
|
collIsKtoken,
|
|
151
|
+
useV2Ixs,
|
|
150
152
|
elevationGroupOverride
|
|
151
153
|
);
|
|
152
154
|
|
|
@@ -311,7 +313,8 @@ export async function getDepositWithLeverageIxns<QuoteResponse>({
|
|
|
311
313
|
quoter,
|
|
312
314
|
swapper,
|
|
313
315
|
elevationGroupOverride,
|
|
314
|
-
|
|
316
|
+
useV2Ixs,
|
|
317
|
+
}: DepositWithLeverageProps<QuoteResponse>): Promise<DepositLeverageIxsResponse<QuoteResponse>> {
|
|
315
318
|
const { swapInputs, initialInputs } = await getDepositWithLeverageSwapInputs({
|
|
316
319
|
owner,
|
|
317
320
|
kaminoMarket,
|
|
@@ -333,6 +336,7 @@ export async function getDepositWithLeverageIxns<QuoteResponse>({
|
|
|
333
336
|
priceAinB,
|
|
334
337
|
isKtoken,
|
|
335
338
|
quoter,
|
|
339
|
+
useV2Ixs,
|
|
336
340
|
});
|
|
337
341
|
|
|
338
342
|
let depositSwapper: SwapIxsProvider<QuoteResponse>;
|
|
@@ -388,6 +392,7 @@ export async function getDepositWithLeverageIxns<QuoteResponse>({
|
|
|
388
392
|
},
|
|
389
393
|
initialInputs.strategy,
|
|
390
394
|
initialInputs.collIsKtoken,
|
|
395
|
+
useV2Ixs,
|
|
391
396
|
elevationGroupOverride
|
|
392
397
|
);
|
|
393
398
|
|
|
@@ -414,6 +419,7 @@ async function buildDepositWithLeverageIxns(
|
|
|
414
419
|
swapQuoteIxs: SwapIxs,
|
|
415
420
|
strategy: StrategyWithAddress | undefined,
|
|
416
421
|
collIsKtoken: boolean,
|
|
422
|
+
useV2Ixs: boolean,
|
|
417
423
|
elevationGroupOverride?: number
|
|
418
424
|
): Promise<TransactionInstruction[]> {
|
|
419
425
|
const budgetIxns = budgetAndPriorityFeeIxs || getComputeBudgetAndPriorityFeeIxns(3000000);
|
|
@@ -526,6 +532,7 @@ async function buildDepositWithLeverageIxns(
|
|
|
526
532
|
debtTokenMint,
|
|
527
533
|
owner,
|
|
528
534
|
obligation!,
|
|
535
|
+
useV2Ixs,
|
|
529
536
|
0,
|
|
530
537
|
false,
|
|
531
538
|
elevationGroupOverride === 0 ? false : true, // emode
|
|
@@ -587,6 +594,7 @@ export async function getWithdrawWithLeverageSwapInputs<QuoteResponse>({
|
|
|
587
594
|
quoteBufferBps,
|
|
588
595
|
isKtoken,
|
|
589
596
|
quoter,
|
|
597
|
+
useV2Ixs,
|
|
590
598
|
}: WithdrawWithLeverageSwapInputsProps<QuoteResponse>): Promise<{
|
|
591
599
|
swapInputs: SwapInputs;
|
|
592
600
|
initialInputs: WithdrawLeverageInitialInputs<QuoteResponse>;
|
|
@@ -637,7 +645,8 @@ export async function getWithdrawWithLeverageSwapInputs<QuoteResponse>({
|
|
|
637
645
|
lookupTables: [],
|
|
638
646
|
},
|
|
639
647
|
strategy,
|
|
640
|
-
collIsKtoken
|
|
648
|
+
collIsKtoken,
|
|
649
|
+
useV2Ixs
|
|
641
650
|
);
|
|
642
651
|
|
|
643
652
|
const uniqueKlendAccounts = uniqueAccounts(klendIxs);
|
|
@@ -720,6 +729,7 @@ export async function getWithdrawWithLeverageIxns<QuoteResponse>({
|
|
|
720
729
|
isKtoken,
|
|
721
730
|
quoter,
|
|
722
731
|
swapper,
|
|
732
|
+
useV2Ixs,
|
|
723
733
|
}: WithdrawWithLeverageProps<QuoteResponse>): Promise<WithdrawLeverageIxsResponse<QuoteResponse>> {
|
|
724
734
|
const collReserve = kaminoMarket.getReserveByMint(collTokenMint);
|
|
725
735
|
const debtReserve = kaminoMarket.getReserveByMint(debtTokenMint);
|
|
@@ -747,6 +757,7 @@ export async function getWithdrawWithLeverageIxns<QuoteResponse>({
|
|
|
747
757
|
quoteBufferBps,
|
|
748
758
|
isKtoken,
|
|
749
759
|
quoter,
|
|
760
|
+
useV2Ixs,
|
|
750
761
|
});
|
|
751
762
|
|
|
752
763
|
let withdrawSwapper: SwapIxsProvider<QuoteResponse>;
|
|
@@ -797,7 +808,8 @@ export async function getWithdrawWithLeverageIxns<QuoteResponse>({
|
|
|
797
808
|
lookupTables,
|
|
798
809
|
},
|
|
799
810
|
initialInputs.strategy,
|
|
800
|
-
initialInputs.collIsKtoken
|
|
811
|
+
initialInputs.collIsKtoken,
|
|
812
|
+
useV2Ixs
|
|
801
813
|
);
|
|
802
814
|
|
|
803
815
|
// Send ixns and lookup tables
|
|
@@ -824,7 +836,8 @@ export async function buildWithdrawWithLeverageIxns(
|
|
|
824
836
|
budgetAndPriorityFeeIxs: TransactionInstruction[] | undefined,
|
|
825
837
|
swapQuoteIxs: SwapIxs,
|
|
826
838
|
strategy: StrategyWithAddress | undefined,
|
|
827
|
-
collIsKtoken: boolean
|
|
839
|
+
collIsKtoken: boolean,
|
|
840
|
+
useV2Ixs: boolean
|
|
828
841
|
): Promise<TransactionInstruction[]> {
|
|
829
842
|
const collTokenMint = collReserve.getLiquidityMint();
|
|
830
843
|
const debtTokenMint = debtReserve.getLiquidityMint();
|
|
@@ -936,6 +949,7 @@ export async function buildWithdrawWithLeverageIxns(
|
|
|
936
949
|
owner,
|
|
937
950
|
currentSlot,
|
|
938
951
|
obligation,
|
|
952
|
+
useV2Ixs,
|
|
939
953
|
0,
|
|
940
954
|
false,
|
|
941
955
|
false, // to be checked and created in a setup tx in the UI (won't be the case for withdraw anyway as this would be created in deposit)
|
|
@@ -980,6 +994,7 @@ export async function getAdjustLeverageSwapInputs<QuoteResponse>({
|
|
|
980
994
|
quoteBufferBps,
|
|
981
995
|
isKtoken,
|
|
982
996
|
quoter,
|
|
997
|
+
useV2Ixs,
|
|
983
998
|
}: AdjustLeverageSwapInputsProps<QuoteResponse>): Promise<{
|
|
984
999
|
swapInputs: SwapInputs;
|
|
985
1000
|
initialInputs: AdjustLeverageInitialInputs<QuoteResponse>;
|
|
@@ -1045,7 +1060,8 @@ export async function getAdjustLeverageSwapInputs<QuoteResponse>({
|
|
|
1045
1060
|
swapIxs: [],
|
|
1046
1061
|
lookupTables: [],
|
|
1047
1062
|
},
|
|
1048
|
-
budgetAndPriorityFeeIxs
|
|
1063
|
+
budgetAndPriorityFeeIxs,
|
|
1064
|
+
useV2Ixs
|
|
1049
1065
|
);
|
|
1050
1066
|
|
|
1051
1067
|
const uniqueKlendAccounts = uniqueAccounts(klendIxs);
|
|
@@ -1148,7 +1164,8 @@ export async function getAdjustLeverageSwapInputs<QuoteResponse>({
|
|
|
1148
1164
|
swapIxs: [],
|
|
1149
1165
|
lookupTables: [],
|
|
1150
1166
|
},
|
|
1151
|
-
budgetAndPriorityFeeIxs
|
|
1167
|
+
budgetAndPriorityFeeIxs,
|
|
1168
|
+
useV2Ixs
|
|
1152
1169
|
);
|
|
1153
1170
|
|
|
1154
1171
|
const uniqueKlendAccounts = uniqueAccounts(klendIxs);
|
|
@@ -1234,6 +1251,7 @@ export async function getAdjustLeverageIxns<QuoteResponse>({
|
|
|
1234
1251
|
isKtoken,
|
|
1235
1252
|
quoter,
|
|
1236
1253
|
swapper,
|
|
1254
|
+
useV2Ixs,
|
|
1237
1255
|
}: AdjustLeverageProps<QuoteResponse>): Promise<AdjustLeverageIxsResponse<QuoteResponse>> {
|
|
1238
1256
|
const { swapInputs, initialInputs } = await getAdjustLeverageSwapInputs({
|
|
1239
1257
|
owner,
|
|
@@ -1256,6 +1274,7 @@ export async function getAdjustLeverageIxns<QuoteResponse>({
|
|
|
1256
1274
|
priceAinB,
|
|
1257
1275
|
isKtoken,
|
|
1258
1276
|
quoter,
|
|
1277
|
+
useV2Ixs,
|
|
1259
1278
|
});
|
|
1260
1279
|
|
|
1261
1280
|
// leverage increased so we need to deposit and borrow more
|
|
@@ -1303,7 +1322,8 @@ export async function getAdjustLeverageIxns<QuoteResponse>({
|
|
|
1303
1322
|
swapIxs,
|
|
1304
1323
|
lookupTables,
|
|
1305
1324
|
},
|
|
1306
|
-
budgetAndPriorityFeeIxs
|
|
1325
|
+
budgetAndPriorityFeeIxs,
|
|
1326
|
+
useV2Ixs
|
|
1307
1327
|
);
|
|
1308
1328
|
return {
|
|
1309
1329
|
ixs,
|
|
@@ -1349,7 +1369,8 @@ export async function getAdjustLeverageIxns<QuoteResponse>({
|
|
|
1349
1369
|
swapIxs,
|
|
1350
1370
|
lookupTables,
|
|
1351
1371
|
},
|
|
1352
|
-
budgetAndPriorityFeeIxs
|
|
1372
|
+
budgetAndPriorityFeeIxs,
|
|
1373
|
+
useV2Ixs
|
|
1353
1374
|
);
|
|
1354
1375
|
|
|
1355
1376
|
return {
|
|
@@ -1377,7 +1398,8 @@ async function buildIncreaseLeverageIxns(
|
|
|
1377
1398
|
scopeFeed: string | undefined,
|
|
1378
1399
|
collIsKtoken: boolean,
|
|
1379
1400
|
swapQuoteIxs: SwapIxs,
|
|
1380
|
-
budgetAndPriorityFeeIxns: TransactionInstruction[] | undefined
|
|
1401
|
+
budgetAndPriorityFeeIxns: TransactionInstruction[] | undefined,
|
|
1402
|
+
useV2Ixs: boolean
|
|
1381
1403
|
): Promise<TransactionInstruction[]> {
|
|
1382
1404
|
const collReserve = kaminoMarket.getReserveByMint(collTokenMint);
|
|
1383
1405
|
const debtReserve = kaminoMarket.getReserveByMint(debtTokenMint);
|
|
@@ -1469,6 +1491,7 @@ async function buildIncreaseLeverageIxns(
|
|
|
1469
1491
|
collTokenMint,
|
|
1470
1492
|
owner,
|
|
1471
1493
|
obligation,
|
|
1494
|
+
useV2Ixs,
|
|
1472
1495
|
0,
|
|
1473
1496
|
false,
|
|
1474
1497
|
false,
|
|
@@ -1485,6 +1508,7 @@ async function buildIncreaseLeverageIxns(
|
|
|
1485
1508
|
debtTokenMint,
|
|
1486
1509
|
owner,
|
|
1487
1510
|
obligation,
|
|
1511
|
+
useV2Ixs,
|
|
1488
1512
|
0,
|
|
1489
1513
|
false,
|
|
1490
1514
|
false,
|
|
@@ -1543,7 +1567,8 @@ async function buildDecreaseLeverageIxns(
|
|
|
1543
1567
|
scopeFeed: string | undefined,
|
|
1544
1568
|
collIsKtoken: boolean,
|
|
1545
1569
|
swapQuoteIxs: SwapIxs,
|
|
1546
|
-
budgetAndPriorityFeeIxns: TransactionInstruction[] | undefined
|
|
1570
|
+
budgetAndPriorityFeeIxns: TransactionInstruction[] | undefined,
|
|
1571
|
+
useV2Ixs: boolean
|
|
1547
1572
|
): Promise<TransactionInstruction[]> {
|
|
1548
1573
|
const collReserve = kaminoMarket.getReserveByMint(collTokenMint);
|
|
1549
1574
|
const debtReserve = kaminoMarket.getReserveByMint(debtTokenMint);
|
|
@@ -1643,6 +1668,7 @@ async function buildDecreaseLeverageIxns(
|
|
|
1643
1668
|
debtTokenMint,
|
|
1644
1669
|
owner,
|
|
1645
1670
|
obligation,
|
|
1671
|
+
useV2Ixs,
|
|
1646
1672
|
currentSlot,
|
|
1647
1673
|
undefined,
|
|
1648
1674
|
0,
|
|
@@ -1660,6 +1686,7 @@ async function buildDecreaseLeverageIxns(
|
|
|
1660
1686
|
collTokenMint,
|
|
1661
1687
|
owner,
|
|
1662
1688
|
obligation,
|
|
1689
|
+
useV2Ixs,
|
|
1663
1690
|
0,
|
|
1664
1691
|
false,
|
|
1665
1692
|
false,
|
package/src/leverage/types.ts
CHANGED
|
@@ -49,7 +49,7 @@ export type KaminoDepositSwapOverride = (
|
|
|
49
49
|
amountDebtAtaBalance: Decimal
|
|
50
50
|
) => Promise<InstructionsWithLookupTables>;
|
|
51
51
|
|
|
52
|
-
export type
|
|
52
|
+
export type DepositLeverageIxsResponse<QuoteResponse> = {
|
|
53
53
|
ixs: TransactionInstruction[];
|
|
54
54
|
lookupTables: AddressLookupTableAccount[];
|
|
55
55
|
swapInputs: SwapInputs;
|
|
@@ -90,6 +90,7 @@ export interface DepositWithLeverageSwapInputsProps<QuoteResponse> {
|
|
|
90
90
|
// currently only used to disable requesting elevation group when this value is 0
|
|
91
91
|
// to be implemented properly in the future
|
|
92
92
|
elevationGroupOverride?: number;
|
|
93
|
+
useV2Ixs: boolean;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
export interface DepositWithLeverageProps<QuoteResponse> extends DepositWithLeverageSwapInputsProps<QuoteResponse> {
|
|
@@ -146,6 +147,7 @@ export interface WithdrawWithLeverageSwapInputsProps<QuoteResponse> {
|
|
|
146
147
|
quoteBufferBps: Decimal;
|
|
147
148
|
isKtoken: IsKtokenProvider;
|
|
148
149
|
quoter: SwapQuoteProvider<QuoteResponse>;
|
|
150
|
+
useV2Ixs: boolean;
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
export interface WithdrawWithLeverageProps<QuoteResponse> extends WithdrawWithLeverageSwapInputsProps<QuoteResponse> {
|
|
@@ -199,6 +201,7 @@ export interface AdjustLeverageSwapInputsProps<QuoteResponse> {
|
|
|
199
201
|
priceAinB: PriceAinBProvider;
|
|
200
202
|
isKtoken: IsKtokenProvider;
|
|
201
203
|
quoter: SwapQuoteProvider<QuoteResponse>;
|
|
204
|
+
useV2Ixs: boolean;
|
|
202
205
|
}
|
|
203
206
|
|
|
204
207
|
export interface AdjustLeverageProps<QuoteResponse> extends AdjustLeverageSwapInputsProps<QuoteResponse> {
|
package/src/utils/seeds.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { PROGRAM_ID } from '../idl_codegen/programId';
|
|
3
|
+
import { farmsId } from '@kamino-finance/farms-sdk';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Lending market authority seed
|
|
@@ -38,6 +39,11 @@ export const BASE_SEED_REFERRER_STATE = 'ref_state';
|
|
|
38
39
|
*/
|
|
39
40
|
export const BASE_SEED_SHORT_URL = 'short_url';
|
|
40
41
|
|
|
42
|
+
/**
|
|
43
|
+
* User farm state seed
|
|
44
|
+
*/
|
|
45
|
+
export const BASE_SEED_FARM_USER_STATE = Buffer.from('user');
|
|
46
|
+
|
|
41
47
|
/**
|
|
42
48
|
* Encapsulates all the PDAs for a given reserve
|
|
43
49
|
*/
|
|
@@ -181,3 +187,10 @@ export function referrerStatePda(referrer: PublicKey, programId: PublicKey = PRO
|
|
|
181
187
|
export function shortUrlPda(shortUrl: string, programId: PublicKey = PROGRAM_ID) {
|
|
182
188
|
return PublicKey.findProgramAddressSync([Buffer.from(BASE_SEED_SHORT_URL), Buffer.from(shortUrl)], programId);
|
|
183
189
|
}
|
|
190
|
+
|
|
191
|
+
export function obligationFarmStatePda(obligation: PublicKey, farm: PublicKey, programId: PublicKey = farmsId) {
|
|
192
|
+
return PublicKey.findProgramAddressSync(
|
|
193
|
+
[Buffer.from(BASE_SEED_FARM_USER_STATE), farm.toBuffer(), obligation.toBuffer()],
|
|
194
|
+
programId
|
|
195
|
+
);
|
|
196
|
+
}
|
|
@@ -20,8 +20,8 @@ import {
|
|
|
20
20
|
isNotNullPubkey,
|
|
21
21
|
UserMetadata,
|
|
22
22
|
PublicKeySet,
|
|
23
|
+
obligationFarmStatePda,
|
|
23
24
|
} from '../lib';
|
|
24
|
-
import { farmsId } from '@kamino-finance/farms-sdk';
|
|
25
25
|
import { KaminoReserve } from '../classes/reserve';
|
|
26
26
|
|
|
27
27
|
export type KaminoUserMetadata = {
|
|
@@ -266,19 +266,19 @@ function getMultiplyObligationAndObligationFarmStateAddresses(
|
|
|
266
266
|
});
|
|
267
267
|
if (!collReserve.state.farmCollateral.equals(PublicKey.default)) {
|
|
268
268
|
farmUserStates.push({
|
|
269
|
-
address:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
),
|
|
269
|
+
address: obligationFarmStatePda(
|
|
270
|
+
multiplyObligation.toPda(kaminoMarket.getAddress(), user),
|
|
271
|
+
collReserve.state.farmCollateral!
|
|
272
|
+
)[0],
|
|
273
273
|
log: 'collReserve farmState for multiply obligation coll: ' + collMintString + ' debt: ' + debtMintString,
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
276
|
if (!debtReserve.state.farmDebt.equals(PublicKey.default)) {
|
|
277
277
|
farmUserStates.push({
|
|
278
|
-
address:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
),
|
|
278
|
+
address: obligationFarmStatePda(
|
|
279
|
+
multiplyObligation.toPda(kaminoMarket.getAddress(), user),
|
|
280
|
+
debtReserve.state.farmDebt!
|
|
281
|
+
)[0],
|
|
282
282
|
log: 'debtReserve farmState for multiply obligation coll: ' + collMintString + ' debt: ' + debtMintString,
|
|
283
283
|
});
|
|
284
284
|
}
|
|
@@ -309,19 +309,19 @@ function getLeverageObligationAndObligationFarmStateAddresses(
|
|
|
309
309
|
});
|
|
310
310
|
if (!collReserve.state.farmCollateral.equals(PublicKey.default)) {
|
|
311
311
|
farmUserStates.push({
|
|
312
|
-
address:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
),
|
|
312
|
+
address: obligationFarmStatePda(
|
|
313
|
+
leverageObligation.toPda(kaminoMarket.getAddress(), user),
|
|
314
|
+
collReserve.state.farmCollateral!
|
|
315
|
+
)[0],
|
|
316
316
|
log: 'collReserve farmState for leverage obligation coll: ' + collMintString + ' debt: ' + debtMintString,
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
319
|
if (!debtReserve.state.farmDebt.equals(PublicKey.default)) {
|
|
320
320
|
farmUserStates.push({
|
|
321
|
-
address:
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
),
|
|
321
|
+
address: obligationFarmStatePda(
|
|
322
|
+
leverageObligation.toPda(kaminoMarket.getAddress(), user),
|
|
323
|
+
debtReserve.state.farmDebt!
|
|
324
|
+
)[0],
|
|
325
325
|
log: 'debtReserve farmState for leverage obligation coll: ' + collMintString + ' debt: ' + debtMintString,
|
|
326
326
|
});
|
|
327
327
|
}
|
|
@@ -342,7 +342,7 @@ function getRepayWithCollObligationFarmStateAddresses(
|
|
|
342
342
|
const borrowReserve = kaminoMarket.getReserveByMint(borrow.mintAddress)!;
|
|
343
343
|
if (!borrowReserve.state.farmDebt.equals(PublicKey.default)) {
|
|
344
344
|
farmUserStates.push({
|
|
345
|
-
address:
|
|
345
|
+
address: obligationFarmStatePda(obligation.obligationAddress, borrowReserve.state.farmDebt!)[0],
|
|
346
346
|
log: 'debtReserve farmState for vanilla obligation: ' + obligationString,
|
|
347
347
|
});
|
|
348
348
|
}
|
|
@@ -352,7 +352,7 @@ function getRepayWithCollObligationFarmStateAddresses(
|
|
|
352
352
|
const depositReserve = kaminoMarket.getReserveByMint(deposit.mintAddress)!;
|
|
353
353
|
if (!depositReserve.state.farmCollateral.equals(PublicKey.default)) {
|
|
354
354
|
farmUserStates.push({
|
|
355
|
-
address:
|
|
355
|
+
address: obligationFarmStatePda(obligation.obligationAddress, depositReserve.state.farmCollateral!)[0],
|
|
356
356
|
log: 'collReserve farmState for vanilla obligation' + obligationString,
|
|
357
357
|
});
|
|
358
358
|
}
|
|
@@ -361,11 +361,6 @@ function getRepayWithCollObligationFarmStateAddresses(
|
|
|
361
361
|
return farmUserStates;
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
const BASE_SEED_USER_STATE = Buffer.from('user');
|
|
365
|
-
|
|
366
|
-
const getPdaFarmsUserState = (farm: PublicKey, obligation: PublicKey) =>
|
|
367
|
-
PublicKey.findProgramAddressSync([BASE_SEED_USER_STATE, farm.toBytes(), obligation.toBytes()], farmsId)[0];
|
|
368
|
-
|
|
369
364
|
export async function getAllUserMetadatasWithFilter(
|
|
370
365
|
connection: Connection,
|
|
371
366
|
filter: GetProgramAccountsFilter[],
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Connection, PublicKey } from '@solana/web3.js/lib';
|
|
2
|
-
import { StakePool as StandardStakePool } from '@solana/spl-stake-pool/dist/layouts';
|
|
3
|
-
export type GenericStakePool = StandardStakePool;
|
|
4
|
-
export declare enum StakePoolType {
|
|
5
|
-
Standard = 0
|
|
6
|
-
}
|
|
7
|
-
export declare function mapStakedSolMintToPool(connection: Connection, mint: PublicKey): Promise<[GenericStakePool, PublicKey, StakePoolType]>;
|
|
8
|
-
//# sourceMappingURL=stakePool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stakePool.d.ts","sourceRoot":"","sources":["../../src/classes/stakePool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAGrF,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AACjD,oBAAY,aAAa;IACvB,QAAQ,IAAA;CACT;AAED,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,CAAC,gBAAgB,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAOvD"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StakePoolType = void 0;
|
|
4
|
-
exports.mapStakedSolMintToPool = mapStakedSolMintToPool;
|
|
5
|
-
const standardStakePool_1 = require("./standardStakePool");
|
|
6
|
-
var StakePoolType;
|
|
7
|
-
(function (StakePoolType) {
|
|
8
|
-
StakePoolType[StakePoolType["Standard"] = 0] = "Standard";
|
|
9
|
-
})(StakePoolType || (exports.StakePoolType = StakePoolType = {}));
|
|
10
|
-
async function mapStakedSolMintToPool(connection, mint) {
|
|
11
|
-
// We cannot know which pool the mint corresponds to, so we fetch them program by program
|
|
12
|
-
const maybeStandardPoolAndKey = await (0, standardStakePool_1.maybeGetStakedPoolByMint)(connection, mint);
|
|
13
|
-
if (maybeStandardPoolAndKey) {
|
|
14
|
-
return [...maybeStandardPoolAndKey, StakePoolType.Standard];
|
|
15
|
-
}
|
|
16
|
-
throw new Error(`Cannot map mint ${mint} to staked sol pool`);
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=stakePool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stakePool.js","sourceRoot":"","sources":["../../src/classes/stakePool.ts"],"names":[],"mappings":";;;AAUA,wDAUC;AAnBD,2DAA+D;AAK/D,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,yDAAQ,CAAA;AACV,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB;AAEM,KAAK,UAAU,sBAAsB,CAC1C,UAAsB,EACtB,IAAe;IAEf,yFAAyF;IACzF,MAAM,uBAAuB,GAAG,MAAM,IAAA,4CAAwB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACjF,IAAI,uBAAuB,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,uBAAuB,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC9D,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,qBAAqB,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { ValidatorList } from '@solana/spl-stake-pool';
|
|
2
|
-
import { StakePool } from '@solana/spl-stake-pool';
|
|
3
|
-
import { AccountMeta, Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
4
|
-
import BN from 'bn.js';
|
|
5
|
-
import { Infer } from 'superstruct';
|
|
6
|
-
export declare const TRANSIENT_STAKE_SEED_PREFIX: Buffer<ArrayBuffer>;
|
|
7
|
-
export declare const STAKE_ACCOUNT_RENT_EXEMPTION = 2282880;
|
|
8
|
-
export declare function getStandardPoolState(address: PublicKey, connection: Connection): Promise<StakePool>;
|
|
9
|
-
export declare function getValidatorList(address: PublicKey, connection: Connection): Promise<ValidatorList>;
|
|
10
|
-
export declare function maybeGetStakedPoolByMint(connection: Connection, mint: PublicKey): Promise<[StakePool, PublicKey] | undefined>;
|
|
11
|
-
export declare function getStandardPoolMintRemainingAccounts(connection: Connection, stakedSolPool: StakePool, stakedSolPoolPk: PublicKey, stakedSolToDeposit: BN): Promise<[Array<AccountMeta>, Array<Keypair>]>;
|
|
12
|
-
export declare function getWithdrawCandidates(connection: Connection, stakedSolPool: StakePool, stakedSolPoolPk: PublicKey, stakedSolToDeposit: BN): Promise<Array<PublicKey>>;
|
|
13
|
-
/**
|
|
14
|
-
* Generates the withdraw authority program address for the stake pool
|
|
15
|
-
*/
|
|
16
|
-
export declare function findWithdrawAuthorityProgramAddress(programId: PublicKey, stakePoolAddress: PublicKey): Promise<PublicKey>;
|
|
17
|
-
export declare function findStakeProgramAddress(programId: PublicKey, voteAccountAddress: PublicKey, stakedSolPoolPk: PublicKey, seed: number): Promise<PublicKey>;
|
|
18
|
-
export declare function findTransientStakeProgramAddress(programId: PublicKey, voteAccountAddress: PublicKey, stakePoolAddress: PublicKey, seed: BN): Promise<PublicKey>;
|
|
19
|
-
export declare function calcLamportsWithdrawAmount(stakePool: StakePool, poolTokens: BN): BN;
|
|
20
|
-
export declare const BigNumFromString: import('superstruct').Struct<BN, null>;
|
|
21
|
-
export declare const PublicKeyFromString: import('superstruct').Struct<PublicKey, null>;
|
|
22
|
-
export declare const StakeAccountType: import("superstruct").Struct<"uninitialized" | "initialized" | "delegated" | "rewardsPool", {
|
|
23
|
-
uninitialized: "uninitialized";
|
|
24
|
-
initialized: "initialized";
|
|
25
|
-
delegated: "delegated";
|
|
26
|
-
rewardsPool: "rewardsPool";
|
|
27
|
-
}>;
|
|
28
|
-
export type StakeMeta = Infer<typeof StakeMeta>;
|
|
29
|
-
export declare const StakeMeta: import("superstruct").Struct<{
|
|
30
|
-
rentExemptReserve: BN;
|
|
31
|
-
authorized: {
|
|
32
|
-
staker: PublicKey;
|
|
33
|
-
withdrawer: PublicKey;
|
|
34
|
-
};
|
|
35
|
-
lockup: {
|
|
36
|
-
unixTimestamp: number;
|
|
37
|
-
epoch: number;
|
|
38
|
-
custodian: PublicKey;
|
|
39
|
-
};
|
|
40
|
-
}, {
|
|
41
|
-
rentExemptReserve: import("superstruct").Struct<BN, null>;
|
|
42
|
-
authorized: import("superstruct").Struct<{
|
|
43
|
-
staker: PublicKey;
|
|
44
|
-
withdrawer: PublicKey;
|
|
45
|
-
}, {
|
|
46
|
-
staker: import("superstruct").Struct<PublicKey, null>;
|
|
47
|
-
withdrawer: import("superstruct").Struct<PublicKey, null>;
|
|
48
|
-
}>;
|
|
49
|
-
lockup: import("superstruct").Struct<{
|
|
50
|
-
unixTimestamp: number;
|
|
51
|
-
epoch: number;
|
|
52
|
-
custodian: PublicKey;
|
|
53
|
-
}, {
|
|
54
|
-
unixTimestamp: import("superstruct").Struct<number, null>;
|
|
55
|
-
epoch: import("superstruct").Struct<number, null>;
|
|
56
|
-
custodian: import("superstruct").Struct<PublicKey, null>;
|
|
57
|
-
}>;
|
|
58
|
-
}>;
|
|
59
|
-
export type StakeAccount = Infer<typeof StakeAccount>;
|
|
60
|
-
export declare const StakeAccount: import("superstruct").Struct<{
|
|
61
|
-
type: "uninitialized" | "initialized" | "delegated" | "rewardsPool";
|
|
62
|
-
info: {
|
|
63
|
-
meta: {
|
|
64
|
-
rentExemptReserve: BN;
|
|
65
|
-
authorized: {
|
|
66
|
-
staker: PublicKey;
|
|
67
|
-
withdrawer: PublicKey;
|
|
68
|
-
};
|
|
69
|
-
lockup: {
|
|
70
|
-
unixTimestamp: number;
|
|
71
|
-
epoch: number;
|
|
72
|
-
custodian: PublicKey;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
stake: {
|
|
76
|
-
delegation: {
|
|
77
|
-
stake: BN;
|
|
78
|
-
voter: PublicKey;
|
|
79
|
-
activationEpoch: BN;
|
|
80
|
-
deactivationEpoch: BN;
|
|
81
|
-
warmupCooldownRate: number;
|
|
82
|
-
};
|
|
83
|
-
creditsObserved: number;
|
|
84
|
-
} | null;
|
|
85
|
-
};
|
|
86
|
-
}, {
|
|
87
|
-
type: import("superstruct").Struct<"uninitialized" | "initialized" | "delegated" | "rewardsPool", {
|
|
88
|
-
uninitialized: "uninitialized";
|
|
89
|
-
initialized: "initialized";
|
|
90
|
-
delegated: "delegated";
|
|
91
|
-
rewardsPool: "rewardsPool";
|
|
92
|
-
}>;
|
|
93
|
-
info: import("superstruct").Struct<{
|
|
94
|
-
meta: {
|
|
95
|
-
rentExemptReserve: BN;
|
|
96
|
-
authorized: {
|
|
97
|
-
staker: PublicKey;
|
|
98
|
-
withdrawer: PublicKey;
|
|
99
|
-
};
|
|
100
|
-
lockup: {
|
|
101
|
-
unixTimestamp: number;
|
|
102
|
-
epoch: number;
|
|
103
|
-
custodian: PublicKey;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
stake: {
|
|
107
|
-
delegation: {
|
|
108
|
-
stake: BN;
|
|
109
|
-
voter: PublicKey;
|
|
110
|
-
activationEpoch: BN;
|
|
111
|
-
deactivationEpoch: BN;
|
|
112
|
-
warmupCooldownRate: number;
|
|
113
|
-
};
|
|
114
|
-
creditsObserved: number;
|
|
115
|
-
} | null;
|
|
116
|
-
}, {
|
|
117
|
-
meta: import("superstruct").Struct<{
|
|
118
|
-
rentExemptReserve: BN;
|
|
119
|
-
authorized: {
|
|
120
|
-
staker: PublicKey;
|
|
121
|
-
withdrawer: PublicKey;
|
|
122
|
-
};
|
|
123
|
-
lockup: {
|
|
124
|
-
unixTimestamp: number;
|
|
125
|
-
epoch: number;
|
|
126
|
-
custodian: PublicKey;
|
|
127
|
-
};
|
|
128
|
-
}, {
|
|
129
|
-
rentExemptReserve: import("superstruct").Struct<BN, null>;
|
|
130
|
-
authorized: import("superstruct").Struct<{
|
|
131
|
-
staker: PublicKey;
|
|
132
|
-
withdrawer: PublicKey;
|
|
133
|
-
}, {
|
|
134
|
-
staker: import("superstruct").Struct<PublicKey, null>;
|
|
135
|
-
withdrawer: import("superstruct").Struct<PublicKey, null>;
|
|
136
|
-
}>;
|
|
137
|
-
lockup: import("superstruct").Struct<{
|
|
138
|
-
unixTimestamp: number;
|
|
139
|
-
epoch: number;
|
|
140
|
-
custodian: PublicKey;
|
|
141
|
-
}, {
|
|
142
|
-
unixTimestamp: import("superstruct").Struct<number, null>;
|
|
143
|
-
epoch: import("superstruct").Struct<number, null>;
|
|
144
|
-
custodian: import("superstruct").Struct<PublicKey, null>;
|
|
145
|
-
}>;
|
|
146
|
-
}>;
|
|
147
|
-
stake: import("superstruct").Struct<{
|
|
148
|
-
delegation: {
|
|
149
|
-
stake: BN;
|
|
150
|
-
voter: PublicKey;
|
|
151
|
-
activationEpoch: BN;
|
|
152
|
-
deactivationEpoch: BN;
|
|
153
|
-
warmupCooldownRate: number;
|
|
154
|
-
};
|
|
155
|
-
creditsObserved: number;
|
|
156
|
-
} | null, {
|
|
157
|
-
delegation: import("superstruct").Struct<{
|
|
158
|
-
stake: BN;
|
|
159
|
-
voter: PublicKey;
|
|
160
|
-
activationEpoch: BN;
|
|
161
|
-
deactivationEpoch: BN;
|
|
162
|
-
warmupCooldownRate: number;
|
|
163
|
-
}, {
|
|
164
|
-
voter: import("superstruct").Struct<PublicKey, null>;
|
|
165
|
-
stake: import("superstruct").Struct<BN, null>;
|
|
166
|
-
activationEpoch: import("superstruct").Struct<BN, null>;
|
|
167
|
-
deactivationEpoch: import("superstruct").Struct<BN, null>;
|
|
168
|
-
warmupCooldownRate: import("superstruct").Struct<number, null>;
|
|
169
|
-
}>;
|
|
170
|
-
creditsObserved: import("superstruct").Struct<number, null>;
|
|
171
|
-
}>;
|
|
172
|
-
}>;
|
|
173
|
-
}>;
|
|
174
|
-
//# sourceMappingURL=standardStakePool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standardStakePool.d.ts","sourceRoot":"","sources":["../../src/classes/standardStakePool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAuB,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAmB,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvB,OAAO,EAAS,KAAK,EAA0B,MAAM,aAAa,CAAC;AAEnE,eAAO,MAAM,2BAA2B,qBAA2B,CAAC;AACpE,eAAO,MAAM,4BAA4B,UAAY,CAAC;AAKtD,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAMzG;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAMzG;AAED,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC,CAY7C;AAED,wBAAsB,oCAAoC,CACxD,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,SAAS,EACxB,eAAe,EAAE,SAAS,EAC1B,kBAAkB,EAAE,EAAE,GACrB,OAAO,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CA0B/C;AAuFD,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,SAAS,EACxB,eAAe,EAAE,SAAS,EAC1B,kBAAkB,EAAE,EAAE,GACrB,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAoD3B;AAiCD;;GAEG;AACH,wBAAsB,mCAAmC,CAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,sBAM1G;AAED,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,SAAS,EAC7B,eAAe,EAAE,SAAS,EAC1B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,SAAS,CAAC,CAUpB;AAED,wBAAsB,gCAAgC,CACpD,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,SAAS,EAC7B,gBAAgB,EAAE,SAAS,EAC3B,IAAI,EAAE,EAAE,sBAYT;AAUD,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,CAOnF;AAED,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAC9E,MAAM,CAAC,OAAO,CAAC,MAAM,mBAAmB,EAAE,OAAO,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACxF,eAAO,MAAM,gBAAgB;;;;;EAAsE,CAAC;AAEpG,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAChD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC;AAmBH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACtD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAC"}
|