@0dotxyz/p0-ts-sdk 2.3.0-alpha.1 → 2.3.0-alpha.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/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{merge.types-BS8s5Ck0.d.cts → merge.types-Coz1eQZg.d.cts} +12 -5
- package/dist/{merge.types-BS8s5Ck0.d.ts → merge.types-Coz1eQZg.d.ts} +12 -5
- package/dist/vendor.cjs +5 -1
- 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 +5 -1
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
package/dist/vendor.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { PublicKey, TransactionInstruction, Connection, Transaction, Commitment, AccountInfo, AccountMeta as AccountMeta$1, Signer, AddressLookupTableAccount } from '@solana/web3.js';
|
|
3
3
|
import BigNumber$1 from 'bignumber.js';
|
|
4
|
-
import { E as ExponentVault, R as ResolveExponentMergeContextParams, a as ExponentMergeContext, b as ExponentMergeAccounts } from './merge.types-
|
|
5
|
-
export { c as CrossbarSimulatePayload, C as CurrentResult, F as FeedResponse, O as OracleSubmission, P as PullFeedAccountData, S as SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, d as decodeSwitchboardPullFeedData, g as getSwitchboardProgram, s as switchboardAccountCoder } from './merge.types-
|
|
4
|
+
import { E as ExponentVault, R as ResolveExponentMergeContextParams, a as ExponentMergeContext, b as ExponentMergeAccounts } from './merge.types-Coz1eQZg.cjs';
|
|
5
|
+
export { c as CrossbarSimulatePayload, C as CurrentResult, F as FeedResponse, O as OracleSubmission, P as PullFeedAccountData, S as SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, d as decodeSwitchboardPullFeedData, g as getSwitchboardProgram, s as switchboardAccountCoder } from './merge.types-Coz1eQZg.cjs';
|
|
6
6
|
import { Program, BorshCoder, Address } from '@coral-xyz/anchor';
|
|
7
7
|
import { R as ReserveRaw, O as ObligationRaw, h as ObligationJSON, g as ReserveJSON, C as CurvePointFields, r as RewardInfoFields, F as FarmStateRaw, i as FarmStateJSON, H as HistoricalOracleData, s as HistoricalIndexData, P as PoolBalance, I as InsuranceFund, t as FeeStructureJSON, u as OracleGuardRailsJSON, v as FeeStructure, w as OracleGuardRails, S as SpotPosition, c as DriftUserStats, m as DriftUserStatsJSON, a as DriftUser, k as DriftUserJSON, D as DriftSpotMarket, j as DriftSpotMarketJSON, b as DriftRewards, l as DriftRewardsJSON, x as DriftSpotBalanceType, J as JupLendingState, n as JupLendingStateJSON, d as JupTokenReserve, o as JupTokenReserveJSON, e as JupLendingRewardsRateModel, p as JupLendingRewardsRateModelJSON, f as JupRateModel, q as JupRateModelJSON } from './dto-rate-model.types-DveIB9Ll.cjs';
|
|
8
8
|
export { aa as BigFractionBytesFields, ac as BigFractionBytesJSON, E as BorrowRateCurveFields, X as BorrowRateCurveJSON, Y as CurvePointJSON, ak as FeeTier, al as FeeTierJSON, at as HistoricalIndexDataJSON, as as HistoricalOracleDataJSON, av as InsuranceFundJSON, a9 as LastUpdateFields, ab as LastUpdateJSON, a6 as ObligationCollateralFields, a4 as ObligationCollateralJSON, a7 as ObligationLiquidityFields, a3 as ObligationLiquidityJSON, a8 as ObligationOrderFields, a5 as ObligationOrderJSON, am as OrderFillerRewardStructure, an as OrderFillerRewardStructureJSON, au as PoolBalanceJSON, ao as PriceDivergenceGuardRails, ap as PriceDivergenceGuardRailsJSON, G as PriceHeuristicFields, _ as PriceHeuristicJSON, M as PythConfigurationFields, a1 as PythConfigurationJSON, z as ReserveCollateralFields, Q as ReserveCollateralJSON, A as ReserveConfigFields, U as ReserveConfigJSON, B as ReserveFeesFields, V as ReserveFeesJSON, y as ReserveLiquidityFields, N as ReserveLiquidityJSON, ad as RewardPerTimeUnitPointFields, ag as RewardPerTimeUnitPointJSON, ae as RewardScheduleCurveFields, af as RewardScheduleCurveJSON, K as ScopeConfigurationFields, $ as ScopeConfigurationJSON, aw as SpotBalanceType, ax as SpotPositionJSON, L as SwitchboardConfigurationFields, a0 as SwitchboardConfigurationJSON, T as TokenInfoFields, Z as TokenInfoJSON, ai as UserFeesFields, ah as UserFeesJSON, aq as ValidityGuardRails, ar as ValidityGuardRailsJSON, W as WithdrawalCapsFields, a2 as WithdrawalCapsJSON, aj as isSpotBalanceTypeVariant } from './dto-rate-model.types-DveIB9Ll.cjs';
|
package/dist/vendor.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { PublicKey, TransactionInstruction, Connection, Transaction, Commitment, AccountInfo, AccountMeta as AccountMeta$1, Signer, AddressLookupTableAccount } from '@solana/web3.js';
|
|
3
3
|
import BigNumber$1 from 'bignumber.js';
|
|
4
|
-
import { E as ExponentVault, R as ResolveExponentMergeContextParams, a as ExponentMergeContext, b as ExponentMergeAccounts } from './merge.types-
|
|
5
|
-
export { c as CrossbarSimulatePayload, C as CurrentResult, F as FeedResponse, O as OracleSubmission, P as PullFeedAccountData, S as SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, d as decodeSwitchboardPullFeedData, g as getSwitchboardProgram, s as switchboardAccountCoder } from './merge.types-
|
|
4
|
+
import { E as ExponentVault, R as ResolveExponentMergeContextParams, a as ExponentMergeContext, b as ExponentMergeAccounts } from './merge.types-Coz1eQZg.js';
|
|
5
|
+
export { c as CrossbarSimulatePayload, C as CurrentResult, F as FeedResponse, O as OracleSubmission, P as PullFeedAccountData, S as SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, d as decodeSwitchboardPullFeedData, g as getSwitchboardProgram, s as switchboardAccountCoder } from './merge.types-Coz1eQZg.js';
|
|
6
6
|
import { Program, BorshCoder, Address } from '@coral-xyz/anchor';
|
|
7
7
|
import { R as ReserveRaw, O as ObligationRaw, h as ObligationJSON, g as ReserveJSON, C as CurvePointFields, r as RewardInfoFields, F as FarmStateRaw, i as FarmStateJSON, H as HistoricalOracleData, s as HistoricalIndexData, P as PoolBalance, I as InsuranceFund, t as FeeStructureJSON, u as OracleGuardRailsJSON, v as FeeStructure, w as OracleGuardRails, S as SpotPosition, c as DriftUserStats, m as DriftUserStatsJSON, a as DriftUser, k as DriftUserJSON, D as DriftSpotMarket, j as DriftSpotMarketJSON, b as DriftRewards, l as DriftRewardsJSON, x as DriftSpotBalanceType, J as JupLendingState, n as JupLendingStateJSON, d as JupTokenReserve, o as JupTokenReserveJSON, e as JupLendingRewardsRateModel, p as JupLendingRewardsRateModelJSON, f as JupRateModel, q as JupRateModelJSON } from './dto-rate-model.types-DveIB9Ll.js';
|
|
8
8
|
export { aa as BigFractionBytesFields, ac as BigFractionBytesJSON, E as BorrowRateCurveFields, X as BorrowRateCurveJSON, Y as CurvePointJSON, ak as FeeTier, al as FeeTierJSON, at as HistoricalIndexDataJSON, as as HistoricalOracleDataJSON, av as InsuranceFundJSON, a9 as LastUpdateFields, ab as LastUpdateJSON, a6 as ObligationCollateralFields, a4 as ObligationCollateralJSON, a7 as ObligationLiquidityFields, a3 as ObligationLiquidityJSON, a8 as ObligationOrderFields, a5 as ObligationOrderJSON, am as OrderFillerRewardStructure, an as OrderFillerRewardStructureJSON, au as PoolBalanceJSON, ao as PriceDivergenceGuardRails, ap as PriceDivergenceGuardRailsJSON, G as PriceHeuristicFields, _ as PriceHeuristicJSON, M as PythConfigurationFields, a1 as PythConfigurationJSON, z as ReserveCollateralFields, Q as ReserveCollateralJSON, A as ReserveConfigFields, U as ReserveConfigJSON, B as ReserveFeesFields, V as ReserveFeesJSON, y as ReserveLiquidityFields, N as ReserveLiquidityJSON, ad as RewardPerTimeUnitPointFields, ag as RewardPerTimeUnitPointJSON, ae as RewardScheduleCurveFields, af as RewardScheduleCurveJSON, K as ScopeConfigurationFields, $ as ScopeConfigurationJSON, aw as SpotBalanceType, ax as SpotPositionJSON, L as SwitchboardConfigurationFields, a0 as SwitchboardConfigurationJSON, T as TokenInfoFields, Z as TokenInfoJSON, ai as UserFeesFields, ah as UserFeesJSON, aq as ValidityGuardRails, ar as ValidityGuardRailsJSON, W as WithdrawalCapsFields, a2 as WithdrawalCapsJSON, aj as isSpotBalanceTypeVariant } from './dto-rate-model.types-DveIB9Ll.js';
|
package/dist/vendor.js
CHANGED
|
@@ -39719,6 +39719,7 @@ function pk(v) {
|
|
|
39719
39719
|
function decodeExponentVault(data) {
|
|
39720
39720
|
const d = EXPONENT_ACCOUNTS_CODER.decode("Vault", data);
|
|
39721
39721
|
const get = (snake, camel) => d[snake] ?? d[camel];
|
|
39722
|
+
const u646 = (v) => BigInt(BN2.isBN(v) ? v.toString() : String(v ?? 0));
|
|
39722
39723
|
return {
|
|
39723
39724
|
authority: pk(get("authority", "authority")),
|
|
39724
39725
|
syProgram: pk(get("sy_program", "syProgram")),
|
|
@@ -39728,6 +39729,8 @@ function decodeExponentVault(data) {
|
|
|
39728
39729
|
escrowSy: pk(get("escrow_sy", "escrowSy")),
|
|
39729
39730
|
yieldPosition: pk(get("yield_position", "yieldPosition")),
|
|
39730
39731
|
addressLookupTable: pk(get("address_lookup_table", "addressLookupTable")),
|
|
39732
|
+
syForPt: u646(get("sy_for_pt", "syForPt")),
|
|
39733
|
+
ptSupply: u646(get("pt_supply", "ptSupply")),
|
|
39731
39734
|
finalSyExchangeRate: exponentNumberToBigNumber(
|
|
39732
39735
|
get("final_sy_exchange_rate", "finalSyExchangeRate")
|
|
39733
39736
|
),
|
|
@@ -39801,7 +39804,8 @@ async function resolveExponentMergeContext(params) {
|
|
|
39801
39804
|
mergeAccounts,
|
|
39802
39805
|
underlying: { mint: vault.mintSy, decimals, tokenProgram: syTokenProgram },
|
|
39803
39806
|
computeRedeemedAmountNative(ptAmountNative) {
|
|
39804
|
-
|
|
39807
|
+
if (vault.ptSupply === 0n) return 0n;
|
|
39808
|
+
const sy = new BigNumber(ptAmountNative.toString()).times(vault.syForPt.toString()).div(vault.ptSupply.toString()).integerValue(BigNumber.ROUND_FLOOR);
|
|
39805
39809
|
return BigInt(sy.toFixed(0));
|
|
39806
39810
|
}
|
|
39807
39811
|
};
|