hedge-web3 0.2.31 → 0.3.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.
- package/declarations/Constants.d.ts +0 -12
- package/declarations/HedgeConstants.d.ts +76 -0
- package/declarations/idl/pyth.d.ts +1 -1
- package/declarations/idl/switchboard.d.ts +1 -1
- package/declarations/idl/vault.d.ts +60 -744
- package/declarations/index.d.ts +1 -10
- package/declarations/instructions/claimLiquidationPoolPosition.d.ts +1 -1
- package/declarations/instructions/claimStakingPoolPosition.d.ts +1 -1
- package/declarations/instructions/closeClaimedLiquidationPoolPosition.d.ts +1 -1
- package/declarations/instructions/closeLiquidationPoolPosition.d.ts +1 -1
- package/declarations/instructions/createReferralAccount.d.ts +3 -3
- package/declarations/instructions/createStakingPool.d.ts +1 -1
- package/declarations/instructions/createUserReferralAccount.d.ts +1 -1
- package/declarations/instructions/createVault.d.ts +1 -2
- package/declarations/instructions/depositLiquidationPool.d.ts +1 -2
- package/declarations/instructions/depositStakingPool.d.ts +1 -2
- package/declarations/instructions/depositVault.d.ts +1 -2
- package/declarations/instructions/initHedgeFoundation.d.ts +1 -1
- package/declarations/instructions/initHedgeFoundationTokens.d.ts +1 -1
- package/declarations/instructions/liquidateVault.d.ts +1 -1
- package/declarations/instructions/loanVault.d.ts +1 -2
- package/declarations/instructions/psmEditAccount.d.ts +1 -2
- package/declarations/instructions/psmMintUsh.d.ts +1 -2
- package/declarations/instructions/psmRedeemUsh.d.ts +1 -2
- package/declarations/instructions/redeemVault.d.ts +1 -2
- package/declarations/instructions/referralClaimFees.d.ts +3 -3
- package/declarations/instructions/refreshOraclePrice.d.ts +1 -1
- package/declarations/instructions/repayVault.d.ts +1 -2
- package/declarations/instructions/setHalted.d.ts +1 -1
- package/declarations/instructions/transferVault.d.ts +1 -1
- package/declarations/instructions/updateReferralAccount.d.ts +1 -2
- package/declarations/instructions/updateReferralState.d.ts +1 -2
- package/declarations/instructions/updateVaultType.d.ts +1 -2
- package/declarations/instructions/withdrawStakingPool.d.ts +1 -1
- package/declarations/instructions/withdrawVault.d.ts +1 -2
- package/declarations/state/VaultAccount.d.ts +2 -3
- package/declarations/utils/getLinkedListAccounts.d.ts +1 -2
- package/lib/Constants.js +27 -54
- package/lib/HedgeConstants.js +170 -0
- package/lib/HedgeDecimal.js +1 -2
- package/lib/StakingPools.js +5 -1
- package/lib/Vaults.js +5 -1
- package/lib/idl/vault.js +60 -744
- package/lib/index.js +6 -11
- package/lib/instructions/claimLiquidationPoolPosition.js +7 -8
- package/lib/instructions/claimStakingPoolPosition.js +7 -8
- package/lib/instructions/closeClaimedLiquidationPoolPosition.js +2 -3
- package/lib/instructions/closeLiquidationPoolPosition.js +16 -17
- package/lib/instructions/createReferralAccount.js +13 -17
- package/lib/instructions/createStakingPool.js +10 -11
- package/lib/instructions/createUserReferralAccount.js +9 -10
- package/lib/instructions/createVault.js +20 -21
- package/lib/instructions/depositLiquidationPool.js +12 -13
- package/lib/instructions/depositStakingPool.js +8 -9
- package/lib/instructions/depositVault.js +10 -11
- package/lib/instructions/initHedgeFoundation.js +10 -11
- package/lib/instructions/initHedgeFoundationTokens.js +7 -8
- package/lib/instructions/liquidateVault.js +12 -19
- package/lib/instructions/loanVault.js +16 -23
- package/lib/instructions/psmEditAccount.js +11 -11
- package/lib/instructions/psmMintUsh.js +18 -19
- package/lib/instructions/psmRedeemUsh.js +18 -19
- package/lib/instructions/redeemVault.js +10 -11
- package/lib/instructions/referralClaimFees.js +12 -16
- package/lib/instructions/refreshOraclePrice.js +9 -9
- package/lib/instructions/repayVault.js +12 -13
- package/lib/instructions/setHalted.js +4 -5
- package/lib/instructions/transferVault.js +2 -3
- package/lib/instructions/updateReferralAccount.js +6 -7
- package/lib/instructions/updateReferralState.js +6 -7
- package/lib/instructions/updateVaultType.js +5 -6
- package/lib/instructions/withdrawStakingPool.js +14 -15
- package/lib/instructions/withdrawVault.js +8 -9
- package/lib/state/VaultAccount.js +22 -8
- package/lib/state/VaultHistoryEvent.js +2 -2
- package/lib/utils/Errors.js +2 -3
- package/lib/utils/getLinkedListAccounts.js +2 -3
- package/lib/utils/sendAndConfirmWithDebug.js +1 -1
- package/package.json +9 -8
- package/src/{Constants.ts → HedgeConstants.ts} +13 -43
- package/src/idl/vault.ts +2382 -3750
- package/src/index.ts +3 -10
- package/src/instructions/claimLiquidationPoolPosition.ts +2 -2
- package/src/instructions/claimStakingPoolPosition.ts +2 -2
- package/src/instructions/closeClaimedLiquidationPoolPosition.ts +1 -1
- package/src/instructions/closeLiquidationPoolPosition.ts +2 -2
- package/src/instructions/createReferralAccount.ts +11 -15
- package/src/instructions/createStakingPool.ts +11 -4
- package/src/instructions/createUserReferralAccount.ts +2 -2
- package/src/instructions/createVault.ts +2 -2
- package/src/instructions/depositLiquidationPool.ts +2 -2
- package/src/instructions/depositStakingPool.ts +2 -2
- package/src/instructions/depositVault.ts +2 -2
- package/src/instructions/initHedgeFoundation.ts +2 -2
- package/src/instructions/initHedgeFoundationTokens.ts +2 -2
- package/src/instructions/liquidateVault.ts +29 -39
- package/src/instructions/loanVault.ts +23 -36
- package/src/instructions/psmEditAccount.ts +3 -3
- package/src/instructions/psmMintUsh.ts +3 -3
- package/src/instructions/psmRedeemUsh.ts +3 -3
- package/src/instructions/redeemVault.ts +2 -2
- package/src/instructions/referralClaimFees.ts +12 -18
- package/src/instructions/refreshOraclePrice.ts +4 -4
- package/src/instructions/repayVault.ts +2 -2
- package/src/instructions/setHalted.ts +2 -2
- package/src/instructions/transferVault.ts +1 -1
- package/src/instructions/updateReferralAccount.ts +2 -2
- package/src/instructions/updateReferralState.ts +2 -2
- package/src/instructions/updateVaultType.ts +2 -2
- package/src/instructions/withdrawStakingPool.ts +2 -2
- package/src/instructions/withdrawVault.ts +2 -2
- package/src/utils/Errors.ts +1 -1
- package/src/utils/getLinkedListAccounts.ts +1 -1
- package/declarations/instructions/adminWithdrawCol.d.ts +0 -5
- package/declarations/instructions/adminWithdrawUsh.d.ts +0 -5
- package/declarations/instructions/createCompoundStakingPool.d.ts +0 -5
- package/declarations/instructions/createCompoundStakingPoolPosition.d.ts +0 -6
- package/declarations/instructions/depositCompoundStakingPoolPosition.d.ts +0 -6
- package/declarations/instructions/depositRewardsToCompoundPool.d.ts +0 -6
- package/declarations/instructions/setCompoundPoolActive.d.ts +0 -5
- package/declarations/instructions/setDelegateWallet.d.ts +0 -5
- package/declarations/instructions/setVaultTypeStatus.d.ts +0 -4
- package/declarations/instructions/withdrawCompoundStakingPoolPosition.d.ts +0 -6
- package/declarations/utils/Sender.d.ts +0 -2
- package/lib/instructions/adminWithdrawCol.js +0 -60
- package/lib/instructions/adminWithdrawUsh.js +0 -57
- package/lib/instructions/createCompoundStakingPool.js +0 -58
- package/lib/instructions/createCompoundStakingPoolPosition.js +0 -56
- package/lib/instructions/depositCompoundStakingPoolPosition.js +0 -55
- package/lib/instructions/depositRewardsToCompoundPool.js +0 -64
- package/lib/instructions/setCompoundPoolActive.js +0 -43
- package/lib/instructions/setDelegateWallet.js +0 -43
- package/lib/instructions/setVaultTypeStatus.js +0 -38
- package/lib/instructions/withdrawCompoundStakingPoolPosition.js +0 -64
- package/lib/utils/Sender.js +0 -32
- package/src/instructions/adminWithdrawCol.ts +0 -87
- package/src/instructions/adminWithdrawUsh.ts +0 -78
- package/src/instructions/createCompoundStakingPool.ts +0 -63
- package/src/instructions/createCompoundStakingPoolPosition.ts +0 -85
- package/src/instructions/depositCompoundStakingPoolPosition.ts +0 -78
- package/src/instructions/depositRewardsToCompoundPool.ts +0 -110
- package/src/instructions/setCompoundPoolActive.ts +0 -51
- package/src/instructions/setDelegateWallet.ts +0 -51
- package/src/instructions/withdrawCompoundStakingPoolPosition.ts +0 -100
@@ -12,10 +12,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.Cluster =
|
16
|
-
|
15
|
+
exports.Cluster = void 0;
|
16
|
+
exports.refreshOraclePrice = refreshOraclePrice;
|
17
|
+
exports.refreshOraclePriceInstruction = refreshOraclePriceInstruction;
|
18
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
17
19
|
const web3_js_1 = require("@solana/web3.js");
|
18
|
-
const
|
20
|
+
const HedgeConstants_1 = require("../HedgeConstants");
|
19
21
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
20
22
|
function refreshOraclePrice(program, provider, payer, collateralType, network, overridePrice, overrideTime) {
|
21
23
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -23,12 +25,11 @@ function refreshOraclePrice(program, provider, payer, collateralType, network, o
|
|
23
25
|
return yield (0, sendAndConfirmWithDebug_1.default)(provider.connection, transaction, [payer]);
|
24
26
|
});
|
25
27
|
}
|
26
|
-
exports.refreshOraclePrice = refreshOraclePrice;
|
27
28
|
function refreshOraclePriceInstruction(program, collateralType, network, overridePrice, overrideTime) {
|
28
29
|
return __awaiter(this, void 0, void 0, function* () {
|
29
30
|
const enc = new TextEncoder();
|
30
|
-
const [oracleInfoAccount] = yield web3_js_1.PublicKey.
|
31
|
-
const [vaultTypeAccount] = yield web3_js_1.PublicKey.
|
31
|
+
const [oracleInfoAccount] = yield web3_js_1.PublicKey.findProgramAddressSync([enc.encode(collateralType), enc.encode('Oracle')], program.programId);
|
32
|
+
const [vaultTypeAccount] = yield web3_js_1.PublicKey.findProgramAddressSync([enc.encode(collateralType), enc.encode('State')], program.programId);
|
32
33
|
const oracleInfo = yield program.account.oracleInfoForCollateralType.fetch(oracleInfoAccount);
|
33
34
|
return yield program.methods
|
34
35
|
.refreshOraclePrice(new anchor_1.BN(overridePrice !== null && overridePrice !== void 0 ? overridePrice : web3_js_1.LAMPORTS_PER_SOL * 150), // override usd/sol price
|
@@ -41,18 +42,17 @@ function refreshOraclePriceInstruction(program, collateralType, network, overrid
|
|
41
42
|
oraclePyth: oracleInfo.oraclePyth,
|
42
43
|
oracleSwitchboard: oracleInfo.oracleSwitchboard,
|
43
44
|
systemProgram: web3_js_1.SystemProgram.programId,
|
44
|
-
chainlinkProgram:
|
45
|
+
chainlinkProgram: HedgeConstants_1.CHAINLINK_PROGRAM_ID,
|
45
46
|
})
|
46
47
|
.instruction();
|
47
48
|
});
|
48
49
|
}
|
49
|
-
exports.refreshOraclePriceInstruction = refreshOraclePriceInstruction;
|
50
50
|
var Cluster;
|
51
51
|
(function (Cluster) {
|
52
52
|
Cluster["Testing"] = "Testing";
|
53
53
|
Cluster["Devnet"] = "Devnet";
|
54
54
|
Cluster["MainnetBeta"] = "MainnetBeta";
|
55
|
-
})(Cluster
|
55
|
+
})(Cluster || (exports.Cluster = Cluster = {}));
|
56
56
|
const pythAccounts = {
|
57
57
|
Testing: web3_js_1.SystemProgram.programId,
|
58
58
|
Devnet: new web3_js_1.PublicKey('J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix'),
|
@@ -12,22 +12,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
16
|
-
|
15
|
+
exports.repayVault = repayVault;
|
16
|
+
exports.repayVaultInstruction = repayVaultInstruction;
|
17
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
17
18
|
const spl_token_1 = require("@solana/spl-token");
|
18
19
|
const web3_js_1 = require("@solana/web3.js");
|
19
|
-
const
|
20
|
+
const HedgeConstants_1 = require("../HedgeConstants");
|
20
21
|
const getLinkedListAccounts_1 = require("../utils/getLinkedListAccounts");
|
21
22
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
22
23
|
function repayVault(program, provider, payer, vaultPublicKey, repayAmount, overrideTime) {
|
23
24
|
return __awaiter(this, void 0, void 0, function* () {
|
24
|
-
const ushMintPublickey = yield (0,
|
25
|
+
const ushMintPublickey = yield (0, HedgeConstants_1.getUshMintPublicKey)(program.programId);
|
25
26
|
// Prep the user to get USH back out at some point
|
26
27
|
const payerUshAccount = yield (0, spl_token_1.getOrCreateAssociatedTokenAccount)(provider.connection, payer, ushMintPublickey, payer.publicKey);
|
27
28
|
const vaultAccount = yield program.account.vault.fetch(vaultPublicKey);
|
28
29
|
const vaultTypeAccount = yield program.account.vaultType.fetch(vaultAccount.vaultType);
|
29
|
-
const vaultTypeAssociatedTokenAccount = yield (0,
|
30
|
-
const vaultAssociatedTokenAccount = yield (0,
|
30
|
+
const vaultTypeAssociatedTokenAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, vaultAccount.vaultType, vaultTypeAccount.collateralMint);
|
31
|
+
const vaultAssociatedTokenAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, vaultPublicKey, vaultTypeAccount.collateralMint);
|
31
32
|
const [oldSmallerPublicKey, newSmallerPublicKey, newLargerPublicKey] = yield (0, getLinkedListAccounts_1.getLinkedListAccounts)(program, vaultAccount.vaultType, vaultPublicKey, new anchor_1.BN(0), new anchor_1.BN(0), new anchor_1.BN(0), new anchor_1.BN(Math.abs(repayAmount)), false, false);
|
32
33
|
const history = web3_js_1.Keypair.generate();
|
33
34
|
const transaction = new web3_js_1.Transaction().add(yield repayVaultInstruction(program, payer.publicKey, payerUshAccount.address, vaultPublicKey, vaultAssociatedTokenAccount, history.publicKey, vaultAccount.vaultType, vaultTypeAssociatedTokenAccount, oldSmallerPublicKey, newSmallerPublicKey, newLargerPublicKey, new anchor_1.BN(repayAmount), overrideTime));
|
@@ -35,14 +36,13 @@ function repayVault(program, provider, payer, vaultPublicKey, repayAmount, overr
|
|
35
36
|
return vaultPublicKey;
|
36
37
|
});
|
37
38
|
}
|
38
|
-
exports.repayVault = repayVault;
|
39
39
|
function repayVaultInstruction(program, payerPublicKey, ownerUshAccount, vaultPublickey, vaultAssociatedTokenAccount, historyPublicKey, vaultTypeAccount, vaultTypeAssociatedTokenAccount, oldSmallerPublicKey, newSmallerPublicKey, newLargerPublicKey, repayAmount, overrideTime) {
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
41
|
-
const vaultSystemStatePublicKey = yield (0,
|
42
|
-
const ushMintPublickey = yield (0,
|
43
|
-
const hedgeMintPublickey = yield (0,
|
44
|
-
const [hedgeStakingPoolPublicKey] = yield (0,
|
45
|
-
const hedgeStakingPoolAssociatedUshTokenAccount = yield (0,
|
41
|
+
const vaultSystemStatePublicKey = yield (0, HedgeConstants_1.getVaultSystemStatePublicKey)(program.programId);
|
42
|
+
const ushMintPublickey = yield (0, HedgeConstants_1.getUshMintPublicKey)(program.programId);
|
43
|
+
const hedgeMintPublickey = yield (0, HedgeConstants_1.getHedgeMintPublicKey)(program.programId);
|
44
|
+
const [hedgeStakingPoolPublicKey] = yield (0, HedgeConstants_1.getPoolPublicKeyForMint)(program.programId, hedgeMintPublickey);
|
45
|
+
const hedgeStakingPoolAssociatedUshTokenAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, hedgeStakingPoolPublicKey, ushMintPublickey);
|
46
46
|
return yield program.methods
|
47
47
|
.repayVault(repayAmount, new anchor_1.BN(overrideTime !== null && overrideTime !== void 0 ? overrideTime : Math.floor(Date.now() / 1000)) // override override time
|
48
48
|
)
|
@@ -67,4 +67,3 @@ function repayVaultInstruction(program, payerPublicKey, ownerUshAccount, vaultPu
|
|
67
67
|
.instruction();
|
68
68
|
});
|
69
69
|
}
|
70
|
-
exports.repayVaultInstruction = repayVaultInstruction;
|
@@ -12,20 +12,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
15
|
+
exports.setHalted = setHalted;
|
16
|
+
exports.setHaltedInstruction = setHaltedInstruction;
|
16
17
|
const web3_js_1 = require("@solana/web3.js");
|
17
|
-
const
|
18
|
+
const HedgeConstants_1 = require("../HedgeConstants");
|
18
19
|
const Errors_1 = require("../utils/Errors");
|
19
20
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
20
21
|
function setHalted(program, provider, payer, halted) {
|
21
22
|
return __awaiter(this, void 0, void 0, function* () {
|
22
|
-
const vaultSystemStatePublicKey = yield (0,
|
23
|
+
const vaultSystemStatePublicKey = yield (0, HedgeConstants_1.getVaultSystemStatePublicKey)(program.programId);
|
23
24
|
const transaction = new web3_js_1.Transaction().add(yield setHaltedInstruction(program, vaultSystemStatePublicKey, payer.publicKey, halted));
|
24
25
|
yield (0, sendAndConfirmWithDebug_1.default)(provider.connection, transaction, [payer]).catch(Errors_1.parseAnchorErrors);
|
25
26
|
return vaultSystemStatePublicKey;
|
26
27
|
});
|
27
28
|
}
|
28
|
-
exports.setHalted = setHalted;
|
29
29
|
function setHaltedInstruction(program, vaultSystemStatePublicKey, payerPublicKey, halted) {
|
30
30
|
return __awaiter(this, void 0, void 0, function* () {
|
31
31
|
return yield program.methods
|
@@ -37,4 +37,3 @@ function setHaltedInstruction(program, vaultSystemStatePublicKey, payerPublicKey
|
|
37
37
|
.instruction();
|
38
38
|
});
|
39
39
|
}
|
40
|
-
exports.setHaltedInstruction = setHaltedInstruction;
|
@@ -12,7 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
15
|
+
exports.transferVault = transferVault;
|
16
|
+
exports.transferVaultInstruction = transferVaultInstruction;
|
16
17
|
const web3_js_1 = require("@solana/web3.js");
|
17
18
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
18
19
|
function transferVault(program, provider, payer, vaultPublicKey, vaultSystemStatePublicKey, vaultTypeAccount, newOwner) {
|
@@ -23,7 +24,6 @@ function transferVault(program, provider, payer, vaultPublicKey, vaultSystemStat
|
|
23
24
|
return vaultPublicKey;
|
24
25
|
});
|
25
26
|
}
|
26
|
-
exports.transferVault = transferVault;
|
27
27
|
function transferVaultInstruction(vaultPublickey, vaultSystemStatePublicKey, vaultTypeAccount, historyPublicKey, vaultOwner, program, newOwner) {
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
29
29
|
return yield program.methods
|
@@ -38,4 +38,3 @@ function transferVaultInstruction(vaultPublickey, vaultSystemStatePublicKey, vau
|
|
38
38
|
.instruction();
|
39
39
|
});
|
40
40
|
}
|
41
|
-
exports.transferVaultInstruction = transferVaultInstruction;
|
@@ -12,23 +12,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
15
|
+
exports.updateReferralAccount = updateReferralAccount;
|
16
|
+
exports.updateReferralAccountInstruction = updateReferralAccountInstruction;
|
16
17
|
const web3_js_1 = require("@solana/web3.js");
|
17
|
-
const
|
18
|
+
const HedgeConstants_1 = require("../HedgeConstants");
|
18
19
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
19
20
|
function updateReferralAccount(program, provider, payer, referrer, config) {
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
21
|
-
const vaultSystemStatePublicKey = yield (0,
|
22
|
-
const referralAccountPublicKey = yield (0,
|
22
|
+
const vaultSystemStatePublicKey = yield (0, HedgeConstants_1.getVaultSystemStatePublicKey)(program.programId);
|
23
|
+
const referralAccountPublicKey = yield (0, HedgeConstants_1.getReferralAccountPublicKey)(program.programId, referrer);
|
23
24
|
const transaction = new web3_js_1.Transaction().add(yield updateReferralAccountInstruction(program, vaultSystemStatePublicKey, referralAccountPublicKey, payer.publicKey, config));
|
24
25
|
yield (0, sendAndConfirmWithDebug_1.default)(provider.connection, transaction, [payer]);
|
25
26
|
return referralAccountPublicKey;
|
26
27
|
});
|
27
28
|
}
|
28
|
-
exports.updateReferralAccount = updateReferralAccount;
|
29
29
|
function updateReferralAccountInstruction(program, vaultSystemStatePublicKey, referralAccountPublicKey, payerPublicKey, referralAccountConfig) {
|
30
|
-
var _a, _b, _c, _d, _e;
|
31
30
|
return __awaiter(this, void 0, void 0, function* () {
|
31
|
+
var _a, _b, _c, _d, _e;
|
32
32
|
const config = {
|
33
33
|
setupCut: (_a = referralAccountConfig.setupCut) !== null && _a !== void 0 ? _a : null,
|
34
34
|
stabilityCut: (_b = referralAccountConfig.stabilityCut) !== null && _b !== void 0 ? _b : null,
|
@@ -47,4 +47,3 @@ function updateReferralAccountInstruction(program, vaultSystemStatePublicKey, re
|
|
47
47
|
.instruction();
|
48
48
|
});
|
49
49
|
}
|
50
|
-
exports.updateReferralAccountInstruction = updateReferralAccountInstruction;
|
@@ -12,23 +12,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
15
|
+
exports.updateReferralState = updateReferralState;
|
16
|
+
exports.updateReferralStateInstruction = updateReferralStateInstruction;
|
16
17
|
const web3_js_1 = require("@solana/web3.js");
|
17
|
-
const
|
18
|
+
const HedgeConstants_1 = require("../HedgeConstants");
|
18
19
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
19
20
|
function updateReferralState(program, provider, payer, config) {
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
21
|
-
const vaultSystemStatePublicKey = yield (0,
|
22
|
-
const referralStatePublicKey = yield (0,
|
22
|
+
const vaultSystemStatePublicKey = yield (0, HedgeConstants_1.getVaultSystemStatePublicKey)(program.programId);
|
23
|
+
const referralStatePublicKey = yield (0, HedgeConstants_1.getReferralStatePublicKey)(program.programId);
|
23
24
|
const transaction = new web3_js_1.Transaction().add(yield updateReferralStateInstruction(program, vaultSystemStatePublicKey, referralStatePublicKey, payer.publicKey, config));
|
24
25
|
yield (0, sendAndConfirmWithDebug_1.default)(provider.connection, transaction, [payer]);
|
25
26
|
return referralStatePublicKey;
|
26
27
|
});
|
27
28
|
}
|
28
|
-
exports.updateReferralState = updateReferralState;
|
29
29
|
function updateReferralStateInstruction(program, vaultSystemStatePublicKey, referralStatePublicKey, payerPublicKey, referralStateConfig) {
|
30
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
31
30
|
return __awaiter(this, void 0, void 0, function* () {
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
32
32
|
const config = {
|
33
33
|
setupCut: (_a = referralStateConfig.setupCut) !== null && _a !== void 0 ? _a : null,
|
34
34
|
stabilityCut: (_b = referralStateConfig.stabilityCut) !== null && _b !== void 0 ? _b : null,
|
@@ -54,4 +54,3 @@ function updateReferralStateInstruction(program, vaultSystemStatePublicKey, refe
|
|
54
54
|
.instruction();
|
55
55
|
});
|
56
56
|
}
|
57
|
-
exports.updateReferralStateInstruction = updateReferralStateInstruction;
|
@@ -12,22 +12,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
15
|
+
exports.updateVaultType = updateVaultType;
|
16
|
+
exports.updateVaultTypeStatusInstruction = updateVaultTypeStatusInstruction;
|
16
17
|
const web3_js_1 = require("@solana/web3.js");
|
17
|
-
const
|
18
|
+
const HedgeConstants_1 = require("../HedgeConstants");
|
18
19
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
19
20
|
function updateVaultType(program, provider, payer, vaultTypeAccount, oracleInfoAccount, config) {
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
21
|
-
const vaultSystemStatePublicKey = yield (0,
|
22
|
+
const vaultSystemStatePublicKey = yield (0, HedgeConstants_1.getVaultSystemStatePublicKey)(program.programId);
|
22
23
|
const transaction = new web3_js_1.Transaction().add(yield updateVaultTypeStatusInstruction(program, vaultSystemStatePublicKey, payer.publicKey, vaultTypeAccount, oracleInfoAccount, config));
|
23
24
|
yield (0, sendAndConfirmWithDebug_1.default)(provider.connection, transaction, [payer]);
|
24
25
|
return vaultSystemStatePublicKey;
|
25
26
|
});
|
26
27
|
}
|
27
|
-
exports.updateVaultType = updateVaultType;
|
28
28
|
function updateVaultTypeStatusInstruction(program, vaultSystemStatePublicKey, payerPublicKey, vaultTypeAccount, oracleInfoAccount, vaultTypeConfig) {
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
30
29
|
return __awaiter(this, void 0, void 0, function* () {
|
30
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
31
31
|
const config = {
|
32
32
|
maxDebtExtended: (_a = vaultTypeConfig.maxDebtExtended) !== null && _a !== void 0 ? _a : null,
|
33
33
|
minDebtPerVault: (_b = vaultTypeConfig.minDebtPerVault) !== null && _b !== void 0 ? _b : null,
|
@@ -53,4 +53,3 @@ function updateVaultTypeStatusInstruction(program, vaultSystemStatePublicKey, pa
|
|
53
53
|
.instruction();
|
54
54
|
});
|
55
55
|
}
|
56
|
-
exports.updateVaultTypeStatusInstruction = updateVaultTypeStatusInstruction;
|
@@ -12,11 +12,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
16
|
-
|
15
|
+
exports.withdrawStakingPool = withdrawStakingPool;
|
16
|
+
exports.withdrawStakingPoolInstruction = withdrawStakingPoolInstruction;
|
17
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
17
18
|
const spl_token_1 = require("@solana/spl-token");
|
18
19
|
const web3_js_1 = require("@solana/web3.js");
|
19
|
-
const
|
20
|
+
const HedgeConstants_1 = require("../HedgeConstants");
|
20
21
|
const Errors_1 = require("../utils/Errors");
|
21
22
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
22
23
|
function withdrawStakingPool(program, provider, payer, poolPositionPublicKey, stakedTokenMintPublicKey, overrideStartTime) {
|
@@ -27,19 +28,18 @@ function withdrawStakingPool(program, provider, payer, poolPositionPublicKey, st
|
|
27
28
|
return poolPosition.publicKey;
|
28
29
|
});
|
29
30
|
}
|
30
|
-
exports.withdrawStakingPool = withdrawStakingPool;
|
31
31
|
function withdrawStakingPoolInstruction(program, payerPublicKey, poolPositionPublicKey, stakedTokenMintPublicKey, overrideStartTime) {
|
32
32
|
return __awaiter(this, void 0, void 0, function* () {
|
33
|
-
const vaultSystemStatePublicKey = yield (0,
|
34
|
-
const ushMintPublickey = yield (0,
|
35
|
-
const hedgeMintPublickey = yield (0,
|
36
|
-
const [poolPublickey] = yield (0,
|
37
|
-
const poolAssociatedStakedTokenAccount = yield (0,
|
38
|
-
const poolAssociatedUshTokenAccount = yield (0,
|
39
|
-
const payerAssociatedStakedTokenAccount = yield (0,
|
40
|
-
const payerAssociatedHedgeAccount = yield (0,
|
41
|
-
const payerAssociatedUshAccount = yield (0,
|
42
|
-
const communityHedgeTokenAccount = yield (0,
|
33
|
+
const vaultSystemStatePublicKey = yield (0, HedgeConstants_1.getVaultSystemStatePublicKey)(program.programId);
|
34
|
+
const ushMintPublickey = yield (0, HedgeConstants_1.getUshMintPublicKey)(program.programId);
|
35
|
+
const hedgeMintPublickey = yield (0, HedgeConstants_1.getHedgeMintPublicKey)(program.programId);
|
36
|
+
const [poolPublickey] = yield (0, HedgeConstants_1.getPoolPublicKeyForMint)(program.programId, stakedTokenMintPublicKey);
|
37
|
+
const poolAssociatedStakedTokenAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, poolPublickey, stakedTokenMintPublicKey);
|
38
|
+
const poolAssociatedUshTokenAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, poolPublickey, ushMintPublickey);
|
39
|
+
const payerAssociatedStakedTokenAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, payerPublicKey, stakedTokenMintPublicKey);
|
40
|
+
const payerAssociatedHedgeAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, payerPublicKey, hedgeMintPublickey);
|
41
|
+
const payerAssociatedUshAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, payerPublicKey, ushMintPublickey);
|
42
|
+
const communityHedgeTokenAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, vaultSystemStatePublicKey, hedgeMintPublickey);
|
43
43
|
return yield program.methods
|
44
44
|
.withdrawStakingPool(new anchor_1.BN(overrideStartTime !== null && overrideStartTime !== void 0 ? overrideStartTime : Math.floor(Date.now() / 1000)) // override current time
|
45
45
|
)
|
@@ -63,4 +63,3 @@ function withdrawStakingPoolInstruction(program, payerPublicKey, poolPositionPub
|
|
63
63
|
.instruction();
|
64
64
|
});
|
65
65
|
}
|
66
|
-
exports.withdrawStakingPoolInstruction = withdrawStakingPoolInstruction;
|
@@ -12,35 +12,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.
|
16
|
-
|
15
|
+
exports.withdrawVault = withdrawVault;
|
16
|
+
exports.withdrawVaultInstruction = withdrawVaultInstruction;
|
17
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
17
18
|
const serum_1 = require("@project-serum/serum");
|
18
19
|
const spl_token_1 = require("@solana/spl-token");
|
19
20
|
const web3_js_1 = require("@solana/web3.js");
|
20
|
-
const
|
21
|
+
const HedgeConstants_1 = require("../HedgeConstants");
|
21
22
|
const getLinkedListAccounts_1 = require("../utils/getLinkedListAccounts");
|
22
23
|
const sendAndConfirmWithDebug_1 = __importDefault(require("../utils/sendAndConfirmWithDebug"));
|
23
24
|
function withdrawVault(program, provider, payer, vaultPublicKey, withdrawAmount, overrideTime) {
|
24
25
|
return __awaiter(this, void 0, void 0, function* () {
|
25
|
-
const ushMintPublickey = yield (0,
|
26
|
+
const ushMintPublickey = yield (0, HedgeConstants_1.getUshMintPublicKey)(program.programId);
|
26
27
|
// Prep the user to get USH back out at some point
|
27
28
|
yield (0, spl_token_1.getOrCreateAssociatedTokenAccount)(provider.connection, payer, ushMintPublickey, payer.publicKey);
|
28
29
|
const history = web3_js_1.Keypair.generate();
|
29
|
-
const vaultSystemStatePublicKey = yield (0,
|
30
|
+
const vaultSystemStatePublicKey = yield (0, HedgeConstants_1.getVaultSystemStatePublicKey)(program.programId);
|
30
31
|
const vaultAccount = yield program.account.vault.fetch(vaultPublicKey);
|
31
32
|
const vaultAssociatedCollateralAccount = yield (0, spl_token_1.getOrCreateAssociatedTokenAccount)(provider.connection, payer, serum_1.TokenInstructions.WRAPPED_SOL_MINT, vaultPublicKey, true);
|
32
33
|
const vaultTypeAccountInfo = yield program.account.vaultType.fetch(vaultAccount.vaultType);
|
33
34
|
const vaultTypeAssociatedTokenAccount = yield (0, spl_token_1.getOrCreateAssociatedTokenAccount)(provider.connection, payer, vaultTypeAccountInfo.collateralMint, vaultAccount.vaultType, true);
|
34
35
|
const destinationTokenAccount = yield (0, spl_token_1.getOrCreateAssociatedTokenAccount)(provider.connection, payer, vaultTypeAccountInfo.collateralMint, payer.publicKey);
|
35
|
-
const [hedgeStakingPoolPublicKey] = yield (0,
|
36
|
-
const hedgeStakingPoolAssociatedUshTokenAccount = yield (0,
|
36
|
+
const [hedgeStakingPoolPublicKey] = yield (0, HedgeConstants_1.getPoolPublicKeyForMint)(program.programId, yield (0, HedgeConstants_1.getHedgeMintPublicKey)(program.programId));
|
37
|
+
const hedgeStakingPoolAssociatedUshTokenAccount = yield (0, HedgeConstants_1.findAssociatedTokenAddress)(program.programId, hedgeStakingPoolPublicKey, ushMintPublickey);
|
37
38
|
const [oldSmallerPublicKey, newSmallerPublicKey, newLargerPublicKey] = yield (0, getLinkedListAccounts_1.getLinkedListAccounts)(program, vaultAccount.vaultType, vaultPublicKey, new anchor_1.BN(0), new anchor_1.BN(Math.abs(withdrawAmount)), new anchor_1.BN(0), new anchor_1.BN(0), false, false);
|
38
39
|
const transaction = new web3_js_1.Transaction().add(yield withdrawVaultInstruction(program, vaultSystemStatePublicKey, payer.publicKey, destinationTokenAccount.address, vaultPublicKey, vaultAssociatedCollateralAccount.address, vaultAccount.vaultType, vaultTypeAssociatedTokenAccount.address, hedgeStakingPoolPublicKey, hedgeStakingPoolAssociatedUshTokenAccount, ushMintPublickey, history.publicKey, oldSmallerPublicKey, newSmallerPublicKey, newLargerPublicKey, new anchor_1.BN(withdrawAmount), overrideTime));
|
39
40
|
yield (0, sendAndConfirmWithDebug_1.default)(provider.connection, transaction, [payer, history]);
|
40
41
|
return vaultPublicKey;
|
41
42
|
});
|
42
43
|
}
|
43
|
-
exports.withdrawVault = withdrawVault;
|
44
44
|
function withdrawVaultInstruction(program, vaultSystemStatePublicKey, payerPublicKey, destinationTokenAccount, vaultPublickey, vaultAssociatedCollateralPublicKey, vaultTypeAccount, vaultTypeAssociatedTokenAccount, hedgeStakingPoolPublicKey, hedgeStakingPoolAssociatedUshTokenAccount, ushMint, historyPublicKey, oldSmallerPublicKey, newSmallerPublicKey, newLargerPublicKey, withdrawAmount, overrideTime) {
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
46
46
|
return yield program.methods
|
@@ -67,4 +67,3 @@ function withdrawVaultInstruction(program, vaultSystemStatePublicKey, payerPubli
|
|
67
67
|
.instruction();
|
68
68
|
});
|
69
69
|
}
|
70
|
-
exports.withdrawVaultInstruction = withdrawVaultInstruction;
|
@@ -1,7 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
3
|
if (k2 === undefined) k2 = k;
|
4
|
-
Object.
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
5
9
|
}) : (function(o, m, k, k2) {
|
6
10
|
if (k2 === undefined) k2 = k;
|
7
11
|
o[k2] = m[k];
|
@@ -11,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
11
15
|
}) : function(o, v) {
|
12
16
|
o["default"] = v;
|
13
17
|
});
|
14
|
-
var __importStar = (this && this.__importStar) || function (
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
};
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
21
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
37
|
};
|
@@ -28,7 +28,7 @@ var VaultStatus;
|
|
28
28
|
VaultStatus[VaultStatus["Liquidated"] = 2] = "Liquidated";
|
29
29
|
VaultStatus[VaultStatus["Distributed"] = 3] = "Distributed";
|
30
30
|
VaultStatus[VaultStatus["Redeemed"] = 4] = "Redeemed";
|
31
|
-
})(VaultStatus
|
31
|
+
})(VaultStatus || (exports.VaultStatus = VaultStatus = {}));
|
32
32
|
var VaultHistoryAction;
|
33
33
|
(function (VaultHistoryAction) {
|
34
34
|
VaultHistoryAction[VaultHistoryAction["Create"] = 0] = "Create";
|
@@ -42,4 +42,4 @@ var VaultHistoryAction;
|
|
42
42
|
VaultHistoryAction[VaultHistoryAction["Withdraw"] = 8] = "Withdraw";
|
43
43
|
VaultHistoryAction[VaultHistoryAction["Loan"] = 9] = "Loan";
|
44
44
|
VaultHistoryAction[VaultHistoryAction["RepayCredit"] = 10] = "RepayCredit";
|
45
|
-
})(VaultHistoryAction
|
45
|
+
})(VaultHistoryAction || (exports.VaultHistoryAction = VaultHistoryAction = {}));
|
package/lib/utils/Errors.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.parseAnchorErrors =
|
4
|
-
const anchor_1 = require("@
|
3
|
+
exports.parseAnchorErrors = parseAnchorErrors;
|
4
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
5
5
|
const vault_1 = require("../idl/vault");
|
6
6
|
function parseAnchorErrors(error) {
|
7
7
|
const idlErrors = (0, anchor_1.parseIdlErrors)(vault_1.IDL);
|
@@ -12,4 +12,3 @@ function parseAnchorErrors(error) {
|
|
12
12
|
}
|
13
13
|
throw error;
|
14
14
|
}
|
15
|
-
exports.parseAnchorErrors = parseAnchorErrors;
|
@@ -12,8 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.getLinkedListAccounts =
|
16
|
-
const anchor_1 = require("@
|
15
|
+
exports.getLinkedListAccounts = getLinkedListAccounts;
|
16
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
17
17
|
const underscore_1 = __importDefault(require("underscore"));
|
18
18
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
19
19
|
const VaultAccount_1 = require("../state/VaultAccount");
|
@@ -166,7 +166,6 @@ function getLinkedListAccounts(program, vaultTypeAccountPublicKey, vaultPublicKe
|
|
166
166
|
return [oldSmallerPublicKey, newSmallerPublicKey, newLargerPublicKey, vaults];
|
167
167
|
});
|
168
168
|
}
|
169
|
-
exports.getLinkedListAccounts = getLinkedListAccounts;
|
170
169
|
// Sort function we can use to sort the vaults
|
171
170
|
// Sorted by collateral ratio. If two are the same, newer vault first
|
172
171
|
function sortVaults(a, b) {
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
});
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.default = sendAndConfirmWithDebug;
|
12
13
|
function sendAndConfirmWithDebug(connection, transaction, signers) {
|
13
14
|
return __awaiter(this, void 0, void 0, function* () {
|
14
15
|
return connection
|
@@ -32,4 +33,3 @@ function sendAndConfirmWithDebug(connection, transaction, signers) {
|
|
32
33
|
});
|
33
34
|
});
|
34
35
|
}
|
35
|
-
exports.default = sendAndConfirmWithDebug;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hedge-web3",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.3.0",
|
4
4
|
"description": "Hedge Javascript Web3 API",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"types": "declarations/index.d.ts",
|
@@ -14,26 +14,27 @@
|
|
14
14
|
"author": "Chris Coudron <coudron@hedge.so>",
|
15
15
|
"license": "ISC",
|
16
16
|
"dependencies": {
|
17
|
-
"@
|
18
|
-
"@project-serum/serum": "^0.13.61",
|
17
|
+
"@coral-xyz/anchor": "^0.29.0",
|
19
18
|
"@rollup/plugin-typescript": "^8.3.0",
|
20
19
|
"@solana/buffer-layout": "^4.0.0",
|
21
|
-
"@solana/spl-token": "^0.
|
22
|
-
"@solana/
|
20
|
+
"@solana/spl-token": "^0.3.9",
|
21
|
+
"@solana/spl-token-metadata": "^0.1.6",
|
22
|
+
"@solana/web3.js": "^1.90.0",
|
23
23
|
"@types/bn.js": "^5.1.0",
|
24
24
|
"@types/underscore": "^1.11.4",
|
25
25
|
"@types/uuid": "^8.3.4",
|
26
26
|
"bn.js": "^5.2.0",
|
27
27
|
"bs58": "^5.0.0",
|
28
28
|
"decimal.js": "^10.3.1",
|
29
|
+
"i": "^0.3.7",
|
30
|
+
"npm": "^10.9.2",
|
29
31
|
"rollup": "^2.62.0",
|
30
32
|
"ts-standard": "^11.0.0",
|
31
|
-
"typedoc": "^0.
|
32
|
-
"typescript": "^4.5.5",
|
33
|
+
"typedoc": "^0.27.6",
|
33
34
|
"underscore": "^1.13.2",
|
34
35
|
"uuid": "^8.3.2"
|
35
36
|
},
|
36
37
|
"devDependencies": {
|
37
|
-
"
|
38
|
+
"typescript": "^5.7.3"
|
38
39
|
}
|
39
40
|
}
|