@0dotxyz/p0-ts-sdk 1.0.0-alpha.3 → 1.0.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/README.md +7 -3
- package/dist/{dto-farm.types-D9Q3c7Q7.d.cts → dto-farm.types-DvTDZThL.d.cts} +101 -101
- package/dist/{dto-farm.types-D9Q3c7Q7.d.ts → dto-farm.types-DvTDZThL.d.ts} +101 -101
- package/dist/index.cjs +140 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +139 -141
- package/dist/index.js.map +1 -1
- package/dist/vendor.cjs +115 -117
- 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 +111 -113
- package/dist/vendor.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
var web3_js = require('@solana/web3.js');
|
|
4
4
|
var superstruct = require('superstruct');
|
|
5
5
|
var BigNumber10 = require('bignumber.js');
|
|
6
|
-
var
|
|
6
|
+
var BN9 = require('bn.js');
|
|
7
7
|
var decimal_js = require('decimal.js');
|
|
8
|
+
var anchor = require('@coral-xyz/anchor');
|
|
8
9
|
var bufferLayout = require('@solana/buffer-layout');
|
|
9
10
|
var bufferLayoutUtils = require('@solana/buffer-layout-utils');
|
|
10
11
|
var buffer = require('buffer');
|
|
11
|
-
var BN10 = require('bn.js');
|
|
12
12
|
var borsh$1 = require('borsh');
|
|
13
13
|
var borsh = require('@coral-xyz/borsh');
|
|
14
14
|
var api = require('@jup-ag/api');
|
|
@@ -36,7 +36,7 @@ function _interopNamespace(e) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
var BigNumber10__default = /*#__PURE__*/_interopDefault(BigNumber10);
|
|
39
|
-
var
|
|
39
|
+
var BN9__default = /*#__PURE__*/_interopDefault(BN9);
|
|
40
40
|
var borsh__namespace = /*#__PURE__*/_interopNamespace(borsh);
|
|
41
41
|
|
|
42
42
|
// src/config.ts
|
|
@@ -351,7 +351,7 @@ function bigNumberToWrappedI80F48(value) {
|
|
|
351
351
|
let decimalValue = new decimal_js.Decimal(value.toString());
|
|
352
352
|
const isNegative = decimalValue.isNegative();
|
|
353
353
|
decimalValue = decimalValue.times(I80F48_DIVISOR);
|
|
354
|
-
let wrappedValue = new
|
|
354
|
+
let wrappedValue = new BN9__default.default(decimalValue.round().toFixed()).toArray();
|
|
355
355
|
if (wrappedValue.length < I80F48_TOTAL_BYTES) {
|
|
356
356
|
const padding = Array(I80F48_TOTAL_BYTES - wrappedValue.length).fill(0);
|
|
357
357
|
wrappedValue.unshift(...padding);
|
|
@@ -385,7 +385,7 @@ function toBigNumber(amount) {
|
|
|
385
385
|
}
|
|
386
386
|
function uiToNative(amount, decimals) {
|
|
387
387
|
let amt = toBigNumber(amount);
|
|
388
|
-
return new
|
|
388
|
+
return new BN9__default.default(amt.times(10 ** decimals).toFixed(0, BigNumber10__default.default.ROUND_FLOOR));
|
|
389
389
|
}
|
|
390
390
|
function uiToNativeBigNumber(amount, decimals) {
|
|
391
391
|
let amt = toBigNumber(amount);
|
|
@@ -10816,7 +10816,7 @@ async function makePoolAddPermissionlessStakedBankIx(mfProgram, accounts, remain
|
|
|
10816
10816
|
tokenProgram = TOKEN_PROGRAM_ID,
|
|
10817
10817
|
...optionalAccounts
|
|
10818
10818
|
} = accounts;
|
|
10819
|
-
return mfProgram.methods.lendingPoolAddBankPermissionless(args.seed ?? new
|
|
10819
|
+
return mfProgram.methods.lendingPoolAddBankPermissionless(args.seed ?? new BN9__default.default(0)).accounts({
|
|
10820
10820
|
stakedSettings,
|
|
10821
10821
|
feePayer,
|
|
10822
10822
|
bankMint,
|
|
@@ -10958,7 +10958,7 @@ var BankVaultType = /* @__PURE__ */ ((BankVaultType2) => {
|
|
|
10958
10958
|
// src/services/bank/utils/serialize.utils.ts
|
|
10959
10959
|
function serializeBankConfigOpt(bankConfigOpt) {
|
|
10960
10960
|
const toWrappedI80F48 = (value) => value && bigNumberToWrappedI80F48(value);
|
|
10961
|
-
const toBN = (value) => value && new
|
|
10961
|
+
const toBN = (value) => value && new BN9__default.default(value.toString());
|
|
10962
10962
|
return {
|
|
10963
10963
|
assetWeightInit: toWrappedI80F48(bankConfigOpt.assetWeightInit),
|
|
10964
10964
|
assetWeightMaint: toWrappedI80F48(bankConfigOpt.assetWeightMaint),
|
|
@@ -11224,16 +11224,16 @@ function bankConfigToBankConfigRaw(config) {
|
|
|
11224
11224
|
assetWeightMaint: bigNumberToWrappedI80F48(config.assetWeightMaint),
|
|
11225
11225
|
liabilityWeightInit: bigNumberToWrappedI80F48(config.liabilityWeightInit),
|
|
11226
11226
|
liabilityWeightMaint: bigNumberToWrappedI80F48(config.liabilityWeightMaint),
|
|
11227
|
-
depositLimit: new
|
|
11227
|
+
depositLimit: new BN9__default.default(config.depositLimit.toString()),
|
|
11228
11228
|
interestRateConfig: serializeInterestRateConfig(config.interestRateConfig),
|
|
11229
11229
|
operationalState: serializeOperationalState(config.operationalState),
|
|
11230
11230
|
oracleSetup: serializeOracleSetup(config.oracleSetup),
|
|
11231
11231
|
oracleKeys: config.oracleKeys,
|
|
11232
11232
|
configFlags: config.configFlags,
|
|
11233
|
-
borrowLimit: new
|
|
11233
|
+
borrowLimit: new BN9__default.default(config.borrowLimit.toString()),
|
|
11234
11234
|
riskTier: serializeRiskTier(config.riskTier),
|
|
11235
11235
|
assetTag: config.assetTag,
|
|
11236
|
-
totalAssetValueInitLimit: new
|
|
11236
|
+
totalAssetValueInitLimit: new BN9__default.default(config.totalAssetValueInitLimit.toString()),
|
|
11237
11237
|
oracleMaxAge: config.oracleMaxAge,
|
|
11238
11238
|
oracleMaxConfidence: config.oracleMaxConfidence,
|
|
11239
11239
|
fixedPrice: bigNumberToWrappedI80F48(config.fixedPrice)
|
|
@@ -11483,12 +11483,12 @@ function dtoToBankRaw(bankDto) {
|
|
|
11483
11483
|
feeVaultBump: bankDto.feeVaultBump,
|
|
11484
11484
|
feeVaultAuthorityBump: bankDto.feeVaultAuthorityBump,
|
|
11485
11485
|
collectedGroupFeesOutstanding: bankDto.collectedGroupFeesOutstanding,
|
|
11486
|
-
lastUpdate: new
|
|
11486
|
+
lastUpdate: new BN9__default.default(bankDto.lastUpdate),
|
|
11487
11487
|
config: dtoToBankConfigRaw(bankDto.config),
|
|
11488
11488
|
totalAssetShares: bankDto.totalAssetShares,
|
|
11489
11489
|
totalLiabilityShares: bankDto.totalLiabilityShares,
|
|
11490
|
-
flags: new
|
|
11491
|
-
emissionsRate: new
|
|
11490
|
+
flags: new BN9__default.default(bankDto.flags),
|
|
11491
|
+
emissionsRate: new BN9__default.default(bankDto.emissionsRate),
|
|
11492
11492
|
emissionsRemaining: bankDto.emissionsRemaining,
|
|
11493
11493
|
emissionsMint: new web3_js.PublicKey(bankDto.emissionsMint),
|
|
11494
11494
|
feesDestinationAccount: bankDto.feesDestinationAccount ? new web3_js.PublicKey(bankDto.feesDestinationAccount) : void 0,
|
|
@@ -11502,8 +11502,8 @@ function dtoToBankRaw(bankDto) {
|
|
|
11502
11502
|
function dtoToEmodeSettingsRaw(emodeSettingsDto) {
|
|
11503
11503
|
return {
|
|
11504
11504
|
emodeTag: emodeSettingsDto.emodeTag,
|
|
11505
|
-
timestamp: new
|
|
11506
|
-
flags: new
|
|
11505
|
+
timestamp: new BN9__default.default(emodeSettingsDto.timestamp),
|
|
11506
|
+
flags: new BN9__default.default(emodeSettingsDto.flags),
|
|
11507
11507
|
emodeConfig: {
|
|
11508
11508
|
entries: emodeSettingsDto.emodeConfig.entries.map((entry) => {
|
|
11509
11509
|
return {
|
|
@@ -11522,11 +11522,11 @@ function dtoToBankConfigRaw(bankConfigDto) {
|
|
|
11522
11522
|
assetWeightMaint: bankConfigDto.assetWeightMaint,
|
|
11523
11523
|
liabilityWeightInit: bankConfigDto.liabilityWeightInit,
|
|
11524
11524
|
liabilityWeightMaint: bankConfigDto.liabilityWeightMaint,
|
|
11525
|
-
depositLimit: new
|
|
11526
|
-
borrowLimit: new
|
|
11525
|
+
depositLimit: new BN9__default.default(bankConfigDto.depositLimit),
|
|
11526
|
+
borrowLimit: new BN9__default.default(bankConfigDto.borrowLimit),
|
|
11527
11527
|
riskTier: bankConfigDto.riskTier,
|
|
11528
11528
|
operationalState: bankConfigDto.operationalState,
|
|
11529
|
-
totalAssetValueInitLimit: new
|
|
11529
|
+
totalAssetValueInitLimit: new BN9__default.default(bankConfigDto.totalAssetValueInitLimit),
|
|
11530
11530
|
assetTag: bankConfigDto.assetTag,
|
|
11531
11531
|
configFlags: bankConfigDto.configFlags,
|
|
11532
11532
|
oracleSetup: bankConfigDto.oracleSetup,
|
|
@@ -11656,7 +11656,7 @@ function getActiveEmodeFlags(flags) {
|
|
|
11656
11656
|
return activeFlags;
|
|
11657
11657
|
}
|
|
11658
11658
|
function hasEmodeFlag(flags, flag) {
|
|
11659
|
-
return !flags.and(new
|
|
11659
|
+
return !flags.and(new BN9__default.default(flag)).isZero();
|
|
11660
11660
|
}
|
|
11661
11661
|
function getActiveEmodeEntryFlags(flags) {
|
|
11662
11662
|
const activeFlags = [];
|
|
@@ -14583,9 +14583,7 @@ var idl_default = {
|
|
|
14583
14583
|
|
|
14584
14584
|
// src/vendor/switchboard_pull/index.ts
|
|
14585
14585
|
var SWITCHBOARD_ONDEMANDE_PRICE_PRECISION = 18;
|
|
14586
|
-
var switchboardAccountCoder = new anchor.BorshCoder(
|
|
14587
|
-
idl_default
|
|
14588
|
-
);
|
|
14586
|
+
var switchboardAccountCoder = new anchor.BorshCoder(idl_default);
|
|
14589
14587
|
function decodeSwitchboardPullFeedData(data) {
|
|
14590
14588
|
const pullFeedDAta = switchboardAccountCoder.accounts.decode(
|
|
14591
14589
|
"PullFeedAccountData",
|
|
@@ -14611,8 +14609,8 @@ var mapSwbBanksToOraclePrices = (banks, swbOracleAiDataByKey, crossbarResponse)
|
|
|
14611
14609
|
const crossbarData = crossbarResponse[oracleFeed]?.results;
|
|
14612
14610
|
const timestamp = (/* @__PURE__ */ new Date()).getTime().toString();
|
|
14613
14611
|
const oraclePrice = parseSwbOraclePriceData(
|
|
14614
|
-
crossbarData ?? new
|
|
14615
|
-
new
|
|
14612
|
+
crossbarData ?? new BN9__default.default(oracleData.rawPrice),
|
|
14613
|
+
new BN9__default.default(oracleData.stdev),
|
|
14616
14614
|
timestamp,
|
|
14617
14615
|
oracleData
|
|
14618
14616
|
);
|
|
@@ -14638,7 +14636,7 @@ var mapBrokenFeedsToOraclePrices = (banks, swbOracleAiDataByKey, birdeyeResponse
|
|
|
14638
14636
|
const timestamp = (/* @__PURE__ */ new Date()).getTime().toString();
|
|
14639
14637
|
const oraclePrice = parseSwbOraclePriceData(
|
|
14640
14638
|
[birdeyeData],
|
|
14641
|
-
new
|
|
14639
|
+
new BN9__default.default(oracleData.stdev),
|
|
14642
14640
|
timestamp,
|
|
14643
14641
|
oracleData
|
|
14644
14642
|
);
|
|
@@ -15200,7 +15198,7 @@ var EMPTY_HEALTH_CACHE = {
|
|
|
15200
15198
|
liabilityValue: {
|
|
15201
15199
|
value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
15202
15200
|
},
|
|
15203
|
-
timestamp: new
|
|
15201
|
+
timestamp: new BN9__default.default(0),
|
|
15204
15202
|
flags: 0,
|
|
15205
15203
|
prices: [],
|
|
15206
15204
|
assetValueMaint: bigNumberToWrappedI80F48(new BigNumber10__default.default(0)),
|
|
@@ -15287,7 +15285,7 @@ function getActiveAccountFlags(flags) {
|
|
|
15287
15285
|
return activeFlags;
|
|
15288
15286
|
}
|
|
15289
15287
|
function hasAccountFlag(flags, flag) {
|
|
15290
|
-
return !flags.and(new
|
|
15288
|
+
return !flags.and(new BN9__default.default(flag)).isZero();
|
|
15291
15289
|
}
|
|
15292
15290
|
function getActiveHealthCacheFlags(flags) {
|
|
15293
15291
|
const activeFlags = [];
|
|
@@ -15357,7 +15355,7 @@ function dtoToHealthCache(healthCacheDto) {
|
|
|
15357
15355
|
};
|
|
15358
15356
|
}
|
|
15359
15357
|
function accountFlagToBN(flag) {
|
|
15360
|
-
return new
|
|
15358
|
+
return new BN9__default.default(flag);
|
|
15361
15359
|
}
|
|
15362
15360
|
function marginfiAccountToDto(marginfiAccount) {
|
|
15363
15361
|
return {
|
|
@@ -16509,7 +16507,7 @@ function generateDummyAccount(group, authority, accountKey) {
|
|
|
16509
16507
|
assetShares: dummyWrappedI80F48,
|
|
16510
16508
|
liabilityShares: dummyWrappedI80F48,
|
|
16511
16509
|
emissionsOutstanding: dummyWrappedI80F48,
|
|
16512
|
-
lastUpdate: new
|
|
16510
|
+
lastUpdate: new BN9__default.default(0)
|
|
16513
16511
|
});
|
|
16514
16512
|
const rawAccount = {
|
|
16515
16513
|
group,
|
|
@@ -16522,7 +16520,7 @@ function generateDummyAccount(group, authority, accountKey) {
|
|
|
16522
16520
|
liabilityValue: {
|
|
16523
16521
|
value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
16524
16522
|
},
|
|
16525
|
-
timestamp: new
|
|
16523
|
+
timestamp: new BN9__default.default(0),
|
|
16526
16524
|
flags: 0,
|
|
16527
16525
|
prices: [],
|
|
16528
16526
|
assetValueMaint: bigNumberToWrappedI80F48(new BigNumber10__default.default(0)),
|
|
@@ -16536,7 +16534,7 @@ function generateDummyAccount(group, authority, accountKey) {
|
|
|
16536
16534
|
mrgnErr: 0
|
|
16537
16535
|
},
|
|
16538
16536
|
emissionsDestinationAccount: new web3_js.PublicKey("11111111111111111111111111111111"),
|
|
16539
|
-
accountFlags: new
|
|
16537
|
+
accountFlags: new BN9__default.default([0, 0, 0])
|
|
16540
16538
|
};
|
|
16541
16539
|
return parseMarginfiAccountRaw(accountKey, rawAccount);
|
|
16542
16540
|
}
|
|
@@ -23295,9 +23293,9 @@ function decodeKlendObligationData(data) {
|
|
|
23295
23293
|
}
|
|
23296
23294
|
function dtoToObligationRaw(obligationDto) {
|
|
23297
23295
|
return {
|
|
23298
|
-
tag: new
|
|
23296
|
+
tag: new BN9__default.default(obligationDto.tag),
|
|
23299
23297
|
lastUpdate: {
|
|
23300
|
-
slot: new
|
|
23298
|
+
slot: new BN9__default.default(obligationDto.lastUpdate.slot),
|
|
23301
23299
|
stale: obligationDto.lastUpdate.stale,
|
|
23302
23300
|
priceStatus: obligationDto.lastUpdate.priceStatus,
|
|
23303
23301
|
placeholder: obligationDto.lastUpdate.placeholder
|
|
@@ -23307,21 +23305,21 @@ function dtoToObligationRaw(obligationDto) {
|
|
|
23307
23305
|
deposits: obligationDto.deposits.map(
|
|
23308
23306
|
(item) => dtoToObligationCollateralFields(item)
|
|
23309
23307
|
),
|
|
23310
|
-
lowestReserveDepositLiquidationLtv: new
|
|
23308
|
+
lowestReserveDepositLiquidationLtv: new BN9__default.default(
|
|
23311
23309
|
obligationDto.lowestReserveDepositLiquidationLtv
|
|
23312
23310
|
),
|
|
23313
|
-
depositedValueSf: new
|
|
23311
|
+
depositedValueSf: new BN9__default.default(obligationDto.depositedValueSf),
|
|
23314
23312
|
borrows: obligationDto.borrows.map(
|
|
23315
23313
|
(item) => dtoToObligationLiquidityFields(item)
|
|
23316
23314
|
),
|
|
23317
|
-
borrowFactorAdjustedDebtValueSf: new
|
|
23315
|
+
borrowFactorAdjustedDebtValueSf: new BN9__default.default(
|
|
23318
23316
|
obligationDto.borrowFactorAdjustedDebtValueSf
|
|
23319
23317
|
),
|
|
23320
|
-
borrowedAssetsMarketValueSf: new
|
|
23318
|
+
borrowedAssetsMarketValueSf: new BN9__default.default(
|
|
23321
23319
|
obligationDto.borrowedAssetsMarketValueSf
|
|
23322
23320
|
),
|
|
23323
|
-
allowedBorrowValueSf: new
|
|
23324
|
-
unhealthyBorrowValueSf: new
|
|
23321
|
+
allowedBorrowValueSf: new BN9__default.default(obligationDto.allowedBorrowValueSf),
|
|
23322
|
+
unhealthyBorrowValueSf: new BN9__default.default(obligationDto.unhealthyBorrowValueSf),
|
|
23325
23323
|
depositsAssetTiers: obligationDto.depositsAssetTiers,
|
|
23326
23324
|
borrowsAssetTiers: obligationDto.borrowsAssetTiers,
|
|
23327
23325
|
elevationGroup: obligationDto.elevationGroup,
|
|
@@ -23333,21 +23331,21 @@ function dtoToObligationRaw(obligationDto) {
|
|
|
23333
23331
|
lowestReserveDepositMaxLtvPct: obligationDto.lowestReserveDepositMaxLtvPct,
|
|
23334
23332
|
numOfObsoleteBorrowReserves: obligationDto.numOfObsoleteBorrowReserves,
|
|
23335
23333
|
reserved: obligationDto.reserved,
|
|
23336
|
-
highestBorrowFactorPct: new
|
|
23337
|
-
autodeleverageMarginCallStartedTimestamp: new
|
|
23334
|
+
highestBorrowFactorPct: new BN9__default.default(obligationDto.highestBorrowFactorPct),
|
|
23335
|
+
autodeleverageMarginCallStartedTimestamp: new BN9__default.default(
|
|
23338
23336
|
obligationDto.autodeleverageMarginCallStartedTimestamp
|
|
23339
23337
|
),
|
|
23340
23338
|
orders: obligationDto.orders.map(
|
|
23341
23339
|
(item) => dtoToObligationOrderFields(item)
|
|
23342
23340
|
),
|
|
23343
|
-
padding3: obligationDto.padding3.map((item) => new
|
|
23341
|
+
padding3: obligationDto.padding3.map((item) => new BN9__default.default(item))
|
|
23344
23342
|
};
|
|
23345
23343
|
}
|
|
23346
23344
|
function dtoToReserveRaw(reserveDto) {
|
|
23347
23345
|
return {
|
|
23348
|
-
version: new
|
|
23346
|
+
version: new BN9__default.default(reserveDto.version),
|
|
23349
23347
|
lastUpdate: {
|
|
23350
|
-
slot: new
|
|
23348
|
+
slot: new BN9__default.default(reserveDto.lastUpdate.slot),
|
|
23351
23349
|
stale: reserveDto.lastUpdate.stale,
|
|
23352
23350
|
priceStatus: reserveDto.lastUpdate.priceStatus,
|
|
23353
23351
|
placeholder: reserveDto.lastUpdate.placeholder
|
|
@@ -23357,27 +23355,27 @@ function dtoToReserveRaw(reserveDto) {
|
|
|
23357
23355
|
farmDebt: new web3_js.PublicKey(reserveDto.farmDebt),
|
|
23358
23356
|
liquidity: dtoToReserveLiquidityFields(reserveDto.liquidity),
|
|
23359
23357
|
reserveLiquidityPadding: reserveDto.reserveLiquidityPadding.map(
|
|
23360
|
-
(item) => new
|
|
23358
|
+
(item) => new BN9__default.default(item)
|
|
23361
23359
|
),
|
|
23362
23360
|
collateral: {
|
|
23363
23361
|
mintPubkey: new web3_js.PublicKey(reserveDto.collateral.mintPubkey),
|
|
23364
|
-
mintTotalSupply: new
|
|
23362
|
+
mintTotalSupply: new BN9__default.default(reserveDto.collateral.mintTotalSupply),
|
|
23365
23363
|
supplyVault: new web3_js.PublicKey(reserveDto.collateral.supplyVault),
|
|
23366
|
-
padding1: reserveDto.collateral.padding1.map((item) => new
|
|
23367
|
-
padding2: reserveDto.collateral.padding2.map((item) => new
|
|
23364
|
+
padding1: reserveDto.collateral.padding1.map((item) => new BN9__default.default(item)),
|
|
23365
|
+
padding2: reserveDto.collateral.padding2.map((item) => new BN9__default.default(item))
|
|
23368
23366
|
},
|
|
23369
23367
|
reserveCollateralPadding: reserveDto.reserveCollateralPadding.map(
|
|
23370
|
-
(item) => new
|
|
23368
|
+
(item) => new BN9__default.default(item)
|
|
23371
23369
|
),
|
|
23372
23370
|
config: dtoToReserveConfigFields(reserveDto.config),
|
|
23373
|
-
configPadding: reserveDto.configPadding.map((item) => new
|
|
23374
|
-
borrowedAmountOutsideElevationGroup: new
|
|
23371
|
+
configPadding: reserveDto.configPadding.map((item) => new BN9__default.default(item)),
|
|
23372
|
+
borrowedAmountOutsideElevationGroup: new BN9__default.default(
|
|
23375
23373
|
reserveDto.borrowedAmountOutsideElevationGroup
|
|
23376
23374
|
),
|
|
23377
23375
|
borrowedAmountsAgainstThisReserveInElevationGroups: reserveDto.borrowedAmountsAgainstThisReserveInElevationGroups.map(
|
|
23378
|
-
(item) => new
|
|
23376
|
+
(item) => new BN9__default.default(item)
|
|
23379
23377
|
),
|
|
23380
|
-
padding: reserveDto.padding.map((item) => new
|
|
23378
|
+
padding: reserveDto.padding.map((item) => new BN9__default.default(item))
|
|
23381
23379
|
};
|
|
23382
23380
|
}
|
|
23383
23381
|
function dtoToReserveLiquidityFields(reserveDto) {
|
|
@@ -23385,30 +23383,30 @@ function dtoToReserveLiquidityFields(reserveDto) {
|
|
|
23385
23383
|
mintPubkey: new web3_js.PublicKey(reserveDto.mintPubkey),
|
|
23386
23384
|
supplyVault: new web3_js.PublicKey(reserveDto.supplyVault),
|
|
23387
23385
|
feeVault: new web3_js.PublicKey(reserveDto.feeVault),
|
|
23388
|
-
availableAmount: new
|
|
23389
|
-
borrowedAmountSf: new
|
|
23390
|
-
marketPriceSf: new
|
|
23391
|
-
marketPriceLastUpdatedTs: new
|
|
23392
|
-
mintDecimals: new
|
|
23393
|
-
depositLimitCrossedTimestamp: new
|
|
23386
|
+
availableAmount: new BN9__default.default(reserveDto.availableAmount),
|
|
23387
|
+
borrowedAmountSf: new BN9__default.default(reserveDto.borrowedAmountSf),
|
|
23388
|
+
marketPriceSf: new BN9__default.default(reserveDto.marketPriceSf),
|
|
23389
|
+
marketPriceLastUpdatedTs: new BN9__default.default(reserveDto.marketPriceLastUpdatedTs),
|
|
23390
|
+
mintDecimals: new BN9__default.default(reserveDto.mintDecimals),
|
|
23391
|
+
depositLimitCrossedTimestamp: new BN9__default.default(
|
|
23394
23392
|
reserveDto.depositLimitCrossedTimestamp
|
|
23395
23393
|
),
|
|
23396
|
-
borrowLimitCrossedTimestamp: new
|
|
23394
|
+
borrowLimitCrossedTimestamp: new BN9__default.default(reserveDto.borrowLimitCrossedTimestamp),
|
|
23397
23395
|
cumulativeBorrowRateBsf: {
|
|
23398
23396
|
value: reserveDto.cumulativeBorrowRateBsf.value.map(
|
|
23399
|
-
(item) => new
|
|
23397
|
+
(item) => new BN9__default.default(item)
|
|
23400
23398
|
),
|
|
23401
23399
|
padding: reserveDto.cumulativeBorrowRateBsf.padding.map(
|
|
23402
|
-
(item) => new
|
|
23400
|
+
(item) => new BN9__default.default(item)
|
|
23403
23401
|
)
|
|
23404
23402
|
},
|
|
23405
|
-
accumulatedProtocolFeesSf: new
|
|
23406
|
-
accumulatedReferrerFeesSf: new
|
|
23407
|
-
pendingReferrerFeesSf: new
|
|
23408
|
-
absoluteReferralRateSf: new
|
|
23403
|
+
accumulatedProtocolFeesSf: new BN9__default.default(reserveDto.accumulatedProtocolFeesSf),
|
|
23404
|
+
accumulatedReferrerFeesSf: new BN9__default.default(reserveDto.accumulatedReferrerFeesSf),
|
|
23405
|
+
pendingReferrerFeesSf: new BN9__default.default(reserveDto.pendingReferrerFeesSf),
|
|
23406
|
+
absoluteReferralRateSf: new BN9__default.default(reserveDto.absoluteReferralRateSf),
|
|
23409
23407
|
tokenProgram: new web3_js.PublicKey(reserveDto.tokenProgram),
|
|
23410
|
-
padding2: reserveDto.padding2.map((item) => new
|
|
23411
|
-
padding3: reserveDto.padding3.map((item) => new
|
|
23408
|
+
padding2: reserveDto.padding2.map((item) => new BN9__default.default(item)),
|
|
23409
|
+
padding3: reserveDto.padding3.map((item) => new BN9__default.default(item))
|
|
23412
23410
|
};
|
|
23413
23411
|
}
|
|
23414
23412
|
function dtoToReserveConfigFields(reserveDto) {
|
|
@@ -23425,15 +23423,15 @@ function dtoToReserveConfigFields(reserveDto) {
|
|
|
23425
23423
|
minLiquidationBonusBps: reserveDto.minLiquidationBonusBps,
|
|
23426
23424
|
maxLiquidationBonusBps: reserveDto.maxLiquidationBonusBps,
|
|
23427
23425
|
badDebtLiquidationBonusBps: reserveDto.badDebtLiquidationBonusBps,
|
|
23428
|
-
deleveragingMarginCallPeriodSecs: new
|
|
23426
|
+
deleveragingMarginCallPeriodSecs: new BN9__default.default(
|
|
23429
23427
|
reserveDto.deleveragingMarginCallPeriodSecs
|
|
23430
23428
|
),
|
|
23431
|
-
deleveragingThresholdDecreaseBpsPerDay: new
|
|
23429
|
+
deleveragingThresholdDecreaseBpsPerDay: new BN9__default.default(
|
|
23432
23430
|
reserveDto.deleveragingThresholdDecreaseBpsPerDay
|
|
23433
23431
|
),
|
|
23434
23432
|
fees: {
|
|
23435
|
-
borrowFeeSf: new
|
|
23436
|
-
flashLoanFeeSf: new
|
|
23433
|
+
borrowFeeSf: new BN9__default.default(reserveDto.fees.borrowFeeSf),
|
|
23434
|
+
flashLoanFeeSf: new BN9__default.default(reserveDto.fees.flashLoanFeeSf),
|
|
23437
23435
|
padding: reserveDto.fees.padding
|
|
23438
23436
|
},
|
|
23439
23437
|
borrowRateCurve: {
|
|
@@ -23442,9 +23440,9 @@ function dtoToReserveConfigFields(reserveDto) {
|
|
|
23442
23440
|
borrowRateBps: item.borrowRateBps
|
|
23443
23441
|
}))
|
|
23444
23442
|
},
|
|
23445
|
-
borrowFactorPct: new
|
|
23446
|
-
depositLimit: new
|
|
23447
|
-
borrowLimit: new
|
|
23443
|
+
borrowFactorPct: new BN9__default.default(reserveDto.borrowFactorPct),
|
|
23444
|
+
depositLimit: new BN9__default.default(reserveDto.depositLimit),
|
|
23445
|
+
borrowLimit: new BN9__default.default(reserveDto.borrowLimit),
|
|
23448
23446
|
tokenInfo: dtoToTokenInfoFields(reserveDto.tokenInfo),
|
|
23449
23447
|
depositWithdrawalCap: dtoToWithdrawalCapsFields(
|
|
23450
23448
|
reserveDto.depositWithdrawalCap
|
|
@@ -23455,13 +23453,13 @@ function dtoToReserveConfigFields(reserveDto) {
|
|
|
23455
23453
|
utilizationLimitBlockBorrowingAbovePct: reserveDto.utilizationLimitBlockBorrowingAbovePct,
|
|
23456
23454
|
autodeleverageEnabled: reserveDto.autodeleverageEnabled,
|
|
23457
23455
|
reserved1: reserveDto.reserved1,
|
|
23458
|
-
borrowLimitOutsideElevationGroup: new
|
|
23456
|
+
borrowLimitOutsideElevationGroup: new BN9__default.default(
|
|
23459
23457
|
reserveDto.borrowLimitOutsideElevationGroup
|
|
23460
23458
|
),
|
|
23461
23459
|
borrowLimitAgainstThisCollateralInElevationGroup: reserveDto.borrowLimitAgainstThisCollateralInElevationGroup.map(
|
|
23462
|
-
(item) => new
|
|
23460
|
+
(item) => new BN9__default.default(item)
|
|
23463
23461
|
),
|
|
23464
|
-
deleveragingBonusIncreaseBpsPerDay: new
|
|
23462
|
+
deleveragingBonusIncreaseBpsPerDay: new BN9__default.default(
|
|
23465
23463
|
reserveDto.deleveragingBonusIncreaseBpsPerDay
|
|
23466
23464
|
)
|
|
23467
23465
|
};
|
|
@@ -23470,13 +23468,13 @@ function dtoToTokenInfoFields(tokenInfoDto) {
|
|
|
23470
23468
|
return {
|
|
23471
23469
|
name: tokenInfoDto.name,
|
|
23472
23470
|
heuristic: {
|
|
23473
|
-
lower: new
|
|
23474
|
-
upper: new
|
|
23475
|
-
exp: new
|
|
23471
|
+
lower: new BN9__default.default(tokenInfoDto.heuristic.lower),
|
|
23472
|
+
upper: new BN9__default.default(tokenInfoDto.heuristic.upper),
|
|
23473
|
+
exp: new BN9__default.default(tokenInfoDto.heuristic.exp)
|
|
23476
23474
|
},
|
|
23477
|
-
maxTwapDivergenceBps: new
|
|
23478
|
-
maxAgePriceSeconds: new
|
|
23479
|
-
maxAgeTwapSeconds: new
|
|
23475
|
+
maxTwapDivergenceBps: new BN9__default.default(tokenInfoDto.maxTwapDivergenceBps),
|
|
23476
|
+
maxAgePriceSeconds: new BN9__default.default(tokenInfoDto.maxAgePriceSeconds),
|
|
23477
|
+
maxAgeTwapSeconds: new BN9__default.default(tokenInfoDto.maxAgeTwapSeconds),
|
|
23480
23478
|
scopeConfiguration: {
|
|
23481
23479
|
priceFeed: new web3_js.PublicKey(tokenInfoDto.scopeConfiguration.priceFeed),
|
|
23482
23480
|
priceChain: tokenInfoDto.scopeConfiguration.priceChain,
|
|
@@ -23495,17 +23493,17 @@ function dtoToTokenInfoFields(tokenInfoDto) {
|
|
|
23495
23493
|
},
|
|
23496
23494
|
blockPriceUsage: tokenInfoDto.blockPriceUsage,
|
|
23497
23495
|
reserved: tokenInfoDto.reserved,
|
|
23498
|
-
padding: tokenInfoDto.padding.map((item) => new
|
|
23496
|
+
padding: tokenInfoDto.padding.map((item) => new BN9__default.default(item))
|
|
23499
23497
|
};
|
|
23500
23498
|
}
|
|
23501
23499
|
function dtoToWithdrawalCapsFields(withdrawalCapsDto) {
|
|
23502
23500
|
return {
|
|
23503
|
-
configCapacity: new
|
|
23504
|
-
currentTotal: new
|
|
23505
|
-
lastIntervalStartTimestamp: new
|
|
23501
|
+
configCapacity: new BN9__default.default(withdrawalCapsDto.configCapacity),
|
|
23502
|
+
currentTotal: new BN9__default.default(withdrawalCapsDto.currentTotal),
|
|
23503
|
+
lastIntervalStartTimestamp: new BN9__default.default(
|
|
23506
23504
|
withdrawalCapsDto.lastIntervalStartTimestamp
|
|
23507
23505
|
),
|
|
23508
|
-
configIntervalLengthSeconds: new
|
|
23506
|
+
configIntervalLengthSeconds: new BN9__default.default(
|
|
23509
23507
|
withdrawalCapsDto.configIntervalLengthSeconds
|
|
23510
23508
|
)
|
|
23511
23509
|
};
|
|
@@ -23513,12 +23511,12 @@ function dtoToWithdrawalCapsFields(withdrawalCapsDto) {
|
|
|
23513
23511
|
function dtoToObligationCollateralFields(obligationCollateralDto) {
|
|
23514
23512
|
return {
|
|
23515
23513
|
depositReserve: new web3_js.PublicKey(obligationCollateralDto.depositReserve),
|
|
23516
|
-
depositedAmount: new
|
|
23517
|
-
marketValueSf: new
|
|
23518
|
-
borrowedAmountAgainstThisCollateralInElevationGroup: new
|
|
23514
|
+
depositedAmount: new BN9__default.default(obligationCollateralDto.depositedAmount),
|
|
23515
|
+
marketValueSf: new BN9__default.default(obligationCollateralDto.marketValueSf),
|
|
23516
|
+
borrowedAmountAgainstThisCollateralInElevationGroup: new BN9__default.default(
|
|
23519
23517
|
obligationCollateralDto.borrowedAmountAgainstThisCollateralInElevationGroup
|
|
23520
23518
|
),
|
|
23521
|
-
padding: obligationCollateralDto.padding.map((item) => new
|
|
23519
|
+
padding: obligationCollateralDto.padding.map((item) => new BN9__default.default(item))
|
|
23522
23520
|
};
|
|
23523
23521
|
}
|
|
23524
23522
|
function dtoToObligationLiquidityFields(obligationLiquidityDto) {
|
|
@@ -23526,34 +23524,34 @@ function dtoToObligationLiquidityFields(obligationLiquidityDto) {
|
|
|
23526
23524
|
borrowReserve: new web3_js.PublicKey(obligationLiquidityDto.borrowReserve),
|
|
23527
23525
|
cumulativeBorrowRateBsf: {
|
|
23528
23526
|
value: obligationLiquidityDto.cumulativeBorrowRateBsf.value.map(
|
|
23529
|
-
(item) => new
|
|
23527
|
+
(item) => new BN9__default.default(item)
|
|
23530
23528
|
),
|
|
23531
23529
|
padding: obligationLiquidityDto.cumulativeBorrowRateBsf.padding.map(
|
|
23532
|
-
(item) => new
|
|
23530
|
+
(item) => new BN9__default.default(item)
|
|
23533
23531
|
)
|
|
23534
23532
|
},
|
|
23535
|
-
padding: new
|
|
23536
|
-
borrowedAmountSf: new
|
|
23537
|
-
marketValueSf: new
|
|
23538
|
-
borrowFactorAdjustedMarketValueSf: new
|
|
23533
|
+
padding: new BN9__default.default(obligationLiquidityDto.padding),
|
|
23534
|
+
borrowedAmountSf: new BN9__default.default(obligationLiquidityDto.borrowedAmountSf),
|
|
23535
|
+
marketValueSf: new BN9__default.default(obligationLiquidityDto.marketValueSf),
|
|
23536
|
+
borrowFactorAdjustedMarketValueSf: new BN9__default.default(
|
|
23539
23537
|
obligationLiquidityDto.borrowFactorAdjustedMarketValueSf
|
|
23540
23538
|
),
|
|
23541
|
-
borrowedAmountOutsideElevationGroups: new
|
|
23539
|
+
borrowedAmountOutsideElevationGroups: new BN9__default.default(
|
|
23542
23540
|
obligationLiquidityDto.borrowedAmountOutsideElevationGroups
|
|
23543
23541
|
),
|
|
23544
|
-
padding2: obligationLiquidityDto.padding2.map((item) => new
|
|
23542
|
+
padding2: obligationLiquidityDto.padding2.map((item) => new BN9__default.default(item))
|
|
23545
23543
|
};
|
|
23546
23544
|
}
|
|
23547
23545
|
function dtoToObligationOrderFields(obligationOrderDto) {
|
|
23548
23546
|
return {
|
|
23549
|
-
conditionThresholdSf: new
|
|
23550
|
-
opportunityParameterSf: new
|
|
23547
|
+
conditionThresholdSf: new BN9__default.default(obligationOrderDto.conditionThresholdSf),
|
|
23548
|
+
opportunityParameterSf: new BN9__default.default(obligationOrderDto.opportunityParameterSf),
|
|
23551
23549
|
minExecutionBonusBps: obligationOrderDto.minExecutionBonusBps,
|
|
23552
23550
|
maxExecutionBonusBps: obligationOrderDto.maxExecutionBonusBps,
|
|
23553
23551
|
conditionType: obligationOrderDto.conditionType,
|
|
23554
23552
|
opportunityType: obligationOrderDto.opportunityType,
|
|
23555
23553
|
padding1: obligationOrderDto.padding1,
|
|
23556
|
-
padding2: obligationOrderDto.padding2.map((item) => new
|
|
23554
|
+
padding2: obligationOrderDto.padding2.map((item) => new BN9__default.default(item))
|
|
23557
23555
|
};
|
|
23558
23556
|
}
|
|
23559
23557
|
var SEED_LENDING_MARKET_AUTH = "lma";
|
|
@@ -23806,42 +23804,42 @@ function dtoToFarmRaw(dto) {
|
|
|
23806
23804
|
globalConfig: new web3_js.PublicKey(dto.globalConfig),
|
|
23807
23805
|
token: {
|
|
23808
23806
|
mint: new web3_js.PublicKey(dto.token.mint),
|
|
23809
|
-
decimals: new
|
|
23807
|
+
decimals: new BN9__default.default(dto.token.decimals),
|
|
23810
23808
|
tokenProgram: new web3_js.PublicKey(dto.token.tokenProgram),
|
|
23811
|
-
padding: dto.token.padding.map((item) => new
|
|
23809
|
+
padding: dto.token.padding.map((item) => new BN9__default.default(item))
|
|
23812
23810
|
},
|
|
23813
23811
|
rewardInfos: dto.rewardInfos.map((item) => ({
|
|
23814
23812
|
token: {
|
|
23815
23813
|
mint: new web3_js.PublicKey(item.token.mint),
|
|
23816
|
-
decimals: new
|
|
23814
|
+
decimals: new BN9__default.default(item.token.decimals),
|
|
23817
23815
|
tokenProgram: new web3_js.PublicKey(item.token.tokenProgram),
|
|
23818
|
-
padding: item.token.padding.map((p) => new
|
|
23816
|
+
padding: item.token.padding.map((p) => new BN9__default.default(p))
|
|
23819
23817
|
},
|
|
23820
23818
|
rewardsVault: new web3_js.PublicKey(item.rewardsVault),
|
|
23821
|
-
rewardsAvailable: new
|
|
23819
|
+
rewardsAvailable: new BN9__default.default(item.rewardsAvailable),
|
|
23822
23820
|
rewardScheduleCurve: {
|
|
23823
23821
|
points: item.rewardScheduleCurve.points.map((p) => ({
|
|
23824
|
-
tsStart: new
|
|
23825
|
-
rewardPerTimeUnit: new
|
|
23822
|
+
tsStart: new BN9__default.default(p.tsStart),
|
|
23823
|
+
rewardPerTimeUnit: new BN9__default.default(p.rewardPerTimeUnit)
|
|
23826
23824
|
}))
|
|
23827
23825
|
},
|
|
23828
|
-
minClaimDurationSeconds: new
|
|
23829
|
-
lastIssuanceTs: new
|
|
23830
|
-
rewardsIssuedUnclaimed: new
|
|
23831
|
-
rewardsIssuedCumulative: new
|
|
23832
|
-
rewardPerShareScaled: new
|
|
23833
|
-
placeholder0: new
|
|
23826
|
+
minClaimDurationSeconds: new BN9__default.default(item.minClaimDurationSeconds),
|
|
23827
|
+
lastIssuanceTs: new BN9__default.default(item.lastIssuanceTs),
|
|
23828
|
+
rewardsIssuedUnclaimed: new BN9__default.default(item.rewardsIssuedUnclaimed),
|
|
23829
|
+
rewardsIssuedCumulative: new BN9__default.default(item.rewardsIssuedCumulative),
|
|
23830
|
+
rewardPerShareScaled: new BN9__default.default(item.rewardPerShareScaled),
|
|
23831
|
+
placeholder0: new BN9__default.default(item.placeholder0),
|
|
23834
23832
|
rewardType: item.rewardType,
|
|
23835
23833
|
rewardsPerSecondDecimals: item.rewardsPerSecondDecimals,
|
|
23836
23834
|
padding0: item.padding0,
|
|
23837
|
-
padding1: item.padding1.map((p) => new
|
|
23835
|
+
padding1: item.padding1.map((p) => new BN9__default.default(p))
|
|
23838
23836
|
})),
|
|
23839
|
-
numRewardTokens: new
|
|
23840
|
-
numUsers: new
|
|
23841
|
-
totalStakedAmount: new
|
|
23837
|
+
numRewardTokens: new BN9__default.default(dto.numRewardTokens),
|
|
23838
|
+
numUsers: new BN9__default.default(dto.numUsers),
|
|
23839
|
+
totalStakedAmount: new BN9__default.default(dto.totalStakedAmount),
|
|
23842
23840
|
farmVault: new web3_js.PublicKey(dto.farmVault),
|
|
23843
23841
|
farmVaultsAuthority: new web3_js.PublicKey(dto.farmVaultsAuthority),
|
|
23844
|
-
farmVaultsAuthorityBump: new
|
|
23842
|
+
farmVaultsAuthorityBump: new BN9__default.default(dto.farmVaultsAuthorityBump),
|
|
23845
23843
|
delegateAuthority: new web3_js.PublicKey(dto.delegateAuthority),
|
|
23846
23844
|
timeUnit: dto.timeUnit,
|
|
23847
23845
|
isFarmFrozen: dto.isFarmFrozen,
|
|
@@ -23850,28 +23848,28 @@ function dtoToFarmRaw(dto) {
|
|
|
23850
23848
|
withdrawAuthority: new web3_js.PublicKey(dto.withdrawAuthority),
|
|
23851
23849
|
depositWarmupPeriod: dto.depositWarmupPeriod,
|
|
23852
23850
|
withdrawalCooldownPeriod: dto.withdrawalCooldownPeriod,
|
|
23853
|
-
totalActiveStakeScaled: new
|
|
23854
|
-
totalPendingStakeScaled: new
|
|
23855
|
-
totalPendingAmount: new
|
|
23856
|
-
slashedAmountCurrent: new
|
|
23857
|
-
slashedAmountCumulative: new
|
|
23851
|
+
totalActiveStakeScaled: new BN9__default.default(dto.totalActiveStakeScaled),
|
|
23852
|
+
totalPendingStakeScaled: new BN9__default.default(dto.totalPendingStakeScaled),
|
|
23853
|
+
totalPendingAmount: new BN9__default.default(dto.totalPendingAmount),
|
|
23854
|
+
slashedAmountCurrent: new BN9__default.default(dto.slashedAmountCurrent),
|
|
23855
|
+
slashedAmountCumulative: new BN9__default.default(dto.slashedAmountCumulative),
|
|
23858
23856
|
slashedAmountSpillAddress: new web3_js.PublicKey(dto.slashedAmountSpillAddress),
|
|
23859
|
-
lockingMode: new
|
|
23860
|
-
lockingStartTimestamp: new
|
|
23861
|
-
lockingDuration: new
|
|
23862
|
-
lockingEarlyWithdrawalPenaltyBps: new
|
|
23857
|
+
lockingMode: new BN9__default.default(dto.lockingMode),
|
|
23858
|
+
lockingStartTimestamp: new BN9__default.default(dto.lockingStartTimestamp),
|
|
23859
|
+
lockingDuration: new BN9__default.default(dto.lockingDuration),
|
|
23860
|
+
lockingEarlyWithdrawalPenaltyBps: new BN9__default.default(
|
|
23863
23861
|
dto.lockingEarlyWithdrawalPenaltyBps
|
|
23864
23862
|
),
|
|
23865
|
-
depositCapAmount: new
|
|
23863
|
+
depositCapAmount: new BN9__default.default(dto.depositCapAmount),
|
|
23866
23864
|
scopePrices: new web3_js.PublicKey(dto.scopePrices),
|
|
23867
|
-
scopeOraclePriceId: new
|
|
23868
|
-
scopeOracleMaxAge: new
|
|
23865
|
+
scopeOraclePriceId: new BN9__default.default(dto.scopeOraclePriceId),
|
|
23866
|
+
scopeOracleMaxAge: new BN9__default.default(dto.scopeOracleMaxAge),
|
|
23869
23867
|
pendingFarmAdmin: new web3_js.PublicKey(dto.pendingFarmAdmin),
|
|
23870
23868
|
strategyId: new web3_js.PublicKey(dto.strategyId),
|
|
23871
23869
|
delegatedRpsAdmin: new web3_js.PublicKey(dto.delegatedRpsAdmin),
|
|
23872
23870
|
vaultId: new web3_js.PublicKey(dto.vaultId),
|
|
23873
23871
|
secondDelegatedAuthority: new web3_js.PublicKey(dto.secondDelegatedAuthority),
|
|
23874
|
-
padding: dto.padding.map((item) => new
|
|
23872
|
+
padding: dto.padding.map((item) => new BN9__default.default(item))
|
|
23875
23873
|
};
|
|
23876
23874
|
}
|
|
23877
23875
|
var KAMINO_PROGRAM_ID = new web3_js.PublicKey("KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD");
|
|
@@ -24437,7 +24435,7 @@ function makePoolAddPermissionlessStakedBankIx2(programId, accounts, remainingAc
|
|
|
24437
24435
|
keys.push(...remainingAccounts);
|
|
24438
24436
|
const data = Buffer.concat([
|
|
24439
24437
|
DISCRIMINATORS.LENDING_POOL_ADD_BANK_PERMISSIONLESS,
|
|
24440
|
-
encodeU64(args.seed || new
|
|
24438
|
+
encodeU64(args.seed || new BN9__default.default(0))
|
|
24441
24439
|
]);
|
|
24442
24440
|
return new web3_js.TransactionInstruction({
|
|
24443
24441
|
keys,
|
|
@@ -25145,14 +25143,14 @@ async function makeBeginFlashLoanIx3(program, marginfiAccountPk, endIndex, autho
|
|
|
25145
25143
|
marginfiAccount: marginfiAccountPk,
|
|
25146
25144
|
authority
|
|
25147
25145
|
},
|
|
25148
|
-
{ endIndex: new
|
|
25146
|
+
{ endIndex: new BN9__default.default(endIndex) }
|
|
25149
25147
|
) : await instructions_default.makeBeginFlashLoanIx(
|
|
25150
25148
|
program,
|
|
25151
25149
|
{
|
|
25152
25150
|
marginfiAccount: marginfiAccountPk,
|
|
25153
25151
|
authority
|
|
25154
25152
|
},
|
|
25155
|
-
{ endIndex: new
|
|
25153
|
+
{ endIndex: new BN9__default.default(endIndex) }
|
|
25156
25154
|
);
|
|
25157
25155
|
return { instructions: [ix], keys: [] };
|
|
25158
25156
|
}
|
|
@@ -26823,7 +26821,7 @@ async function makeUpdateSwbFeedIx(props) {
|
|
|
26823
26821
|
pullFeed.data = {
|
|
26824
26822
|
queue: new web3_js.PublicKey(swbData.queue),
|
|
26825
26823
|
feedHash: new Uint8Array(Buffer.from(swbData.feedHash, "hex")),
|
|
26826
|
-
maxVariance: new
|
|
26824
|
+
maxVariance: new BN9.BN(swbData.maxVariance),
|
|
26827
26825
|
minResponses: swbData.minResponses
|
|
26828
26826
|
};
|
|
26829
26827
|
}
|
|
@@ -27214,8 +27212,8 @@ var fetchSwbOracleData = async (banks, opts) => {
|
|
|
27214
27212
|
const brokenSwbFeeds = [];
|
|
27215
27213
|
Object.keys(swbOracleAiDataByKey).forEach((oracleKey) => {
|
|
27216
27214
|
const oracleAiData = swbOracleAiDataByKey[oracleKey];
|
|
27217
|
-
const rawPriceBN = new
|
|
27218
|
-
const isFeedBroken = rawPriceBN.isZero() || rawPriceBN.eq(new
|
|
27215
|
+
const rawPriceBN = new BN9__default.default(oracleAiData.rawPrice);
|
|
27216
|
+
const isFeedBroken = rawPriceBN.isZero() || rawPriceBN.eq(new BN9__default.default(1e-6)) || rawPriceBN.eq(new BN9__default.default(1e-8));
|
|
27219
27217
|
if (isFeedBroken) {
|
|
27220
27218
|
const bank = switchboardBanks.find(
|
|
27221
27219
|
(bank2) => bank2.config.oracleKeys[0].toBase58() === oracleKey
|
|
@@ -28035,7 +28033,7 @@ async function makeAddPermissionlessStakedBankIx(program, group, voteAccountAddr
|
|
|
28035
28033
|
isWritable: false
|
|
28036
28034
|
})),
|
|
28037
28035
|
{
|
|
28038
|
-
seed: new
|
|
28036
|
+
seed: new BN9__default.default(0)
|
|
28039
28037
|
}
|
|
28040
28038
|
);
|
|
28041
28039
|
return {
|