hedge-web3 0.2.21 → 0.2.25

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 (92) hide show
  1. package/declarations/Constants.d.ts +25 -12
  2. package/declarations/idl/pyth.d.ts +44 -24
  3. package/declarations/idl/switchboard.d.ts +47 -0
  4. package/declarations/idl/vault.d.ts +905 -155
  5. package/declarations/index.d.ts +26 -20
  6. package/declarations/instructions/closeLiquidationPoolPosition.d.ts +2 -2
  7. package/declarations/instructions/createReferralAccount.d.ts +17 -0
  8. package/declarations/instructions/createUserReferralAccount.d.ts +5 -0
  9. package/declarations/instructions/depositLiquidationPool.d.ts +2 -2
  10. package/declarations/instructions/loanVault.d.ts +2 -2
  11. package/declarations/instructions/psmEditAccount.d.ts +12 -0
  12. package/declarations/instructions/psmMintUsh.d.ts +2 -2
  13. package/declarations/instructions/psmRedeemUsh.d.ts +2 -2
  14. package/declarations/instructions/referralClaimFees.d.ts +16 -0
  15. package/declarations/instructions/transferVault.d.ts +3 -17
  16. package/declarations/instructions/updateReferralAccount.d.ts +13 -0
  17. package/declarations/instructions/updateReferralState.d.ts +20 -0
  18. package/declarations/state/VaultAccount.d.ts +1 -1
  19. package/declarations/utils/getLinkedListAccounts.d.ts +2 -2
  20. package/lib/Constants.js +57 -28
  21. package/lib/idl/pyth.js +44 -24
  22. package/lib/idl/switchboard.js +49 -0
  23. package/lib/idl/vault.js +898 -148
  24. package/lib/index.js +26 -20
  25. package/lib/instructions/claimLiquidationPoolPosition.js +10 -7
  26. package/lib/instructions/claimStakingPoolPosition.js +5 -5
  27. package/lib/instructions/closeClaimedLiquidationPoolPosition.js +1 -1
  28. package/lib/instructions/closeLiquidationPoolPosition.js +25 -12
  29. package/lib/instructions/createReferralAccount.js +80 -0
  30. package/lib/instructions/createStakingPool.js +7 -7
  31. package/lib/instructions/createUserReferralAccount.js +61 -0
  32. package/lib/instructions/createVault.js +15 -15
  33. package/lib/instructions/depositLiquidationPool.js +21 -10
  34. package/lib/instructions/depositStakingPool.js +5 -5
  35. package/lib/instructions/depositVault.js +11 -9
  36. package/lib/instructions/initHedgeFoundation.js +8 -8
  37. package/lib/instructions/initHedgeFoundationTokens.js +5 -5
  38. package/lib/instructions/liquidateVault.js +8 -8
  39. package/lib/instructions/loanVault.js +23 -10
  40. package/lib/instructions/psmEditAccount.js +60 -0
  41. package/lib/instructions/psmMintUsh.js +24 -13
  42. package/lib/instructions/psmRedeemUsh.js +24 -13
  43. package/lib/instructions/redeemVault.js +7 -7
  44. package/lib/instructions/referralClaimFees.js +84 -0
  45. package/lib/instructions/refreshOraclePrice.js +3 -3
  46. package/lib/instructions/repayVault.js +9 -9
  47. package/lib/instructions/setHalted.js +1 -1
  48. package/lib/instructions/transferVault.js +10 -24
  49. package/lib/instructions/updateReferralAccount.js +50 -0
  50. package/lib/instructions/updateReferralState.js +57 -0
  51. package/lib/instructions/updateVaultType.js +1 -1
  52. package/lib/instructions/withdrawStakingPool.js +11 -11
  53. package/lib/instructions/withdrawVault.js +5 -5
  54. package/lib/state/VaultAccount.js +3 -1
  55. package/lib/utils/getLinkedListAccounts.js +2 -3
  56. package/package.json +1 -1
  57. package/src/Constants.ts +64 -63
  58. package/src/idl/pyth.ts +88 -48
  59. package/src/idl/switchboard.ts +93 -0
  60. package/src/idl/vault.ts +1851 -351
  61. package/src/index.ts +28 -24
  62. package/src/instructions/claimLiquidationPoolPosition.ts +31 -29
  63. package/src/instructions/claimStakingPoolPosition.ts +10 -15
  64. package/src/instructions/closeClaimedLiquidationPoolPosition.ts +4 -2
  65. package/src/instructions/closeLiquidationPoolPosition.ts +36 -18
  66. package/src/instructions/createReferralAccount.ts +115 -0
  67. package/src/instructions/createStakingPool.ts +11 -13
  68. package/src/instructions/createUserReferralAccount.ts +75 -0
  69. package/src/instructions/createVault.ts +44 -26
  70. package/src/instructions/depositLiquidationPool.ts +34 -21
  71. package/src/instructions/depositStakingPool.ts +18 -14
  72. package/src/instructions/depositVault.ts +23 -18
  73. package/src/instructions/initHedgeFoundation.ts +16 -14
  74. package/src/instructions/initHedgeFoundationTokens.ts +12 -14
  75. package/src/instructions/liquidateVault.ts +15 -20
  76. package/src/instructions/loanVault.ts +29 -19
  77. package/src/instructions/{psmEditAccount.rs → psmEditAccount.ts} +10 -18
  78. package/src/instructions/psmMintUsh.ts +35 -38
  79. package/src/instructions/psmRedeemUsh.ts +35 -40
  80. package/src/instructions/redeemVault.ts +12 -15
  81. package/src/instructions/referralClaimFees.ts +145 -0
  82. package/src/instructions/refreshOraclePrice.ts +6 -8
  83. package/src/instructions/repayVault.ts +18 -16
  84. package/src/instructions/setHalted.ts +5 -24
  85. package/src/instructions/transferVault.ts +57 -0
  86. package/src/instructions/updateReferralAccount.ts +70 -0
  87. package/src/instructions/updateReferralState.ts +86 -0
  88. package/src/instructions/updateVaultType.ts +9 -23
  89. package/src/instructions/withdrawStakingPool.ts +17 -21
  90. package/src/instructions/withdrawVault.ts +10 -16
  91. package/src/state/VaultAccount.ts +9 -10
  92. package/src/utils/getLinkedListAccounts.ts +4 -7
