@exponent-labs/kamino-lend-standard 0.9.3
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/build/anchor/idl.json +2889 -0
- package/build/anchor/type.d.ts +2895 -0
- package/build/anchor/type.js +3 -0
- package/build/anchor/type.js.map +1 -0
- package/build/constants.d.ts +44 -0
- package/build/constants.js +144 -0
- package/build/constants.js.map +1 -0
- package/build/index.d.ts +103 -0
- package/build/index.js +318 -0
- package/build/index.js.map +1 -0
- package/build/instructions/addEmission.d.ts +11 -0
- package/build/instructions/addEmission.js +58 -0
- package/build/instructions/addEmission.js.map +1 -0
- package/build/instructions/createStandardToken.d.ts +0 -0
- package/build/instructions/createStandardToken.js +56 -0
- package/build/instructions/createStandardToken.js.map +1 -0
- package/build/instructions/depositInstruction.d.ts +17 -0
- package/build/instructions/depositInstruction.js +119 -0
- package/build/instructions/depositInstruction.js.map +1 -0
- package/build/instructions/getPositionInstruction.d.ts +15 -0
- package/build/instructions/getPositionInstruction.js +114 -0
- package/build/instructions/getPositionInstruction.js.map +1 -0
- package/build/instructions/index.d.ts +2 -0
- package/build/instructions/index.js +19 -0
- package/build/instructions/index.js.map +1 -0
- package/build/instructions/initializeKaminoLendAccount.d.ts +18 -0
- package/build/instructions/initializeKaminoLendAccount.js +85 -0
- package/build/instructions/initializeKaminoLendAccount.js.map +1 -0
- package/build/instructions/initializePositionInstruction.d.ts +8 -0
- package/build/instructions/initializePositionInstruction.js +55 -0
- package/build/instructions/initializePositionInstruction.js.map +1 -0
- package/build/instructions/mintInstruction.d.ts +19 -0
- package/build/instructions/mintInstruction.js +132 -0
- package/build/instructions/mintInstruction.js.map +1 -0
- package/build/instructions/redeemInstruction.d.ts +21 -0
- package/build/instructions/redeemInstruction.js +129 -0
- package/build/instructions/redeemInstruction.js.map +1 -0
- package/build/instructions/withdrawInstruction.d.ts +17 -0
- package/build/instructions/withdrawInstruction.js +122 -0
- package/build/instructions/withdrawInstruction.js.map +1 -0
- package/package.json +22 -0
- package/src/anchor/idl.json +2889 -0
- package/src/anchor/type.ts +2895 -0
- package/src/constants.d.ts +44 -0
- package/src/constants.js +133 -0
- package/src/constants.ts +205 -0
- package/src/index.ts +500 -0
- package/src/instructions/addEmission.ts +39 -0
- package/src/instructions/createStandardToken.ts +57 -0
- package/src/instructions/depositInstruction.ts +130 -0
- package/src/instructions/getPositionInstruction.ts +117 -0
- package/src/instructions/index.ts +2 -0
- package/src/instructions/initializeKaminoLendAccount.ts +101 -0
- package/src/instructions/initializePositionInstruction.ts +31 -0
- package/src/instructions/mintInstruction.ts +149 -0
- package/src/instructions/redeemInstruction.ts +140 -0
- package/src/instructions/withdrawInstruction.ts +137 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
export declare const getAccountAuthority: (reserve: PublicKey, programId: PublicKey) => PublicKey;
|
|
3
|
+
export declare const getMintAuthority: (reserve: PublicKey, programId: PublicKey) => PublicKey;
|
|
4
|
+
export declare const getEmissionTracker: (reserve: PublicKey, programId: PublicKey) => PublicKey;
|
|
5
|
+
export declare const getPosition: (reserve: PublicKey, owner: PublicKey, programId: PublicKey) => PublicKey;
|
|
6
|
+
export declare const getStakedReceiptPool: (reserve: PublicKey, programId: PublicKey) => PublicKey;
|
|
7
|
+
export declare const getStakedReceiptPoolAuthority: (reserve: PublicKey, programId: PublicKey) => PublicKey;
|
|
8
|
+
export declare const getAccountAuthorityBaseTokenAccount: (reserve: PublicKey, programId: PublicKey) => PublicKey;
|
|
9
|
+
export declare const getKaminoReserveLiquiditySupply: (lendingMarket: PublicKey, reserveLiquidityMint: PublicKey, kaminoProgramId: PublicKey) => PublicKey;
|
|
10
|
+
export declare const getKaminoReserveCollateralMint: (lendingMarket: PublicKey, reserveLiquidityMint: PublicKey, kaminoProgramId: PublicKey) => PublicKey;
|
|
11
|
+
export declare const getKaminoReserveCollateralSupply: (lendingMarket: PublicKey, reserveLiquidityMint: PublicKey, kaminoProgramId: PublicKey) => PublicKey;
|
|
12
|
+
export declare const getStandardTokenMint: (reserve: PublicKey, programId: PublicKey) => PublicKey;
|
|
13
|
+
export declare const getKaminoUserMetadata: (user: PublicKey, programId: PublicKey) => PublicKey;
|
|
14
|
+
export declare const getKaminoFarmsVaultAuthority: (farm: PublicKey, programId: PublicKey) => PublicKey;
|
|
15
|
+
export declare const getKaminoGlobalConfig: () => PublicKey;
|
|
16
|
+
export declare const getKaminoFarmsRewardsTreasuryVault: (reward_mint: PublicKey, globalConfig: PublicKey, kaminoFarmsProgramId: PublicKey) => PublicKey;
|
|
17
|
+
export declare const getKaminoFarmsRewardsVault: (reward_mint: PublicKey, kaminoFarm: PublicKey, kaminoFarmsProgramId: PublicKey) => PublicKey;
|
|
18
|
+
export declare const getMeta: (kaminoReserve: PublicKey, programId: PublicKey) => PublicKey;
|
|
19
|
+
export declare const getKaminoLendObligation: (owner: PublicKey, lendingMarket: PublicKey, programId: PublicKey) => PublicKey;
|
|
20
|
+
export declare const getKaminoFarmsObligationFarm: (obligation: PublicKey, reserveFarmState: PublicKey, programId: PublicKey) => PublicKey;
|
|
21
|
+
export declare const KAMINO_LEND_PROGRAM_ID: PublicKey;
|
|
22
|
+
export declare const KAMINO_FARMS_PROGRAM_ID: PublicKey;
|
|
23
|
+
export declare const KAMINO_LENDING_MARKET_ID: PublicKey;
|
|
24
|
+
export declare const KAMINO_RESERVE_ID: PublicKey;
|
|
25
|
+
export declare const KAMINO_USDC_RESERVE_FARM_ID: PublicKey;
|
|
26
|
+
export declare const KAMINO_RESERVE_FARM_STATE_ID: PublicKey;
|
|
27
|
+
export declare const KAMINO_LENDING_MARKET_AUTHORITY_ID: PublicKey;
|
|
28
|
+
export declare const KAMINO_FARMS_GLOBAL_CONFIG: PublicKey;
|
|
29
|
+
export declare const KAMINO_SCOPE_PRICES_ID: PublicKey;
|
|
30
|
+
export declare const KAMINO_RESERVE_COLLATERAL_MINT_ID: PublicKey;
|
|
31
|
+
export declare const KAMINO_RESERVE_DESTINATION_DEPOSIT_COLLATERAL_ID: PublicKey;
|
|
32
|
+
export declare const KAMINO_RESERVE_LIQUIDITY_SUPPLY_ID: PublicKey;
|
|
33
|
+
export declare const PYTH_USDC_FEED_ID: PublicKey;
|
|
34
|
+
export declare const PAYPAL_USD_MINT: PublicKey;
|
|
35
|
+
export declare const KAMINO_PAYPAL_USD_RESERVE: PublicKey;
|
|
36
|
+
export declare const KAMINO_PAYPAL_USD_RESERVE_LIQUIDITY_SUPPLY: PublicKey;
|
|
37
|
+
export declare const KAMINO_PAYPAL_USD_RESERVE_FARM_ID: PublicKey;
|
|
38
|
+
export declare const KAMINO_PAYPAL_USD_RESERVE_COLLATERAL_MINT_ID: PublicKey;
|
|
39
|
+
export declare const KAMINO_PAYPAL_USD_RESERVE_DESTINATION_DEPOSIT_COLLATERAL_ID: PublicKey;
|
|
40
|
+
export declare const KAMINO_FARMS_GLOBAL_CONFIG_ID: PublicKey;
|
|
41
|
+
export declare const KAMINO_PAYPAL_USD_FARM_REWARDS_VAULT: PublicKey;
|
|
42
|
+
export declare const KAMINO_PAYPAL_USD_FARM_REWARDS_TREASURY_VAULT: PublicKey;
|
|
43
|
+
export declare const KAMINO_STANDARD_PROGRAM_ID: PublicKey;
|
|
44
|
+
export declare const METADATA_PROGRAM_ID: PublicKey;
|
package/src/constants.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.METADATA_PROGRAM_ID = exports.KAMINO_STANDARD_PROGRAM_ID = exports.KAMINO_PAYPAL_USD_FARM_REWARDS_TREASURY_VAULT = exports.KAMINO_PAYPAL_USD_FARM_REWARDS_VAULT = exports.KAMINO_FARMS_GLOBAL_CONFIG_ID = exports.KAMINO_PAYPAL_USD_RESERVE_DESTINATION_DEPOSIT_COLLATERAL_ID = exports.KAMINO_PAYPAL_USD_RESERVE_COLLATERAL_MINT_ID = exports.KAMINO_PAYPAL_USD_RESERVE_FARM_ID = exports.KAMINO_PAYPAL_USD_RESERVE_LIQUIDITY_SUPPLY = exports.KAMINO_PAYPAL_USD_RESERVE = exports.PAYPAL_USD_MINT = exports.PYTH_USDC_FEED_ID = exports.KAMINO_RESERVE_LIQUIDITY_SUPPLY_ID = exports.KAMINO_RESERVE_DESTINATION_DEPOSIT_COLLATERAL_ID = exports.KAMINO_RESERVE_COLLATERAL_MINT_ID = exports.KAMINO_SCOPE_PRICES_ID = exports.KAMINO_FARMS_GLOBAL_CONFIG = exports.KAMINO_LENDING_MARKET_AUTHORITY_ID = exports.KAMINO_RESERVE_FARM_STATE_ID = exports.KAMINO_USDC_RESERVE_FARM_ID = exports.KAMINO_RESERVE_ID = exports.KAMINO_LENDING_MARKET_ID = exports.KAMINO_FARMS_PROGRAM_ID = exports.KAMINO_LEND_PROGRAM_ID = exports.getKaminoFarmsObligationFarm = exports.getKaminoLendObligation = exports.getMeta = exports.getKaminoFarmsRewardsVault = exports.getKaminoFarmsRewardsTreasuryVault = exports.getKaminoGlobalConfig = exports.getKaminoFarmsVaultAuthority = exports.getKaminoUserMetadata = exports.getStandardTokenMint = exports.getKaminoReserveCollateralSupply = exports.getKaminoReserveCollateralMint = exports.getKaminoReserveLiquiditySupply = exports.getAccountAuthorityBaseTokenAccount = exports.getStakedReceiptPoolAuthority = exports.getStakedReceiptPool = exports.getPosition = exports.getEmissionTracker = exports.getMintAuthority = exports.getAccountAuthority = void 0;
|
|
27
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
28
|
+
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
29
|
+
const getAccountAuthority = (reserve, programId) => {
|
|
30
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("account_authority"), reserve.toBuffer()], programId)[0];
|
|
31
|
+
};
|
|
32
|
+
exports.getAccountAuthority = getAccountAuthority;
|
|
33
|
+
const getMintAuthority = (reserve, programId) => {
|
|
34
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("mint_authority"), reserve.toBuffer()], programId)[0];
|
|
35
|
+
};
|
|
36
|
+
exports.getMintAuthority = getMintAuthority;
|
|
37
|
+
const getEmissionTracker = (reserve, programId) => {
|
|
38
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("emission_tracker"), reserve.toBuffer()], programId)[0];
|
|
39
|
+
};
|
|
40
|
+
exports.getEmissionTracker = getEmissionTracker;
|
|
41
|
+
const getPosition = (reserve, owner, programId) => {
|
|
42
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("position"), reserve.toBuffer(), owner.toBuffer()], programId)[0];
|
|
43
|
+
};
|
|
44
|
+
exports.getPosition = getPosition;
|
|
45
|
+
const getStakedReceiptPool = (reserve, programId) => {
|
|
46
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("staked_receipt_pool"), reserve.toBuffer()], programId)[0];
|
|
47
|
+
};
|
|
48
|
+
exports.getStakedReceiptPool = getStakedReceiptPool;
|
|
49
|
+
const getStakedReceiptPoolAuthority = (reserve, programId) => {
|
|
50
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("stake_pool_authority"), reserve.toBuffer()], programId)[0];
|
|
51
|
+
};
|
|
52
|
+
exports.getStakedReceiptPoolAuthority = getStakedReceiptPoolAuthority;
|
|
53
|
+
const getAccountAuthorityBaseTokenAccount = (reserve, programId) => {
|
|
54
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("account_authority_token"), reserve.toBuffer()], programId)[0];
|
|
55
|
+
};
|
|
56
|
+
exports.getAccountAuthorityBaseTokenAccount = getAccountAuthorityBaseTokenAccount;
|
|
57
|
+
const getKaminoReserveLiquiditySupply = (lendingMarket, reserveLiquidityMint, kaminoProgramId) => {
|
|
58
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("reserve_liq_supply"), lendingMarket.toBuffer(), reserveLiquidityMint.toBuffer()], kaminoProgramId)[0];
|
|
59
|
+
};
|
|
60
|
+
exports.getKaminoReserveLiquiditySupply = getKaminoReserveLiquiditySupply;
|
|
61
|
+
const getKaminoReserveCollateralMint = (lendingMarket, reserveLiquidityMint, kaminoProgramId) => {
|
|
62
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("reserve_coll_mint"), lendingMarket.toBuffer(), reserveLiquidityMint.toBuffer()], kaminoProgramId)[0];
|
|
63
|
+
};
|
|
64
|
+
exports.getKaminoReserveCollateralMint = getKaminoReserveCollateralMint;
|
|
65
|
+
const getKaminoReserveCollateralSupply = (lendingMarket, reserveLiquidityMint, kaminoProgramId) => {
|
|
66
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("reserve_coll_supply"), lendingMarket.toBuffer(), reserveLiquidityMint.toBuffer()], kaminoProgramId)[0];
|
|
67
|
+
};
|
|
68
|
+
exports.getKaminoReserveCollateralSupply = getKaminoReserveCollateralSupply;
|
|
69
|
+
const getStandardTokenMint = (reserve, programId) => {
|
|
70
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("standard_token_mint"), reserve.toBuffer()], programId)[0];
|
|
71
|
+
};
|
|
72
|
+
exports.getStandardTokenMint = getStandardTokenMint;
|
|
73
|
+
const getKaminoUserMetadata = (user, programId) => {
|
|
74
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("user_meta"), user.toBuffer()], programId)[0];
|
|
75
|
+
};
|
|
76
|
+
exports.getKaminoUserMetadata = getKaminoUserMetadata;
|
|
77
|
+
const getKaminoFarmsVaultAuthority = (farm, programId) => {
|
|
78
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("authority"), farm.toBuffer()], programId)[0];
|
|
79
|
+
};
|
|
80
|
+
exports.getKaminoFarmsVaultAuthority = getKaminoFarmsVaultAuthority;
|
|
81
|
+
const getKaminoGlobalConfig = () => new web3_js_1.PublicKey("6UodrBjL2ZreDy7QdR4YV1oxqMBjVYSEyrFpctqqwGwL");
|
|
82
|
+
exports.getKaminoGlobalConfig = getKaminoGlobalConfig;
|
|
83
|
+
const getKaminoFarmsRewardsTreasuryVault = (reward_mint, globalConfig, kaminoFarmsProgramId) => {
|
|
84
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("tvault"), globalConfig.toBuffer(), reward_mint.toBuffer()], kaminoFarmsProgramId)[0];
|
|
85
|
+
};
|
|
86
|
+
exports.getKaminoFarmsRewardsTreasuryVault = getKaminoFarmsRewardsTreasuryVault;
|
|
87
|
+
const getKaminoFarmsRewardsVault = (reward_mint, kaminoFarm, kaminoFarmsProgramId) => {
|
|
88
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("rvault"), kaminoFarm.toBuffer(), reward_mint.toBuffer()], kaminoFarmsProgramId)[0];
|
|
89
|
+
};
|
|
90
|
+
exports.getKaminoFarmsRewardsVault = getKaminoFarmsRewardsVault;
|
|
91
|
+
const getMeta = (kaminoReserve, programId) => {
|
|
92
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("meta"), kaminoReserve.toBuffer()], programId)[0];
|
|
93
|
+
};
|
|
94
|
+
exports.getMeta = getMeta;
|
|
95
|
+
const getKaminoLendObligation = (owner, lendingMarket, programId) => {
|
|
96
|
+
return anchor.web3.PublicKey.findProgramAddressSync([
|
|
97
|
+
Buffer.from([0]),
|
|
98
|
+
Buffer.from([0]),
|
|
99
|
+
owner.toBuffer(),
|
|
100
|
+
lendingMarket.toBuffer(),
|
|
101
|
+
web3_js_1.SystemProgram.programId.toBuffer(),
|
|
102
|
+
web3_js_1.SystemProgram.programId.toBuffer(),
|
|
103
|
+
], programId)[0];
|
|
104
|
+
};
|
|
105
|
+
exports.getKaminoLendObligation = getKaminoLendObligation;
|
|
106
|
+
const getKaminoFarmsObligationFarm = (obligation, reserveFarmState, programId) => {
|
|
107
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("user"), reserveFarmState.toBuffer(), obligation.toBuffer()], programId)[0];
|
|
108
|
+
};
|
|
109
|
+
exports.getKaminoFarmsObligationFarm = getKaminoFarmsObligationFarm;
|
|
110
|
+
exports.KAMINO_LEND_PROGRAM_ID = new web3_js_1.PublicKey("KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD");
|
|
111
|
+
exports.KAMINO_FARMS_PROGRAM_ID = new web3_js_1.PublicKey("FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr");
|
|
112
|
+
exports.KAMINO_LENDING_MARKET_ID = new web3_js_1.PublicKey("7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF");
|
|
113
|
+
exports.KAMINO_RESERVE_ID = new web3_js_1.PublicKey("D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59");
|
|
114
|
+
exports.KAMINO_USDC_RESERVE_FARM_ID = new web3_js_1.PublicKey("DEe2NZ5dAXGxC7M8Gs9Esd9wZRPdQzG8jNamXqhL5yku");
|
|
115
|
+
exports.KAMINO_RESERVE_FARM_STATE_ID = new web3_js_1.PublicKey("JAvnB9AKtgPsTEoKmn24Bq64UMoYcrtWtq42HHBdsPkh");
|
|
116
|
+
exports.KAMINO_LENDING_MARKET_AUTHORITY_ID = new web3_js_1.PublicKey("9DrvZvyWh1HuAoZxvYWMvkf2XCzryCpGgHqrMjyDWpmo");
|
|
117
|
+
exports.KAMINO_FARMS_GLOBAL_CONFIG = new web3_js_1.PublicKey("6UodrBjL2ZreDy7QdR4YV1oxqMBjVYSEyrFpctqqwGwL");
|
|
118
|
+
exports.KAMINO_SCOPE_PRICES_ID = new web3_js_1.PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C");
|
|
119
|
+
exports.KAMINO_RESERVE_COLLATERAL_MINT_ID = new web3_js_1.PublicKey("B8V6WVjPxW1UGwVDfxH2d2r8SyT4cqn7dQRK6XneVa7D");
|
|
120
|
+
exports.KAMINO_RESERVE_DESTINATION_DEPOSIT_COLLATERAL_ID = new web3_js_1.PublicKey("3DzjXRfxRm6iejfyyMynR4tScddaanrePJ1NJU2XnPPL");
|
|
121
|
+
exports.KAMINO_RESERVE_LIQUIDITY_SUPPLY_ID = new web3_js_1.PublicKey("Bgq7trRgVMeq33yt235zM2onQ4bRDBsY5EWiTetF4qw6");
|
|
122
|
+
exports.PYTH_USDC_FEED_ID = new web3_js_1.PublicKey("Gnt27xtC473ZT2Mw5u8wZ68Z3gULkSTb5DuxJy7eJotD");
|
|
123
|
+
exports.PAYPAL_USD_MINT = new web3_js_1.PublicKey("2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo");
|
|
124
|
+
exports.KAMINO_PAYPAL_USD_RESERVE = new web3_js_1.PublicKey("2gc9Dm1eB6UgVYFBUN9bWks6Kes9PbWSaPaa9DqyvEiN");
|
|
125
|
+
exports.KAMINO_PAYPAL_USD_RESERVE_LIQUIDITY_SUPPLY = new web3_js_1.PublicKey("Gm2itCNPBpBSSrgCA194pmErjwHAFVpvBBFvpdTF5LuJ");
|
|
126
|
+
exports.KAMINO_PAYPAL_USD_RESERVE_FARM_ID = new web3_js_1.PublicKey("DEe2NZ5dAXGxC7M8Gs9Esd9wZRPdQzG8jNamXqhL5yku");
|
|
127
|
+
exports.KAMINO_PAYPAL_USD_RESERVE_COLLATERAL_MINT_ID = new web3_js_1.PublicKey("2dQkXr1e9LBvT2QcfKrzZaWY6gGAAVoCjLgkWFk3Mhkj");
|
|
128
|
+
exports.KAMINO_PAYPAL_USD_RESERVE_DESTINATION_DEPOSIT_COLLATERAL_ID = new web3_js_1.PublicKey("6LNyxFoeThPa3kPAWUYjEXPMsEd93VQUo5cuJfxcXaGp");
|
|
129
|
+
exports.KAMINO_FARMS_GLOBAL_CONFIG_ID = new web3_js_1.PublicKey("6UodrBjL2ZreDy7QdR4YV1oxqMBjVYSEyrFpctqqwGwL");
|
|
130
|
+
exports.KAMINO_PAYPAL_USD_FARM_REWARDS_VAULT = new web3_js_1.PublicKey("5swBaTjW3bHMN4SwkRD1jxDtfJu5JDdrtxt5EZiun9MU");
|
|
131
|
+
exports.KAMINO_PAYPAL_USD_FARM_REWARDS_TREASURY_VAULT = new web3_js_1.PublicKey("E9xC3aoxhEMXBnMkMSvnvNDMQXCAWMKyEqJJ9x9UqwuG");
|
|
132
|
+
exports.KAMINO_STANDARD_PROGRAM_ID = new anchor.web3.PublicKey("XPK1ndTK1xrgRg99ifvdPP1exrx8D1mRXTuxBkkroCx");
|
|
133
|
+
exports.METADATA_PROGRAM_ID = new web3_js_1.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { PublicKey, SystemProgram } from "@solana/web3.js"
|
|
2
|
+
import * as anchor from "@coral-xyz/anchor"
|
|
3
|
+
|
|
4
|
+
export const getAccountAuthority = (reserve: PublicKey, programId: PublicKey) => {
|
|
5
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
6
|
+
[Buffer.from("account_authority"), reserve.toBuffer()],
|
|
7
|
+
programId,
|
|
8
|
+
)[0]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getMintAuthority = (reserve: PublicKey, programId: PublicKey) => {
|
|
12
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("mint_authority"), reserve.toBuffer()], programId)[0]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const getEmissionTracker = (reserve: PublicKey, programId: PublicKey) => {
|
|
16
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
17
|
+
[Buffer.from("emission_tracker"), reserve.toBuffer()],
|
|
18
|
+
programId,
|
|
19
|
+
)[0]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const getPosition = (reserve: PublicKey, owner: PublicKey, programId: PublicKey) => {
|
|
23
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
24
|
+
[Buffer.from("position"), reserve.toBuffer(), owner.toBuffer()],
|
|
25
|
+
programId,
|
|
26
|
+
)[0]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const getStakedReceiptPool = (reserve: PublicKey, programId: PublicKey) => {
|
|
30
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
31
|
+
[Buffer.from("staked_receipt_pool"), reserve.toBuffer()],
|
|
32
|
+
programId,
|
|
33
|
+
)[0]
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const getStakedReceiptPoolAuthority = (reserve: PublicKey, programId: PublicKey) => {
|
|
37
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
38
|
+
[Buffer.from("stake_pool_authority"), reserve.toBuffer()],
|
|
39
|
+
programId,
|
|
40
|
+
)[0]
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const getAccountAuthorityBaseTokenAccount = (reserve: PublicKey, programId: PublicKey) => {
|
|
44
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
45
|
+
[Buffer.from("account_authority_token"), reserve.toBuffer()],
|
|
46
|
+
programId,
|
|
47
|
+
)[0]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const getKaminoReserveLiquiditySupply = (
|
|
51
|
+
lendingMarket: PublicKey,
|
|
52
|
+
reserveLiquidityMint: PublicKey,
|
|
53
|
+
kaminoProgramId: PublicKey,
|
|
54
|
+
) => {
|
|
55
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
56
|
+
[Buffer.from("reserve_liq_supply"), lendingMarket.toBuffer(), reserveLiquidityMint.toBuffer()],
|
|
57
|
+
kaminoProgramId,
|
|
58
|
+
)[0]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const getKaminoReserveCollateralMint = (
|
|
62
|
+
lendingMarket: PublicKey,
|
|
63
|
+
reserveLiquidityMint: PublicKey,
|
|
64
|
+
kaminoProgramId: PublicKey,
|
|
65
|
+
) => {
|
|
66
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
67
|
+
[Buffer.from("reserve_coll_mint"), lendingMarket.toBuffer(), reserveLiquidityMint.toBuffer()],
|
|
68
|
+
kaminoProgramId,
|
|
69
|
+
)[0]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const getKaminoReserveCollateralSupply = (
|
|
73
|
+
lendingMarket: PublicKey,
|
|
74
|
+
reserveLiquidityMint: PublicKey,
|
|
75
|
+
kaminoProgramId: PublicKey,
|
|
76
|
+
) => {
|
|
77
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
78
|
+
[Buffer.from("reserve_coll_supply"), lendingMarket.toBuffer(), reserveLiquidityMint.toBuffer()],
|
|
79
|
+
kaminoProgramId,
|
|
80
|
+
)[0]
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const getStandardTokenMint = (reserve: PublicKey, programId: PublicKey) => {
|
|
84
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
85
|
+
[Buffer.from("standard_token_mint"), reserve.toBuffer()],
|
|
86
|
+
programId,
|
|
87
|
+
)[0]
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const getKaminoUserMetadata = (user: PublicKey, programId: PublicKey) => {
|
|
91
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("user_meta"), user.toBuffer()], programId)[0]
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const getKaminoFarmsVaultAuthority = (farm: PublicKey, programId: PublicKey) => {
|
|
95
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("authority"), farm.toBuffer()], programId)[0]
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const getKaminoGlobalConfig = () => new PublicKey("6UodrBjL2ZreDy7QdR4YV1oxqMBjVYSEyrFpctqqwGwL")
|
|
99
|
+
|
|
100
|
+
export const getKaminoFarmsRewardsTreasuryVault = (
|
|
101
|
+
reward_mint: PublicKey,
|
|
102
|
+
globalConfig: PublicKey,
|
|
103
|
+
kaminoFarmsProgramId: PublicKey,
|
|
104
|
+
) => {
|
|
105
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
106
|
+
[Buffer.from("tvault"), globalConfig.toBuffer(), reward_mint.toBuffer()],
|
|
107
|
+
kaminoFarmsProgramId,
|
|
108
|
+
)[0]
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const getKaminoFarmsRewardsVault = (
|
|
112
|
+
reward_mint: PublicKey,
|
|
113
|
+
kaminoFarm: PublicKey,
|
|
114
|
+
kaminoFarmsProgramId: PublicKey,
|
|
115
|
+
) => {
|
|
116
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
117
|
+
[Buffer.from("rvault"), kaminoFarm.toBuffer(), reward_mint.toBuffer()],
|
|
118
|
+
kaminoFarmsProgramId,
|
|
119
|
+
)[0]
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const getMeta = (kaminoReserve: PublicKey, programId: PublicKey) => {
|
|
123
|
+
return anchor.web3.PublicKey.findProgramAddressSync([Buffer.from("meta"), kaminoReserve.toBuffer()], programId)[0]
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const getKaminoLendObligation = (owner: PublicKey, lendingMarket: PublicKey, programId: PublicKey) => {
|
|
127
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
128
|
+
[
|
|
129
|
+
Buffer.from([0]),
|
|
130
|
+
Buffer.from([0]),
|
|
131
|
+
owner.toBuffer(),
|
|
132
|
+
lendingMarket.toBuffer(),
|
|
133
|
+
SystemProgram.programId.toBuffer(),
|
|
134
|
+
SystemProgram.programId.toBuffer(),
|
|
135
|
+
],
|
|
136
|
+
programId,
|
|
137
|
+
)[0]
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const getKaminoFarmsObligationFarm = (
|
|
141
|
+
obligation: PublicKey,
|
|
142
|
+
reserveFarmState: PublicKey,
|
|
143
|
+
programId: PublicKey,
|
|
144
|
+
) => {
|
|
145
|
+
return anchor.web3.PublicKey.findProgramAddressSync(
|
|
146
|
+
[Buffer.from("user"), reserveFarmState.toBuffer(), obligation.toBuffer()],
|
|
147
|
+
programId,
|
|
148
|
+
)[0]
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export const KAMINO_LEND_PROGRAM_ID = new PublicKey("KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD")
|
|
152
|
+
|
|
153
|
+
export const KAMINO_FARMS_PROGRAM_ID = new PublicKey("FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr")
|
|
154
|
+
|
|
155
|
+
export const KAMINO_LENDING_MARKET_ID = new PublicKey("7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF")
|
|
156
|
+
|
|
157
|
+
export const KAMINO_RESERVE_ID = new PublicKey("D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59")
|
|
158
|
+
|
|
159
|
+
export const KAMINO_USDC_RESERVE_FARM_ID = new PublicKey("DEe2NZ5dAXGxC7M8Gs9Esd9wZRPdQzG8jNamXqhL5yku")
|
|
160
|
+
|
|
161
|
+
export const KAMINO_RESERVE_FARM_STATE_ID = new PublicKey("JAvnB9AKtgPsTEoKmn24Bq64UMoYcrtWtq42HHBdsPkh")
|
|
162
|
+
|
|
163
|
+
export const KAMINO_LENDING_MARKET_AUTHORITY_ID = new PublicKey("9DrvZvyWh1HuAoZxvYWMvkf2XCzryCpGgHqrMjyDWpmo")
|
|
164
|
+
|
|
165
|
+
export const KAMINO_FARMS_GLOBAL_CONFIG = new PublicKey("6UodrBjL2ZreDy7QdR4YV1oxqMBjVYSEyrFpctqqwGwL")
|
|
166
|
+
|
|
167
|
+
export const KAMINO_SCOPE_PRICES_ID = new PublicKey("3NJYftD5sjVfxSnUdZ1wVML8f3aC6mp1CXCL6L7TnU8C")
|
|
168
|
+
|
|
169
|
+
export const KAMINO_RESERVE_COLLATERAL_MINT_ID = new PublicKey("B8V6WVjPxW1UGwVDfxH2d2r8SyT4cqn7dQRK6XneVa7D")
|
|
170
|
+
|
|
171
|
+
export const KAMINO_RESERVE_DESTINATION_DEPOSIT_COLLATERAL_ID = new PublicKey(
|
|
172
|
+
"3DzjXRfxRm6iejfyyMynR4tScddaanrePJ1NJU2XnPPL",
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
export const KAMINO_RESERVE_LIQUIDITY_SUPPLY_ID = new PublicKey("Bgq7trRgVMeq33yt235zM2onQ4bRDBsY5EWiTetF4qw6")
|
|
176
|
+
|
|
177
|
+
export const PYTH_USDC_FEED_ID = new PublicKey("Gnt27xtC473ZT2Mw5u8wZ68Z3gULkSTb5DuxJy7eJotD")
|
|
178
|
+
|
|
179
|
+
export const PAYPAL_USD_MINT = new PublicKey("2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo")
|
|
180
|
+
|
|
181
|
+
export const KAMINO_PAYPAL_USD_RESERVE = new PublicKey("2gc9Dm1eB6UgVYFBUN9bWks6Kes9PbWSaPaa9DqyvEiN")
|
|
182
|
+
|
|
183
|
+
export const KAMINO_PAYPAL_USD_RESERVE_LIQUIDITY_SUPPLY = new PublicKey("Gm2itCNPBpBSSrgCA194pmErjwHAFVpvBBFvpdTF5LuJ")
|
|
184
|
+
|
|
185
|
+
export const KAMINO_PAYPAL_USD_RESERVE_FARM_ID = new PublicKey("DEe2NZ5dAXGxC7M8Gs9Esd9wZRPdQzG8jNamXqhL5yku")
|
|
186
|
+
|
|
187
|
+
export const KAMINO_PAYPAL_USD_RESERVE_COLLATERAL_MINT_ID = new PublicKey(
|
|
188
|
+
"2dQkXr1e9LBvT2QcfKrzZaWY6gGAAVoCjLgkWFk3Mhkj",
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
export const KAMINO_PAYPAL_USD_RESERVE_DESTINATION_DEPOSIT_COLLATERAL_ID = new PublicKey(
|
|
192
|
+
"6LNyxFoeThPa3kPAWUYjEXPMsEd93VQUo5cuJfxcXaGp",
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
export const KAMINO_FARMS_GLOBAL_CONFIG_ID = new PublicKey("6UodrBjL2ZreDy7QdR4YV1oxqMBjVYSEyrFpctqqwGwL")
|
|
196
|
+
|
|
197
|
+
export const KAMINO_PAYPAL_USD_FARM_REWARDS_VAULT = new PublicKey("5swBaTjW3bHMN4SwkRD1jxDtfJu5JDdrtxt5EZiun9MU")
|
|
198
|
+
|
|
199
|
+
export const KAMINO_PAYPAL_USD_FARM_REWARDS_TREASURY_VAULT = new PublicKey(
|
|
200
|
+
"E9xC3aoxhEMXBnMkMSvnvNDMQXCAWMKyEqJJ9x9UqwuG",
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
export const KAMINO_STANDARD_PROGRAM_ID = new anchor.web3.PublicKey("XPK1ndTK1xrgRg99ifvdPP1exrx8D1mRXTuxBkkroCx")
|
|
204
|
+
|
|
205
|
+
export const METADATA_PROGRAM_ID = new PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s")
|