flipmeme-sdk 1.2.39 → 1.2.41

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
@@ -2029,7 +2029,7 @@ var SDK_SOLANA_CONFIG = {
2029
2029
  MINT_CHUNK_SIZE: 3,
2030
2030
  BUY_CHUNK_SIZE: 9,
2031
2031
  SELL_CHUNK_SIZE: 9,
2032
- EJECT_CHUNK_SIZE: 9
2032
+ EJECT_CHUNK_SIZE: 7
2033
2033
  };
2034
2034
  var VALID_SIZE_PAIR = {
2035
2035
  3: { maxBufferSize: 8, maxDepth: 3 },
@@ -2284,8 +2284,8 @@ var SolanaConnector = class {
2284
2284
  name,
2285
2285
  tokenUri,
2286
2286
  totalSupply,
2287
- new import_bn.default(1e8),
2288
- new import_bn.default(5e8)
2287
+ new import_bn.default(1e5),
2288
+ new import_bn.default(5e5)
2289
2289
  ).accountsStrict({
2290
2290
  state: SOLANA_PUBKEYS.STATE_ID,
2291
2291
  collection: collectionPda2,
@@ -2644,7 +2644,7 @@ var SolanaConnector = class {
2644
2644
  }).instruction();
2645
2645
  try {
2646
2646
  const { signature, latestBlockhash } = yield this.sendTxn(
2647
- [instruction],
2647
+ new import_web34.Transaction().add(instruction),
2648
2648
  null
2649
2649
  );
2650
2650
  const confirmResult = yield this.config.provider.connection.confirmTransaction({
@@ -2665,12 +2665,10 @@ var SolanaConnector = class {
2665
2665
  if (!this.program) {
2666
2666
  throw new Error("Program not initialized");
2667
2667
  }
2668
- let transactions = [];
2669
2668
  let tokenChunks = getTokenChunks(
2670
2669
  nftInfos,
2671
2670
  SDK_SOLANA_CONFIG.EJECT_CHUNK_SIZE
2672
2671
  );
2673
- console.log("nftInfos from SDK", tokenChunks);
2674
2672
  try {
2675
2673
  for (const chunk of tokenChunks) {
2676
2674
  let transaction = yield this.setUpInstructions(14e5);
@@ -2697,12 +2695,21 @@ var SolanaConnector = class {
2697
2695
  }).instruction();
2698
2696
  transaction.add(instruction);
2699
2697
  }
2700
- transactions.push(transaction);
2698
+ const { signature, latestBlockhash } = yield this.sendTxn(
2699
+ transaction,
2700
+ this.lookupTableAccounts
2701
+ );
2702
+ const confirmResult = yield this.config.provider.connection.confirmTransaction({
2703
+ blockhash: latestBlockhash.blockhash,
2704
+ lastValidBlockHeight: latestBlockhash.lastValidBlockHeight,
2705
+ signature
2706
+ });
2707
+ console.log("confirmResult", confirmResult);
2708
+ if (confirmResult.value.err != null) {
2709
+ throw new Error("ERRORR in ejectAllNftsOfCollection of SDK function");
2710
+ }
2711
+ console.log("signature", signature);
2701
2712
  }
2702
- const { signatures } = yield this.sendTxnForBatch(
2703
- transactions,
2704
- this.lookupTableAccounts
2705
- );
2706
2713
  } catch (e) {
2707
2714
  console.log("ERRORR in ejectAllNftsOfCollection", JSON.stringify(e));
2708
2715
  throw e;
@@ -2725,19 +2732,17 @@ var SolanaConnector = class {
2725
2732
  * not used for now. sendTxnForBatch function is used
2726
2733
  */
2727
2734
  //useSenTxn.ts
2728
- sendTxn(instructions, lookupTableAccounts) {
2735
+ sendTxn(transaction, lookupTableAccounts) {
2729
2736
  return __async(this, null, function* () {
2730
2737
  if (!this.program) {
2731
2738
  console.error("Trade NFT failed: Insufficient data");
2732
2739
  throw new Error("Trade NFT failed: Insufficient data");
2733
2740
  }
2734
- const transaction = new import_web34.Transaction();
2735
- instructions.forEach((inx) => transaction.add(inx));
2736
2741
  const latestBlockhash = yield this.config.provider.connection.getLatestBlockhash("confirmed");
2737
2742
  const messageV0 = new import_web34.TransactionMessage({
2738
2743
  payerKey: this.config.wallet,
2739
2744
  recentBlockhash: latestBlockhash.blockhash,
2740
- instructions
2745
+ instructions: transaction.instructions
2741
2746
  }).compileToV0Message(
2742
2747
  lookupTableAccounts == null ? [] : [lookupTableAccounts]
2743
2748
  );