hedge-web3 0.1.26 → 0.1.27
Sign up to get free protection for your applications and to get access to all the features.
- package/declarations/Constants.d.ts +1 -1
- package/declarations/idl/vault.d.ts +893 -756
- package/lib/Constants.js +3 -3
- package/lib/idl/vault.js +893 -756
- package/lib/utils/Errors.js +2 -2
- package/package.json +1 -1
- package/src/Constants.ts +73 -31
- package/src/idl/vault.ts +1780 -1506
- package/src/state/StakingPool.ts +0 -4
- package/src/utils/Errors.ts +2 -2
- package/declarations/idl/idl.d.ts +0 -2
- package/lib/idl/idl.js +0 -1475
- package/src/idl/idl.ts +0 -1474
package/lib/Constants.js
CHANGED
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.findAssociatedTokenAddress = exports.findVaultAddress = exports.getVaultTypeOracleAccountPublicKey = exports.getVaultTypeAccountPublicKey = exports.getPoolPublicKeyForMint = exports.getHedgeMintPublicKey = exports.getVaultSystemStatePublicKey = exports.getUshMintPublicKey = exports.getLiquidationPoolUshAccountPublicKey = exports.getLiquidationPoolStatePublicKey = exports.CHAINLINK_SOL_USD_PUBLICKEY = exports.CHAINLINK_SOL_USD_ID = exports.HEDGE_PROGRAM_PUBLICKEY = exports.HEDGE_PROGRAM_ID = void 0;
|
13
13
|
const spl_token_1 = require("@solana/spl-token");
|
14
14
|
const web3_js_1 = require("@solana/web3.js");
|
15
|
-
exports.HEDGE_PROGRAM_ID = '
|
15
|
+
exports.HEDGE_PROGRAM_ID = 'HDG2DRczYGkTuYTwTYy1UUhXXucT2Ujede2j4bWEoE6p';
|
16
16
|
exports.HEDGE_PROGRAM_PUBLICKEY = new web3_js_1.PublicKey(exports.HEDGE_PROGRAM_ID);
|
17
17
|
exports.CHAINLINK_SOL_USD_ID = 'FmAmfoyPXiA8Vhhe6MZTr3U6rZfEZ1ctEHay1ysqCqcf';
|
18
18
|
exports.CHAINLINK_SOL_USD_PUBLICKEY = new web3_js_1.PublicKey(exports.CHAINLINK_SOL_USD_ID);
|
@@ -54,7 +54,7 @@ function getHedgeMintPublicKey() {
|
|
54
54
|
exports.getHedgeMintPublicKey = getHedgeMintPublicKey;
|
55
55
|
function getPoolPublicKeyForMint(mintPublicKey) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const strToEncode =
|
57
|
+
const strToEncode = mintPublicKey.toString().substring(0, 12);
|
58
58
|
const [publicKey, bump] = yield web3_js_1.PublicKey.findProgramAddress([enc.encode(strToEncode)], exports.HEDGE_PROGRAM_PUBLICKEY);
|
59
59
|
return [publicKey, bump, strToEncode];
|
60
60
|
});
|
@@ -86,7 +86,7 @@ function findAssociatedTokenAddress(walletAddress, tokenMintAddress) {
|
|
86
86
|
return (yield web3_js_1.PublicKey.findProgramAddress([
|
87
87
|
walletAddress.toBuffer(),
|
88
88
|
spl_token_1.TOKEN_PROGRAM_ID.toBuffer(),
|
89
|
-
tokenMintAddress.toBuffer()
|
89
|
+
tokenMintAddress.toBuffer(),
|
90
90
|
], spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID))[0];
|
91
91
|
});
|
92
92
|
}
|