TorqueActionsModule

@torque-labs/sdk


@torque-labs/sdk / TorqueActionsModule

Class: TorqueActionsModule

Defined in: sdk/src/modules/actions.ts:16

The TorqueActionsModule class is used to interact with the actions endpoints of the Torque API.

Param

The URL of the Torque API server

Param

The public key of the user

Param

The auth token for the API

Constructors

new TorqueActionsModule()

new TorqueActionsModule(
   url, 
   transactions, 
   publicKey?, 
   token?): TorqueActionsModule

Defined in: sdk/src/modules/actions.ts:22

Parameters

Parameter
Type

url

string

publicKey?

string

token?

string

Returns

TorqueActionsModule

Properties

Property
Type

_publicKey

undefined | string

_token

undefined | string

baseUrl

string

Accessors

publicKey

Set Signature

set publicKey(value): void

Defined in: sdk/src/modules/actions.ts:39

Set private public key for the actions module

Parameters

Parameter
Type

value

undefined | string

Returns

void


token

Set Signature

set token(value): void

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

Set private token for the actions module

Parameters

Parameter
Type

value

undefined | string

Returns

void

Methods

executeAction()

executeAction(offerid, index): Promise<string>

Defined in: sdk/src/modules/actions.ts:80

Execute an action.

Parameters

Parameter
Type
Description

offerId

string

The offer ID

index

number

The index of the action

Returns

Promise<string>

The signature of the transaction


executeXAction()

executeXAction(
   targetType, 
   targetId, 
   telegramId?, 
source?): Promise<void>

Defined in: sdk/src/modules/actions.ts:96

Execute an X action

Parameters

Parameter
Type
Description

targetType

X_FOLLOW | X_LIKE | X_REPOST

The type of target

targetId

string

The id of the target

telegramId?

string

The id of the telegram user

source?

"web" | "telegram"

The source of the action

Returns

Promise<void>

The response from the API


getActionTransaction()

getActionTransaction(offerid, index): Promise<ActionPostWithCallbackResponse>

Defined in: sdk/src/modules/actions.ts:53

Get the transaction for an action.

Parameters

Parameter
Type
Description

offerId

string

The offer ID

index

number

The index of the action

Returns

Promise<ActionPostWithCallbackResponse>

The transaction for the action

Throws

An error if the public key is not provided

Last updated