hedge-web3 0.2.27 → 0.2.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) 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/declarations/utils/getLinkedListAccounts.d.ts +2 -1
  16. package/lib/Constants.js +28 -1
  17. package/lib/idl/vault.js +741 -57
  18. package/lib/index.js +9 -0
  19. package/lib/instructions/adminWithdrawCol.js +60 -0
  20. package/lib/instructions/adminWithdrawUsh.js +57 -0
  21. package/lib/instructions/createCompoundStakingPool.js +58 -0
  22. package/lib/instructions/createCompoundStakingPoolPosition.js +56 -0
  23. package/lib/instructions/createReferralAccount.js +6 -3
  24. package/lib/instructions/depositCompoundStakingPoolPosition.js +55 -0
  25. package/lib/instructions/depositRewardsToCompoundPool.js +64 -0
  26. package/lib/instructions/liquidateVault.js +7 -1
  27. package/lib/instructions/loanVault.js +7 -1
  28. package/lib/instructions/referralClaimFees.js +6 -3
  29. package/lib/instructions/setCompoundPoolActive.js +43 -0
  30. package/lib/instructions/setDelegateWallet.js +43 -0
  31. package/lib/instructions/withdrawCompoundStakingPoolPosition.js +64 -0
  32. package/lib/utils/getLinkedListAccounts.js +5 -21
  33. package/package.json +5 -2
  34. package/src/Constants.ts +30 -0
  35. package/src/idl/vault.ts +3638 -2270
  36. package/src/index.ts +9 -2
  37. package/src/instructions/adminWithdrawCol.ts +87 -0
  38. package/src/instructions/adminWithdrawUsh.ts +78 -0
  39. package/src/instructions/createCompoundStakingPool.ts +63 -0
  40. package/src/instructions/createCompoundStakingPoolPosition.ts +85 -0
  41. package/src/instructions/createReferralAccount.ts +13 -9
  42. package/src/instructions/createStakingPool.ts +2 -9
  43. package/src/instructions/depositCompoundStakingPoolPosition.ts +78 -0
  44. package/src/instructions/depositRewardsToCompoundPool.ts +110 -0
  45. package/src/instructions/liquidateVault.ts +37 -27
  46. package/src/instructions/loanVault.ts +34 -21
  47. package/src/instructions/referralClaimFees.ts +16 -10
  48. package/src/instructions/setCompoundPoolActive.ts +51 -0
  49. package/src/instructions/setDelegateWallet.ts +51 -0
  50. package/src/instructions/withdrawCompoundStakingPoolPosition.ts +100 -0
  51. package/src/utils/getLinkedListAccounts.ts +6 -20
@@ -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)