TorqueTransactionsModule
@torque-labs/sdk / TorqueTransactionsModule
Class: TorqueTransactionsModule
Defined in: sdk/src/modules/transactions.ts:16
The TorqueTransactionsModule class is used to handle transactions for the Torque SDK. It provides methods for creating, signing, and sending transactions.
Param
The signer for the transactions
Param
The RPC connection for the Solana network
Constructors
new TorqueTransactionsModule()
new TorqueTransactionsModule(connection, signer?): TorqueTransactionsModuleDefined in: sdk/src/modules/transactions.ts:32
Parameters
connection
Connection
signer?
Adapter | Keypair
Returns
TorqueTransactionsModule
Properties
_connection
Connection
The RPC connection for the Solana network
_publicKey
undefined | null | PublicKey
The public key of the signer
Accessors
signer
Set Signature
set signer(value): voidDefined in: sdk/src/modules/transactions.ts:40
Set the signer for the transactions
Parameters
value
| Adapter | Keypair | PrivySolanaWallet
Returns
void
Methods
sendTransaction()
sendTransaction(serializedtx): Promise<string>Defined in: sdk/src/modules/transactions.ts:157
Send a transaction to the network.
Parameters
serializedTx
string
The transaction to send
Returns
Promise<string>
The signature of the completed transaction after confirmation
signOrSendTransaction()
private signOrSendTransaction(serializedtx, execute): Promise<string>Defined in: sdk/src/modules/transactions.ts:53
Execute or sign a transaction from a Solana action.
Parameters
serializedTx
string
The serialized transaction
execute
boolean
Whether to execute the transaction
Returns
Promise<string>
The signature of the transaction
signTransaction()
signTransaction(serializedtx): Promise<string>Defined in: sdk/src/modules/transactions.ts:146
Sign and return the transaction signature.
Parameters
serializedTx
string
The transaction to sign
Returns
Promise<string>
The signature of the signed transaction
signWithKeypair()
private signWithKeypair(txn): VersionedTransactionDefined in: sdk/src/modules/transactions.ts:170
Signs a transaction with a Keypair.
Parameters
txn
VersionedTransaction
The versioned transaction to sign with a keypair
Returns
VersionedTransaction
The signer transaction
Throws
An error if the signer is not initialized or if there is an issue signing the transaction
Last updated
