@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,275 @@
|
|
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
|
+
Context,
|
11
|
+
Option,
|
12
|
+
OptionOrNullable,
|
13
|
+
Pda,
|
14
|
+
PublicKey,
|
15
|
+
Signer,
|
16
|
+
TransactionBuilder,
|
17
|
+
publicKey,
|
18
|
+
transactionBuilder,
|
19
|
+
} from '@metaplex-foundation/umi';
|
20
|
+
import {
|
21
|
+
Serializer,
|
22
|
+
mapSerializer,
|
23
|
+
option,
|
24
|
+
struct,
|
25
|
+
u64,
|
26
|
+
u8,
|
27
|
+
} from '@metaplex-foundation/umi/serializers';
|
28
|
+
import {
|
29
|
+
ResolvedAccount,
|
30
|
+
ResolvedAccountsWithIndices,
|
31
|
+
getAccountMetasAndSigners,
|
32
|
+
} from '../shared';
|
33
|
+
import {
|
34
|
+
UpdatePositionData,
|
35
|
+
UpdatePositionDataArgs,
|
36
|
+
getUpdatePositionDataSerializer,
|
37
|
+
} from '../types';
|
38
|
+
|
39
|
+
// Accounts.
|
40
|
+
export type MarginfiOpenPositionInstructionAccounts = {
|
41
|
+
signer: Signer;
|
42
|
+
marginfiProgram: PublicKey | Pda;
|
43
|
+
systemProgram?: PublicKey | Pda;
|
44
|
+
tokenProgram?: PublicKey | Pda;
|
45
|
+
ataProgram?: PublicKey | Pda;
|
46
|
+
rent?: PublicKey | Pda;
|
47
|
+
solautoFeesWallet: PublicKey | Pda;
|
48
|
+
solautoFeesSupplyTa: PublicKey | Pda;
|
49
|
+
signerReferralState: PublicKey | Pda;
|
50
|
+
referredByState?: PublicKey | Pda;
|
51
|
+
referredBySupplyTa?: PublicKey | Pda;
|
52
|
+
solautoPosition: PublicKey | Pda;
|
53
|
+
marginfiGroup: PublicKey | Pda;
|
54
|
+
marginfiAccount: PublicKey | Pda | Signer;
|
55
|
+
supplyMint: PublicKey | Pda;
|
56
|
+
supplyBank: PublicKey | Pda;
|
57
|
+
positionSupplyTa: PublicKey | Pda;
|
58
|
+
debtMint: PublicKey | Pda;
|
59
|
+
debtBank: PublicKey | Pda;
|
60
|
+
positionDebtTa: PublicKey | Pda;
|
61
|
+
signerDebtTa?: PublicKey | Pda;
|
62
|
+
};
|
63
|
+
|
64
|
+
// Data.
|
65
|
+
export type MarginfiOpenPositionInstructionData = {
|
66
|
+
discriminator: number;
|
67
|
+
positionData: UpdatePositionData;
|
68
|
+
marginfiAccountSeedIdx: Option<bigint>;
|
69
|
+
};
|
70
|
+
|
71
|
+
export type MarginfiOpenPositionInstructionDataArgs = {
|
72
|
+
positionData: UpdatePositionDataArgs;
|
73
|
+
marginfiAccountSeedIdx: OptionOrNullable<number | bigint>;
|
74
|
+
};
|
75
|
+
|
76
|
+
export function getMarginfiOpenPositionInstructionDataSerializer(): Serializer<
|
77
|
+
MarginfiOpenPositionInstructionDataArgs,
|
78
|
+
MarginfiOpenPositionInstructionData
|
79
|
+
> {
|
80
|
+
return mapSerializer<
|
81
|
+
MarginfiOpenPositionInstructionDataArgs,
|
82
|
+
any,
|
83
|
+
MarginfiOpenPositionInstructionData
|
84
|
+
>(
|
85
|
+
struct<MarginfiOpenPositionInstructionData>(
|
86
|
+
[
|
87
|
+
['discriminator', u8()],
|
88
|
+
['positionData', getUpdatePositionDataSerializer()],
|
89
|
+
['marginfiAccountSeedIdx', option(u64())],
|
90
|
+
],
|
91
|
+
{ description: 'MarginfiOpenPositionInstructionData' }
|
92
|
+
),
|
93
|
+
(value) => ({ ...value, discriminator: 6 })
|
94
|
+
) as Serializer<
|
95
|
+
MarginfiOpenPositionInstructionDataArgs,
|
96
|
+
MarginfiOpenPositionInstructionData
|
97
|
+
>;
|
98
|
+
}
|
99
|
+
|
100
|
+
// Args.
|
101
|
+
export type MarginfiOpenPositionInstructionArgs =
|
102
|
+
MarginfiOpenPositionInstructionDataArgs;
|
103
|
+
|
104
|
+
// Instruction.
|
105
|
+
export function marginfiOpenPosition(
|
106
|
+
context: Pick<Context, 'programs'>,
|
107
|
+
input: MarginfiOpenPositionInstructionAccounts &
|
108
|
+
MarginfiOpenPositionInstructionArgs
|
109
|
+
): TransactionBuilder {
|
110
|
+
// Program ID.
|
111
|
+
const programId = context.programs.getPublicKey(
|
112
|
+
'solauto',
|
113
|
+
'AutoyKBRaHSBHy9RsmXCZMy6nNFAg5FYijrvZyQcNLV'
|
114
|
+
);
|
115
|
+
|
116
|
+
// Accounts.
|
117
|
+
const resolvedAccounts = {
|
118
|
+
signer: {
|
119
|
+
index: 0,
|
120
|
+
isWritable: false as boolean,
|
121
|
+
value: input.signer ?? null,
|
122
|
+
},
|
123
|
+
marginfiProgram: {
|
124
|
+
index: 1,
|
125
|
+
isWritable: false as boolean,
|
126
|
+
value: input.marginfiProgram ?? null,
|
127
|
+
},
|
128
|
+
systemProgram: {
|
129
|
+
index: 2,
|
130
|
+
isWritable: false as boolean,
|
131
|
+
value: input.systemProgram ?? null,
|
132
|
+
},
|
133
|
+
tokenProgram: {
|
134
|
+
index: 3,
|
135
|
+
isWritable: false as boolean,
|
136
|
+
value: input.tokenProgram ?? null,
|
137
|
+
},
|
138
|
+
ataProgram: {
|
139
|
+
index: 4,
|
140
|
+
isWritable: false as boolean,
|
141
|
+
value: input.ataProgram ?? null,
|
142
|
+
},
|
143
|
+
rent: { index: 5, isWritable: false as boolean, value: input.rent ?? null },
|
144
|
+
solautoFeesWallet: {
|
145
|
+
index: 6,
|
146
|
+
isWritable: false as boolean,
|
147
|
+
value: input.solautoFeesWallet ?? null,
|
148
|
+
},
|
149
|
+
solautoFeesSupplyTa: {
|
150
|
+
index: 7,
|
151
|
+
isWritable: true as boolean,
|
152
|
+
value: input.solautoFeesSupplyTa ?? null,
|
153
|
+
},
|
154
|
+
signerReferralState: {
|
155
|
+
index: 8,
|
156
|
+
isWritable: false as boolean,
|
157
|
+
value: input.signerReferralState ?? null,
|
158
|
+
},
|
159
|
+
referredByState: {
|
160
|
+
index: 9,
|
161
|
+
isWritable: false as boolean,
|
162
|
+
value: input.referredByState ?? null,
|
163
|
+
},
|
164
|
+
referredBySupplyTa: {
|
165
|
+
index: 10,
|
166
|
+
isWritable: true as boolean,
|
167
|
+
value: input.referredBySupplyTa ?? null,
|
168
|
+
},
|
169
|
+
solautoPosition: {
|
170
|
+
index: 11,
|
171
|
+
isWritable: true as boolean,
|
172
|
+
value: input.solautoPosition ?? null,
|
173
|
+
},
|
174
|
+
marginfiGroup: {
|
175
|
+
index: 12,
|
176
|
+
isWritable: false as boolean,
|
177
|
+
value: input.marginfiGroup ?? null,
|
178
|
+
},
|
179
|
+
marginfiAccount: {
|
180
|
+
index: 13,
|
181
|
+
isWritable: true as boolean,
|
182
|
+
value: input.marginfiAccount ?? null,
|
183
|
+
},
|
184
|
+
supplyMint: {
|
185
|
+
index: 14,
|
186
|
+
isWritable: false as boolean,
|
187
|
+
value: input.supplyMint ?? null,
|
188
|
+
},
|
189
|
+
supplyBank: {
|
190
|
+
index: 15,
|
191
|
+
isWritable: false as boolean,
|
192
|
+
value: input.supplyBank ?? null,
|
193
|
+
},
|
194
|
+
positionSupplyTa: {
|
195
|
+
index: 16,
|
196
|
+
isWritable: true as boolean,
|
197
|
+
value: input.positionSupplyTa ?? null,
|
198
|
+
},
|
199
|
+
debtMint: {
|
200
|
+
index: 17,
|
201
|
+
isWritable: false as boolean,
|
202
|
+
value: input.debtMint ?? null,
|
203
|
+
},
|
204
|
+
debtBank: {
|
205
|
+
index: 18,
|
206
|
+
isWritable: false as boolean,
|
207
|
+
value: input.debtBank ?? null,
|
208
|
+
},
|
209
|
+
positionDebtTa: {
|
210
|
+
index: 19,
|
211
|
+
isWritable: true as boolean,
|
212
|
+
value: input.positionDebtTa ?? null,
|
213
|
+
},
|
214
|
+
signerDebtTa: {
|
215
|
+
index: 20,
|
216
|
+
isWritable: true as boolean,
|
217
|
+
value: input.signerDebtTa ?? null,
|
218
|
+
},
|
219
|
+
} satisfies ResolvedAccountsWithIndices;
|
220
|
+
|
221
|
+
// Arguments.
|
222
|
+
const resolvedArgs: MarginfiOpenPositionInstructionArgs = { ...input };
|
223
|
+
|
224
|
+
// Default values.
|
225
|
+
if (!resolvedAccounts.systemProgram.value) {
|
226
|
+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
|
227
|
+
'splSystem',
|
228
|
+
'11111111111111111111111111111111'
|
229
|
+
);
|
230
|
+
resolvedAccounts.systemProgram.isWritable = false;
|
231
|
+
}
|
232
|
+
if (!resolvedAccounts.tokenProgram.value) {
|
233
|
+
resolvedAccounts.tokenProgram.value = context.programs.getPublicKey(
|
234
|
+
'splToken',
|
235
|
+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
|
236
|
+
);
|
237
|
+
resolvedAccounts.tokenProgram.isWritable = false;
|
238
|
+
}
|
239
|
+
if (!resolvedAccounts.ataProgram.value) {
|
240
|
+
resolvedAccounts.ataProgram.value = context.programs.getPublicKey(
|
241
|
+
'splAssociatedToken',
|
242
|
+
'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'
|
243
|
+
);
|
244
|
+
resolvedAccounts.ataProgram.isWritable = false;
|
245
|
+
}
|
246
|
+
if (!resolvedAccounts.rent.value) {
|
247
|
+
resolvedAccounts.rent.value = publicKey(
|
248
|
+
'SysvarRent111111111111111111111111111111111'
|
249
|
+
);
|
250
|
+
}
|
251
|
+
|
252
|
+
// Accounts in order.
|
253
|
+
const orderedAccounts: ResolvedAccount[] = Object.values(
|
254
|
+
resolvedAccounts
|
255
|
+
).sort((a, b) => a.index - b.index);
|
256
|
+
|
257
|
+
// Keys and Signers.
|
258
|
+
const [keys, signers] = getAccountMetasAndSigners(
|
259
|
+
orderedAccounts,
|
260
|
+
'programId',
|
261
|
+
programId
|
262
|
+
);
|
263
|
+
|
264
|
+
// Data.
|
265
|
+
const data = getMarginfiOpenPositionInstructionDataSerializer().serialize(
|
266
|
+
resolvedArgs as MarginfiOpenPositionInstructionDataArgs
|
267
|
+
);
|
268
|
+
|
269
|
+
// Bytes Created On Chain.
|
270
|
+
const bytesCreatedOnChain = 0;
|
271
|
+
|
272
|
+
return transactionBuilder([
|
273
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
|
274
|
+
]);
|
275
|
+
}
|
@@ -0,0 +1,257 @@
|
|
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
|
+
Context,
|
11
|
+
Pda,
|
12
|
+
PublicKey,
|
13
|
+
Signer,
|
14
|
+
TransactionBuilder,
|
15
|
+
publicKey,
|
16
|
+
transactionBuilder,
|
17
|
+
} from '@metaplex-foundation/umi';
|
18
|
+
import {
|
19
|
+
Serializer,
|
20
|
+
mapSerializer,
|
21
|
+
struct,
|
22
|
+
u8,
|
23
|
+
} from '@metaplex-foundation/umi/serializers';
|
24
|
+
import {
|
25
|
+
ResolvedAccount,
|
26
|
+
ResolvedAccountsWithIndices,
|
27
|
+
getAccountMetasAndSigners,
|
28
|
+
} from '../shared';
|
29
|
+
import {
|
30
|
+
SolautoAction,
|
31
|
+
SolautoActionArgs,
|
32
|
+
getSolautoActionSerializer,
|
33
|
+
} from '../types';
|
34
|
+
|
35
|
+
// Accounts.
|
36
|
+
export type MarginfiProtocolInteractionInstructionAccounts = {
|
37
|
+
signer: Signer;
|
38
|
+
marginfiProgram: PublicKey | Pda;
|
39
|
+
systemProgram?: PublicKey | Pda;
|
40
|
+
tokenProgram?: PublicKey | Pda;
|
41
|
+
ataProgram?: PublicKey | Pda;
|
42
|
+
rent?: PublicKey | Pda;
|
43
|
+
solautoPosition: PublicKey | Pda;
|
44
|
+
marginfiGroup: PublicKey | Pda;
|
45
|
+
marginfiAccount: PublicKey | Pda;
|
46
|
+
supplyBank: PublicKey | Pda;
|
47
|
+
supplyPriceOracle?: PublicKey | Pda;
|
48
|
+
sourceSupplyTa?: PublicKey | Pda;
|
49
|
+
vaultSupplyTa?: PublicKey | Pda;
|
50
|
+
supplyVaultAuthority?: PublicKey | Pda;
|
51
|
+
debtBank: PublicKey | Pda;
|
52
|
+
debtPriceOracle?: PublicKey | Pda;
|
53
|
+
sourceDebtTa?: PublicKey | Pda;
|
54
|
+
vaultDebtTa?: PublicKey | Pda;
|
55
|
+
debtVaultAuthority?: PublicKey | Pda;
|
56
|
+
};
|
57
|
+
|
58
|
+
// Data.
|
59
|
+
export type MarginfiProtocolInteractionInstructionData = {
|
60
|
+
discriminator: number;
|
61
|
+
solautoAction: SolautoAction;
|
62
|
+
};
|
63
|
+
|
64
|
+
export type MarginfiProtocolInteractionInstructionDataArgs = {
|
65
|
+
solautoAction: SolautoActionArgs;
|
66
|
+
};
|
67
|
+
|
68
|
+
export function getMarginfiProtocolInteractionInstructionDataSerializer(): Serializer<
|
69
|
+
MarginfiProtocolInteractionInstructionDataArgs,
|
70
|
+
MarginfiProtocolInteractionInstructionData
|
71
|
+
> {
|
72
|
+
return mapSerializer<
|
73
|
+
MarginfiProtocolInteractionInstructionDataArgs,
|
74
|
+
any,
|
75
|
+
MarginfiProtocolInteractionInstructionData
|
76
|
+
>(
|
77
|
+
struct<MarginfiProtocolInteractionInstructionData>(
|
78
|
+
[
|
79
|
+
['discriminator', u8()],
|
80
|
+
['solautoAction', getSolautoActionSerializer()],
|
81
|
+
],
|
82
|
+
{ description: 'MarginfiProtocolInteractionInstructionData' }
|
83
|
+
),
|
84
|
+
(value) => ({ ...value, discriminator: 8 })
|
85
|
+
) as Serializer<
|
86
|
+
MarginfiProtocolInteractionInstructionDataArgs,
|
87
|
+
MarginfiProtocolInteractionInstructionData
|
88
|
+
>;
|
89
|
+
}
|
90
|
+
|
91
|
+
// Args.
|
92
|
+
export type MarginfiProtocolInteractionInstructionArgs =
|
93
|
+
MarginfiProtocolInteractionInstructionDataArgs;
|
94
|
+
|
95
|
+
// Instruction.
|
96
|
+
export function marginfiProtocolInteraction(
|
97
|
+
context: Pick<Context, 'programs'>,
|
98
|
+
input: MarginfiProtocolInteractionInstructionAccounts &
|
99
|
+
MarginfiProtocolInteractionInstructionArgs
|
100
|
+
): TransactionBuilder {
|
101
|
+
// Program ID.
|
102
|
+
const programId = context.programs.getPublicKey(
|
103
|
+
'solauto',
|
104
|
+
'AutoyKBRaHSBHy9RsmXCZMy6nNFAg5FYijrvZyQcNLV'
|
105
|
+
);
|
106
|
+
|
107
|
+
// Accounts.
|
108
|
+
const resolvedAccounts = {
|
109
|
+
signer: {
|
110
|
+
index: 0,
|
111
|
+
isWritable: false as boolean,
|
112
|
+
value: input.signer ?? null,
|
113
|
+
},
|
114
|
+
marginfiProgram: {
|
115
|
+
index: 1,
|
116
|
+
isWritable: false as boolean,
|
117
|
+
value: input.marginfiProgram ?? null,
|
118
|
+
},
|
119
|
+
systemProgram: {
|
120
|
+
index: 2,
|
121
|
+
isWritable: false as boolean,
|
122
|
+
value: input.systemProgram ?? null,
|
123
|
+
},
|
124
|
+
tokenProgram: {
|
125
|
+
index: 3,
|
126
|
+
isWritable: false as boolean,
|
127
|
+
value: input.tokenProgram ?? null,
|
128
|
+
},
|
129
|
+
ataProgram: {
|
130
|
+
index: 4,
|
131
|
+
isWritable: false as boolean,
|
132
|
+
value: input.ataProgram ?? null,
|
133
|
+
},
|
134
|
+
rent: { index: 5, isWritable: false as boolean, value: input.rent ?? null },
|
135
|
+
solautoPosition: {
|
136
|
+
index: 6,
|
137
|
+
isWritable: true as boolean,
|
138
|
+
value: input.solautoPosition ?? null,
|
139
|
+
},
|
140
|
+
marginfiGroup: {
|
141
|
+
index: 7,
|
142
|
+
isWritable: false as boolean,
|
143
|
+
value: input.marginfiGroup ?? null,
|
144
|
+
},
|
145
|
+
marginfiAccount: {
|
146
|
+
index: 8,
|
147
|
+
isWritable: true as boolean,
|
148
|
+
value: input.marginfiAccount ?? null,
|
149
|
+
},
|
150
|
+
supplyBank: {
|
151
|
+
index: 9,
|
152
|
+
isWritable: true as boolean,
|
153
|
+
value: input.supplyBank ?? null,
|
154
|
+
},
|
155
|
+
supplyPriceOracle: {
|
156
|
+
index: 10,
|
157
|
+
isWritable: false as boolean,
|
158
|
+
value: input.supplyPriceOracle ?? null,
|
159
|
+
},
|
160
|
+
sourceSupplyTa: {
|
161
|
+
index: 11,
|
162
|
+
isWritable: true as boolean,
|
163
|
+
value: input.sourceSupplyTa ?? null,
|
164
|
+
},
|
165
|
+
vaultSupplyTa: {
|
166
|
+
index: 12,
|
167
|
+
isWritable: true as boolean,
|
168
|
+
value: input.vaultSupplyTa ?? null,
|
169
|
+
},
|
170
|
+
supplyVaultAuthority: {
|
171
|
+
index: 13,
|
172
|
+
isWritable: true as boolean,
|
173
|
+
value: input.supplyVaultAuthority ?? null,
|
174
|
+
},
|
175
|
+
debtBank: {
|
176
|
+
index: 14,
|
177
|
+
isWritable: true as boolean,
|
178
|
+
value: input.debtBank ?? null,
|
179
|
+
},
|
180
|
+
debtPriceOracle: {
|
181
|
+
index: 15,
|
182
|
+
isWritable: false as boolean,
|
183
|
+
value: input.debtPriceOracle ?? null,
|
184
|
+
},
|
185
|
+
sourceDebtTa: {
|
186
|
+
index: 16,
|
187
|
+
isWritable: true as boolean,
|
188
|
+
value: input.sourceDebtTa ?? null,
|
189
|
+
},
|
190
|
+
vaultDebtTa: {
|
191
|
+
index: 17,
|
192
|
+
isWritable: true as boolean,
|
193
|
+
value: input.vaultDebtTa ?? null,
|
194
|
+
},
|
195
|
+
debtVaultAuthority: {
|
196
|
+
index: 18,
|
197
|
+
isWritable: true as boolean,
|
198
|
+
value: input.debtVaultAuthority ?? null,
|
199
|
+
},
|
200
|
+
} satisfies ResolvedAccountsWithIndices;
|
201
|
+
|
202
|
+
// Arguments.
|
203
|
+
const resolvedArgs: MarginfiProtocolInteractionInstructionArgs = { ...input };
|
204
|
+
|
205
|
+
// Default values.
|
206
|
+
if (!resolvedAccounts.systemProgram.value) {
|
207
|
+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
|
208
|
+
'splSystem',
|
209
|
+
'11111111111111111111111111111111'
|
210
|
+
);
|
211
|
+
resolvedAccounts.systemProgram.isWritable = false;
|
212
|
+
}
|
213
|
+
if (!resolvedAccounts.tokenProgram.value) {
|
214
|
+
resolvedAccounts.tokenProgram.value = context.programs.getPublicKey(
|
215
|
+
'splToken',
|
216
|
+
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
|
217
|
+
);
|
218
|
+
resolvedAccounts.tokenProgram.isWritable = false;
|
219
|
+
}
|
220
|
+
if (!resolvedAccounts.ataProgram.value) {
|
221
|
+
resolvedAccounts.ataProgram.value = context.programs.getPublicKey(
|
222
|
+
'splAssociatedToken',
|
223
|
+
'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'
|
224
|
+
);
|
225
|
+
resolvedAccounts.ataProgram.isWritable = false;
|
226
|
+
}
|
227
|
+
if (!resolvedAccounts.rent.value) {
|
228
|
+
resolvedAccounts.rent.value = publicKey(
|
229
|
+
'SysvarRent111111111111111111111111111111111'
|
230
|
+
);
|
231
|
+
}
|
232
|
+
|
233
|
+
// Accounts in order.
|
234
|
+
const orderedAccounts: ResolvedAccount[] = Object.values(
|
235
|
+
resolvedAccounts
|
236
|
+
).sort((a, b) => a.index - b.index);
|
237
|
+
|
238
|
+
// Keys and Signers.
|
239
|
+
const [keys, signers] = getAccountMetasAndSigners(
|
240
|
+
orderedAccounts,
|
241
|
+
'programId',
|
242
|
+
programId
|
243
|
+
);
|
244
|
+
|
245
|
+
// Data.
|
246
|
+
const data =
|
247
|
+
getMarginfiProtocolInteractionInstructionDataSerializer().serialize(
|
248
|
+
resolvedArgs as MarginfiProtocolInteractionInstructionDataArgs
|
249
|
+
);
|
250
|
+
|
251
|
+
// Bytes Created On Chain.
|
252
|
+
const bytesCreatedOnChain = 0;
|
253
|
+
|
254
|
+
return transactionBuilder([
|
255
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
|
256
|
+
]);
|
257
|
+
}
|