@0dotxyz/p0-ts-sdk 2.11.0 → 2.11.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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as superstruct from 'superstruct';
2
2
  import { Infer } from 'superstruct';
3
- import { c as BankType, R as RiskTier, A as AssetTag, d as BankConfigFlag, e as OperationalState, f as OracleSetup, E as EmodeTag, g as EmodeEntryFlags, h as EmodeFlags, W as WrappedI80F48, I as InterestRateConfigRaw, i as OperationalStateRaw, j as OracleSetupRaw, k as RiskTierRaw, M as MarginfiProgram, l as InterestRateConfig, m as BankConfigType, n as BankConfigRaw, o as BankConfigOpt, p as BankConfigOptRaw, q as EmodeSettingsType, r as BankRateLimiterType, s as BankRaw, t as BankRateLimiterRaw, u as EmodeSettingsRaw, v as MarginfiIdlType, H as HealthCacheFlags, w as HealthCacheStatus, x as AccountFlags, y as MarginfiAccountType, z as OraclePrice, P as PriceWithConfidence, C as PriceBias, D as OraclePriceDto, F as BankIntegrationMetadataMap, G as OrderType, J as BalanceType, K as HealthCacheType, L as EmodePair, N as ActiveEmodePair, Q as ActionEmodeImpact, S as MarginRequirementType, a as BankConfigFastRaw, b as BankConfigGovRaw, T as Amount, U as EmodeImpactStatus, O as OrderTrigger, V as TypedAmount, X as BankVaultType, Y as RateLimitWindowType, Z as BankIntegrationMetadataMapDto, _ as BankIntegrationMetadataDto, $ as BankIntegrationMetadata, a0 as Bank, a1 as Environment, a2 as Project0Config, a3 as MintData } from './types-BO-ZFk04.cjs';
4
- export { aC as AccountType, aH as AmountType, aB as BankAddress, a4 as BankConfig, B as BankConfigCompactRaw, aE as BankMap, aA as BankMetadata, a7 as BankMetadataRaw, as as ComputeAssetUsdValueParams, aq as ComputeLiabilityUsdValueParams, ao as ComputeUsdValueParams, ac as EmodeConfigRaw, af as EmodeEntry, ah as EmodeImpact, a5 as EmodeSettings, aj as GetAssetWeightParams, a9 as InterestRateConfigCompactRaw, ae as InterestRateConfigOpt, aa as InterestRateConfigOptRaw, aD as KaminoStates, ax as MARGINFI_IDL, aG as MintDataMap, ag as OracleConfigOpt, ab as OracleConfigOptRaw, aF as OraclePriceMap, av as OrderTriggerKind, aw as PriceWithConfidenceDto, ay as Program, a6 as RateLimitWindowRaw, ad as RatePoint, a8 as RatePointRaw, az as Wallet, at as computeAssetUsdValue, ar as computeLiabilityUsdValue, an as computeLoopingParams, am as computeMaxLeverage, au as computeTvl, ap as computeUsdValue, ak as getAssetWeight, al as getLiabilityWeight, ai as isWeightedPrice, aI as resolveAmount } from './types-BO-ZFk04.cjs';
3
+ import { c as BankType, R as RiskTier, A as AssetTag, d as BankConfigFlag, e as OperationalState, f as OracleSetup, E as EmodeTag, g as EmodeEntryFlags, h as EmodeFlags, W as WrappedI80F48, I as InterestRateConfigRaw, i as OperationalStateRaw, j as OracleSetupRaw, k as RiskTierRaw, M as MarginfiProgram, l as InterestRateConfig, m as BankConfigType, n as BankConfigRaw, o as BankConfigOpt, p as BankConfigOptRaw, q as EmodeSettingsType, r as BankRateLimiterType, s as BankRaw, t as BankRateLimiterRaw, u as EmodeSettingsRaw, v as MarginfiIdlType, H as HealthCacheFlags, w as HealthCacheStatus, x as AccountFlags, y as MarginfiAccountType, z as OraclePrice, P as PriceWithConfidence, C as PriceBias, D as OraclePriceDto, F as BankIntegrationMetadataMap, G as OrderType, J as BalanceType, K as HealthCacheType, L as EmodePair, N as ActiveEmodePair, Q as ActionEmodeImpact, S as MarginRequirementType, a as BankConfigFastRaw, b as BankConfigGovRaw, T as Amount, U as EmodeImpactStatus, O as OrderTrigger, V as TypedAmount, X as BankVaultType, Y as RateLimitWindowType, Z as BankIntegrationMetadataMapDto, _ as BankIntegrationMetadataDto, $ as BankIntegrationMetadata, a0 as Bank, a1 as Environment, a2 as Project0Config, a3 as MintData } from './types-BOPERR6x.cjs';
4
+ export { aC as AccountType, aH as AmountType, aB as BankAddress, a4 as BankConfig, B as BankConfigCompactRaw, aE as BankMap, aA as BankMetadata, a7 as BankMetadataRaw, as as ComputeAssetUsdValueParams, aq as ComputeLiabilityUsdValueParams, ao as ComputeUsdValueParams, ac as EmodeConfigRaw, af as EmodeEntry, ah as EmodeImpact, a5 as EmodeSettings, aj as GetAssetWeightParams, a9 as InterestRateConfigCompactRaw, ae as InterestRateConfigOpt, aa as InterestRateConfigOptRaw, aD as KaminoStates, ax as MARGINFI_IDL, aG as MintDataMap, ag as OracleConfigOpt, ab as OracleConfigOptRaw, aF as OraclePriceMap, av as OrderTriggerKind, aw as PriceWithConfidenceDto, ay as Program, a6 as RateLimitWindowRaw, ad as RatePoint, a8 as RatePointRaw, az as Wallet, at as computeAssetUsdValue, ar as computeLiabilityUsdValue, an as computeLoopingParams, am as computeMaxLeverage, au as computeTvl, ap as computeUsdValue, ak as getAssetWeight, al as getLiabilityWeight, ai as isWeightedPrice, aI as resolveAmount } from './types-BOPERR6x.cjs';
5
5
  import * as _solana_web3_js from '@solana/web3.js';
