@haven-fi/solauto-sdk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/index.d.ts +2 -0
- package/dist/clients/index.d.ts.map +1 -0
- package/dist/clients/index.js +17 -0
- package/dist/clients/solautoClient.d.ts +73 -0
- package/dist/clients/solautoClient.d.ts.map +1 -0
- package/dist/clients/solautoClient.js +416 -0
- package/dist/clients/solautoMarginfiClient.d.ts +40 -0
- package/dist/clients/solautoMarginfiClient.d.ts.map +1 -0
- package/dist/clients/solautoMarginfiClient.js +313 -0
- package/dist/constants/generalAccounts.d.ts +5 -0
- package/dist/constants/generalAccounts.d.ts.map +1 -0
- package/dist/constants/generalAccounts.js +8 -0
- package/dist/constants/index.d.ts +6 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +21 -0
- package/dist/constants/marginfiAccounts.d.ts +7 -0
- package/dist/constants/marginfiAccounts.d.ts.map +1 -0
- package/dist/constants/marginfiAccounts.js +23 -0
- package/dist/constants/pythConstants.d.ts +5 -0
- package/dist/constants/pythConstants.d.ts.map +1 -0
- package/dist/constants/pythConstants.js +10 -0
- package/dist/constants/solautoConstants.d.ts +19 -0
- package/dist/constants/solautoConstants.d.ts.map +1 -0
- package/dist/constants/solautoConstants.js +35 -0
- package/dist/constants/tokenConstants.d.ts +3 -0
- package/dist/constants/tokenConstants.d.ts.map +1 -0
- package/dist/constants/tokenConstants.js +10 -0
- package/dist/generated/accounts/index.d.ts +10 -0
- package/dist/generated/accounts/index.d.ts.map +1 -0
- package/dist/generated/accounts/index.js +25 -0
- package/dist/generated/accounts/referralState.d.ts +37 -0
- package/dist/generated/accounts/referralState.d.ts.map +1 -0
- package/dist/generated/accounts/referralState.js +73 -0
- package/dist/generated/accounts/solautoPosition.d.ts +58 -0
- package/dist/generated/accounts/solautoPosition.d.ts.map +1 -0
- package/dist/generated/accounts/solautoPosition.js +82 -0
- package/dist/generated/errors/index.d.ts +9 -0
- package/dist/generated/errors/index.d.ts.map +1 -0
- package/dist/generated/errors/index.js +24 -0
- package/dist/generated/errors/solauto.d.ts +91 -0
- package/dist/generated/errors/solauto.d.ts.map +1 -0
- package/dist/generated/errors/solauto.js +163 -0
- package/dist/generated/index.d.ts +14 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +29 -0
- package/dist/generated/instructions/cancelDCA.d.ts +26 -0
- package/dist/generated/instructions/cancelDCA.d.ts.map +1 -0
- package/dist/generated/instructions/cancelDCA.js +92 -0
- package/dist/generated/instructions/claimReferralFees.d.ts +26 -0
- package/dist/generated/instructions/claimReferralFees.d.ts.map +1 -0
- package/dist/generated/instructions/claimReferralFees.js +87 -0
- package/dist/generated/instructions/closePosition.d.ts +28 -0
- package/dist/generated/instructions/closePosition.d.ts.map +1 -0
- package/dist/generated/instructions/closePosition.js +102 -0
- package/dist/generated/instructions/convertReferralFees.d.ts +27 -0
- package/dist/generated/instructions/convertReferralFees.d.ts.map +1 -0
- package/dist/generated/instructions/convertReferralFees.js +96 -0
- package/dist/generated/instructions/index.d.ts +18 -0
- package/dist/generated/instructions/index.d.ts.map +1 -0
- package/dist/generated/instructions/index.js +33 -0
- package/dist/generated/instructions/marginfiOpenPosition.d.ts +46 -0
- package/dist/generated/instructions/marginfiOpenPosition.d.ts.map +1 -0
- package/dist/generated/instructions/marginfiOpenPosition.js +161 -0
- package/dist/generated/instructions/marginfiProtocolInteraction.d.ts +42 -0
- package/dist/generated/instructions/marginfiProtocolInteraction.d.ts.map +1 -0
- package/dist/generated/instructions/marginfiProtocolInteraction.js +150 -0
- package/dist/generated/instructions/marginfiRebalance.d.ts +49 -0
- package/dist/generated/instructions/marginfiRebalance.d.ts.map +1 -0
- package/dist/generated/instructions/marginfiRebalance.js +164 -0
- package/dist/generated/instructions/marginfiRefreshData.d.ts +27 -0
- package/dist/generated/instructions/marginfiRefreshData.d.ts.map +1 -0
- package/dist/generated/instructions/marginfiRefreshData.js +84 -0
- package/dist/generated/instructions/updatePosition.d.ts +30 -0
- package/dist/generated/instructions/updatePosition.d.ts.map +1 -0
- package/dist/generated/instructions/updatePosition.js +87 -0
- package/dist/generated/instructions/updateReferralStates.d.ts +30 -0
- package/dist/generated/instructions/updateReferralStates.d.ts.map +1 -0
- package/dist/generated/instructions/updateReferralStates.js +77 -0
- package/dist/generated/programs/index.d.ts +9 -0
- package/dist/generated/programs/index.d.ts.map +1 -0
- package/dist/generated/programs/index.js +24 -0
- package/dist/generated/programs/solauto.d.ts +13 -0
- package/dist/generated/programs/solauto.d.ts.map +1 -0
- package/dist/generated/programs/solauto.js +36 -0
- package/dist/generated/shared/index.d.ts +54 -0
- package/dist/generated/shared/index.d.ts.map +1 -0
- package/dist/generated/shared/index.js +70 -0
- package/dist/generated/types/automationSettings.d.ts +26 -0
- package/dist/generated/types/automationSettings.d.ts.map +1 -0
- package/dist/generated/types/automationSettings.js +22 -0
- package/dist/generated/types/automationSettingsInp.d.ts +22 -0
- package/dist/generated/types/automationSettingsInp.d.ts.map +1 -0
- package/dist/generated/types/automationSettingsInp.js +20 -0
- package/dist/generated/types/dCASettings.d.ts +21 -0
- package/dist/generated/types/dCASettings.d.ts.map +1 -0
- package/dist/generated/types/dCASettings.js +20 -0
- package/dist/generated/types/dCASettingsInp.d.ts +19 -0
- package/dist/generated/types/dCASettingsInp.d.ts.map +1 -0
- package/dist/generated/types/dCASettingsInp.js +19 -0
- package/dist/generated/types/feeType.d.ts +15 -0
- package/dist/generated/types/feeType.d.ts.map +1 -0
- package/dist/generated/types/feeType.js +20 -0
- package/dist/generated/types/index.d.ts +26 -0
- package/dist/generated/types/index.d.ts.map +1 -0
- package/dist/generated/types/index.js +41 -0
- package/dist/generated/types/lendingPlatform.d.ts +16 -0
- package/dist/generated/types/lendingPlatform.d.ts.map +1 -0
- package/dist/generated/types/lendingPlatform.js +23 -0
- package/dist/generated/types/podBool.d.ts +14 -0
- package/dist/generated/types/podBool.d.ts.map +1 -0
- package/dist/generated/types/podBool.js +17 -0
- package/dist/generated/types/positionData.d.ts +32 -0
- package/dist/generated/types/positionData.d.ts.map +1 -0
- package/dist/generated/types/positionData.js +25 -0
- package/dist/generated/types/positionState.d.ts +35 -0
- package/dist/generated/types/positionState.d.ts.map +1 -0
- package/dist/generated/types/positionState.js +27 -0
- package/dist/generated/types/positionTokenUsage.d.ts +36 -0
- package/dist/generated/types/positionTokenUsage.d.ts.map +1 -0
- package/dist/generated/types/positionTokenUsage.js +27 -0
- package/dist/generated/types/rebalanceData.d.ts +29 -0
- package/dist/generated/types/rebalanceData.d.ts.map +1 -0
- package/dist/generated/types/rebalanceData.js +24 -0
- package/dist/generated/types/solautoAction.d.ts +44 -0
- package/dist/generated/types/solautoAction.d.ts.map +1 -0
- package/dist/generated/types/solautoAction.js +51 -0
- package/dist/generated/types/solautoRebalanceType.d.ts +17 -0
- package/dist/generated/types/solautoRebalanceType.d.ts.map +1 -0
- package/dist/generated/types/solautoRebalanceType.js +24 -0
- package/dist/generated/types/solautoSettingsParameters.d.ts +31 -0
- package/dist/generated/types/solautoSettingsParameters.d.ts.map +1 -0
- package/dist/generated/types/solautoSettingsParameters.js +25 -0
- package/dist/generated/types/solautoSettingsParametersInp.d.ts +28 -0
- package/dist/generated/types/solautoSettingsParametersInp.d.ts.map +1 -0
- package/dist/generated/types/solautoSettingsParametersInp.js +23 -0
- package/dist/generated/types/tokenAmount.d.ts +18 -0
- package/dist/generated/types/tokenAmount.d.ts.map +1 -0
- package/dist/generated/types/tokenAmount.js +18 -0
- package/dist/generated/types/tokenBalanceAmount.d.ts +27 -0
- package/dist/generated/types/tokenBalanceAmount.d.ts.map +1 -0
- package/dist/generated/types/tokenBalanceAmount.js +33 -0
- package/dist/generated/types/updatePositionData.d.ts +22 -0
- package/dist/generated/types/updatePositionData.d.ts.map +1 -0
- package/dist/generated/types/updatePositionData.js +20 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/marginfi-sdk/accounts/bank.d.ts +136 -0
- package/dist/marginfi-sdk/accounts/bank.d.ts.map +1 -0
- package/dist/marginfi-sdk/accounts/bank.js +124 -0
- package/dist/marginfi-sdk/accounts/index.d.ts +11 -0
- package/dist/marginfi-sdk/accounts/index.d.ts.map +1 -0
- package/dist/marginfi-sdk/accounts/index.js +26 -0
- package/dist/marginfi-sdk/accounts/marginfiAccount.d.ts +58 -0
- package/dist/marginfi-sdk/accounts/marginfiAccount.d.ts.map +1 -0
- package/dist/marginfi-sdk/accounts/marginfiAccount.js +76 -0
- package/dist/marginfi-sdk/accounts/marginfiGroup.d.ts +35 -0
- package/dist/marginfi-sdk/accounts/marginfiGroup.d.ts.map +1 -0
- package/dist/marginfi-sdk/accounts/marginfiGroup.js +71 -0
- package/dist/marginfi-sdk/errors/index.d.ts +9 -0
- package/dist/marginfi-sdk/errors/index.d.ts.map +1 -0
- package/dist/marginfi-sdk/errors/index.js +24 -0
- package/dist/marginfi-sdk/errors/marginfi.d.ts +283 -0
- package/dist/marginfi-sdk/errors/marginfi.d.ts.map +1 -0
- package/dist/marginfi-sdk/errors/marginfi.js +515 -0
- package/dist/marginfi-sdk/index.d.ts +14 -0
- package/dist/marginfi-sdk/index.d.ts.map +1 -0
- package/dist/marginfi-sdk/index.js +29 -0
- package/dist/marginfi-sdk/instructions/index.d.ts +32 -0
- package/dist/marginfi-sdk/instructions/index.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/index.js +47 -0
- package/dist/marginfi-sdk/instructions/lendingAccountBorrow.d.ts +30 -0
- package/dist/marginfi-sdk/instructions/lendingAccountBorrow.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountBorrow.js +83 -0
- package/dist/marginfi-sdk/instructions/lendingAccountCloseBalance.d.ts +22 -0
- package/dist/marginfi-sdk/instructions/lendingAccountCloseBalance.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountCloseBalance.js +53 -0
- package/dist/marginfi-sdk/instructions/lendingAccountDeposit.d.ts +29 -0
- package/dist/marginfi-sdk/instructions/lendingAccountDeposit.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountDeposit.js +81 -0
- package/dist/marginfi-sdk/instructions/lendingAccountEndFlashloan.d.ts +20 -0
- package/dist/marginfi-sdk/instructions/lendingAccountEndFlashloan.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountEndFlashloan.js +50 -0
- package/dist/marginfi-sdk/instructions/lendingAccountLiquidate.d.ts +32 -0
- package/dist/marginfi-sdk/instructions/lendingAccountLiquidate.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountLiquidate.js +100 -0
- package/dist/marginfi-sdk/instructions/lendingAccountRepay.d.ts +31 -0
- package/dist/marginfi-sdk/instructions/lendingAccountRepay.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountRepay.js +82 -0
- package/dist/marginfi-sdk/instructions/lendingAccountSettleEmissions.d.ts +20 -0
- package/dist/marginfi-sdk/instructions/lendingAccountSettleEmissions.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountSettleEmissions.js +46 -0
- package/dist/marginfi-sdk/instructions/lendingAccountStartFlashloan.d.ts +25 -0
- package/dist/marginfi-sdk/instructions/lendingAccountStartFlashloan.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountStartFlashloan.js +62 -0
- package/dist/marginfi-sdk/instructions/lendingAccountWithdraw.d.ts +32 -0
- package/dist/marginfi-sdk/instructions/lendingAccountWithdraw.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountWithdraw.js +87 -0
- package/dist/marginfi-sdk/instructions/lendingAccountWithdrawEmissions.d.ts +27 -0
- package/dist/marginfi-sdk/instructions/lendingAccountWithdrawEmissions.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingAccountWithdrawEmissions.js +86 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAccrueBankInterest.d.ts +20 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAccrueBankInterest.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAccrueBankInterest.js +46 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAddBank.d.ts +37 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAddBank.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAddBank.js +127 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAddBankWithSeed.d.ts +39 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAddBankWithSeed.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingPoolAddBankWithSeed.js +128 -0
- package/dist/marginfi-sdk/instructions/lendingPoolCollectBankFees.d.ts +25 -0
- package/dist/marginfi-sdk/instructions/lendingPoolCollectBankFees.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingPoolCollectBankFees.js +76 -0
- package/dist/marginfi-sdk/instructions/lendingPoolConfigureBank.d.ts +46 -0
- package/dist/marginfi-sdk/instructions/lendingPoolConfigureBank.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingPoolConfigureBank.js +67 -0
- package/dist/marginfi-sdk/instructions/lendingPoolHandleBankruptcy.d.ts +26 -0
- package/dist/marginfi-sdk/instructions/lendingPoolHandleBankruptcy.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingPoolHandleBankruptcy.js +81 -0
- package/dist/marginfi-sdk/instructions/lendingPoolSetupEmissions.d.ts +35 -0
- package/dist/marginfi-sdk/instructions/lendingPoolSetupEmissions.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingPoolSetupEmissions.js +97 -0
- package/dist/marginfi-sdk/instructions/lendingPoolUpdateEmissionsParameters.d.ts +33 -0
- package/dist/marginfi-sdk/instructions/lendingPoolUpdateEmissionsParameters.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/lendingPoolUpdateEmissionsParameters.js +85 -0
- package/dist/marginfi-sdk/instructions/marginfiAccountInitialize.d.ts +23 -0
- package/dist/marginfi-sdk/instructions/marginfiAccountInitialize.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/marginfiAccountInitialize.js +76 -0
- package/dist/marginfi-sdk/instructions/marginfiGroupConfigure.d.ts +24 -0
- package/dist/marginfi-sdk/instructions/marginfiGroupConfigure.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/marginfiGroupConfigure.js +52 -0
- package/dist/marginfi-sdk/instructions/marginfiGroupInitialize.d.ts +21 -0
- package/dist/marginfi-sdk/instructions/marginfiGroupInitialize.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/marginfiGroupInitialize.js +57 -0
- package/dist/marginfi-sdk/instructions/setAccountFlag.d.ts +26 -0
- package/dist/marginfi-sdk/instructions/setAccountFlag.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/setAccountFlag.js +60 -0
- package/dist/marginfi-sdk/instructions/setNewAccountAuthority.d.ts +23 -0
- package/dist/marginfi-sdk/instructions/setNewAccountAuthority.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/setNewAccountAuthority.js +69 -0
- package/dist/marginfi-sdk/instructions/unsetAccountFlag.d.ts +26 -0
- package/dist/marginfi-sdk/instructions/unsetAccountFlag.d.ts.map +1 -0
- package/dist/marginfi-sdk/instructions/unsetAccountFlag.js +57 -0
- package/dist/marginfi-sdk/programs/index.d.ts +9 -0
- package/dist/marginfi-sdk/programs/index.d.ts.map +1 -0
- package/dist/marginfi-sdk/programs/index.js +24 -0
- package/dist/marginfi-sdk/programs/marginfi.d.ts +13 -0
- package/dist/marginfi-sdk/programs/marginfi.d.ts.map +1 -0
- package/dist/marginfi-sdk/programs/marginfi.js +36 -0
- package/dist/marginfi-sdk/shared/index.d.ts +54 -0
- package/dist/marginfi-sdk/shared/index.d.ts.map +1 -0
- package/dist/marginfi-sdk/shared/index.js +70 -0
- package/dist/marginfi-sdk/types/accountEventHeader.d.ts +23 -0
- package/dist/marginfi-sdk/types/accountEventHeader.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/accountEventHeader.js +20 -0
- package/dist/marginfi-sdk/types/balance.d.ts +32 -0
- package/dist/marginfi-sdk/types/balance.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/balance.js +25 -0
- package/dist/marginfi-sdk/types/balanceDecreaseType.d.ts +17 -0
- package/dist/marginfi-sdk/types/balanceDecreaseType.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/balanceDecreaseType.js +24 -0
- package/dist/marginfi-sdk/types/balanceIncreaseType.d.ts +17 -0
- package/dist/marginfi-sdk/types/balanceIncreaseType.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/balanceIncreaseType.js +24 -0
- package/dist/marginfi-sdk/types/balanceSide.d.ts +15 -0
- package/dist/marginfi-sdk/types/balanceSide.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/balanceSide.js +22 -0
- package/dist/marginfi-sdk/types/bankConfig.d.ts +67 -0
- package/dist/marginfi-sdk/types/bankConfig.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/bankConfig.js +32 -0
- package/dist/marginfi-sdk/types/bankConfigCompact.d.ts +65 -0
- package/dist/marginfi-sdk/types/bankConfigCompact.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/bankConfigCompact.js +31 -0
- package/dist/marginfi-sdk/types/bankOperationalState.d.ts +16 -0
- package/dist/marginfi-sdk/types/bankOperationalState.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/bankOperationalState.js +23 -0
- package/dist/marginfi-sdk/types/bankVaultType.d.ts +16 -0
- package/dist/marginfi-sdk/types/bankVaultType.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/bankVaultType.js +23 -0
- package/dist/marginfi-sdk/types/groupEventHeader.d.ts +19 -0
- package/dist/marginfi-sdk/types/groupEventHeader.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/groupEventHeader.js +18 -0
- package/dist/marginfi-sdk/types/index.d.ts +31 -0
- package/dist/marginfi-sdk/types/index.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/index.js +46 -0
- package/dist/marginfi-sdk/types/interestRateConfig.d.ts +31 -0
- package/dist/marginfi-sdk/types/interestRateConfig.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/interestRateConfig.js +25 -0
- package/dist/marginfi-sdk/types/interestRateConfigCompact.d.ts +29 -0
- package/dist/marginfi-sdk/types/interestRateConfigCompact.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/interestRateConfigCompact.js +24 -0
- package/dist/marginfi-sdk/types/interestRateConfigOpt.d.ts +30 -0
- package/dist/marginfi-sdk/types/interestRateConfigOpt.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/interestRateConfigOpt.js +24 -0
- package/dist/marginfi-sdk/types/lendingAccount.d.ts +19 -0
- package/dist/marginfi-sdk/types/lendingAccount.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/lendingAccount.js +19 -0
- package/dist/marginfi-sdk/types/liquidationBalances.d.ts +17 -0
- package/dist/marginfi-sdk/types/liquidationBalances.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/liquidationBalances.js +20 -0
- package/dist/marginfi-sdk/types/oracleConfig.d.ts +20 -0
- package/dist/marginfi-sdk/types/oracleConfig.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/oracleConfig.js +19 -0
- package/dist/marginfi-sdk/types/oraclePriceType.d.ts +15 -0
- package/dist/marginfi-sdk/types/oraclePriceType.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/oraclePriceType.js +22 -0
- package/dist/marginfi-sdk/types/oracleSetup.d.ts +17 -0
- package/dist/marginfi-sdk/types/oracleSetup.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/oracleSetup.js +24 -0
- package/dist/marginfi-sdk/types/priceBias.d.ts +15 -0
- package/dist/marginfi-sdk/types/priceBias.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/priceBias.js +22 -0
- package/dist/marginfi-sdk/types/requirementType.d.ts +16 -0
- package/dist/marginfi-sdk/types/requirementType.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/requirementType.js +23 -0
- package/dist/marginfi-sdk/types/riskRequirementType.d.ts +16 -0
- package/dist/marginfi-sdk/types/riskRequirementType.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/riskRequirementType.js +23 -0
- package/dist/marginfi-sdk/types/riskTier.d.ts +15 -0
- package/dist/marginfi-sdk/types/riskTier.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/riskTier.js +22 -0
- package/dist/marginfi-sdk/types/wrappedI80F48.d.ts +16 -0
- package/dist/marginfi-sdk/types/wrappedI80F48.d.ts.map +1 -0
- package/dist/marginfi-sdk/types/wrappedI80F48.js +17 -0
- package/dist/transactions/index.d.ts +3 -0
- package/dist/transactions/index.d.ts.map +1 -0
- package/dist/transactions/index.js +18 -0
- package/dist/transactions/transactionUtils.d.ts +12 -0
- package/dist/transactions/transactionUtils.d.ts.map +1 -0
- package/dist/transactions/transactionUtils.js +262 -0
- package/dist/transactions/transactionsManager.d.ts +42 -0
- package/dist/transactions/transactionsManager.d.ts.map +1 -0
- package/dist/transactions/transactionsManager.js +246 -0
- package/dist/types/accounts.d.ts +8 -0
- package/dist/types/accounts.d.ts.map +1 -0
- package/dist/types/accounts.js +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +17 -0
- package/dist/utils/accountUtils.d.ts +11 -0
- package/dist/utils/accountUtils.d.ts.map +1 -0
- package/dist/utils/accountUtils.js +60 -0
- package/dist/utils/deleteme.d.ts +2 -0
- package/dist/utils/deleteme.d.ts.map +1 -0
- package/dist/utils/deleteme.js +21 -0
- package/dist/utils/generalUtils.d.ts +11 -0
- package/dist/utils/generalUtils.d.ts.map +1 -0
- package/dist/utils/generalUtils.js +107 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +24 -0
- package/dist/utils/jitoUtils.d.ts +15 -0
- package/dist/utils/jitoUtils.d.ts.map +1 -0
- package/dist/utils/jitoUtils.js +108 -0
- package/dist/utils/jupiterUtils.d.ts +21 -0
- package/dist/utils/jupiterUtils.d.ts.map +1 -0
- package/dist/utils/jupiterUtils.js +61 -0
- package/dist/utils/local/shared.d.ts +3 -0
- package/dist/utils/local/shared.d.ts.map +1 -0
- package/dist/utils/local/shared.js +63 -0
- package/dist/utils/local/updateMarginfiLUT.d.ts +2 -0
- package/dist/utils/local/updateMarginfiLUT.d.ts.map +1 -0
- package/dist/utils/local/updateMarginfiLUT.js +22 -0
- package/dist/utils/local/updateSolautoLUT.d.ts +2 -0
- package/dist/utils/local/updateSolautoLUT.d.ts.map +1 -0
- package/dist/utils/local/updateSolautoLUT.js +13 -0
- package/dist/utils/marginfiUtils.d.ts +14 -0
- package/dist/utils/marginfiUtils.d.ts.map +1 -0
- package/dist/utils/marginfiUtils.js +201 -0
- package/dist/utils/numberUtils.d.ts +9 -0
- package/dist/utils/numberUtils.d.ts.map +1 -0
- package/dist/utils/numberUtils.js +62 -0
- package/dist/utils/solanaUtils.d.ts +18 -0
- package/dist/utils/solanaUtils.d.ts.map +1 -0
- package/dist/utils/solanaUtils.js +183 -0
- package/dist/utils/solauto/generalUtils.d.ts +51 -0
- package/dist/utils/solauto/generalUtils.d.ts.map +1 -0
- package/dist/utils/solauto/generalUtils.js +271 -0
- package/dist/utils/solauto/index.d.ts +3 -0
- package/dist/utils/solauto/index.d.ts.map +1 -0
- package/dist/utils/solauto/index.js +18 -0
- package/dist/utils/solauto/rebalanceUtils.d.ts +17 -0
- package/dist/utils/solauto/rebalanceUtils.d.ts.map +1 -0
- package/dist/utils/solauto/rebalanceUtils.js +199 -0
- package/package.json +37 -0
- package/src/clients/index.ts +1 -0
- package/src/clients/solautoClient.ts +684 -0
- package/src/clients/solautoMarginfiClient.ts +496 -0
- package/src/constants/README.md +9 -0
- package/src/constants/generalAccounts.ts +8 -0
- package/src/constants/index.ts +5 -0
- package/src/constants/marginfiAccounts.ts +24 -0
- package/src/constants/pythConstants.ts +10 -0
- package/src/constants/solautoConstants.ts +54 -0
- package/src/constants/tokenConstants.ts +9 -0
- package/src/generated/accounts/index.ts +10 -0
- package/src/generated/accounts/referralState.ts +159 -0
- package/src/generated/accounts/solautoPosition.ts +205 -0
- package/src/generated/errors/index.ts +9 -0
- package/src/generated/errors/solauto.ts +228 -0
- package/src/generated/index.ts +14 -0
- package/src/generated/instructions/cancelDCA.ts +161 -0
- package/src/generated/instructions/claimReferralFees.ts +159 -0
- package/src/generated/instructions/closePosition.ts +176 -0
- package/src/generated/instructions/convertReferralFees.ts +172 -0
- package/src/generated/instructions/index.ts +18 -0
- package/src/generated/instructions/marginfiOpenPosition.ts +275 -0
- package/src/generated/instructions/marginfiProtocolInteraction.ts +257 -0
- package/src/generated/instructions/marginfiRebalance.ts +274 -0
- package/src/generated/instructions/marginfiRefreshData.ts +147 -0
- package/src/generated/instructions/updatePosition.ts +173 -0
- package/src/generated/instructions/updateReferralStates.ts +166 -0
- package/src/generated/programs/index.ts +9 -0
- package/src/generated/programs/solauto.ts +52 -0
- package/src/generated/shared/index.ts +117 -0
- package/src/generated/types/automationSettings.ts +52 -0
- package/src/generated/types/automationSettingsInp.ts +43 -0
- package/src/generated/types/dCASettings.ts +45 -0
- package/src/generated/types/dCASettingsInp.ts +37 -0
- package/src/generated/types/feeType.ts +23 -0
- package/src/generated/types/index.ts +26 -0
- package/src/generated/types/lendingPlatform.ts +26 -0
- package/src/generated/types/podBool.ts +19 -0
- package/src/generated/types/positionData.ts +69 -0
- package/src/generated/types/positionState.ts +72 -0
- package/src/generated/types/positionTokenUsage.ts +67 -0
- package/src/generated/types/rebalanceData.ts +60 -0
- package/src/generated/types/solautoAction.ts +101 -0
- package/src/generated/types/solautoRebalanceType.ts +27 -0
- package/src/generated/types/solautoSettingsParameters.ts +62 -0
- package/src/generated/types/solautoSettingsParametersInp.ts +58 -0
- package/src/generated/types/tokenAmount.ts +29 -0
- package/src/generated/types/tokenBalanceAmount.ts +67 -0
- package/src/generated/types/updatePositionData.ts +49 -0
- package/src/index.ts +6 -0
- package/src/marginfi-sdk/accounts/bank.ts +311 -0
- package/src/marginfi-sdk/accounts/index.ts +11 -0
- package/src/marginfi-sdk/accounts/marginfiAccount.ts +195 -0
- package/src/marginfi-sdk/accounts/marginfiGroup.ts +164 -0
- package/src/marginfi-sdk/errors/index.ts +9 -0
- package/src/marginfi-sdk/errors/marginfi.ts +650 -0
- package/src/marginfi-sdk/index.ts +14 -0
- package/src/marginfi-sdk/instructions/index.ts +32 -0
- package/src/marginfi-sdk/instructions/lendingAccountBorrow.ts +167 -0
- package/src/marginfi-sdk/instructions/lendingAccountCloseBalance.ts +118 -0
- package/src/marginfi-sdk/instructions/lendingAccountDeposit.ts +164 -0
- package/src/marginfi-sdk/instructions/lendingAccountEndFlashloan.ts +113 -0
- package/src/marginfi-sdk/instructions/lendingAccountLiquidate.ts +186 -0
- package/src/marginfi-sdk/instructions/lendingAccountRepay.ts +171 -0
- package/src/marginfi-sdk/instructions/lendingAccountSettleEmissions.ts +108 -0
- package/src/marginfi-sdk/instructions/lendingAccountStartFlashloan.ts +138 -0
- package/src/marginfi-sdk/instructions/lendingAccountWithdraw.ts +177 -0
- package/src/marginfi-sdk/instructions/lendingAccountWithdrawEmissions.ts +160 -0
- package/src/marginfi-sdk/instructions/lendingPoolAccrueBankInterest.ts +108 -0
- package/src/marginfi-sdk/instructions/lendingPoolAddBank.ts +226 -0
- package/src/marginfi-sdk/instructions/lendingPoolAddBankWithSeed.ts +231 -0
- package/src/marginfi-sdk/instructions/lendingPoolCollectBankFees.ts +147 -0
- package/src/marginfi-sdk/instructions/lendingPoolConfigureBank.ts +181 -0
- package/src/marginfi-sdk/instructions/lendingPoolHandleBankruptcy.ts +154 -0
- package/src/marginfi-sdk/instructions/lendingPoolSetupEmissions.ts +190 -0
- package/src/marginfi-sdk/instructions/lendingPoolUpdateEmissionsParameters.ts +176 -0
- package/src/marginfi-sdk/instructions/marginfiAccountInitialize.ts +146 -0
- package/src/marginfi-sdk/instructions/marginfiGroupConfigure.ts +129 -0
- package/src/marginfi-sdk/instructions/marginfiGroupInitialize.ts +126 -0
- package/src/marginfi-sdk/instructions/setAccountFlag.ts +132 -0
- package/src/marginfi-sdk/instructions/setNewAccountAuthority.ts +137 -0
- package/src/marginfi-sdk/instructions/unsetAccountFlag.ts +130 -0
- package/src/marginfi-sdk/programs/index.ts +9 -0
- package/src/marginfi-sdk/programs/marginfi.ts +52 -0
- package/src/marginfi-sdk/shared/index.ts +117 -0
- package/src/marginfi-sdk/types/accountEventHeader.ts +44 -0
- package/src/marginfi-sdk/types/balance.ts +61 -0
- package/src/marginfi-sdk/types/balanceDecreaseType.ts +27 -0
- package/src/marginfi-sdk/types/balanceIncreaseType.ts +27 -0
- package/src/marginfi-sdk/types/balanceSide.ts +25 -0
- package/src/marginfi-sdk/types/bankConfig.ts +117 -0
- package/src/marginfi-sdk/types/bankConfigCompact.ts +114 -0
- package/src/marginfi-sdk/types/bankOperationalState.ts +26 -0
- package/src/marginfi-sdk/types/bankVaultType.ts +26 -0
- package/src/marginfi-sdk/types/groupEventHeader.ts +38 -0
- package/src/marginfi-sdk/types/index.ts +31 -0
- package/src/marginfi-sdk/types/interestRateConfig.ts +60 -0
- package/src/marginfi-sdk/types/interestRateConfigCompact.ts +52 -0
- package/src/marginfi-sdk/types/interestRateConfigOpt.ts +57 -0
- package/src/marginfi-sdk/types/lendingAccount.ts +38 -0
- package/src/marginfi-sdk/types/liquidationBalances.ts +33 -0
- package/src/marginfi-sdk/types/oracleConfig.ts +36 -0
- package/src/marginfi-sdk/types/oraclePriceType.ts +25 -0
- package/src/marginfi-sdk/types/oracleSetup.ts +27 -0
- package/src/marginfi-sdk/types/priceBias.ts +22 -0
- package/src/marginfi-sdk/types/requirementType.ts +26 -0
- package/src/marginfi-sdk/types/riskRequirementType.ts +26 -0
- package/src/marginfi-sdk/types/riskTier.ts +22 -0
- package/src/marginfi-sdk/types/wrappedI80F48.ts +22 -0
- package/src/transactions/index.ts +2 -0
- package/src/transactions/transactionUtils.ts +518 -0
- package/src/transactions/transactionsManager.ts +344 -0
- package/src/types/accounts.ts +7 -0
- package/src/types/index.ts +1 -0
- package/src/utils/accountUtils.ts +92 -0
- package/src/utils/deleteme.ts +40 -0
- package/src/utils/generalUtils.ts +123 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/jitoUtils.ts +192 -0
- package/src/utils/jupiterUtils.ts +114 -0
- package/src/utils/local/shared.ts +85 -0
- package/src/utils/local/updateMarginfiLUT.ts +33 -0
- package/src/utils/local/updateSolautoLUT.ts +15 -0
- package/src/utils/marginfiUtils.ts +383 -0
- package/src/utils/numberUtils.ts +77 -0
- package/src/utils/solanaUtils.ts +333 -0
- package/src/utils/solauto/generalUtils.ts +371 -0
- package/src/utils/solauto/index.ts +2 -0
- package/src/utils/solauto/rebalanceUtils.ts +359 -0
- package/tests/shared.ts +15 -0
- package/tests/transactions/solautoMarginfi.ts +144 -0
- package/tests/unit/lookupTables.ts +40 -0
- package/tests/unit/rebalanceCalculations.ts +432 -0
- package/tsconfig.json +22 -0
@@ -0,0 +1,311 @@
|
|
1
|
+
/**
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
4
|
+
* to add features, then rerun kinobi to update it.
|
5
|
+
*
|
6
|
+
* @see https://github.com/metaplex-foundation/kinobi
|
7
|
+
*/
|
8
|
+
|
9
|
+
import {
|
10
|
+
Account,
|
11
|
+
Context,
|
12
|
+
Pda,
|
13
|
+
PublicKey,
|
14
|
+
RpcAccount,
|
15
|
+
RpcGetAccountOptions,
|
16
|
+
RpcGetAccountsOptions,
|
17
|
+
assertAccountExists,
|
18
|
+
deserializeAccount,
|
19
|
+
gpaBuilder,
|
20
|
+
publicKey as toPublicKey,
|
21
|
+
} from '@metaplex-foundation/umi';
|
22
|
+
import {
|
23
|
+
Serializer,
|
24
|
+
array,
|
25
|
+
i64,
|
26
|
+
mapSerializer,
|
27
|
+
publicKey as publicKeySerializer,
|
28
|
+
struct,
|
29
|
+
u128,
|
30
|
+
u64,
|
31
|
+
u8,
|
32
|
+
} from '@metaplex-foundation/umi/serializers';
|
33
|
+
import {
|
34
|
+
BankConfig,
|
35
|
+
BankConfigArgs,
|
36
|
+
WrappedI80F48,
|
37
|
+
WrappedI80F48Args,
|
38
|
+
getBankConfigSerializer,
|
39
|
+
getWrappedI80F48Serializer,
|
40
|
+
} from '../types';
|
41
|
+
|
42
|
+
export type Bank = Account<BankAccountData>;
|
43
|
+
|
44
|
+
export type BankAccountData = {
|
45
|
+
discriminator: Array<number>;
|
46
|
+
mint: PublicKey;
|
47
|
+
mintDecimals: number;
|
48
|
+
group: PublicKey;
|
49
|
+
autoPadding0: Array<number>;
|
50
|
+
assetShareValue: WrappedI80F48;
|
51
|
+
liabilityShareValue: WrappedI80F48;
|
52
|
+
liquidityVault: PublicKey;
|
53
|
+
liquidityVaultBump: number;
|
54
|
+
liquidityVaultAuthorityBump: number;
|
55
|
+
insuranceVault: PublicKey;
|
56
|
+
insuranceVaultBump: number;
|
57
|
+
insuranceVaultAuthorityBump: number;
|
58
|
+
autoPadding1: Array<number>;
|
59
|
+
collectedInsuranceFeesOutstanding: WrappedI80F48;
|
60
|
+
feeVault: PublicKey;
|
61
|
+
feeVaultBump: number;
|
62
|
+
feeVaultAuthorityBump: number;
|
63
|
+
autoPadding2: Array<number>;
|
64
|
+
collectedGroupFeesOutstanding: WrappedI80F48;
|
65
|
+
totalLiabilityShares: WrappedI80F48;
|
66
|
+
totalAssetShares: WrappedI80F48;
|
67
|
+
lastUpdate: bigint;
|
68
|
+
config: BankConfig;
|
69
|
+
/**
|
70
|
+
* Emissions Config Flags
|
71
|
+
*
|
72
|
+
* - EMISSIONS_FLAG_BORROW_ACTIVE: 1
|
73
|
+
* - EMISSIONS_FLAG_LENDING_ACTIVE: 2
|
74
|
+
*
|
75
|
+
*/
|
76
|
+
emissionsFlags: bigint;
|
77
|
+
/**
|
78
|
+
* Emissions APR.
|
79
|
+
* Number of emitted tokens (emissions_mint) per 1e(bank.mint_decimal) tokens (bank mint) (native amount) per 1 YEAR.
|
80
|
+
*/
|
81
|
+
emissionsRate: bigint;
|
82
|
+
emissionsRemaining: WrappedI80F48;
|
83
|
+
emissionsMint: PublicKey;
|
84
|
+
padding0: Array<bigint>;
|
85
|
+
padding1: Array<bigint>;
|
86
|
+
};
|
87
|
+
|
88
|
+
export type BankAccountDataArgs = {
|
89
|
+
mint: PublicKey;
|
90
|
+
mintDecimals: number;
|
91
|
+
group: PublicKey;
|
92
|
+
autoPadding0: Array<number>;
|
93
|
+
assetShareValue: WrappedI80F48Args;
|
94
|
+
liabilityShareValue: WrappedI80F48Args;
|
95
|
+
liquidityVault: PublicKey;
|
96
|
+
liquidityVaultBump: number;
|
97
|
+
liquidityVaultAuthorityBump: number;
|
98
|
+
insuranceVault: PublicKey;
|
99
|
+
insuranceVaultBump: number;
|
100
|
+
insuranceVaultAuthorityBump: number;
|
101
|
+
autoPadding1: Array<number>;
|
102
|
+
collectedInsuranceFeesOutstanding: WrappedI80F48Args;
|
103
|
+
feeVault: PublicKey;
|
104
|
+
feeVaultBump: number;
|
105
|
+
feeVaultAuthorityBump: number;
|
106
|
+
autoPadding2: Array<number>;
|
107
|
+
collectedGroupFeesOutstanding: WrappedI80F48Args;
|
108
|
+
totalLiabilityShares: WrappedI80F48Args;
|
109
|
+
totalAssetShares: WrappedI80F48Args;
|
110
|
+
lastUpdate: number | bigint;
|
111
|
+
config: BankConfigArgs;
|
112
|
+
/**
|
113
|
+
* Emissions Config Flags
|
114
|
+
*
|
115
|
+
* - EMISSIONS_FLAG_BORROW_ACTIVE: 1
|
116
|
+
* - EMISSIONS_FLAG_LENDING_ACTIVE: 2
|
117
|
+
*
|
118
|
+
*/
|
119
|
+
emissionsFlags: number | bigint;
|
120
|
+
/**
|
121
|
+
* Emissions APR.
|
122
|
+
* Number of emitted tokens (emissions_mint) per 1e(bank.mint_decimal) tokens (bank mint) (native amount) per 1 YEAR.
|
123
|
+
*/
|
124
|
+
emissionsRate: number | bigint;
|
125
|
+
emissionsRemaining: WrappedI80F48Args;
|
126
|
+
emissionsMint: PublicKey;
|
127
|
+
padding0: Array<number | bigint>;
|
128
|
+
padding1: Array<number | bigint>;
|
129
|
+
};
|
130
|
+
|
131
|
+
export function getBankAccountDataSerializer(): Serializer<
|
132
|
+
BankAccountDataArgs,
|
133
|
+
BankAccountData
|
134
|
+
> {
|
135
|
+
return mapSerializer<BankAccountDataArgs, any, BankAccountData>(
|
136
|
+
struct<BankAccountData>(
|
137
|
+
[
|
138
|
+
['discriminator', array(u8(), { size: 8 })],
|
139
|
+
['mint', publicKeySerializer()],
|
140
|
+
['mintDecimals', u8()],
|
141
|
+
['group', publicKeySerializer()],
|
142
|
+
['autoPadding0', array(u8(), { size: 7 })],
|
143
|
+
['assetShareValue', getWrappedI80F48Serializer()],
|
144
|
+
['liabilityShareValue', getWrappedI80F48Serializer()],
|
145
|
+
['liquidityVault', publicKeySerializer()],
|
146
|
+
['liquidityVaultBump', u8()],
|
147
|
+
['liquidityVaultAuthorityBump', u8()],
|
148
|
+
['insuranceVault', publicKeySerializer()],
|
149
|
+
['insuranceVaultBump', u8()],
|
150
|
+
['insuranceVaultAuthorityBump', u8()],
|
151
|
+
['autoPadding1', array(u8(), { size: 4 })],
|
152
|
+
['collectedInsuranceFeesOutstanding', getWrappedI80F48Serializer()],
|
153
|
+
['feeVault', publicKeySerializer()],
|
154
|
+
['feeVaultBump', u8()],
|
155
|
+
['feeVaultAuthorityBump', u8()],
|
156
|
+
['autoPadding2', array(u8(), { size: 6 })],
|
157
|
+
['collectedGroupFeesOutstanding', getWrappedI80F48Serializer()],
|
158
|
+
['totalLiabilityShares', getWrappedI80F48Serializer()],
|
159
|
+
['totalAssetShares', getWrappedI80F48Serializer()],
|
160
|
+
['lastUpdate', i64()],
|
161
|
+
['config', getBankConfigSerializer()],
|
162
|
+
['emissionsFlags', u64()],
|
163
|
+
['emissionsRate', u64()],
|
164
|
+
['emissionsRemaining', getWrappedI80F48Serializer()],
|
165
|
+
['emissionsMint', publicKeySerializer()],
|
166
|
+
['padding0', array(u128(), { size: 28 })],
|
167
|
+
['padding1', array(u128(), { size: 32 })],
|
168
|
+
],
|
169
|
+
{ description: 'BankAccountData' }
|
170
|
+
),
|
171
|
+
(value) => ({
|
172
|
+
...value,
|
173
|
+
discriminator: [142, 49, 166, 242, 50, 66, 97, 188],
|
174
|
+
})
|
175
|
+
) as Serializer<BankAccountDataArgs, BankAccountData>;
|
176
|
+
}
|
177
|
+
|
178
|
+
export function deserializeBank(rawAccount: RpcAccount): Bank {
|
179
|
+
return deserializeAccount(rawAccount, getBankAccountDataSerializer());
|
180
|
+
}
|
181
|
+
|
182
|
+
export async function fetchBank(
|
183
|
+
context: Pick<Context, 'rpc'>,
|
184
|
+
publicKey: PublicKey | Pda,
|
185
|
+
options?: RpcGetAccountOptions
|
186
|
+
): Promise<Bank> {
|
187
|
+
const maybeAccount = await context.rpc.getAccount(
|
188
|
+
toPublicKey(publicKey, false),
|
189
|
+
options
|
190
|
+
);
|
191
|
+
assertAccountExists(maybeAccount, 'Bank');
|
192
|
+
return deserializeBank(maybeAccount);
|
193
|
+
}
|
194
|
+
|
195
|
+
export async function safeFetchBank(
|
196
|
+
context: Pick<Context, 'rpc'>,
|
197
|
+
publicKey: PublicKey | Pda,
|
198
|
+
options?: RpcGetAccountOptions
|
199
|
+
): Promise<Bank | null> {
|
200
|
+
const maybeAccount = await context.rpc.getAccount(
|
201
|
+
toPublicKey(publicKey, false),
|
202
|
+
options
|
203
|
+
);
|
204
|
+
return maybeAccount.exists ? deserializeBank(maybeAccount) : null;
|
205
|
+
}
|
206
|
+
|
207
|
+
export async function fetchAllBank(
|
208
|
+
context: Pick<Context, 'rpc'>,
|
209
|
+
publicKeys: Array<PublicKey | Pda>,
|
210
|
+
options?: RpcGetAccountsOptions
|
211
|
+
): Promise<Bank[]> {
|
212
|
+
const maybeAccounts = await context.rpc.getAccounts(
|
213
|
+
publicKeys.map((key) => toPublicKey(key, false)),
|
214
|
+
options
|
215
|
+
);
|
216
|
+
return maybeAccounts.map((maybeAccount) => {
|
217
|
+
assertAccountExists(maybeAccount, 'Bank');
|
218
|
+
return deserializeBank(maybeAccount);
|
219
|
+
});
|
220
|
+
}
|
221
|
+
|
222
|
+
export async function safeFetchAllBank(
|
223
|
+
context: Pick<Context, 'rpc'>,
|
224
|
+
publicKeys: Array<PublicKey | Pda>,
|
225
|
+
options?: RpcGetAccountsOptions
|
226
|
+
): Promise<Bank[]> {
|
227
|
+
const maybeAccounts = await context.rpc.getAccounts(
|
228
|
+
publicKeys.map((key) => toPublicKey(key, false)),
|
229
|
+
options
|
230
|
+
);
|
231
|
+
return maybeAccounts
|
232
|
+
.filter((maybeAccount) => maybeAccount.exists)
|
233
|
+
.map((maybeAccount) => deserializeBank(maybeAccount as RpcAccount));
|
234
|
+
}
|
235
|
+
|
236
|
+
export function getBankGpaBuilder(context: Pick<Context, 'rpc' | 'programs'>) {
|
237
|
+
const programId = context.programs.getPublicKey(
|
238
|
+
'marginfi',
|
239
|
+
'MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA'
|
240
|
+
);
|
241
|
+
return gpaBuilder(context, programId)
|
242
|
+
.registerFields<{
|
243
|
+
discriminator: Array<number>;
|
244
|
+
mint: PublicKey;
|
245
|
+
mintDecimals: number;
|
246
|
+
group: PublicKey;
|
247
|
+
autoPadding0: Array<number>;
|
248
|
+
assetShareValue: WrappedI80F48Args;
|
249
|
+
liabilityShareValue: WrappedI80F48Args;
|
250
|
+
liquidityVault: PublicKey;
|
251
|
+
liquidityVaultBump: number;
|
252
|
+
liquidityVaultAuthorityBump: number;
|
253
|
+
insuranceVault: PublicKey;
|
254
|
+
insuranceVaultBump: number;
|
255
|
+
insuranceVaultAuthorityBump: number;
|
256
|
+
autoPadding1: Array<number>;
|
257
|
+
collectedInsuranceFeesOutstanding: WrappedI80F48Args;
|
258
|
+
feeVault: PublicKey;
|
259
|
+
feeVaultBump: number;
|
260
|
+
feeVaultAuthorityBump: number;
|
261
|
+
autoPadding2: Array<number>;
|
262
|
+
collectedGroupFeesOutstanding: WrappedI80F48Args;
|
263
|
+
totalLiabilityShares: WrappedI80F48Args;
|
264
|
+
totalAssetShares: WrappedI80F48Args;
|
265
|
+
lastUpdate: number | bigint;
|
266
|
+
config: BankConfigArgs;
|
267
|
+
emissionsFlags: number | bigint;
|
268
|
+
emissionsRate: number | bigint;
|
269
|
+
emissionsRemaining: WrappedI80F48Args;
|
270
|
+
emissionsMint: PublicKey;
|
271
|
+
padding0: Array<number | bigint>;
|
272
|
+
padding1: Array<number | bigint>;
|
273
|
+
}>({
|
274
|
+
discriminator: [0, array(u8(), { size: 8 })],
|
275
|
+
mint: [8, publicKeySerializer()],
|
276
|
+
mintDecimals: [40, u8()],
|
277
|
+
group: [41, publicKeySerializer()],
|
278
|
+
autoPadding0: [73, array(u8(), { size: 7 })],
|
279
|
+
assetShareValue: [80, getWrappedI80F48Serializer()],
|
280
|
+
liabilityShareValue: [96, getWrappedI80F48Serializer()],
|
281
|
+
liquidityVault: [112, publicKeySerializer()],
|
282
|
+
liquidityVaultBump: [144, u8()],
|
283
|
+
liquidityVaultAuthorityBump: [145, u8()],
|
284
|
+
insuranceVault: [146, publicKeySerializer()],
|
285
|
+
insuranceVaultBump: [178, u8()],
|
286
|
+
insuranceVaultAuthorityBump: [179, u8()],
|
287
|
+
autoPadding1: [180, array(u8(), { size: 4 })],
|
288
|
+
collectedInsuranceFeesOutstanding: [184, getWrappedI80F48Serializer()],
|
289
|
+
feeVault: [200, publicKeySerializer()],
|
290
|
+
feeVaultBump: [232, u8()],
|
291
|
+
feeVaultAuthorityBump: [233, u8()],
|
292
|
+
autoPadding2: [234, array(u8(), { size: 6 })],
|
293
|
+
collectedGroupFeesOutstanding: [240, getWrappedI80F48Serializer()],
|
294
|
+
totalLiabilityShares: [256, getWrappedI80F48Serializer()],
|
295
|
+
totalAssetShares: [272, getWrappedI80F48Serializer()],
|
296
|
+
lastUpdate: [288, i64()],
|
297
|
+
config: [296, getBankConfigSerializer()],
|
298
|
+
emissionsFlags: [840, u64()],
|
299
|
+
emissionsRate: [848, u64()],
|
300
|
+
emissionsRemaining: [856, getWrappedI80F48Serializer()],
|
301
|
+
emissionsMint: [872, publicKeySerializer()],
|
302
|
+
padding0: [904, array(u128(), { size: 28 })],
|
303
|
+
padding1: [1352, array(u128(), { size: 32 })],
|
304
|
+
})
|
305
|
+
.deserializeUsing<Bank>((account) => deserializeBank(account))
|
306
|
+
.whereField('discriminator', [142, 49, 166, 242, 50, 66, 97, 188]);
|
307
|
+
}
|
308
|
+
|
309
|
+
export function getBankSize(): number {
|
310
|
+
return 1864;
|
311
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
4
|
+
* to add features, then rerun kinobi to update it.
|
5
|
+
*
|
6
|
+
* @see https://github.com/metaplex-foundation/kinobi
|
7
|
+
*/
|
8
|
+
|
9
|
+
export * from './bank';
|
10
|
+
export * from './marginfiAccount';
|
11
|
+
export * from './marginfiGroup';
|
@@ -0,0 +1,195 @@
|
|
1
|
+
/**
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
4
|
+
* to add features, then rerun kinobi to update it.
|
5
|
+
*
|
6
|
+
* @see https://github.com/metaplex-foundation/kinobi
|
7
|
+
*/
|
8
|
+
|
9
|
+
import {
|
10
|
+
Account,
|
11
|
+
Context,
|
12
|
+
Pda,
|
13
|
+
PublicKey,
|
14
|
+
RpcAccount,
|
15
|
+
RpcGetAccountOptions,
|
16
|
+
RpcGetAccountsOptions,
|
17
|
+
assertAccountExists,
|
18
|
+
deserializeAccount,
|
19
|
+
gpaBuilder,
|
20
|
+
publicKey as toPublicKey,
|
21
|
+
} from '@metaplex-foundation/umi';
|
22
|
+
import {
|
23
|
+
Serializer,
|
24
|
+
array,
|
25
|
+
mapSerializer,
|
26
|
+
publicKey as publicKeySerializer,
|
27
|
+
struct,
|
28
|
+
u64,
|
29
|
+
u8,
|
30
|
+
} from '@metaplex-foundation/umi/serializers';
|
31
|
+
import {
|
32
|
+
LendingAccount,
|
33
|
+
LendingAccountArgs,
|
34
|
+
getLendingAccountSerializer,
|
35
|
+
} from '../types';
|
36
|
+
|
37
|
+
export type MarginfiAccount = Account<MarginfiAccountAccountData>;
|
38
|
+
|
39
|
+
export type MarginfiAccountAccountData = {
|
40
|
+
discriminator: Array<number>;
|
41
|
+
group: PublicKey;
|
42
|
+
authority: PublicKey;
|
43
|
+
lendingAccount: LendingAccount;
|
44
|
+
/**
|
45
|
+
* The flags that indicate the state of the account.
|
46
|
+
* This is u64 bitfield, where each bit represents a flag.
|
47
|
+
*
|
48
|
+
* Flags:
|
49
|
+
* - DISABLED_FLAG = 1 << 0 = 1 - This flag indicates that the account is disabled,
|
50
|
+
* and no further actions can be taken on it.
|
51
|
+
*/
|
52
|
+
accountFlags: bigint;
|
53
|
+
padding: Array<bigint>;
|
54
|
+
};
|
55
|
+
|
56
|
+
export type MarginfiAccountAccountDataArgs = {
|
57
|
+
group: PublicKey;
|
58
|
+
authority: PublicKey;
|
59
|
+
lendingAccount: LendingAccountArgs;
|
60
|
+
/**
|
61
|
+
* The flags that indicate the state of the account.
|
62
|
+
* This is u64 bitfield, where each bit represents a flag.
|
63
|
+
*
|
64
|
+
* Flags:
|
65
|
+
* - DISABLED_FLAG = 1 << 0 = 1 - This flag indicates that the account is disabled,
|
66
|
+
* and no further actions can be taken on it.
|
67
|
+
*/
|
68
|
+
accountFlags: number | bigint;
|
69
|
+
padding: Array<number | bigint>;
|
70
|
+
};
|
71
|
+
|
72
|
+
export function getMarginfiAccountAccountDataSerializer(): Serializer<
|
73
|
+
MarginfiAccountAccountDataArgs,
|
74
|
+
MarginfiAccountAccountData
|
75
|
+
> {
|
76
|
+
return mapSerializer<
|
77
|
+
MarginfiAccountAccountDataArgs,
|
78
|
+
any,
|
79
|
+
MarginfiAccountAccountData
|
80
|
+
>(
|
81
|
+
struct<MarginfiAccountAccountData>(
|
82
|
+
[
|
83
|
+
['discriminator', array(u8(), { size: 8 })],
|
84
|
+
['group', publicKeySerializer()],
|
85
|
+
['authority', publicKeySerializer()],
|
86
|
+
['lendingAccount', getLendingAccountSerializer()],
|
87
|
+
['accountFlags', u64()],
|
88
|
+
['padding', array(u64(), { size: 63 })],
|
89
|
+
],
|
90
|
+
{ description: 'MarginfiAccountAccountData' }
|
91
|
+
),
|
92
|
+
(value) => ({
|
93
|
+
...value,
|
94
|
+
discriminator: [67, 178, 130, 109, 126, 114, 28, 42],
|
95
|
+
})
|
96
|
+
) as Serializer<MarginfiAccountAccountDataArgs, MarginfiAccountAccountData>;
|
97
|
+
}
|
98
|
+
|
99
|
+
export function deserializeMarginfiAccount(
|
100
|
+
rawAccount: RpcAccount
|
101
|
+
): MarginfiAccount {
|
102
|
+
return deserializeAccount(
|
103
|
+
rawAccount,
|
104
|
+
getMarginfiAccountAccountDataSerializer()
|
105
|
+
);
|
106
|
+
}
|
107
|
+
|
108
|
+
export async function fetchMarginfiAccount(
|
109
|
+
context: Pick<Context, 'rpc'>,
|
110
|
+
publicKey: PublicKey | Pda,
|
111
|
+
options?: RpcGetAccountOptions
|
112
|
+
): Promise<MarginfiAccount> {
|
113
|
+
const maybeAccount = await context.rpc.getAccount(
|
114
|
+
toPublicKey(publicKey, false),
|
115
|
+
options
|
116
|
+
);
|
117
|
+
assertAccountExists(maybeAccount, 'MarginfiAccount');
|
118
|
+
return deserializeMarginfiAccount(maybeAccount);
|
119
|
+
}
|
120
|
+
|
121
|
+
export async function safeFetchMarginfiAccount(
|
122
|
+
context: Pick<Context, 'rpc'>,
|
123
|
+
publicKey: PublicKey | Pda,
|
124
|
+
options?: RpcGetAccountOptions
|
125
|
+
): Promise<MarginfiAccount | null> {
|
126
|
+
const maybeAccount = await context.rpc.getAccount(
|
127
|
+
toPublicKey(publicKey, false),
|
128
|
+
options
|
129
|
+
);
|
130
|
+
return maybeAccount.exists ? deserializeMarginfiAccount(maybeAccount) : null;
|
131
|
+
}
|
132
|
+
|
133
|
+
export async function fetchAllMarginfiAccount(
|
134
|
+
context: Pick<Context, 'rpc'>,
|
135
|
+
publicKeys: Array<PublicKey | Pda>,
|
136
|
+
options?: RpcGetAccountsOptions
|
137
|
+
): Promise<MarginfiAccount[]> {
|
138
|
+
const maybeAccounts = await context.rpc.getAccounts(
|
139
|
+
publicKeys.map((key) => toPublicKey(key, false)),
|
140
|
+
options
|
141
|
+
);
|
142
|
+
return maybeAccounts.map((maybeAccount) => {
|
143
|
+
assertAccountExists(maybeAccount, 'MarginfiAccount');
|
144
|
+
return deserializeMarginfiAccount(maybeAccount);
|
145
|
+
});
|
146
|
+
}
|
147
|
+
|
148
|
+
export async function safeFetchAllMarginfiAccount(
|
149
|
+
context: Pick<Context, 'rpc'>,
|
150
|
+
publicKeys: Array<PublicKey | Pda>,
|
151
|
+
options?: RpcGetAccountsOptions
|
152
|
+
): Promise<MarginfiAccount[]> {
|
153
|
+
const maybeAccounts = await context.rpc.getAccounts(
|
154
|
+
publicKeys.map((key) => toPublicKey(key, false)),
|
155
|
+
options
|
156
|
+
);
|
157
|
+
return maybeAccounts
|
158
|
+
.filter((maybeAccount) => maybeAccount.exists)
|
159
|
+
.map((maybeAccount) =>
|
160
|
+
deserializeMarginfiAccount(maybeAccount as RpcAccount)
|
161
|
+
);
|
162
|
+
}
|
163
|
+
|
164
|
+
export function getMarginfiAccountGpaBuilder(
|
165
|
+
context: Pick<Context, 'rpc' | 'programs'>
|
166
|
+
) {
|
167
|
+
const programId = context.programs.getPublicKey(
|
168
|
+
'marginfi',
|
169
|
+
'MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA'
|
170
|
+
);
|
171
|
+
return gpaBuilder(context, programId)
|
172
|
+
.registerFields<{
|
173
|
+
discriminator: Array<number>;
|
174
|
+
group: PublicKey;
|
175
|
+
authority: PublicKey;
|
176
|
+
lendingAccount: LendingAccountArgs;
|
177
|
+
accountFlags: number | bigint;
|
178
|
+
padding: Array<number | bigint>;
|
179
|
+
}>({
|
180
|
+
discriminator: [0, array(u8(), { size: 8 })],
|
181
|
+
group: [8, publicKeySerializer()],
|
182
|
+
authority: [40, publicKeySerializer()],
|
183
|
+
lendingAccount: [72, getLendingAccountSerializer()],
|
184
|
+
accountFlags: [1800, u64()],
|
185
|
+
padding: [1808, array(u64(), { size: 63 })],
|
186
|
+
})
|
187
|
+
.deserializeUsing<MarginfiAccount>((account) =>
|
188
|
+
deserializeMarginfiAccount(account)
|
189
|
+
)
|
190
|
+
.whereField('discriminator', [67, 178, 130, 109, 126, 114, 28, 42]);
|
191
|
+
}
|
192
|
+
|
193
|
+
export function getMarginfiAccountSize(): number {
|
194
|
+
return 2312;
|
195
|
+
}
|
@@ -0,0 +1,164 @@
|
|
1
|
+
/**
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
4
|
+
* to add features, then rerun kinobi to update it.
|
5
|
+
*
|
6
|
+
* @see https://github.com/metaplex-foundation/kinobi
|
7
|
+
*/
|
8
|
+
|
9
|
+
import {
|
10
|
+
Account,
|
11
|
+
Context,
|
12
|
+
Pda,
|
13
|
+
PublicKey,
|
14
|
+
RpcAccount,
|
15
|
+
RpcGetAccountOptions,
|
16
|
+
RpcGetAccountsOptions,
|
17
|
+
assertAccountExists,
|
18
|
+
deserializeAccount,
|
19
|
+
gpaBuilder,
|
20
|
+
publicKey as toPublicKey,
|
21
|
+
} from '@metaplex-foundation/umi';
|
22
|
+
import {
|
23
|
+
Serializer,
|
24
|
+
array,
|
25
|
+
mapSerializer,
|
26
|
+
publicKey as publicKeySerializer,
|
27
|
+
struct,
|
28
|
+
u128,
|
29
|
+
u8,
|
30
|
+
} from '@metaplex-foundation/umi/serializers';
|
31
|
+
|
32
|
+
export type MarginfiGroup = Account<MarginfiGroupAccountData>;
|
33
|
+
|
34
|
+
export type MarginfiGroupAccountData = {
|
35
|
+
discriminator: Array<number>;
|
36
|
+
admin: PublicKey;
|
37
|
+
padding0: Array<bigint>;
|
38
|
+
padding1: Array<bigint>;
|
39
|
+
};
|
40
|
+
|
41
|
+
export type MarginfiGroupAccountDataArgs = {
|
42
|
+
admin: PublicKey;
|
43
|
+
padding0: Array<number | bigint>;
|
44
|
+
padding1: Array<number | bigint>;
|
45
|
+
};
|
46
|
+
|
47
|
+
export function getMarginfiGroupAccountDataSerializer(): Serializer<
|
48
|
+
MarginfiGroupAccountDataArgs,
|
49
|
+
MarginfiGroupAccountData
|
50
|
+
> {
|
51
|
+
return mapSerializer<
|
52
|
+
MarginfiGroupAccountDataArgs,
|
53
|
+
any,
|
54
|
+
MarginfiGroupAccountData
|
55
|
+
>(
|
56
|
+
struct<MarginfiGroupAccountData>(
|
57
|
+
[
|
58
|
+
['discriminator', array(u8(), { size: 8 })],
|
59
|
+
['admin', publicKeySerializer()],
|
60
|
+
['padding0', array(u128(), { size: 32 })],
|
61
|
+
['padding1', array(u128(), { size: 32 })],
|
62
|
+
],
|
63
|
+
{ description: 'MarginfiGroupAccountData' }
|
64
|
+
),
|
65
|
+
(value) => ({
|
66
|
+
...value,
|
67
|
+
discriminator: [182, 23, 173, 240, 151, 206, 182, 67],
|
68
|
+
})
|
69
|
+
) as Serializer<MarginfiGroupAccountDataArgs, MarginfiGroupAccountData>;
|
70
|
+
}
|
71
|
+
|
72
|
+
export function deserializeMarginfiGroup(
|
73
|
+
rawAccount: RpcAccount
|
74
|
+
): MarginfiGroup {
|
75
|
+
return deserializeAccount(
|
76
|
+
rawAccount,
|
77
|
+
getMarginfiGroupAccountDataSerializer()
|
78
|
+
);
|
79
|
+
}
|
80
|
+
|
81
|
+
export async function fetchMarginfiGroup(
|
82
|
+
context: Pick<Context, 'rpc'>,
|
83
|
+
publicKey: PublicKey | Pda,
|
84
|
+
options?: RpcGetAccountOptions
|
85
|
+
): Promise<MarginfiGroup> {
|
86
|
+
const maybeAccount = await context.rpc.getAccount(
|
87
|
+
toPublicKey(publicKey, false),
|
88
|
+
options
|
89
|
+
);
|
90
|
+
assertAccountExists(maybeAccount, 'MarginfiGroup');
|
91
|
+
return deserializeMarginfiGroup(maybeAccount);
|
92
|
+
}
|
93
|
+
|
94
|
+
export async function safeFetchMarginfiGroup(
|
95
|
+
context: Pick<Context, 'rpc'>,
|
96
|
+
publicKey: PublicKey | Pda,
|
97
|
+
options?: RpcGetAccountOptions
|
98
|
+
): Promise<MarginfiGroup | null> {
|
99
|
+
const maybeAccount = await context.rpc.getAccount(
|
100
|
+
toPublicKey(publicKey, false),
|
101
|
+
options
|
102
|
+
);
|
103
|
+
return maybeAccount.exists ? deserializeMarginfiGroup(maybeAccount) : null;
|
104
|
+
}
|
105
|
+
|
106
|
+
export async function fetchAllMarginfiGroup(
|
107
|
+
context: Pick<Context, 'rpc'>,
|
108
|
+
publicKeys: Array<PublicKey | Pda>,
|
109
|
+
options?: RpcGetAccountsOptions
|
110
|
+
): Promise<MarginfiGroup[]> {
|
111
|
+
const maybeAccounts = await context.rpc.getAccounts(
|
112
|
+
publicKeys.map((key) => toPublicKey(key, false)),
|
113
|
+
options
|
114
|
+
);
|
115
|
+
return maybeAccounts.map((maybeAccount) => {
|
116
|
+
assertAccountExists(maybeAccount, 'MarginfiGroup');
|
117
|
+
return deserializeMarginfiGroup(maybeAccount);
|
118
|
+
});
|
119
|
+
}
|
120
|
+
|
121
|
+
export async function safeFetchAllMarginfiGroup(
|
122
|
+
context: Pick<Context, 'rpc'>,
|
123
|
+
publicKeys: Array<PublicKey | Pda>,
|
124
|
+
options?: RpcGetAccountsOptions
|
125
|
+
): Promise<MarginfiGroup[]> {
|
126
|
+
const maybeAccounts = await context.rpc.getAccounts(
|
127
|
+
publicKeys.map((key) => toPublicKey(key, false)),
|
128
|
+
options
|
129
|
+
);
|
130
|
+
return maybeAccounts
|
131
|
+
.filter((maybeAccount) => maybeAccount.exists)
|
132
|
+
.map((maybeAccount) =>
|
133
|
+
deserializeMarginfiGroup(maybeAccount as RpcAccount)
|
134
|
+
);
|
135
|
+
}
|
136
|
+
|
137
|
+
export function getMarginfiGroupGpaBuilder(
|
138
|
+
context: Pick<Context, 'rpc' | 'programs'>
|
139
|
+
) {
|
140
|
+
const programId = context.programs.getPublicKey(
|
141
|
+
'marginfi',
|
142
|
+
'MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA'
|
143
|
+
);
|
144
|
+
return gpaBuilder(context, programId)
|
145
|
+
.registerFields<{
|
146
|
+
discriminator: Array<number>;
|
147
|
+
admin: PublicKey;
|
148
|
+
padding0: Array<number | bigint>;
|
149
|
+
padding1: Array<number | bigint>;
|
150
|
+
}>({
|
151
|
+
discriminator: [0, array(u8(), { size: 8 })],
|
152
|
+
admin: [8, publicKeySerializer()],
|
153
|
+
padding0: [40, array(u128(), { size: 32 })],
|
154
|
+
padding1: [552, array(u128(), { size: 32 })],
|
155
|
+
})
|
156
|
+
.deserializeUsing<MarginfiGroup>((account) =>
|
157
|
+
deserializeMarginfiGroup(account)
|
158
|
+
)
|
159
|
+
.whereField('discriminator', [182, 23, 173, 240, 151, 206, 182, 67]);
|
160
|
+
}
|
161
|
+
|
162
|
+
export function getMarginfiGroupSize(): number {
|
163
|
+
return 1064;
|
164
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
4
|
+
* to add features, then rerun kinobi to update it.
|
5
|
+
*
|
6
|
+
* @see https://github.com/metaplex-foundation/kinobi
|
7
|
+
*/
|
8
|
+
|
9
|
+
export * from './marginfi';
|