Skip to main content

SocketTx

An entity representing the transaction prompted by the socket api

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new SocketTx(nextTx, statusCheckInterval?)

Parameters

NameTypeDefault valueDescription
nextTxNextTxResponseundefinedThe api object for the next transaction
statusCheckIntervalnumber10000How often in ms to poll for status updates when checking the transaction

Inherited from

NextTxResponse.constructor

Defined in

socket-v2-sdk/src/socketTx.ts:36

Properties

activeRouteId

activeRouteId: number

Id of Active Route.

Inherited from

NextTxResponse.activeRouteId

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:10


approvalChecked

approvalChecked: boolean = false

If the approval has been checked

Defined in

socket-v2-sdk/src/socketTx.ts:22


approvalData

approvalData: null | ApprovalData

Inherited from

NextTxResponse.approvalData

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:44


chainId

chainId: ChainId

Id of chain where transaction has to be sent.

Inherited from

NextTxResponse.chainId

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:22


done

done: boolean = false

If the transaction is done

Defined in

socket-v2-sdk/src/socketTx.ts:26


hash

hash: undefined | string

Hash associated with this socket transaction step

Defined in

socket-v2-sdk/src/socketTx.ts:30


totalUserTx

totalUserTx: number

Total number of transactions in Active Route.

Inherited from

NextTxResponse.totalUserTx

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:43


txData

txData: string

Calldata for transaction.

Inherited from

NextTxResponse.txData

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:26


txTarget

txTarget: string

Address to which transaction has to be sent.

Inherited from

NextTxResponse.txTarget

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:18


txType

txType: TxType

Type of transaction.

Inherited from

NextTxResponse.txType

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:30


userTxIndex

userTxIndex: number

Index of transaction in Active Route. Index of the object in the userTxs array.

Inherited from

NextTxResponse.userTxIndex

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:39


userTxType

userTxType: UserTxType

Type of user transaction.

Inherited from

NextTxResponse.userTxType

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:14


value

value: string

Native token amount to be sent with transaction.

Inherited from

NextTxResponse.value

Defined in

socket-v2-sdk/src/client/models/NextTxResponse.ts:35

Methods

approvalRequired

approvalRequired(): Promise<boolean>

Whether an approval transaction is required.

Returns

Promise<boolean>

True if required, otherwise false.

Defined in

socket-v2-sdk/src/socketTx.ts:45


getApproveTransaction

getApproveTransaction(): Promise<null | { data?: string ; from?: string ; to?: string }>

Get the apporval transaction data if it is required

Returns

Promise<null | { data?: string ; from?: string ; to?: string }>

Apporval data to be sent if required, otherwise null

Defined in

socket-v2-sdk/src/socketTx.ts:80


getSendTransaction

getSendTransaction(): Promise<{ data: string ; to: string ; value: string }>

Get the transaction data

Returns

Promise<{ data: string ; to: string ; value: string }>

Send transaction data

Defined in

socket-v2-sdk/src/socketTx.ts:107


submit

submit(hash): Promise<COMPLETED>

Submit the hash for this transaction and wait until it is marked as complete

Parameters

NameTypeDescription
hashstringThe hash for this transaction on the network

Returns

Promise<COMPLETED>

Returns the final status "COMPLETED" once the transaction is complete

Defined in

socket-v2-sdk/src/socketTx.ts:145