@pooflabs/web 0.0.4 → 0.0.5

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
@@ -19469,6 +19469,7 @@ class PrivyWalletProvider {
19469
19469
  const useOAuthTokens = privyImports.useOAuthTokens();
19470
19470
  const useFundWalletSolana = privySolana.useFundWallet();
19471
19471
  const useSendTransactionSolana = privySolana.useSendTransaction();
19472
+ const { signTransaction } = privySolana.useSignTransaction();
19472
19473
  const useSolanaWallets = privySolana.useSolanaWallets();
19473
19474
  const useIdentityToken = privyImports.useIdentityToken();
19474
19475
  const { createWallet, wallets, ready: walletReady } = privySolana.useSolanaWallets();
@@ -19564,6 +19565,7 @@ class PrivyWalletProvider {
19564
19565
  useFundWalletSolana: useFundWalletSolana,
19565
19566
  useSendTransactionSolana: useSendTransactionSolana,
19566
19567
  useSolanaWallets: useSolanaWallets,
19568
+ signTransaction: signTransaction,
19567
19569
  };
19568
19570
  }
19569
19571
  }, [privy.ready, privy.authenticated, wallets, login, logout, walletReady]);
@@ -19628,7 +19630,7 @@ class PrivyWalletProvider {
19628
19630
  await this.privyMethods.logout();
19629
19631
  }
19630
19632
  async runTransaction(_evmTransactionData, solTransactionData, options) {
19631
- var _a;
19633
+ var _a, _b, _c;
19632
19634
  await this.ensureReady();
19633
19635
  let session = await SessionManager.getSession();
19634
19636
  let sessionAddress = session === null || session === void 0 ? void 0 : session.address;
@@ -19697,7 +19699,11 @@ class PrivyWalletProvider {
19697
19699
  }
19698
19700
  try {
19699
19701
  if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
19700
- const signedTx = await wallet.signTransaction(tx);
19702
+ const signedTx = await ((_b = this.privyMethods) === null || _b === void 0 ? void 0 : _b.signTransaction({
19703
+ transaction: tx,
19704
+ connection,
19705
+ address: wallet.address.toString(),
19706
+ }));
19701
19707
  return {
19702
19708
  signedTransaction: signedTx,
19703
19709
  blockNumber: 0,
@@ -19705,7 +19711,19 @@ class PrivyWalletProvider {
19705
19711
  data: ""
19706
19712
  };
19707
19713
  }
19708
- const txSignature = await wallet.sendTransaction(tx, connection);
19714
+ const isSurfnet = connection.rpcEndpoint === SURFNET_RPC_URL;
19715
+ let txSignature;
19716
+ if (isSurfnet) {
19717
+ const signedTx = await ((_c = this.privyMethods) === null || _c === void 0 ? void 0 : _c.signTransaction({
19718
+ transaction: tx,
19719
+ connection,
19720
+ address: wallet.address.toString(),
19721
+ }));
19722
+ txSignature = await connection.sendRawTransaction(signedTx.serialize());
19723
+ }
19724
+ else {
19725
+ txSignature = await privyWallet.sendTransaction(tx, connection);
19726
+ }
19709
19727
  return {
19710
19728
  transactionSignature: txSignature,
19711
19729
  blockNumber: 0,