hedge-web3 0.2.28 → 0.2.31

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.
Files changed (48) hide show
  1. package/declarations/Constants.d.ts +12 -0
  2. package/declarations/idl/vault.d.ts +743 -59
  3. package/declarations/index.d.ts +9 -0
  4. package/declarations/instructions/adminWithdrawCol.d.ts +5 -0
  5. package/declarations/instructions/adminWithdrawUsh.d.ts +5 -0
  6. package/declarations/instructions/createCompoundStakingPool.d.ts +5 -0
  7. package/declarations/instructions/createCompoundStakingPoolPosition.d.ts +6 -0
  8. package/declarations/instructions/createReferralAccount.d.ts +2 -2
  9. package/declarations/instructions/depositCompoundStakingPoolPosition.d.ts +6 -0
  10. package/declarations/instructions/depositRewardsToCompoundPool.d.ts +6 -0
  11. package/declarations/instructions/referralClaimFees.d.ts +2 -2
  12. package/declarations/instructions/setCompoundPoolActive.d.ts +5 -0
  13. package/declarations/instructions/setDelegateWallet.d.ts +5 -0
  14. package/declarations/instructions/withdrawCompoundStakingPoolPosition.d.ts +6 -0
  15. package/lib/Constants.js +28 -1
  16. package/lib/idl/vault.js +741 -57
  17. package/lib/index.js +9 -0
  18. package/lib/instructions/adminWithdrawCol.js +60 -0
  19. package/lib/instructions/adminWithdrawUsh.js +57 -0
  20. package/lib/instructions/createCompoundStakingPool.js +58 -0
  21. package/lib/instructions/createCompoundStakingPoolPosition.js +56 -0
  22. package/lib/instructions/createReferralAccount.js +6 -3
  23. package/lib/instructions/depositCompoundStakingPoolPosition.js +55 -0
  24. package/lib/instructions/depositRewardsToCompoundPool.js +64 -0
  25. package/lib/instructions/liquidateVault.js +7 -1
  26. package/lib/instructions/loanVault.js +7 -1
  27. package/lib/instructions/referralClaimFees.js +6 -3
  28. package/lib/instructions/setCompoundPoolActive.js +43 -0
  29. package/lib/instructions/setDelegateWallet.js +43 -0
  30. package/lib/instructions/withdrawCompoundStakingPoolPosition.js +64 -0
  31. package/package.json +5 -2
  32. package/src/Constants.ts +30 -0
  33. package/src/idl/vault.ts +3638 -2270
  34. package/src/index.ts +9 -2
  35. package/src/instructions/adminWithdrawCol.ts +87 -0
  36. package/src/instructions/adminWithdrawUsh.ts +78 -0
  37. package/src/instructions/createCompoundStakingPool.ts +63 -0
  38. package/src/instructions/createCompoundStakingPoolPosition.ts +85 -0
  39. package/src/instructions/createReferralAccount.ts +13 -9
  40. package/src/instructions/createStakingPool.ts +2 -9
  41. package/src/instructions/depositCompoundStakingPoolPosition.ts +78 -0
  42. package/src/instructions/depositRewardsToCompoundPool.ts +110 -0
  43. package/src/instructions/liquidateVault.ts +37 -27
  44. package/src/instructions/loanVault.ts +34 -21
  45. package/src/instructions/referralClaimFees.ts +16 -10
  46. package/src/instructions/setCompoundPoolActive.ts +51 -0
  47. package/src/instructions/setDelegateWallet.ts +51 -0
  48. package/src/instructions/withdrawCompoundStakingPoolPosition.ts +100 -0
@@ -36,6 +36,11 @@ export declare function getReferralAccountPublicKey(hedgeProgramId: PublicKey, o
36
36
  * @returns The user referral account public key based off the user's public key
37
37
  */
38
38
  export declare function getUserReferralAccountPublicKey(hedgeProgramId: PublicKey, ownerPublicKey: PublicKey): Promise<PublicKey>;
39
+ /**
40
+ *
41
+ * @returns The compound pool position address for the given user
42
+ */
43
+ export declare function getCompoundPoolPositionAddress(hedgeProgramId: PublicKey, poolPublicKey: PublicKey, ownerPublicKey: PublicKey): Promise<PublicKey>;
39
44
  /**
40
45
  *
41
46
  * @returns The HDG mint public key
@@ -48,6 +53,13 @@ export declare function getHedgeMintPublicKey(hedgeProgramId: PublicKey): Promis
48
53
  * @returns the public key for that staking pool
49
54
  */
50
55
  export declare function getPoolPublicKeyForMint(hedgeProgramId: PublicKey, mintPublicKey: PublicKey): Promise<[PublicKey, number, string]>;
56
+ /**
57
+ * Get the public key for any compound staking pool
58
+ *
59
+ * @param mintPublicKey Staked collateral mint public key
60
+ * @returns the public key for that compound staking pool
61
+ */
62
+ export declare function getCompoundPoolPublicKeyForMint(hedgeProgramId: PublicKey, mintPublicKey: PublicKey): Promise<[PublicKey, number]>;
51
63
  /**
52
64
  *
53
65
  * @param collateralType String name of the collateral type (must be 16 chars)