hedge-web3 0.1.44 → 0.2.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.
Files changed (71) hide show
  1. package/declarations/Constants.d.ts +2 -1
  2. package/declarations/idl/vault.d.ts +161 -35
  3. package/declarations/instructions/claimLiquidationPoolPosition.d.ts +1 -1
  4. package/declarations/instructions/claimStakingPoolPosition.d.ts +1 -1
  5. package/declarations/instructions/closeLiquidationPoolPosition.d.ts +1 -1
  6. package/declarations/instructions/createStakingPool.d.ts +1 -1
  7. package/declarations/instructions/createVault.d.ts +1 -1
  8. package/declarations/instructions/depositLiquidationPool.d.ts +1 -1
  9. package/declarations/instructions/depositStakingPool.d.ts +1 -1
  10. package/declarations/instructions/depositVault.d.ts +1 -1
  11. package/declarations/instructions/initHedgeFoundation.d.ts +1 -1
  12. package/declarations/instructions/liquidateVault.d.ts +1 -1
  13. package/declarations/instructions/loanVault.d.ts +1 -1
  14. package/declarations/instructions/redeemVault.d.ts +1 -1
  15. package/declarations/instructions/refreshOraclePrice.d.ts +3 -3
  16. package/declarations/instructions/repayVault.d.ts +1 -1
  17. package/declarations/instructions/setHalted.d.ts +1 -1
  18. package/declarations/instructions/updateVaultType.d.ts +4 -1
  19. package/declarations/instructions/withdrawStakingPool.d.ts +1 -1
  20. package/declarations/instructions/withdrawVault.d.ts +1 -1
  21. package/declarations/state/VaultAccount.d.ts +4 -3
  22. package/declarations/utils/getLinkedListAccounts.d.ts +1 -1
  23. package/lib/Constants.js +3 -2
  24. package/lib/idl/vault.js +161 -35
  25. package/lib/instructions/claimLiquidationPoolPosition.js +5 -1
  26. package/lib/instructions/claimStakingPoolPosition.js +5 -1
  27. package/lib/instructions/closeLiquidationPoolPosition.js +5 -1
  28. package/lib/instructions/createStakingPool.js +5 -2
  29. package/lib/instructions/createVault.js +5 -1
  30. package/lib/instructions/depositLiquidationPool.js +5 -1
  31. package/lib/instructions/depositStakingPool.js +5 -1
  32. package/lib/instructions/depositVault.js +5 -1
  33. package/lib/instructions/initHedgeFoundation.js +5 -1
  34. package/lib/instructions/initHedgeFoundationTokens.js +5 -1
  35. package/lib/instructions/liquidateVault.js +5 -1
  36. package/lib/instructions/loanVault.js +5 -3
  37. package/lib/instructions/redeemVault.js +5 -1
  38. package/lib/instructions/refreshOraclePrice.js +6 -1
  39. package/lib/instructions/repayVault.js +5 -1
  40. package/lib/instructions/setHalted.js +5 -1
  41. package/lib/instructions/updateVaultType.js +9 -2
  42. package/lib/instructions/withdrawStakingPool.js +5 -1
  43. package/lib/instructions/withdrawVault.js +5 -1
  44. package/lib/state/VaultAccount.js +11 -9
  45. package/lib/utils/getLinkedListAccounts.js +48 -48
  46. package/package.json +1 -1
  47. package/src/Constants.ts +2 -1
  48. package/src/idl/vault.ts +322 -70
  49. package/src/instructions/claimLiquidationPoolPosition.ts +3 -2
  50. package/src/instructions/claimStakingPoolPosition.ts +3 -2
  51. package/src/instructions/closeLiquidationPoolPosition.ts +3 -2
  52. package/src/instructions/createStakingPool.ts +3 -3
  53. package/src/instructions/createVault.ts +3 -2
  54. package/src/instructions/depositLiquidationPool.ts +3 -2
  55. package/src/instructions/depositStakingPool.ts +3 -2
  56. package/src/instructions/depositVault.ts +3 -3
  57. package/src/instructions/initHedgeFoundation.ts +3 -2
  58. package/src/instructions/initHedgeFoundationTokens.ts +2 -1
  59. package/src/instructions/liquidateVault.ts +5 -3
  60. package/src/instructions/loanVault.ts +3 -4
  61. package/src/instructions/redeemVault.ts +3 -2
  62. package/src/instructions/refreshOraclePrice.ts +7 -4
  63. package/src/instructions/repayVault.ts +3 -2
  64. package/src/instructions/setHalted.ts +3 -2
  65. package/src/instructions/updateVaultType.ts +10 -2
  66. package/src/instructions/withdrawStakingPool.ts +3 -2
  67. package/src/instructions/withdrawVault.ts +3 -2
  68. package/src/state/VaultAccount.ts +17 -12
  69. package/src/state/VaultType.ts +62 -0
  70. package/src/utils/getLinkedListAccounts.ts +54 -49
  71. package/src/utils/sendAndConfirmWithDebug.ts +27 -0
