@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.esm.js +21 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -19449,6 +19449,7 @@ class PrivyWalletProvider {
|
|
|
19449
19449
|
const useOAuthTokens = privyImports.useOAuthTokens();
|
|
19450
19450
|
const useFundWalletSolana = privySolana.useFundWallet();
|
|
19451
19451
|
const useSendTransactionSolana = privySolana.useSendTransaction();
|
|
19452
|
+
const { signTransaction } = privySolana.useSignTransaction();
|
|
19452
19453
|
const useSolanaWallets = privySolana.useSolanaWallets();
|
|
19453
19454
|
const useIdentityToken = privyImports.useIdentityToken();
|
|
19454
19455
|
const { createWallet, wallets, ready: walletReady } = privySolana.useSolanaWallets();
|
|
@@ -19544,6 +19545,7 @@ class PrivyWalletProvider {
|
|
|
19544
19545
|
useFundWalletSolana: useFundWalletSolana,
|
|
19545
19546
|
useSendTransactionSolana: useSendTransactionSolana,
|
|
19546
19547
|
useSolanaWallets: useSolanaWallets,
|
|
19548
|
+
signTransaction: signTransaction,
|
|
19547
19549
|
};
|
|
19548
19550
|
}
|
|
19549
19551
|
}, [privy.ready, privy.authenticated, wallets, login, logout, walletReady]);
|
|
@@ -19608,7 +19610,7 @@ class PrivyWalletProvider {
|
|
|
19608
19610
|
await this.privyMethods.logout();
|
|
19609
19611
|
}
|
|
19610
19612
|
async runTransaction(_evmTransactionData, solTransactionData, options) {
|
|
19611
|
-
var _a;
|
|
19613
|
+
var _a, _b, _c;
|
|
19612
19614
|
await this.ensureReady();
|
|
19613
19615
|
let session = await SessionManager.getSession();
|
|
19614
19616
|
let sessionAddress = session === null || session === void 0 ? void 0 : session.address;
|
|
@@ -19677,7 +19679,11 @@ class PrivyWalletProvider {
|
|
|
19677
19679
|
}
|
|
19678
19680
|
try {
|
|
19679
19681
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
19680
|
-
const signedTx = await
|
|
19682
|
+
const signedTx = await ((_b = this.privyMethods) === null || _b === void 0 ? void 0 : _b.signTransaction({
|
|
19683
|
+
transaction: tx,
|
|
19684
|
+
connection,
|
|
19685
|
+
address: wallet.address.toString(),
|
|
19686
|
+
}));
|
|
19681
19687
|
return {
|
|
19682
19688
|
signedTransaction: signedTx,
|
|
19683
19689
|
blockNumber: 0,
|
|
@@ -19685,7 +19691,19 @@ class PrivyWalletProvider {
|
|
|
19685
19691
|
data: ""
|
|
19686
19692
|
};
|
|
19687
19693
|
}
|
|
19688
|
-
const
|
|
19694
|
+
const isSurfnet = connection.rpcEndpoint === SURFNET_RPC_URL;
|
|
19695
|
+
let txSignature;
|
|
19696
|
+
if (isSurfnet) {
|
|
19697
|
+
const signedTx = await ((_c = this.privyMethods) === null || _c === void 0 ? void 0 : _c.signTransaction({
|
|
19698
|
+
transaction: tx,
|
|
19699
|
+
connection,
|
|
19700
|
+
address: wallet.address.toString(),
|
|
19701
|
+
}));
|
|
19702
|
+
txSignature = await connection.sendRawTransaction(signedTx.serialize());
|
|
19703
|
+
}
|
|
19704
|
+
else {
|
|
19705
|
+
txSignature = await privyWallet.sendTransaction(tx, connection);
|
|
19706
|
+
}
|
|
19689
19707
|
return {
|
|
19690
19708
|
transactionSignature: txSignature,
|
|
19691
19709
|
blockNumber: 0,
|