hedge-web3 0.1.46 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/declarations/Constants.d.ts +2 -1
- package/declarations/idl/vault.d.ts +109 -47
- package/declarations/instructions/claimLiquidationPoolPosition.d.ts +1 -1
- package/declarations/instructions/claimStakingPoolPosition.d.ts +1 -1
- package/declarations/instructions/closeLiquidationPoolPosition.d.ts +1 -1
- package/declarations/instructions/createStakingPool.d.ts +1 -1
- package/declarations/instructions/createVault.d.ts +1 -1
- package/declarations/instructions/depositLiquidationPool.d.ts +1 -1
- package/declarations/instructions/depositStakingPool.d.ts +1 -1
- package/declarations/instructions/depositVault.d.ts +1 -1
- package/declarations/instructions/initHedgeFoundation.d.ts +1 -1
- package/declarations/instructions/liquidateVault.d.ts +1 -1
- package/declarations/instructions/loanVault.d.ts +1 -1
- package/declarations/instructions/redeemVault.d.ts +1 -1
- package/declarations/instructions/refreshOraclePrice.d.ts +3 -3
- package/declarations/instructions/repayVault.d.ts +1 -1
- package/declarations/instructions/setHalted.d.ts +1 -1
- package/declarations/instructions/updateVaultType.d.ts +4 -1
- package/declarations/instructions/withdrawStakingPool.d.ts +1 -1
- package/declarations/instructions/withdrawVault.d.ts +1 -1
- package/declarations/state/VaultAccount.d.ts +4 -3
- package/declarations/utils/getLinkedListAccounts.d.ts +1 -1
- package/lib/Constants.js +3 -2
- package/lib/idl/vault.js +109 -47
- package/lib/instructions/claimLiquidationPoolPosition.js +5 -1
- package/lib/instructions/claimStakingPoolPosition.js +5 -1
- package/lib/instructions/closeLiquidationPoolPosition.js +5 -1
- package/lib/instructions/createStakingPool.js +5 -2
- package/lib/instructions/createVault.js +5 -1
- package/lib/instructions/depositLiquidationPool.js +5 -1
- package/lib/instructions/depositStakingPool.js +5 -1
- package/lib/instructions/depositVault.js +5 -1
- package/lib/instructions/initHedgeFoundation.js +5 -1
- package/lib/instructions/initHedgeFoundationTokens.js +5 -1
- package/lib/instructions/liquidateVault.js +5 -1
- package/lib/instructions/loanVault.js +5 -3
- package/lib/instructions/redeemVault.js +5 -1
- package/lib/instructions/refreshOraclePrice.js +6 -1
- package/lib/instructions/repayVault.js +5 -1
- package/lib/instructions/setHalted.js +5 -1
- package/lib/instructions/updateVaultType.js +9 -2
- package/lib/instructions/withdrawStakingPool.js +5 -1
- package/lib/instructions/withdrawVault.js +5 -1
- package/lib/state/VaultAccount.js +11 -9
- package/lib/utils/getLinkedListAccounts.js +48 -48
- package/package.json +1 -1
- package/src/Constants.ts +2 -1
- package/src/idl/vault.ts +218 -94
- package/src/instructions/claimLiquidationPoolPosition.ts +3 -2
- package/src/instructions/claimStakingPoolPosition.ts +3 -2
- package/src/instructions/closeLiquidationPoolPosition.ts +3 -2
- package/src/instructions/createStakingPool.ts +3 -3
- package/src/instructions/createVault.ts +3 -2
- package/src/instructions/depositLiquidationPool.ts +3 -2
- package/src/instructions/depositStakingPool.ts +3 -2
- package/src/instructions/depositVault.ts +3 -3
- package/src/instructions/initHedgeFoundation.ts +3 -2
- package/src/instructions/initHedgeFoundationTokens.ts +2 -1
- package/src/instructions/liquidateVault.ts +5 -3
- package/src/instructions/loanVault.ts +3 -4
- package/src/instructions/redeemVault.ts +3 -2
- package/src/instructions/refreshOraclePrice.ts +7 -4
- package/src/instructions/repayVault.ts +3 -2
- package/src/instructions/setHalted.ts +3 -2
- package/src/instructions/updateVaultType.ts +10 -2
- package/src/instructions/withdrawStakingPool.ts +3 -2
- package/src/instructions/withdrawVault.ts +3 -2
- package/src/state/VaultAccount.ts +17 -12
- package/src/state/VaultType.ts +62 -0
- package/src/utils/getLinkedListAccounts.ts +54 -49
- 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": [
|
@@ -1769,7 +1774,7 @@ export type Vault = {
|
|
1769
1774
|
"type": {
|
1770
1775
|
"array": [
|
1771
1776
|
"u128",
|
1772
|
-
|
1777
|
+
128
|
1773
1778
|
]
|
1774
1779
|
}
|
1775
1780
|
},
|
@@ -1829,10 +1834,6 @@ export type Vault = {
|
|
1829
1834
|
"type": {
|
1830
1835
|
"kind": "struct",
|
1831
1836
|
"fields": [
|
1832
|
-
{
|
1833
|
-
"name": "state",
|
1834
|
-
"type": "u64"
|
1835
|
-
},
|
1836
1837
|
{
|
1837
1838
|
"name": "era",
|
1838
1839
|
"type": "publicKey"
|
@@ -1841,14 +1842,6 @@ export type Vault = {
|
|
1841
1842
|
"name": "ownerAccount",
|
1842
1843
|
"type": "publicKey"
|
1843
1844
|
},
|
1844
|
-
{
|
1845
|
-
"name": "deposit",
|
1846
|
-
"type": "u64"
|
1847
|
-
},
|
1848
|
-
{
|
1849
|
-
"name": "closedUsh",
|
1850
|
-
"type": "u64"
|
1851
|
-
},
|
1852
1845
|
{
|
1853
1846
|
"name": "productSnapshotEntry",
|
1854
1847
|
"type": "u128"
|
@@ -1862,7 +1855,7 @@ export type Vault = {
|
|
1862
1855
|
"type": {
|
1863
1856
|
"array": [
|
1864
1857
|
"u128",
|
1865
|
-
|
1858
|
+
128
|
1866
1859
|
]
|
1867
1860
|
}
|
1868
1861
|
},
|
@@ -1871,7 +1864,7 @@ export type Vault = {
|
|
1871
1864
|
"type": {
|
1872
1865
|
"array": [
|
1873
1866
|
"u128",
|
1874
|
-
|
1867
|
+
128
|
1875
1868
|
]
|
1876
1869
|
}
|
1877
1870
|
},
|
@@ -1879,6 +1872,14 @@ export type Vault = {
|
|
1879
1872
|
"name": "hedgeRewardsSnapshotAccum",
|
1880
1873
|
"type": "u128"
|
1881
1874
|
},
|
1875
|
+
{
|
1876
|
+
"name": "deposit",
|
1877
|
+
"type": "u64"
|
1878
|
+
},
|
1879
|
+
{
|
1880
|
+
"name": "closedUsh",
|
1881
|
+
"type": "u64"
|
1882
|
+
},
|
1882
1883
|
{
|
1883
1884
|
"name": "timestampOpened",
|
1884
1885
|
"type": "u64"
|
@@ -1886,6 +1887,12 @@ export type Vault = {
|
|
1886
1887
|
{
|
1887
1888
|
"name": "timestampClosed",
|
1888
1889
|
"type": "u64"
|
1890
|
+
},
|
1891
|
+
{
|
1892
|
+
"name": "state",
|
1893
|
+
"type": {
|
1894
|
+
"defined": "PositionState"
|
1895
|
+
}
|
1889
1896
|
}
|
1890
1897
|
]
|
1891
1898
|
}
|
@@ -1896,8 +1903,8 @@ export type Vault = {
|
|
1896
1903
|
"kind": "struct",
|
1897
1904
|
"fields": [
|
1898
1905
|
{
|
1899
|
-
"name": "
|
1900
|
-
"type": "
|
1906
|
+
"name": "vaultType",
|
1907
|
+
"type": "publicKey"
|
1901
1908
|
},
|
1902
1909
|
{
|
1903
1910
|
"name": "oraclePyth",
|
@@ -1912,8 +1919,20 @@ export type Vault = {
|
|
1912
1919
|
"type": "publicKey"
|
1913
1920
|
},
|
1914
1921
|
{
|
1915
|
-
"name": "
|
1916
|
-
"type": "
|
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"
|
1917
1936
|
}
|
1918
1937
|
]
|
1919
1938
|
}
|
@@ -1936,7 +1955,7 @@ export type Vault = {
|
|
1936
1955
|
"type": {
|
1937
1956
|
"array": [
|
1938
1957
|
"u128",
|
1939
|
-
|
1958
|
+
128
|
1940
1959
|
]
|
1941
1960
|
}
|
1942
1961
|
},
|
@@ -1945,7 +1964,7 @@ export type Vault = {
|
|
1945
1964
|
"type": {
|
1946
1965
|
"array": [
|
1947
1966
|
"u128",
|
1948
|
-
|
1967
|
+
128
|
1949
1968
|
]
|
1950
1969
|
}
|
1951
1970
|
},
|
@@ -2033,7 +2052,7 @@ export type Vault = {
|
|
2033
2052
|
"type": {
|
2034
2053
|
"array": [
|
2035
2054
|
"u128",
|
2036
|
-
|
2055
|
+
128
|
2037
2056
|
]
|
2038
2057
|
}
|
2039
2058
|
},
|
@@ -2117,7 +2136,7 @@ export type Vault = {
|
|
2117
2136
|
},
|
2118
2137
|
{
|
2119
2138
|
"name": "totalUshSupply",
|
2120
|
-
"type": "
|
2139
|
+
"type": "u128"
|
2121
2140
|
},
|
2122
2141
|
{
|
2123
2142
|
"name": "totalVaults",
|
@@ -2157,10 +2176,6 @@ export type Vault = {
|
|
2157
2176
|
"type": {
|
2158
2177
|
"kind": "struct",
|
2159
2178
|
"fields": [
|
2160
|
-
{
|
2161
|
-
"name": "vaultTypeName",
|
2162
|
-
"type": "string"
|
2163
|
-
},
|
2164
2179
|
{
|
2165
2180
|
"name": "collateralMint",
|
2166
2181
|
"type": "publicKey"
|
@@ -2233,12 +2248,6 @@ export type Vault = {
|
|
2233
2248
|
"name": "interestRatePerSecond",
|
2234
2249
|
"type": "u128"
|
2235
2250
|
},
|
2236
|
-
{
|
2237
|
-
"name": "firstVaultToRedeem",
|
2238
|
-
"type": {
|
2239
|
-
"option": "publicKey"
|
2240
|
-
}
|
2241
|
-
},
|
2242
2251
|
{
|
2243
2252
|
"name": "deprecated",
|
2244
2253
|
"type": "bool"
|
@@ -2250,6 +2259,16 @@ export type Vault = {
|
|
2250
2259
|
{
|
2251
2260
|
"name": "totalFeesAccumulatedCollateral",
|
2252
2261
|
"type": "u128"
|
2262
|
+
},
|
2263
|
+
{
|
2264
|
+
"name": "vaultTypeName",
|
2265
|
+
"type": "string"
|
2266
|
+
},
|
2267
|
+
{
|
2268
|
+
"name": "firstVaultToRedeem",
|
2269
|
+
"type": {
|
2270
|
+
"option": "publicKey"
|
2271
|
+
}
|
2253
2272
|
}
|
2254
2273
|
]
|
2255
2274
|
}
|
@@ -2276,12 +2295,14 @@ export type Vault = {
|
|
2276
2295
|
"type": "u64"
|
2277
2296
|
},
|
2278
2297
|
{
|
2279
|
-
"name": "
|
2280
|
-
"type":
|
2298
|
+
"name": "vaultStatus",
|
2299
|
+
"type": {
|
2300
|
+
"defined": "VaultStatus"
|
2301
|
+
}
|
2281
2302
|
},
|
2282
2303
|
{
|
2283
|
-
"name": "
|
2284
|
-
"type": "
|
2304
|
+
"name": "vaultType",
|
2305
|
+
"type": "publicKey"
|
2285
2306
|
},
|
2286
2307
|
{
|
2287
2308
|
"name": "bump",
|
@@ -2305,12 +2326,6 @@ export type Vault = {
|
|
2305
2326
|
"defined": "CurrencyType"
|
2306
2327
|
}
|
2307
2328
|
},
|
2308
|
-
{
|
2309
|
-
"name": "vaultStatus",
|
2310
|
-
"type": {
|
2311
|
-
"defined": "VaultStatus"
|
2312
|
-
}
|
2313
|
-
},
|
2314
2329
|
{
|
2315
2330
|
"name": "timeCreated",
|
2316
2331
|
"type": "u64"
|
@@ -2319,15 +2334,19 @@ export type Vault = {
|
|
2319
2334
|
"name": "timeLastInteraction",
|
2320
2335
|
"type": "u64"
|
2321
2336
|
},
|
2337
|
+
{
|
2338
|
+
"name": "vaultTypeName",
|
2339
|
+
"type": "string"
|
2340
|
+
},
|
2341
|
+
{
|
2342
|
+
"name": "pdaSalt",
|
2343
|
+
"type": "string"
|
2344
|
+
},
|
2322
2345
|
{
|
2323
2346
|
"name": "nextVaultToRedeem",
|
2324
2347
|
"type": {
|
2325
2348
|
"option": "publicKey"
|
2326
2349
|
}
|
2327
|
-
},
|
2328
|
-
{
|
2329
|
-
"name": "vaultType",
|
2330
|
-
"type": "publicKey"
|
2331
2350
|
}
|
2332
2351
|
]
|
2333
2352
|
}
|
@@ -2417,6 +2436,24 @@ export type Vault = {
|
|
2417
2436
|
"option": "publicKey"
|
2418
2437
|
}
|
2419
2438
|
},
|
2439
|
+
{
|
2440
|
+
"name": "priorityChainlink",
|
2441
|
+
"type": {
|
2442
|
+
"option": "i8"
|
2443
|
+
}
|
2444
|
+
},
|
2445
|
+
{
|
2446
|
+
"name": "priorityPyth",
|
2447
|
+
"type": {
|
2448
|
+
"option": "i8"
|
2449
|
+
}
|
2450
|
+
},
|
2451
|
+
{
|
2452
|
+
"name": "prioritySwitchboard",
|
2453
|
+
"type": {
|
2454
|
+
"option": "i8"
|
2455
|
+
}
|
2456
|
+
},
|
2420
2457
|
{
|
2421
2458
|
"name": "deprecated",
|
2422
2459
|
"type": {
|
@@ -2761,8 +2798,33 @@ export type Vault = {
|
|
2761
2798
|
},
|
2762
2799
|
{
|
2763
2800
|
"code": 6024,
|
2801
|
+
"name": "InvalidNameLength",
|
2802
|
+
"msg": "Name for new vault type must be length 16"
|
2803
|
+
},
|
2804
|
+
{
|
2805
|
+
"code": 6025,
|
2764
2806
|
"name": "UpdateVaultTypeBadMaxDebtExtended",
|
2765
2807
|
"msg": "New Max debt extended value is less than the current debt!"
|
2808
|
+
},
|
2809
|
+
{
|
2810
|
+
"code": 6026,
|
2811
|
+
"name": "UpdateVaultTypeNoEnabledOracles",
|
2812
|
+
"msg": "No Enabled Oracles!"
|
2813
|
+
},
|
2814
|
+
{
|
2815
|
+
"code": 6027,
|
2816
|
+
"name": "UpdateVaultTypeDuplicateOraclePriorities",
|
2817
|
+
"msg": "Duplicate Oracle Priorities"
|
2818
|
+
},
|
2819
|
+
{
|
2820
|
+
"code": 6028,
|
2821
|
+
"name": "UpdateVaultTypeInvalidOraclePriority",
|
2822
|
+
"msg": "Invalid Oracle Priority"
|
2823
|
+
},
|
2824
|
+
{
|
2825
|
+
"code": 6029,
|
2826
|
+
"name": "OracleUpdateFailed",
|
2827
|
+
"msg": "OracleUpdateFailed"
|
2766
2828
|
}
|
2767
2829
|
]
|
2768
2830
|
};
|
@@ -3946,6 +4008,11 @@ export const IDL: Vault = {
|
|
3946
4008
|
"name": "systemProgram",
|
3947
4009
|
"isMut": false,
|
3948
4010
|
"isSigner": false
|
4011
|
+
},
|
4012
|
+
{
|
4013
|
+
"name": "chainlinkProgram",
|
4014
|
+
"isMut": false,
|
4015
|
+
"isSigner": false
|
3949
4016
|
}
|
3950
4017
|
],
|
3951
4018
|
"args": [
|
@@ -4538,7 +4605,7 @@ export const IDL: Vault = {
|
|
4538
4605
|
"type": {
|
4539
4606
|
"array": [
|
4540
4607
|
"u128",
|
4541
|
-
|
4608
|
+
128
|
4542
4609
|
]
|
4543
4610
|
}
|
4544
4611
|
},
|
@@ -4598,10 +4665,6 @@ export const IDL: Vault = {
|
|
4598
4665
|
"type": {
|
4599
4666
|
"kind": "struct",
|
4600
4667
|
"fields": [
|
4601
|
-
{
|
4602
|
-
"name": "state",
|
4603
|
-
"type": "u64"
|
4604
|
-
},
|
4605
4668
|
{
|
4606
4669
|
"name": "era",
|
4607
4670
|
"type": "publicKey"
|
@@ -4610,14 +4673,6 @@ export const IDL: Vault = {
|
|
4610
4673
|
"name": "ownerAccount",
|
4611
4674
|
"type": "publicKey"
|
4612
4675
|
},
|
4613
|
-
{
|
4614
|
-
"name": "deposit",
|
4615
|
-
"type": "u64"
|
4616
|
-
},
|
4617
|
-
{
|
4618
|
-
"name": "closedUsh",
|
4619
|
-
"type": "u64"
|
4620
|
-
},
|
4621
4676
|
{
|
4622
4677
|
"name": "productSnapshotEntry",
|
4623
4678
|
"type": "u128"
|
@@ -4631,7 +4686,7 @@ export const IDL: Vault = {
|
|
4631
4686
|
"type": {
|
4632
4687
|
"array": [
|
4633
4688
|
"u128",
|
4634
|
-
|
4689
|
+
128
|
4635
4690
|
]
|
4636
4691
|
}
|
4637
4692
|
},
|
@@ -4640,7 +4695,7 @@ export const IDL: Vault = {
|
|
4640
4695
|
"type": {
|
4641
4696
|
"array": [
|
4642
4697
|
"u128",
|
4643
|
-
|
4698
|
+
128
|
4644
4699
|
]
|
4645
4700
|
}
|
4646
4701
|
},
|
@@ -4648,6 +4703,14 @@ export const IDL: Vault = {
|
|
4648
4703
|
"name": "hedgeRewardsSnapshotAccum",
|
4649
4704
|
"type": "u128"
|
4650
4705
|
},
|
4706
|
+
{
|
4707
|
+
"name": "deposit",
|
4708
|
+
"type": "u64"
|
4709
|
+
},
|
4710
|
+
{
|
4711
|
+
"name": "closedUsh",
|
4712
|
+
"type": "u64"
|
4713
|
+
},
|
4651
4714
|
{
|
4652
4715
|
"name": "timestampOpened",
|
4653
4716
|
"type": "u64"
|
@@ -4655,6 +4718,12 @@ export const IDL: Vault = {
|
|
4655
4718
|
{
|
4656
4719
|
"name": "timestampClosed",
|
4657
4720
|
"type": "u64"
|
4721
|
+
},
|
4722
|
+
{
|
4723
|
+
"name": "state",
|
4724
|
+
"type": {
|
4725
|
+
"defined": "PositionState"
|
4726
|
+
}
|
4658
4727
|
}
|
4659
4728
|
]
|
4660
4729
|
}
|
@@ -4665,8 +4734,8 @@ export const IDL: Vault = {
|
|
4665
4734
|
"kind": "struct",
|
4666
4735
|
"fields": [
|
4667
4736
|
{
|
4668
|
-
"name": "
|
4669
|
-
"type": "
|
4737
|
+
"name": "vaultType",
|
4738
|
+
"type": "publicKey"
|
4670
4739
|
},
|
4671
4740
|
{
|
4672
4741
|
"name": "oraclePyth",
|
@@ -4681,8 +4750,20 @@ export const IDL: Vault = {
|
|
4681
4750
|
"type": "publicKey"
|
4682
4751
|
},
|
4683
4752
|
{
|
4684
|
-
"name": "
|
4685
|
-
"type": "
|
4753
|
+
"name": "priorityPyth",
|
4754
|
+
"type": "i8"
|
4755
|
+
},
|
4756
|
+
{
|
4757
|
+
"name": "priorityChainlink",
|
4758
|
+
"type": "i8"
|
4759
|
+
},
|
4760
|
+
{
|
4761
|
+
"name": "prioritySwitchboard",
|
4762
|
+
"type": "i8"
|
4763
|
+
},
|
4764
|
+
{
|
4765
|
+
"name": "vaultTypeName",
|
4766
|
+
"type": "string"
|
4686
4767
|
}
|
4687
4768
|
]
|
4688
4769
|
}
|
@@ -4705,7 +4786,7 @@ export const IDL: Vault = {
|
|
4705
4786
|
"type": {
|
4706
4787
|
"array": [
|
4707
4788
|
"u128",
|
4708
|
-
|
4789
|
+
128
|
4709
4790
|
]
|
4710
4791
|
}
|
4711
4792
|
},
|
@@ -4714,7 +4795,7 @@ export const IDL: Vault = {
|
|
4714
4795
|
"type": {
|
4715
4796
|
"array": [
|
4716
4797
|
"u128",
|
4717
|
-
|
4798
|
+
128
|
4718
4799
|
]
|
4719
4800
|
}
|
4720
4801
|
},
|
@@ -4802,7 +4883,7 @@ export const IDL: Vault = {
|
|
4802
4883
|
"type": {
|
4803
4884
|
"array": [
|
4804
4885
|
"u128",
|
4805
|
-
|
4886
|
+
128
|
4806
4887
|
]
|
4807
4888
|
}
|
4808
4889
|
},
|
@@ -4886,7 +4967,7 @@ export const IDL: Vault = {
|
|
4886
4967
|
},
|
4887
4968
|
{
|
4888
4969
|
"name": "totalUshSupply",
|
4889
|
-
"type": "
|
4970
|
+
"type": "u128"
|
4890
4971
|
},
|
4891
4972
|
{
|
4892
4973
|
"name": "totalVaults",
|
@@ -4926,10 +5007,6 @@ export const IDL: Vault = {
|
|
4926
5007
|
"type": {
|
4927
5008
|
"kind": "struct",
|
4928
5009
|
"fields": [
|
4929
|
-
{
|
4930
|
-
"name": "vaultTypeName",
|
4931
|
-
"type": "string"
|
4932
|
-
},
|
4933
5010
|
{
|
4934
5011
|
"name": "collateralMint",
|
4935
5012
|
"type": "publicKey"
|
@@ -5002,12 +5079,6 @@ export const IDL: Vault = {
|
|
5002
5079
|
"name": "interestRatePerSecond",
|
5003
5080
|
"type": "u128"
|
5004
5081
|
},
|
5005
|
-
{
|
5006
|
-
"name": "firstVaultToRedeem",
|
5007
|
-
"type": {
|
5008
|
-
"option": "publicKey"
|
5009
|
-
}
|
5010
|
-
},
|
5011
5082
|
{
|
5012
5083
|
"name": "deprecated",
|
5013
5084
|
"type": "bool"
|
@@ -5019,6 +5090,16 @@ export const IDL: Vault = {
|
|
5019
5090
|
{
|
5020
5091
|
"name": "totalFeesAccumulatedCollateral",
|
5021
5092
|
"type": "u128"
|
5093
|
+
},
|
5094
|
+
{
|
5095
|
+
"name": "vaultTypeName",
|
5096
|
+
"type": "string"
|
5097
|
+
},
|
5098
|
+
{
|
5099
|
+
"name": "firstVaultToRedeem",
|
5100
|
+
"type": {
|
5101
|
+
"option": "publicKey"
|
5102
|
+
}
|
5022
5103
|
}
|
5023
5104
|
]
|
5024
5105
|
}
|
@@ -5045,12 +5126,14 @@ export const IDL: Vault = {
|
|
5045
5126
|
"type": "u64"
|
5046
5127
|
},
|
5047
5128
|
{
|
5048
|
-
"name": "
|
5049
|
-
"type":
|
5129
|
+
"name": "vaultStatus",
|
5130
|
+
"type": {
|
5131
|
+
"defined": "VaultStatus"
|
5132
|
+
}
|
5050
5133
|
},
|
5051
5134
|
{
|
5052
|
-
"name": "
|
5053
|
-
"type": "
|
5135
|
+
"name": "vaultType",
|
5136
|
+
"type": "publicKey"
|
5054
5137
|
},
|
5055
5138
|
{
|
5056
5139
|
"name": "bump",
|
@@ -5074,12 +5157,6 @@ export const IDL: Vault = {
|
|
5074
5157
|
"defined": "CurrencyType"
|
5075
5158
|
}
|
5076
5159
|
},
|
5077
|
-
{
|
5078
|
-
"name": "vaultStatus",
|
5079
|
-
"type": {
|
5080
|
-
"defined": "VaultStatus"
|
5081
|
-
}
|
5082
|
-
},
|
5083
5160
|
{
|
5084
5161
|
"name": "timeCreated",
|
5085
5162
|
"type": "u64"
|
@@ -5088,15 +5165,19 @@ export const IDL: Vault = {
|
|
5088
5165
|
"name": "timeLastInteraction",
|
5089
5166
|
"type": "u64"
|
5090
5167
|
},
|
5168
|
+
{
|
5169
|
+
"name": "vaultTypeName",
|
5170
|
+
"type": "string"
|
5171
|
+
},
|
5172
|
+
{
|
5173
|
+
"name": "pdaSalt",
|
5174
|
+
"type": "string"
|
5175
|
+
},
|
5091
5176
|
{
|
5092
5177
|
"name": "nextVaultToRedeem",
|
5093
5178
|
"type": {
|
5094
5179
|
"option": "publicKey"
|
5095
5180
|
}
|
5096
|
-
},
|
5097
|
-
{
|
5098
|
-
"name": "vaultType",
|
5099
|
-
"type": "publicKey"
|
5100
5181
|
}
|
5101
5182
|
]
|
5102
5183
|
}
|
@@ -5186,6 +5267,24 @@ export const IDL: Vault = {
|
|
5186
5267
|
"option": "publicKey"
|
5187
5268
|
}
|
5188
5269
|
},
|
5270
|
+
{
|
5271
|
+
"name": "priorityChainlink",
|
5272
|
+
"type": {
|
5273
|
+
"option": "i8"
|
5274
|
+
}
|
5275
|
+
},
|
5276
|
+
{
|
5277
|
+
"name": "priorityPyth",
|
5278
|
+
"type": {
|
5279
|
+
"option": "i8"
|
5280
|
+
}
|
5281
|
+
},
|
5282
|
+
{
|
5283
|
+
"name": "prioritySwitchboard",
|
5284
|
+
"type": {
|
5285
|
+
"option": "i8"
|
5286
|
+
}
|
5287
|
+
},
|
5189
5288
|
{
|
5190
5289
|
"name": "deprecated",
|
5191
5290
|
"type": {
|
@@ -5530,8 +5629,33 @@ export const IDL: Vault = {
|
|
5530
5629
|
},
|
5531
5630
|
{
|
5532
5631
|
"code": 6024,
|
5632
|
+
"name": "InvalidNameLength",
|
5633
|
+
"msg": "Name for new vault type must be length 16"
|
5634
|
+
},
|
5635
|
+
{
|
5636
|
+
"code": 6025,
|
5533
5637
|
"name": "UpdateVaultTypeBadMaxDebtExtended",
|
5534
5638
|
"msg": "New Max debt extended value is less than the current debt!"
|
5639
|
+
},
|
5640
|
+
{
|
5641
|
+
"code": 6026,
|
5642
|
+
"name": "UpdateVaultTypeNoEnabledOracles",
|
5643
|
+
"msg": "No Enabled Oracles!"
|
5644
|
+
},
|
5645
|
+
{
|
5646
|
+
"code": 6027,
|
5647
|
+
"name": "UpdateVaultTypeDuplicateOraclePriorities",
|
5648
|
+
"msg": "Duplicate Oracle Priorities"
|
5649
|
+
},
|
5650
|
+
{
|
5651
|
+
"code": 6028,
|
5652
|
+
"name": "UpdateVaultTypeInvalidOraclePriority",
|
5653
|
+
"msg": "Invalid Oracle Priority"
|
5654
|
+
},
|
5655
|
+
{
|
5656
|
+
"code": 6029,
|
5657
|
+
"name": "OracleUpdateFailed",
|
5658
|
+
"msg": "OracleUpdateFailed"
|
5535
5659
|
}
|
5536
5660
|
]
|
5537
5661
|
};
|
@@ -16,7 +16,8 @@ import {
|
|
16
16
|
getLiquidationPoolStatePublicKey,
|
17
17
|
getVaultSystemStatePublicKey,
|
18
18
|
} from '../Constants'
|
19
|
-
import
|
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
|
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
|
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
|
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
|
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
|
68
|
+
await sendAndConfirmWithDebug(provider.connection, transaction, [payer]).catch(parseAnchorErrors)
|
68
69
|
return poolPosition
|
69
70
|
}
|
70
71
|
|