Class: TorqueRequestClient
Last updated
Last updated
@torque-labs/torque-ts-sdk • Docs
@torque-labs/torque-ts-sdk / TorqueRequestClient
The TorqueRequestClient class is used to make requests to the Torque API. It provides methods for performing API requests and handling responses.
Create a new instance of the TorqueRequestClient class.
Parameters
Parameter | Type |
---|---|
Returns
Throws
Throws an error if a signer is not provided.
Defined in
Perform a request to the Torque API.
Type Parameters
Parameters
Returns
Promise
<T
>
The response from the API.
Throws
If there is an error performing the request.
Defined in
Builds and returns a serialized transaction from the API based on the provided transaction input.
Type Parameters
Parameters
Returns
Promise
<T
& { serializedTx
: string
; }>
A promise that resolves with the serialized transaction.
Throws
Throws an error if the API is not able to build the transaction.
Defined in
Executes the serialized transaction using the API.
Parameters
Returns
Promise
<TxnExecuteResponse
>
A promise that resolves with the signature of the transaction.
Throws
Throws an error if the API request is unsuccessful or if the transaction fails.
Defined in
Perform a request to a Torque Function endpoint.
Type Parameters
Parameters
Returns
Promise
<T
>
The response from the API.
Throws
If there is an error performing the request.
Defined in
Signs a transaction with a Keypair.
Parameters
Returns
VersionedTransaction
The signed transaction.
Throws
If the signer is not initialized or if the signer is not a Keypair.
Defined in
Builds and executes the transaction using the Torque API.
Type Parameters
Parameters
Returns
Promise
<WithSignature
<T
>>
A promise that resolves with the signature of the transaction.
Defined in
Perform a regular request to any endpoint.
Type Parameters
Parameters
Returns
Promise
<T
>
The response from the API.
Throws
If there is an error performing the request.
Defined in
Property | Type |
---|---|
Type Parameter | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Type Parameter | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Type Parameter | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Type Parameter | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Type Parameter | Description |
---|---|
Parameter | Type | Description |
---|---|---|