flipmeme-sdk 1.3.6 → 1.3.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.js CHANGED
@@ -2972,12 +2972,13 @@ var SolanaConnector = class {
2972
2972
  try {
2973
2973
  for (const chunk of tokenChunks) {
2974
2974
  let transaction = yield this.setUpInstructions(14e5);
2975
- index += chunk.length - 1;
2975
+ index += chunk.length;
2976
2976
  let slippagePrice = this.getPriceOfIndex(
2977
2977
  "buy" /* BUY */,
2978
2978
  collectionInfo,
2979
- index
2980
- ).mul(slippage).div(100).toFixed(0);
2979
+ index - 1
2980
+ //when buy it calculates price first and control index
2981
+ ).mul(slippage + 0.01).div(100).toFixed(0);
2981
2982
  for (const nft of chunk) {
2982
2983
  const nftPda2 = nftPda(
2983
2984
  this.configAddresses,
@@ -3040,7 +3041,9 @@ var SolanaConnector = class {
3040
3041
  "sell" /* SELL */,
3041
3042
  collectionInfo,
3042
3043
  index
3043
- ).mul(slippage).div(100).toFixed(0);
3044
+ //when sell it control index and calculate the price
3045
+ ).mul(slippage - 0.01).div(100).toFixed(0);
3046
+ console.log("slippage price", slippagePrice);
3044
3047
  for (const nft of chunk) {
3045
3048
  const nftPda2 = nftPda(
3046
3049
  this.configAddresses,
@@ -3106,8 +3109,9 @@ var SolanaConnector = class {
3106
3109
  let slippagePrice = this.getPriceOfIndex(
3107
3110
  "buy" /* BUY */,
3108
3111
  collectionInfo,
3109
- index
3110
- ).mul(slippage).div(100).toFixed(0);
3112
+ index - 1
3113
+ // when mint calculate price and control index
3114
+ ).mul(slippage + 0.01).div(100).toFixed(0);
3111
3115
  for (const nftName of chunks) {
3112
3116
  const nftSeedKeypair = import_web34.Keypair.generate();
3113
3117
  const nftPda2 = nftPda(