@0dotxyz/p0-ts-sdk 2.2.1 → 2.2.2
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/{dto-rate-model.types-gN82ZYyC.d.cts → dto-rate-model.types-AQ40wS-P.d.cts} +2 -46
- package/dist/{dto-rate-model.types-gN82ZYyC.d.ts → dto-rate-model.types-AQ40wS-P.d.ts} +2 -46
- package/dist/index-BDDVBMdM.d.cts +48 -0
- package/dist/index-BDDVBMdM.d.ts +48 -0
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -15390
- package/dist/index.d.ts +8 -15390
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/instructions.cjs +344 -0
- package/dist/instructions.cjs.map +1 -0
- package/dist/instructions.d.cts +371 -0
- package/dist/instructions.d.ts +371 -0
- package/dist/instructions.js +338 -0
- package/dist/instructions.js.map +1 -0
- package/dist/types-DGWxbPM1.d.ts +15392 -0
- package/dist/types-ZvnTjjh4.d.cts +15392 -0
- package/dist/vendor.d.cts +3 -2
- package/dist/vendor.d.ts +3 -2
- package/package.json +6 -1
|
@@ -1,49 +1,5 @@
|
|
|
1
|
-
import { BorshCoder, Provider, Program } from '@coral-xyz/anchor';
|
|
2
|
-
import BN from 'bn.js';
|
|
3
1
|
import { PublicKey } from '@solana/web3.js';
|
|
4
|
-
|
|
5
|
-
declare const SWITCHBOARD_ONDEMANDE_PRICE_PRECISION = 18;
|
|
6
|
-
interface CurrentResult {
|
|
7
|
-
value: BN;
|
|
8
|
-
std_dev: BN;
|
|
9
|
-
mean: BN;
|
|
10
|
-
range: BN;
|
|
11
|
-
min_value: BN;
|
|
12
|
-
max_vaalue: BN;
|
|
13
|
-
slot: BN;
|
|
14
|
-
min_slot: BN;
|
|
15
|
-
max_slot: BN;
|
|
16
|
-
}
|
|
17
|
-
interface OracleSubmission {
|
|
18
|
-
oracle: PublicKey;
|
|
19
|
-
slot: BN;
|
|
20
|
-
value: BN;
|
|
21
|
-
}
|
|
22
|
-
interface PullFeedAccountData {
|
|
23
|
-
submissions: OracleSubmission[];
|
|
24
|
-
authority: PublicKey;
|
|
25
|
-
queue: PublicKey;
|
|
26
|
-
feed_hash: Buffer;
|
|
27
|
-
initialized_at: BN;
|
|
28
|
-
permissions: BN;
|
|
29
|
-
max_variance: BN;
|
|
30
|
-
min_responses: number;
|
|
31
|
-
name: Buffer;
|
|
32
|
-
sample_size: number;
|
|
33
|
-
last_update_timestamp: BN;
|
|
34
|
-
lut_slot: BN;
|
|
35
|
-
result: CurrentResult;
|
|
36
|
-
max_staleness: number;
|
|
37
|
-
min_sample_size: number;
|
|
38
|
-
}
|
|
39
|
-
type CrossbarSimulatePayload = FeedResponse[];
|
|
40
|
-
interface FeedResponse {
|
|
41
|
-
feedHash: string;
|
|
42
|
-
results: number[];
|
|
43
|
-
}
|
|
44
|
-
declare const switchboardAccountCoder: BorshCoder<string, string>;
|
|
45
|
-
declare function getSwitchboardProgram(provider: Provider): Program;
|
|
46
|
-
declare function decodeSwitchboardPullFeedData(data: Buffer): PullFeedAccountData;
|
|
2
|
+
import BN from 'bn.js';
|
|
47
3
|
|
|
48
4
|
interface LastUpdateFields {
|
|
49
5
|
/** Last slot when updated */
|
|
@@ -1767,4 +1723,4 @@ interface JupRateModelJSON {
|
|
|
1767
1723
|
rateAtKink2: number;
|
|
1768
1724
|
}
|
|
1769
1725
|
|
|
1770
|
-
export { type
|
|
1726
|
+
export { type ScopeConfigurationJSON as $, type ReserveConfigFields as A, type ReserveFeesFields as B, type CurvePointFields as C, type DriftSpotMarket as D, type BorrowRateCurveFields as E, type FarmStateJSON as F, type PriceHeuristicFields as G, type HistoricalOracleData as H, type InsuranceFund as I, type JupLendingState as J, type ScopeConfigurationFields as K, type SwitchboardConfigurationFields as L, type PythConfigurationFields as M, type ReserveLiquidityJSON as N, type ObligationJSON as O, type PoolBalance as P, type ReserveCollateralJSON as Q, type ReserveRaw as R, type SpotPosition as S, type TokenInfoFields$1 as T, type ReserveConfigJSON as U, type ReserveFeesJSON as V, type WithdrawalCapsFields as W, type BorrowRateCurveJSON as X, type CurvePointJSON as Y, type TokenInfoJSON$1 as Z, type PriceHeuristicJSON as _, type DriftRewards as a, type SwitchboardConfigurationJSON as a0, type PythConfigurationJSON as a1, type WithdrawalCapsJSON as a2, type ObligationLiquidityJSON as a3, type ObligationCollateralJSON as a4, type ObligationOrderJSON as a5, type ObligationCollateralFields as a6, type ObligationLiquidityFields as a7, type ObligationOrderFields as a8, type LastUpdateFields as a9, type BigFractionBytesFields as aa, type LastUpdateJSON as ab, type BigFractionBytesJSON as ac, type RewardPerTimeUnitPointFields as ad, type RewardScheduleCurveFields as ae, type RewardScheduleCurveJSON as af, type RewardPerTimeUnitPointJSON as ag, type UserFeesJSON as ah, type UserFeesFields as ai, isSpotBalanceTypeVariant as aj, type FeeTier as ak, type FeeTierJSON as al, type OrderFillerRewardStructure as am, type OrderFillerRewardStructureJSON as an, type PriceDivergenceGuardRails as ao, type PriceDivergenceGuardRailsJSON as ap, type ValidityGuardRails as aq, type ValidityGuardRailsJSON as ar, type HistoricalOracleDataJSON as as, type HistoricalIndexDataJSON as at, type PoolBalanceJSON as au, type InsuranceFundJSON as av, SpotBalanceType as aw, type SpotPositionJSON as ax, type ReserveJSON as b, type ObligationRaw as c, type FarmStateRaw as d, type DriftSpotMarketJSON as e, type DriftUserJSON as f, type DriftRewardsJSON as g, type DriftUserStatsJSON as h, type DriftUser as i, type DriftUserStats as j, type JupLendingStateJSON as k, type JupTokenReserveJSON as l, type JupLendingRewardsRateModelJSON as m, type JupRateModelJSON as n, type JupTokenReserve as o, type JupLendingRewardsRateModel as p, type JupRateModel as q, type RewardInfoFields as r, type HistoricalIndexData as s, type FeeStructureJSON as t, type OracleGuardRailsJSON as u, type FeeStructure as v, type OracleGuardRails as w, DriftSpotBalanceType as x, type ReserveLiquidityFields as y, type ReserveCollateralFields as z };
|
|
@@ -1,49 +1,5 @@
|
|
|
1
|
-
import { BorshCoder, Provider, Program } from '@coral-xyz/anchor';
|
|
2
|
-
import BN from 'bn.js';
|
|
3
1
|
import { PublicKey } from '@solana/web3.js';
|
|
4
|
-
|
|
5
|
-
declare const SWITCHBOARD_ONDEMANDE_PRICE_PRECISION = 18;
|
|
6
|
-
interface CurrentResult {
|
|
7
|
-
value: BN;
|
|
8
|
-
std_dev: BN;
|
|
9
|
-
mean: BN;
|
|
10
|
-
range: BN;
|
|
11
|
-
min_value: BN;
|
|
12
|
-
max_vaalue: BN;
|
|
13
|
-
slot: BN;
|
|
14
|
-
min_slot: BN;
|
|
15
|
-
max_slot: BN;
|
|
16
|
-
}
|
|
17
|
-
interface OracleSubmission {
|
|
18
|
-
oracle: PublicKey;
|
|
19
|
-
slot: BN;
|
|
20
|
-
value: BN;
|
|
21
|
-
}
|
|
22
|
-
interface PullFeedAccountData {
|
|
23
|
-
submissions: OracleSubmission[];
|
|
24
|
-
authority: PublicKey;
|
|
25
|
-
queue: PublicKey;
|
|
26
|
-
feed_hash: Buffer;
|
|
27
|
-
initialized_at: BN;
|
|
28
|
-
permissions: BN;
|
|
29
|
-
max_variance: BN;
|
|
30
|
-
min_responses: number;
|
|
31
|
-
name: Buffer;
|
|
32
|
-
sample_size: number;
|
|
33
|
-
last_update_timestamp: BN;
|
|
34
|
-
lut_slot: BN;
|
|
35
|
-
result: CurrentResult;
|
|
36
|
-
max_staleness: number;
|
|
37
|
-
min_sample_size: number;
|
|
38
|
-
}
|
|
39
|
-
type CrossbarSimulatePayload = FeedResponse[];
|
|
40
|
-
interface FeedResponse {
|
|
41
|
-
feedHash: string;
|
|
42
|
-
results: number[];
|
|
43
|
-
}
|
|
44
|
-
declare const switchboardAccountCoder: BorshCoder<string, string>;
|
|
45
|
-
declare function getSwitchboardProgram(provider: Provider): Program;
|
|
46
|
-
declare function decodeSwitchboardPullFeedData(data: Buffer): PullFeedAccountData;
|
|
2
|
+
import BN from 'bn.js';
|
|
47
3
|
|
|
48
4
|
interface LastUpdateFields {
|
|
49
5
|
/** Last slot when updated */
|
|
@@ -1767,4 +1723,4 @@ interface JupRateModelJSON {
|
|
|
1767
1723
|
rateAtKink2: number;
|
|
1768
1724
|
}
|
|
1769
1725
|
|
|
1770
|
-
export { type
|
|
1726
|
+
export { type ScopeConfigurationJSON as $, type ReserveConfigFields as A, type ReserveFeesFields as B, type CurvePointFields as C, type DriftSpotMarket as D, type BorrowRateCurveFields as E, type FarmStateJSON as F, type PriceHeuristicFields as G, type HistoricalOracleData as H, type InsuranceFund as I, type JupLendingState as J, type ScopeConfigurationFields as K, type SwitchboardConfigurationFields as L, type PythConfigurationFields as M, type ReserveLiquidityJSON as N, type ObligationJSON as O, type PoolBalance as P, type ReserveCollateralJSON as Q, type ReserveRaw as R, type SpotPosition as S, type TokenInfoFields$1 as T, type ReserveConfigJSON as U, type ReserveFeesJSON as V, type WithdrawalCapsFields as W, type BorrowRateCurveJSON as X, type CurvePointJSON as Y, type TokenInfoJSON$1 as Z, type PriceHeuristicJSON as _, type DriftRewards as a, type SwitchboardConfigurationJSON as a0, type PythConfigurationJSON as a1, type WithdrawalCapsJSON as a2, type ObligationLiquidityJSON as a3, type ObligationCollateralJSON as a4, type ObligationOrderJSON as a5, type ObligationCollateralFields as a6, type ObligationLiquidityFields as a7, type ObligationOrderFields as a8, type LastUpdateFields as a9, type BigFractionBytesFields as aa, type LastUpdateJSON as ab, type BigFractionBytesJSON as ac, type RewardPerTimeUnitPointFields as ad, type RewardScheduleCurveFields as ae, type RewardScheduleCurveJSON as af, type RewardPerTimeUnitPointJSON as ag, type UserFeesJSON as ah, type UserFeesFields as ai, isSpotBalanceTypeVariant as aj, type FeeTier as ak, type FeeTierJSON as al, type OrderFillerRewardStructure as am, type OrderFillerRewardStructureJSON as an, type PriceDivergenceGuardRails as ao, type PriceDivergenceGuardRailsJSON as ap, type ValidityGuardRails as aq, type ValidityGuardRailsJSON as ar, type HistoricalOracleDataJSON as as, type HistoricalIndexDataJSON as at, type PoolBalanceJSON as au, type InsuranceFundJSON as av, SpotBalanceType as aw, type SpotPositionJSON as ax, type ReserveJSON as b, type ObligationRaw as c, type FarmStateRaw as d, type DriftSpotMarketJSON as e, type DriftUserJSON as f, type DriftRewardsJSON as g, type DriftUserStatsJSON as h, type DriftUser as i, type DriftUserStats as j, type JupLendingStateJSON as k, type JupTokenReserveJSON as l, type JupLendingRewardsRateModelJSON as m, type JupRateModelJSON as n, type JupTokenReserve as o, type JupLendingRewardsRateModel as p, type JupRateModel as q, type RewardInfoFields as r, type HistoricalIndexData as s, type FeeStructureJSON as t, type OracleGuardRailsJSON as u, type FeeStructure as v, type OracleGuardRails as w, DriftSpotBalanceType as x, type ReserveLiquidityFields as y, type ReserveCollateralFields as z };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BorshCoder, Provider, Program } from '@coral-xyz/anchor';
|
|
2
|
+
import BN from 'bn.js';
|
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
|
4
|
+
|
|
5
|
+
declare const SWITCHBOARD_ONDEMANDE_PRICE_PRECISION = 18;
|
|
6
|
+
interface CurrentResult {
|
|
7
|
+
value: BN;
|
|
8
|
+
std_dev: BN;
|
|
9
|
+
mean: BN;
|
|
10
|
+
range: BN;
|
|
11
|
+
min_value: BN;
|
|
12
|
+
max_vaalue: BN;
|
|
13
|
+
slot: BN;
|
|
14
|
+
min_slot: BN;
|
|
15
|
+
max_slot: BN;
|
|
16
|
+
}
|
|
17
|
+
interface OracleSubmission {
|
|
18
|
+
oracle: PublicKey;
|
|
19
|
+
slot: BN;
|
|
20
|
+
value: BN;
|
|
21
|
+
}
|
|
22
|
+
interface PullFeedAccountData {
|
|
23
|
+
submissions: OracleSubmission[];
|
|
24
|
+
authority: PublicKey;
|
|
25
|
+
queue: PublicKey;
|
|
26
|
+
feed_hash: Buffer;
|
|
27
|
+
initialized_at: BN;
|
|
28
|
+
permissions: BN;
|
|
29
|
+
max_variance: BN;
|
|
30
|
+
min_responses: number;
|
|
31
|
+
name: Buffer;
|
|
32
|
+
sample_size: number;
|
|
33
|
+
last_update_timestamp: BN;
|
|
34
|
+
lut_slot: BN;
|
|
35
|
+
result: CurrentResult;
|
|
36
|
+
max_staleness: number;
|
|
37
|
+
min_sample_size: number;
|
|
38
|
+
}
|
|
39
|
+
type CrossbarSimulatePayload = FeedResponse[];
|
|
40
|
+
interface FeedResponse {
|
|
41
|
+
feedHash: string;
|
|
42
|
+
results: number[];
|
|
43
|
+
}
|
|
44
|
+
declare const switchboardAccountCoder: BorshCoder<string, string>;
|
|
45
|
+
declare function getSwitchboardProgram(provider: Provider): Program;
|
|
46
|
+
declare function decodeSwitchboardPullFeedData(data: Buffer): PullFeedAccountData;
|
|
47
|
+
|
|
48
|
+
export { type CurrentResult as C, type FeedResponse as F, type OracleSubmission as O, type PullFeedAccountData as P, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION as S, type CrossbarSimulatePayload as a, decodeSwitchboardPullFeedData as d, getSwitchboardProgram as g, switchboardAccountCoder as s };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BorshCoder, Provider, Program } from '@coral-xyz/anchor';
|
|
2
|
+
import BN from 'bn.js';
|
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
|
4
|
+
|
|
5
|
+
declare const SWITCHBOARD_ONDEMANDE_PRICE_PRECISION = 18;
|
|
6
|
+
interface CurrentResult {
|
|
7
|
+
value: BN;
|
|
8
|
+
std_dev: BN;
|
|
9
|
+
mean: BN;
|
|
10
|
+
range: BN;
|
|
11
|
+
min_value: BN;
|
|
12
|
+
max_vaalue: BN;
|
|
13
|
+
slot: BN;
|
|
14
|
+
min_slot: BN;
|
|
15
|
+
max_slot: BN;
|
|
16
|
+
}
|
|
17
|
+
interface OracleSubmission {
|
|
18
|
+
oracle: PublicKey;
|
|
19
|
+
slot: BN;
|
|
20
|
+
value: BN;
|
|
21
|
+
}
|
|
22
|
+
interface PullFeedAccountData {
|
|
23
|
+
submissions: OracleSubmission[];
|
|
24
|
+
authority: PublicKey;
|
|
25
|
+
queue: PublicKey;
|
|
26
|
+
feed_hash: Buffer;
|
|
27
|
+
initialized_at: BN;
|
|
28
|
+
permissions: BN;
|
|
29
|
+
max_variance: BN;
|
|
30
|
+
min_responses: number;
|
|
31
|
+
name: Buffer;
|
|
32
|
+
sample_size: number;
|
|
33
|
+
last_update_timestamp: BN;
|
|
34
|
+
lut_slot: BN;
|
|
35
|
+
result: CurrentResult;
|
|
36
|
+
max_staleness: number;
|
|
37
|
+
min_sample_size: number;
|
|
38
|
+
}
|
|
39
|
+
type CrossbarSimulatePayload = FeedResponse[];
|
|
40
|
+
interface FeedResponse {
|
|
41
|
+
feedHash: string;
|
|
42
|
+
results: number[];
|
|
43
|
+
}
|
|
44
|
+
declare const switchboardAccountCoder: BorshCoder<string, string>;
|
|
45
|
+
declare function getSwitchboardProgram(provider: Provider): Program;
|
|
46
|
+
declare function decodeSwitchboardPullFeedData(data: Buffer): PullFeedAccountData;
|
|
47
|
+
|
|
48
|
+
export { type CurrentResult as C, type FeedResponse as F, type OracleSubmission as O, type PullFeedAccountData as P, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION as S, type CrossbarSimulatePayload as a, decodeSwitchboardPullFeedData as d, getSwitchboardProgram as g, switchboardAccountCoder as s };
|
package/dist/index.cjs
CHANGED
|
@@ -21374,7 +21374,10 @@ function computeProjectedActiveBalancesNoCpi(balances, instructions2, program, b
|
|
|
21374
21374
|
if (!bank) {
|
|
21375
21375
|
throw Error(`Bank ${targetBank.toBase58()} not found in bankMap`);
|
|
21376
21376
|
}
|
|
21377
|
-
const
|
|
21377
|
+
const isKaminoWithdraw = decoded.name === "kaminoWithdraw";
|
|
21378
|
+
const assetShareValueMultiplier = isKaminoWithdraw ? new BigNumber3__default.default(1) : assetShareValueMultiplierByBank.get(targetBank.toBase58()) ?? new BigNumber3__default.default(1);
|
|
21379
|
+
const cTokenAmount = withdrawTokenAmount.div(assetShareValueMultiplier);
|
|
21380
|
+
const withdrawShares = getAssetShares(bank, cTokenAmount);
|
|
21378
21381
|
targetBalance.assetShares = BigNumber3__default.default.max(
|
|
21379
21382
|
0,
|
|
21380
21383
|
targetBalance.assetShares.minus(withdrawShares)
|
|
@@ -49153,7 +49156,7 @@ function computeMaxWithdrawForBank(params) {
|
|
|
49153
49156
|
const maxWithdraw = initUntiedCollateralForBank.div(initWeightedPrice);
|
|
49154
49157
|
return maxWithdraw;
|
|
49155
49158
|
}
|
|
49156
|
-
var TITAN_FEE_WALLET = new web3_js.PublicKey("
|
|
49159
|
+
var TITAN_FEE_WALLET = new web3_js.PublicKey("FEES6XLN7dMz2iBwKab9Hri9Kwc4WJ6TmDAiT4BNhyej");
|
|
49157
49160
|
var getTitanFeeAccount = (mint) => {
|
|
49158
49161
|
return getAssociatedTokenAddressSync(mint, TITAN_FEE_WALLET, true);
|
|
49159
49162
|
};
|