@@ -0,0 +1,93 @@
1
+ export type Switchboard = {
2
+ "version": "0.1.0",
3
+ "name": "switchboard",
4
+ "instructions": [
5
+ {
6
+ "name": "initialize",
7
+ "accounts": [
8
+ {
9
+ "name": "aggregator",
10
+ "isMut": true,
11
+ "isSigner": false
12
+ }
13
+ ],
14
+ "args": [
15
+ {
16
+ "name": "price",
17
+ "type": "u64"
18
+ },
19
+ {
20
+ "name": "scale",
21
+ "type": "u16"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ "name": "setPrice",
27
+ "accounts": [
28
+ {
29
+ "name": "aggregator",
30
+ "isMut": true,
31
+ "isSigner": false
32
+ }
33
+ ],
34
+ "args": [
35
+ {
36
+ "name": "price",
37
+ "type": "u64"
38
+ },
39
+ {
40
+ "name": "scale",
41
+ "type": "u16"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ };
47
+
48
+ export const IDL: Switchboard = {
49
+ "version": "0.1.0",
50
+ "name": "switchboard",
51
+ "instructions": [
52
+ {
53
+ "name": "initialize",
54
+ "accounts": [
55
+ {
56
+ "name": "aggregator",
57
+ "isMut": true,
58
+ "isSigner": false
59
+ }
60
+ ],
61
+ "args": [
62
+ {
63
+ "name": "price",
64
+ "type": "u64"
65
+ },
66
+ {
67
+ "name": "scale",
68
+ "type": "u16"
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "name": "setPrice",
74
+ "accounts": [
75
+ {
76
+ "name": "aggregator",
77
+ "isMut": true,
78
+ "isSigner": false
79
+ }
80
+ ],
81
+ "args": [
82
+ {
83
+ "name": "price",
84
+ "type": "u64"
85
+ },
86
+ {
87
+ "name": "scale",
88
+ "type": "u16"
89
+ }
90
+ ]
91
+ }
92
+ ]
93
+ };