hedge-web3 0.1.27 → 0.1.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.
- package/declarations/Constants.d.ts +1 -1
- package/declarations/idl/vault.d.ts +277 -126
- package/declarations/index.d.ts +3 -0
- package/declarations/instructions/claimLiquidationPoolPosition.d.ts +3 -2
- package/declarations/instructions/claimStakingPoolPosition.d.ts +3 -2
- package/declarations/instructions/closeLiquidationPoolPosition.d.ts +3 -2
- package/declarations/instructions/createStakingPool.d.ts +3 -2
- package/declarations/instructions/createVault.d.ts +6 -5
- package/declarations/instructions/depositLiquidationPool.d.ts +3 -2
- package/declarations/instructions/depositStakingPool.d.ts +3 -2
- package/declarations/instructions/depositVault.d.ts +3 -2
- package/declarations/instructions/initHedgeFoundation.d.ts +3 -2
- package/declarations/instructions/liquidateVault.d.ts +3 -2
- package/declarations/instructions/loanVault.d.ts +3 -2
- package/declarations/instructions/redeemVault.d.ts +3 -2
- package/declarations/instructions/refreshOraclePrice.d.ts +3 -2
- package/declarations/instructions/repayVault.d.ts +3 -2
- package/declarations/instructions/setHalted.d.ts +3 -2
- package/declarations/instructions/setVaultTypeStatus.d.ts +5 -0
- package/declarations/instructions/withdrawStakingPool.d.ts +3 -2
- package/declarations/instructions/withdrawVault.d.ts +3 -2
- package/declarations/state/VaultAccount.d.ts +8 -0
- package/declarations/utils/getLinkedListAccounts.d.ts +5 -0
- package/lib/Constants.js +1 -1
- package/lib/idl/vault.js +277 -126
- package/lib/index.js +3 -0
- package/lib/instructions/claimLiquidationPoolPosition.js +19 -22
- package/lib/instructions/claimStakingPoolPosition.js +19 -19
- package/lib/instructions/closeLiquidationPoolPosition.js +22 -22
- package/lib/instructions/createStakingPool.js +18 -19
- package/lib/instructions/createVault.js +28 -31
- package/lib/instructions/depositLiquidationPool.js +17 -18
- package/lib/instructions/depositStakingPool.js +16 -18
- package/lib/instructions/depositVault.js +31 -26
- package/lib/instructions/initHedgeFoundation.js +17 -19
- package/lib/instructions/initHedgeFoundationTokens.js +15 -15
- package/lib/instructions/liquidateVault.js +36 -32
- package/lib/instructions/loanVault.js +27 -22
- package/lib/instructions/redeemVault.js +28 -23
- package/lib/instructions/refreshOraclePrice.js +17 -17
- package/lib/instructions/repayVault.js +27 -22
- package/lib/instructions/setHalted.js +8 -9
- package/lib/instructions/setVaultTypeStatus.js +37 -0
- package/lib/instructions/withdrawStakingPool.js +22 -24
- package/lib/instructions/withdrawVault.js +30 -25
- package/lib/state/LiquidationPoolEra.js +3 -1
- package/lib/state/LiquidationPosition.js +0 -7
- package/lib/state/StakingPool.js +3 -4
- package/lib/state/VaultAccount.js +51 -1
- package/lib/utils/getLinkedListAccounts.js +139 -0
- package/package.json +4 -2
- package/src/Constants.ts +1 -1
- package/src/idl/vault.ts +554 -252
- package/src/index.ts +4 -0
- package/src/instructions/claimLiquidationPoolPosition.ts +39 -29
- package/src/instructions/claimStakingPoolPosition.ts +45 -25
- package/src/instructions/closeLiquidationPoolPosition.ts +62 -32
- package/src/instructions/createStakingPool.ts +38 -37
- package/src/instructions/createVault.ts +81 -125
- package/src/instructions/depositLiquidationPool.ts +45 -26
- package/src/instructions/depositStakingPool.ts +32 -24
- package/src/instructions/depositVault.ts +77 -31
- package/src/instructions/initHedgeFoundation.ts +42 -43
- package/src/instructions/initHedgeFoundationTokens.ts +38 -39
- package/src/instructions/liquidateVault.ts +96 -22
- package/src/instructions/loanVault.ts +84 -30
- package/src/instructions/redeemVault.ts +91 -32
- package/src/instructions/refreshOraclePrice.ts +41 -32
- package/src/instructions/repayVault.ts +74 -29
- package/src/instructions/setHalted.ts +32 -24
- package/src/instructions/setVaultTypeStatus.ts +58 -0
- package/src/instructions/withdrawStakingPool.ts +44 -30
- package/src/instructions/withdrawVault.ts +87 -33
- package/src/state/LiquidationPoolEra.ts +4 -3
- package/src/state/LiquidationPosition.ts +0 -27
- package/src/state/StakingPool.ts +4 -7
- package/src/state/StakingPoolPosition.ts +2 -3
- package/src/state/VaultAccount.ts +65 -8
- package/src/state/VaultHistoryEvent.ts +1 -2
- package/src/utils/getLinkedListAccounts.ts +157 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
|
-
export declare const HEDGE_PROGRAM_ID = "
|
2
|
+
export declare const HEDGE_PROGRAM_ID = "HDG3uyafYaKxSYRW37ZBTdxaUCoyzaqbuirYucAeaPFY";
|
3
3
|
export declare const HEDGE_PROGRAM_PUBLICKEY: PublicKey;
|
4
4
|
export declare const CHAINLINK_SOL_USD_ID = "FmAmfoyPXiA8Vhhe6MZTr3U6rZfEZ1ctEHay1ysqCqcf";
|
5
5
|
export declare const CHAINLINK_SOL_USD_PUBLICKEY: PublicKey;
|
@@ -373,10 +373,6 @@ export declare type Vault = {
|
|
373
373
|
"name": "bump1";
|
374
374
|
"type": "u8";
|
375
375
|
},
|
376
|
-
{
|
377
|
-
"name": "poolSeedPhraseInput";
|
378
|
-
"type": "string";
|
379
|
-
},
|
380
376
|
{
|
381
377
|
"name": "totalRewards";
|
382
378
|
"type": "u64";
|
@@ -624,11 +620,6 @@ export declare type Vault = {
|
|
624
620
|
"isMut": true;
|
625
621
|
"isSigner": false;
|
626
622
|
},
|
627
|
-
{
|
628
|
-
"name": "vault";
|
629
|
-
"isMut": true;
|
630
|
-
"isSigner": false;
|
631
|
-
},
|
632
623
|
{
|
633
624
|
"name": "vaultAssociatedTokenAccount";
|
634
625
|
"isMut": true;
|
@@ -669,6 +660,26 @@ export declare type Vault = {
|
|
669
660
|
"isMut": true;
|
670
661
|
"isSigner": false;
|
671
662
|
},
|
663
|
+
{
|
664
|
+
"name": "oldSmallerVaultInfo";
|
665
|
+
"isMut": true;
|
666
|
+
"isSigner": false;
|
667
|
+
},
|
668
|
+
{
|
669
|
+
"name": "newSmallerVaultInfo";
|
670
|
+
"isMut": true;
|
671
|
+
"isSigner": false;
|
672
|
+
},
|
673
|
+
{
|
674
|
+
"name": "newLargerVaultInfo";
|
675
|
+
"isMut": false;
|
676
|
+
"isSigner": false;
|
677
|
+
},
|
678
|
+
{
|
679
|
+
"name": "vault";
|
680
|
+
"isMut": true;
|
681
|
+
"isSigner": false;
|
682
|
+
},
|
672
683
|
{
|
673
684
|
"name": "tokenProgram";
|
674
685
|
"isMut": false;
|
@@ -821,11 +832,6 @@ export declare type Vault = {
|
|
821
832
|
"isMut": true;
|
822
833
|
"isSigner": false;
|
823
834
|
},
|
824
|
-
{
|
825
|
-
"name": "vaultAccount";
|
826
|
-
"isMut": true;
|
827
|
-
"isSigner": false;
|
828
|
-
},
|
829
835
|
{
|
830
836
|
"name": "vaultAssociatedTokenAccount";
|
831
837
|
"isMut": true;
|
@@ -861,6 +867,26 @@ export declare type Vault = {
|
|
861
867
|
"isMut": true;
|
862
868
|
"isSigner": false;
|
863
869
|
},
|
870
|
+
{
|
871
|
+
"name": "oldSmallerVaultInfo";
|
872
|
+
"isMut": true;
|
873
|
+
"isSigner": false;
|
874
|
+
},
|
875
|
+
{
|
876
|
+
"name": "newSmallerVaultInfo";
|
877
|
+
"isMut": true;
|
878
|
+
"isSigner": false;
|
879
|
+
},
|
880
|
+
{
|
881
|
+
"name": "newLargerVaultInfo";
|
882
|
+
"isMut": false;
|
883
|
+
"isSigner": false;
|
884
|
+
},
|
885
|
+
{
|
886
|
+
"name": "vaultAccount";
|
887
|
+
"isMut": true;
|
888
|
+
"isSigner": false;
|
889
|
+
},
|
864
890
|
{
|
865
891
|
"name": "systemProgram";
|
866
892
|
"isMut": false;
|
@@ -901,11 +927,6 @@ export declare type Vault = {
|
|
901
927
|
"isMut": true;
|
902
928
|
"isSigner": false;
|
903
929
|
},
|
904
|
-
{
|
905
|
-
"name": "vault";
|
906
|
-
"isMut": true;
|
907
|
-
"isSigner": false;
|
908
|
-
},
|
909
930
|
{
|
910
931
|
"name": "vaultAssociatedTokenAccount";
|
911
932
|
"isMut": true;
|
@@ -946,6 +967,26 @@ export declare type Vault = {
|
|
946
967
|
"isMut": true;
|
947
968
|
"isSigner": false;
|
948
969
|
},
|
970
|
+
{
|
971
|
+
"name": "oldSmallerVaultInfo";
|
972
|
+
"isMut": true;
|
973
|
+
"isSigner": false;
|
974
|
+
},
|
975
|
+
{
|
976
|
+
"name": "newSmallerVaultInfo";
|
977
|
+
"isMut": true;
|
978
|
+
"isSigner": false;
|
979
|
+
},
|
980
|
+
{
|
981
|
+
"name": "newLargerVaultInfo";
|
982
|
+
"isMut": false;
|
983
|
+
"isSigner": false;
|
984
|
+
},
|
985
|
+
{
|
986
|
+
"name": "vault";
|
987
|
+
"isMut": true;
|
988
|
+
"isSigner": false;
|
989
|
+
},
|
949
990
|
{
|
950
991
|
"name": "systemProgram";
|
951
992
|
"isMut": false;
|
@@ -991,11 +1032,6 @@ export declare type Vault = {
|
|
991
1032
|
"isMut": true;
|
992
1033
|
"isSigner": false;
|
993
1034
|
},
|
994
|
-
{
|
995
|
-
"name": "vaultAccount";
|
996
|
-
"isMut": true;
|
997
|
-
"isSigner": false;
|
998
|
-
},
|
999
1035
|
{
|
1000
1036
|
"name": "vaultAssociatedTokenAccount";
|
1001
1037
|
"isMut": true;
|
@@ -1061,6 +1097,26 @@ export declare type Vault = {
|
|
1061
1097
|
"isMut": true;
|
1062
1098
|
"isSigner": false;
|
1063
1099
|
},
|
1100
|
+
{
|
1101
|
+
"name": "oldSmallerVaultInfo";
|
1102
|
+
"isMut": true;
|
1103
|
+
"isSigner": false;
|
1104
|
+
},
|
1105
|
+
{
|
1106
|
+
"name": "newSmallerVaultInfo";
|
1107
|
+
"isMut": true;
|
1108
|
+
"isSigner": false;
|
1109
|
+
},
|
1110
|
+
{
|
1111
|
+
"name": "newLargerVaultInfo";
|
1112
|
+
"isMut": false;
|
1113
|
+
"isSigner": false;
|
1114
|
+
},
|
1115
|
+
{
|
1116
|
+
"name": "vaultAccount";
|
1117
|
+
"isMut": true;
|
1118
|
+
"isSigner": false;
|
1119
|
+
},
|
1064
1120
|
{
|
1065
1121
|
"name": "associatedTokenProgram";
|
1066
1122
|
"isMut": false;
|
@@ -1152,11 +1208,6 @@ export declare type Vault = {
|
|
1152
1208
|
"isMut": true;
|
1153
1209
|
"isSigner": false;
|
1154
1210
|
},
|
1155
|
-
{
|
1156
|
-
"name": "vaultAccount";
|
1157
|
-
"isMut": true;
|
1158
|
-
"isSigner": false;
|
1159
|
-
},
|
1160
1211
|
{
|
1161
1212
|
"name": "vaultAssociatedTokenAccount";
|
1162
1213
|
"isMut": true;
|
@@ -1192,6 +1243,26 @@ export declare type Vault = {
|
|
1192
1243
|
"isMut": true;
|
1193
1244
|
"isSigner": false;
|
1194
1245
|
},
|
1246
|
+
{
|
1247
|
+
"name": "oldSmallerVaultInfo";
|
1248
|
+
"isMut": true;
|
1249
|
+
"isSigner": false;
|
1250
|
+
},
|
1251
|
+
{
|
1252
|
+
"name": "newSmallerVaultInfo";
|
1253
|
+
"isMut": true;
|
1254
|
+
"isSigner": false;
|
1255
|
+
},
|
1256
|
+
{
|
1257
|
+
"name": "newLargerVaultInfo";
|
1258
|
+
"isMut": false;
|
1259
|
+
"isSigner": false;
|
1260
|
+
},
|
1261
|
+
{
|
1262
|
+
"name": "vaultAccount";
|
1263
|
+
"isMut": true;
|
1264
|
+
"isSigner": false;
|
1265
|
+
},
|
1195
1266
|
{
|
1196
1267
|
"name": "systemProgram";
|
1197
1268
|
"isMut": false;
|
@@ -1411,11 +1482,6 @@ export declare type Vault = {
|
|
1411
1482
|
"isMut": true;
|
1412
1483
|
"isSigner": false;
|
1413
1484
|
},
|
1414
|
-
{
|
1415
|
-
"name": "vault";
|
1416
|
-
"isMut": true;
|
1417
|
-
"isSigner": false;
|
1418
|
-
},
|
1419
1485
|
{
|
1420
1486
|
"name": "vaultAssociatedTokenAccount";
|
1421
1487
|
"isMut": true;
|
@@ -1451,6 +1517,26 @@ export declare type Vault = {
|
|
1451
1517
|
"isMut": true;
|
1452
1518
|
"isSigner": false;
|
1453
1519
|
},
|
1520
|
+
{
|
1521
|
+
"name": "oldSmallerVaultInfo";
|
1522
|
+
"isMut": true;
|
1523
|
+
"isSigner": false;
|
1524
|
+
},
|
1525
|
+
{
|
1526
|
+
"name": "newSmallerVaultInfo";
|
1527
|
+
"isMut": true;
|
1528
|
+
"isSigner": false;
|
1529
|
+
},
|
1530
|
+
{
|
1531
|
+
"name": "newLargerVaultInfo";
|
1532
|
+
"isMut": false;
|
1533
|
+
"isSigner": false;
|
1534
|
+
},
|
1535
|
+
{
|
1536
|
+
"name": "vault";
|
1537
|
+
"isMut": true;
|
1538
|
+
"isSigner": false;
|
1539
|
+
},
|
1454
1540
|
{
|
1455
1541
|
"name": "systemProgram";
|
1456
1542
|
"isMut": false;
|
@@ -1472,6 +1558,32 @@ export declare type Vault = {
|
|
1472
1558
|
"type": "i64";
|
1473
1559
|
}
|
1474
1560
|
];
|
1561
|
+
},
|
1562
|
+
{
|
1563
|
+
"name": "setVaultTypeStatus";
|
1564
|
+
"accounts": [
|
1565
|
+
{
|
1566
|
+
"name": "payer";
|
1567
|
+
"isMut": true;
|
1568
|
+
"isSigner": true;
|
1569
|
+
},
|
1570
|
+
{
|
1571
|
+
"name": "vaultSystemState";
|
1572
|
+
"isMut": true;
|
1573
|
+
"isSigner": false;
|
1574
|
+
},
|
1575
|
+
{
|
1576
|
+
"name": "vaultType";
|
1577
|
+
"isMut": true;
|
1578
|
+
"isSigner": false;
|
1579
|
+
}
|
1580
|
+
];
|
1581
|
+
"args": [
|
1582
|
+
{
|
1583
|
+
"name": "deprecated";
|
1584
|
+
"type": "bool";
|
1585
|
+
}
|
1586
|
+
];
|
1475
1587
|
}
|
1476
1588
|
];
|
1477
1589
|
"accounts": [
|
@@ -1685,68 +1797,6 @@ export declare type Vault = {
|
|
1685
1797
|
];
|
1686
1798
|
};
|
1687
1799
|
},
|
1688
|
-
{
|
1689
|
-
"name": "stakingPool";
|
1690
|
-
"type": {
|
1691
|
-
"kind": "struct";
|
1692
|
-
"fields": [
|
1693
|
-
{
|
1694
|
-
"name": "halfLifeInDays";
|
1695
|
-
"type": "u64";
|
1696
|
-
},
|
1697
|
-
{
|
1698
|
-
"name": "deposits";
|
1699
|
-
"type": "u64";
|
1700
|
-
},
|
1701
|
-
{
|
1702
|
-
"name": "startTime";
|
1703
|
-
"type": "u64";
|
1704
|
-
},
|
1705
|
-
{
|
1706
|
-
"name": "lastTransactionTime";
|
1707
|
-
"type": "u64";
|
1708
|
-
},
|
1709
|
-
{
|
1710
|
-
"name": "hedgeRewardAccumulator";
|
1711
|
-
"type": "u128";
|
1712
|
-
},
|
1713
|
-
{
|
1714
|
-
"name": "ushFeeAccumulator";
|
1715
|
-
"type": "u128";
|
1716
|
-
},
|
1717
|
-
{
|
1718
|
-
"name": "totalHedgeReward";
|
1719
|
-
"type": "u64";
|
1720
|
-
},
|
1721
|
-
{
|
1722
|
-
"name": "stakedTokenMint";
|
1723
|
-
"type": "publicKey";
|
1724
|
-
},
|
1725
|
-
{
|
1726
|
-
"name": "seedPhrase";
|
1727
|
-
"type": {
|
1728
|
-
"array": [
|
1729
|
-
"u8",
|
1730
|
-
12
|
1731
|
-
];
|
1732
|
-
};
|
1733
|
-
},
|
1734
|
-
{
|
1735
|
-
"name": "collateralFeeAccumulator";
|
1736
|
-
"type": {
|
1737
|
-
"array": [
|
1738
|
-
"u128",
|
1739
|
-
32
|
1740
|
-
];
|
1741
|
-
};
|
1742
|
-
},
|
1743
|
-
{
|
1744
|
-
"name": "bump";
|
1745
|
-
"type": "u8";
|
1746
|
-
}
|
1747
|
-
];
|
1748
|
-
};
|
1749
|
-
},
|
1750
1800
|
{
|
1751
1801
|
"name": "stakingPoolPosition";
|
1752
1802
|
"type": {
|
@@ -1812,65 +1862,63 @@ export declare type Vault = {
|
|
1812
1862
|
};
|
1813
1863
|
},
|
1814
1864
|
{
|
1815
|
-
"name": "
|
1865
|
+
"name": "stakingPool";
|
1816
1866
|
"type": {
|
1817
1867
|
"kind": "struct";
|
1818
1868
|
"fields": [
|
1819
1869
|
{
|
1820
|
-
"name": "
|
1821
|
-
"type": "
|
1822
|
-
},
|
1823
|
-
{
|
1824
|
-
"name": "pdaSalt";
|
1825
|
-
"type": "string";
|
1826
|
-
},
|
1827
|
-
{
|
1828
|
-
"name": "bump";
|
1829
|
-
"type": "u8";
|
1870
|
+
"name": "halfLifeInDays";
|
1871
|
+
"type": "u64";
|
1830
1872
|
},
|
1831
1873
|
{
|
1832
|
-
"name": "
|
1874
|
+
"name": "deposits";
|
1833
1875
|
"type": "u64";
|
1834
1876
|
},
|
1835
1877
|
{
|
1836
|
-
"name": "
|
1878
|
+
"name": "startTime";
|
1837
1879
|
"type": "u64";
|
1838
1880
|
},
|
1839
1881
|
{
|
1840
|
-
"name": "
|
1882
|
+
"name": "lastTransactionTime";
|
1841
1883
|
"type": "u64";
|
1842
1884
|
},
|
1843
1885
|
{
|
1844
|
-
"name": "
|
1886
|
+
"name": "hedgeRewardAccumulator";
|
1845
1887
|
"type": "u128";
|
1846
1888
|
},
|
1847
1889
|
{
|
1848
|
-
"name": "
|
1890
|
+
"name": "ushFeeAccumulator";
|
1849
1891
|
"type": "u128";
|
1850
1892
|
},
|
1851
1893
|
{
|
1852
|
-
"name": "
|
1853
|
-
"type": "
|
1894
|
+
"name": "totalHedgeReward";
|
1895
|
+
"type": "u64";
|
1854
1896
|
},
|
1855
1897
|
{
|
1856
|
-
"name": "
|
1857
|
-
"type":
|
1858
|
-
"defined": "CurrencyType";
|
1859
|
-
};
|
1898
|
+
"name": "stakedTokenMint";
|
1899
|
+
"type": "publicKey";
|
1860
1900
|
},
|
1861
1901
|
{
|
1862
|
-
"name": "
|
1902
|
+
"name": "seedPhrase";
|
1863
1903
|
"type": {
|
1864
|
-
"
|
1904
|
+
"array": [
|
1905
|
+
"u8",
|
1906
|
+
12
|
1907
|
+
];
|
1865
1908
|
};
|
1866
1909
|
},
|
1867
1910
|
{
|
1868
|
-
"name": "
|
1869
|
-
"type":
|
1911
|
+
"name": "collateralFeeAccumulator";
|
1912
|
+
"type": {
|
1913
|
+
"array": [
|
1914
|
+
"u128",
|
1915
|
+
32
|
1916
|
+
];
|
1917
|
+
};
|
1870
1918
|
},
|
1871
1919
|
{
|
1872
|
-
"name": "
|
1873
|
-
"type": "
|
1920
|
+
"name": "bump";
|
1921
|
+
"type": "u8";
|
1874
1922
|
}
|
1875
1923
|
];
|
1876
1924
|
};
|
@@ -2048,6 +2096,10 @@ export declare type Vault = {
|
|
2048
2096
|
"name": "canBeRedeemed";
|
2049
2097
|
"type": "bool";
|
2050
2098
|
},
|
2099
|
+
{
|
2100
|
+
"name": "emergencyModeThreshold";
|
2101
|
+
"type": "u64";
|
2102
|
+
},
|
2051
2103
|
{
|
2052
2104
|
"name": "cumulativeRate";
|
2053
2105
|
"type": "u128";
|
@@ -2059,6 +2111,90 @@ export declare type Vault = {
|
|
2059
2111
|
{
|
2060
2112
|
"name": "interestRatePerSecond";
|
2061
2113
|
"type": "u128";
|
2114
|
+
},
|
2115
|
+
{
|
2116
|
+
"name": "firstVaultToRedeem";
|
2117
|
+
"type": {
|
2118
|
+
"option": "publicKey";
|
2119
|
+
};
|
2120
|
+
},
|
2121
|
+
{
|
2122
|
+
"name": "deprecated";
|
2123
|
+
"type": "bool";
|
2124
|
+
}
|
2125
|
+
];
|
2126
|
+
};
|
2127
|
+
},
|
2128
|
+
{
|
2129
|
+
"name": "vault";
|
2130
|
+
"type": {
|
2131
|
+
"kind": "struct";
|
2132
|
+
"fields": [
|
2133
|
+
{
|
2134
|
+
"name": "vaultOwner";
|
2135
|
+
"type": "publicKey";
|
2136
|
+
},
|
2137
|
+
{
|
2138
|
+
"name": "vaultNumber";
|
2139
|
+
"type": "u64";
|
2140
|
+
},
|
2141
|
+
{
|
2142
|
+
"name": "deposited";
|
2143
|
+
"type": "u64";
|
2144
|
+
},
|
2145
|
+
{
|
2146
|
+
"name": "denormalizedDebt";
|
2147
|
+
"type": "u64";
|
2148
|
+
},
|
2149
|
+
{
|
2150
|
+
"name": "collateralType";
|
2151
|
+
"type": "string";
|
2152
|
+
},
|
2153
|
+
{
|
2154
|
+
"name": "pdaSalt";
|
2155
|
+
"type": "string";
|
2156
|
+
},
|
2157
|
+
{
|
2158
|
+
"name": "bump";
|
2159
|
+
"type": "u8";
|
2160
|
+
},
|
2161
|
+
{
|
2162
|
+
"name": "vaultVersion";
|
2163
|
+
"type": "u64";
|
2164
|
+
},
|
2165
|
+
{
|
2166
|
+
"name": "debtProductSnapshotBytes";
|
2167
|
+
"type": "u128";
|
2168
|
+
},
|
2169
|
+
{
|
2170
|
+
"name": "collateralAccumulatorSnapshotBytes";
|
2171
|
+
"type": "u128";
|
2172
|
+
},
|
2173
|
+
{
|
2174
|
+
"name": "debtType";
|
2175
|
+
"type": {
|
2176
|
+
"defined": "CurrencyType";
|
2177
|
+
};
|
2178
|
+
},
|
2179
|
+
{
|
2180
|
+
"name": "vaultStatus";
|
2181
|
+
"type": {
|
2182
|
+
"defined": "VaultStatus";
|
2183
|
+
};
|
2184
|
+
},
|
2185
|
+
{
|
2186
|
+
"name": "timeCreated";
|
2187
|
+
"type": "u64";
|
2188
|
+
},
|
2189
|
+
{
|
2190
|
+
"name": "timeLastInteraction";
|
2191
|
+
"type": "u64";
|
2192
|
+
},
|
2193
|
+
{
|
2194
|
+
"name": "nextVaultToRedeem";
|
2195
|
+
"type": {
|
2196
|
+
"option": "publicKey";
|
2197
|
+
};
|
2062
2198
|
}
|
2063
2199
|
];
|
2064
2200
|
};
|
@@ -2348,12 +2484,12 @@ export declare type Vault = {
|
|
2348
2484
|
{
|
2349
2485
|
"code": 6005;
|
2350
2486
|
"name": "VaultClosed";
|
2351
|
-
"msg": "Vault
|
2487
|
+
"msg": "Vault closed";
|
2352
2488
|
},
|
2353
2489
|
{
|
2354
2490
|
"code": 6006;
|
2355
2491
|
"name": "VaultNotSubjectToLiquidation";
|
2356
|
-
"msg": "Vault
|
2492
|
+
"msg": "Vault cannot be liquidated. It is collateralized.";
|
2357
2493
|
},
|
2358
2494
|
{
|
2359
2495
|
"code": 6007;
|
@@ -2414,6 +2550,21 @@ export declare type Vault = {
|
|
2414
2550
|
"code": 6018;
|
2415
2551
|
"name": "SystemHalted";
|
2416
2552
|
"msg": "System is currently halted. No actions may be taken at this time.";
|
2553
|
+
},
|
2554
|
+
{
|
2555
|
+
"code": 6019;
|
2556
|
+
"name": "EntireVaultRedeem";
|
2557
|
+
"msg": "Entire vault must be redeemed at this time.";
|
2558
|
+
},
|
2559
|
+
{
|
2560
|
+
"code": 6020;
|
2561
|
+
"name": "RedeemingNonHighestCollateralRatioVault";
|
2562
|
+
"msg": "Can only redeem highest collateral ratio vault in system.";
|
2563
|
+
},
|
2564
|
+
{
|
2565
|
+
"code": 6021;
|
2566
|
+
"name": "VaultTypeDeprecated";
|
2567
|
+
"msg": "Vaults of this collateral type are deprecated. No new vaults can be created and no new debt will be issued for this collateral type.";
|
2417
2568
|
}
|
2418
2569
|
];
|
2419
2570
|
};
|
package/declarations/index.d.ts
CHANGED
@@ -16,6 +16,7 @@ export * from './instructions/refreshOraclePrice';
|
|
16
16
|
export * from './instructions/initHedgeFoundation';
|
17
17
|
export * from './instructions/initHedgeFoundationTokens';
|
18
18
|
export * from './instructions/setHalted';
|
19
|
+
export * from './instructions/setVaultTypeStatus';
|
19
20
|
export * from './HedgeDecimal';
|
20
21
|
export * from './Constants';
|
21
22
|
export * from './state/VaultAccount';
|
@@ -25,3 +26,5 @@ export * from './state/StakingPoolPosition';
|
|
25
26
|
export * from './state/LiquidationPoolEra';
|
26
27
|
export * from './state/LiquidationPoolState';
|
27
28
|
export * from './state/LiquidationPosition';
|
29
|
+
export * from './utils/getLinkedListAccounts';
|
30
|
+
export * from './idl/vault';
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Program, Provider } from '@project-serum/anchor';
|
2
2
|
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
|
3
|
-
|
4
|
-
export declare function
|
3
|
+
import { Vault } from 'idl/vault';
|
4
|
+
export declare function claimLiquidationPoolPosition(program: Program<Vault>, provider: Provider, poolPosition: PublicKey, payer: Signer, collateralType: string, overrideStartTime?: number): Promise<PublicKey>;
|
5
|
+
export declare function claimLiquidationPoolPositionInstruction(program: Program<Vault>, poolState: PublicKey, poolAssociatedTokenAccount: PublicKey, vaultTypeAccount: PublicKey, collateralMint: PublicKey, poolPosition: PublicKey, payer: PublicKey, payerAssociatedTokenAccount: PublicKey, overrideStartTime?: number): Promise<TransactionInstruction>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Program, Provider } from '@project-serum/anchor';
|
2
2
|
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
|
3
|
-
|
4
|
-
export declare function
|
3
|
+
import { Vault } from 'idl/vault';
|
4
|
+
export declare function claimStakingPoolPosition(program: Program<Vault>, provider: Provider, poolPosition: PublicKey, payer: Signer, collateralType: string): Promise<PublicKey>;
|
5
|
+
export declare function claimStakingPoolPositionInstruction(program: Program<Vault>, feePool: PublicKey, feePoolAssociatedTokenAccount: PublicKey, stakedTokenMint: PublicKey, vaultTypeAccount: PublicKey, collateralMint: PublicKey, poolPosition: PublicKey, payer: PublicKey, payerAssociatedTokenAccount: PublicKey): Promise<TransactionInstruction>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Program, Provider } from '@project-serum/anchor';
|
2
2
|
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
|
3
|
-
|
4
|
-
export declare function
|
3
|
+
import { Vault } from 'idl/vault';
|
4
|
+
export declare function closeLiquidationPoolPosition(program: Program<Vault>, provider: Provider, poolPosition: PublicKey, payer: Signer, overrideStartTime?: number): Promise<PublicKey>;
|
5
|
+
export declare function closeLiquidationPoolPositionInstruction(program: Program<Vault>, poolEra: PublicKey, poolPosition: PublicKey, payerPublicKey: PublicKey, payerUshAccount: PublicKey, payerAssociatedHedgeAccount: PublicKey, communityAssociatedHedgeTokenAccount: PublicKey, overrideStartTime?: number): Promise<TransactionInstruction>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Program, Provider } from '@project-serum/anchor';
|
2
2
|
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
|
3
|
-
|
4
|
-
export declare function
|
3
|
+
import { Vault } from 'idl/vault';
|
4
|
+
export declare function createStakingPool(program: Program<Vault>, provider: Provider, payer: Signer, mintPublicKey: PublicKey, hedgeTokensToBeMinted: number, overrideStartTime?: number): Promise<PublicKey>;
|
5
|
+
export declare function createStakingPoolInstruction(program: Program<Vault>, payerPublicKey: PublicKey, mintPublicKey: PublicKey, hedgeTokensToBeMinted: number, overrideStartTime?: number): Promise<TransactionInstruction>;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { Program, Provider } from
|
2
|
-
import { PublicKey, Signer, Transaction, TransactionInstruction } from
|
3
|
-
|
4
|
-
export declare function
|
5
|
-
export declare function
|
1
|
+
import { Program, Provider } from '@project-serum/anchor';
|
2
|
+
import { PublicKey, Signer, Transaction, TransactionInstruction } from '@solana/web3.js';
|
3
|
+
import { Vault } from 'idl/vault';
|
4
|
+
export declare function createVault(program: Program<Vault>, provider: Provider, payer: Signer, collateralType: string, depositAmount: number, overrideTime?: number): Promise<PublicKey>;
|
5
|
+
export declare function buildCreateVaultTransaction(program: Program<Vault>, payerPublicKey: PublicKey, collateralType: string, depositAmount: number, overrideTime?: number): Promise<[Transaction, Signer[], PublicKey]>;
|
6
|
+
export declare function createVaultInstruction(program: Program<Vault>, salt: string, payerPublicKey: PublicKey, payerTokenAccountPublicKey: PublicKey, vaultPublicKey: PublicKey, vaultAssociatedTokenAccount: PublicKey, feePool: PublicKey, feePoolAssociatedUshTokenAccount: PublicKey, vaultTypeAccount: PublicKey, collateralMint: PublicKey, historyPublicKey: PublicKey, ushMintPublickey: PublicKey, depositAmount: number, overrideTime?: number): Promise<TransactionInstruction>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Program, Provider } from '@project-serum/anchor';
|
2
2
|
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
|
3
|
-
|
4
|
-
export declare function
|
3
|
+
import { Vault } from 'idl/vault';
|
4
|
+
export declare function depositLiquidationPool(program: Program<Vault>, provider: Provider, payer: Signer, depositAmount: number, overrideStartTime?: number): Promise<PublicKey>;
|
5
|
+
export declare function depositLiquidationPoolInstruction(program: Program<Vault>, payerPublicKey: PublicKey, payerUshAccount: PublicKey, poolPositionPublicKey: PublicKey, depositAmount: number, overrideStartTime?: number): Promise<TransactionInstruction>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Program, Provider } from '@project-serum/anchor';
|
2
2
|
import { PublicKey, Signer, TransactionInstruction } from '@solana/web3.js';
|
3
|
-
|
4
|
-
export declare function
|
3
|
+
import { Vault } from 'idl/vault';
|
4
|
+
export declare function depositStakingPool(program: Program<Vault>, provider: Provider, payer: Signer, mintPublicKey: PublicKey, depositAmount: number, overrideStartTime?: number): Promise<PublicKey>;
|
5
|
+
export declare function depositStakingPoolInstruction(program: Program<Vault>, payerPublicKey: PublicKey, poolPositionPublicKey: PublicKey, stakedTokenMintPublicKey: PublicKey, depositAmount: number, overrideStartTime?: number): Promise<TransactionInstruction>;
|