6
6
  import { VersionedTransaction, Transaction, PublicKey, TransactionError, TransactionInstruction, Keypair, Signer, AddressLookupTableAccount, Blockhash, TransactionMessage, Connection, AccountInfo } from '@solana/web3.js';
7
7
  import { Idl, Instruction, Address } from '@coral-xyz/anchor';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as superstruct from 'superstruct';
2
2
  import { Infer } from 'superstruct';
3
- import { c as BankType, R as RiskTier, A as AssetTag, d as BankConfigFlag, e as OperationalState, f as OracleSetup, E as EmodeTag, g as EmodeEntryFlags, h as EmodeFlags, W as WrappedI80F48, I as InterestRateConfigRaw, i as OperationalStateRaw, j as OracleSetupRaw, k as RiskTierRaw, M as MarginfiProgram, l as InterestRateConfig, m as BankConfigType, n as BankConfigRaw, o as BankConfigOpt, p as BankConfigOptRaw, q as EmodeSettingsType, r as BankRateLimiterType, s as BankRaw, t as BankRateLimiterRaw, u as EmodeSettingsRaw, v as MarginfiIdlType, H as HealthCacheFlags, w as HealthCacheStatus, x as AccountFlags, y as MarginfiAccountType, z as OraclePrice, P as PriceWithConfidence, C as PriceBias, D as OraclePriceDto, F as BankIntegrationMetadataMap, G as OrderType, J as BalanceType, K as HealthCacheType, L as EmodePair, N as ActiveEmodePair, Q as ActionEmodeImpact, S as MarginRequirementType, a as BankConfigFastRaw, b as BankConfigGovRaw, T as Amount, U as EmodeImpactStatus, O as OrderTrigger, V as TypedAmount, X as BankVaultType, Y as RateLimitWindowType, Z as BankIntegrationMetadataMapDto, _ as BankIntegrationMetadataDto, $ as BankIntegrationMetadata, a0 as Bank, a1 as Environment, a2 as Project0Config, a3 as MintData } from './types-DgVpJ2nB.js';
4
- export { aC as AccountType, aH as AmountType, aB as BankAddress, a4 as BankConfig, B as BankConfigCompactRaw, aE as BankMap, aA as BankMetadata, a7 as BankMetadataRaw, as as ComputeAssetUsdValueParams, aq as ComputeLiabilityUsdValueParams, ao as ComputeUsdValueParams, ac as EmodeConfigRaw, af as EmodeEntry, ah as EmodeImpact, a5 as EmodeSettings, aj as GetAssetWeightParams, a9 as InterestRateConfigCompactRaw, ae as InterestRateConfigOpt, aa as InterestRateConfigOptRaw, aD as KaminoStates, ax as MARGINFI_IDL, aG as MintDataMap, ag as OracleConfigOpt, ab as OracleConfigOptRaw, aF as OraclePriceMap, av as OrderTriggerKind, aw as PriceWithConfidenceDto, ay as Program, a6 as RateLimitWindowRaw, ad as RatePoint, a8 as RatePointRaw, az as Wallet, at as computeAssetUsdValue, ar as computeLiabilityUsdValue, an as computeLoopingParams, am as computeMaxLeverage, au as computeTvl, ap as computeUsdValue, ak as getAssetWeight, al as getLiabilityWeight, ai as isWeightedPrice, aI as resolveAmount } from './types-DgVpJ2nB.js';
3
+ import { c as BankType, R as RiskTier, A as AssetTag, d as BankConfigFlag, e as OperationalState, f as OracleSetup, E as EmodeTag, g as EmodeEntryFlags, h as EmodeFlags, W as WrappedI80F48, I as InterestRateConfigRaw, i as OperationalStateRaw, j as OracleSetupRaw, k as RiskTierRaw, M as MarginfiProgram, l as InterestRateConfig, m as BankConfigType, n as BankConfigRaw, o as BankConfigOpt, p as BankConfigOptRaw, q as EmodeSettingsType, r as BankRateLimiterType, s as BankRaw, t as BankRateLimiterRaw, u as EmodeSettingsRaw, v as MarginfiIdlType, H as HealthCacheFlags, w as HealthCacheStatus, x as AccountFlags, y as MarginfiAccountType, z as OraclePrice, P as PriceWithConfidence, C as PriceBias, D as OraclePriceDto, F as BankIntegrationMetadataMap, G as OrderType, J as BalanceType, K as HealthCacheType, L as EmodePair, N as ActiveEmodePair, Q as ActionEmodeImpact, S as MarginRequirementType, a as BankConfigFastRaw, b as BankConfigGovRaw, T as Amount, U as EmodeImpactStatus, O as OrderTrigger, V as TypedAmount, X as BankVaultType, Y as RateLimitWindowType, Z as BankIntegrationMetadataMapDto, _ as BankIntegrationMetadataDto, $ as BankIntegrationMetadata, a0 as Bank, a1 as Environment, a2 as Project0Config, a3 as MintData } from './types-D2GhlUZp.js';
4
+ export { aC as AccountType, aH as AmountType, aB as BankAddress, a4 as BankConfig, B as BankConfigCompactRaw, aE as BankMap, aA as BankMetadata, a7 as BankMetadataRaw, as as ComputeAssetUsdValueParams, aq as ComputeLiabilityUsdValueParams, ao as ComputeUsdValueParams, ac as EmodeConfigRaw, af as EmodeEntry, ah as EmodeImpact, a5 as EmodeSettings, aj as GetAssetWeightParams, a9 as InterestRateConfigCompactRaw, ae as InterestRateConfigOpt, aa as InterestRateConfigOptRaw, aD as KaminoStates, ax as MARGINFI_IDL, aG as MintDataMap, ag as OracleConfigOpt, ab as OracleConfigOptRaw, aF as OraclePriceMap, av as OrderTriggerKind, aw as PriceWithConfidenceDto, ay as Program, a6 as RateLimitWindowRaw, ad as RatePoint, a8 as RatePointRaw, az as Wallet, at as computeAssetUsdValue, ar as computeLiabilityUsdValue, an as computeLoopingParams, am as computeMaxLeverage, au as computeTvl, ap as computeUsdValue, ak as getAssetWeight, al as getLiabilityWeight, ai as isWeightedPrice, aI as resolveAmount } from './types-D2GhlUZp.js';
5
5
  import * as _solana_web3_js from '@solana/web3.js';
