@elmntl/jlpd-sdk 0.1.5 → 0.1.7
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/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +15 -8
- package/dist/index.mjs +15 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2964,6 +2964,7 @@ interface JupiterLendPool {
|
|
|
2964
2964
|
decimals: number;
|
|
2965
2965
|
stvIndex: number;
|
|
2966
2966
|
hasJupiterLend: boolean;
|
|
2967
|
+
jupDirectSwap: boolean;
|
|
2967
2968
|
}
|
|
2968
2969
|
interface AccountMeta {
|
|
2969
2970
|
pubkey: PublicKey;
|
|
@@ -3191,6 +3192,7 @@ declare class PoolContext {
|
|
|
3191
3192
|
readonly stvBump: number;
|
|
3192
3193
|
readonly vaultStagingAta: PublicKey;
|
|
3193
3194
|
readonly vaultJlpAta: PublicKey;
|
|
3195
|
+
readonly vaultBaseAta: PublicKey;
|
|
3194
3196
|
readonly stvBaseAta: PublicKey;
|
|
3195
3197
|
readonly stvJlxAta: PublicKey;
|
|
3196
3198
|
constructor(client: JlpdClient, pool: JupiterLendPool);
|
package/dist/index.d.ts
CHANGED
|
@@ -2964,6 +2964,7 @@ interface JupiterLendPool {
|
|
|
2964
2964
|
decimals: number;
|
|
2965
2965
|
stvIndex: number;
|
|
2966
2966
|
hasJupiterLend: boolean;
|
|
2967
|
+
jupDirectSwap: boolean;
|
|
2967
2968
|
}
|
|
2968
2969
|
interface AccountMeta {
|
|
2969
2970
|
pubkey: PublicKey;
|
|
@@ -3191,6 +3192,7 @@ declare class PoolContext {
|
|
|
3191
3192
|
readonly stvBump: number;
|
|
3192
3193
|
readonly vaultStagingAta: PublicKey;
|
|
3193
3194
|
readonly vaultJlpAta: PublicKey;
|
|
3195
|
+
readonly vaultBaseAta: PublicKey;
|
|
3194
3196
|
readonly stvBaseAta: PublicKey;
|
|
3195
3197
|
readonly stvJlxAta: PublicKey;
|
|
3196
3198
|
constructor(client: JlpdClient, pool: JupiterLendPool);
|
package/dist/index.js
CHANGED
|
@@ -3467,7 +3467,8 @@ var WSOL_POOL = {
|
|
|
3467
3467
|
claimAccount: new import_web36.PublicKey("6AQGR8zK4KTVZfZ9UZaRzyEL5ynvwVaF5ywVdmtJT24N"),
|
|
3468
3468
|
decimals: 9,
|
|
3469
3469
|
stvIndex: 2 /* SOL */,
|
|
3470
|
-
hasJupiterLend: true
|
|
3470
|
+
hasJupiterLend: true,
|
|
3471
|
+
jupDirectSwap: false
|
|
3471
3472
|
};
|
|
3472
3473
|
var USDC_POOL = {
|
|
3473
3474
|
mint: MINTS.USDC,
|
|
@@ -3482,7 +3483,8 @@ var USDC_POOL = {
|
|
|
3482
3483
|
claimAccount: new import_web36.PublicKey("HN1r4VfkDn53xQQfeGDYrNuDKFdemAhZsHYRwBrFhsW"),
|
|
3483
3484
|
decimals: 6,
|
|
3484
3485
|
stvIndex: 3 /* USDC */,
|
|
3485
|
-
hasJupiterLend: true
|
|
3486
|
+
hasJupiterLend: true,
|
|
3487
|
+
jupDirectSwap: true
|
|
3486
3488
|
};
|
|
3487
3489
|
var JUPUSD_POOL = {
|
|
3488
3490
|
mint: MINTS.JupUSD,
|
|
@@ -3497,7 +3499,8 @@ var JUPUSD_POOL = {
|
|
|
3497
3499
|
claimAccount: new import_web36.PublicKey("6q9vTzAsTMEPUCwuhEdJSJdpRNXnubwKZbi2go1B8nvg"),
|
|
3498
3500
|
decimals: 6,
|
|
3499
3501
|
stvIndex: 4 /* JupUSD */,
|
|
3500
|
-
hasJupiterLend: true
|
|
3502
|
+
hasJupiterLend: true,
|
|
3503
|
+
jupDirectSwap: true
|
|
3501
3504
|
};
|
|
3502
3505
|
var WBTC_POOL = {
|
|
3503
3506
|
mint: MINTS.WBTC,
|
|
@@ -3513,7 +3516,8 @@ var WBTC_POOL = {
|
|
|
3513
3516
|
claimAccount: import_web36.PublicKey.default,
|
|
3514
3517
|
decimals: 8,
|
|
3515
3518
|
stvIndex: 0 /* BTC */,
|
|
3516
|
-
hasJupiterLend: false
|
|
3519
|
+
hasJupiterLend: false,
|
|
3520
|
+
jupDirectSwap: true
|
|
3517
3521
|
};
|
|
3518
3522
|
var WETH_POOL = {
|
|
3519
3523
|
mint: MINTS.WETH,
|
|
@@ -3529,7 +3533,8 @@ var WETH_POOL = {
|
|
|
3529
3533
|
claimAccount: import_web36.PublicKey.default,
|
|
3530
3534
|
decimals: 8,
|
|
3531
3535
|
stvIndex: 1 /* ETH */,
|
|
3532
|
-
hasJupiterLend: false
|
|
3536
|
+
hasJupiterLend: false,
|
|
3537
|
+
jupDirectSwap: true
|
|
3533
3538
|
};
|
|
3534
3539
|
var POOLS = {
|
|
3535
3540
|
SOL: WSOL_POOL,
|
|
@@ -4215,6 +4220,7 @@ var PoolContext = class {
|
|
|
4215
4220
|
const vaultAtas = deriveVaultAtas(pool.fTokenMint, MINTS.JLP, client.vaultPda);
|
|
4216
4221
|
this.vaultStagingAta = vaultAtas.stagingAta;
|
|
4217
4222
|
this.vaultJlpAta = vaultAtas.jlpAta;
|
|
4223
|
+
this.vaultBaseAta = deriveAta(pool.mint, client.vaultPda, true);
|
|
4218
4224
|
const stvAtas = deriveStvAtas(pool.mint, pool.fTokenMint, this.stvPda);
|
|
4219
4225
|
this.stvBaseAta = stvAtas.baseAta;
|
|
4220
4226
|
this.stvJlxAta = stvAtas.jlxAta;
|
|
@@ -4409,8 +4415,9 @@ var SwapContext = class {
|
|
|
4409
4415
|
async quoteJlxJlp(params) {
|
|
4410
4416
|
const poolConfig = getPoolByName(params.pool);
|
|
4411
4417
|
if (!poolConfig) throw new JlpdClientError(`Unknown pool: ${params.pool}`);
|
|
4412
|
-
const
|
|
4413
|
-
const
|
|
4418
|
+
const swapMint = poolConfig.jupDirectSwap ? poolConfig.fTokenMint : poolConfig.mint;
|
|
4419
|
+
const inputMint = params.direction === "JlxToJlp" ? swapMint : MINTS.JLP;
|
|
4420
|
+
const outputMint = params.direction === "JlxToJlp" ? MINTS.JLP : swapMint;
|
|
4414
4421
|
const quote = await getJupiterQuote(
|
|
4415
4422
|
inputMint,
|
|
4416
4423
|
outputMint,
|
|
@@ -4460,7 +4467,7 @@ var SwapContext = class {
|
|
|
4460
4467
|
{
|
|
4461
4468
|
manager: params.manager,
|
|
4462
4469
|
jlpVault: this.client.vaultPda,
|
|
4463
|
-
vaultJlxAta: poolCtx.vaultStagingAta,
|
|
4470
|
+
vaultJlxAta: poolConfig.jupDirectSwap ? poolCtx.vaultStagingAta : poolCtx.vaultBaseAta,
|
|
4464
4471
|
vaultJlpAta: poolCtx.vaultJlpAta,
|
|
4465
4472
|
jlpMint: MINTS.JLP,
|
|
4466
4473
|
tokenProgram: import_spl_token5.TOKEN_PROGRAM_ID,
|
package/dist/index.mjs
CHANGED
|
@@ -3371,7 +3371,8 @@ var WSOL_POOL = {
|
|
|
3371
3371
|
claimAccount: new PublicKey5("6AQGR8zK4KTVZfZ9UZaRzyEL5ynvwVaF5ywVdmtJT24N"),
|
|
3372
3372
|
decimals: 9,
|
|
3373
3373
|
stvIndex: 2 /* SOL */,
|
|
3374
|
-
hasJupiterLend: true
|
|
3374
|
+
hasJupiterLend: true,
|
|
3375
|
+
jupDirectSwap: false
|
|
3375
3376
|
};
|
|
3376
3377
|
var USDC_POOL = {
|
|
3377
3378
|
mint: MINTS.USDC,
|
|
@@ -3386,7 +3387,8 @@ var USDC_POOL = {
|
|
|
3386
3387
|
claimAccount: new PublicKey5("HN1r4VfkDn53xQQfeGDYrNuDKFdemAhZsHYRwBrFhsW"),
|
|
3387
3388
|
decimals: 6,
|
|
3388
3389
|
stvIndex: 3 /* USDC */,
|
|
3389
|
-
hasJupiterLend: true
|
|
3390
|
+
hasJupiterLend: true,
|
|
3391
|
+
jupDirectSwap: true
|
|
3390
3392
|
};
|
|
3391
3393
|
var JUPUSD_POOL = {
|
|
3392
3394
|
mint: MINTS.JupUSD,
|
|
@@ -3401,7 +3403,8 @@ var JUPUSD_POOL = {
|
|
|
3401
3403
|
claimAccount: new PublicKey5("6q9vTzAsTMEPUCwuhEdJSJdpRNXnubwKZbi2go1B8nvg"),
|
|
3402
3404
|
decimals: 6,
|
|
3403
3405
|
stvIndex: 4 /* JupUSD */,
|
|
3404
|
-
hasJupiterLend: true
|
|
3406
|
+
hasJupiterLend: true,
|
|
3407
|
+
jupDirectSwap: true
|
|
3405
3408
|
};
|
|
3406
3409
|
var WBTC_POOL = {
|
|
3407
3410
|
mint: MINTS.WBTC,
|
|
@@ -3417,7 +3420,8 @@ var WBTC_POOL = {
|
|
|
3417
3420
|
claimAccount: PublicKey5.default,
|
|
3418
3421
|
decimals: 8,
|
|
3419
3422
|
stvIndex: 0 /* BTC */,
|
|
3420
|
-
hasJupiterLend: false
|
|
3423
|
+
hasJupiterLend: false,
|
|
3424
|
+
jupDirectSwap: true
|
|
3421
3425
|
};
|
|
3422
3426
|
var WETH_POOL = {
|
|
3423
3427
|
mint: MINTS.WETH,
|
|
@@ -3433,7 +3437,8 @@ var WETH_POOL = {
|
|
|
3433
3437
|
claimAccount: PublicKey5.default,
|
|
3434
3438
|
decimals: 8,
|
|
3435
3439
|
stvIndex: 1 /* ETH */,
|
|
3436
|
-
hasJupiterLend: false
|
|
3440
|
+
hasJupiterLend: false,
|
|
3441
|
+
jupDirectSwap: true
|
|
3437
3442
|
};
|
|
3438
3443
|
var POOLS = {
|
|
3439
3444
|
SOL: WSOL_POOL,
|
|
@@ -4122,6 +4127,7 @@ var PoolContext = class {
|
|
|
4122
4127
|
const vaultAtas = deriveVaultAtas(pool.fTokenMint, MINTS.JLP, client.vaultPda);
|
|
4123
4128
|
this.vaultStagingAta = vaultAtas.stagingAta;
|
|
4124
4129
|
this.vaultJlpAta = vaultAtas.jlpAta;
|
|
4130
|
+
this.vaultBaseAta = deriveAta(pool.mint, client.vaultPda, true);
|
|
4125
4131
|
const stvAtas = deriveStvAtas(pool.mint, pool.fTokenMint, this.stvPda);
|
|
4126
4132
|
this.stvBaseAta = stvAtas.baseAta;
|
|
4127
4133
|
this.stvJlxAta = stvAtas.jlxAta;
|
|
@@ -4316,8 +4322,9 @@ var SwapContext = class {
|
|
|
4316
4322
|
async quoteJlxJlp(params) {
|
|
4317
4323
|
const poolConfig = getPoolByName(params.pool);
|
|
4318
4324
|
if (!poolConfig) throw new JlpdClientError(`Unknown pool: ${params.pool}`);
|
|
4319
|
-
const
|
|
4320
|
-
const
|
|
4325
|
+
const swapMint = poolConfig.jupDirectSwap ? poolConfig.fTokenMint : poolConfig.mint;
|
|
4326
|
+
const inputMint = params.direction === "JlxToJlp" ? swapMint : MINTS.JLP;
|
|
4327
|
+
const outputMint = params.direction === "JlxToJlp" ? MINTS.JLP : swapMint;
|
|
4321
4328
|
const quote = await getJupiterQuote(
|
|
4322
4329
|
inputMint,
|
|
4323
4330
|
outputMint,
|
|
@@ -4367,7 +4374,7 @@ var SwapContext = class {
|
|
|
4367
4374
|
{
|
|
4368
4375
|
manager: params.manager,
|
|
4369
4376
|
jlpVault: this.client.vaultPda,
|
|
4370
|
-
vaultJlxAta: poolCtx.vaultStagingAta,
|
|
4377
|
+
vaultJlxAta: poolConfig.jupDirectSwap ? poolCtx.vaultStagingAta : poolCtx.vaultBaseAta,
|
|
4371
4378
|
vaultJlpAta: poolCtx.vaultJlpAta,
|
|
4372
4379
|
jlpMint: MINTS.JLP,
|
|
4373
4380
|
tokenProgram: TOKEN_PROGRAM_ID2,
|