@primuslabs/fund-js-sdk 0.1.25 → 0.1.27

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
@@ -187,7 +187,7 @@ var formatErrFn = (error) => {
187
187
  if (isNoPendingWithdrawals) {
188
188
  formatError = "no pending withdrawals";
189
189
  }
190
- const insufficientBalanceErrStrArr = ["insufficient balance", "INSUFFICIENT_FUNDS", "The caller does not have enough funds for value transfer."];
190
+ const insufficientBalanceErrStrArr = ["insufficient balance", "INSUFFICIENT_FUNDS", "The caller does not have enough funds for value transfer.", "insufficient lamports", "Attempt to debit an account but found no record of a prior credit"];
191
191
  const isInsufficientBalance = hasErrorFlagFn(curErrorStrArr, insufficientBalanceErrStrArr);
192
192
  if (isInsufficientBalance) {
193
193
  formatError = "insufficient balance";
@@ -5958,11 +5958,8 @@ async function reClaim({
5958
5958
  tx = new import_web33.Transaction().add(instruction);
5959
5959
  tx.feePayer = userKey;
5960
5960
  tx.recentBlockhash = (await provider.connection.getLatestBlockhash()).blockhash;
5961
- signatureStr = await provider.sendAndConfirm(tx);
5962
- return resolve(signatureStr);
5963
5961
  console.log("UnSigned tx size:", tx.serialize({ requireAllSignatures: false, verifySignatures: false }).length, "bytes");
5964
5962
  const signedTx = await provider.wallet.signTransaction(tx);
5965
- signedTx.partialSign();
5966
5963
  signatureStr = getTxSigStrFromTx(signedTx);
5967
5964
  const isOnChain = await getTxIsOnChain(signatureStr, provider.connection);
5968
5965
  if (isOnChain) {
@@ -5971,7 +5968,9 @@ async function reClaim({
5971
5968
  } else {
5972
5969
  const serializeSignedTx = signedTx.serialize();
5973
5970
  console.log("Signed tx size:", serializeSignedTx.length, "bytes");
5974
- signatureStr = await provider.connection.sendRawTransaction(serializeSignedTx);
5971
+ const rpc = "https://unipay-solanam-6275.mainnet.rpcpool.com";
5972
+ const rpcConnection = new import_web33.Connection(rpc);
5973
+ signatureStr = await rpcConnection.sendRawTransaction(serializeSignedTx);
5975
5974
  console.log("reClaim done ", signatureStr);
5976
5975
  return resolve(signatureStr);
5977
5976
  }
package/dist/index.mjs CHANGED
@@ -153,7 +153,7 @@ var formatErrFn = (error) => {
153
153
  if (isNoPendingWithdrawals) {
154
154
  formatError = "no pending withdrawals";
155
155
  }
156
- const insufficientBalanceErrStrArr = ["insufficient balance", "INSUFFICIENT_FUNDS", "The caller does not have enough funds for value transfer."];
156
+ const insufficientBalanceErrStrArr = ["insufficient balance", "INSUFFICIENT_FUNDS", "The caller does not have enough funds for value transfer.", "insufficient lamports", "Attempt to debit an account but found no record of a prior credit"];
157
157
  const isInsufficientBalance = hasErrorFlagFn(curErrorStrArr, insufficientBalanceErrStrArr);
158
158
  if (isInsufficientBalance) {
159
159
  formatError = "insufficient balance";
@@ -5547,6 +5547,7 @@ var zktlsIdl_default = {
5547
5547
  import * as anchor2 from "@coral-xyz/anchor";
5548
5548
  import {
5549
5549
  PublicKey as PublicKey3,
5550
+ Connection as Connection2,
5550
5551
  SystemProgram,
5551
5552
  Transaction,
5552
5553
  Keypair
@@ -5931,11 +5932,8 @@ async function reClaim({
5931
5932
  tx = new Transaction().add(instruction);
5932
5933
  tx.feePayer = userKey;
5933
5934
  tx.recentBlockhash = (await provider.connection.getLatestBlockhash()).blockhash;
5934
- signatureStr = await provider.sendAndConfirm(tx);
5935
- return resolve(signatureStr);
5936
5935
  console.log("UnSigned tx size:", tx.serialize({ requireAllSignatures: false, verifySignatures: false }).length, "bytes");
5937
5936
  const signedTx = await provider.wallet.signTransaction(tx);
5938
- signedTx.partialSign();
5939
5937
  signatureStr = getTxSigStrFromTx(signedTx);
5940
5938
  const isOnChain = await getTxIsOnChain(signatureStr, provider.connection);
5941
5939
  if (isOnChain) {
@@ -5944,7 +5942,9 @@ async function reClaim({
5944
5942
  } else {
5945
5943
  const serializeSignedTx = signedTx.serialize();
5946
5944
  console.log("Signed tx size:", serializeSignedTx.length, "bytes");
5947
- signatureStr = await provider.connection.sendRawTransaction(serializeSignedTx);
5945
+ const rpc = "https://unipay-solanam-6275.mainnet.rpcpool.com";
5946
+ const rpcConnection = new Connection2(rpc);
5947
+ signatureStr = await rpcConnection.sendRawTransaction(serializeSignedTx);
5948
5948
  console.log("reClaim done ", signatureStr);
5949
5949
  return resolve(signatureStr);
5950
5950
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primuslabs/fund-js-sdk",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "author": "Primus Labs <dev@primuslabs.org>",
5
5
  "description": "Primus fund js sdk",
6
6
  "repository": {