|
1 | 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ |
2 | 2 | import { Connection, LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction } from "@solana/web3.js"; |
3 | 3 | import { CustomChainConfig, IProvider, log } from "@web3auth/base"; |
4 | | -import { SolanaWallet } from "@web3auth/solana-provider"; |
| 4 | +import { SolanaWallet, TransactionOrVersionedTransaction } from "@web3auth/solana-provider"; |
5 | 5 | import base58 from "bs58"; |
6 | 6 |
|
7 | 7 | const getConnection = async (provider: IProvider): Promise<Connection> => { |
@@ -65,7 +65,7 @@ export const signAndSendTransaction = async (provider: IProvider, uiConsole: any |
65 | 65 | feePayer: new PublicKey(pubKey[0]), |
66 | 66 | }).add(transactionInstruction); |
67 | 67 |
|
68 | | - const signature = await solWeb3.signAndSendTransaction(transaction); |
| 68 | + const signature = await solWeb3.signAndSendTransaction(transaction as unknown as TransactionOrVersionedTransaction); |
69 | 69 | uiConsole("signature", signature); |
70 | 70 | } catch (error) { |
71 | 71 | log.error("Error", error); |
@@ -93,7 +93,7 @@ export const signTransaction = async (provider: IProvider, uiConsole: any) => { |
93 | 93 | feePayer: new PublicKey(pubKey[0]), |
94 | 94 | }).add(transactionInstruction); |
95 | 95 |
|
96 | | - const signedTx = await solWeb3.signTransaction(transaction); |
| 96 | + const signedTx = await solWeb3.signTransaction(transaction as unknown as TransactionOrVersionedTransaction); |
97 | 97 | log.info("signedTx", signedTx); |
98 | 98 | uiConsole("signature", signedTx); |
99 | 99 | return { signature: signedTx }; |
@@ -126,9 +126,9 @@ export const signAllTransactions = async (provider: IProvider, uiConsole: any) = |
126 | 126 | log.info("blockhash", blockhash); |
127 | 127 |
|
128 | 128 | const signedTx = await solWeb3.signAllTransactions([ |
129 | | - getNewTx(publicKeys, blockhash), |
130 | | - getNewTx(publicKeys, blockhash), |
131 | | - getNewTx(publicKeys, blockhash), |
| 129 | + getNewTx(publicKeys, blockhash) as unknown as TransactionOrVersionedTransaction, |
| 130 | + getNewTx(publicKeys, blockhash) as unknown as TransactionOrVersionedTransaction, |
| 131 | + getNewTx(publicKeys, blockhash) as unknown as TransactionOrVersionedTransaction, |
132 | 132 | ]); |
133 | 133 | log.info("signedTx", signedTx); |
134 | 134 | uiConsole("signature", signedTx); |
|
0 commit comments