@jup-ag/lend 0.2.0-beta.1 → 0.2.0-beta.2

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.
@@ -202,4 +202,4 @@ const borrow = {
202
202
  getVaultsProgramId: getVaultsProgramId
203
203
  };
204
204
 
205
- export { getTickHasDebt as a, borrow as b, getPosition as c, getTick as d, getTickIdLiquidation as e, getVaultConfig as f, getVaultAdmin as g, getBranch as h, getVaultState as i, getPositionMetadata as j, getPositionTokenAccount as k, getPositionMint as l, getVaultMetadata as m, getLiquidity as n, getClaimAccount as o, getRateModel as p, getUserBorrowPosition as q, getUserSupplyPosition as r, getLiquidityReserve as s };
205
+ export { getPositionMetadata as a, borrow as b, getPositionTokenAccount as c, getPositionMint as d, getPosition as e, getVaultState as f, getVaultAdmin as g, getVaultConfig as h, getVaultMetadata as i, getLiquidity as j, getClaimAccount as k, getRateModel as l, getUserBorrowPosition as m, getUserSupplyPosition as n, getLiquidityReserve as o, getTickHasDebt as p, getTick as q, getBranch as r, getTickIdLiquidation as s };
@@ -0,0 +1,29 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+
3
+ const DEX_PROGRAM_ID = new PublicKey(
4
+ "jupZ4m2GqUCJ5iueMfzQf8khFfH31d4XAQt3RzCT9Vd"
5
+ );
6
+ const getDex = (dexId) => {
7
+ const id = Buffer.alloc(2);
8
+ id.writeUInt16LE(dexId);
9
+ return PublicKey.findProgramAddressSync(
10
+ [Buffer.from("dex"), id],
11
+ DEX_PROGRAM_ID
12
+ )[0];
13
+ };
14
+ const getDexMetadata = (dexId) => {
15
+ const id = Buffer.alloc(2);
16
+ id.writeUInt16LE(dexId);
17
+ return PublicKey.findProgramAddressSync(
18
+ [Buffer.from("dex_metadata"), id],
19
+ DEX_PROGRAM_ID
20
+ )[0];
21
+ };
22
+
23
+ const dex = {
24
+ __proto__: null,
25
+ getDex: getDex,
26
+ getDexMetadata: getDexMetadata
27
+ };
28
+
29
+ export { getDexMetadata as a, dex as d, getDex as g };