@meteora-ag/dynamic-bonding-curve-sdk 1.4.7 → 1.4.8
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.cjs +21 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
} from "@solana/web3.js";
|
|
8
8
|
|
|
9
9
|
// src/types.ts
|
|
10
|
-
var ActivationType = /* @__PURE__ */ ((
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
10
|
+
var ActivationType = /* @__PURE__ */ ((ActivationType4) => {
|
|
11
|
+
ActivationType4[ActivationType4["Slot"] = 0] = "Slot";
|
|
12
|
+
ActivationType4[ActivationType4["Timestamp"] = 1] = "Timestamp";
|
|
13
|
+
return ActivationType4;
|
|
14
14
|
})(ActivationType || {});
|
|
15
15
|
var TokenType = /* @__PURE__ */ ((TokenType2) => {
|
|
16
16
|
TokenType2[TokenType2["SPL"] = 0] = "SPL";
|
|
@@ -25148,7 +25148,7 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25148
25148
|
* @param quoteMint - The quote mint token
|
|
25149
25149
|
* @returns Instructions for the first buy
|
|
25150
25150
|
*/
|
|
25151
|
-
async swapBuyTx(firstBuyParam, baseMint, config, baseFee, swapBaseForQuote,
|
|
25151
|
+
async swapBuyTx(firstBuyParam, baseMint, config, baseFee, swapBaseForQuote, activationType, tokenType, quoteMint) {
|
|
25152
25152
|
const {
|
|
25153
25153
|
buyer,
|
|
25154
25154
|
receiver,
|
|
@@ -25159,6 +25159,10 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25159
25159
|
validateSwapAmount(buyAmount);
|
|
25160
25160
|
let rateLimiterApplied = false;
|
|
25161
25161
|
if (baseFee.baseFeeMode === 2 /* RateLimiter */) {
|
|
25162
|
+
const currentPoint = await getCurrentPoint(
|
|
25163
|
+
this.connection,
|
|
25164
|
+
activationType
|
|
25165
|
+
);
|
|
25162
25166
|
rateLimiterApplied = isRateLimiterApplied(
|
|
25163
25167
|
currentPoint,
|
|
25164
25168
|
new BN16(0),
|
|
@@ -25380,10 +25384,6 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25380
25384
|
params.tokenType,
|
|
25381
25385
|
quoteMintToken
|
|
25382
25386
|
);
|
|
25383
|
-
const currentPoint = await getCurrentPoint(
|
|
25384
|
-
this.connection,
|
|
25385
|
-
configParam.activationType
|
|
25386
|
-
);
|
|
25387
25387
|
let swapBuyTx;
|
|
25388
25388
|
if (params.firstBuyParam && params.firstBuyParam.buyAmount.gt(new BN16(0))) {
|
|
25389
25389
|
swapBuyTx = await this.swapBuyTx(
|
|
@@ -25392,7 +25392,7 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25392
25392
|
configKey,
|
|
25393
25393
|
configParam.poolFees.baseFee,
|
|
25394
25394
|
false,
|
|
25395
|
-
|
|
25395
|
+
configParam.activationType,
|
|
25396
25396
|
params.tokenType,
|
|
25397
25397
|
quoteMintToken
|
|
25398
25398
|
);
|
|
@@ -25422,10 +25422,6 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25422
25422
|
tokenType,
|
|
25423
25423
|
quoteMint
|
|
25424
25424
|
);
|
|
25425
|
-
const currentPoint = await getCurrentPoint(
|
|
25426
|
-
this.connection,
|
|
25427
|
-
poolConfigState.activationType
|
|
25428
|
-
);
|
|
25429
25425
|
let swapBuyTx;
|
|
25430
25426
|
if (firstBuyParam && firstBuyParam.buyAmount.gt(new BN16(0))) {
|
|
25431
25427
|
swapBuyTx = await this.swapBuyTx(
|
|
@@ -25434,7 +25430,7 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25434
25430
|
config,
|
|
25435
25431
|
poolConfigState.poolFees.baseFee,
|
|
25436
25432
|
false,
|
|
25437
|
-
|
|
25433
|
+
poolConfigState.activationType,
|
|
25438
25434
|
tokenType,
|
|
25439
25435
|
quoteMint
|
|
25440
25436
|
);
|
|
@@ -25461,10 +25457,6 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25461
25457
|
tokenType,
|
|
25462
25458
|
quoteMint
|
|
25463
25459
|
);
|
|
25464
|
-
const currentPoint = await getCurrentPoint(
|
|
25465
|
-
this.connection,
|
|
25466
|
-
poolConfigState.activationType
|
|
25467
|
-
);
|
|
25468
25460
|
let partnerSwapBuyTx;
|
|
25469
25461
|
if (partnerFirstBuyParam && partnerFirstBuyParam.buyAmount.gt(new BN16(0))) {
|
|
25470
25462
|
partnerSwapBuyTx = await this.swapBuyTx(
|
|
@@ -25479,7 +25471,7 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25479
25471
|
config,
|
|
25480
25472
|
poolConfigState.poolFees.baseFee,
|
|
25481
25473
|
false,
|
|
25482
|
-
|
|
25474
|
+
poolConfigState.activationType,
|
|
25483
25475
|
tokenType,
|
|
25484
25476
|
quoteMint
|
|
25485
25477
|
);
|
|
@@ -25498,7 +25490,7 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25498
25490
|
config,
|
|
25499
25491
|
poolConfigState.poolFees.baseFee,
|
|
25500
25492
|
false,
|
|
25501
|
-
|
|
25493
|
+
poolConfigState.activationType,
|
|
25502
25494
|
tokenType,
|
|
25503
25495
|
quoteMint
|
|
25504
25496
|
);
|
|
@@ -25539,12 +25531,12 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25539
25531
|
throw new Error(`Pool config not found for virtual pool`);
|
|
25540
25532
|
}
|
|
25541
25533
|
validateSwapAmount(amountIn);
|
|
25542
|
-
const currentPoint = await getCurrentPoint(
|
|
25543
|
-
this.connection,
|
|
25544
|
-
poolConfigState.activationType
|
|
25545
|
-
);
|
|
25546
25534
|
let rateLimiterApplied = false;
|
|
25547
25535
|
if (poolConfigState.poolFees.baseFee.baseFeeMode === 2 /* RateLimiter */) {
|
|
25536
|
+
const currentPoint = await getCurrentPoint(
|
|
25537
|
+
this.connection,
|
|
25538
|
+
poolConfigState.activationType
|
|
25539
|
+
);
|
|
25548
25540
|
rateLimiterApplied = isRateLimiterApplied(
|
|
25549
25541
|
currentPoint,
|
|
25550
25542
|
poolState.activationPoint,
|
|
@@ -25650,12 +25642,12 @@ var PoolService = class extends DynamicBondingCurveProgram {
|
|
|
25650
25642
|
if (!poolConfigState) {
|
|
25651
25643
|
throw new Error(`Pool config not found for virtual pool`);
|
|
25652
25644
|
}
|
|
25653
|
-
const currentPoint = await getCurrentPoint(
|
|
25654
|
-
this.connection,
|
|
25655
|
-
poolConfigState.activationType
|
|
25656
|
-
);
|
|
25657
25645
|
let rateLimiterApplied = false;
|
|
25658
25646
|
if (poolConfigState.poolFees.baseFee.baseFeeMode === 2 /* RateLimiter */) {
|
|
25647
|
+
const currentPoint = await getCurrentPoint(
|
|
25648
|
+
this.connection,
|
|
25649
|
+
poolConfigState.activationType
|
|
25650
|
+
);
|
|
25659
25651
|
rateLimiterApplied = isRateLimiterApplied(
|
|
25660
25652
|
currentPoint,
|
|
25661
25653
|
poolState.activationPoint,
|