@meteora-ag/cp-amm-sdk 1.1.5-rc.2 → 1.1.6
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.js +6 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -7689,10 +7689,10 @@ var _bytes = require('@coral-xyz/anchor/dist/cjs/utils/bytes');
|
|
|
7689
7689
|
function getTokenProgram(flag) {
|
|
7690
7690
|
return flag == 0 ? _spltoken.TOKEN_PROGRAM_ID : _spltoken.TOKEN_2022_PROGRAM_ID;
|
|
7691
7691
|
}
|
|
7692
|
-
var getTokenDecimals = (connection, mint) => __async(
|
|
7692
|
+
var getTokenDecimals = (connection, mint) => __async(null, null, function* () {
|
|
7693
7693
|
return (yield _spltoken.getMint.call(void 0, connection, mint)).decimals;
|
|
7694
7694
|
});
|
|
7695
|
-
var getOrCreateATAInstruction = (_0, _1, _2, ..._3) => __async(
|
|
7695
|
+
var getOrCreateATAInstruction = (_0, _1, _2, ..._3) => __async(null, [_0, _1, _2, ..._3], function* (connection, tokenMint, owner, payer = owner, allowOwnerOffCurve = true, tokenProgram) {
|
|
7696
7696
|
const toAccount = _spltoken.getAssociatedTokenAddressSync.call(void 0,
|
|
7697
7697
|
tokenMint,
|
|
7698
7698
|
owner,
|
|
@@ -7738,7 +7738,7 @@ var wrapSOLInstruction = (from, to, amount) => {
|
|
|
7738
7738
|
})
|
|
7739
7739
|
];
|
|
7740
7740
|
};
|
|
7741
|
-
var unwrapSOLInstruction = (_0, ..._1) => __async(
|
|
7741
|
+
var unwrapSOLInstruction = (_0, ..._1) => __async(null, [_0, ..._1], function* (owner, receiver = owner, allowOwnerOffCurve = true) {
|
|
7742
7742
|
const wSolATAAccount = _spltoken.getAssociatedTokenAddressSync.call(void 0,
|
|
7743
7743
|
_spltoken.NATIVE_MINT,
|
|
7744
7744
|
owner,
|
|
@@ -7816,7 +7816,7 @@ function getAllPositionNftAccountByOwner(connection, user) {
|
|
|
7816
7816
|
|
|
7817
7817
|
|
|
7818
7818
|
|
|
7819
|
-
var getSimulationComputeUnits = (connection, instructions, payer, lookupTables, commitment = "confirmed") => __async(
|
|
7819
|
+
var getSimulationComputeUnits = (connection, instructions, payer, lookupTables, commitment = "confirmed") => __async(null, null, function* () {
|
|
7820
7820
|
var _a, _b, _c;
|
|
7821
7821
|
const testInstructions = [
|
|
7822
7822
|
// Set an arbitrarily high number in simulation
|
|
@@ -7848,7 +7848,7 @@ var getSimulationComputeUnits = (connection, instructions, payer, lookupTables,
|
|
|
7848
7848
|
}
|
|
7849
7849
|
return rpcResponse.value.unitsConsumed || null;
|
|
7850
7850
|
});
|
|
7851
|
-
var getEstimatedComputeUnitUsageWithBuffer = (connection, instructions, feePayer, buffer) => __async(
|
|
7851
|
+
var getEstimatedComputeUnitUsageWithBuffer = (connection, instructions, feePayer, buffer) => __async(null, null, function* () {
|
|
7852
7852
|
if (!buffer) {
|
|
7853
7853
|
buffer = 0.1;
|
|
7854
7854
|
}
|
|
@@ -7871,7 +7871,7 @@ var getEstimatedComputeUnitUsageWithBuffer = (connection, instructions, feePayer
|
|
|
7871
7871
|
}
|
|
7872
7872
|
return estimatedComputeUnitUsage + extraComputeUnitBuffer;
|
|
7873
7873
|
});
|
|
7874
|
-
var getEstimatedComputeUnitIxWithBuffer = (connection, instructions, feePayer, buffer) => __async(
|
|
7874
|
+
var getEstimatedComputeUnitIxWithBuffer = (connection, instructions, feePayer, buffer) => __async(null, null, function* () {
|
|
7875
7875
|
const units = yield getEstimatedComputeUnitUsageWithBuffer(
|
|
7876
7876
|
connection,
|
|
7877
7877
|
instructions,
|
|
@@ -8273,9 +8273,6 @@ function getFeeInPeriod(cliffFeeNumerator, reductionFactor, passedPeriod) {
|
|
|
8273
8273
|
throw new Error("Math overflow");
|
|
8274
8274
|
}
|
|
8275
8275
|
const fee = result.mul(cliffFeeNumerator).shrn(SCALE_OFFSET);
|
|
8276
|
-
if (fee.gt(U64_MAX)) {
|
|
8277
|
-
throw new Error("Type cast failed: fee does not fit in u64");
|
|
8278
|
-
}
|
|
8279
8276
|
return fee;
|
|
8280
8277
|
}
|
|
8281
8278
|
function getFeeMode(collectFeeMode, tradeDirection, hasReferral) {
|
|
@@ -8314,9 +8311,6 @@ function getTotalFeeNumerator(poolFees, baseFeeNumerator, maxFeeNumerator) {
|
|
|
8314
8311
|
);
|
|
8315
8312
|
}
|
|
8316
8313
|
const totalFeeNumerator = dynamicFeeNumerator.add(baseFeeNumerator);
|
|
8317
|
-
if (totalFeeNumerator.gt(U64_MAX)) {
|
|
8318
|
-
throw new Error("Type cast failed: fee does not fit in u64");
|
|
8319
|
-
}
|
|
8320
8314
|
return _anchor.BN.min(totalFeeNumerator, maxFeeNumerator);
|
|
8321
8315
|
}
|
|
8322
8316
|
function getTotalTradingFeeFromIncludedFeeAmount(poolFees, currentPoint, activationPoint, includedFeeAmount, tradeDirection, maxFeeNumerator) {
|