flipmeme-sdk 1.3.48 → 1.3.51

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
@@ -32442,10 +32442,7 @@ var SolanaConnector = class {
32442
32442
  });
32443
32443
  const latestBlockhash = yield this.config.provider.connection.getLatestBlockhash();
32444
32444
  const blockHash = latestBlockhash.blockhash;
32445
- const tx = new import_web34.Transaction({
32446
- feePayer: this.config.wallet,
32447
- recentBlockhash: blockHash
32448
- }).add(modifyComputeUnits).add(addPriorityFee).add(instruction);
32445
+ const tx = new import_web34.Transaction().add(modifyComputeUnits).add(addPriorityFee).add(instruction);
32449
32446
  yield this.sendTxn(tx, this.lookupTableAccounts, [this.updateAuthority]);
32450
32447
  return {
32451
32448
  collectionId: collectionID.toString(),
@@ -32505,7 +32502,7 @@ var SolanaConnector = class {
32505
32502
  );
32506
32503
  return result;
32507
32504
  } catch (e) {
32508
- console.error("Buy failed:", JSON.stringify(e));
32505
+ console.error("Buy failed:", e);
32509
32506
  }
32510
32507
  return { successCount: 0, failedCount: 0 };
32511
32508
  });
@@ -32591,7 +32588,6 @@ var SolanaConnector = class {
32591
32588
  if (!this.program) {
32592
32589
  throw new Error("Program not initialized");
32593
32590
  }
32594
- console.log("====1===");
32595
32591
  const transaction = new import_web34.Transaction().add(
32596
32592
  import_web34.SystemProgram.transfer({
32597
32593
  fromPubkey: params.userPubkey,
@@ -32599,8 +32595,7 @@ var SolanaConnector = class {
32599
32595
  lamports: new import_decimal3.default(params.amount).mul(10 ** 9).floor().toNumber()
32600
32596
  })
32601
32597
  );
32602
- console.log("====2===");
32603
- return yield this.sendTxn(transaction, null, void 0);
32598
+ return yield this.sendTxn(transaction, null);
32604
32599
  });
32605
32600
  }
32606
32601
  claimReferralReward(params) {
@@ -32615,10 +32610,7 @@ var SolanaConnector = class {
32615
32610
  lamports: new import_decimal3.default(params.amount).mul(10 ** 9).floor().toNumber()
32616
32611
  })
32617
32612
  );
32618
- return yield this.config.sendTransaction(
32619
- transaction,
32620
- this.config.provider.connection
32621
- );
32613
+ return yield this.sendTxn(transaction, null);
32622
32614
  });
32623
32615
  }
32624
32616
  getCollectionInfo(collectionId) {
@@ -32947,9 +32939,7 @@ var SolanaConnector = class {
32947
32939
  console.error("Trade NFT failed: Insufficient data");
32948
32940
  throw new Error("Trade NFT failed: Insufficient data");
32949
32941
  }
32950
- console.log("===3===");
32951
32942
  const latestBlockhash = yield this.config.provider.connection.getLatestBlockhash("confirmed");
32952
- console.log("===4===", this.config.wallet.toBase58());
32953
32943
  const messageV0 = new import_web34.TransactionMessage({
32954
32944
  payerKey: this.config.wallet,
32955
32945
  recentBlockhash: latestBlockhash.blockhash,
@@ -32957,18 +32947,17 @@ var SolanaConnector = class {
32957
32947
  }).compileToV0Message(
32958
32948
  lookupTableAccounts == null ? [] : [lookupTableAccounts]
32959
32949
  );
32960
- console.log("===5===");
32961
32950
  const tx = new import_web34.VersionedTransaction(messageV0);
32951
+ const sim = yield this.config.provider.connection.simulateTransaction(tx);
32952
+ console.log("simulation result == ", sim);
32953
+ console.log("transaction size ", tx.serialize().length);
32962
32954
  if (additionalSigner) {
32963
32955
  tx.sign(additionalSigner);
32964
32956
  }
32965
- console.log("===6===");
32966
- const signedTx = yield this.config.signAllTransactions([tx]);
32967
- const signature = yield this.config.provider.connection.sendTransaction(
32968
- signedTx[0],
32969
- { skipPreflight: true, preflightCommitment: "confirmed" }
32957
+ const signature = yield this.config.sendTransaction(
32958
+ tx,
32959
+ this.config.provider.connection
32970
32960
  );
32971
- console.log("===7===");
32972
32961
  return {
32973
32962
  signature,
32974
32963
  latestBlockhash
@@ -33027,14 +33016,17 @@ var SolanaConnector = class {
33027
33016
  return __async(this, null, function* () {
33028
33017
  let successCount = 0;
33029
33018
  let failedCount = 0;
33019
+ console.log("===confirm signature===", signatures);
33030
33020
  for (const index in signatures) {
33031
33021
  if (signatures[index]) {
33032
33022
  if (signatures[index].signature) {
33023
+ console.log("===confirm signature===", signatures[index].signature);
33033
33024
  const confirmResult = yield this.config.provider.connection.confirmTransaction({
33034
33025
  blockhash: latestBlockhash.blockhash,
33035
33026
  lastValidBlockHeight: latestBlockhash.lastValidBlockHeight,
33036
33027
  signature: signatures[index].signature
33037
33028
  });
33029
+ console.log("===confirm result===", confirmResult);
33038
33030
  if (confirmResult.value.err == null) {
33039
33031
  successCount += transactions[index].instructionCount;
33040
33032
  } else {