@voltr/vault-sdk 1.0.21 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/batchFetchers.d.ts +7 -0
- package/dist/extensions/batchFetchers.d.ts.map +1 -0
- package/dist/extensions/batchFetchers.js +63 -0
- package/dist/extensions/batchFetchers.js.map +1 -0
- package/dist/extensions/decimal.d.ts +11 -0
- package/dist/extensions/decimal.d.ts.map +1 -0
- package/dist/extensions/decimal.js +19 -0
- package/dist/extensions/decimal.js.map +1 -0
- package/dist/extensions/fees.d.ts +6 -0
- package/dist/extensions/fees.d.ts.map +1 -0
- package/dist/extensions/fees.js +23 -0
- package/dist/extensions/fees.js.map +1 -0
- package/dist/extensions/index.d.ts +10 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +26 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/lpEconomics.d.ts +27 -0
- package/dist/extensions/lpEconomics.d.ts.map +1 -0
- package/dist/extensions/lpEconomics.js +140 -0
- package/dist/extensions/lpEconomics.js.map +1 -0
- package/dist/extensions/math.d.ts +90 -0
- package/dist/extensions/math.d.ts.map +1 -0
- package/dist/extensions/math.js +182 -0
- package/dist/extensions/math.js.map +1 -0
- package/dist/extensions/metadataPda.d.ts +18 -0
- package/dist/extensions/metadataPda.d.ts.map +1 -0
- package/dist/extensions/metadataPda.js +34 -0
- package/dist/extensions/metadataPda.js.map +1 -0
- package/dist/extensions/position.d.ts +19 -0
- package/dist/extensions/position.d.ts.map +1 -0
- package/dist/extensions/position.js +28 -0
- package/dist/extensions/position.js.map +1 -0
- package/dist/extensions/rpc.d.ts +8 -0
- package/dist/extensions/rpc.d.ts.map +1 -0
- package/dist/{types/voltr_vault.js → extensions/rpc.js} +1 -0
- package/dist/extensions/rpc.js.map +1 -0
- package/dist/extensions/withdrawals.d.ts +16 -0
- package/dist/extensions/withdrawals.d.ts.map +1 -0
- package/dist/extensions/withdrawals.js +59 -0
- package/dist/extensions/withdrawals.js.map +1 -0
- package/dist/generated/accounts/adaptorAddReceipt.d.ts +57 -0
- package/dist/generated/accounts/adaptorAddReceipt.d.ts.map +1 -0
- package/dist/generated/accounts/adaptorAddReceipt.js +82 -0
- package/dist/generated/accounts/adaptorAddReceipt.js.map +1 -0
- package/dist/generated/accounts/directWithdrawInitReceipt.d.ts +60 -0
- package/dist/generated/accounts/directWithdrawInitReceipt.d.ts.map +1 -0
- package/dist/generated/accounts/directWithdrawInitReceipt.js +95 -0
- package/dist/generated/accounts/directWithdrawInitReceipt.js.map +1 -0
- package/dist/generated/accounts/index.d.ts +14 -0
- package/dist/generated/accounts/index.d.ts.map +1 -0
- package/dist/generated/accounts/index.js +30 -0
- package/dist/generated/accounts/index.js.map +1 -0
- package/dist/generated/accounts/protocol.d.ts +57 -0
- package/dist/generated/accounts/protocol.d.ts.map +1 -0
- package/dist/generated/accounts/protocol.js +82 -0
- package/dist/generated/accounts/protocol.js.map +1 -0
- package/dist/generated/accounts/requestWithdrawVaultReceipt.d.ts +43 -0
- package/dist/generated/accounts/requestWithdrawVaultReceipt.d.ts.map +1 -0
- package/dist/generated/accounts/requestWithdrawVaultReceipt.js +85 -0
- package/dist/generated/accounts/requestWithdrawVaultReceipt.js.map +1 -0
- package/dist/generated/accounts/strategyInitReceipt.d.ts +69 -0
- package/dist/generated/accounts/strategyInitReceipt.d.ts.map +1 -0
- package/dist/generated/accounts/strategyInitReceipt.js +91 -0
- package/dist/generated/accounts/strategyInitReceipt.js.map +1 -0
- package/dist/generated/accounts/vault.d.ts +100 -0
- package/dist/generated/accounts/vault.d.ts.map +1 -0
- package/dist/generated/accounts/vault.js +105 -0
- package/dist/generated/accounts/vault.js.map +1 -0
- package/dist/generated/errors/index.d.ts +9 -0
- package/dist/generated/errors/index.d.ts.map +1 -0
- package/dist/{types → generated/errors}/index.js +9 -2
- package/dist/generated/errors/index.js.map +1 -0
- package/dist/generated/errors/voltrVault.d.ts +52 -0
- package/dist/generated/errors/voltrVault.d.ts.map +1 -0
- package/dist/generated/errors/voltrVault.js +77 -0
- package/dist/generated/errors/voltrVault.js.map +1 -0
- package/dist/generated/index.d.ts +14 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +30 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/instructions/acceptProtocolAdmin.d.ts +47 -0
- package/dist/generated/instructions/acceptProtocolAdmin.d.ts.map +1 -0
- package/dist/generated/instructions/acceptProtocolAdmin.js +103 -0
- package/dist/generated/instructions/acceptProtocolAdmin.js.map +1 -0
- package/dist/generated/instructions/acceptVaultAdmin.d.ts +40 -0
- package/dist/generated/instructions/acceptVaultAdmin.d.ts.map +1 -0
- package/dist/generated/instructions/acceptVaultAdmin.js +75 -0
- package/dist/generated/instructions/acceptVaultAdmin.js.map +1 -0
- package/dist/generated/instructions/addAdaptor.d.ts +67 -0
- package/dist/generated/instructions/addAdaptor.d.ts.map +1 -0
- package/dist/generated/instructions/addAdaptor.js +149 -0
- package/dist/generated/instructions/addAdaptor.js.map +1 -0
- package/dist/generated/instructions/calibrateHighWaterMark.d.ts +63 -0
- package/dist/generated/instructions/calibrateHighWaterMark.d.ts.map +1 -0
- package/dist/generated/instructions/calibrateHighWaterMark.js +150 -0
- package/dist/generated/instructions/calibrateHighWaterMark.js.map +1 -0
- package/dist/generated/instructions/calibrateHighWaterMarkUnsafe.d.ts +55 -0
- package/dist/generated/instructions/calibrateHighWaterMarkUnsafe.d.ts.map +1 -0
- package/dist/generated/instructions/calibrateHighWaterMarkUnsafe.js +121 -0
- package/dist/generated/instructions/calibrateHighWaterMarkUnsafe.js.map +1 -0
- package/dist/generated/instructions/cancelRequestWithdrawVault.d.ts +84 -0
- package/dist/generated/instructions/cancelRequestWithdrawVault.d.ts.map +1 -0
- package/dist/generated/instructions/cancelRequestWithdrawVault.js +208 -0
- package/dist/generated/instructions/cancelRequestWithdrawVault.js.map +1 -0
- package/dist/generated/instructions/closeStrategy.d.ts +67 -0
- package/dist/generated/instructions/closeStrategy.d.ts.map +1 -0
- package/dist/generated/instructions/closeStrategy.js +149 -0
- package/dist/generated/instructions/closeStrategy.js.map +1 -0
- package/dist/generated/instructions/createLpMetadata.d.ts +88 -0
- package/dist/generated/instructions/createLpMetadata.d.ts.map +1 -0
- package/dist/generated/instructions/createLpMetadata.js +194 -0
- package/dist/generated/instructions/createLpMetadata.js.map +1 -0
- package/dist/generated/instructions/depositStrategy.d.ts +111 -0
- package/dist/generated/instructions/depositStrategy.d.ts.map +1 -0
- package/dist/generated/instructions/depositStrategy.js +277 -0
- package/dist/generated/instructions/depositStrategy.js.map +1 -0
- package/dist/generated/instructions/depositVault.d.ts +108 -0
- package/dist/generated/instructions/depositVault.d.ts.map +1 -0
- package/dist/generated/instructions/depositVault.js +258 -0
- package/dist/generated/instructions/depositVault.js.map +1 -0
- package/dist/generated/instructions/directWithdrawStrategy.d.ts +125 -0
- package/dist/generated/instructions/directWithdrawStrategy.d.ts.map +1 -0
- package/dist/generated/instructions/directWithdrawStrategy.js +338 -0
- package/dist/generated/instructions/directWithdrawStrategy.js.map +1 -0
- package/dist/generated/instructions/directWithdrawStrategyWithTolerance.d.ts +129 -0
- package/dist/generated/instructions/directWithdrawStrategyWithTolerance.d.ts.map +1 -0
- package/dist/generated/instructions/directWithdrawStrategyWithTolerance.js +338 -0
- package/dist/generated/instructions/directWithdrawStrategyWithTolerance.js.map +1 -0
- package/dist/generated/instructions/harvestFee.d.ts +87 -0
- package/dist/generated/instructions/harvestFee.d.ts.map +1 -0
- package/dist/generated/instructions/harvestFee.js +220 -0
- package/dist/generated/instructions/harvestFee.js.map +1 -0
- package/dist/generated/instructions/index.d.ts +35 -0
- package/dist/generated/instructions/index.d.ts.map +1 -0
- package/dist/generated/instructions/index.js +51 -0
- package/dist/generated/instructions/index.js.map +1 -0
- package/dist/generated/instructions/initProtocol.d.ts +60 -0
- package/dist/generated/instructions/initProtocol.d.ts.map +1 -0
- package/dist/generated/instructions/initProtocol.js +130 -0
- package/dist/generated/instructions/initProtocol.js.map +1 -0
- package/dist/generated/instructions/initializeDirectWithdrawStrategy.d.ts +92 -0
- package/dist/generated/instructions/initializeDirectWithdrawStrategy.d.ts.map +1 -0
- package/dist/generated/instructions/initializeDirectWithdrawStrategy.js +214 -0
- package/dist/generated/instructions/initializeDirectWithdrawStrategy.js.map +1 -0
- package/dist/generated/instructions/initializeStrategy.d.ts +88 -0
- package/dist/generated/instructions/initializeStrategy.d.ts.map +1 -0
- package/dist/generated/instructions/initializeStrategy.js +210 -0
- package/dist/generated/instructions/initializeStrategy.js.map +1 -0
- package/dist/generated/instructions/initializeVault.d.ts +172 -0
- package/dist/generated/instructions/initializeVault.d.ts.map +1 -0
- package/dist/generated/instructions/initializeVault.js +289 -0
- package/dist/generated/instructions/initializeVault.js.map +1 -0
- package/dist/generated/instructions/instantWithdrawStrategy.d.ts +133 -0
- package/dist/generated/instructions/instantWithdrawStrategy.d.ts.map +1 -0
- package/dist/generated/instructions/instantWithdrawStrategy.js +320 -0
- package/dist/generated/instructions/instantWithdrawStrategy.js.map +1 -0
- package/dist/generated/instructions/instantWithdrawStrategyWithTolerance.d.ts +137 -0
- package/dist/generated/instructions/instantWithdrawStrategyWithTolerance.d.ts.map +1 -0
- package/dist/generated/instructions/instantWithdrawStrategyWithTolerance.js +320 -0
- package/dist/generated/instructions/instantWithdrawStrategyWithTolerance.js.map +1 -0
- package/dist/generated/instructions/instantWithdrawVault.d.ts +112 -0
- package/dist/generated/instructions/instantWithdrawVault.d.ts.map +1 -0
- package/dist/generated/instructions/instantWithdrawVault.js +249 -0
- package/dist/generated/instructions/instantWithdrawVault.js.map +1 -0
- package/dist/generated/instructions/removeAdaptor.d.ts +63 -0
- package/dist/generated/instructions/removeAdaptor.d.ts.map +1 -0
- package/dist/generated/instructions/removeAdaptor.js +144 -0
- package/dist/generated/instructions/removeAdaptor.js.map +1 -0
- package/dist/generated/instructions/requestWithdrawVault.d.ts +104 -0
- package/dist/generated/instructions/requestWithdrawVault.d.ts.map +1 -0
- package/dist/generated/instructions/requestWithdrawVault.js +225 -0
- package/dist/generated/instructions/requestWithdrawVault.js.map +1 -0
- package/dist/generated/instructions/updateProtocol.d.ts +57 -0
- package/dist/generated/instructions/updateProtocol.d.ts.map +1 -0
- package/dist/generated/instructions/updateProtocol.js +111 -0
- package/dist/generated/instructions/updateProtocol.js.map +1 -0
- package/dist/generated/instructions/updateVaultConfig.d.ts +65 -0
- package/dist/generated/instructions/updateVaultConfig.d.ts.map +1 -0
- package/dist/generated/instructions/updateVaultConfig.js +133 -0
- package/dist/generated/instructions/updateVaultConfig.js.map +1 -0
- package/dist/generated/instructions/updateVaultProtocolFee.d.ts +65 -0
- package/dist/generated/instructions/updateVaultProtocolFee.d.ts.map +1 -0
- package/dist/generated/instructions/updateVaultProtocolFee.js +132 -0
- package/dist/generated/instructions/updateVaultProtocolFee.js.map +1 -0
- package/dist/generated/instructions/withdrawStrategy.d.ts +111 -0
- package/dist/generated/instructions/withdrawStrategy.d.ts.map +1 -0
- package/dist/generated/instructions/withdrawStrategy.js +277 -0
- package/dist/generated/instructions/withdrawStrategy.js.map +1 -0
- package/dist/generated/instructions/withdrawVault.d.ts +103 -0
- package/dist/generated/instructions/withdrawVault.d.ts.map +1 -0
- package/dist/generated/instructions/withdrawVault.js +258 -0
- package/dist/generated/instructions/withdrawVault.js.map +1 -0
- package/dist/generated/pdas/adaptorAddReceipt.d.ts +16 -0
- package/dist/generated/pdas/adaptorAddReceipt.d.ts.map +1 -0
- package/dist/generated/pdas/adaptorAddReceipt.js +26 -0
- package/dist/generated/pdas/adaptorAddReceipt.js.map +1 -0
- package/dist/generated/pdas/directWithdrawInitReceipt.d.ts +16 -0
- package/dist/generated/pdas/directWithdrawInitReceipt.d.ts.map +1 -0
- package/dist/generated/pdas/directWithdrawInitReceipt.js +26 -0
- package/dist/generated/pdas/directWithdrawInitReceipt.js.map +1 -0
- package/dist/generated/pdas/index.d.ts +17 -0
- package/dist/generated/pdas/index.d.ts.map +1 -0
- package/dist/generated/pdas/index.js +33 -0
- package/dist/generated/pdas/index.js.map +1 -0
- package/dist/generated/pdas/protocol.d.ts +12 -0
- package/dist/generated/pdas/protocol.d.ts.map +1 -0
- package/dist/generated/pdas/protocol.js +21 -0
- package/dist/generated/pdas/protocol.js.map +1 -0
- package/dist/generated/pdas/requestWithdrawVaultReceipt.d.ts +16 -0
- package/dist/generated/pdas/requestWithdrawVaultReceipt.d.ts.map +1 -0
- package/dist/generated/pdas/requestWithdrawVaultReceipt.js +27 -0
- package/dist/generated/pdas/requestWithdrawVaultReceipt.js.map +1 -0
- package/dist/generated/pdas/strategyInitReceipt.d.ts +16 -0
- package/dist/generated/pdas/strategyInitReceipt.d.ts.map +1 -0
- package/dist/generated/pdas/strategyInitReceipt.js +26 -0
- package/dist/generated/pdas/strategyInitReceipt.js.map +1 -0
- package/dist/generated/pdas/vaultAssetIdleAuth.d.ts +15 -0
- package/dist/generated/pdas/vaultAssetIdleAuth.d.ts.map +1 -0
- package/dist/generated/pdas/vaultAssetIdleAuth.js +25 -0
- package/dist/generated/pdas/vaultAssetIdleAuth.js.map +1 -0
- package/dist/generated/pdas/vaultLpMint.d.ts +15 -0
- package/dist/generated/pdas/vaultLpMint.d.ts.map +1 -0
- package/dist/generated/pdas/vaultLpMint.js +24 -0
- package/dist/generated/pdas/vaultLpMint.js.map +1 -0
- package/dist/generated/pdas/vaultLpMintAuth.d.ts +15 -0
- package/dist/generated/pdas/vaultLpMintAuth.d.ts.map +1 -0
- package/dist/generated/pdas/vaultLpMintAuth.js +25 -0
- package/dist/generated/pdas/vaultLpMintAuth.js.map +1 -0
- package/dist/generated/pdas/vaultStrategyAuth.d.ts +16 -0
- package/dist/generated/pdas/vaultStrategyAuth.d.ts.map +1 -0
- package/dist/generated/pdas/vaultStrategyAuth.js +26 -0
- package/dist/generated/pdas/vaultStrategyAuth.js.map +1 -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 +25 -0
- package/dist/generated/programs/index.js.map +1 -0
- package/dist/generated/programs/voltrVault.d.ts +172 -0
- package/dist/generated/programs/voltrVault.d.ts.map +1 -0
- package/dist/generated/programs/voltrVault.js +447 -0
- package/dist/generated/programs/voltrVault.js.map +1 -0
- package/dist/generated/types/acceptProtocolAdminEvent.d.ts +24 -0
- package/dist/generated/types/acceptProtocolAdminEvent.d.ts.map +1 -0
- package/dist/generated/types/acceptProtocolAdminEvent.js +33 -0
- package/dist/generated/types/acceptProtocolAdminEvent.js.map +1 -0
- package/dist/generated/types/acceptVaultAdminEvent.d.ts +24 -0
- package/dist/generated/types/acceptVaultAdminEvent.d.ts.map +1 -0
- package/dist/generated/types/acceptVaultAdminEvent.js +33 -0
- package/dist/generated/types/acceptVaultAdminEvent.js.map +1 -0
- package/dist/generated/types/addAdaptorEvent.d.ts +28 -0
- package/dist/generated/types/addAdaptorEvent.d.ts.map +1 -0
- package/dist/generated/types/addAdaptorEvent.js +37 -0
- package/dist/generated/types/addAdaptorEvent.js.map +1 -0
- package/dist/generated/types/calibrateHighWaterMarkEvent.d.ts +34 -0
- package/dist/generated/types/calibrateHighWaterMarkEvent.d.ts.map +1 -0
- package/dist/generated/types/calibrateHighWaterMarkEvent.js +43 -0
- package/dist/generated/types/calibrateHighWaterMarkEvent.js.map +1 -0
- package/dist/generated/types/calibrateHighWaterMarkUnsafeEvent.d.ts +30 -0
- package/dist/generated/types/calibrateHighWaterMarkUnsafeEvent.d.ts.map +1 -0
- package/dist/generated/types/calibrateHighWaterMarkUnsafeEvent.js +39 -0
- package/dist/generated/types/calibrateHighWaterMarkUnsafeEvent.js.map +1 -0
- package/dist/generated/types/cancelRequestWithdrawVaultEvent.d.ts +32 -0
- package/dist/generated/types/cancelRequestWithdrawVaultEvent.d.ts.map +1 -0
- package/dist/generated/types/cancelRequestWithdrawVaultEvent.js +41 -0
- package/dist/generated/types/cancelRequestWithdrawVaultEvent.js.map +1 -0
- package/dist/generated/types/closeStrategyEvent.d.ts +26 -0
- package/dist/generated/types/closeStrategyEvent.d.ts.map +1 -0
- package/dist/generated/types/closeStrategyEvent.js +35 -0
- package/dist/generated/types/closeStrategyEvent.js.map +1 -0
- package/dist/generated/types/depositStrategyEvent.d.ts +52 -0
- package/dist/generated/types/depositStrategyEvent.d.ts.map +1 -0
- package/dist/generated/types/depositStrategyEvent.js +61 -0
- package/dist/generated/types/depositStrategyEvent.js.map +1 -0
- package/dist/generated/types/depositVaultEvent.d.ts +48 -0
- package/dist/generated/types/depositVaultEvent.d.ts.map +1 -0
- package/dist/generated/types/depositVaultEvent.js +57 -0
- package/dist/generated/types/depositVaultEvent.js.map +1 -0
- package/dist/generated/types/directWithdrawStrategyEvent.d.ts +62 -0
- package/dist/generated/types/directWithdrawStrategyEvent.d.ts.map +1 -0
- package/dist/generated/types/directWithdrawStrategyEvent.js +71 -0
- package/dist/generated/types/directWithdrawStrategyEvent.js.map +1 -0
- package/dist/generated/types/feeConfiguration.d.ts +33 -0
- package/dist/generated/types/feeConfiguration.d.ts.map +1 -0
- package/dist/generated/types/feeConfiguration.js +43 -0
- package/dist/generated/types/feeConfiguration.js.map +1 -0
- package/dist/generated/types/feeState.d.ts +32 -0
- package/dist/generated/types/feeState.d.ts.map +1 -0
- package/dist/generated/types/feeState.js +33 -0
- package/dist/generated/types/feeState.js.map +1 -0
- package/dist/generated/types/feeUpdate.d.ts +24 -0
- package/dist/generated/types/feeUpdate.d.ts.map +1 -0
- package/dist/generated/types/feeUpdate.js +29 -0
- package/dist/generated/types/feeUpdate.js.map +1 -0
- package/dist/generated/types/harvestFeeEvent.d.ts +32 -0
- package/dist/generated/types/harvestFeeEvent.d.ts.map +1 -0
- package/dist/generated/types/harvestFeeEvent.js +41 -0
- package/dist/generated/types/harvestFeeEvent.js.map +1 -0
- package/dist/generated/types/highWaterMark.d.ts +28 -0
- package/dist/generated/types/highWaterMark.d.ts.map +1 -0
- package/dist/generated/types/highWaterMark.js +31 -0
- package/dist/generated/types/highWaterMark.js.map +1 -0
- package/dist/generated/types/index.d.ts +44 -0
- package/dist/generated/types/index.d.ts.map +1 -0
- package/dist/generated/types/index.js +60 -0
- package/dist/generated/types/index.js.map +1 -0
- package/dist/generated/types/initProtocolEvent.d.ts +22 -0
- package/dist/generated/types/initProtocolEvent.d.ts.map +1 -0
- package/dist/generated/types/initProtocolEvent.js +31 -0
- package/dist/generated/types/initProtocolEvent.js.map +1 -0
- package/dist/generated/types/initializeDirectWithdrawStrategyEvent.d.ts +34 -0
- package/dist/generated/types/initializeDirectWithdrawStrategyEvent.d.ts.map +1 -0
- package/dist/generated/types/initializeDirectWithdrawStrategyEvent.js +55 -0
- package/dist/generated/types/initializeDirectWithdrawStrategyEvent.js.map +1 -0
- package/dist/generated/types/initializeStrategyEvent.d.ts +32 -0
- package/dist/generated/types/initializeStrategyEvent.d.ts.map +1 -0
- package/dist/generated/types/initializeStrategyEvent.js +41 -0
- package/dist/generated/types/initializeStrategyEvent.js.map +1 -0
- package/dist/generated/types/initializeVaultEvent.d.ts +56 -0
- package/dist/generated/types/initializeVaultEvent.d.ts.map +1 -0
- package/dist/generated/types/initializeVaultEvent.js +71 -0
- package/dist/generated/types/initializeVaultEvent.js.map +1 -0
- package/dist/generated/types/instantWithdrawStrategyEvent.d.ts +68 -0
- package/dist/generated/types/instantWithdrawStrategyEvent.d.ts.map +1 -0
- package/dist/generated/types/instantWithdrawStrategyEvent.js +77 -0
- package/dist/generated/types/instantWithdrawStrategyEvent.js.map +1 -0
- package/dist/generated/types/instantWithdrawVaultEvent.d.ts +56 -0
- package/dist/generated/types/instantWithdrawVaultEvent.d.ts.map +1 -0
- package/dist/generated/types/instantWithdrawVaultEvent.js +65 -0
- package/dist/generated/types/instantWithdrawVaultEvent.js.map +1 -0
- package/dist/generated/types/lockedProfitState.d.ts +20 -0
- package/dist/generated/types/lockedProfitState.d.ts.map +1 -0
- package/dist/generated/types/lockedProfitState.js +29 -0
- package/dist/generated/types/lockedProfitState.js.map +1 -0
- package/dist/generated/types/protocolConfigField.d.ts +17 -0
- package/dist/generated/types/protocolConfigField.d.ts.map +1 -0
- package/dist/generated/types/protocolConfigField.js +29 -0
- package/dist/generated/types/protocolConfigField.js.map +1 -0
- package/dist/generated/types/protocolFeeField.d.ts +17 -0
- package/dist/generated/types/protocolFeeField.d.ts.map +1 -0
- package/dist/generated/types/protocolFeeField.js +29 -0
- package/dist/generated/types/protocolFeeField.js.map +1 -0
- package/dist/generated/types/removeAdaptorEvent.d.ts +26 -0
- package/dist/generated/types/removeAdaptorEvent.d.ts.map +1 -0
- package/dist/generated/types/removeAdaptorEvent.js +35 -0
- package/dist/generated/types/removeAdaptorEvent.js.map +1 -0
- package/dist/generated/types/requestWithdrawVaultEvent.d.ts +44 -0
- package/dist/generated/types/requestWithdrawVaultEvent.d.ts.map +1 -0
- package/dist/generated/types/requestWithdrawVaultEvent.js +53 -0
- package/dist/generated/types/requestWithdrawVaultEvent.js.map +1 -0
- package/dist/generated/types/updateProtocolEvent.d.ts +28 -0
- package/dist/generated/types/updateProtocolEvent.d.ts.map +1 -0
- package/dist/generated/types/updateProtocolEvent.js +37 -0
- package/dist/generated/types/updateProtocolEvent.js.map +1 -0
- package/dist/generated/types/updateVaultConfigEvent.d.ts +28 -0
- package/dist/generated/types/updateVaultConfigEvent.d.ts.map +1 -0
- package/dist/generated/types/updateVaultConfigEvent.js +37 -0
- package/dist/generated/types/updateVaultConfigEvent.js.map +1 -0
- package/dist/generated/types/updateVaultEvent.d.ts +62 -0
- package/dist/generated/types/updateVaultEvent.d.ts.map +1 -0
- package/dist/generated/types/updateVaultEvent.js +71 -0
- package/dist/generated/types/updateVaultEvent.js.map +1 -0
- package/dist/generated/types/updateVaultProtocolFeeEvent.d.ts +28 -0
- package/dist/generated/types/updateVaultProtocolFeeEvent.d.ts.map +1 -0
- package/dist/generated/types/updateVaultProtocolFeeEvent.js +37 -0
- package/dist/generated/types/updateVaultProtocolFeeEvent.js.map +1 -0
- package/dist/generated/types/vaultAsset.d.ts +36 -0
- package/dist/generated/types/vaultAsset.d.ts.map +1 -0
- package/dist/generated/types/vaultAsset.js +35 -0
- package/dist/generated/types/vaultAsset.js.map +1 -0
- package/dist/generated/types/vaultConfigField.d.ts +28 -0
- package/dist/generated/types/vaultConfigField.d.ts.map +1 -0
- package/dist/generated/types/vaultConfigField.js +40 -0
- package/dist/generated/types/vaultConfigField.js.map +1 -0
- package/dist/generated/types/vaultConfiguration.d.ts +40 -0
- package/dist/generated/types/vaultConfiguration.d.ts.map +1 -0
- package/dist/generated/types/vaultConfiguration.js +37 -0
- package/dist/generated/types/vaultConfiguration.js.map +1 -0
- package/dist/generated/types/vaultLp.d.ts +23 -0
- package/dist/generated/types/vaultLp.d.ts.map +1 -0
- package/dist/generated/types/vaultLp.js +33 -0
- package/dist/generated/types/vaultLp.js.map +1 -0
- package/dist/generated/types/withdrawStrategyEvent.d.ts +52 -0
- package/dist/generated/types/withdrawStrategyEvent.d.ts.map +1 -0
- package/dist/generated/types/withdrawStrategyEvent.js +61 -0
- package/dist/generated/types/withdrawStrategyEvent.js.map +1 -0
- package/dist/generated/types/withdrawVaultEvent.d.ts +50 -0
- package/dist/generated/types/withdrawVaultEvent.d.ts.map +1 -0
- package/dist/generated/types/withdrawVaultEvent.js +59 -0
- package/dist/generated/types/withdrawVaultEvent.js.map +1 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -0
- package/package.json +31 -27
- package/src/extensions/batchFetchers.ts +121 -0
- package/src/extensions/decimal.ts +15 -0
- package/src/extensions/fees.ts +36 -0
- package/src/extensions/index.ts +9 -0
- package/src/extensions/lpEconomics.ts +225 -0
- package/src/extensions/math.ts +338 -0
- package/src/extensions/metadataPda.ts +47 -0
- package/src/extensions/position.ts +54 -0
- package/src/extensions/rpc.ts +17 -0
- package/src/extensions/withdrawals.ts +113 -0
- package/src/generated/accounts/adaptorAddReceipt.ts +194 -0
- package/src/generated/accounts/directWithdrawInitReceipt.ts +235 -0
- package/src/generated/accounts/index.ts +14 -0
- package/src/generated/accounts/protocol.ts +176 -0
- package/src/generated/accounts/requestWithdrawVaultReceipt.ts +197 -0
- package/src/generated/accounts/strategyInitReceipt.ts +221 -0
- package/src/generated/accounts/vault.ts +274 -0
- package/src/generated/errors/index.ts +9 -0
- package/src/generated/errors/voltrVault.ts +112 -0
- package/src/generated/index.ts +14 -0
- package/src/generated/instructions/acceptProtocolAdmin.ts +248 -0
- package/src/generated/instructions/acceptVaultAdmin.ts +187 -0
- package/src/generated/instructions/addAdaptor.ts +391 -0
- package/src/generated/instructions/calibrateHighWaterMark.ts +394 -0
- package/src/generated/instructions/calibrateHighWaterMarkUnsafe.ts +311 -0
- package/src/generated/instructions/cancelRequestWithdrawVault.ts +546 -0
- package/src/generated/instructions/closeStrategy.ts +395 -0
- package/src/generated/instructions/createLpMetadata.ts +501 -0
- package/src/generated/instructions/depositStrategy.ts +737 -0
- package/src/generated/instructions/depositVault.ts +686 -0
- package/src/generated/instructions/directWithdrawStrategy.ts +903 -0
- package/src/generated/instructions/directWithdrawStrategyWithTolerance.ts +913 -0
- package/src/generated/instructions/harvestFee.ts +599 -0
- package/src/generated/instructions/index.ts +35 -0
- package/src/generated/instructions/initProtocol.ts +329 -0
- package/src/generated/instructions/initializeDirectWithdrawStrategy.ts +576 -0
- package/src/generated/instructions/initializeStrategy.ts +557 -0
- package/src/generated/instructions/initializeVault.ts +784 -0
- package/src/generated/instructions/instantWithdrawStrategy.ts +870 -0
- package/src/generated/instructions/instantWithdrawStrategyWithTolerance.ts +878 -0
- package/src/generated/instructions/instantWithdrawVault.ts +670 -0
- package/src/generated/instructions/removeAdaptor.ts +371 -0
- package/src/generated/instructions/requestWithdrawVault.ts +608 -0
- package/src/generated/instructions/updateProtocol.ts +270 -0
- package/src/generated/instructions/updateVaultConfig.ts +343 -0
- package/src/generated/instructions/updateVaultProtocolFee.ts +344 -0
- package/src/generated/instructions/withdrawStrategy.ts +737 -0
- package/src/generated/instructions/withdrawVault.ts +685 -0
- package/src/generated/pdas/adaptorAddReceipt.ts +42 -0
- package/src/generated/pdas/directWithdrawInitReceipt.ts +42 -0
- package/src/generated/pdas/index.ts +17 -0
- package/src/generated/pdas/protocol.ts +30 -0
- package/src/generated/pdas/requestWithdrawVaultReceipt.ts +43 -0
- package/src/generated/pdas/strategyInitReceipt.ts +42 -0
- package/src/generated/pdas/vaultAssetIdleAuth.ts +40 -0
- package/src/generated/pdas/vaultLpMint.ts +39 -0
- package/src/generated/pdas/vaultLpMintAuth.ts +40 -0
- package/src/generated/pdas/vaultStrategyAuth.ts +42 -0
- package/src/generated/programs/index.ts +9 -0
- package/src/generated/programs/voltrVault.ts +1261 -0
- package/src/generated/types/acceptProtocolAdminEvent.ts +63 -0
- package/src/generated/types/acceptVaultAdminEvent.ts +63 -0
- package/src/generated/types/addAdaptorEvent.ts +68 -0
- package/src/generated/types/calibrateHighWaterMarkEvent.ts +85 -0
- package/src/generated/types/calibrateHighWaterMarkUnsafeEvent.ts +77 -0
- package/src/generated/types/cancelRequestWithdrawVaultEvent.ts +81 -0
- package/src/generated/types/closeStrategyEvent.ts +67 -0
- package/src/generated/types/depositStrategyEvent.ts +121 -0
- package/src/generated/types/depositVaultEvent.ts +113 -0
- package/src/generated/types/directWithdrawStrategyEvent.ts +141 -0
- package/src/generated/types/feeConfiguration.ts +84 -0
- package/src/generated/types/feeState.ts +67 -0
- package/src/generated/types/feeUpdate.ts +50 -0
- package/src/generated/types/harvestFeeEvent.ts +76 -0
- package/src/generated/types/highWaterMark.ts +66 -0
- package/src/generated/types/index.ts +44 -0
- package/src/generated/types/initProtocolEvent.ts +61 -0
- package/src/generated/types/initializeDirectWithdrawStrategyEvent.ts +104 -0
- package/src/generated/types/initializeStrategyEvent.ts +81 -0
- package/src/generated/types/initializeVaultEvent.ts +141 -0
- package/src/generated/types/instantWithdrawStrategyEvent.ts +155 -0
- package/src/generated/types/instantWithdrawVaultEvent.ts +131 -0
- package/src/generated/types/lockedProfitState.ts +52 -0
- package/src/generated/types/protocolConfigField.ts +41 -0
- package/src/generated/types/protocolFeeField.ts +41 -0
- package/src/generated/types/removeAdaptorEvent.ts +67 -0
- package/src/generated/types/requestWithdrawVaultEvent.ts +107 -0
- package/src/generated/types/updateProtocolEvent.ts +77 -0
- package/src/generated/types/updateVaultConfigEvent.ts +77 -0
- package/src/generated/types/updateVaultEvent.ts +141 -0
- package/src/generated/types/updateVaultProtocolFeeEvent.ts +79 -0
- package/src/generated/types/vaultAsset.ts +81 -0
- package/src/generated/types/vaultConfigField.ts +52 -0
- package/src/generated/types/vaultConfiguration.ts +87 -0
- package/src/generated/types/vaultLp.ts +61 -0
- package/src/generated/types/withdrawStrategyEvent.ts +121 -0
- package/src/generated/types/withdrawVaultEvent.ts +117 -0
- package/src/index.ts +2 -0
- package/README.md +0 -453
- package/dist/client.d.ts +0 -1544
- package/dist/client.js +0 -1964
- package/dist/constants.d.ts +0 -20
- package/dist/constants.js +0 -27
- package/dist/decimals.d.ts +0 -3
- package/dist/decimals.js +0 -10
- package/dist/idl/voltr_vault.json +0 -9029
- package/dist/types/index.d.ts +0 -2
- package/dist/types/vault.d.ts +0 -70
- package/dist/types/vault.js +0 -29
- package/dist/types/voltr_vault.d.ts +0 -9035
package/dist/client.d.ts
DELETED
|
@@ -1,1544 +0,0 @@
|
|
|
1
|
-
import { Program, AnchorProvider, Idl } from "@coral-xyz/anchor";
|
|
2
|
-
import BN from "bn.js";
|
|
3
|
-
import { ConfirmOptions, Connection, Keypair, PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
4
|
-
import { VaultParams, VoltrVault, InitializeStrategyArgs, DepositStrategyArgs, WithdrawStrategyArgs, InitializeDirectWithdrawStrategyArgs, RequestWithdrawVaultArgs, InstantWithdrawVaultArgs, InstantWithdrawStrategyArgs, VaultConfigField, ProtocolConfigField, ProtocolFeeField } from "./types";
|
|
5
|
-
declare class AccountUtils {
|
|
6
|
-
conn: Connection;
|
|
7
|
-
constructor(conn: Connection);
|
|
8
|
-
/**
|
|
9
|
-
* Gets the balance of a Solana account
|
|
10
|
-
* @param publicKey - Public key to check balance for
|
|
11
|
-
* @returns Promise resolving to the account balance in lamports
|
|
12
|
-
* @throws {Error} If fetching balance fails
|
|
13
|
-
*/
|
|
14
|
-
getBalance(publicKey: PublicKey): Promise<number>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Main client for interacting with the Voltr protocol
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* The VoltrClient provides methods for initializing and managing vaults,
|
|
21
|
-
* handling strategies, and performing deposits/withdrawals. It requires
|
|
22
|
-
* a Solana connection and optionally accepts a wallet for signing transactions.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import { VoltrClient } from '@voltr/vault-sdk';
|
|
27
|
-
* import { Connection } from '@solana/web3.js';
|
|
28
|
-
*
|
|
29
|
-
* const connection = new Connection('https://api.mainnet-beta.solana.com');
|
|
30
|
-
* const client = new VoltrClient(connection);
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare class VoltrClient extends AccountUtils {
|
|
34
|
-
provider: AnchorProvider;
|
|
35
|
-
vaultProgram: Program<VoltrVault>;
|
|
36
|
-
vaultIdl: Idl;
|
|
37
|
-
/**
|
|
38
|
-
* Creates a new VoltrClient instance
|
|
39
|
-
* @param conn - Solana connection instance
|
|
40
|
-
* @param wallet - Optional keypair for signing transactions
|
|
41
|
-
*/
|
|
42
|
-
constructor(conn: Connection, wallet?: Keypair, opts?: ConfirmOptions);
|
|
43
|
-
private setProvider;
|
|
44
|
-
private setPrograms;
|
|
45
|
-
/**
|
|
46
|
-
* Finds the vault LP mint address for a given vault
|
|
47
|
-
* @param vault - Public key of the vault
|
|
48
|
-
* @returns The PDA for the vault's LP mint
|
|
49
|
-
*/
|
|
50
|
-
findVaultLpMint(vault: PublicKey): PublicKey;
|
|
51
|
-
/**
|
|
52
|
-
* Finds the vault's asset idle authority address
|
|
53
|
-
* @param vault - Public key of the vault
|
|
54
|
-
* @returns The PDA for the vault's asset idle authority
|
|
55
|
-
*/
|
|
56
|
-
findVaultAssetIdleAuth(vault: PublicKey): PublicKey;
|
|
57
|
-
/**
|
|
58
|
-
* Finds all vault-related addresses
|
|
59
|
-
* @param vault - Public key of the vault
|
|
60
|
-
* @returns Object containing all vault-related PDAs
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```typescript
|
|
64
|
-
* const addresses = client.findVaultAddresses(vaultPubkey);
|
|
65
|
-
* console.log(addresses.vaultLpMint.toBase58());
|
|
66
|
-
* console.log(addresses.vaultAssetIdleAuth.toBase58());
|
|
67
|
-
* console.log(addresses.vaultLpFeeAuth.toBase58());
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
findVaultAddresses(vault: PublicKey): {
|
|
71
|
-
vaultLpMint: PublicKey;
|
|
72
|
-
vaultAssetIdleAuth: PublicKey;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Finds the vault strategy auth address
|
|
76
|
-
* @param vault - Public key of the vault
|
|
77
|
-
* @param strategy - Public key of the strategy
|
|
78
|
-
* @returns The PDA for the vault strategy auth
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```typescript
|
|
82
|
-
* const vaultStrategyAuth = client.findVaultStrategyAuth(vaultPubkey, strategyPubkey);
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
findVaultStrategyAuth(vault: PublicKey, strategy: PublicKey): PublicKey;
|
|
86
|
-
/**
|
|
87
|
-
* Finds the strategy init receipt address
|
|
88
|
-
* @param vault - Public key of the vault
|
|
89
|
-
* @param strategy - Public key of the strategy
|
|
90
|
-
* @returns The PDA for the strategy init receipt
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```typescript
|
|
94
|
-
* const strategyInitReceipt = client.findStrategyInitReceipt(vaultPubkey, strategyPubkey);
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
findStrategyInitReceipt(vault: PublicKey, strategy: PublicKey): PublicKey;
|
|
98
|
-
/**
|
|
99
|
-
* Finds the direct withdraw init receipt address
|
|
100
|
-
* @param vault - Public key of the vault
|
|
101
|
-
* @param strategy - Public key of the strategy
|
|
102
|
-
* @returns The PDA for the direct withdraw init receipt
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* ```typescript
|
|
106
|
-
* const directWithdrawInitReceipt = client.findDirectWithdrawInitReceipt(vaultPubkey, strategyPubkey);
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
findDirectWithdrawInitReceipt(vault: PublicKey, strategy: PublicKey): PublicKey;
|
|
110
|
-
findVaultStrategyAddresses(vault: PublicKey, strategy: PublicKey): {
|
|
111
|
-
vaultStrategyAuth: PublicKey;
|
|
112
|
-
strategyInitReceipt: PublicKey;
|
|
113
|
-
directWithdrawInitReceipt: PublicKey;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Finds the request withdraw vault receipt address
|
|
117
|
-
* @param vault - Public key of the vault
|
|
118
|
-
* @param user - Public key of the user
|
|
119
|
-
* @returns The PDA for the request withdraw vault receipt
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* ```typescript
|
|
123
|
-
* const requestWithdrawVaultReceipt = client.findRequestWithdrawVaultReceipt(vaultPubkey, userPubkey);
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
findRequestWithdrawVaultReceipt(vault: PublicKey, user: PublicKey): PublicKey;
|
|
127
|
-
/**
|
|
128
|
-
* Finds the LP metadata account for a given vault
|
|
129
|
-
* @param vault - Public key of the vault
|
|
130
|
-
* @returns The PDA for the LP metadata account
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* ```typescript
|
|
134
|
-
* const lpMetadataAccount = client.findLpMetadataAccount(vaultPubkey);
|
|
135
|
-
* ```
|
|
136
|
-
*/
|
|
137
|
-
findLpMetadataAccount(vault: PublicKey): PublicKey;
|
|
138
|
-
/**
|
|
139
|
-
* Finds the protocol PDA address
|
|
140
|
-
* @returns The PDA for the protocol account
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* ```typescript
|
|
144
|
-
* const protocol = client.findProtocol();
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
findProtocol(): PublicKey;
|
|
148
|
-
/**
|
|
149
|
-
* Creates an instruction to initialize the protocol
|
|
150
|
-
*
|
|
151
|
-
* @param {number} operationalState - Bitflags for allowed operations (e.g., CREATE_VAULT = 1, DEPOSIT_VAULT = 2, etc.)
|
|
152
|
-
* @param {Object} params - Parameters for initializing the protocol
|
|
153
|
-
* @param {PublicKey} params.payer - Public key of the fee payer
|
|
154
|
-
* @param {PublicKey} params.admin - Public key of the protocol admin
|
|
155
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for initializing the protocol
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* ```typescript
|
|
159
|
-
* const ix = await client.createInitProtocolIx(
|
|
160
|
-
* 0xFFFF, // enable all operations
|
|
161
|
-
* {
|
|
162
|
-
* payer: payerPubkey,
|
|
163
|
-
* admin: adminPubkey,
|
|
164
|
-
* }
|
|
165
|
-
* );
|
|
166
|
-
* ```
|
|
167
|
-
*/
|
|
168
|
-
createInitProtocolIx(operationalState: number, { payer, admin, }: {
|
|
169
|
-
payer: PublicKey;
|
|
170
|
-
admin: PublicKey;
|
|
171
|
-
}): Promise<TransactionInstruction>;
|
|
172
|
-
/**
|
|
173
|
-
* Creates an instruction to update the protocol configuration
|
|
174
|
-
*
|
|
175
|
-
* @param {ProtocolConfigField} field - The protocol configuration field to update
|
|
176
|
-
* @param {Buffer} data - The serialized data for the new value
|
|
177
|
-
* @param {Object} params - Parameters for updating the protocol
|
|
178
|
-
* @param {PublicKey} params.admin - Public key of the protocol admin
|
|
179
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for updating the protocol
|
|
180
|
-
*
|
|
181
|
-
* @throws {Error} If the field is unknown
|
|
182
|
-
*
|
|
183
|
-
* @example Update operational state
|
|
184
|
-
* ```typescript
|
|
185
|
-
* const data = Buffer.alloc(2);
|
|
186
|
-
* data.writeUInt16LE(0xFFFF, 0);
|
|
187
|
-
* const ix = await client.createUpdateProtocolIx(
|
|
188
|
-
* ProtocolConfigField.OperationalState,
|
|
189
|
-
* data,
|
|
190
|
-
* { admin: adminPubkey }
|
|
191
|
-
* );
|
|
192
|
-
* ```
|
|
193
|
-
*
|
|
194
|
-
* @example Set pending admin for 2-step transfer
|
|
195
|
-
* ```typescript
|
|
196
|
-
* const data = newAdmin.toBuffer();
|
|
197
|
-
* const ix = await client.createUpdateProtocolIx(
|
|
198
|
-
* ProtocolConfigField.PendingAdmin,
|
|
199
|
-
* data,
|
|
200
|
-
* { admin: adminPubkey }
|
|
201
|
-
* );
|
|
202
|
-
* ```
|
|
203
|
-
*/
|
|
204
|
-
createUpdateProtocolIx(field: ProtocolConfigField, data: Buffer, { admin, }: {
|
|
205
|
-
admin: PublicKey;
|
|
206
|
-
}): Promise<TransactionInstruction>;
|
|
207
|
-
/**
|
|
208
|
-
* Creates an instruction to accept a protocol admin transfer (2-step admin transfer)
|
|
209
|
-
*
|
|
210
|
-
* @param {Object} params - Parameters for accepting protocol admin
|
|
211
|
-
* @param {PublicKey} params.pendingAdmin - Public key of the pending admin (must be signer)
|
|
212
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for accepting protocol admin
|
|
213
|
-
*
|
|
214
|
-
* @example
|
|
215
|
-
* ```typescript
|
|
216
|
-
* const ix = await client.createAcceptProtocolAdminIx({
|
|
217
|
-
* pendingAdmin: pendingAdminPubkey,
|
|
218
|
-
* });
|
|
219
|
-
* ```
|
|
220
|
-
*/
|
|
221
|
-
createAcceptProtocolAdminIx({ pendingAdmin, }: {
|
|
222
|
-
pendingAdmin: PublicKey;
|
|
223
|
-
}): Promise<TransactionInstruction>;
|
|
224
|
-
/**
|
|
225
|
-
* Creates an instruction to initialize a new vault
|
|
226
|
-
*
|
|
227
|
-
* @param {VaultParams} vaultParams - Configuration parameters for the vault
|
|
228
|
-
* @param {VaultConfig} vaultParams.config - Vault configuration settings
|
|
229
|
-
* @param {BN} vaultParams.config.maxCap - Maximum capacity of the vault
|
|
230
|
-
* @param {BN} vaultParams.config.startAtTs - Vault start timestamp in seconds
|
|
231
|
-
* @param {BN} vaultParams.config.lockedProfitDegradationDuration - Locked profit degradation duration in seconds
|
|
232
|
-
* @param {number} vaultParams.config.managerManagementFee - Manager's management fee in basis points (e.g., 50 = 0.5%)
|
|
233
|
-
* @param {number} vaultParams.config.managerPerformanceFee - Manager's performance fee in basis points (e.g., 1000 = 10%)
|
|
234
|
-
* @param {number} vaultParams.config.adminManagementFee - Admin's management fee in basis points (e.g., 50 = 0.5%)
|
|
235
|
-
* @param {number} vaultParams.config.adminPerformanceFee - Admin's performance fee in basis points (e.g., 1000 = 10%)
|
|
236
|
-
* @param {number} vaultParams.config.redemptionFee - Redemption fee in basis points (e.g., 10 = 0.1%)
|
|
237
|
-
* @param {number} vaultParams.config.issuanceFee - Issuance fee in basis points (e.g., 10 = 0.1%)
|
|
238
|
-
* @param {BN} vaultParams.config.withdrawalWaitingPeriod - Withdrawal waiting period in seconds
|
|
239
|
-
* @param {string} vaultParams.name - Name of the vault
|
|
240
|
-
* @param {string} vaultParams.description - Description of the vault
|
|
241
|
-
* @param {Object} params - Additional parameters for initializing the vault
|
|
242
|
-
* @param {Keypair} params.vault - Keypair for the new vault
|
|
243
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault's asset mint
|
|
244
|
-
* @param {PublicKey} params.admin - Public key of the vault admin
|
|
245
|
-
* @param {PublicKey} params.manager - Public key of the vault manager
|
|
246
|
-
* @param {PublicKey} params.payer - Public key of the fee payer
|
|
247
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for initializing the vault
|
|
248
|
-
*
|
|
249
|
-
* @example
|
|
250
|
-
* ```typescript
|
|
251
|
-
* const ix = await client.createInitializeVaultIx(
|
|
252
|
-
* {
|
|
253
|
-
* config: {
|
|
254
|
-
* maxCap: new BN('1000000000'),
|
|
255
|
-
* startAtTs: new BN(Math.floor(Date.now() / 1000)),
|
|
256
|
-
* lockedProfitDegradationDuration: new BN(3600), // 1 hour
|
|
257
|
-
* redemptionFee: 10,
|
|
258
|
-
* issuanceFee: 10,
|
|
259
|
-
* withdrawalWaitingPeriod: new BN(3600), // 1 hour
|
|
260
|
-
* managerManagementFee: 50, // 0.5%
|
|
261
|
-
* managerPerformanceFee: 1000, // 10%
|
|
262
|
-
* adminManagementFee: 50, // 0.5%
|
|
263
|
-
* adminPerformanceFee: 1000, // 10%
|
|
264
|
-
* },
|
|
265
|
-
* name: "My Vault",
|
|
266
|
-
* description: "Example vault"
|
|
267
|
-
* },
|
|
268
|
-
* {
|
|
269
|
-
* vault: vaultKeypair,
|
|
270
|
-
* vaultAssetMint: new PublicKey('...'),
|
|
271
|
-
* admin: adminPubkey,
|
|
272
|
-
* manager: managerPubkey,
|
|
273
|
-
* payer: payerPubkey
|
|
274
|
-
* }
|
|
275
|
-
* );
|
|
276
|
-
* ```
|
|
277
|
-
*/
|
|
278
|
-
createInitializeVaultIx(vaultParams: VaultParams, { vault, vaultAssetMint, admin, manager, payer, }: {
|
|
279
|
-
vault: PublicKey;
|
|
280
|
-
vaultAssetMint: PublicKey;
|
|
281
|
-
admin: PublicKey;
|
|
282
|
-
manager: PublicKey;
|
|
283
|
-
payer: PublicKey;
|
|
284
|
-
}): Promise<TransactionInstruction>;
|
|
285
|
-
/**
|
|
286
|
-
* Creates an instruction to update a specific vault configuration field
|
|
287
|
-
*
|
|
288
|
-
* @param {VaultConfigField} field - The configuration field to update
|
|
289
|
-
* @param {Buffer} data - The serialized data for the new value
|
|
290
|
-
* @param {Object} params - Parameters for updating the vault config
|
|
291
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
292
|
-
* @param {PublicKey} params.admin - Public key of the vault admin
|
|
293
|
-
* @param {PublicKey} [params.vaultLpMint] - Required when updating management fees
|
|
294
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for updating the vault config
|
|
295
|
-
*
|
|
296
|
-
* @throws {Error} If the field requires LP mint but it's not provided
|
|
297
|
-
*
|
|
298
|
-
* @example Update max cap
|
|
299
|
-
* ```typescript
|
|
300
|
-
* const newMaxCap = new BN(20_000_000_000_000);
|
|
301
|
-
* const data = newMaxCap.toArrayLike(Buffer, "le", 8);
|
|
302
|
-
*
|
|
303
|
-
* const ix = await client.createUpdateVaultConfigIx(
|
|
304
|
-
* VaultConfigField.MaxCap,
|
|
305
|
-
* data,
|
|
306
|
-
* {
|
|
307
|
-
* vault: vaultPubkey,
|
|
308
|
-
* admin: adminPubkey
|
|
309
|
-
* }
|
|
310
|
-
* );
|
|
311
|
-
* ```
|
|
312
|
-
*
|
|
313
|
-
* @example Update manager management fee (requires LP mint)
|
|
314
|
-
* ```typescript
|
|
315
|
-
* const newManagerManagementFee = 1000; // 10%
|
|
316
|
-
* const data = Buffer.alloc(2);
|
|
317
|
-
* data.writeUInt16LE(newManagerManagementFee, 0);
|
|
318
|
-
*
|
|
319
|
-
* const vaultLpMint = client.findVaultLpMint(vaultPubkey);
|
|
320
|
-
*
|
|
321
|
-
* const ix = await client.createUpdateVaultConfigIx(
|
|
322
|
-
* VaultConfigField.ManagerManagementFee,
|
|
323
|
-
* data,
|
|
324
|
-
* {
|
|
325
|
-
* vault: vaultPubkey,
|
|
326
|
-
* admin: adminPubkey,
|
|
327
|
-
* vaultLpMint: vaultLpMint
|
|
328
|
-
* }
|
|
329
|
-
* );
|
|
330
|
-
* ```
|
|
331
|
-
*
|
|
332
|
-
* @example Update manager (requires Pubkey)
|
|
333
|
-
* ```typescript
|
|
334
|
-
* const newManager = new PublicKey('...');
|
|
335
|
-
* const data = newManager.toBuffer();
|
|
336
|
-
*
|
|
337
|
-
* const ix = await client.createUpdateVaultConfigIx(
|
|
338
|
-
* VaultConfigField.Manager,
|
|
339
|
-
* data,
|
|
340
|
-
* {
|
|
341
|
-
* vault: vaultPubkey,
|
|
342
|
-
* admin: adminPubkey
|
|
343
|
-
* }
|
|
344
|
-
* );
|
|
345
|
-
* ```
|
|
346
|
-
*/
|
|
347
|
-
createUpdateVaultConfigIx(field: VaultConfigField, data: Buffer, { vault, admin, vaultLpMint, }: {
|
|
348
|
-
vault: PublicKey;
|
|
349
|
-
admin: PublicKey;
|
|
350
|
-
vaultLpMint?: PublicKey;
|
|
351
|
-
}): Promise<TransactionInstruction>;
|
|
352
|
-
/**
|
|
353
|
-
* Creates an instruction for the pending admin to accept the vault admin role
|
|
354
|
-
*
|
|
355
|
-
* @param {Object} params - Parameters for accepting vault admin
|
|
356
|
-
* @param {PublicKey} params.pendingAdmin - Public key of the pending admin (must be signer)
|
|
357
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
358
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for accepting vault admin
|
|
359
|
-
* @throws {Error} If instruction creation fails
|
|
360
|
-
*
|
|
361
|
-
* @example
|
|
362
|
-
* ```typescript
|
|
363
|
-
* const ix = await client.createAcceptVaultAdminIx({
|
|
364
|
-
* pendingAdmin: pendingAdminPubkey,
|
|
365
|
-
* vault: vaultPubkey,
|
|
366
|
-
* });
|
|
367
|
-
* ```
|
|
368
|
-
*/
|
|
369
|
-
createAcceptVaultAdminIx({ pendingAdmin, vault, }: {
|
|
370
|
-
pendingAdmin: PublicKey;
|
|
371
|
-
vault: PublicKey;
|
|
372
|
-
}): Promise<TransactionInstruction>;
|
|
373
|
-
/**
|
|
374
|
-
* Creates a deposit instruction for a vault
|
|
375
|
-
*
|
|
376
|
-
* @param {BN} amount - Amount of tokens to deposit
|
|
377
|
-
* @param {Object} params - Deposit parameters
|
|
378
|
-
* @param {PublicKey} params.userTransferAuthority - Public key of the user's transfer authority
|
|
379
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
380
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
381
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
382
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for depositing tokens
|
|
383
|
-
* @throws {Error} If instruction creation fails
|
|
384
|
-
*
|
|
385
|
-
* @example
|
|
386
|
-
* ```typescript
|
|
387
|
-
* const ix = await client.createDepositVaultIx(
|
|
388
|
-
* new BN('1000000000'),
|
|
389
|
-
* {
|
|
390
|
-
* userTransferAuthority: userPubkey,
|
|
391
|
-
* vault: vaultPubkey,
|
|
392
|
-
* vaultAssetMint: mintPubkey,
|
|
393
|
-
* assetTokenProgram: tokenProgramPubkey
|
|
394
|
-
* }
|
|
395
|
-
* );
|
|
396
|
-
* ```
|
|
397
|
-
*/
|
|
398
|
-
createDepositVaultIx(amount: BN, { userTransferAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
|
|
399
|
-
userTransferAuthority: PublicKey;
|
|
400
|
-
vault: PublicKey;
|
|
401
|
-
vaultAssetMint: PublicKey;
|
|
402
|
-
assetTokenProgram: PublicKey;
|
|
403
|
-
}): Promise<TransactionInstruction>;
|
|
404
|
-
/**
|
|
405
|
-
* Creates a request withdraw instruction for a vault
|
|
406
|
-
*
|
|
407
|
-
* @param {RequestWithdrawVaultArgs} requestWithdrawArgs - Arguments for withdrawing from the vault
|
|
408
|
-
* @param {BN} requestWithdrawArgs.amount - Amount of LP tokens to withdraw
|
|
409
|
-
* @param {boolean} requestWithdrawArgs.isAmountInLp - Whether the amount is in LP tokens
|
|
410
|
-
* @param {boolean} requestWithdrawArgs.isWithdrawAll - Whether to withdraw all assets
|
|
411
|
-
* @param {Object} params - Request withdraw parameters
|
|
412
|
-
* @param {PublicKey} params.payer - Public key of the payer
|
|
413
|
-
* @param {PublicKey} params.userTransferAuthority - Public key of the user authority
|
|
414
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
415
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for withdrawal
|
|
416
|
-
*
|
|
417
|
-
* @throws {Error} If the instruction creation fails
|
|
418
|
-
*
|
|
419
|
-
* @example
|
|
420
|
-
* const ix = await client.createRequestWithdrawVaultIx(
|
|
421
|
-
* {
|
|
422
|
-
* amount: new BN('1000000000'),
|
|
423
|
-
* isAmountInLp: true,
|
|
424
|
-
* isWithdrawAll: false,
|
|
425
|
-
* },
|
|
426
|
-
* {
|
|
427
|
-
* payer: payerPubkey,
|
|
428
|
-
* userTransferAuthority: userPubkey,
|
|
429
|
-
* vault: vaultPubkey,
|
|
430
|
-
* }
|
|
431
|
-
* );
|
|
432
|
-
*/
|
|
433
|
-
createRequestWithdrawVaultIx({ amount, isAmountInLp, isWithdrawAll }: RequestWithdrawVaultArgs, { payer, userTransferAuthority, vault, }: {
|
|
434
|
-
payer: PublicKey;
|
|
435
|
-
userTransferAuthority: PublicKey;
|
|
436
|
-
vault: PublicKey;
|
|
437
|
-
}): Promise<TransactionInstruction>;
|
|
438
|
-
/**
|
|
439
|
-
* Creates a cancel withdraw instruction for a vault
|
|
440
|
-
*
|
|
441
|
-
* @param {Object} params - Cancel withdraw request parameters
|
|
442
|
-
* @param {PublicKey} params.userTransferAuthority - Public key of the user authority
|
|
443
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
444
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for withdrawal
|
|
445
|
-
*
|
|
446
|
-
* @throws {Error} If the instruction creation fails
|
|
447
|
-
*
|
|
448
|
-
* @example
|
|
449
|
-
* const ix = await client.createCancelRequestWithdrawVaultIx(
|
|
450
|
-
* {
|
|
451
|
-
* userTransferAuthority: userPubkey,
|
|
452
|
-
* vault: vaultPubkey,
|
|
453
|
-
* }
|
|
454
|
-
* );
|
|
455
|
-
*/
|
|
456
|
-
createCancelRequestWithdrawVaultIx({ userTransferAuthority, vault, }: {
|
|
457
|
-
userTransferAuthority: PublicKey;
|
|
458
|
-
vault: PublicKey;
|
|
459
|
-
}): Promise<TransactionInstruction>;
|
|
460
|
-
/**
|
|
461
|
-
* Creates a withdraw instruction for a vault
|
|
462
|
-
*
|
|
463
|
-
* @param {Object} params - Withdraw parameters
|
|
464
|
-
* @param {PublicKey} params.userTransferAuthority - Public key of the user authority
|
|
465
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
466
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
467
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
468
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for withdrawal
|
|
469
|
-
*
|
|
470
|
-
* @throws {Error} If the instruction creation fails
|
|
471
|
-
*
|
|
472
|
-
* @example
|
|
473
|
-
* const ix = await client.createWithdrawVaultIx(
|
|
474
|
-
* {
|
|
475
|
-
* userTransferAuthority: userPubkey,
|
|
476
|
-
* vault: vaultPubkey,
|
|
477
|
-
* vaultAssetMint: mintPubkey,
|
|
478
|
-
* assetTokenProgram: tokenProgramPubkey
|
|
479
|
-
* }
|
|
480
|
-
* );
|
|
481
|
-
*/
|
|
482
|
-
createWithdrawVaultIx({ userTransferAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
|
|
483
|
-
userTransferAuthority: PublicKey;
|
|
484
|
-
vault: PublicKey;
|
|
485
|
-
vaultAssetMint: PublicKey;
|
|
486
|
-
assetTokenProgram: PublicKey;
|
|
487
|
-
}): Promise<TransactionInstruction>;
|
|
488
|
-
/**
|
|
489
|
-
* Creates an instant withdraw instruction for a vault (no waiting period required)
|
|
490
|
-
*
|
|
491
|
-
* @param {InstantWithdrawVaultArgs} args - Instant withdrawal arguments
|
|
492
|
-
* @param {BN} args.amount - Amount to withdraw (in LP tokens or asset, depending on isAmountInLp)
|
|
493
|
-
* @param {boolean} args.isAmountInLp - Whether the amount is denominated in LP tokens
|
|
494
|
-
* @param {boolean} args.isWithdrawAll - Whether to withdraw all user's LP tokens
|
|
495
|
-
* @param {Object} params - Instant withdraw parameters
|
|
496
|
-
* @param {PublicKey} params.userTransferAuthority - Public key of the user's transfer authority
|
|
497
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
498
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
499
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
500
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for instant withdrawal
|
|
501
|
-
*
|
|
502
|
-
* @throws {Error} If the vault's withdrawal waiting period is not zero
|
|
503
|
-
*
|
|
504
|
-
* @example
|
|
505
|
-
* ```typescript
|
|
506
|
-
* const ix = await client.createInstantWithdrawVaultIx(
|
|
507
|
-
* {
|
|
508
|
-
* amount: new BN('1000000000'),
|
|
509
|
-
* isAmountInLp: true,
|
|
510
|
-
* isWithdrawAll: false,
|
|
511
|
-
* },
|
|
512
|
-
* {
|
|
513
|
-
* userTransferAuthority: userPubkey,
|
|
514
|
-
* vault: vaultPubkey,
|
|
515
|
-
* vaultAssetMint: mintPubkey,
|
|
516
|
-
* assetTokenProgram: tokenProgramPubkey,
|
|
517
|
-
* }
|
|
518
|
-
* );
|
|
519
|
-
* ```
|
|
520
|
-
*/
|
|
521
|
-
createInstantWithdrawVaultIx({ amount, isAmountInLp, isWithdrawAll }: InstantWithdrawVaultArgs, { userTransferAuthority, vault, vaultAssetMint, assetTokenProgram, }: {
|
|
522
|
-
userTransferAuthority: PublicKey;
|
|
523
|
-
vault: PublicKey;
|
|
524
|
-
vaultAssetMint: PublicKey;
|
|
525
|
-
assetTokenProgram: PublicKey;
|
|
526
|
-
}): Promise<TransactionInstruction>;
|
|
527
|
-
/**
|
|
528
|
-
* Creates an instruction to add an adaptor to a vault
|
|
529
|
-
* @param {Object} params - Parameters for adding adaptor to vault
|
|
530
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
531
|
-
* @param {PublicKey} params.payer - Public key of the payer
|
|
532
|
-
* @param {PublicKey} params.admin - Public key of the admin
|
|
533
|
-
* @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
|
|
534
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for adding adaptor to vault
|
|
535
|
-
*
|
|
536
|
-
* @throws {Error} If the instruction creation fails
|
|
537
|
-
*
|
|
538
|
-
* @example
|
|
539
|
-
* ```typescript
|
|
540
|
-
* const ix = await client.createAddAdaptorIx({
|
|
541
|
-
* vault: vaultPubkey,
|
|
542
|
-
* payer: payerPubkey,
|
|
543
|
-
* admin: adminPubkey,
|
|
544
|
-
* adaptorProgram: adaptorProgramPubkey
|
|
545
|
-
* });
|
|
546
|
-
* ```
|
|
547
|
-
*/
|
|
548
|
-
createAddAdaptorIx({ vault, payer, admin, adaptorProgram, }: {
|
|
549
|
-
vault: PublicKey;
|
|
550
|
-
payer: PublicKey;
|
|
551
|
-
admin: PublicKey;
|
|
552
|
-
adaptorProgram: PublicKey;
|
|
553
|
-
}): Promise<TransactionInstruction>;
|
|
554
|
-
/**
|
|
555
|
-
* Creates an instruction to initialize a strategy to a vault
|
|
556
|
-
* @param {InitializeStrategyArgs} initArgs - Arguments for strategy initialization
|
|
557
|
-
* @param {Buffer | null} [initArgs.instructionDiscriminator] - Optional discriminator for the instruction
|
|
558
|
-
* @param {Buffer | null} [initArgs.additionalArgs] - Optional additional arguments for the instruction
|
|
559
|
-
* @param {Object} params - Parameters for initializing strategy to vault
|
|
560
|
-
* @param {PublicKey} params.payer - Public key of the payer
|
|
561
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
562
|
-
* @param {PublicKey} params.manager - Public key of the manager
|
|
563
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
564
|
-
* @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
|
|
565
|
-
* @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
|
|
566
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for initializing strategy to vault
|
|
567
|
-
* @throws {Error} If the instruction creation fails
|
|
568
|
-
*
|
|
569
|
-
* @example
|
|
570
|
-
* ```typescript
|
|
571
|
-
* const ix = await client.createInitializeStrategyIx(
|
|
572
|
-
* {
|
|
573
|
-
* instructionDiscriminator: Buffer.from('...'), // optional
|
|
574
|
-
* additionalArgs: Buffer.from('...') // optional
|
|
575
|
-
* },
|
|
576
|
-
* {
|
|
577
|
-
* payer: payerPubkey,
|
|
578
|
-
* vault: vaultPubkey,
|
|
579
|
-
* manager: managerPubkey,
|
|
580
|
-
* strategy: strategyPubkey,
|
|
581
|
-
* adaptorProgram: adaptorProgramPubkey,
|
|
582
|
-
* remainingAccounts: []
|
|
583
|
-
* }
|
|
584
|
-
* );
|
|
585
|
-
* ```
|
|
586
|
-
*/
|
|
587
|
-
createInitializeStrategyIx({ instructionDiscriminator, additionalArgs, }: InitializeStrategyArgs, { payer, vault, manager, strategy, adaptorProgram, remainingAccounts, }: {
|
|
588
|
-
payer: PublicKey;
|
|
589
|
-
vault: PublicKey;
|
|
590
|
-
manager: PublicKey;
|
|
591
|
-
strategy: PublicKey;
|
|
592
|
-
adaptorProgram: PublicKey;
|
|
593
|
-
remainingAccounts: Array<{
|
|
594
|
-
pubkey: PublicKey;
|
|
595
|
-
isSigner: boolean;
|
|
596
|
-
isWritable: boolean;
|
|
597
|
-
}>;
|
|
598
|
-
}): Promise<TransactionInstruction>;
|
|
599
|
-
/**
|
|
600
|
-
* Creates an instruction to deposit assets into a strategy
|
|
601
|
-
*
|
|
602
|
-
* @param {DepositStrategyArgs} depositArgs - Deposit arguments
|
|
603
|
-
* @param {BN} depositArgs.depositAmount - Amount of assets to deposit
|
|
604
|
-
* @param {Buffer | null} [depositArgs.instructionDiscriminator] - Optional discriminator for the instruction
|
|
605
|
-
* @param {Buffer | null} [depositArgs.additionalArgs] - Optional additional arguments for the instruction
|
|
606
|
-
* @param {Object} params - Strategy deposit parameters
|
|
607
|
-
* @param {PublicKey} params.manager - Public key of the manager
|
|
608
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
609
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
610
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
611
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
612
|
-
* @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
|
|
613
|
-
* @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
|
|
614
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for depositing assets into strategy
|
|
615
|
-
* @throws {Error} If the instruction creation fails
|
|
616
|
-
*
|
|
617
|
-
* @example
|
|
618
|
-
* ```typescript
|
|
619
|
-
* const ix = await client.createDepositStrategyIx(
|
|
620
|
-
* {
|
|
621
|
-
* depositAmount: new BN('1000000000'),
|
|
622
|
-
* instructionDiscriminator: Buffer.from('...'),
|
|
623
|
-
* additionalArgs: Buffer.from('...')
|
|
624
|
-
* },
|
|
625
|
-
* {
|
|
626
|
-
* manager: managerPubkey,
|
|
627
|
-
* vault: vaultPubkey,
|
|
628
|
-
* vaultAssetMint: mintPubkey,
|
|
629
|
-
* strategy: strategyPubkey,
|
|
630
|
-
* assetTokenProgram: tokenProgramPubkey,
|
|
631
|
-
* adaptorProgram: adaptorProgramPubkey,
|
|
632
|
-
* remainingAccounts: []
|
|
633
|
-
* }
|
|
634
|
-
* );
|
|
635
|
-
* ```
|
|
636
|
-
*/
|
|
637
|
-
createDepositStrategyIx({ depositAmount, instructionDiscriminator, additionalArgs, }: DepositStrategyArgs, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
|
|
638
|
-
manager: PublicKey;
|
|
639
|
-
vault: PublicKey;
|
|
640
|
-
vaultAssetMint: PublicKey;
|
|
641
|
-
strategy: PublicKey;
|
|
642
|
-
assetTokenProgram: PublicKey;
|
|
643
|
-
adaptorProgram: PublicKey;
|
|
644
|
-
remainingAccounts: Array<{
|
|
645
|
-
pubkey: PublicKey;
|
|
646
|
-
isSigner: boolean;
|
|
647
|
-
isWritable: boolean;
|
|
648
|
-
}>;
|
|
649
|
-
}): Promise<TransactionInstruction>;
|
|
650
|
-
/**
|
|
651
|
-
* Creates an instruction to withdraw assets from a strategy
|
|
652
|
-
*
|
|
653
|
-
* @param {WithdrawStrategyArgs} withdrawArgs - Withdrawal arguments
|
|
654
|
-
* @param {BN} withdrawArgs.withdrawAmount - Amount of assets to withdraw
|
|
655
|
-
* @param {Buffer | null} [withdrawArgs.instructionDiscriminator] - Optional discriminator for the instruction
|
|
656
|
-
* @param {Buffer | null} [withdrawArgs.additionalArgs] - Optional additional arguments for the instruction
|
|
657
|
-
* @param {Object} params - Strategy withdrawal parameters
|
|
658
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
659
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
660
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
661
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
662
|
-
* @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
|
|
663
|
-
* @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
|
|
664
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for withdrawing assets from strategy
|
|
665
|
-
* @throws {Error} If the instruction creation fails
|
|
666
|
-
*
|
|
667
|
-
* @example
|
|
668
|
-
* ```typescript
|
|
669
|
-
* const ix = await client.createWithdrawStrategyIx(
|
|
670
|
-
* {
|
|
671
|
-
* withdrawAmount: new BN('1000000000'),
|
|
672
|
-
* instructionDiscriminator: Buffer.from('...'),
|
|
673
|
-
* additionalArgs: Buffer.from('...')
|
|
674
|
-
* },
|
|
675
|
-
* {
|
|
676
|
-
* vault: vaultPubkey,
|
|
677
|
-
* vaultAssetMint: mintPubkey,
|
|
678
|
-
* strategy: strategyPubkey,
|
|
679
|
-
* assetTokenProgram: tokenProgramPubkey,
|
|
680
|
-
* adaptorProgram: adaptorProgramPubkey,
|
|
681
|
-
* remainingAccounts: []
|
|
682
|
-
* }
|
|
683
|
-
* );
|
|
684
|
-
* ```
|
|
685
|
-
*/
|
|
686
|
-
createWithdrawStrategyIx({ withdrawAmount, instructionDiscriminator, additionalArgs, }: WithdrawStrategyArgs, { manager, vault, vaultAssetMint, strategy, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
|
|
687
|
-
manager: PublicKey;
|
|
688
|
-
vault: PublicKey;
|
|
689
|
-
vaultAssetMint: PublicKey;
|
|
690
|
-
strategy: PublicKey;
|
|
691
|
-
assetTokenProgram: PublicKey;
|
|
692
|
-
adaptorProgram: PublicKey;
|
|
693
|
-
remainingAccounts: Array<{
|
|
694
|
-
pubkey: PublicKey;
|
|
695
|
-
isSigner: boolean;
|
|
696
|
-
isWritable: boolean;
|
|
697
|
-
}>;
|
|
698
|
-
}): Promise<TransactionInstruction>;
|
|
699
|
-
/**
|
|
700
|
-
* Creates an instruction to remove a strategy from a vault
|
|
701
|
-
* @param {Object} params - Parameters for removing strategy
|
|
702
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
703
|
-
* @param {PublicKey} params.admin - Public key of the admin
|
|
704
|
-
* @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
|
|
705
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for removing adaptor from vault
|
|
706
|
-
* @throws {Error} If instruction creation fails
|
|
707
|
-
*
|
|
708
|
-
* @example
|
|
709
|
-
* ```typescript
|
|
710
|
-
* const ix = await client.createRemoveAdaptorIx({
|
|
711
|
-
* vault: vaultPubkey,
|
|
712
|
-
* admin: adminPubkey,
|
|
713
|
-
* adaptorProgram: adaptorProgramPubkey
|
|
714
|
-
* });
|
|
715
|
-
* ```
|
|
716
|
-
*/
|
|
717
|
-
createRemoveAdaptorIx({ vault, admin, adaptorProgram, }: {
|
|
718
|
-
vault: PublicKey;
|
|
719
|
-
admin: PublicKey;
|
|
720
|
-
adaptorProgram: PublicKey;
|
|
721
|
-
}): Promise<TransactionInstruction>;
|
|
722
|
-
/**
|
|
723
|
-
* Creates an instruction to initialize a direct withdraw strategy
|
|
724
|
-
* @param {InitializeDirectWithdrawStrategyArgs} initArgs - Arguments for initializing direct withdraw strategy
|
|
725
|
-
* @param {Buffer | null} initArgs.instructionDiscriminator - Optional discriminator for the instruction
|
|
726
|
-
* @param {Buffer | null} initArgs.additionalArgs - Optional additional arguments for the instruction
|
|
727
|
-
* @param {boolean} initArgs.allowUserArgs - Whether to allow user arguments
|
|
728
|
-
* @param {Object} params - Parameters for initializing direct withdraw strategy
|
|
729
|
-
* @param {PublicKey} params.payer - Public key of the payer
|
|
730
|
-
* @param {PublicKey} params.admin - Public key of the admin
|
|
731
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
732
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
733
|
-
* @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
|
|
734
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for initializing direct withdraw strategy
|
|
735
|
-
* @throws {Error} If instruction creation fails
|
|
736
|
-
*
|
|
737
|
-
* @example
|
|
738
|
-
* ```typescript
|
|
739
|
-
* const ix = await client.createInitializeDirectWithdrawStrategyIx(
|
|
740
|
-
* {
|
|
741
|
-
* instructionDiscriminator: Buffer.from('...'),
|
|
742
|
-
* additionalArgs: Buffer.from('...'),
|
|
743
|
-
* allowUserArgs: true
|
|
744
|
-
* },
|
|
745
|
-
* {
|
|
746
|
-
* payer: payerPubkey,
|
|
747
|
-
* admin: adminPubkey,
|
|
748
|
-
* vault: vaultPubkey,
|
|
749
|
-
* strategy: strategyPubkey,
|
|
750
|
-
* adaptorProgram: adaptorProgramPubkey
|
|
751
|
-
* }
|
|
752
|
-
* );
|
|
753
|
-
* ```
|
|
754
|
-
*/
|
|
755
|
-
createInitializeDirectWithdrawStrategyIx({ instructionDiscriminator, additionalArgs, allowUserArgs, }: InitializeDirectWithdrawStrategyArgs, { payer, admin, vault, strategy, adaptorProgram, }: {
|
|
756
|
-
payer: PublicKey;
|
|
757
|
-
admin: PublicKey;
|
|
758
|
-
vault: PublicKey;
|
|
759
|
-
strategy: PublicKey;
|
|
760
|
-
adaptorProgram: PublicKey;
|
|
761
|
-
}): Promise<TransactionInstruction>;
|
|
762
|
-
/**
|
|
763
|
-
* Creates an instruction to withdraw assets from a direct withdraw strategy
|
|
764
|
-
* @param {Object} directWithdrawArgs - Withdrawal arguments
|
|
765
|
-
* @param {Buffer | null} [directWithdrawArgs.userArgs] - Optional user arguments for the instruction
|
|
766
|
-
* @param {Object} params - Parameters for withdrawing assets from direct withdraw strategy
|
|
767
|
-
* @param {PublicKey} params.user - Public key of the user
|
|
768
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
769
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
770
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
771
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
772
|
-
* @param {PublicKey} params.adaptorProgram - Public key of the adaptor program
|
|
773
|
-
* @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
|
|
774
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for withdrawing assets from direct withdraw strategy
|
|
775
|
-
* @throws {Error} If instruction creation fails
|
|
776
|
-
*
|
|
777
|
-
* @example
|
|
778
|
-
* ```typescript
|
|
779
|
-
* const ix = await client.createDirectWithdrawStrategyIx(
|
|
780
|
-
* {
|
|
781
|
-
* userArgs: Buffer.from('...')
|
|
782
|
-
* },
|
|
783
|
-
* {
|
|
784
|
-
* user: userPubkey,
|
|
785
|
-
* vault: vaultPubkey,
|
|
786
|
-
* strategy: strategyPubkey,
|
|
787
|
-
* vaultAssetMint: mintPubkey,
|
|
788
|
-
* assetTokenProgram: tokenProgramPubkey,
|
|
789
|
-
* adaptorProgram: adaptorProgramPubkey,
|
|
790
|
-
* remainingAccounts: []
|
|
791
|
-
* }
|
|
792
|
-
* );
|
|
793
|
-
* ```
|
|
794
|
-
*/
|
|
795
|
-
createDirectWithdrawStrategyIx({ userArgs }: {
|
|
796
|
-
userArgs?: Buffer | null;
|
|
797
|
-
}, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
|
|
798
|
-
user: PublicKey;
|
|
799
|
-
vault: PublicKey;
|
|
800
|
-
strategy: PublicKey;
|
|
801
|
-
vaultAssetMint: PublicKey;
|
|
802
|
-
assetTokenProgram: PublicKey;
|
|
803
|
-
adaptorProgram: PublicKey;
|
|
804
|
-
remainingAccounts: Array<{
|
|
805
|
-
pubkey: PublicKey;
|
|
806
|
-
isSigner: boolean;
|
|
807
|
-
isWritable: boolean;
|
|
808
|
-
}>;
|
|
809
|
-
}): Promise<TransactionInstruction>;
|
|
810
|
-
/**
|
|
811
|
-
* Creates an instruction to withdraw assets from a direct withdraw strategy with slippage tolerance
|
|
812
|
-
*
|
|
813
|
-
* @param {Object} directWithdrawArgs - Withdrawal arguments
|
|
814
|
-
* @param {Buffer | null} [directWithdrawArgs.userArgs] - Optional user arguments for the instruction
|
|
815
|
-
* @param {BN} directWithdrawArgs.tolerance - Slippage tolerance in asset amount (max difference between requested and actual)
|
|
816
|
-
* @param {Object} params - Parameters for withdrawing assets from direct withdraw strategy
|
|
817
|
-
* @param {PublicKey} params.user - Public key of the user
|
|
818
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
819
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
820
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
821
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
822
|
-
* @param {PublicKey} [params.adaptorProgram] - Public key of the adaptor program (defaults to lending adaptor)
|
|
823
|
-
* @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
|
|
824
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for direct withdraw with tolerance
|
|
825
|
-
* @throws {Error} If instruction creation fails
|
|
826
|
-
*
|
|
827
|
-
* @example
|
|
828
|
-
* ```typescript
|
|
829
|
-
* const ix = await client.createDirectWithdrawStrategyWithToleranceIx(
|
|
830
|
-
* {
|
|
831
|
-
* userArgs: Buffer.from('...'),
|
|
832
|
-
* tolerance: new BN(1000),
|
|
833
|
-
* },
|
|
834
|
-
* {
|
|
835
|
-
* user: userPubkey,
|
|
836
|
-
* vault: vaultPubkey,
|
|
837
|
-
* strategy: strategyPubkey,
|
|
838
|
-
* vaultAssetMint: mintPubkey,
|
|
839
|
-
* assetTokenProgram: tokenProgramPubkey,
|
|
840
|
-
* remainingAccounts: [],
|
|
841
|
-
* }
|
|
842
|
-
* );
|
|
843
|
-
* ```
|
|
844
|
-
*/
|
|
845
|
-
createDirectWithdrawStrategyWithToleranceIx({ userArgs, tolerance }: {
|
|
846
|
-
userArgs?: Buffer | null;
|
|
847
|
-
tolerance: BN;
|
|
848
|
-
}, { user, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
|
|
849
|
-
user: PublicKey;
|
|
850
|
-
vault: PublicKey;
|
|
851
|
-
strategy: PublicKey;
|
|
852
|
-
vaultAssetMint: PublicKey;
|
|
853
|
-
assetTokenProgram: PublicKey;
|
|
854
|
-
adaptorProgram: PublicKey;
|
|
855
|
-
remainingAccounts: Array<{
|
|
856
|
-
pubkey: PublicKey;
|
|
857
|
-
isSigner: boolean;
|
|
858
|
-
isWritable: boolean;
|
|
859
|
-
}>;
|
|
860
|
-
}): Promise<TransactionInstruction>;
|
|
861
|
-
/**
|
|
862
|
-
* Creates an instant withdraw instruction for a strategy (no waiting period, withdraws directly from strategy)
|
|
863
|
-
*
|
|
864
|
-
* @param {InstantWithdrawStrategyArgs} args - Instant withdrawal arguments
|
|
865
|
-
* @param {BN} args.amount - Amount to withdraw (in LP tokens or asset, depending on isAmountInLp)
|
|
866
|
-
* @param {boolean} args.isAmountInLp - Whether the amount is denominated in LP tokens
|
|
867
|
-
* @param {boolean} args.isWithdrawAll - Whether to withdraw all user's LP tokens
|
|
868
|
-
* @param {Buffer | null} [args.userArgs] - Optional user arguments passed to the adaptor
|
|
869
|
-
* @param {Object} params - Instant withdraw strategy parameters
|
|
870
|
-
* @param {PublicKey} params.userTransferAuthority - Public key of the user's transfer authority
|
|
871
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
872
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
873
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
874
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
875
|
-
* @param {PublicKey} [params.adaptorProgram] - Public key of the adaptor program (defaults to lending adaptor)
|
|
876
|
-
* @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
|
|
877
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for instant strategy withdrawal
|
|
878
|
-
* @throws {Error} If the vault's withdrawal waiting period is not zero
|
|
879
|
-
*
|
|
880
|
-
* @example
|
|
881
|
-
* ```typescript
|
|
882
|
-
* const ix = await client.createInstantWithdrawStrategyIx(
|
|
883
|
-
* {
|
|
884
|
-
* amount: new BN('1000000000'),
|
|
885
|
-
* isAmountInLp: true,
|
|
886
|
-
* isWithdrawAll: false,
|
|
887
|
-
* },
|
|
888
|
-
* {
|
|
889
|
-
* userTransferAuthority: userPubkey,
|
|
890
|
-
* vault: vaultPubkey,
|
|
891
|
-
* strategy: strategyPubkey,
|
|
892
|
-
* vaultAssetMint: mintPubkey,
|
|
893
|
-
* assetTokenProgram: tokenProgramPubkey,
|
|
894
|
-
* remainingAccounts: [],
|
|
895
|
-
* }
|
|
896
|
-
* );
|
|
897
|
-
* ```
|
|
898
|
-
*/
|
|
899
|
-
createInstantWithdrawStrategyIx({ amount, isAmountInLp, isWithdrawAll, userArgs, }: InstantWithdrawStrategyArgs, { userTransferAuthority, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
|
|
900
|
-
userTransferAuthority: PublicKey;
|
|
901
|
-
vault: PublicKey;
|
|
902
|
-
strategy: PublicKey;
|
|
903
|
-
vaultAssetMint: PublicKey;
|
|
904
|
-
assetTokenProgram: PublicKey;
|
|
905
|
-
adaptorProgram: PublicKey;
|
|
906
|
-
remainingAccounts: Array<{
|
|
907
|
-
pubkey: PublicKey;
|
|
908
|
-
isSigner: boolean;
|
|
909
|
-
isWritable: boolean;
|
|
910
|
-
}>;
|
|
911
|
-
}): Promise<TransactionInstruction>;
|
|
912
|
-
/**
|
|
913
|
-
* Creates an instant withdraw instruction for a strategy with slippage tolerance
|
|
914
|
-
*
|
|
915
|
-
* @param {InstantWithdrawStrategyArgs & { tolerance: BN }} args - Instant withdrawal arguments with tolerance
|
|
916
|
-
* @param {BN} args.amount - Amount to withdraw (in LP tokens or asset, depending on isAmountInLp)
|
|
917
|
-
* @param {boolean} args.isAmountInLp - Whether the amount is denominated in LP tokens
|
|
918
|
-
* @param {boolean} args.isWithdrawAll - Whether to withdraw all user's LP tokens
|
|
919
|
-
* @param {Buffer | null} [args.userArgs] - Optional user arguments passed to the adaptor
|
|
920
|
-
* @param {BN} args.tolerance - Slippage tolerance in asset amount (max difference between requested and actual)
|
|
921
|
-
* @param {Object} params - Instant withdraw strategy parameters
|
|
922
|
-
* @param {PublicKey} params.userTransferAuthority - Public key of the user's transfer authority
|
|
923
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
924
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
925
|
-
* @param {PublicKey} params.vaultAssetMint - Public key of the vault asset mint
|
|
926
|
-
* @param {PublicKey} params.assetTokenProgram - Public key of the asset token program
|
|
927
|
-
* @param {PublicKey} [params.adaptorProgram] - Public key of the adaptor program (defaults to lending adaptor)
|
|
928
|
-
* @param {Array<{ pubkey: PublicKey, isSigner: boolean, isWritable: boolean }>} params.remainingAccounts - Remaining accounts for the instruction
|
|
929
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for instant strategy withdrawal with tolerance
|
|
930
|
-
* @throws {Error} If the vault's withdrawal waiting period is not zero
|
|
931
|
-
*
|
|
932
|
-
* @example
|
|
933
|
-
* ```typescript
|
|
934
|
-
* const ix = await client.createInstantWithdrawStrategyWithToleranceIx(
|
|
935
|
-
* {
|
|
936
|
-
* amount: new BN('1000000000'),
|
|
937
|
-
* isAmountInLp: true,
|
|
938
|
-
* isWithdrawAll: false,
|
|
939
|
-
* tolerance: new BN(1000),
|
|
940
|
-
* },
|
|
941
|
-
* {
|
|
942
|
-
* userTransferAuthority: userPubkey,
|
|
943
|
-
* vault: vaultPubkey,
|
|
944
|
-
* strategy: strategyPubkey,
|
|
945
|
-
* vaultAssetMint: mintPubkey,
|
|
946
|
-
* assetTokenProgram: tokenProgramPubkey,
|
|
947
|
-
* remainingAccounts: [],
|
|
948
|
-
* }
|
|
949
|
-
* );
|
|
950
|
-
* ```
|
|
951
|
-
*/
|
|
952
|
-
createInstantWithdrawStrategyWithToleranceIx({ amount, isAmountInLp, isWithdrawAll, userArgs, tolerance, }: InstantWithdrawStrategyArgs & {
|
|
953
|
-
tolerance: BN;
|
|
954
|
-
}, { userTransferAuthority, vault, strategy, vaultAssetMint, assetTokenProgram, adaptorProgram, remainingAccounts, }: {
|
|
955
|
-
userTransferAuthority: PublicKey;
|
|
956
|
-
vault: PublicKey;
|
|
957
|
-
strategy: PublicKey;
|
|
958
|
-
vaultAssetMint: PublicKey;
|
|
959
|
-
assetTokenProgram: PublicKey;
|
|
960
|
-
adaptorProgram: PublicKey;
|
|
961
|
-
remainingAccounts: Array<{
|
|
962
|
-
pubkey: PublicKey;
|
|
963
|
-
isSigner: boolean;
|
|
964
|
-
isWritable: boolean;
|
|
965
|
-
}>;
|
|
966
|
-
}): Promise<TransactionInstruction>;
|
|
967
|
-
/**
|
|
968
|
-
* Creates an instruction to harvest fees from a vault
|
|
969
|
-
* @param {Object} params - Parameters for harvesting fees
|
|
970
|
-
* @param {PublicKey} params.harvester - Public key of the harvester
|
|
971
|
-
* @param {PublicKey} params.vaultManager - Public key of the vault manager
|
|
972
|
-
* @param {PublicKey} params.vaultAdmin - Public key of the vault admin
|
|
973
|
-
* @param {PublicKey} params.protocolAdmin - Public key of the protocol admin
|
|
974
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
975
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for harvesting fees
|
|
976
|
-
* @throws {Error} If instruction creation fails
|
|
977
|
-
*
|
|
978
|
-
* @example
|
|
979
|
-
* ```typescript
|
|
980
|
-
* const ix = await client.createHarvestFeeIx({
|
|
981
|
-
* harvester: harvesterPubkey,
|
|
982
|
-
* vaultManager: vaultManagerPubkey,
|
|
983
|
-
* vaultAdmin: vaultAdminPubkey,
|
|
984
|
-
* protocolAdmin: protocolAdminPubkey,
|
|
985
|
-
* vault: vaultPubkey,
|
|
986
|
-
* });
|
|
987
|
-
* ```
|
|
988
|
-
*/
|
|
989
|
-
createHarvestFeeIx({ harvester, vaultManager, vaultAdmin, protocolAdmin, vault, }: {
|
|
990
|
-
harvester: PublicKey;
|
|
991
|
-
vaultManager: PublicKey;
|
|
992
|
-
vaultAdmin: PublicKey;
|
|
993
|
-
protocolAdmin: PublicKey;
|
|
994
|
-
vault: PublicKey;
|
|
995
|
-
}): Promise<TransactionInstruction>;
|
|
996
|
-
/**
|
|
997
|
-
* Creates an instruction to close a strategy
|
|
998
|
-
* @param {Object} params - Parameters for closing strategy
|
|
999
|
-
* @param {PublicKey} params.payer - Public key of the payer
|
|
1000
|
-
* @param {PublicKey} params.manager - Public key of the manager
|
|
1001
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
1002
|
-
* @param {PublicKey} params.strategy - Public key of the strategy
|
|
1003
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for closing strategy
|
|
1004
|
-
* @throws {Error} If instruction creation fails
|
|
1005
|
-
*
|
|
1006
|
-
* @example
|
|
1007
|
-
* ```typescript
|
|
1008
|
-
* const ix = await client.createCloseStrategyIx({
|
|
1009
|
-
* payer: payerPubkey,
|
|
1010
|
-
* manager: managerPubkey,
|
|
1011
|
-
* vault: vaultPubkey,
|
|
1012
|
-
* strategy: strategyPubkey,
|
|
1013
|
-
* });
|
|
1014
|
-
* ```
|
|
1015
|
-
*/
|
|
1016
|
-
createCloseStrategyIx({ payer, manager, vault, strategy, }: {
|
|
1017
|
-
payer: PublicKey;
|
|
1018
|
-
manager: PublicKey;
|
|
1019
|
-
vault: PublicKey;
|
|
1020
|
-
strategy: PublicKey;
|
|
1021
|
-
}): Promise<TransactionInstruction>;
|
|
1022
|
-
/**
|
|
1023
|
-
* Creates an instruction to calibrate the high water mark
|
|
1024
|
-
* @param {Object} params - Parameters for calibrating the high water mark
|
|
1025
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
1026
|
-
* @param {PublicKey} params.admin - Public key of the admin
|
|
1027
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for calibrating the high water mark
|
|
1028
|
-
* @throws {Error} If instruction creation fails
|
|
1029
|
-
*
|
|
1030
|
-
* @example
|
|
1031
|
-
* ```typescript
|
|
1032
|
-
* const ix = await client.createCalibrateHighWaterMarkIx({
|
|
1033
|
-
* vault: vaultPubkey,
|
|
1034
|
-
* admin: adminPubkey,
|
|
1035
|
-
* });
|
|
1036
|
-
* ```
|
|
1037
|
-
*/
|
|
1038
|
-
createCalibrateHighWaterMarkIx({ vault, admin, }: {
|
|
1039
|
-
vault: PublicKey;
|
|
1040
|
-
admin: PublicKey;
|
|
1041
|
-
}): Promise<TransactionInstruction>;
|
|
1042
|
-
/**
|
|
1043
|
-
* Creates an instruction to calibrate the high water mark without fee clawback (unsafe)
|
|
1044
|
-
* @param {Object} params - Parameters for calibrating the high water mark
|
|
1045
|
-
* @param {PublicKey} params.vault - Public key of the vault (must be whitelisted)
|
|
1046
|
-
* @param {PublicKey} params.admin - Public key of the admin
|
|
1047
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for unsafe calibration
|
|
1048
|
-
* @throws {Error} If instruction creation fails or vault is not whitelisted
|
|
1049
|
-
*
|
|
1050
|
-
* @example
|
|
1051
|
-
* ```typescript
|
|
1052
|
-
* const ix = await client.createCalibrateHighWaterMarkUnsafeIx({
|
|
1053
|
-
* vault: vaultPubkey,
|
|
1054
|
-
* admin: adminPubkey,
|
|
1055
|
-
* });
|
|
1056
|
-
* ```
|
|
1057
|
-
*/
|
|
1058
|
-
createCalibrateHighWaterMarkUnsafeIx({ vault, admin, }: {
|
|
1059
|
-
vault: PublicKey;
|
|
1060
|
-
admin: PublicKey;
|
|
1061
|
-
}): Promise<TransactionInstruction>;
|
|
1062
|
-
/**
|
|
1063
|
-
* Creates an instruction to create LP metadata
|
|
1064
|
-
* @param {Object} createLpMetadataArgs - Parameters for creating LP metadata
|
|
1065
|
-
* @param {string} createLpMetadataArgs.name - Name of the LP
|
|
1066
|
-
* @param {string} createLpMetadataArgs.symbol - Symbol of the LP
|
|
1067
|
-
* @param {string} createLpMetadataArgs.uri - URI of the LP metadata
|
|
1068
|
-
* @param {Object} params - Parameters for creating LP metadata
|
|
1069
|
-
* @param {PublicKey} params.payer - Public key of the payer
|
|
1070
|
-
* @param {PublicKey} params.admin - Public key of the admin
|
|
1071
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
1072
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for creating LP metadata
|
|
1073
|
-
* @throws {Error} If instruction creation fails
|
|
1074
|
-
*
|
|
1075
|
-
* @example
|
|
1076
|
-
* ```typescript
|
|
1077
|
-
* const ix = await client.createCreateLpMetadataIx({
|
|
1078
|
-
* name: "My LP",
|
|
1079
|
-
* symbol: "MYLP",
|
|
1080
|
-
* uri: "https://mylp.com/metadata",
|
|
1081
|
-
* });
|
|
1082
|
-
* ```
|
|
1083
|
-
*/
|
|
1084
|
-
createCreateLpMetadataIx({ name, symbol, uri, }: {
|
|
1085
|
-
name: string;
|
|
1086
|
-
symbol: string;
|
|
1087
|
-
uri: string;
|
|
1088
|
-
}, { payer, admin, vault, }: {
|
|
1089
|
-
payer: PublicKey;
|
|
1090
|
-
admin: PublicKey;
|
|
1091
|
-
vault: PublicKey;
|
|
1092
|
-
}): Promise<TransactionInstruction>;
|
|
1093
|
-
/**
|
|
1094
|
-
* Creates an instruction to update per-vault protocol fees (admin-only, protocol level)
|
|
1095
|
-
*
|
|
1096
|
-
* @param {ProtocolFeeField} field - The protocol fee field to update
|
|
1097
|
-
* @param {number} feeBps - The new fee value in basis points
|
|
1098
|
-
* @param {Object} params - Parameters for updating the protocol fee
|
|
1099
|
-
* @param {PublicKey} params.admin - Public key of the protocol admin
|
|
1100
|
-
* @param {PublicKey} params.vault - Public key of the vault
|
|
1101
|
-
* @returns {Promise<TransactionInstruction>} Transaction instruction for updating the protocol fee
|
|
1102
|
-
*
|
|
1103
|
-
* @throws {Error} If the total fee (protocol + admin + manager) exceeds 10000 BPS
|
|
1104
|
-
*
|
|
1105
|
-
* @example
|
|
1106
|
-
* ```typescript
|
|
1107
|
-
* const ix = await client.createUpdateVaultProtocolFeeIx(
|
|
1108
|
-
* ProtocolFeeField.ProtocolPerformanceFee,
|
|
1109
|
-
* 500, // 5%
|
|
1110
|
-
* {
|
|
1111
|
-
* admin: protocolAdminPubkey,
|
|
1112
|
-
* vault: vaultPubkey,
|
|
1113
|
-
* }
|
|
1114
|
-
* );
|
|
1115
|
-
* ```
|
|
1116
|
-
*/
|
|
1117
|
-
createUpdateVaultProtocolFeeIx(field: ProtocolFeeField, feeBps: number, { admin, vault, }: {
|
|
1118
|
-
admin: PublicKey;
|
|
1119
|
-
vault: PublicKey;
|
|
1120
|
-
}): Promise<TransactionInstruction>;
|
|
1121
|
-
/**
|
|
1122
|
-
* Fetches all strategy init receipt accounts
|
|
1123
|
-
* @returns Promise resolving to an array of strategy init receipt accounts
|
|
1124
|
-
*
|
|
1125
|
-
* @example
|
|
1126
|
-
* ```typescript
|
|
1127
|
-
* const strategyInitReceiptAccounts = await client.fetchAllStrategyInitReceiptAccounts();
|
|
1128
|
-
* ```
|
|
1129
|
-
*/
|
|
1130
|
-
fetchAllStrategyInitReceiptAccounts(): Promise<import("@coral-xyz/anchor").ProgramAccount<{
|
|
1131
|
-
vault: PublicKey;
|
|
1132
|
-
strategy: PublicKey;
|
|
1133
|
-
adaptorProgram: PublicKey;
|
|
1134
|
-
positionValue: BN;
|
|
1135
|
-
lastUpdatedTs: BN;
|
|
1136
|
-
version: number;
|
|
1137
|
-
bump: number;
|
|
1138
|
-
vaultStrategyAuthBump: number;
|
|
1139
|
-
padding0: number[];
|
|
1140
|
-
reserved: number[];
|
|
1141
|
-
}>[]>;
|
|
1142
|
-
/**
|
|
1143
|
-
* Fetches all strategy init receipt accounts of a vault
|
|
1144
|
-
* @param vault - Public key of the vault
|
|
1145
|
-
* @returns Promise resolving to an array of strategy init receipt accounts
|
|
1146
|
-
*
|
|
1147
|
-
* @example
|
|
1148
|
-
* ```typescript
|
|
1149
|
-
* const strategyInitReceiptAccounts = await client.fetchAllStrategyInitReceiptAccountsOfVault(vaultPubkey);
|
|
1150
|
-
* ```
|
|
1151
|
-
*/
|
|
1152
|
-
fetchAllStrategyInitReceiptAccountsOfVault(vault: PublicKey): Promise<import("@coral-xyz/anchor").ProgramAccount<{
|
|
1153
|
-
vault: PublicKey;
|
|
1154
|
-
strategy: PublicKey;
|
|
1155
|
-
adaptorProgram: PublicKey;
|
|
1156
|
-
positionValue: BN;
|
|
1157
|
-
lastUpdatedTs: BN;
|
|
1158
|
-
version: number;
|
|
1159
|
-
bump: number;
|
|
1160
|
-
vaultStrategyAuthBump: number;
|
|
1161
|
-
padding0: number[];
|
|
1162
|
-
reserved: number[];
|
|
1163
|
-
}>[]>;
|
|
1164
|
-
/**
|
|
1165
|
-
* Fetches all request withdraw vault receipt accounts of a vault
|
|
1166
|
-
* @param vault - Public key of the vault
|
|
1167
|
-
* @returns Promise resolving to an array of request withdraw vault receipt accounts
|
|
1168
|
-
*
|
|
1169
|
-
* @example
|
|
1170
|
-
* ```typescript
|
|
1171
|
-
* const requestWithdrawVaultReceiptAccounts = await client.fetchAllRequestWithdrawVaultReceiptsOfVault(vaultPubkey);
|
|
1172
|
-
* ```
|
|
1173
|
-
*/
|
|
1174
|
-
fetchAllRequestWithdrawVaultReceiptsOfVault(vault: PublicKey): Promise<import("@coral-xyz/anchor").ProgramAccount<{
|
|
1175
|
-
vault: PublicKey;
|
|
1176
|
-
user: PublicKey;
|
|
1177
|
-
amountLpEscrowed: BN;
|
|
1178
|
-
amountAssetToWithdrawDecimalBits: BN;
|
|
1179
|
-
withdrawableFromTs: BN;
|
|
1180
|
-
bump: number;
|
|
1181
|
-
version: number;
|
|
1182
|
-
}>[]>;
|
|
1183
|
-
/**
|
|
1184
|
-
* Fetches all adaptor add receipt accounts of a vault
|
|
1185
|
-
* @param vault - Public key of the vault
|
|
1186
|
-
* @returns Promise resolving to an array of adaptor add receipt accounts
|
|
1187
|
-
*
|
|
1188
|
-
* @example
|
|
1189
|
-
* ```typescript
|
|
1190
|
-
* const adaptorAddReceiptAccounts = await client.fetchAllAdaptorAddReceiptAccountsOfVault(vaultPubkey);
|
|
1191
|
-
* ```
|
|
1192
|
-
*/
|
|
1193
|
-
fetchAllAdaptorAddReceiptAccountsOfVault(vault: PublicKey): Promise<import("@coral-xyz/anchor").ProgramAccount<{
|
|
1194
|
-
vault: PublicKey;
|
|
1195
|
-
adaptorProgram: PublicKey;
|
|
1196
|
-
version: number;
|
|
1197
|
-
bump: number;
|
|
1198
|
-
padding0: number[];
|
|
1199
|
-
lastUpdatedEpoch: BN;
|
|
1200
|
-
reserved: number[];
|
|
1201
|
-
}>[]>;
|
|
1202
|
-
/**
|
|
1203
|
-
* Fetches a vault account's data
|
|
1204
|
-
* @param vault - Public key of the vault
|
|
1205
|
-
* @returns Promise resolving to the vault account data
|
|
1206
|
-
*/
|
|
1207
|
-
/**
|
|
1208
|
-
* Fetches the protocol account's data
|
|
1209
|
-
* @returns Promise resolving to the protocol account data
|
|
1210
|
-
*
|
|
1211
|
-
* @example
|
|
1212
|
-
* ```typescript
|
|
1213
|
-
* const protocolAccount = await client.fetchProtocolAccount();
|
|
1214
|
-
* ```
|
|
1215
|
-
*/
|
|
1216
|
-
fetchProtocolAccount(): Promise<{
|
|
1217
|
-
admin: PublicKey;
|
|
1218
|
-
operationalState: number;
|
|
1219
|
-
padding1: number[];
|
|
1220
|
-
bump: number;
|
|
1221
|
-
padding0: number[];
|
|
1222
|
-
pendingAdmin: PublicKey;
|
|
1223
|
-
reserved: number[];
|
|
1224
|
-
}>;
|
|
1225
|
-
fetchVaultAccount(vault: PublicKey): Promise<{
|
|
1226
|
-
name: number[];
|
|
1227
|
-
description: number[];
|
|
1228
|
-
asset: {
|
|
1229
|
-
mint: PublicKey;
|
|
1230
|
-
idleAta: PublicKey;
|
|
1231
|
-
totalValue: BN;
|
|
1232
|
-
idleAtaAuthBump: number;
|
|
1233
|
-
reserved: number[];
|
|
1234
|
-
};
|
|
1235
|
-
lp: {
|
|
1236
|
-
mint: PublicKey;
|
|
1237
|
-
mintBump: number;
|
|
1238
|
-
mintAuthBump: number;
|
|
1239
|
-
reserved: number[];
|
|
1240
|
-
};
|
|
1241
|
-
pendingAdmin: PublicKey;
|
|
1242
|
-
manager: PublicKey;
|
|
1243
|
-
admin: PublicKey;
|
|
1244
|
-
vaultConfiguration: {
|
|
1245
|
-
maxCap: BN;
|
|
1246
|
-
startAtTs: BN;
|
|
1247
|
-
lockedProfitDegradationDuration: BN;
|
|
1248
|
-
withdrawalWaitingPeriod: BN;
|
|
1249
|
-
disabledOperations: number;
|
|
1250
|
-
reserved: number[];
|
|
1251
|
-
};
|
|
1252
|
-
feeConfiguration: {
|
|
1253
|
-
managerPerformanceFee: number;
|
|
1254
|
-
adminPerformanceFee: number;
|
|
1255
|
-
managerManagementFee: number;
|
|
1256
|
-
adminManagementFee: number;
|
|
1257
|
-
redemptionFee: number;
|
|
1258
|
-
issuanceFee: number;
|
|
1259
|
-
protocolPerformanceFee: number;
|
|
1260
|
-
protocolManagementFee: number;
|
|
1261
|
-
reserved: number[];
|
|
1262
|
-
};
|
|
1263
|
-
feeUpdate: {
|
|
1264
|
-
lastPerformanceFeeUpdateTs: BN;
|
|
1265
|
-
lastManagementFeeUpdateTs: BN;
|
|
1266
|
-
};
|
|
1267
|
-
feeState: {
|
|
1268
|
-
accumulatedLpManagerFees: BN;
|
|
1269
|
-
accumulatedLpAdminFees: BN;
|
|
1270
|
-
accumulatedLpProtocolFees: BN;
|
|
1271
|
-
reserved: number[];
|
|
1272
|
-
};
|
|
1273
|
-
deadWeight: BN;
|
|
1274
|
-
highWaterMark: {
|
|
1275
|
-
highestAssetPerLpDecimalBits: BN;
|
|
1276
|
-
lastUpdatedTs: BN;
|
|
1277
|
-
reserved: number[];
|
|
1278
|
-
};
|
|
1279
|
-
lastUpdatedTs: BN;
|
|
1280
|
-
version: number;
|
|
1281
|
-
padding0: number[];
|
|
1282
|
-
lockedProfitState: {
|
|
1283
|
-
lastUpdatedLockedProfit: BN;
|
|
1284
|
-
lastReport: BN;
|
|
1285
|
-
};
|
|
1286
|
-
reserved: number[];
|
|
1287
|
-
}>;
|
|
1288
|
-
/**
|
|
1289
|
-
* Fetches a strategy init receipt account's data
|
|
1290
|
-
* @param strategyInitReceipt - Public key of the strategy init receipt account
|
|
1291
|
-
* @returns Promise resolving to the strategy init receipt account data
|
|
1292
|
-
*
|
|
1293
|
-
* @example
|
|
1294
|
-
* ```typescript
|
|
1295
|
-
* const strategyInitReceiptAccount = await client.fetchStrategyInitReceiptAccount(strategyInitReceiptPubkey);
|
|
1296
|
-
* ```
|
|
1297
|
-
*/
|
|
1298
|
-
fetchStrategyInitReceiptAccount(strategyInitReceipt: PublicKey): Promise<{
|
|
1299
|
-
vault: PublicKey;
|
|
1300
|
-
strategy: PublicKey;
|
|
1301
|
-
adaptorProgram: PublicKey;
|
|
1302
|
-
positionValue: BN;
|
|
1303
|
-
lastUpdatedTs: BN;
|
|
1304
|
-
version: number;
|
|
1305
|
-
bump: number;
|
|
1306
|
-
vaultStrategyAuthBump: number;
|
|
1307
|
-
padding0: number[];
|
|
1308
|
-
reserved: number[];
|
|
1309
|
-
}>;
|
|
1310
|
-
/**
|
|
1311
|
-
* Fetches an adaptor add receipt account's data
|
|
1312
|
-
* @param adaptorAddReceipt - Public key of the adaptor add receipt account
|
|
1313
|
-
* @returns Promise resolving to the adaptor add receipt account data
|
|
1314
|
-
*
|
|
1315
|
-
* @example
|
|
1316
|
-
* ```typescript
|
|
1317
|
-
* const adaptorAddReceiptAccount = await client.fetchAdaptorAddReceiptAccount(adaptorAddReceiptPubkey);
|
|
1318
|
-
* ```
|
|
1319
|
-
*/
|
|
1320
|
-
fetchAdaptorAddReceiptAccount(adaptorAddReceipt: PublicKey): Promise<{
|
|
1321
|
-
vault: PublicKey;
|
|
1322
|
-
adaptorProgram: PublicKey;
|
|
1323
|
-
version: number;
|
|
1324
|
-
bump: number;
|
|
1325
|
-
padding0: number[];
|
|
1326
|
-
lastUpdatedEpoch: BN;
|
|
1327
|
-
reserved: number[];
|
|
1328
|
-
}>;
|
|
1329
|
-
/**
|
|
1330
|
-
* Fetches a request withdraw vault receipt account's data
|
|
1331
|
-
* @param requestWithdrawVaultReceipt - Public key of the request withdraw vault receipt account
|
|
1332
|
-
* @returns Promise resolving to the request withdraw vault receipt account data
|
|
1333
|
-
*
|
|
1334
|
-
* @example
|
|
1335
|
-
* ```typescript
|
|
1336
|
-
* const requestWithdrawVaultReceiptAccount = await client.fetchRequestWithdrawVaultReceiptAccount(requestWithdrawVaultReceiptPubkey);
|
|
1337
|
-
* ```
|
|
1338
|
-
*/
|
|
1339
|
-
fetchRequestWithdrawVaultReceiptAccount(requestWithdrawVaultReceipt: PublicKey): Promise<{
|
|
1340
|
-
vault: PublicKey;
|
|
1341
|
-
user: PublicKey;
|
|
1342
|
-
amountLpEscrowed: BN;
|
|
1343
|
-
amountAssetToWithdrawDecimalBits: BN;
|
|
1344
|
-
withdrawableFromTs: BN;
|
|
1345
|
-
bump: number;
|
|
1346
|
-
version: number;
|
|
1347
|
-
}>;
|
|
1348
|
-
/**
|
|
1349
|
-
* Fetches the position and total values for a vault
|
|
1350
|
-
* @param vault - Public key of the vault
|
|
1351
|
-
* @returns Promise resolving to the position and total values
|
|
1352
|
-
*
|
|
1353
|
-
* @example
|
|
1354
|
-
* ```typescript
|
|
1355
|
-
* const positionAndTotalValues = await client.getPositionAndTotalValuesForVault(vaultPubkey);
|
|
1356
|
-
* ```
|
|
1357
|
-
*/
|
|
1358
|
-
getPositionAndTotalValuesForVault(vault: PublicKey): Promise<{
|
|
1359
|
-
totalValue: number;
|
|
1360
|
-
strategies: {
|
|
1361
|
-
strategyId: string;
|
|
1362
|
-
amount: number;
|
|
1363
|
-
}[];
|
|
1364
|
-
}>;
|
|
1365
|
-
/**
|
|
1366
|
-
* Fetches the accumulated admin fees for a vault
|
|
1367
|
-
* @param vault - Public key of the vault
|
|
1368
|
-
* @returns Promise resolving to the accumulated admin fees
|
|
1369
|
-
*
|
|
1370
|
-
* @example
|
|
1371
|
-
* ```typescript
|
|
1372
|
-
* const accumulatedAdminFees = await client.getAccumulatedAdminFeesForVault(vaultPubkey);
|
|
1373
|
-
* ```
|
|
1374
|
-
*/
|
|
1375
|
-
getAccumulatedAdminFeesForVault(vault: PublicKey): Promise<BN>;
|
|
1376
|
-
/**
|
|
1377
|
-
* Fetches the accumulated manager fees for a vault
|
|
1378
|
-
* @param vault - Public key of the vault
|
|
1379
|
-
* @returns Promise resolving to the accumulated manager fees
|
|
1380
|
-
*
|
|
1381
|
-
* @example
|
|
1382
|
-
* ```typescript
|
|
1383
|
-
* const accumulatedManagerFees = await client.getAccumulatedManagerFeesForVault(vaultPubkey);
|
|
1384
|
-
* ```
|
|
1385
|
-
*/
|
|
1386
|
-
getAccumulatedManagerFeesForVault(vault: PublicKey): Promise<BN>;
|
|
1387
|
-
/**
|
|
1388
|
-
* Fetches the accumulated protocol fees for a vault
|
|
1389
|
-
* @param vault - Public key of the vault
|
|
1390
|
-
* @returns Promise resolving to the accumulated protocol fees
|
|
1391
|
-
*
|
|
1392
|
-
* @example
|
|
1393
|
-
* ```typescript
|
|
1394
|
-
* const accumulatedProtocolFees = await client.getAccumulatedProtocolFeesForVault(vaultPubkey);
|
|
1395
|
-
* ```
|
|
1396
|
-
*/
|
|
1397
|
-
getAccumulatedProtocolFeesForVault(vault: PublicKey): Promise<BN>;
|
|
1398
|
-
/**
|
|
1399
|
-
* Fetches the current asset per LP for a vault
|
|
1400
|
-
* @param vault - Public key of the vault
|
|
1401
|
-
* @returns Promise resolving to the current asset per LP
|
|
1402
|
-
*
|
|
1403
|
-
* @example
|
|
1404
|
-
* ```typescript
|
|
1405
|
-
* const currentAssetPerLp = await client.getCurrentAssetPerLpForVault(vaultPubkey);
|
|
1406
|
-
* ```
|
|
1407
|
-
*/
|
|
1408
|
-
getCurrentAssetPerLpForVault(vault: PublicKey): Promise<number>;
|
|
1409
|
-
/**
|
|
1410
|
-
* Fetches the high water mark for a vault
|
|
1411
|
-
* @param vault - Public key of the vault
|
|
1412
|
-
* @returns Promise resolving to the high water mark
|
|
1413
|
-
*
|
|
1414
|
-
* @example
|
|
1415
|
-
* ```typescript
|
|
1416
|
-
* const highWaterMark = await client.getHighWaterMarkForVault(vaultPubkey);
|
|
1417
|
-
* ```
|
|
1418
|
-
*/
|
|
1419
|
-
getHighWaterMarkForVault(vault: PublicKey): Promise<{
|
|
1420
|
-
highestAssetPerLp: number;
|
|
1421
|
-
lastUpdatedTs: number;
|
|
1422
|
-
}>;
|
|
1423
|
-
/**
|
|
1424
|
-
* Fetches the breakdown of the LP supply for a vault
|
|
1425
|
-
* @param vault - Public key of the vault
|
|
1426
|
-
* @returns Promise resolving to the breakdown of the LP supply
|
|
1427
|
-
*
|
|
1428
|
-
* @example
|
|
1429
|
-
* ```typescript
|
|
1430
|
-
* const lpSupplyBreakdown = await client.getVaultLpSupplyBreakdown(vaultPubkey);
|
|
1431
|
-
* ```
|
|
1432
|
-
*/
|
|
1433
|
-
getVaultLpSupplyBreakdown(vault: PublicKey): Promise<{
|
|
1434
|
-
circulating: BN;
|
|
1435
|
-
unharvestedFees: BN;
|
|
1436
|
-
unrealisedFees: BN;
|
|
1437
|
-
total: BN;
|
|
1438
|
-
}>;
|
|
1439
|
-
/**
|
|
1440
|
-
* Processes a withdrawal receipt into a standardized withdrawal info object
|
|
1441
|
-
* @private
|
|
1442
|
-
*/
|
|
1443
|
-
private processWithdrawalReceipt;
|
|
1444
|
-
/**
|
|
1445
|
-
* Fetches the pending withdrawal for a user
|
|
1446
|
-
* @param vault - Public key of the vault
|
|
1447
|
-
* @param user - Public key of the user
|
|
1448
|
-
* @returns Promise resolving to the pending withdrawal
|
|
1449
|
-
*
|
|
1450
|
-
* @example
|
|
1451
|
-
* ```typescript
|
|
1452
|
-
* const pendingWithdrawal = await client.getPendingWithdrawalForUser(vaultPubkey, userPubkey);
|
|
1453
|
-
* ```
|
|
1454
|
-
*/
|
|
1455
|
-
getPendingWithdrawalForUser(vault: PublicKey, user: PublicKey): Promise<{
|
|
1456
|
-
user: PublicKey;
|
|
1457
|
-
amountAssetToWithdrawEffective: number;
|
|
1458
|
-
amountAssetToWithdrawAtRequest: number;
|
|
1459
|
-
amountAssetToWithdrawAtPresent: number;
|
|
1460
|
-
amountLpEscrowed: number;
|
|
1461
|
-
withdrawableFromTs: number;
|
|
1462
|
-
}>;
|
|
1463
|
-
/**
|
|
1464
|
-
* Fetches all pending withdrawals for a vault
|
|
1465
|
-
* @param vault - Public key of the vault
|
|
1466
|
-
* @returns Promise resolving to an array of pending withdrawals
|
|
1467
|
-
*
|
|
1468
|
-
* @example
|
|
1469
|
-
* ```typescript
|
|
1470
|
-
* const pendingWithdrawals = await client.getAllPendingWithdrawalsForVault(vaultPubkey);
|
|
1471
|
-
* ```
|
|
1472
|
-
*/
|
|
1473
|
-
getAllPendingWithdrawalsForVault(vault: PublicKey): Promise<{
|
|
1474
|
-
user: PublicKey;
|
|
1475
|
-
amountAssetToWithdrawEffective: number;
|
|
1476
|
-
amountAssetToWithdrawAtRequest: number;
|
|
1477
|
-
amountAssetToWithdrawAtPresent: number;
|
|
1478
|
-
amountLpEscrowed: number;
|
|
1479
|
-
withdrawableFromTs: number;
|
|
1480
|
-
}[]>;
|
|
1481
|
-
calculateLockedProfit(lastUpdatedLockedProfit: BN, lockedProfitDegradationDuration: BN, currentTime: BN): BN;
|
|
1482
|
-
/**
|
|
1483
|
-
* Helper to calculate only the pending (unrealised) LP fees based on time elapsed.
|
|
1484
|
-
*/
|
|
1485
|
-
private calculateUnrealisedLpFees;
|
|
1486
|
-
calculateAssetsForWithdrawHelper(vaultTotalValue: BN, vaultLastUpdatedLockedProfit: BN, vaultLockedProfitDegradationDuration: BN, vaultAccumulatedLpAdminFees: BN, vaultAccumulatedLpManagerFees: BN, vaultAccumulatedLpProtocolFees: BN, vaultRedemptionFeeBps: number, vaultManagementFeeBps: number, vaultLastManagementFeeUpdateTs: BN, lpSupply: BN, lpAmount: BN, deadWeight?: BN): BN;
|
|
1487
|
-
/**
|
|
1488
|
-
* Calculates the amount of assets that would be received for a given LP token amount
|
|
1489
|
-
*
|
|
1490
|
-
* @param vaultPk - Public key of the vault
|
|
1491
|
-
* @param lpAmount - Amount of LP tokens to calculate for
|
|
1492
|
-
* @returns Promise resolving to the amount of assets that would be received
|
|
1493
|
-
*
|
|
1494
|
-
* @throws {Error} If LP supply or total assets are invalid
|
|
1495
|
-
* @throws {Error} If math overflow occurs during calculation
|
|
1496
|
-
*
|
|
1497
|
-
* @example
|
|
1498
|
-
* ```typescript
|
|
1499
|
-
* const assetsToReceive = await client.calculateAssetsForWithdraw(
|
|
1500
|
-
* vaultPubkey,
|
|
1501
|
-
* new BN('1000000000')
|
|
1502
|
-
* );
|
|
1503
|
-
* ```
|
|
1504
|
-
*/
|
|
1505
|
-
calculateAssetsForWithdraw(vaultPk: PublicKey, lpAmount: BN): Promise<BN>;
|
|
1506
|
-
/**
|
|
1507
|
-
* Calculates the amount of LP tokens that would be burned for a given asset amount
|
|
1508
|
-
*
|
|
1509
|
-
* @param vaultPk - Public key of the vault
|
|
1510
|
-
* @param assetAmount - Amount of assets to calculate for
|
|
1511
|
-
* @returns Promise resolving to the amount of LP tokens that would be burned
|
|
1512
|
-
*
|
|
1513
|
-
* @throws {Error} If LP supply or total assets are invalid
|
|
1514
|
-
* @throws {Error} If math overflow occurs during calculation
|
|
1515
|
-
*
|
|
1516
|
-
* @example
|
|
1517
|
-
* ```typescript
|
|
1518
|
-
* const lpTokensToBurn = await client.calculateLpForWithdraw(
|
|
1519
|
-
* vaultPubkey,
|
|
1520
|
-
* new BN('1000000000')
|
|
1521
|
-
* );
|
|
1522
|
-
* ```
|
|
1523
|
-
*/
|
|
1524
|
-
calculateLpForWithdraw(vaultPk: PublicKey, assetAmount: BN): Promise<BN>;
|
|
1525
|
-
/**
|
|
1526
|
-
* Calculates the amount of LP tokens that would be received for a given asset deposit
|
|
1527
|
-
*
|
|
1528
|
-
* @param vaultPk - Public key of the vault
|
|
1529
|
-
* @param assetAmount - Amount of assets to deposit
|
|
1530
|
-
* @returns Promise resolving to the amount of LP tokens that would be received
|
|
1531
|
-
*
|
|
1532
|
-
* @throws {Error} If math overflow occurs during calculation
|
|
1533
|
-
*
|
|
1534
|
-
* @example
|
|
1535
|
-
* ```typescript
|
|
1536
|
-
* const lpTokens = await client.calculateLpTokensForDeposit(
|
|
1537
|
-
* vaultPubkey
|
|
1538
|
-
* new BN('1000000000'),
|
|
1539
|
-
* );
|
|
1540
|
-
* ```
|
|
1541
|
-
*/
|
|
1542
|
-
calculateLpForDeposit(vaultPk: PublicKey, assetAmount: BN): Promise<BN>;
|
|
1543
|
-
}
|
|
1544
|
-
export {};
|