@0dotxyz/p0-ts-sdk 1.0.0 → 1.0.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/README.md +7 -4
- package/dist/{dto-farm.types-D9Q3c7Q7.d.cts → dto-farm.types-DvTDZThL.d.cts} +101 -101
- package/dist/{dto-farm.types-D9Q3c7Q7.d.ts → dto-farm.types-DvTDZThL.d.ts} +101 -101
- package/dist/index.cjs +140 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +139 -141
- package/dist/index.js.map +1 -1
- package/dist/vendor.cjs +115 -117
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +2 -2
- package/dist/vendor.d.ts +2 -2
- package/dist/vendor.js +111 -113
- package/dist/vendor.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BorshCoder, Provider, Program } from '@coral-xyz/anchor';
|
|
2
|
+
import BN from 'bn.js';
|
|
2
3
|
import { PublicKey } from '@solana/web3.js';
|
|
3
|
-
import BN$1 from 'bn.js';
|
|
4
4
|
|
|
5
5
|
declare const SWITCHBOARD_ONDEMANDE_PRICE_PRECISION = 18;
|
|
6
6
|
interface CurrentResult {
|
|
@@ -47,7 +47,7 @@ declare function decodeSwitchboardPullFeedData(data: Buffer): PullFeedAccountDat
|
|
|
47
47
|
|
|
48
48
|
interface LastUpdateFields {
|
|
49
49
|
/** Last slot when updated */
|
|
50
|
-
slot: BN
|
|
50
|
+
slot: BN;
|
|
51
51
|
/** True when marked stale, false when slot updated */
|
|
52
52
|
stale: number;
|
|
53
53
|
/** Status of the prices used to calculate the last update */
|
|
@@ -55,8 +55,8 @@ interface LastUpdateFields {
|
|
|
55
55
|
placeholder: Array<number>;
|
|
56
56
|
}
|
|
57
57
|
interface BigFractionBytesFields {
|
|
58
|
-
value: Array<BN
|
|
59
|
-
padding: Array<BN
|
|
58
|
+
value: Array<BN>;
|
|
59
|
+
padding: Array<BN>;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
interface LastUpdateJSON {
|
|
@@ -75,7 +75,7 @@ interface BigFractionBytesJSON {
|
|
|
75
75
|
|
|
76
76
|
interface ReserveRaw {
|
|
77
77
|
/** Version of the reserve */
|
|
78
|
-
version: BN
|
|
78
|
+
version: BN;
|
|
79
79
|
/** Last slot when supply and rates updated */
|
|
80
80
|
lastUpdate: LastUpdateFields;
|
|
81
81
|
/** Lending market address */
|
|
@@ -84,20 +84,20 @@ interface ReserveRaw {
|
|
|
84
84
|
farmDebt: PublicKey;
|
|
85
85
|
/** Reserve liquidity */
|
|
86
86
|
liquidity: ReserveLiquidityFields;
|
|
87
|
-
reserveLiquidityPadding: Array<BN
|
|
87
|
+
reserveLiquidityPadding: Array<BN>;
|
|
88
88
|
/** Reserve collateral */
|
|
89
89
|
collateral: ReserveCollateralFields;
|
|
90
|
-
reserveCollateralPadding: Array<BN
|
|
90
|
+
reserveCollateralPadding: Array<BN>;
|
|
91
91
|
/** Reserve configuration values */
|
|
92
92
|
config: ReserveConfigFields;
|
|
93
|
-
configPadding: Array<BN
|
|
94
|
-
borrowedAmountOutsideElevationGroup: BN
|
|
93
|
+
configPadding: Array<BN>;
|
|
94
|
+
borrowedAmountOutsideElevationGroup: BN;
|
|
95
95
|
/**
|
|
96
96
|
* Amount of token borrowed in lamport of debt asset in the given
|
|
97
97
|
* elevation group when this reserve is part of the collaterals.
|
|
98
98
|
*/
|
|
99
|
-
borrowedAmountsAgainstThisReserveInElevationGroups: Array<BN
|
|
100
|
-
padding: Array<BN
|
|
99
|
+
borrowedAmountsAgainstThisReserveInElevationGroups: Array<BN>;
|
|
100
|
+
padding: Array<BN>;
|
|
101
101
|
}
|
|
102
102
|
interface ReserveLiquidityFields {
|
|
103
103
|
/** Reserve liquidity mint address */
|
|
@@ -107,49 +107,49 @@ interface ReserveLiquidityFields {
|
|
|
107
107
|
/** Reserve liquidity fee collection address */
|
|
108
108
|
feeVault: PublicKey;
|
|
109
109
|
/** Reserve liquidity available */
|
|
110
|
-
availableAmount: BN
|
|
110
|
+
availableAmount: BN;
|
|
111
111
|
/** Reserve liquidity borrowed (scaled fraction) */
|
|
112
|
-
borrowedAmountSf: BN
|
|
112
|
+
borrowedAmountSf: BN;
|
|
113
113
|
/** Reserve liquidity market price in quote currency (scaled fraction) */
|
|
114
|
-
marketPriceSf: BN
|
|
114
|
+
marketPriceSf: BN;
|
|
115
115
|
/** Unix timestamp of the market price (from the oracle) */
|
|
116
|
-
marketPriceLastUpdatedTs: BN
|
|
116
|
+
marketPriceLastUpdatedTs: BN;
|
|
117
117
|
/** Reserve liquidity mint decimals */
|
|
118
|
-
mintDecimals: BN
|
|
118
|
+
mintDecimals: BN;
|
|
119
119
|
/**
|
|
120
120
|
* Timestamp when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
|
|
121
121
|
* If the threshold is not crossed, then the timestamp is set to 0
|
|
122
122
|
*/
|
|
123
|
-
depositLimitCrossedTimestamp: BN
|
|
123
|
+
depositLimitCrossedTimestamp: BN;
|
|
124
124
|
/**
|
|
125
125
|
* Timestamp when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
|
|
126
126
|
* If the threshold is not crossed, then the timestamp is set to 0
|
|
127
127
|
*/
|
|
128
|
-
borrowLimitCrossedTimestamp: BN
|
|
128
|
+
borrowLimitCrossedTimestamp: BN;
|
|
129
129
|
/** Reserve liquidity cumulative borrow rate (scaled fraction) */
|
|
130
130
|
cumulativeBorrowRateBsf: BigFractionBytesFields;
|
|
131
131
|
/** Reserve cumulative protocol fees (scaled fraction) */
|
|
132
|
-
accumulatedProtocolFeesSf: BN
|
|
132
|
+
accumulatedProtocolFeesSf: BN;
|
|
133
133
|
/** Reserve cumulative referrer fees (scaled fraction) */
|
|
134
|
-
accumulatedReferrerFeesSf: BN
|
|
134
|
+
accumulatedReferrerFeesSf: BN;
|
|
135
135
|
/** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
|
|
136
|
-
pendingReferrerFeesSf: BN
|
|
136
|
+
pendingReferrerFeesSf: BN;
|
|
137
137
|
/** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
|
|
138
|
-
absoluteReferralRateSf: BN
|
|
138
|
+
absoluteReferralRateSf: BN;
|
|
139
139
|
/** Token program of the liquidity mint */
|
|
140
140
|
tokenProgram: PublicKey;
|
|
141
|
-
padding2: Array<BN
|
|
142
|
-
padding3: Array<BN
|
|
141
|
+
padding2: Array<BN>;
|
|
142
|
+
padding3: Array<BN>;
|
|
143
143
|
}
|
|
144
144
|
interface ReserveCollateralFields {
|
|
145
145
|
/** Reserve collateral mint address */
|
|
146
146
|
mintPubkey: PublicKey;
|
|
147
147
|
/** Reserve collateral mint supply, used for exchange rate */
|
|
148
|
-
mintTotalSupply: BN
|
|
148
|
+
mintTotalSupply: BN;
|
|
149
149
|
/** Reserve collateral supply address */
|
|
150
150
|
supplyVault: PublicKey;
|
|
151
|
-
padding1: Array<BN
|
|
152
|
-
padding2: Array<BN
|
|
151
|
+
padding1: Array<BN>;
|
|
152
|
+
padding2: Array<BN>;
|
|
153
153
|
}
|
|
154
154
|
interface ReserveConfigFields {
|
|
155
155
|
/** Status of the reserve Active/Obsolete/Hidden */
|
|
@@ -189,22 +189,22 @@ interface ReserveConfigFields {
|
|
|
189
189
|
* crossed.
|
|
190
190
|
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
191
191
|
*/
|
|
192
|
-
deleveragingMarginCallPeriodSecs: BN
|
|
192
|
+
deleveragingMarginCallPeriodSecs: BN;
|
|
193
193
|
/**
|
|
194
194
|
* The rate at which the deleveraging threshold decreases, in bps per day.
|
|
195
195
|
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
196
196
|
*/
|
|
197
|
-
deleveragingThresholdDecreaseBpsPerDay: BN
|
|
197
|
+
deleveragingThresholdDecreaseBpsPerDay: BN;
|
|
198
198
|
/** Program owner fees assessed, separate from gains due to interest accrual */
|
|
199
199
|
fees: ReserveFeesFields;
|
|
200
200
|
/** Borrow rate curve based on utilization */
|
|
201
201
|
borrowRateCurve: BorrowRateCurveFields;
|
|
202
202
|
/** Borrow factor in percentage - used for risk adjustment */
|
|
203
|
-
borrowFactorPct: BN
|
|
203
|
+
borrowFactorPct: BN;
|
|
204
204
|
/** Maximum deposit limit of liquidity in native units, u64::MAX for inf */
|
|
205
|
-
depositLimit: BN
|
|
205
|
+
depositLimit: BN;
|
|
206
206
|
/** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */
|
|
207
|
-
borrowLimit: BN
|
|
207
|
+
borrowLimit: BN;
|
|
208
208
|
/** Token id from TokenInfos struct */
|
|
209
209
|
tokenInfo: TokenInfoFields$1;
|
|
210
210
|
/** Deposit withdrawal caps - deposit & redeem */
|
|
@@ -229,19 +229,19 @@ interface ReserveConfigFields {
|
|
|
229
229
|
* - u64::MAX for inf
|
|
230
230
|
* - 0 to disable borrows outside elevation groups
|
|
231
231
|
*/
|
|
232
|
-
borrowLimitOutsideElevationGroup: BN
|
|
232
|
+
borrowLimitOutsideElevationGroup: BN;
|
|
233
233
|
/**
|
|
234
234
|
* Defines the maximum amount (in lamports of elevation group debt asset)
|
|
235
235
|
* that can be borrowed when this reserve is used as collateral.
|
|
236
236
|
* - u64::MAX for inf
|
|
237
237
|
* - 0 to disable borrows in this elevation group (expected value for the debt asset)
|
|
238
238
|
*/
|
|
239
|
-
borrowLimitAgainstThisCollateralInElevationGroup: Array<BN
|
|
239
|
+
borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>;
|
|
240
240
|
/**
|
|
241
241
|
* The rate at which the deleveraging-related liquidation bonus increases, in bps per day.
|
|
242
242
|
* Only relevant when `autodeleverage_enabled == 1`, and must not be 0 in such case.
|
|
243
243
|
*/
|
|
244
|
-
deleveragingBonusIncreaseBpsPerDay: BN
|
|
244
|
+
deleveragingBonusIncreaseBpsPerDay: BN;
|
|
245
245
|
}
|
|
246
246
|
interface ReserveFeesFields {
|
|
247
247
|
/**
|
|
@@ -252,12 +252,12 @@ interface ReserveFeesFields {
|
|
|
252
252
|
* 0.01% (1 basis point) = 115292150460685
|
|
253
253
|
* 0.00001% (Aave borrow fee) = 115292150461
|
|
254
254
|
*/
|
|
255
|
-
borrowFeeSf: BN
|
|
255
|
+
borrowFeeSf: BN;
|
|
256
256
|
/**
|
|
257
257
|
* Fee for flash loan, expressed as scaled fraction.
|
|
258
258
|
* 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
|
|
259
259
|
*/
|
|
260
|
-
flashLoanFeeSf: BN
|
|
260
|
+
flashLoanFeeSf: BN;
|
|
261
261
|
/** Used for allignment */
|
|
262
262
|
padding: Array<number>;
|
|
263
263
|
}
|
|
@@ -274,9 +274,9 @@ interface TokenInfoFields$1 {
|
|
|
274
274
|
/** Heuristics limits of acceptable price */
|
|
275
275
|
heuristic: PriceHeuristicFields;
|
|
276
276
|
/** Max divergence between twap and price in bps */
|
|
277
|
-
maxTwapDivergenceBps: BN
|
|
278
|
-
maxAgePriceSeconds: BN
|
|
279
|
-
maxAgeTwapSeconds: BN
|
|
277
|
+
maxTwapDivergenceBps: BN;
|
|
278
|
+
maxAgePriceSeconds: BN;
|
|
279
|
+
maxAgeTwapSeconds: BN;
|
|
280
280
|
/** Scope price configuration */
|
|
281
281
|
scopeConfiguration: ScopeConfigurationFields;
|
|
282
282
|
/** Switchboard configuration */
|
|
@@ -285,15 +285,15 @@ interface TokenInfoFields$1 {
|
|
|
285
285
|
pythConfiguration: PythConfigurationFields;
|
|
286
286
|
blockPriceUsage: number;
|
|
287
287
|
reserved: Array<number>;
|
|
288
|
-
padding: Array<BN
|
|
288
|
+
padding: Array<BN>;
|
|
289
289
|
}
|
|
290
290
|
interface PriceHeuristicFields {
|
|
291
291
|
/** Lower value of acceptable price */
|
|
292
|
-
lower: BN
|
|
292
|
+
lower: BN;
|
|
293
293
|
/** Upper value of acceptable price */
|
|
294
|
-
upper: BN
|
|
294
|
+
upper: BN;
|
|
295
295
|
/** Number of decimals of the previously defined values */
|
|
296
|
-
exp: BN
|
|
296
|
+
exp: BN;
|
|
297
297
|
}
|
|
298
298
|
interface ScopeConfigurationFields {
|
|
299
299
|
/** Pubkey of the scope price feed (disabled if `null` or `default`) */
|
|
@@ -313,10 +313,10 @@ interface PythConfigurationFields {
|
|
|
313
313
|
price: PublicKey;
|
|
314
314
|
}
|
|
315
315
|
interface WithdrawalCapsFields {
|
|
316
|
-
configCapacity: BN
|
|
317
|
-
currentTotal: BN
|
|
318
|
-
lastIntervalStartTimestamp: BN
|
|
319
|
-
configIntervalLengthSeconds: BN
|
|
316
|
+
configCapacity: BN;
|
|
317
|
+
currentTotal: BN;
|
|
318
|
+
lastIntervalStartTimestamp: BN;
|
|
319
|
+
configIntervalLengthSeconds: BN;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
interface ReserveJSON {
|
|
@@ -746,7 +746,7 @@ interface ObligationOrderJSON {
|
|
|
746
746
|
|
|
747
747
|
interface ObligationRaw {
|
|
748
748
|
/** Version of the struct */
|
|
749
|
-
tag: BN
|
|
749
|
+
tag: BN;
|
|
750
750
|
/** Last update to collateral, liquidity, or their market values */
|
|
751
751
|
lastUpdate: LastUpdateFields;
|
|
752
752
|
/** Lending market address */
|
|
@@ -756,19 +756,19 @@ interface ObligationRaw {
|
|
|
756
756
|
/** Deposited collateral for the obligation, unique by deposit reserve address */
|
|
757
757
|
deposits: Array<ObligationCollateralFields>;
|
|
758
758
|
/** Worst LTV for the collaterals backing the loan, represented as a percentage */
|
|
759
|
-
lowestReserveDepositLiquidationLtv: BN
|
|
759
|
+
lowestReserveDepositLiquidationLtv: BN;
|
|
760
760
|
/** Market value of deposits (scaled fraction) */
|
|
761
|
-
depositedValueSf: BN
|
|
761
|
+
depositedValueSf: BN;
|
|
762
762
|
/** Borrowed liquidity for the obligation, unique by borrow reserve address */
|
|
763
763
|
borrows: Array<ObligationLiquidityFields>;
|
|
764
764
|
/** Risk adjusted market value of borrows/debt (sum of price * borrowed_amount * borrow_factor) (scaled fraction) */
|
|
765
|
-
borrowFactorAdjustedDebtValueSf: BN
|
|
765
|
+
borrowFactorAdjustedDebtValueSf: BN;
|
|
766
766
|
/** Market value of borrows - used for max_liquidatable_borrowed_amount (scaled fraction) */
|
|
767
|
-
borrowedAssetsMarketValueSf: BN
|
|
767
|
+
borrowedAssetsMarketValueSf: BN;
|
|
768
768
|
/** The maximum borrow value at the weighted average loan to value ratio (scaled fraction) */
|
|
769
|
-
allowedBorrowValueSf: BN
|
|
769
|
+
allowedBorrowValueSf: BN;
|
|
770
770
|
/** The dangerous borrow value at the weighted average liquidation threshold (scaled fraction) */
|
|
771
|
-
unhealthyBorrowValueSf: BN
|
|
771
|
+
unhealthyBorrowValueSf: BN;
|
|
772
772
|
/** The asset tier of the deposits */
|
|
773
773
|
depositsAssetTiers: Array<number>;
|
|
774
774
|
/** The asset tier of the borrows */
|
|
@@ -793,50 +793,50 @@ interface ObligationRaw {
|
|
|
793
793
|
/** The number of obsolete reserves the obligation has a borrow in */
|
|
794
794
|
numOfObsoleteBorrowReserves: number;
|
|
795
795
|
reserved: Array<number>;
|
|
796
|
-
highestBorrowFactorPct: BN
|
|
796
|
+
highestBorrowFactorPct: BN;
|
|
797
797
|
/**
|
|
798
798
|
* A timestamp at which the risk council most-recently marked this obligation for deleveraging.
|
|
799
799
|
* Zero if not currently subject to deleveraging.
|
|
800
800
|
*/
|
|
801
|
-
autodeleverageMarginCallStartedTimestamp: BN
|
|
801
|
+
autodeleverageMarginCallStartedTimestamp: BN;
|
|
802
802
|
/**
|
|
803
803
|
* Owner-defined, liquidator-executed orders applicable to this obligation.
|
|
804
804
|
* Typical use-cases would be a stop-loss and a take-profit (possibly co-existing).
|
|
805
805
|
*/
|
|
806
806
|
orders: Array<ObligationOrderFields>;
|
|
807
|
-
padding3: Array<BN
|
|
807
|
+
padding3: Array<BN>;
|
|
808
808
|
}
|
|
809
809
|
interface ObligationCollateralFields {
|
|
810
810
|
/** Reserve collateral is deposited to */
|
|
811
811
|
depositReserve: PublicKey;
|
|
812
812
|
/** Amount of collateral deposited */
|
|
813
|
-
depositedAmount: BN
|
|
813
|
+
depositedAmount: BN;
|
|
814
814
|
/** Collateral market value in quote currency (scaled fraction) */
|
|
815
|
-
marketValueSf: BN
|
|
815
|
+
marketValueSf: BN;
|
|
816
816
|
/**
|
|
817
817
|
* Debt amount (lamport) taken against this collateral.
|
|
818
818
|
* (only meaningful if this obligation is part of an elevation group, otherwise 0)
|
|
819
819
|
* This is only indicative of the debt computed on the last refresh obligation.
|
|
820
820
|
* If the obligation have multiple collateral this value is the same for all of them.
|
|
821
821
|
*/
|
|
822
|
-
borrowedAmountAgainstThisCollateralInElevationGroup: BN
|
|
823
|
-
padding: Array<BN
|
|
822
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: BN;
|
|
823
|
+
padding: Array<BN>;
|
|
824
824
|
}
|
|
825
825
|
interface ObligationLiquidityFields {
|
|
826
826
|
/** Reserve liquidity is borrowed from */
|
|
827
827
|
borrowReserve: PublicKey;
|
|
828
828
|
/** Borrow rate used for calculating interest (big scaled fraction) */
|
|
829
829
|
cumulativeBorrowRateBsf: BigFractionBytesFields;
|
|
830
|
-
padding: BN
|
|
830
|
+
padding: BN;
|
|
831
831
|
/** Amount of liquidity borrowed plus interest (scaled fraction) */
|
|
832
|
-
borrowedAmountSf: BN
|
|
832
|
+
borrowedAmountSf: BN;
|
|
833
833
|
/** Liquidity market value in quote currency (scaled fraction) */
|
|
834
|
-
marketValueSf: BN
|
|
834
|
+
marketValueSf: BN;
|
|
835
835
|
/** Risk adjusted liquidity market value in quote currency - DEBUG ONLY - use market_value instead */
|
|
836
|
-
borrowFactorAdjustedMarketValueSf: BN
|
|
836
|
+
borrowFactorAdjustedMarketValueSf: BN;
|
|
837
837
|
/** Amount of liquidity borrowed outside of an elevation group */
|
|
838
|
-
borrowedAmountOutsideElevationGroups: BN
|
|
839
|
-
padding2: Array<BN
|
|
838
|
+
borrowedAmountOutsideElevationGroups: BN;
|
|
839
|
+
padding2: Array<BN>;
|
|
840
840
|
}
|
|
841
841
|
interface ObligationOrderFields {
|
|
842
842
|
/**
|
|
@@ -852,7 +852,7 @@ interface ObligationOrderFields {
|
|
|
852
852
|
* means that the order is active only when the BTC-SOL price is greater than `491.3` (i.e.
|
|
853
853
|
* > 491.3 SOL per BTC).
|
|
854
854
|
*/
|
|
855
|
-
conditionThresholdSf: BN
|
|
855
|
+
conditionThresholdSf: BN;
|
|
856
856
|
/**
|
|
857
857
|
* A configuration parameter used by the opportunity (scaled [Fraction]).
|
|
858
858
|
* The exact meaning depends on the specific [Self::opportunity_type].
|
|
@@ -867,7 +867,7 @@ interface ObligationOrderFields {
|
|
|
867
867
|
* The only allowed value in this case is [Fraction::MAX] (to emphasize that *all* debt
|
|
868
868
|
* should be repaid).
|
|
869
869
|
*/
|
|
870
|
-
opportunityParameterSf: BN
|
|
870
|
+
opportunityParameterSf: BN;
|
|
871
871
|
/**
|
|
872
872
|
* A *minimum* additional fraction of collateral transferred to the liquidator, in bps.
|
|
873
873
|
*
|
|
@@ -920,7 +920,7 @@ interface ObligationOrderFields {
|
|
|
920
920
|
* End padding.
|
|
921
921
|
* The total size of a single instance is 8*u128 = 128 bytes.
|
|
922
922
|
*/
|
|
923
|
-
padding2: Array<BN
|
|
923
|
+
padding2: Array<BN>;
|
|
924
924
|
}
|
|
925
925
|
|
|
926
926
|
interface FarmStateRaw {
|
|
@@ -928,17 +928,17 @@ interface FarmStateRaw {
|
|
|
928
928
|
globalConfig: PublicKey;
|
|
929
929
|
token: TokenInfoFields;
|
|
930
930
|
rewardInfos: Array<RewardInfoFields>;
|
|
931
|
-
numRewardTokens: BN
|
|
931
|
+
numRewardTokens: BN;
|
|
932
932
|
/** Data used to calculate the rewards of the user */
|
|
933
|
-
numUsers: BN
|
|
933
|
+
numUsers: BN;
|
|
934
934
|
/**
|
|
935
935
|
* The number of token in the `farm_vault` staked (getting rewards and fees)
|
|
936
936
|
* Set such as `farm_vault.amount = total_staked_amount + total_pending_amount`
|
|
937
937
|
*/
|
|
938
|
-
totalStakedAmount: BN
|
|
938
|
+
totalStakedAmount: BN;
|
|
939
939
|
farmVault: PublicKey;
|
|
940
940
|
farmVaultsAuthority: PublicKey;
|
|
941
|
-
farmVaultsAuthorityBump: BN
|
|
941
|
+
farmVaultsAuthorityBump: BN;
|
|
942
942
|
/**
|
|
943
943
|
* Only used for delegate farms
|
|
944
944
|
* Set to `default()` otherwise
|
|
@@ -973,59 +973,59 @@ interface FarmStateRaw {
|
|
|
973
973
|
/** Delay between a user unstake and the ability to withdraw his deposit. */
|
|
974
974
|
withdrawalCooldownPeriod: number;
|
|
975
975
|
/** Total active stake of tokens in the farm (scaled from `Decimal` representation). */
|
|
976
|
-
totalActiveStakeScaled: BN
|
|
976
|
+
totalActiveStakeScaled: BN;
|
|
977
977
|
/**
|
|
978
978
|
* Total pending stake of tokens in the farm (scaled from `Decimal` representation).
|
|
979
979
|
* (can be used by `withdraw_authority` but don't get rewards or fees)
|
|
980
980
|
*/
|
|
981
|
-
totalPendingStakeScaled: BN
|
|
981
|
+
totalPendingStakeScaled: BN;
|
|
982
982
|
/** Total pending amount of tokens in the farm */
|
|
983
|
-
totalPendingAmount: BN
|
|
983
|
+
totalPendingAmount: BN;
|
|
984
984
|
/** Slashed amounts from early withdrawal */
|
|
985
|
-
slashedAmountCurrent: BN
|
|
986
|
-
slashedAmountCumulative: BN
|
|
985
|
+
slashedAmountCurrent: BN;
|
|
986
|
+
slashedAmountCumulative: BN;
|
|
987
987
|
slashedAmountSpillAddress: PublicKey;
|
|
988
988
|
/** Locking stake */
|
|
989
|
-
lockingMode: BN
|
|
990
|
-
lockingStartTimestamp: BN
|
|
991
|
-
lockingDuration: BN
|
|
992
|
-
lockingEarlyWithdrawalPenaltyBps: BN
|
|
993
|
-
depositCapAmount: BN
|
|
989
|
+
lockingMode: BN;
|
|
990
|
+
lockingStartTimestamp: BN;
|
|
991
|
+
lockingDuration: BN;
|
|
992
|
+
lockingEarlyWithdrawalPenaltyBps: BN;
|
|
993
|
+
depositCapAmount: BN;
|
|
994
994
|
scopePrices: PublicKey;
|
|
995
|
-
scopeOraclePriceId: BN
|
|
996
|
-
scopeOracleMaxAge: BN
|
|
995
|
+
scopeOraclePriceId: BN;
|
|
996
|
+
scopeOracleMaxAge: BN;
|
|
997
997
|
pendingFarmAdmin: PublicKey;
|
|
998
998
|
strategyId: PublicKey;
|
|
999
999
|
delegatedRpsAdmin: PublicKey;
|
|
1000
1000
|
vaultId: PublicKey;
|
|
1001
1001
|
secondDelegatedAuthority: PublicKey;
|
|
1002
|
-
padding: Array<BN
|
|
1002
|
+
padding: Array<BN>;
|
|
1003
1003
|
}
|
|
1004
1004
|
interface TokenInfoFields {
|
|
1005
1005
|
mint: PublicKey;
|
|
1006
|
-
decimals: BN
|
|
1006
|
+
decimals: BN;
|
|
1007
1007
|
tokenProgram: PublicKey;
|
|
1008
|
-
padding: Array<BN
|
|
1008
|
+
padding: Array<BN>;
|
|
1009
1009
|
}
|
|
1010
1010
|
interface RewardInfoFields {
|
|
1011
1011
|
token: TokenInfoFields;
|
|
1012
1012
|
rewardsVault: PublicKey;
|
|
1013
|
-
rewardsAvailable: BN
|
|
1013
|
+
rewardsAvailable: BN;
|
|
1014
1014
|
rewardScheduleCurve: RewardScheduleCurveFields;
|
|
1015
|
-
minClaimDurationSeconds: BN
|
|
1016
|
-
lastIssuanceTs: BN
|
|
1017
|
-
rewardsIssuedUnclaimed: BN
|
|
1018
|
-
rewardsIssuedCumulative: BN
|
|
1019
|
-
rewardPerShareScaled: BN
|
|
1020
|
-
placeholder0: BN
|
|
1015
|
+
minClaimDurationSeconds: BN;
|
|
1016
|
+
lastIssuanceTs: BN;
|
|
1017
|
+
rewardsIssuedUnclaimed: BN;
|
|
1018
|
+
rewardsIssuedCumulative: BN;
|
|
1019
|
+
rewardPerShareScaled: BN;
|
|
1020
|
+
placeholder0: BN;
|
|
1021
1021
|
rewardType: number;
|
|
1022
1022
|
rewardsPerSecondDecimals: number;
|
|
1023
1023
|
padding0: Array<number>;
|
|
1024
|
-
padding1: Array<BN
|
|
1024
|
+
padding1: Array<BN>;
|
|
1025
1025
|
}
|
|
1026
1026
|
interface RewardPerTimeUnitPointFields {
|
|
1027
|
-
tsStart: BN
|
|
1028
|
-
rewardPerTimeUnit: BN
|
|
1027
|
+
tsStart: BN;
|
|
1028
|
+
rewardPerTimeUnit: BN;
|
|
1029
1029
|
}
|
|
1030
1030
|
interface RewardScheduleCurveFields {
|
|
1031
1031
|
/**
|