package/src/idl/vault.ts CHANGED
@@ -1177,6 +1177,11 @@ export type Vault = {
1177
1177
  "name": "systemProgram",
1178
1178
  "isMut": false,
1179
1179
  "isSigner": false
1180
+ },
1181
+ {
1182
+ "name": "chainlinkProgram",
1183
+ "isMut": false,
1184
+ "isSigner": false
1180
1185
  }
1181
1186
  ],
1182
1187
  "args": [
@@ -1649,6 +1654,58 @@ export type Vault = {
1649
1654
  }
1650
1655
  }
1651
1656
  ]
1657
+ },
1658
+ {
1659
+ "name": "adminMigrateVault",
1660
+ "accounts": [
1661
+ {
1662
+ "name": "payer",
1663
+ "isMut": true,
1664
+ "isSigner": true
1665
+ },
1666
+ {
1667
+ "name": "vaultSystemState",
1668
+ "isMut": true,
1669
+ "isSigner": false
1670
+ },
1671
+ {
1672
+ "name": "vaultAccount",
1673
+ "isMut": true,
1674
+ "isSigner": false
1675
+ },
1676
+ {
1677
+ "name": "vaultTypeAccount",
1678
+ "isMut": true,
1679
+ "isSigner": false
1680
+ }
1681
+ ],
1682
+ "args": []
1683
+ },
1684
+ {
1685
+ "name": "adminMigrateOracle",
1686
+ "accounts": [
1687
+ {
1688
+ "name": "payer",
1689
+ "isMut": true,
1690
+ "isSigner": true
1691
+ },
1692
+ {
1693
+ "name": "vaultSystemState",
1694
+ "isMut": true,
1695
+ "isSigner": false
1696
+ },
1697
+ {
1698
+ "name": "oracleInfoAccount",
1699
+ "isMut": true,
1700
+ "isSigner": false
1701
+ },
1702
+ {
1703
+ "name": "vaultTypeAccount",
1704
+ "isMut": true,
1705
+ "isSigner": false
1706
+ }
1707
+ ],
1708
+ "args": []
1652
1709
  }
1653
1710
  ],
