@pyron-finance/pyron-client 2.2.0 → 2.3.0
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/common/index.d.cts +1 -1
- package/dist/common/index.d.ts +1 -1
- package/dist/{index-yftX6Mhj.d.cts → index-BDw4KxGN.d.cts} +40 -38
- package/dist/index-BDw4KxGN.d.cts.map +1 -0
- package/dist/{index-BoDaAGQH.d.ts → index-BKsyoTwR.d.ts} +41 -39
- package/dist/index-BKsyoTwR.d.ts.map +1 -0
- package/dist/index.cjs +205 -76
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +205 -76
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-BoDaAGQH.d.ts.map +0 -1
- package/dist/index-yftX6Mhj.d.cts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AccountFlags, AccountType, ActionEmodeImpact, ActiveEmodePair, ActiveStakePoolMap, AssetTag, BUNDLE_TX_SIZE, Balance, BalanceRaw, BalanceType, BalanceTypeDto, Bank, BankAddress, BankConfig, BankConfigCompactRaw, BankConfigDto, BankConfigFlag, BankConfigOpt, BankConfigOptRaw, BankConfigRaw, BankConfigRawDto, BankConfigType, BankMap, BankMetadataRaw, BankRaw, BankRawDto, BankType, BankTypeDto, BankVaultType, BroadcastMethodType, DEFAULT_CLUSTER, DEFAULT_COMMITMENT, DEFAULT_CONFIRM_OPTS, DEFAULT_ORACLE_MAX_AGE, DEFAULT_PROCESS_TX_OPTS, DEFAULT_PROCESS_TX_STRATEGY, DEFAULT_SEND_OPTS, DISABLED_FLAG, DUMMY_USDC_MINT, DataFetcher, DummyMetadataFetcher, EmodeConfigRaw, EmodeConfigRawDto, EmodeEntry, EmodeEntryDto, EmodeEntryFlags, EmodeFlags, EmodeImpact, EmodeImpactStatus, EmodePair, EmodeSettings, EmodeSettingsDto, EmodeSettingsRaw, EmodeSettingsRawDto, EmodeSettingsType, EmodeTag, Environment, FLASHLOAN_ENABLED_FLAG, FetchGroupDataFn, FetchRawBanksArgs, FlashLoanArgs, FlashloanActionResult, FogoMetadataFetcher, GROUP_PK, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, HealthCacheRaw, HealthCacheSimulationError, HealthCacheType, HealthCacheTypeDto, IMetadataFetcher, InterestRateConfig, InterestRateConfigCompactRaw, InterestRateConfigDto, InterestRateConfigOpt, InterestRateConfigOptRaw, InterestRateConfigRaw, JUPITER_V6_PROGRAM, LENDR_IDL, LENDR_PROGRAM, LENDR_SPONSORED_SHARD_ID, LST_MINT, LUT_PROGRAM_AUTHORITY_INDEX, LendingAccountDepositOrRepayWithSessionAccounts, LendingAccountWithdrawOrBorrowWithSessionAccounts, LendrAccount, LendrAccountRaw, LendrAccountType, LendrAccountTypeDto, LendrAccountWrapper, LendrClient, LendrClientFetchOptions, LendrClientOptions, LendrClientProps, LendrConfig, LendrGroup, LendrGroupRaw, LendrGroupType, LendrGroupTypeDto, LendrIdlType, LendrProgram, LendrRequirementType, LendrRequirementTypeRaw, LogFn, LoopProps, LoopTxProps, MAX_ACCOUNT_KEYS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, MakeBorrowIxOpts, MakeBorrowWithSessionIxOpts, MakeDepositIxOpts, MakeDepositWithSessionIxOpts, MakeRepayIxOpts, MakeRepayWithSessionIxOpts, MakeWithdrawIxOpts, MakeWithdrawWithSessionIxOpts, MetadataService, MetadataServiceProps, MetaplexMetadataFetcher, MintData, MintDataMap, OperationalState, OperationalStateRaw, OracleConfigOpt, OracleConfigOptRaw, OraclePrice, OraclePriceDto, OraclePriceMap, OracleSetup, OracleSetupRaw, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PRIORITY_TX_SIZE, PROGRAM_ID, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, PriceBias, PriceWithConfidence, PriceWithConfidenceDto, PriorityFees, ProcessTransactionError, ProcessTransactionErrorType, ProcessTransactionOpts, ProcessTransactionStrategy, ProcessTransactionsClientOpts, ProgramError, ProgramErrorWithDescription, PythPushFeedIdMap, RatePoint, RatePointDto, RatePointRaw, RepayWithCollateralProps, RepayWithCollateralTxProps, RiskTier, RiskTierRaw, SINGLE_POOL_PROGRAM_ID, SKIP_SIMULATION, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, SimulationResult, SpecificBroadcastMethod, SpecificBroadcastMethodType, StakeAccount, StakePoolMevMap, SupportedOracleSetup, TLogger, TMetadata, TRANSFER_ACCOUNT_AUTHORITY_FLAG, TransactionBuilderResult, USDC_DECIMALS, USDC_MINT, ValidatorRateData, ValidatorStakeGroup, ValidatorStakeGroupDto, WSOL_EXTENDED_METADATA, WSOL_MINT, accountFlagToBN, addOracleToBanksIx, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankRawToDto, buildFeedIdMap, computeAccountValue, computeActiveEmodePairs, computeAssetUsdValue, computeBalanceUsdValue, computeBaseInterestRate, computeClaimedEmissions, computeEmodeImpacts, computeFreeCollateral, computeFreeCollateralLegacy, computeHealthAccountMetas, computeHealthCheckAccounts, computeHealthComponents, computeHealthComponentsLegacy, computeHealthComponentsWithoutBiasLegacy, computeInterestRates, computeLiabilityUsdValue, computeLoopingParams, computeMaxLeverage, computeNetApy, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeTotalOutstandingEmissions, computeTvl, computeUsdValue, computeUtilizationRate, confirmTransaction, crankPythOracleIx, createLendrAccountTx, createUpdateFeedIx, decodeAccountRaw, decodeBankRaw, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToLendrAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, feedIdToString, fetchLendrAccountAddresses, fetchLendrAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchPythOracleData, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleData, findOracleKey, findPythPushOracleAddress, freezeBankConfigIx, getActiveAccountFlags, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getActiveStaleBanks, getAssetQuantity, getAssetShares, getAssetWeight, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getConfig, getConfigPda, getHealthCacheStatusDescription, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getPrice, getPriceFeedAccountForProgram, getPriceWithConfidence, getTotalAssetQuantity, getTotalLiabilityQuantity, getTreasuryPda, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, index_d_exports, instructions, isOracleSetupSupported, isWeightedPrice, lendrAccountToDto, makeAddPermissionlessStakedBankIx, makeBundleTipIx, makePoolAddBankIx, makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx, makeTxPriorityIx, makeUnwrapSolIx, makeVersionedTransaction, makeWrapSolIxs, metadataSchema, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseErrorFromLogs, parseLendrAccountRaw, parseOperationalState, parseOraclePriceData, parseOracleSetup, parseRiskTier, parseTransactionError, processTransactions, serializeBankConfigOpt, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateTransactions, toBankConfigDto, toBankDto, toEmodeSettingsDto, toInterestRateConfigDto, validatorStakeGroupToDto } from "./index-
|
|
1
|
+
import { AccountFlags, AccountType, ActionEmodeImpact, ActiveEmodePair, ActiveStakePoolMap, AssetTag, BUNDLE_TX_SIZE, Balance, BalanceRaw, BalanceType, BalanceTypeDto, Bank, BankAddress, BankConfig, BankConfigCompactRaw, BankConfigDto, BankConfigFlag, BankConfigOpt, BankConfigOptRaw, BankConfigRaw, BankConfigRawDto, BankConfigType, BankMap, BankMetadataRaw, BankRaw, BankRawDto, BankType, BankTypeDto, BankVaultType, BroadcastMethodType, DEFAULT_CLUSTER, DEFAULT_COMMITMENT, DEFAULT_CONFIRM_OPTS, DEFAULT_ORACLE_MAX_AGE, DEFAULT_PROCESS_TX_OPTS, DEFAULT_PROCESS_TX_STRATEGY, DEFAULT_SEND_OPTS, DISABLED_FLAG, DUMMY_USDC_MINT, DataFetcher, DummyMetadataFetcher, EmodeConfigRaw, EmodeConfigRawDto, EmodeEntry, EmodeEntryDto, EmodeEntryFlags, EmodeFlags, EmodeImpact, EmodeImpactStatus, EmodePair, EmodeSettings, EmodeSettingsDto, EmodeSettingsRaw, EmodeSettingsRawDto, EmodeSettingsType, EmodeTag, Environment, FLASHLOAN_ENABLED_FLAG, FetchGroupDataFn, FetchRawBanksArgs, FlashLoanArgs, FlashloanActionResult, FogoMetadataFetcher, GROUP_PK, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, HealthCacheRaw, HealthCacheSimulationError, HealthCacheType, HealthCacheTypeDto, IMetadataFetcher, InterestRateConfig, InterestRateConfigCompactRaw, InterestRateConfigDto, InterestRateConfigOpt, InterestRateConfigOptRaw, InterestRateConfigRaw, JUPITER_V6_PROGRAM, LENDR_IDL, LENDR_PROGRAM, LENDR_SPONSORED_SHARD_ID, LST_MINT, LUT_PROGRAM_AUTHORITY_INDEX, LendingAccountDepositOrRepayWithSessionAccounts, LendingAccountWithdrawOrBorrowWithSessionAccounts, LendrAccount, LendrAccountRaw, LendrAccountType, LendrAccountTypeDto, LendrAccountWrapper, LendrClient, LendrClientFetchOptions, LendrClientOptions, LendrClientProps, LendrConfig, LendrGroup, LendrGroupRaw, LendrGroupType, LendrGroupTypeDto, LendrIdlType, LendrProgram, LendrRequirementType, LendrRequirementTypeRaw, LogFn, LoopProps, LoopTxProps, MAX_ACCOUNT_KEYS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, MakeBorrowIxOpts, MakeBorrowWithSessionIxOpts, MakeDepositIxOpts, MakeDepositWithSessionIxOpts, MakeRepayIxOpts, MakeRepayWithSessionIxOpts, MakeWithdrawIxOpts, MakeWithdrawWithSessionIxOpts, MetadataService, MetadataServiceProps, MetaplexMetadataFetcher, MintData, MintDataMap, OperationalState, OperationalStateRaw, OracleConfigOpt, OracleConfigOptRaw, OraclePrice, OraclePriceDto, OraclePriceMap, OracleSetup, OracleSetupRaw, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PRIORITY_TX_SIZE, PROGRAM_ID, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, PriceBias, PriceWithConfidence, PriceWithConfidenceDto, PriorityFees, ProcessTransactionError, ProcessTransactionErrorType, ProcessTransactionOpts, ProcessTransactionStrategy, ProcessTransactionsClientOpts, ProgramError, ProgramErrorWithDescription, PythPushFeedIdMap, RatePoint, RatePointDto, RatePointRaw, RepayWithCollateralProps, RepayWithCollateralTxProps, RiskTier, RiskTierRaw, SINGLE_POOL_PROGRAM_ID, SKIP_SIMULATION, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, SimulationResult, SpecificBroadcastMethod, SpecificBroadcastMethodType, StakeAccount, StakePoolMevMap, SupportedOracleSetup, TLogger, TMetadata, TRANSFER_ACCOUNT_AUTHORITY_FLAG, TransactionBuilderResult, USDC_DECIMALS, USDC_MINT, ValidatorRateData, ValidatorStakeGroup, ValidatorStakeGroupDto, WSOL_EXTENDED_METADATA, WSOL_MINT, accountFlagToBN, addOracleToBanksIx, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankRawToDto, buildFeedIdMap, computeAccountValue, computeActiveEmodePairs, computeAssetUsdValue, computeBalanceUsdValue, computeBaseInterestRate, computeClaimedEmissions, computeEmodeImpacts, computeFreeCollateral, computeFreeCollateralLegacy, computeHealthAccountMetas, computeHealthCheckAccounts, computeHealthComponents, computeHealthComponentsLegacy, computeHealthComponentsWithoutBiasLegacy, computeInterestRates, computeLiabilityUsdValue, computeLoopingParams, computeMaxLeverage, computeNetApy, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeTotalOutstandingEmissions, computeTvl, computeUsdValue, computeUtilizationRate, confirmTransaction, crankPythOracleIx, createLendrAccountTx, createUpdateFeedIx, decodeAccountRaw, decodeBankRaw, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToLendrAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, feedIdToString, fetchLendrAccountAddresses, fetchLendrAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchPythOracleData, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleData, findOracleKey, findPythPushOracleAddress, freezeBankConfigIx, getActiveAccountFlags, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getActiveStaleBanks, getAssetQuantity, getAssetShares, getAssetWeight, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getConfig, getConfigPda, getHealthCacheStatusDescription, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getPrice, getPriceFeedAccountForProgram, getPriceWithConfidence, getTotalAssetQuantity, getTotalLiabilityQuantity, getTreasuryPda, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, index_d_exports, instructions, isOracleSetupSupported, isWeightedPrice, lendrAccountToDto, makeAddPermissionlessStakedBankIx, makeBundleTipIx, makePoolAddBankIx, makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx, makeTxPriorityIx, makeUnwrapSolIx, makeVersionedTransaction, makeWrapSolIxs, metadataSchema, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseErrorFromLogs, parseLendrAccountRaw, parseOperationalState, parseOraclePriceData, parseOracleSetup, parseRiskTier, parseTransactionError, processTransactions, serializeBankConfigOpt, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateTransactions, toBankConfigDto, toBankDto, toEmodeSettingsDto, toInterestRateConfigDto, validatorStakeGroupToDto } from "./index-BKsyoTwR.js";
|
|
2
2
|
export { AccountFlags, AccountType, ActionEmodeImpact, ActiveEmodePair, ActiveStakePoolMap, AssetTag, BUNDLE_TX_SIZE, Balance, BalanceRaw, BalanceType, BalanceTypeDto, Bank, BankAddress, BankConfig, BankConfigCompactRaw, BankConfigDto, BankConfigFlag, BankConfigOpt, BankConfigOptRaw, BankConfigRaw, BankConfigRawDto, BankConfigType, BankMap, BankMetadataRaw, BankRaw, BankRawDto, BankType, BankTypeDto, BankVaultType, BroadcastMethodType, DEFAULT_CLUSTER, DEFAULT_COMMITMENT, DEFAULT_CONFIRM_OPTS, DEFAULT_ORACLE_MAX_AGE, DEFAULT_PROCESS_TX_OPTS, DEFAULT_PROCESS_TX_STRATEGY, DEFAULT_SEND_OPTS, DISABLED_FLAG, DUMMY_USDC_MINT, DataFetcher, DummyMetadataFetcher, EmodeConfigRaw, EmodeConfigRawDto, EmodeEntry, EmodeEntryDto, EmodeEntryFlags, EmodeFlags, EmodeImpact, EmodeImpactStatus, EmodePair, EmodeSettings, EmodeSettingsDto, EmodeSettingsRaw, EmodeSettingsRawDto, EmodeSettingsType, EmodeTag, Environment, FLASHLOAN_ENABLED_FLAG, FetchGroupDataFn, FetchRawBanksArgs, FlashLoanArgs, FlashloanActionResult, FogoMetadataFetcher, GROUP_PK, HOURS_PER_YEAR, HealthCache, HealthCacheFlags, HealthCacheRaw, HealthCacheSimulationError, HealthCacheType, HealthCacheTypeDto, IMetadataFetcher, InterestRateConfig, InterestRateConfigCompactRaw, InterestRateConfigDto, InterestRateConfigOpt, InterestRateConfigOptRaw, InterestRateConfigRaw, JUPITER_V6_PROGRAM, LENDR_IDL, LENDR_PROGRAM, LENDR_SPONSORED_SHARD_ID, LST_MINT, LUT_PROGRAM_AUTHORITY_INDEX, LendingAccountDepositOrRepayWithSessionAccounts, LendingAccountWithdrawOrBorrowWithSessionAccounts, LendrAccount, LendrAccountRaw, LendrAccountType, LendrAccountTypeDto, LendrAccountWrapper, LendrClient, LendrClientFetchOptions, LendrClientOptions, LendrClientProps, LendrConfig, LendrGroup, LendrGroupRaw, LendrGroupType, LendrGroupTypeDto, LendrIdlType, LendrProgram, LendrRequirementType, LendrRequirementTypeRaw, LogFn, LoopProps, LoopTxProps, MAX_ACCOUNT_KEYS, MAX_CONFIDENCE_INTERVAL_RATIO, MAX_TX_SIZE, MAX_U64, MPL_METADATA_PROGRAM_ID, MakeBorrowIxOpts, MakeBorrowWithSessionIxOpts, MakeDepositIxOpts, MakeDepositWithSessionIxOpts, MakeRepayIxOpts, MakeRepayWithSessionIxOpts, MakeWithdrawIxOpts, MakeWithdrawWithSessionIxOpts, MetadataService, MetadataServiceProps, MetaplexMetadataFetcher, MintData, MintDataMap, OperationalState, OperationalStateRaw, OracleConfigOpt, OracleConfigOptRaw, OraclePrice, OraclePriceDto, OraclePriceMap, OracleSetup, OracleSetupRaw, PDA_BANK_FEE_VAULT_AUTH_SEED, PDA_BANK_FEE_VAULT_SEED, PDA_BANK_INSURANCE_VAULT_AUTH_SEED, PDA_BANK_INSURANCE_VAULT_SEED, PDA_BANK_LIQUIDITY_VAULT_AUTH_SEED, PDA_BANK_LIQUIDITY_VAULT_SEED, PRIORITY_TX_SIZE, PROGRAM_ID, PYTH_PRICE_CONF_INTERVALS, PYTH_PUSH_ORACLE_ID, PYTH_SPONSORED_SHARD_ID, PriceBias, PriceWithConfidence, PriceWithConfidenceDto, PriorityFees, ProcessTransactionError, ProcessTransactionErrorType, ProcessTransactionOpts, ProcessTransactionStrategy, ProcessTransactionsClientOpts, ProgramError, ProgramErrorWithDescription, PythPushFeedIdMap, RatePoint, RatePointDto, RatePointRaw, RepayWithCollateralProps, RepayWithCollateralTxProps, RiskTier, RiskTierRaw, SINGLE_POOL_PROGRAM_ID, SKIP_SIMULATION, STAKE_CONFIG_ID, STAKE_PROGRAM_ID, SWB_PRICE_CONF_INTERVALS, SYSTEM_PROGRAM_ID, SYSVAR_CLOCK_ID, SYSVAR_RENT_ID, SYSVAR_STAKE_HISTORY_ID, SimulationResult, SpecificBroadcastMethod, SpecificBroadcastMethodType, StakeAccount, StakePoolMevMap, SupportedOracleSetup, TLogger, TMetadata, TRANSFER_ACCOUNT_AUTHORITY_FLAG, TransactionBuilderResult, USDC_DECIMALS, USDC_MINT, ValidatorRateData, ValidatorStakeGroup, ValidatorStakeGroupDto, WSOL_EXTENDED_METADATA, WSOL_MINT, accountFlagToBN, addOracleToBanksIx, balanceToDto, bankConfigRawToDto, bankConfigToBankConfigRaw, bankRawToDto, buildFeedIdMap, computeAccountValue, computeActiveEmodePairs, computeAssetUsdValue, computeBalanceUsdValue, computeBaseInterestRate, computeClaimedEmissions, computeEmodeImpacts, computeFreeCollateral, computeFreeCollateralLegacy, computeHealthAccountMetas, computeHealthCheckAccounts, computeHealthComponents, computeHealthComponentsLegacy, computeHealthComponentsWithoutBiasLegacy, computeInterestRates, computeLiabilityUsdValue, computeLoopingParams, computeMaxLeverage, computeNetApy, computeQuantity, computeQuantityUi, computeRemainingCapacity, computeTotalOutstandingEmissions, computeTvl, computeUsdValue, computeUtilizationRate, confirmTransaction, crankPythOracleIx, createLendrAccountTx, createUpdateFeedIx, decodeAccountRaw, decodeBankRaw, dtoToBalance, dtoToBank, dtoToBankConfig, dtoToBankConfigRaw, dtoToBankRaw, dtoToEmodeSettings, dtoToEmodeSettingsRaw, dtoToGroup, dtoToHealthCache, dtoToInterestRateConfig, dtoToLendrAccount, dtoToOraclePrice, dtoToValidatorStakeGroup, emodeSettingsRawToDto, extractPythOracleKeys, feedIdToString, fetchLendrAccountAddresses, fetchLendrAccountData, fetchMultipleBanks, fetchNativeStakeAccounts, fetchOracleData, fetchPythOracleData, fetchStakeAccount, fetchStakePoolActiveStates, fetchStakePoolMev, fetchSwbOracleData, findOracleKey, findPythPushOracleAddress, freezeBankConfigIx, getActiveAccountFlags, getActiveEmodeEntryFlags, getActiveEmodeFlags, getActiveHealthCacheFlags, getActiveStaleBanks, getAssetQuantity, getAssetShares, getAssetWeight, getBalanceUsdValueWithPriceBias, getBankVaultAuthority, getBankVaultSeeds, getConfig, getConfigPda, getHealthCacheStatusDescription, getLiabilityQuantity, getLiabilityShares, getLiabilityWeight, getPrice, getPriceFeedAccountForProgram, getPriceWithConfidence, getTotalAssetQuantity, getTotalLiabilityQuantity, getTreasuryPda, groupToDto, hasAccountFlag, hasEmodeEntryFlag, hasEmodeFlag, hasHealthCacheFlag, healthCacheToDto, instructions, isOracleSetupSupported, isWeightedPrice, lendrAccountToDto, makeAddPermissionlessStakedBankIx, makeBundleTipIx, makePoolAddBankIx, makePoolConfigureBankIx, makePriorityFeeIx, makePriorityFeeMicroIx, makePulseHealthIx, makeTxPriorityIx, makeUnwrapSolIx, makeVersionedTransaction, makeWrapSolIxs, metadataSchema, oraclePriceToDto, parseBalanceRaw, parseBankConfigRaw, parseBankRaw, parseEmodeSettingsRaw, parseEmodeTag, parseErrorFromLogs, parseLendrAccountRaw, parseOperationalState, parseOracleSetup, parseOraclePriceData as parsePriceInfo, parseRiskTier, parseTransactionError, processTransactions, serializeBankConfigOpt, serializeOperationalState, serializeOracleSetup, serializeOracleSetupToIndex, serializeRiskTier, simulateAccountHealthCache, simulateAccountHealthCacheWithFallback, simulateTransactions, toBankConfigDto, toBankDto, toEmodeSettingsDto, toInterestRateConfigDto, validatorStakeGroupToDto, index_d_exports as vendor };
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import BN$1, { BN } from "bn.js";
|
|
|
13
13
|
import { findMetadataPda, mplTokenMetadata, safeFetchAllMetadata } from "@metaplex-foundation/mpl-token-metadata";
|
|
14
14
|
import { publicKey } from "@metaplex-foundation/umi";
|
|
15
15
|
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
|
|
16
|
+
import { createSessionUnwrapInstruction, createSessionWrapInstructions } from "@fogo/sessions-sdk";
|
|
16
17
|
import * as borsh$1 from "borsh";
|
|
17
18
|
import * as borsh from "@coral-xyz/borsh";
|
|
18
19
|
import Big from "big.js";
|
|
@@ -10107,19 +10108,19 @@ function fetchLatestIdl() {
|
|
|
10107
10108
|
async function makeInitLendrAccountIx(ldProgram, accounts$2) {
|
|
10108
10109
|
return ldProgram.methods.lendrAccountInitialize().accounts(accounts$2).instruction();
|
|
10109
10110
|
}
|
|
10110
|
-
async function makeInitLendrAccountWithSessionIx(ldProgram, { lendrGroup, session, feePayer }, accountIndex, thirdPartyId) {
|
|
10111
|
+
async function makeInitLendrAccountWithSessionIx(ldProgram, { lendrGroup, session: session$1, feePayer }, accountIndex, thirdPartyId) {
|
|
10111
10112
|
const thirdPartyIdValue = thirdPartyId ?? 0;
|
|
10112
10113
|
const [lendrAccount] = PublicKey.findProgramAddressSync([
|
|
10113
10114
|
Buffer.from("lendr_account"),
|
|
10114
10115
|
lendrGroup.toBuffer(),
|
|
10115
|
-
session.walletPublicKey.toBuffer(),
|
|
10116
|
+
session$1.walletPublicKey.toBuffer(),
|
|
10116
10117
|
Buffer.from(new Uint16Array([accountIndex]).buffer),
|
|
10117
10118
|
Buffer.from(new Uint16Array([thirdPartyIdValue]).buffer)
|
|
10118
10119
|
], ldProgram.programId);
|
|
10119
|
-
return ldProgram.methods.lendrAccountInitializeWithSession(session.walletPublicKey, accountIndex, thirdPartyId ?? null).accounts({
|
|
10120
|
+
return ldProgram.methods.lendrAccountInitializeWithSession(session$1.walletPublicKey, accountIndex, thirdPartyId ?? null).accounts({
|
|
10120
10121
|
lendrGroup,
|
|
10121
10122
|
lendrAccount,
|
|
10122
|
-
sessionKey: session.sessionPublicKey,
|
|
10123
|
+
sessionKey: session$1.sessionPublicKey,
|
|
10123
10124
|
feePayer
|
|
10124
10125
|
}).instruction();
|
|
10125
10126
|
}
|
|
@@ -19386,15 +19387,89 @@ function computeInterestRates(bank) {
|
|
|
19386
19387
|
borrowingRate
|
|
19387
19388
|
};
|
|
19388
19389
|
}
|
|
19389
|
-
|
|
19390
|
-
|
|
19391
|
-
|
|
19390
|
+
/**
|
|
19391
|
+
* Maximum value for u32
|
|
19392
|
+
*/
|
|
19393
|
+
const U32_MAX = 4294967295;
|
|
19394
|
+
/**
|
|
19395
|
+
* Convert u32 encoded rate to APR percentage (0.0 to 10.0)
|
|
19396
|
+
* Rate is encoded as: rate / u32::MAX * 1000%
|
|
19397
|
+
* Example: 100% APR = 0.1 * u32::MAX
|
|
19398
|
+
*/
|
|
19399
|
+
function rateFromU32(rate) {
|
|
19400
|
+
const ratio = new BigNumber(rate).div(U32_MAX);
|
|
19401
|
+
return ratio.times(10);
|
|
19402
|
+
}
|
|
19403
|
+
/**
|
|
19404
|
+
* Convert u32 encoded utilization to percentage (0.0 to 1.0)
|
|
19405
|
+
* Util is encoded as: util / u32::MAX * 100%
|
|
19406
|
+
* Example: 50% = 0.5 * u32::MAX
|
|
19407
|
+
*/
|
|
19408
|
+
function utilFromU32(util) {
|
|
19409
|
+
return new BigNumber(util).div(U32_MAX);
|
|
19410
|
+
}
|
|
19411
|
+
/**
|
|
19412
|
+
* Linear interpolation between two points
|
|
19413
|
+
* Given points (startX, startY) and (endX, endY), find Y at targetX
|
|
19414
|
+
*/
|
|
19415
|
+
function calculateRateBetweenPoints(startX, startY, endX, endY, targetX) {
|
|
19416
|
+
if (endX.lte(startX)) return startY;
|
|
19417
|
+
if (targetX.lt(startX)) return startY;
|
|
19418
|
+
if (targetX.gt(endX)) return endY;
|
|
19419
|
+
if (endY.lt(startY)) return startY;
|
|
19420
|
+
const deltaX = endX.minus(startX);
|
|
19421
|
+
if (deltaX.isZero()) return startY;
|
|
19422
|
+
const offset = targetX.minus(startX);
|
|
19423
|
+
const proportion = offset.div(deltaX);
|
|
19424
|
+
const deltaY = endY.minus(startY);
|
|
19425
|
+
const scaledDelta = deltaY.times(proportion);
|
|
19426
|
+
return startY.plus(scaledDelta);
|
|
19427
|
+
}
|
|
19428
|
+
/**
|
|
19429
|
+
* Compute base interest rate using the legacy 3-point curve
|
|
19430
|
+
*/
|
|
19431
|
+
function computeLegacyCurve(utilizationRate, optimalUtilizationRate, plateauInterestRate, maxInterestRate) {
|
|
19392
19432
|
if (utilizationRate.lte(optimalUtilizationRate)) {
|
|
19393
19433
|
return utilizationRate.times(plateauInterestRate).div(optimalUtilizationRate);
|
|
19394
19434
|
} else {
|
|
19395
19435
|
return utilizationRate.minus(optimalUtilizationRate).div(new BigNumber(1).minus(optimalUtilizationRate)).times(maxInterestRate.minus(plateauInterestRate)).plus(plateauInterestRate);
|
|
19396
19436
|
}
|
|
19397
19437
|
}
|
|
19438
|
+
/**
|
|
19439
|
+
* Compute base interest rate using the 7-point multipoint curve
|
|
19440
|
+
* Locates utilization on a linear function with up to 7 points:
|
|
19441
|
+
* - Point 1: (0%, zeroUtilRate)
|
|
19442
|
+
* - Points 2-6: Custom points from the points array
|
|
19443
|
+
* - Point 7: (100%, hundredUtilRate)
|
|
19444
|
+
*/
|
|
19445
|
+
function computeMultipointCurve(utilizationRate, zeroUtilRate, hundredUtilRate, points) {
|
|
19446
|
+
const zeroRate = rateFromU32(zeroUtilRate);
|
|
19447
|
+
const hundredRate = rateFromU32(hundredUtilRate);
|
|
19448
|
+
const clampedUtilizationRate = BigNumber.max(0, BigNumber.min(1, utilizationRate));
|
|
19449
|
+
const nonPaddingPoints = points.filter((point) => point.util !== 0);
|
|
19450
|
+
let prevUtil = new BigNumber(0);
|
|
19451
|
+
let prevRate = zeroRate;
|
|
19452
|
+
for (const point of nonPaddingPoints) {
|
|
19453
|
+
const pointUtil = utilFromU32(point.util);
|
|
19454
|
+
const pointRate = rateFromU32(point.rate);
|
|
19455
|
+
if (clampedUtilizationRate.lte(pointUtil)) {
|
|
19456
|
+
return calculateRateBetweenPoints(prevUtil, prevRate, pointUtil, pointRate, clampedUtilizationRate);
|
|
19457
|
+
}
|
|
19458
|
+
prevUtil = pointUtil;
|
|
19459
|
+
prevRate = pointRate;
|
|
19460
|
+
}
|
|
19461
|
+
return calculateRateBetweenPoints(prevUtil, prevRate, new BigNumber(1), hundredRate, clampedUtilizationRate);
|
|
19462
|
+
}
|
|
19463
|
+
function computeBaseInterestRate(bank) {
|
|
19464
|
+
const interestRateConfig = bank.config.interestRateConfig;
|
|
19465
|
+
const utilizationRate = computeUtilizationRate(bank);
|
|
19466
|
+
const curveType = interestRateConfig.curveType;
|
|
19467
|
+
if (curveType === 1) {
|
|
19468
|
+
return computeMultipointCurve(utilizationRate, interestRateConfig.zeroUtilRate, interestRateConfig.hundredUtilRate, interestRateConfig.points);
|
|
19469
|
+
} else {
|
|
19470
|
+
return computeLegacyCurve(utilizationRate, interestRateConfig.optimalUtilizationRate, interestRateConfig.plateauInterestRate, interestRateConfig.maxInterestRate);
|
|
19471
|
+
}
|
|
19472
|
+
}
|
|
19398
19473
|
function computeUtilizationRate(bank) {
|
|
19399
19474
|
const assets = getTotalAssetQuantity(bank);
|
|
19400
19475
|
const liabilities = getTotalLiabilityQuantity(bank);
|
|
@@ -22177,6 +22252,38 @@ var BankConfig = class BankConfig {
|
|
|
22177
22252
|
|
|
22178
22253
|
//#endregion
|
|
22179
22254
|
//#region src/models/account/pure.ts
|
|
22255
|
+
/**
|
|
22256
|
+
* Creates session-aware wrap instructions for SOL.
|
|
22257
|
+
* Uses the session SDK's wrap instruction builders to create instructions
|
|
22258
|
+
* that work with Fogo Sessions.
|
|
22259
|
+
*
|
|
22260
|
+
* Note: The amount transferred must include rent-exempt amount if the account is new.
|
|
22261
|
+
* Standard rent-exempt amount for a token account is ~2,039,280 lamports.
|
|
22262
|
+
* We add this as a safety margin when the amount is small, as we can't know if the account exists.
|
|
22263
|
+
*/
|
|
22264
|
+
function makeSessionWrapSolIxs(walletAddress, sessionKey, payer, amount, existingBalance) {
|
|
22265
|
+
const nativeAmount = uiToNative(amount, 9).toNumber();
|
|
22266
|
+
const TOKEN_ACCOUNT_RENT_EXEMPT = 2039280;
|
|
22267
|
+
const existingBalanceNative = existingBalance ? uiToNative(existingBalance, 9).toNumber() : 0;
|
|
22268
|
+
let totalAmount = nativeAmount;
|
|
22269
|
+
if (existingBalanceNative < TOKEN_ACCOUNT_RENT_EXEMPT) {
|
|
22270
|
+
const rentNeeded = Math.max(0, TOKEN_ACCOUNT_RENT_EXEMPT - existingBalanceNative);
|
|
22271
|
+
totalAmount = nativeAmount + rentNeeded;
|
|
22272
|
+
} else {
|
|
22273
|
+
totalAmount = nativeAmount + 1e4;
|
|
22274
|
+
}
|
|
22275
|
+
return createSessionWrapInstructions(sessionKey, walletAddress, BigInt(totalAmount));
|
|
22276
|
+
}
|
|
22277
|
+
/**
|
|
22278
|
+
* Creates a session-aware unwrap instruction for SOL.
|
|
22279
|
+
* Uses the session SDK's unwrap instruction builder to create an instruction
|
|
22280
|
+
* that works with Fogo Sessions.
|
|
22281
|
+
*
|
|
22282
|
+
* Note: createSessionUnwrapInstruction signature: (sessionKey, walletPublicKey)
|
|
22283
|
+
*/
|
|
22284
|
+
function makeSessionUnwrapSolIx(walletAddress, sessionKey, payer) {
|
|
22285
|
+
return createSessionUnwrapInstruction(sessionKey, walletAddress);
|
|
22286
|
+
}
|
|
22180
22287
|
var LendrAccount = class LendrAccount {
|
|
22181
22288
|
constructor(address$2, group, authority, balances, accountFlags, emissionsDestinationAccount, healthCache) {
|
|
22182
22289
|
this.address = address$2;
|
|
@@ -22590,10 +22697,15 @@ var LendrAccount = class LendrAccount {
|
|
|
22590
22697
|
keys: []
|
|
22591
22698
|
};
|
|
22592
22699
|
}
|
|
22593
|
-
async makeDepositWithSessionIx(program, banks, mintDatas, amount, bankAddress,
|
|
22594
|
-
const
|
|
22700
|
+
async makeDepositWithSessionIx(program, banks, mintDatas, amount, bankAddress, session$1, opts = {}) {
|
|
22701
|
+
const bank = banks.get(bankAddress.toBase58());
|
|
22702
|
+
if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
|
|
22703
|
+
const { depositIxs, ixArguments, userTokenAtaPk, mintData, remainingAccounts } = await this.prepareDepositIx(banks, mintDatas, amount, bankAddress, {
|
|
22704
|
+
...opts,
|
|
22705
|
+
wrapAndUnwrapSol: false
|
|
22706
|
+
});
|
|
22595
22707
|
const accounts$2 = {
|
|
22596
|
-
sessionKey,
|
|
22708
|
+
sessionKey: session$1.sessionPublicKey,
|
|
22597
22709
|
lendrAccount: this.address,
|
|
22598
22710
|
bank: bankAddress,
|
|
22599
22711
|
signerTokenAccount: userTokenAtaPk,
|
|
@@ -22602,6 +22714,12 @@ var LendrAccount = class LendrAccount {
|
|
|
22602
22714
|
liquidityVault: opts.overrideInferAccounts?.liquidityVault
|
|
22603
22715
|
};
|
|
22604
22716
|
const depositIx = await instructions_default.makeDepositWithSessionIx(program, accounts$2, ixArguments, remainingAccounts);
|
|
22717
|
+
if (bank.mint.equals(NATIVE_MINT)) {
|
|
22718
|
+
const wSolBalanceUi = opts.wSolBalanceUi ?? 0;
|
|
22719
|
+
const wrapAmount = new BigNumber(amount).minus(wSolBalanceUi);
|
|
22720
|
+
const wrapIxs = makeSessionWrapSolIxs(session$1.walletPublicKey, session$1.sessionPublicKey, session$1.payer, wrapAmount, wSolBalanceUi);
|
|
22721
|
+
depositIxs.push(...wrapIxs);
|
|
22722
|
+
}
|
|
22605
22723
|
depositIxs.push(depositIx);
|
|
22606
22724
|
return {
|
|
22607
22725
|
instructions: depositIxs,
|
|
@@ -22671,10 +22789,15 @@ var LendrAccount = class LendrAccount {
|
|
|
22671
22789
|
keys: []
|
|
22672
22790
|
};
|
|
22673
22791
|
}
|
|
22674
|
-
async makeRepayWithSessionIx(program, banks, mintDatas, amount, bankAddress,
|
|
22675
|
-
const
|
|
22792
|
+
async makeRepayWithSessionIx(program, banks, mintDatas, amount, bankAddress, session$1, repayAll = false, opts = {}) {
|
|
22793
|
+
const bank = banks.get(bankAddress.toBase58());
|
|
22794
|
+
if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
|
|
22795
|
+
const { repayIxs, ixArguments, userAta, mintData, remainingAccounts } = await this.prepareRepayInstruction(program, banks, mintDatas, amount, bankAddress, repayAll, {
|
|
22796
|
+
...opts,
|
|
22797
|
+
wrapAndUnwrapSol: false
|
|
22798
|
+
});
|
|
22676
22799
|
const repayIx = await instructions_default.makeRepayWithSessionIx(program, {
|
|
22677
|
-
sessionKey,
|
|
22800
|
+
sessionKey: session$1.sessionPublicKey,
|
|
22678
22801
|
lendrAccount: this.address,
|
|
22679
22802
|
signerTokenAccount: userAta,
|
|
22680
22803
|
bank: bankAddress,
|
|
@@ -22686,6 +22809,12 @@ var LendrAccount = class LendrAccount {
|
|
|
22686
22809
|
isSigner: false,
|
|
22687
22810
|
isWritable: false
|
|
22688
22811
|
})));
|
|
22812
|
+
if (bank.mint.equals(NATIVE_MINT)) {
|
|
22813
|
+
const wSolBalanceUi = opts.wSolBalanceUi ?? 0;
|
|
22814
|
+
const wrapAmount = new BigNumber(amount).minus(wSolBalanceUi);
|
|
22815
|
+
const wrapIxs = makeSessionWrapSolIxs(session$1.walletPublicKey, session$1.sessionPublicKey, session$1.payer, wrapAmount, wSolBalanceUi);
|
|
22816
|
+
repayIxs.push(...wrapIxs);
|
|
22817
|
+
}
|
|
22689
22818
|
repayIxs.push(repayIx);
|
|
22690
22819
|
return {
|
|
22691
22820
|
instructions: repayIxs,
|
|
@@ -22771,13 +22900,13 @@ var LendrAccount = class LendrAccount {
|
|
|
22771
22900
|
keys: []
|
|
22772
22901
|
};
|
|
22773
22902
|
}
|
|
22774
|
-
async makeWithdrawWithSessionIx(program, bankMap, mintDatas, bankMetadataMap, amount, bankAddress, session, withdrawAll = false, withdrawOpts = {}) {
|
|
22903
|
+
async makeWithdrawWithSessionIx(program, bankMap, mintDatas, bankMetadataMap, amount, bankAddress, session$1, withdrawAll = false, withdrawOpts = {}) {
|
|
22775
22904
|
const { withdrawIxs, wrapAndUnwrapSol, userAta, mintData, bank, remainingAccounts } = await this.prepareWithdrawInstruction(program, bankMap, mintDatas, bankMetadataMap, bankAddress, withdrawAll, {
|
|
22776
22905
|
...withdrawOpts,
|
|
22777
|
-
createAtaPayer: session.payer
|
|
22906
|
+
createAtaPayer: session$1.payer
|
|
22778
22907
|
});
|
|
22779
22908
|
const withdrawIx = await instructions_default.makeWithdrawWithSessionIx(program, {
|
|
22780
|
-
sessionKey: session.sessionPublicKey,
|
|
22909
|
+
sessionKey: session$1.sessionPublicKey,
|
|
22781
22910
|
lendrAccount: this.address,
|
|
22782
22911
|
bank: bank.address,
|
|
22783
22912
|
destinationTokenAccount: userAta,
|
|
@@ -22789,7 +22918,7 @@ var LendrAccount = class LendrAccount {
|
|
|
22789
22918
|
}, remainingAccounts);
|
|
22790
22919
|
withdrawIxs.push(withdrawIx);
|
|
22791
22920
|
if (wrapAndUnwrapSol && bank.mint.equals(NATIVE_MINT)) {
|
|
22792
|
-
withdrawIxs.push(
|
|
22921
|
+
withdrawIxs.push(makeSessionUnwrapSolIx(session$1.walletPublicKey, session$1.sessionPublicKey, session$1.payer));
|
|
22793
22922
|
}
|
|
22794
22923
|
return {
|
|
22795
22924
|
instructions: withdrawIxs,
|
|
@@ -22855,13 +22984,13 @@ var LendrAccount = class LendrAccount {
|
|
|
22855
22984
|
keys: []
|
|
22856
22985
|
};
|
|
22857
22986
|
}
|
|
22858
|
-
async makeBorrowWithSessionIx(program, bankMap, mintDatas, bankMetadataMap, amount, bankAddress, session, borrowOpts = {}) {
|
|
22987
|
+
async makeBorrowWithSessionIx(program, bankMap, mintDatas, bankMetadataMap, amount, bankAddress, session$1, borrowOpts = {}) {
|
|
22859
22988
|
const { borrowIxs, bank, mintData, userAta, remainingAccounts, wrapAndUnwrapSol } = await this.prepareBorrowInstrcution(bankMap, mintDatas, bankMetadataMap, bankAddress, {
|
|
22860
22989
|
...borrowOpts,
|
|
22861
|
-
createAtaPayer: session.payer
|
|
22990
|
+
createAtaPayer: session$1.payer
|
|
22862
22991
|
});
|
|
22863
22992
|
const borrowIx = await instructions_default.makeBorrowWithSessionIx(program, {
|
|
22864
|
-
sessionKey: session.sessionPublicKey,
|
|
22993
|
+
sessionKey: session$1.sessionPublicKey,
|
|
22865
22994
|
lendrAccount: this.address,
|
|
22866
22995
|
bank: bank.address,
|
|
22867
22996
|
destinationTokenAccount: userAta,
|
|
@@ -22870,7 +22999,7 @@ var LendrAccount = class LendrAccount {
|
|
|
22870
22999
|
}, { amount: uiToNative(amount, bank.mintDecimals) }, remainingAccounts);
|
|
22871
23000
|
borrowIxs.push(borrowIx);
|
|
22872
23001
|
if (bank.mint.equals(NATIVE_MINT) && wrapAndUnwrapSol) {
|
|
22873
|
-
borrowIxs.push(
|
|
23002
|
+
borrowIxs.push(makeSessionUnwrapSolIx(session$1.walletPublicKey, session$1.sessionPublicKey, session$1.payer));
|
|
22874
23003
|
}
|
|
22875
23004
|
return {
|
|
22876
23005
|
instructions: borrowIxs,
|
|
@@ -23633,8 +23762,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
23633
23762
|
async makeDepositIx(amount, bankAddress, depositOpts = {}) {
|
|
23634
23763
|
return this._lendrAccount.makeDepositIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress, depositOpts);
|
|
23635
23764
|
}
|
|
23636
|
-
async makeDepositWithSessionIx(amount, bankAddress,
|
|
23637
|
-
return this._lendrAccount.makeDepositWithSessionIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress,
|
|
23765
|
+
async makeDepositWithSessionIx(amount, bankAddress, session$1, depositOpts = {}) {
|
|
23766
|
+
return this._lendrAccount.makeDepositWithSessionIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress, session$1, depositOpts);
|
|
23638
23767
|
}
|
|
23639
23768
|
/**
|
|
23640
23769
|
* Creates a transaction for depositing native stake into a lendr staked asset bank account.
|
|
@@ -23761,15 +23890,15 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
23761
23890
|
}, "[lendr:lendr-account:deposit] Depositing successful");
|
|
23762
23891
|
return sig;
|
|
23763
23892
|
}
|
|
23764
|
-
async depositWithSession(amount, bankAddress, session, depositOpts = {}) {
|
|
23893
|
+
async depositWithSession(amount, bankAddress, session$1, depositOpts = {}) {
|
|
23765
23894
|
this.client.logger.debug({
|
|
23766
23895
|
address: this.address.toBase58(),
|
|
23767
23896
|
amount,
|
|
23768
23897
|
bankAddress: bankAddress.toBase58(),
|
|
23769
|
-
sessionKey: session.sessionPublicKey
|
|
23898
|
+
sessionKey: session$1.sessionPublicKey
|
|
23770
23899
|
}, "[lendr:lendr-account:depositWithSession] Depositing into lendr account, using sessions.");
|
|
23771
|
-
const { instructions: instructions$3 } = await this.makeDepositWithSessionTx(amount, bankAddress, session
|
|
23772
|
-
const txResult = await session.sendTransaction(instructions$3);
|
|
23900
|
+
const { instructions: instructions$3 } = await this.makeDepositWithSessionTx(amount, bankAddress, session$1, depositOpts);
|
|
23901
|
+
const txResult = await session$1.sendTransaction(instructions$3, { variation: "LendingAccountDeposit" });
|
|
23773
23902
|
this.client.logger.debug({
|
|
23774
23903
|
address: this.address.toBase58(),
|
|
23775
23904
|
txResult
|
|
@@ -23795,8 +23924,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
23795
23924
|
});
|
|
23796
23925
|
return solanaTx;
|
|
23797
23926
|
}
|
|
23798
|
-
async makeDepositWithSessionTx(amount, bankAddress,
|
|
23799
|
-
const ixs = await this.makeDepositWithSessionIx(amount, bankAddress,
|
|
23927
|
+
async makeDepositWithSessionTx(amount, bankAddress, session$1, depositOpts = {}) {
|
|
23928
|
+
const ixs = await this.makeDepositWithSessionIx(amount, bankAddress, session$1, depositOpts);
|
|
23800
23929
|
const tx = new Transaction().add(...ixs.instructions);
|
|
23801
23930
|
const clientLookupTables = await getClientAddressLookupTableAccounts(this.client);
|
|
23802
23931
|
const solanaTx = addTransactionMetadata(tx, {
|
|
@@ -23891,7 +24020,7 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
23891
24020
|
async makeRepayWithSessionIx(amount, bankAddress, sessionKey, repayAll = false, repayOpts = {}) {
|
|
23892
24021
|
const tokenProgramAddress = this.client.mintDatas.get(bankAddress.toBase58())?.tokenProgram;
|
|
23893
24022
|
if (!tokenProgramAddress) throw Error("Repay mint not found");
|
|
23894
|
-
return this._lendrAccount.makeRepayWithSessionIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress,
|
|
24023
|
+
return this._lendrAccount.makeRepayWithSessionIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress, session, repayAll, repayOpts);
|
|
23895
24024
|
}
|
|
23896
24025
|
/**
|
|
23897
24026
|
* Repays a loan in a lendr bank account.
|
|
@@ -23929,16 +24058,16 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
23929
24058
|
* @param repayOpts - Optional parameters for the repay instruction
|
|
23930
24059
|
* @returns The transaction signature of the repayment
|
|
23931
24060
|
*/
|
|
23932
|
-
async repayWithSession(amount, bankAddress, session, repayAll = false, repayOpts = {}) {
|
|
24061
|
+
async repayWithSession(amount, bankAddress, session$1, repayAll = false, repayOpts = {}) {
|
|
23933
24062
|
this.client.logger.debug({
|
|
23934
24063
|
address: this.address.toBase58(),
|
|
23935
|
-
sessionKey: session.sessionPublicKey,
|
|
24064
|
+
sessionKey: session$1.sessionPublicKey,
|
|
23936
24065
|
amount,
|
|
23937
24066
|
bankAddress,
|
|
23938
24067
|
repayAll
|
|
23939
24068
|
}, "[lendr:lendr-account:repayWithSession] Repaying into lendr account");
|
|
23940
|
-
const tx = await this.makeRepayWithSessionTx(amount, bankAddress, session
|
|
23941
|
-
const result = await session.sendTransaction(tx.instructions);
|
|
24069
|
+
const tx = await this.makeRepayWithSessionTx(amount, bankAddress, session$1, repayAll, repayOpts);
|
|
24070
|
+
const result = await session$1.sendTransaction(tx.instructions, { variation: "LendingAccountRepay" });
|
|
23942
24071
|
this.client.logger.debug({
|
|
23943
24072
|
address: this.address.toBase58(),
|
|
23944
24073
|
result
|
|
@@ -23974,8 +24103,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
23974
24103
|
* @param repayOpts - Optional parameters for the repay instruction
|
|
23975
24104
|
* @returns A transaction object containing the repay instructions
|
|
23976
24105
|
*/
|
|
23977
|
-
async makeRepayWithSessionTx(amount, bankAddress,
|
|
23978
|
-
const ixs = await this.makeRepayWithSessionIx(amount, bankAddress,
|
|
24106
|
+
async makeRepayWithSessionTx(amount, bankAddress, session$1, repayAll = false, repayOpts = {}) {
|
|
24107
|
+
const ixs = await this.makeRepayWithSessionIx(amount, bankAddress, session$1, repayAll, repayOpts);
|
|
23979
24108
|
const tx = new Transaction().add(...ixs.instructions);
|
|
23980
24109
|
const clientLookupTables = await getClientAddressLookupTableAccounts(this.client);
|
|
23981
24110
|
const solanaTx = addTransactionMetadata(tx, {
|
|
@@ -24012,11 +24141,11 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24012
24141
|
* @returns An InstructionsWrapper containing the withdraw instructions and signers
|
|
24013
24142
|
* @throws Will throw an error if the withdraw mint is not found
|
|
24014
24143
|
*/
|
|
24015
|
-
async makeWithdrawWithSessionIx(amount, bankAddress, session, withdrawAll = false, withdrawOpts = {}) {
|
|
24144
|
+
async makeWithdrawWithSessionIx(amount, bankAddress, session$1, withdrawAll = false, withdrawOpts = {}) {
|
|
24016
24145
|
const tokenProgramAddress = this.client.mintDatas.get(bankAddress.toBase58())?.tokenProgram;
|
|
24017
24146
|
if (!tokenProgramAddress) throw Error("Withdraw mint not found");
|
|
24018
24147
|
if (!this.client.bankMetadataMap) throw Error("Bank metadata map not found");
|
|
24019
|
-
return this._lendrAccount.makeWithdrawWithSessionIx(this._program, this.client.banks, this.client.mintDatas, this.client.bankMetadataMap, amount, bankAddress, session, withdrawAll, withdrawOpts);
|
|
24148
|
+
return this._lendrAccount.makeWithdrawWithSessionIx(this._program, this.client.banks, this.client.mintDatas, this.client.bankMetadataMap, amount, bankAddress, session$1, withdrawAll, withdrawOpts);
|
|
24020
24149
|
}
|
|
24021
24150
|
/**
|
|
24022
24151
|
* Creates a transaction for withdrawing tokens from a lendr bank account and staking them.
|
|
@@ -24110,9 +24239,9 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24110
24239
|
* @param withdrawOpts - Optional parameters for the withdraw instructions
|
|
24111
24240
|
* @returns A transaction object ready to be signed and sent
|
|
24112
24241
|
*/
|
|
24113
|
-
async makeWithdrawAllWithSessionTx(banks, session, withdrawOpts = {}) {
|
|
24242
|
+
async makeWithdrawAllWithSessionTx(banks, session$1, withdrawOpts = {}) {
|
|
24114
24243
|
this.client.logger.debug({ address: this.address.toBase58() }, "[lendr:lendr-account:withdraw-all-with-session] Withdrawing all from lendr account");
|
|
24115
|
-
const withdrawIxsWrapped = await Promise.all(banks.map((bank) => this.makeWithdrawWithSessionIx(bank.amount, bank.bankAddress, session, true, withdrawOpts)));
|
|
24244
|
+
const withdrawIxsWrapped = await Promise.all(banks.map((bank) => this.makeWithdrawWithSessionIx(bank.amount, bank.bankAddress, session$1, true, withdrawOpts)));
|
|
24116
24245
|
return this.finalizeWithdrawAllTransaction(withdrawIxsWrapped);
|
|
24117
24246
|
}
|
|
24118
24247
|
async finalizeWithdrawAllTransaction(withdrawIxsWrapped) {
|
|
@@ -24161,14 +24290,14 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24161
24290
|
* @param withdrawOpts - Optional withdraw configuration parameters
|
|
24162
24291
|
* @returns Array of transaction signatures - includes signatures for any required oracle feed updates followed by the withdraw transaction
|
|
24163
24292
|
*/
|
|
24164
|
-
async withdrawWithSession(amount, bankAddress, session, withdrawAll = false, withdrawOpts = {}) {
|
|
24293
|
+
async withdrawWithSession(amount, bankAddress, session$1, withdrawAll = false, withdrawOpts = {}) {
|
|
24165
24294
|
this.client.logger.debug({
|
|
24166
24295
|
address: this.address.toBase58(),
|
|
24167
24296
|
amount,
|
|
24168
|
-
sessionKey: session.sessionPublicKey
|
|
24297
|
+
sessionKey: session$1.sessionPublicKey
|
|
24169
24298
|
}, "[lendr:lendr-account:withdrawWithSession] Withdrawing from lendr account");
|
|
24170
|
-
const { instructions: instructions$3 } = await this.makeWithdrawWithSessionTx(amount, bankAddress, session, withdrawAll, withdrawOpts);
|
|
24171
|
-
const txResult = await session.sendTransaction(instructions$3);
|
|
24299
|
+
const { instructions: instructions$3 } = await this.makeWithdrawWithSessionTx(amount, bankAddress, session$1, withdrawAll, withdrawOpts);
|
|
24300
|
+
const txResult = await session$1.sendTransaction(instructions$3, { variation: "LendingAccountWithdraw" });
|
|
24172
24301
|
this.client.logger.debug({
|
|
24173
24302
|
address: this.address.toBase58(),
|
|
24174
24303
|
txResult
|
|
@@ -24226,10 +24355,10 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24226
24355
|
* @param withdrawOpts - Optional withdraw configuration parameters
|
|
24227
24356
|
* @returns Object containing feed crank transactions and the withdraw transaction
|
|
24228
24357
|
*/
|
|
24229
|
-
async makeWithdrawWithSessionTx(amount, bankAddress, session, withdrawAll = false, withdrawOpts = {}) {
|
|
24358
|
+
async makeWithdrawWithSessionTx(amount, bankAddress, session$1, withdrawAll = false, withdrawOpts = {}) {
|
|
24230
24359
|
const cuRequestIxs = this.makeComputeBudgetIx();
|
|
24231
24360
|
const { instructions: updateFeedIxs, luts: feedLuts } = await this.makeUpdateFeedIx([]);
|
|
24232
|
-
const withdrawIxs = await this.makeWithdrawWithSessionIx(amount, bankAddress, session, withdrawAll, withdrawOpts);
|
|
24361
|
+
const withdrawIxs = await this.makeWithdrawWithSessionIx(amount, bankAddress, session$1, withdrawAll, withdrawOpts);
|
|
24233
24362
|
const { value: { blockhash } } = await this._program.provider.connection.getLatestBlockhashAndContext("confirmed");
|
|
24234
24363
|
const feedCrankTxs = [];
|
|
24235
24364
|
if (updateFeedIxs.length > 0) {
|
|
@@ -24286,11 +24415,11 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24286
24415
|
* @param borrowOpts - Optional borrow configuration parameters
|
|
24287
24416
|
* @returns An InstructionsWrapper containing the borrow instructions
|
|
24288
24417
|
*/
|
|
24289
|
-
async makeBorrowWithSessionIx(amount, bankAddress, session, borrowOpts = {}) {
|
|
24418
|
+
async makeBorrowWithSessionIx(amount, bankAddress, session$1, borrowOpts = {}) {
|
|
24290
24419
|
const tokenProgramAddress = this.client.mintDatas.get(bankAddress.toBase58())?.tokenProgram;
|
|
24291
24420
|
if (!tokenProgramAddress) throw Error("Borrow mint not found");
|
|
24292
24421
|
if (!this.client.bankMetadataMap) throw Error("Bank metadata map not found");
|
|
24293
|
-
return this._lendrAccount.makeBorrowWithSessionIx(this._program, this.client.banks, this.client.mintDatas, this.client.bankMetadataMap, amount, bankAddress, session, borrowOpts);
|
|
24422
|
+
return this._lendrAccount.makeBorrowWithSessionIx(this._program, this.client.banks, this.client.mintDatas, this.client.bankMetadataMap, amount, bankAddress, session$1, borrowOpts);
|
|
24294
24423
|
}
|
|
24295
24424
|
/**
|
|
24296
24425
|
* Borrows tokens from a lendr bank account.
|
|
@@ -24324,14 +24453,14 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24324
24453
|
* @param borrowOpts - Optional borrow configuration parameters
|
|
24325
24454
|
* @returns Array of transaction signatures from the borrow operation
|
|
24326
24455
|
*/
|
|
24327
|
-
async borrowWithSession(amount, bankAddress, session, borrowOpts = {}) {
|
|
24456
|
+
async borrowWithSession(amount, bankAddress, session$1, borrowOpts = {}) {
|
|
24328
24457
|
this.client.logger.debug({
|
|
24329
24458
|
address: this.address.toBase58(),
|
|
24330
24459
|
amount,
|
|
24331
|
-
sessionKey: session.sessionPublicKey
|
|
24460
|
+
sessionKey: session$1.sessionPublicKey
|
|
24332
24461
|
}, "[lendr:lendr-account:borrowWithSession] Borrowing from lendr account");
|
|
24333
|
-
const { instructions: instructions$3 } = await this.makeBorrowWithSessionTx(amount, bankAddress, session, borrowOpts);
|
|
24334
|
-
const txResult = await session.sendTransaction(instructions$3);
|
|
24462
|
+
const { instructions: instructions$3 } = await this.makeBorrowWithSessionTx(amount, bankAddress, session$1, borrowOpts);
|
|
24463
|
+
const txResult = await session$1.sendTransaction(instructions$3, { variation: "LendingAccountBorrow" });
|
|
24335
24464
|
this.client.logger.debug({
|
|
24336
24465
|
address: this.address.toBase58(),
|
|
24337
24466
|
txResult
|
|
@@ -24387,10 +24516,10 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24387
24516
|
* @param borrowOpts - Optional borrow configuration parameters
|
|
24388
24517
|
* @returns Object containing feed crank transactions and the borrow transaction
|
|
24389
24518
|
*/
|
|
24390
|
-
async makeBorrowWithSessionTx(amount, bankAddress, session, borrowOpts = {}) {
|
|
24519
|
+
async makeBorrowWithSessionTx(amount, bankAddress, session$1, borrowOpts = {}) {
|
|
24391
24520
|
const cuRequestIxs = this.makeComputeBudgetIx();
|
|
24392
24521
|
const { instructions: updateFeedIxs, luts: feedLuts } = await this.makeUpdateFeedIx([bankAddress]);
|
|
24393
|
-
const borrowIxs = await this.makeBorrowWithSessionIx(amount, bankAddress, session, borrowOpts);
|
|
24522
|
+
const borrowIxs = await this.makeBorrowWithSessionIx(amount, bankAddress, session$1, borrowOpts);
|
|
24394
24523
|
const { value: { blockhash } } = await this._program.provider.connection.getLatestBlockhashAndContext("confirmed");
|
|
24395
24524
|
const feedCrankTxs = [];
|
|
24396
24525
|
if (updateFeedIxs.length > 0) {
|
|
@@ -24542,8 +24671,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24542
24671
|
* @param session - established session state
|
|
24543
24672
|
* @returns An InstructionsWrapper containing the begin flash loan instruction
|
|
24544
24673
|
*/
|
|
24545
|
-
async makeBeginFlashLoanWithSessionIx(endIndex, session) {
|
|
24546
|
-
return this._lendrAccount.makeBeginFlashLoanWithSessionIx(this._program, endIndex, session.sessionPublicKey);
|
|
24674
|
+
async makeBeginFlashLoanWithSessionIx(endIndex, session$1) {
|
|
24675
|
+
return this._lendrAccount.makeBeginFlashLoanWithSessionIx(this._program, endIndex, session$1.sessionPublicKey);
|
|
24547
24676
|
}
|
|
24548
24677
|
/**
|
|
24549
24678
|
* Creates an instruction to end a flash loan operation.
|
|
@@ -24561,8 +24690,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24561
24690
|
* @param session - established session state
|
|
24562
24691
|
* @returns An InstructionsWrapper containing the end flash loan instruction
|
|
24563
24692
|
*/
|
|
24564
|
-
async makeEndFlashLoanWithSessionIx(projectedActiveBalances, session) {
|
|
24565
|
-
return this._lendrAccount.makeEndFlashLoanWithSessionIx(this._program, this.client.banks, projectedActiveBalances, session.sessionPublicKey);
|
|
24693
|
+
async makeEndFlashLoanWithSessionIx(projectedActiveBalances, session$1) {
|
|
24694
|
+
return this._lendrAccount.makeEndFlashLoanWithSessionIx(this._program, this.client.banks, projectedActiveBalances, session$1.sessionPublicKey);
|
|
24566
24695
|
}
|
|
24567
24696
|
async flashLoan(args, processOpts, txOpts) {
|
|
24568
24697
|
this.client.logger.debug({ address: this.address.toBase58() }, "[lendr:lendr-account:flashLoan] Executing flashloan from lendr account");
|
|
@@ -24575,11 +24704,11 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24575
24704
|
}, "[lendr:lendr-account:flashLoan] Flashloan successful");
|
|
24576
24705
|
return sig;
|
|
24577
24706
|
}
|
|
24578
|
-
async flashLoanWithSession(args, session) {
|
|
24707
|
+
async flashLoanWithSession(args, session$1) {
|
|
24579
24708
|
this.client.logger.debug({ address: this.address.toBase58() }, "[lendr:lendr-account:flashLoanWithSession] Executing flashloan from lendr account using session");
|
|
24580
24709
|
const clientLookupTables = await getClientAddressLookupTableAccounts(this.client);
|
|
24581
|
-
const tx = await this.buildFlashLoanWithSessionTx(args, session, clientLookupTables);
|
|
24582
|
-
const txResult = await session.sendTransaction(tx);
|
|
24710
|
+
const tx = await this.buildFlashLoanWithSessionTx(args, session$1, clientLookupTables);
|
|
24711
|
+
const txResult = await session$1.sendTransaction(tx);
|
|
24583
24712
|
this.client.logger.debug({
|
|
24584
24713
|
address: this.address.toBase58(),
|
|
24585
24714
|
sig: txResult.signature
|
|
@@ -24612,11 +24741,11 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24612
24741
|
}
|
|
24613
24742
|
return tx;
|
|
24614
24743
|
}
|
|
24615
|
-
async buildFlashLoanWithSessionTx(args, session, lookupTables) {
|
|
24744
|
+
async buildFlashLoanWithSessionTx(args, session$1, lookupTables) {
|
|
24616
24745
|
const endIndex = args.ixs.length + 1;
|
|
24617
24746
|
const projectedActiveBalances = this._lendrAccount.projectActiveBalancesNoCpi(this._program, args.ixs);
|
|
24618
|
-
const beginFlashLoanIx = await this.makeBeginFlashLoanWithSessionIx(endIndex, session);
|
|
24619
|
-
const endFlashLoanIx = await this.makeEndFlashLoanWithSessionIx(projectedActiveBalances, session);
|
|
24747
|
+
const beginFlashLoanIx = await this.makeBeginFlashLoanWithSessionIx(endIndex, session$1);
|
|
24748
|
+
const endFlashLoanIx = await this.makeEndFlashLoanWithSessionIx(projectedActiveBalances, session$1);
|
|
24620
24749
|
const flashloanIxs = [
|
|
24621
24750
|
...beginFlashLoanIx.instructions,
|
|
24622
24751
|
...args.ixs,
|
|
@@ -24625,7 +24754,7 @@ var LendrAccountWrapper = class LendrAccountWrapper {
|
|
|
24625
24754
|
const totalLookupTables = lookupTables || [];
|
|
24626
24755
|
const blockhash = args.blockhash ?? (await this._program.provider.connection.getLatestBlockhash("confirmed")).blockhash;
|
|
24627
24756
|
const message = new TransactionMessage({
|
|
24628
|
-
payerKey: session.payer,
|
|
24757
|
+
payerKey: session$1.payer,
|
|
24629
24758
|
recentBlockhash: blockhash,
|
|
24630
24759
|
instructions: flashloanIxs
|
|
24631
24760
|
}).compileToV0Message(totalLookupTables);
|
|
@@ -25359,12 +25488,12 @@ var LendrClient = class LendrClient {
|
|
|
25359
25488
|
keys: []
|
|
25360
25489
|
};
|
|
25361
25490
|
}
|
|
25362
|
-
async makeCreateLendrAccountWithSessionIx(session, accountIndex, thirdPartyId) {
|
|
25363
|
-
this.logger.debug({ for: session.walletPublicKey.toBase58() }, "Generating lendr account init with session ix");
|
|
25491
|
+
async makeCreateLendrAccountWithSessionIx(session$1, accountIndex, thirdPartyId) {
|
|
25492
|
+
this.logger.debug({ for: session$1.walletPublicKey.toBase58() }, "Generating lendr account init with session ix");
|
|
25364
25493
|
const initLendrAccountIx = await instructions_default.makeInitLendrAccountWithSessionIx(this.program, {
|
|
25365
25494
|
lendrGroup: this.groupAddress,
|
|
25366
|
-
session,
|
|
25367
|
-
feePayer: session.payer
|
|
25495
|
+
session: session$1,
|
|
25496
|
+
feePayer: session$1.payer
|
|
25368
25497
|
}, accountIndex, thirdPartyId);
|
|
25369
25498
|
const ixs = [initLendrAccountIx];
|
|
25370
25499
|
this.logger.debug({
|
|
@@ -25407,15 +25536,15 @@ var LendrClient = class LendrClient {
|
|
|
25407
25536
|
*
|
|
25408
25537
|
* @returns Object containing the transaction signature and the created LendrAccount instance
|
|
25409
25538
|
*/
|
|
25410
|
-
async createLendrAccountWithSession(session, commitment, accountIndex = 0, thirdPartyId) {
|
|
25411
|
-
const tx = await this.createLendrAccountWithSessionTx(session, accountIndex, thirdPartyId);
|
|
25412
|
-
const txResult = await session.sendTransaction(tx);
|
|
25539
|
+
async createLendrAccountWithSession(session$1, commitment, accountIndex = 0, thirdPartyId) {
|
|
25540
|
+
const tx = await this.createLendrAccountWithSessionTx(session$1, accountIndex, thirdPartyId);
|
|
25541
|
+
const txResult = await session$1.sendTransaction(tx, { variation: "LendrAccountInitialize" });
|
|
25413
25542
|
this.logger.debug({ txResult }, "Created Lendr account (using session)");
|
|
25414
25543
|
const thirdPartyIdValue = thirdPartyId ?? 0;
|
|
25415
25544
|
const [accountPublicKey] = PublicKey.findProgramAddressSync([
|
|
25416
25545
|
Buffer.from("lendr_account"),
|
|
25417
25546
|
this.groupAddress.toBuffer(),
|
|
25418
|
-
session.walletPublicKey.toBuffer(),
|
|
25547
|
+
session$1.walletPublicKey.toBuffer(),
|
|
25419
25548
|
Buffer.from(new Uint16Array([accountIndex]).buffer),
|
|
25420
25549
|
Buffer.from(new Uint16Array([thirdPartyIdValue]).buffer)
|
|
25421
25550
|
], this.programId);
|
|
@@ -25478,9 +25607,9 @@ var LendrClient = class LendrClient {
|
|
|
25478
25607
|
}
|
|
25479
25608
|
return tx;
|
|
25480
25609
|
}
|
|
25481
|
-
async createLendrAccountWithSessionTx(session, accountIndex, thirdPartyId) {
|
|
25482
|
-
const ixs = await this.makeCreateLendrAccountWithSessionIx(session, accountIndex, thirdPartyId);
|
|
25483
|
-
return this.createVersionTransaction(ixs.instructions, session.payer, [...ixs.keys], { type: TransactionType.CREATE_ACCOUNT });
|
|
25610
|
+
async createLendrAccountWithSessionTx(session$1, accountIndex, thirdPartyId) {
|
|
25611
|
+
const ixs = await this.makeCreateLendrAccountWithSessionIx(session$1, accountIndex, thirdPartyId);
|
|
25612
|
+
return this.createVersionTransaction(ixs.instructions, session$1.payer, [...ixs.keys], { type: TransactionType.CREATE_ACCOUNT });
|
|
25484
25613
|
}
|
|
25485
25614
|
/**
|
|
25486
25615
|
* Create transaction instruction to initialize a new group.
|