@0dotxyz/p0-ts-sdk 2.4.0 → 2.4.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.
@@ -1,10 +1,10 @@
1
1
  import * as _solana_web3_js from '@solana/web3.js';
2
2
  import { PublicKey, AccountMeta } from '@solana/web3.js';
3
3
  import BN from 'bn.js';
4
- import { M as MarginfiProgram, B as BankConfigCompactRaw, a as BankConfigOptRaw } from './types-DDP4jEc9.cjs';
4
+ import { M as MarginfiProgram, B as BankConfigCompactRaw, a as BankConfigOptRaw } from './types-BkXrDBCr.cjs';
5
5
  import '@coral-xyz/anchor';
6
6
  import 'bignumber.js';
7
- import './dto-rate-model.types-DWB7J91n.cjs';
7
+ import './dto-rate-model.types-IT8wckYH.cjs';
8
8
 
9
9
  declare function makeInitMarginfiAccountIx(mfProgram: MarginfiProgram, accounts: {
10
10
  marginfiGroup: PublicKey;
@@ -1,10 +1,10 @@
1
1
  import * as _solana_web3_js from '@solana/web3.js';
2
2
  import { PublicKey, AccountMeta } from '@solana/web3.js';
3
3
  import BN from 'bn.js';
4
- import { M as MarginfiProgram, B as BankConfigCompactRaw, a as BankConfigOptRaw } from './types-rBQYamIi.js';
4
+ import { M as MarginfiProgram, B as BankConfigCompactRaw, a as BankConfigOptRaw } from './types-Ci3ayYQ2.js';
5
5
  import '@coral-xyz/anchor';
6
6
  import 'bignumber.js';
7
- import './dto-rate-model.types-DWB7J91n.js';
7
+ import './dto-rate-model.types-IT8wckYH.js';
8
8
 
9
9
  declare function makeInitMarginfiAccountIx(mfProgram: MarginfiProgram, accounts: {
10
10
  marginfiGroup: PublicKey;
@@ -2,7 +2,7 @@ import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
2
2
  import { Idl, Program as Program$1, AnchorProvider } from '@coral-xyz/anchor';
3
3
  import BN from 'bn.js';
4
4
  import BigNumber$1 from 'bignumber.js';
5
- import { K as KaminoReserve, a as KaminoObligation, b as KaminoFarmState, D as DriftSpotMarket, c as DriftUser, d as DriftRewards, e as DriftUserStats, J as JupLendingState, f as JupTokenReserve, g as JupLendingRewardsRateModel, h as JupRateModel, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON } from './dto-rate-model.types-DWB7J91n.cjs';
5
+ import { K as KaminoReserve, a as KaminoObligation, b as KaminoFarmState, D as DriftSpotMarket, c as DriftUser, d as DriftRewards, e as DriftUserStats, J as JupLendingState, f as JupTokenReserve, g as JupLendingRewardsRateModel, h as JupRateModel, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON } from './dto-rate-model.types-IT8wckYH.cjs';
6
6
 
7
7
  /**
8
8
  * Program IDL in camelCase format in order to be used in JS/TS.
@@ -2,7 +2,7 @@ import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
2
2
  import { Idl, Program as Program$1, AnchorProvider } from '@coral-xyz/anchor';
3
3
  import BN from 'bn.js';
4
4
  import BigNumber$1 from 'bignumber.js';
5
- import { K as KaminoReserve, a as KaminoObligation, b as KaminoFarmState, D as DriftSpotMarket, c as DriftUser, d as DriftRewards, e as DriftUserStats, J as JupLendingState, f as JupTokenReserve, g as JupLendingRewardsRateModel, h as JupRateModel, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON } from './dto-rate-model.types-DWB7J91n.js';
5
+ import { K as KaminoReserve, a as KaminoObligation, b as KaminoFarmState, D as DriftSpotMarket, c as DriftUser, d as DriftRewards, e as DriftUserStats, J as JupLendingState, f as JupTokenReserve, g as JupLendingRewardsRateModel, h as JupRateModel, i as KaminoReserveJSON, j as KaminoObligationJSON, k as KaminoFarmStateJSON, l as DriftSpotMarketJSON, m as DriftUserJSON, n as DriftRewardsJSON, o as DriftUserStatsJSON, p as JupLendingStateJSON, q as JupTokenReserveJSON, r as JupLendingRewardsRateModelJSON, s as JupRateModelJSON } from './dto-rate-model.types-IT8wckYH.js';
6
6
 
7
7
  /**
8
8
  * Program IDL in camelCase format in order to be used in JS/TS.
package/dist/vendor.cjs CHANGED
@@ -4101,6 +4101,8 @@ function kaminoReserveToDto(reserve) {
4101
4101
  config: {
4102
4102
  protocolTakeRatePct: reserve.config.protocolTakeRatePct,
4103
4103
  hostFixedInterestRateBps: reserve.config.hostFixedInterestRateBps,
4104
+ depositLimit: reserve.config.depositLimit.toString(),
4105
+ borrowLimit: reserve.config.borrowLimit.toString(),
4104
4106
  borrowRateCurve: {
4105
4107
  points: reserve.config.borrowRateCurve.points.map((item) => ({
4106
4108
  utilizationRateBps: item.utilizationRateBps,
@@ -12408,12 +12410,13 @@ function dtoToKaminoObligation(obligationDto) {
12408
12410
  return {
12409
12411
  lendingMarket: new web3_js.PublicKey(obligationDto.lendingMarket),
12410
12412
  owner: new web3_js.PublicKey(obligationDto.owner),
12411
- deposits: obligationDto.deposits.map((item) => ({
12413
+ // Hosted endpoints may prune empty position arrays from the payload
12414
+ deposits: (obligationDto.deposits ?? []).map((item) => ({
12412
12415
  depositReserve: new web3_js.PublicKey(item.depositReserve),
12413
12416
  depositedAmount: new BN5__default.default(item.depositedAmount),
12414
12417
  marketValueSf: new BN5__default.default(item.marketValueSf)
12415
12418
  })),
12416
- borrows: obligationDto.borrows.map((item) => ({
12419
+ borrows: (obligationDto.borrows ?? []).map((item) => ({
12417
12420
  borrowReserve: new web3_js.PublicKey(item.borrowReserve),
12418
12421
  borrowedAmountSf: new BN5__default.default(item.borrowedAmountSf),
12419
12422
  marketValueSf: new BN5__default.default(item.marketValueSf)
@@ -12446,6 +12449,8 @@ function dtoToKaminoReserve(reserveDto) {
12446
12449
  config: {
12447
12450
  protocolTakeRatePct: reserveDto.config.protocolTakeRatePct,
12448
12451
  hostFixedInterestRateBps: reserveDto.config.hostFixedInterestRateBps,
12452
+ depositLimit: new BN5__default.default(reserveDto.config.depositLimit),
12453
+ borrowLimit: new BN5__default.default(reserveDto.config.borrowLimit),
12449
12454
  borrowRateCurve: {
12450
12455
  points: reserveDto.config.borrowRateCurve.points.map((item) => ({
12451
12456
  utilizationRateBps: item.utilizationRateBps,
@@ -12860,6 +12865,7 @@ function kaminoFarmStateToDto(farmState) {
12860
12865
  mint: item.token.mint.toBase58(),
12861
12866
  decimals: item.token.decimals.toString()
12862
12867
  },
12868
+ rewardsAvailable: item.rewardsAvailable.toString(),
12863
12869
  rewardsPerSecondDecimals: item.rewardsPerSecondDecimals,
12864
12870
  rewardScheduleCurve: {
12865
12871
  points: item.rewardScheduleCurve.points.map((p) => ({
@@ -12973,6 +12979,7 @@ function dtoToKaminoFarmState(dto) {
12973
12979
  mint: new web3_js.PublicKey(item.token.mint),
12974
12980
  decimals: new BN5__default.default(item.token.decimals)
12975
12981
  },
12982
+ rewardsAvailable: new BN5__default.default(item.rewardsAvailable),
12976
12983
  rewardsPerSecondDecimals: item.rewardsPerSecondDecimals,
12977
12984
  rewardScheduleCurve: {
12978
12985
  points: item.rewardScheduleCurve.points.map((p) => ({
@@ -30995,41 +31002,27 @@ function jupLendingStateRawToDto(raw) {
30995
31002
  function jupTokenReserveRawToDto(raw) {
30996
31003
  return {
30997
31004
  pubkey: raw.pubkey.toBase58(),
30998
- mint: raw.mint.toBase58(),
30999
- vault: raw.vault.toBase58(),
31000
31005
  borrowRate: raw.borrowRate,
31001
31006
  feeOnInterest: raw.feeOnInterest,
31002
31007
  lastUtilization: raw.lastUtilization,
31003
- lastUpdateTimestamp: raw.lastUpdateTimestamp.toString(),
31004
31008
  supplyExchangePrice: raw.supplyExchangePrice.toString(),
31005
31009
  borrowExchangePrice: raw.borrowExchangePrice.toString(),
31006
- maxUtilization: raw.maxUtilization,
31007
31010
  totalSupplyWithInterest: raw.totalSupplyWithInterest.toString(),
31008
31011
  totalSupplyInterestFree: raw.totalSupplyInterestFree.toString(),
31009
31012
  totalBorrowWithInterest: raw.totalBorrowWithInterest.toString(),
31010
- totalBorrowInterestFree: raw.totalBorrowInterestFree.toString(),
31011
- totalClaimAmount: raw.totalClaimAmount.toString(),
31012
- interactingProtocol: raw.interactingProtocol.toBase58(),
31013
- interactingTimestamp: raw.interactingTimestamp.toString(),
31014
- interactingBalance: raw.interactingBalance.toString()
31013
+ totalBorrowInterestFree: raw.totalBorrowInterestFree.toString()
31015
31014
  };
31016
31015
  }
31017
31016
  function jupLendingRewardsRateModelRawToDto(raw) {
31018
31017
  return {
31019
- pubkey: raw.pubkey.toBase58(),
31020
- mint: raw.mint.toBase58(),
31021
31018
  startTvl: raw.startTvl.toString(),
31022
31019
  duration: raw.duration.toString(),
31023
31020
  startTime: raw.startTime.toString(),
31024
- yearlyReward: raw.yearlyReward.toString(),
31025
- nextDuration: raw.nextDuration.toString(),
31026
- nextRewardAmount: raw.nextRewardAmount.toString()
31021
+ yearlyReward: raw.yearlyReward.toString()
31027
31022
  };
31028
31023
  }
31029
31024
  function jupRateModelRawToDto(raw) {
31030
31025
  return {
31031
- pubkey: raw.pubkey.toBase58(),
31032
- mint: raw.mint.toBase58(),
31033
31026
  version: raw.version,
31034
31027
  rateAtZero: raw.rateAtZero,
31035
31028
  kink1Utilization: raw.kink1Utilization,
@@ -31186,41 +31179,27 @@ function dtoToJupLendingStateRaw(dto) {
31186
31179
  function dtoToJupTokenReserveRaw(dto) {
31187
31180
  return {
31188
31181
  pubkey: new web3_js.PublicKey(dto.pubkey),
31189
- mint: new web3_js.PublicKey(dto.mint),
31190
- vault: new web3_js.PublicKey(dto.vault),
31191
31182
  borrowRate: dto.borrowRate,
31192
31183
  feeOnInterest: dto.feeOnInterest,
31193
31184
  lastUtilization: dto.lastUtilization,
31194
- lastUpdateTimestamp: new BN5__default.default(dto.lastUpdateTimestamp),
31195
31185
  supplyExchangePrice: new BN5__default.default(dto.supplyExchangePrice),
31196
31186
  borrowExchangePrice: new BN5__default.default(dto.borrowExchangePrice),
31197
- maxUtilization: dto.maxUtilization,
31198
31187
  totalSupplyWithInterest: new BN5__default.default(dto.totalSupplyWithInterest),
31199
31188
  totalSupplyInterestFree: new BN5__default.default(dto.totalSupplyInterestFree),
31200
31189
  totalBorrowWithInterest: new BN5__default.default(dto.totalBorrowWithInterest),
31201
- totalBorrowInterestFree: new BN5__default.default(dto.totalBorrowInterestFree),
31202
- totalClaimAmount: new BN5__default.default(dto.totalClaimAmount),
31203
- interactingProtocol: new web3_js.PublicKey(dto.interactingProtocol),
31204
- interactingTimestamp: new BN5__default.default(dto.interactingTimestamp),
31205
- interactingBalance: new BN5__default.default(dto.interactingBalance)
31190
+ totalBorrowInterestFree: new BN5__default.default(dto.totalBorrowInterestFree)
31206
31191
  };
31207
31192
  }
31208
31193
  function dtoToJupLendingRewardsRateModelRaw(dto) {
31209
31194
  return {
31210
- pubkey: new web3_js.PublicKey(dto.pubkey),
31211
- mint: new web3_js.PublicKey(dto.mint),
31212
31195
  startTvl: new BN5__default.default(dto.startTvl),
31213
31196
  duration: new BN5__default.default(dto.duration),
31214
31197
  startTime: new BN5__default.default(dto.startTime),
31215
- yearlyReward: new BN5__default.default(dto.yearlyReward),
31216
- nextDuration: new BN5__default.default(dto.nextDuration),
31217
- nextRewardAmount: new BN5__default.default(dto.nextRewardAmount)
31198
+ yearlyReward: new BN5__default.default(dto.yearlyReward)
31218
31199
  };
31219
31200
  }
31220
31201
  function dtoToJupRateModelRaw(dto) {
31221
31202
  return {
31222
- pubkey: new web3_js.PublicKey(dto.pubkey),
31223
- mint: new web3_js.PublicKey(dto.mint),
31224
31203
  version: dto.version,
31225
31204
  rateAtZero: dto.rateAtZero,
31226
31205
  kink1Utilization: dto.kink1Utilization,