@0dotxyz/p0-ts-sdk 2.1.2 → 2.1.4
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.cjs +6 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -9
- package/dist/index.d.ts +2 -9
- package/dist/index.js +6 -17
- package/dist/index.js.map +1 -1
- package/dist/vendor.cjs +2 -2
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +1 -1
- package/dist/vendor.d.ts +1 -1
- package/dist/vendor.js +2 -2
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -7
package/dist/index.cjs
CHANGED
|
@@ -16070,7 +16070,7 @@ function parseEmodeSettingsRaw(emodeSettingsRaw) {
|
|
|
16070
16070
|
};
|
|
16071
16071
|
return emodeSettings;
|
|
16072
16072
|
}
|
|
16073
|
-
function parseBankRaw(address, accountParsed, bankMetadata
|
|
16073
|
+
function parseBankRaw(address, accountParsed, bankMetadata) {
|
|
16074
16074
|
const flags = accountParsed.flags.toNumber();
|
|
16075
16075
|
const mint = accountParsed.mint;
|
|
16076
16076
|
const mintDecimals = accountParsed.mintDecimals;
|
|
@@ -16169,8 +16169,6 @@ function parseBankRaw(address, accountParsed, bankMetadata, mintData) {
|
|
|
16169
16169
|
borrowingPositionCount,
|
|
16170
16170
|
emode,
|
|
16171
16171
|
tokenSymbol,
|
|
16172
|
-
mintRate: mintData?.mintRate ?? null,
|
|
16173
|
-
mintPrice: mintData?.mintPrice ?? 0,
|
|
16174
16172
|
kaminoIntegrationAccounts,
|
|
16175
16173
|
driftIntegrationAccounts,
|
|
16176
16174
|
solendIntegrationAccounts,
|
|
@@ -16211,9 +16209,6 @@ function dtoToBank(bankDto) {
|
|
|
16211
16209
|
feesDestinationAccount: bankDto.feesDestinationAccount ? new web3_js.PublicKey(bankDto.feesDestinationAccount) : void 0,
|
|
16212
16210
|
lendingPositionCount: bankDto.lendingPositionCount ? new BigNumber3__default.default(bankDto.lendingPositionCount) : void 0,
|
|
16213
16211
|
borrowingPositionCount: bankDto.borrowingPositionCount ? new BigNumber3__default.default(bankDto.borrowingPositionCount) : void 0,
|
|
16214
|
-
mintRate: null,
|
|
16215
|
-
// TODO: move these out
|
|
16216
|
-
mintPrice: 0,
|
|
16217
16212
|
kaminoIntegrationAccounts: bankDto.kaminoIntegrationAccounts ? {
|
|
16218
16213
|
kaminoReserve: new web3_js.PublicKey(bankDto.kaminoIntegrationAccounts.kaminoReserve),
|
|
16219
16214
|
kaminoObligation: new web3_js.PublicKey(bankDto.kaminoIntegrationAccounts.kaminoObligation)
|
|
@@ -43825,7 +43820,7 @@ var SEED_RESERVE = "reserve";
|
|
|
43825
43820
|
var SEED_RATE_MODEL = "rate_model";
|
|
43826
43821
|
var SEED_USER_SUPPLY_POSITION = "user_supply_position";
|
|
43827
43822
|
var SEED_LENDING_REWARDS_RATE_MODEL = "lending_rewards_rate_model";
|
|
43828
|
-
function getAllDerivedJupLendAccounts(mint) {
|
|
43823
|
+
function getAllDerivedJupLendAccounts(mint, tokenProgram) {
|
|
43829
43824
|
const [fTokenMint] = deriveJupLendFTokenMint(mint);
|
|
43830
43825
|
const [lending] = deriveJupLendLending(mint, fTokenMint);
|
|
43831
43826
|
const [liquidity] = deriveJupLendLiquidity();
|
|
@@ -43835,7 +43830,7 @@ function getAllDerivedJupLendAccounts(mint) {
|
|
|
43835
43830
|
supplyTokenReservesLiquidity: deriveJupLendTokenReserve(mint)[0],
|
|
43836
43831
|
lendingSupplyPositionOnLiquidity: deriveJupLendLiquiditySupplyPositionPda(mint, lending)[0],
|
|
43837
43832
|
rateModel: deriveJupLendRateModel(mint)[0],
|
|
43838
|
-
vault: deriveJupLendLiquidityVaultAta(mint, liquidity),
|
|
43833
|
+
vault: deriveJupLendLiquidityVaultAta(mint, liquidity, tokenProgram),
|
|
43839
43834
|
liquidity,
|
|
43840
43835
|
rewardsRateModel: deriveJupLendLendingRewardsRateModel(mint)[0]
|
|
43841
43836
|
};
|
|
@@ -45575,7 +45570,7 @@ async function makeJuplendWithdrawIx2({
|
|
|
45575
45570
|
lendingAdmin,
|
|
45576
45571
|
rateModel,
|
|
45577
45572
|
vault,
|
|
45578
|
-
liquidity} = getAllDerivedJupLendAccounts(bank.mint);
|
|
45573
|
+
liquidity} = getAllDerivedJupLendAccounts(bank.mint, tokenProgram);
|
|
45579
45574
|
if (opts.observationBanksOverride) {
|
|
45580
45575
|
remainingAccounts.push(...opts.observationBanksOverride);
|
|
45581
45576
|
} else {
|
|
@@ -46198,7 +46193,7 @@ async function makeJuplendDepositIx2({
|
|
|
46198
46193
|
if (!bank.jupLendIntegrationAccounts) {
|
|
46199
46194
|
throw new Error("Bank has no JupLend integration accounts");
|
|
46200
46195
|
}
|
|
46201
|
-
const derivedAccounts = getAllDerivedJupLendAccounts(bank.mint);
|
|
46196
|
+
const derivedAccounts = getAllDerivedJupLendAccounts(bank.mint, tokenProgram);
|
|
46202
46197
|
const {
|
|
46203
46198
|
fTokenMint,
|
|
46204
46199
|
lendingAdmin,
|
|
@@ -50887,13 +50882,11 @@ async function fetchBankIntegrationMetadata(options) {
|
|
|
50887
50882
|
return bankIntegrationMap;
|
|
50888
50883
|
}
|
|
50889
50884
|
var Bank = class _Bank {
|
|
50890
|
-
constructor(address, mint, mintDecimals, group,
|
|
50885
|
+
constructor(address, mint, mintDecimals, group, assetShareValue, liabilityShareValue, liquidityVault, liquidityVaultBump, liquidityVaultAuthorityBump, insuranceVault, insuranceVaultBump, insuranceVaultAuthorityBump, collectedInsuranceFeesOutstanding, feeVault, feeVaultBump, feeVaultAuthorityBump, collectedGroupFeesOutstanding, lastUpdate, config, totalAssetShares, totalLiabilityShares, emissionsActiveBorrowing, emissionsActiveLending, emissionsRate, emissionsMint, emissionsRemaining, oracleKey, emode, kaminoIntegrationAccounts, driftIntegrationAccounts, solendIntegrationAccounts, jupLendIntegrationAccounts, feesDestinationAccount, lendingPositionCount, borrowingPositionCount, tokenSymbol) {
|
|
50891
50886
|
this.address = address;
|
|
50892
50887
|
this.mint = mint;
|
|
50893
50888
|
this.mintDecimals = mintDecimals;
|
|
50894
50889
|
this.group = group;
|
|
50895
|
-
this.mintRate = mintRate;
|
|
50896
|
-
this.mintPrice = mintPrice;
|
|
50897
50890
|
this.assetShareValue = assetShareValue;
|
|
50898
50891
|
this.liabilityShareValue = liabilityShareValue;
|
|
50899
50892
|
this.liquidityVault = liquidityVault;
|
|
@@ -50963,8 +50956,6 @@ var Bank = class _Bank {
|
|
|
50963
50956
|
bankType.mint,
|
|
50964
50957
|
bankType.mintDecimals,
|
|
50965
50958
|
bankType.group,
|
|
50966
|
-
bankType.mintRate,
|
|
50967
|
-
bankType.mintPrice,
|
|
50968
50959
|
bankType.assetShareValue,
|
|
50969
50960
|
bankType.liabilityShareValue,
|
|
50970
50961
|
bankType.liquidityVault,
|
|
@@ -51006,8 +50997,6 @@ var Bank = class _Bank {
|
|
|
51006
50997
|
props.mint,
|
|
51007
50998
|
props.mintDecimals,
|
|
51008
50999
|
props.group,
|
|
51009
|
-
props.mintRate,
|
|
51010
|
-
props.mintPrice,
|
|
51011
51000
|
props.assetShareValue,
|
|
51012
51001
|
props.liabilityShareValue,
|
|
51013
51002
|
props.liquidityVault,
|