6
6
  import { VersionedTransaction, Transaction, PublicKey, TransactionError, TransactionInstruction, Keypair, Signer, AddressLookupTableAccount, Blockhash, TransactionMessage, Connection, AccountInfo } from '@solana/web3.js';
7
7
  import { Idl, Instruction, Address } from '@coral-xyz/anchor';
package/dist/index.js CHANGED
@@ -86157,9 +86157,16 @@ async function simulateAccountHealthCacheWithFallback(params) {
86157
86157
  marginfiAccount,
86158
86158
  bankIntegrationMap
86159
86159
  });
86160
- simulatedAccount.healthCache.assetValueEquity = bigNumberToWrappedI80F48(assetValueEquity);
86161
- simulatedAccount.healthCache.liabilityValueEquity = bigNumberToWrappedI80F48(liabilityValueEquity);
86162
- marginfiAccount = parseMarginfiAccountRaw(params.marginfiAccount.address, simulatedAccount);
86160
+ const simulated = parseMarginfiAccountRaw(params.marginfiAccount.address, simulatedAccount);
86161
+ marginfiAccount = {
86162
+ ...simulated,
86163
+ healthCache: {
86164
+ ...simulated.healthCache,
86165
+ assetValueEquity,
86166
+ liabilityValueEquity,
86167
+ simulationStatus: 1 /* ONCHAIN */
86168
+ }
86169
+ };
86163
86170
  } catch (e) {
86164
86171
  console.log("e", e);
86165
86172
  const { assets: assetValueMaint, liabilities: liabilityValueMaint } = computeHealthComponentsFromBalances({