1654
1711
  "accounts": [
@@ -1777,10 +1834,6 @@ export type Vault = {
1777
1834
  "type": {
1778
1835
  "kind": "struct",
1779
1836
  "fields": [
1780
- {
1781
- "name": "state",
1782
- "type": "u64"
1783
- },
1784
1837
  {
1785
1838
  "name": "era",
1786
1839
  "type": "publicKey"
@@ -1789,14 +1842,6 @@ export type Vault = {
1789
1842
  "name": "ownerAccount",
1790
1843
  "type": "publicKey"
1791
1844
  },
1792
- {
1793
- "name": "deposit",
1794
- "type": "u64"
1795
- },
1796
- {
1797
- "name": "closedUsh",
1798
- "type": "u64"
1799
- },
1800
1845
  {
1801
1846
  "name": "productSnapshotEntry",
1802
1847
  "type": "u128"
@@ -1827,6 +1872,14 @@ export type Vault = {
1827
1872
  "name": "hedgeRewardsSnapshotAccum",
1828
1873
  "type": "u128"
1829
1874
  },
1875
+ {
1876
+ "name": "deposit",
1877
+ "type": "u64"
1878
+ },
1879
+ {
1880
+ "name": "closedUsh",
1881
+ "type": "u64"
1882
+ },
1830
1883
  {
1831
1884
  "name": "timestampOpened",
1832
1885
  "type": "u64"
@@ -1834,6 +1887,12 @@ export type Vault = {
1834
1887
  {
1835
1888
  "name": "timestampClosed",
1836
1889
  "type": "u64"
1890
+ },
1891
+ {
1892
+ "name": "state",
1893
+ "type": {
1894
+ "defined": "PositionState"
1895
+ }
1837
1896
  }
1838
1897
  ]
1839
1898
  }
@@ -1844,8 +1903,8 @@ export type Vault = {
1844
1903
  "kind": "struct",
1845
1904
  "fields": [
1846
1905
  {
1847
- "name": "vaultTypeName",
1848
- "type": "string"
1906
+ "name": "vaultType",
1907
+ "type": "publicKey"
1849
1908
  },
1850
1909
  {
1851
1910
  "name": "oraclePyth",
@@ -1860,8 +1919,20 @@ export type Vault = {
1860
1919
  "type": "publicKey"
1861
1920
  },
1862
1921
  {
1863
- "name": "vaultType",
1864
- "type": "publicKey"
1922
+ "name": "priorityPyth",
1923
+ "type": "i8"
1924
+ },
1925
+ {
1926
+ "name": "priorityChainlink",
1927
+ "type": "i8"
1928
+ },
1929
+ {
1930
+ "name": "prioritySwitchboard",
1931
+ "type": "i8"
1932
+ },
1933
+ {
1934
+ "name": "vaultTypeName",
1935
+ "type": "string"
1865
1936
  }
1866
1937
  ]
1867
1938
  }
@@ -2065,7 +2136,7 @@ export type Vault = {
2065
2136
  },
2066
2137
  {
2067
2138
  "name": "totalUshSupply",
2068
- "type": "u64"
2139
+ "type": "u128"
2069
2140
  },
2070
2141
  {
2071
2142
  "name": "totalVaults",
@@ -2105,10 +2176,6 @@ export type Vault = {
2105
2176
  "type": {
2106
2177
  "kind": "struct",
2107
2178
  "fields": [
2108
- {
2109
- "name": "vaultTypeName",
2110
- "type": "string"
2111
- },
2112
2179
  {
2113
2180
  "name": "collateralMint",
2114
2181
  "type": "publicKey"
@@ -2181,6 +2248,22 @@ export type Vault = {
2181
2248
  "name": "interestRatePerSecond",
2182
2249
  "type": "u128"
2183
2250
  },
2251
+ {
2252
+ "name": "deprecated",
2253
+ "type": "bool"
2254
+ },
2255
+ {
2256
+ "name": "totalFeesAccumulatedUsh",
2257
+ "type": "u128"
2258
+ },
2259
+ {
2260
+ "name": "totalFeesAccumulatedCollateral",
2261
+ "type": "u128"
2262
+ },
2263
+ {
2264
+ "name": "vaultTypeName",
2265
+ "type": "string"
2266
+ },
2184
2267
  {
2185
2268
  "name": "firstVaultToRedeem",
2186
2269
  "type": {
@@ -2224,12 +2307,14 @@ export type Vault = {
2224
2307
  "type": "u64"
2225
2308
  },
2226
2309
  {
2227
- "name": "vaultTypeName",
2228
- "type": "string"
2310
+ "name": "vaultStatus",
2311
+ "type": {
2312
+ "defined": "VaultStatus"
2313
+ }
2229
2314
  },
2230
2315
  {
2231
- "name": "pdaSalt",
2232
- "type": "string"
2316
+ "name": "vaultType",
2317
+ "type": "publicKey"
2233
2318
  },
2234
2319
  {
2235
2320
  "name": "bump",
@@ -2253,12 +2338,6 @@ export type Vault = {
2253
2338
  "defined": "CurrencyType"
2254
2339
  }
2255
2340
  },
2256
- {
2257
- "name": "vaultStatus",
2258
- "type": {
2259
- "defined": "VaultStatus"
2260
- }
2261
- },
2262
2341
  {
2263
2342
  "name": "timeCreated",
2264
2343
  "type": "u64"
@@ -2267,15 +2346,19 @@ export type Vault = {
2267
2346
  "name": "timeLastInteraction",
2268
2347
  "type": "u64"
2269
2348
  },
2349
+ {
2350
+ "name": "vaultTypeName",
2351
+ "type": "string"
2352
+ },
2353
+ {
2354
+ "name": "pdaSalt",
2355
+ "type": "string"
2356
+ },
2270
2357
  {
2271
2358
  "name": "nextVaultToRedeem",
2272
2359
  "type": {
2273
2360
  "option": "publicKey"
2274
2361
  }
2275
- },
2276
- {
2277
- "name": "vaultType",
2278
- "type": "publicKey"
2279
2362
  }
2280
2363
  ]
2281
2364
  }
@@ -2365,6 +2448,24 @@ export type Vault = {
2365
2448
  "option": "publicKey"
2366
2449
  }
2367
2450
  },
2451
+ {
2452
+ "name": "priorityChainlink",
2453
+ "type": {
2454
+ "option": "i8"
2455
+ }
2456
+ },
2457
+ {
2458
+ "name": "priorityPyth",
2459
+ "type": {
2460
+ "option": "i8"
2461
+ }
2462
+ },
2463
+ {
2464
+ "name": "prioritySwitchboard",
2465
+ "type": {
2466
+ "option": "i8"
2467
+ }
2468
+ },
2368
2469
  {
2369
2470
  "name": "deprecated",
2370
2471
  "type": {
@@ -2709,8 +2810,33 @@ export type Vault = {
2709
2810
  },
2710
2811
  {
2711
2812
  "code": 6024,
2813
+ "name": "InvalidNameLength",
2814
+ "msg": "Name for new vault type must be length 16"
2815
+ },
2816
+ {
2817
+ "code": 6025,
2712
2818
  "name": "UpdateVaultTypeBadMaxDebtExtended",
2713
2819
  "msg": "New Max debt extended value is less than the current debt!"
2820
+ },
2821
+ {
2822
+ "code": 6025,
2823
+ "name": "UpdateVaultTypeNoEnabledOracles",
2824
+ "msg": "No Enabled Oracles!"
2825
+ },
2826
+ {
2827
+ "code": 6026,
2828
+ "name": "UpdateVaultTypeDuplicateOraclePriorities",
2829
+ "msg": "Duplicate Oracle Priorities"
2830
+ },
2831
+ {
2832
+ "code": 6027,
2833
+ "name": "UpdateVaultTypeInvalidOraclePriority",
2834
+ "msg": "Invalid Oracle Priority"
2835
+ },
2836
+ {
2837
+ "code": 6028,
2838
+ "name": "OracleUpdateFailed",
2839
+ "msg": "OracleUpdateFailed"
2714
2840
  }
2715
2841
  ]
2716
2842
  };
@@ -3894,6 +4020,11 @@ export const IDL: Vault = {
3894
4020
  "name": "systemProgram",
3895
4021
  "isMut": false,
3896
4022
  "isSigner": false
4023
+ },
4024
+ {
4025
+ "name": "chainlinkProgram",
4026
+ "isMut": false,
4027
+ "isSigner": false
3897
4028
  }
3898
4029
  ],
3899
4030
  "args": [
@@ -4366,6 +4497,58 @@ export const IDL: Vault = {
4366
4497
  }
4367
4498
  }
4368
4499
  ]
4500
+ },
4501
+ {
4502
+ "name": "adminMigrateVault",
4503
+ "accounts": [
4504
+ {
4505
+ "name": "payer",
4506
+ "isMut": true,
4507
+ "isSigner": true
4508
+ },
4509
+ {
4510
+ "name": "vaultSystemState",
4511
+ "isMut": true,
4512
+ "isSigner": false
4513
+ },
4514
+ {
4515
+ "name": "vaultAccount",
4516
+ "isMut": true,
4517
+ "isSigner": false
4518
+ },
4519
+ {
4520
+ "name": "vaultTypeAccount",
4521
+ "isMut": true,
4522
+ "isSigner": false
4523
+ }
4524
+ ],
4525
+ "args": []
4526
+ },
4527
+ {
4528
+ "name": "adminMigrateOracle",
4529
+ "accounts": [
4530
+ {
4531
+ "name": "payer",
4532
+ "isMut": true,
4533
+ "isSigner": true
4534
+ },
4535
+ {
4536
+ "name": "vaultSystemState",
4537
+ "isMut": true,
4538
+ "isSigner": false
4539
+ },
4540
+ {
4541
+ "name": "oracleInfoAccount",
4542
+ "isMut": true,
4543
+ "isSigner": false
4544
+ },
4545
+ {
4546
+ "name": "vaultTypeAccount",
4547
+ "isMut": true,
4548
+ "isSigner": false
4549
+ }
4550
+ ],
4551
+ "args": []
4369
4552
  }
4370
4553
  ],
4371
4554
  "accounts": [
@@ -4494,10 +4677,6 @@ export const IDL: Vault = {
4494
4677
  "type": {
4495
4678
  "kind": "struct",
4496
4679
  "fields": [
4497
- {
4498
- "name": "state",
4499
- "type": "u64"
4500
- },
4501
4680
  {
4502
4681
  "name": "era",
4503
4682
  "type": "publicKey"
@@ -4506,14 +4685,6 @@ export const IDL: Vault = {
4506
4685
  "name": "ownerAccount",
4507
4686
  "type": "publicKey"
4508
4687
  },
4509
- {
4510
- "name": "deposit",
4511
- "type": "u64"
4512
- },
4513
- {
4514
- "name": "closedUsh",
4515
- "type": "u64"
4516
- },
4517
4688
  {
4518
4689
  "name": "productSnapshotEntry",
4519
4690
  "type": "u128"
@@ -4544,6 +4715,14 @@ export const IDL: Vault = {
4544
4715
  "name": "hedgeRewardsSnapshotAccum",
4545
4716
  "type": "u128"
4546
4717
  },
4718
+ {
4719
+ "name": "deposit",
4720
+ "type": "u64"
4721
+ },
4722
+ {
4723
+ "name": "closedUsh",
4724
+ "type": "u64"
4725
+ },
4547
4726
  {
4548
4727
  "name": "timestampOpened",
4549
4728
  "type": "u64"
@@ -4551,6 +4730,12 @@ export const IDL: Vault = {
4551
4730
  {
4552
4731
  "name": "timestampClosed",
4553
4732
  "type": "u64"
4733
+ },
4734
+ {
4735
+ "name": "state",
4736
+ "type": {
4737
+ "defined": "PositionState"
4738
+ }
4554
4739
  }
4555
4740
  ]
4556
4741
  }
@@ -4561,8 +4746,8 @@ export const IDL: Vault = {
4561
4746
  "kind": "struct",
4562
4747
  "fields": [
4563
4748
  {
4564
- "name": "vaultTypeName",
4565
- "type": "string"
4749
+ "name": "vaultType",
4750
+ "type": "publicKey"
4566
4751
  },
4567
4752
  {
4568
4753
  "name": "oraclePyth",
@@ -4577,8 +4762,20 @@ export const IDL: Vault = {
4577
4762
  "type": "publicKey"
4578
4763
  },
4579
4764
  {
4580
- "name": "vaultType",
4581
- "type": "publicKey"
4765
+ "name": "priorityPyth",
4766
+ "type": "i8"
4767
+ },
4768
+ {
4769
+ "name": "priorityChainlink",
4770
+ "type": "i8"
4771
+ },
4772
+ {
4773
+ "name": "prioritySwitchboard",
4774
+ "type": "i8"
4775
+ },
4776
+ {
4777
+ "name": "vaultTypeName",
4778
+ "type": "string"
4582
4779
  }
4583
4780
  ]
4584
4781
  }
@@ -4782,7 +4979,7 @@ export const IDL: Vault = {
4782
4979
  },
4783
4980
  {
4784
4981
  "name": "totalUshSupply",
4785
- "type": "u64"
4982
+ "type": "u128"
4786
4983
  },
4787
4984
  {
4788
4985
  "name": "totalVaults",
@@ -4822,10 +5019,6 @@ export const IDL: Vault = {
4822
5019
  "type": {
4823
5020
  "kind": "struct",
4824
5021
  "fields": [
4825
- {
4826
- "name": "vaultTypeName",
4827
- "type": "string"
4828
- },
4829
5022
  {
4830
5023
  "name": "collateralMint",
4831
5024
  "type": "publicKey"
@@ -4898,6 +5091,22 @@ export const IDL: Vault = {
4898
5091
  "name": "interestRatePerSecond",
4899
5092
  "type": "u128"
4900
5093
  },
5094
+ {
5095
+ "name": "deprecated",
5096
+ "type": "bool"
5097
+ },
5098
+ {
5099
+ "name": "totalFeesAccumulatedUsh",
5100
+ "type": "u128"
5101
+ },
5102
+ {
5103
+ "name": "totalFeesAccumulatedCollateral",
5104
+ "type": "u128"
5105
+ },
5106
+ {
5107
+ "name": "vaultTypeName",
5108
+ "type": "string"
5109
+ },
4901
5110
  {
4902
5111
  "name": "firstVaultToRedeem",
4903
5112
  "type": {
@@ -4941,12 +5150,14 @@ export const IDL: Vault = {
4941
5150
  "type": "u64"
4942
5151
  },
4943
5152
  {
4944
- "name": "vaultTypeName",
4945
- "type": "string"
5153
+ "name": "vaultStatus",
5154
+ "type": {
5155
+ "defined": "VaultStatus"
5156
+ }
4946
5157
  },
4947
5158
  {
4948
- "name": "pdaSalt",
4949
- "type": "string"
5159
+ "name": "vaultType",
5160
+ "type": "publicKey"
4950
5161
  },
4951
5162
  {
4952
5163
  "name": "bump",
@@ -4970,12 +5181,6 @@ export const IDL: Vault = {
4970
5181
  "defined": "CurrencyType"
4971
5182
  }
4972
5183
  },
4973
- {
4974
- "name": "vaultStatus",
4975
- "type": {
4976
- "defined": "VaultStatus"
4977
- }
4978
- },
4979
5184
  {
4980
5185
  "name": "timeCreated",
4981
5186
  "type": "u64"
@@ -4984,15 +5189,19 @@ export const IDL: Vault = {
4984
5189
  "name": "timeLastInteraction",
4985
5190
  "type": "u64"
4986
5191
  },
5192
+ {
5193
+ "name": "vaultTypeName",
5194
+ "type": "string"
5195
+ },
5196
+ {
5197
+ "name": "pdaSalt",
5198
+ "type": "string"
5199
+ },
4987
5200
  {
4988
5201
  "name": "nextVaultToRedeem",
4989
5202
  "type": {
4990
5203
  "option": "publicKey"
4991
5204
  }
4992
- },
4993
- {
4994
- "name": "vaultType",
4995
- "type": "publicKey"
4996
5205
  }
4997
5206
  ]
4998
5207
  }
@@ -5082,6 +5291,24 @@ export const IDL: Vault = {
5082
5291
  "option": "publicKey"
5083
5292
  }
5084
5293
  },
5294
+ {
5295
+ "name": "priorityChainlink",
5296
+ "type": {
5297
+ "option": "i8"
5298
+ }
5299
+ },
5300
+ {
5301
+ "name": "priorityPyth",
5302
+ "type": {
5303
+ "option": "i8"
5304
+ }
5305
+ },
5306
+ {
5307
+ "name": "prioritySwitchboard",
5308
+ "type": {
5309
+ "option": "i8"
5310
+ }
5311
+ },
5085
5312
  {
5086
5313
  "name": "deprecated",
5087
5314
  "type": {
@@ -5426,8 +5653,33 @@ export const IDL: Vault = {
5426
5653
  },
5427
5654
  {
5428
5655
  "code": 6024,
5656
+ "name": "InvalidNameLength",
5657
+ "msg": "Name for new vault type must be length 16"
5658
+ },
5659
+ {
5660
+ "code": 6025,
5429
5661
  "name": "UpdateVaultTypeBadMaxDebtExtended",
5430
5662
  "msg": "New Max debt extended value is less than the current debt!"
5663
+ },
5664
+ {
5665
+ "code": 6025,
5666
+ "name": "UpdateVaultTypeNoEnabledOracles",
5667
+ "msg": "No Enabled Oracles!"
5668
+ },
5669
+ {
5670
+ "code": 6026,
5671
+ "name": "UpdateVaultTypeDuplicateOraclePriorities",
5672
+ "msg": "Duplicate Oracle Priorities"
5673
+ },
5674
+ {
5675
+ "code": 6027,
5676
+ "name": "UpdateVaultTypeInvalidOraclePriority",
5677
+ "msg": "Invalid Oracle Priority"
5678
+ },
5679
+ {
5680
+ "code": 6028,
5681
+ "name": "OracleUpdateFailed",
5682
+ "msg": "OracleUpdateFailed"
5431
5683
  }
5432
5684
  ]
5433
5685
  };
@@ -16,7 +16,8 @@ import {
16
16
  getLiquidationPoolStatePublicKey,
17
17
  getVaultSystemStatePublicKey,
18
18
  } from '../Constants'
19
- import { Vault } from 'idl/vault'
19
+ import sendAndConfirmWithDebug from '../utils/sendAndConfirmWithDebug'
20
+ import { Vault } from '../idl/vault'
20
21
 
21
22
  export async function claimLiquidationPoolPosition(
22
23
  program: Program<Vault>,
@@ -48,7 +49,7 @@ export async function claimLiquidationPoolPosition(
48
49
  overrideStartTime
49
50
  )
50
51
  )
51
- await sendAndConfirmTransaction(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
52
+ await sendAndConfirmWithDebug(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
52
53
  return payerAssociatedTokenAccount.address
53
54
  }
54
55
 
@@ -17,7 +17,8 @@ import {
17
17
  getPoolPublicKeyForMint,
18
18
  getVaultSystemStatePublicKey,
19
19
  } from '../Constants'
20
- import { Vault } from 'idl/vault'
20
+ import sendAndConfirmWithDebug from '../utils/sendAndConfirmWithDebug'
21
+ import { Vault } from '../idl/vault'
21
22
 
22
23
  export async function claimStakingPoolPosition(
23
24
  program: Program<Vault>,
@@ -58,7 +59,7 @@ export async function claimStakingPoolPosition(
58
59
  payerAssociatedTokenAccount.address
59
60
  )
60
61
  )
61
- await sendAndConfirmTransaction(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
62
+ await sendAndConfirmWithDebug(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
62
63
  return payerAssociatedTokenAccount.address
63
64
  }
64
65
 
@@ -17,7 +17,8 @@ import {
17
17
  getUshMintPublicKey,
18
18
  getVaultSystemStatePublicKey,
19
19
  } from '../Constants'
20
- import { Vault } from 'idl/vault'
20
+ import sendAndConfirmWithDebug from '../utils/sendAndConfirmWithDebug'
21
+ import { Vault } from '../idl/vault'
21
22
 
22
23
  export async function closeLiquidationPoolPosition(
23
24
  program: Program<Vault>,
@@ -64,7 +65,7 @@ export async function closeLiquidationPoolPosition(
64
65
  overrideStartTime
65
66
  )
66
67
  )
67
- await sendAndConfirmTransaction(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
68
+ await sendAndConfirmWithDebug(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
68
69
  return poolPosition
69
70
  }
70
71
 
@@ -16,7 +16,8 @@ import {
16
16
  getUshMintPublicKey,
17
17
  getVaultSystemStatePublicKey,
18
18
  } from '../Constants'
19
- import { Vault } from 'idl/vault'
19
+ import sendAndConfirmWithDebug from '../utils/sendAndConfirmWithDebug'
20
+ import { Vault } from '../idl/vault'
20
21
 
21
22
  export async function createStakingPool(
22
23
  program: Program<Vault>,
@@ -29,7 +30,7 @@ export async function createStakingPool(
29
30
  const transaction = new Transaction().add(
30
31
  await createStakingPoolInstruction(program, payer.publicKey, mintPublicKey, hedgeTokensToBeMinted, overrideStartTime)
31
32
  )
32
- await sendAndConfirmTransaction(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
33
+ await sendAndConfirmWithDebug(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
33
34
  const [poolPublickey] = await getPoolPublicKeyForMint(mintPublicKey)
34
35
  return poolPublickey
35
36
  }
@@ -41,7 +42,6 @@ export async function createStakingPoolInstruction(
41
42
  hedgeTokensToBeMinted: number,
42
43
  overrideStartTime?: number
43
44
  ): Promise<TransactionInstruction> {
44
- console.log("new createStakingPoolInstruction")
45
45
  const vaultSystemStatePublicKey = await getVaultSystemStatePublicKey()
46
46
  const ushMintPublickey = await getUshMintPublicKey()
47
47
  const [poolPublickey, poolBump] = await getPoolPublicKeyForMint(mintPublicKey)