TorqueTransactionsModule

@torque-labs/sdk


@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?): TorqueTransactionsModule

Defined in: sdk/src/modules/transactions.ts:32

Parameters

Parameter
Type

connection

Connection

signer?

Adapter | Keypair

Returns

TorqueTransactionsModule

Properties

Property
Type
Description

_connection

Connection

The RPC connection for the Solana network

_publicKey

undefined | null | PublicKey

The public key of the signer

_signer

| undefined | Adapter | Keypair | PrivySolanaWallet

The signer for the transactions

Accessors

signer

Set Signature

set signer(value): void

Defined in: sdk/src/modules/transactions.ts:40

Set the signer for the transactions

Parameters

Parameter
Type

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

Parameter
Type
Description

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

Parameter
Type
Description

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

Parameter
Type
Description

serializedTx

string

The transaction to sign

Returns

Promise<string>

The signature of the signed transaction


signWithKeypair()

private signWithKeypair(txn): VersionedTransaction

Defined in: sdk/src/modules/transactions.ts:170

Signs a transaction with a Keypair.

Parameters

Parameter
Type
Description

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