SocketTx
An entity representing the transaction prompted by the socket api
Hierarchy
↳
SocketTx
Table of contents
Constructors
Properties
- activeRouteId
- approvalChecked
- approvalData
- chainId
- done
- hash
- totalUserTx
- txData
- txTarget
- txType
- userTxIndex
- userTxType
- value
Methods
Constructors
constructor
• new SocketTx(nextTx, statusCheckInterval?)
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
nextTx | NextTxResponse | undefined | The api object for the next transaction |
statusCheckInterval | number | 10000 | How 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
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
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
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
Defined in
socket-v2-sdk/src/client/models/NextTxResponse.ts:43
txData
• txData: string
Calldata for transaction.
Inherited from
Defined in
socket-v2-sdk/src/client/models/NextTxResponse.ts:26
txTarget
• txTarget: string
Address to which transaction has to be sent.
Inherited from
Defined in
socket-v2-sdk/src/client/models/NextTxResponse.ts:18
txType
• txType: TxType
Type of transaction.
Inherited from
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
Defined in
socket-v2-sdk/src/client/models/NextTxResponse.ts:39
userTxType
• userTxType: UserTxType
Type of user transaction.
Inherited from
Defined in
socket-v2-sdk/src/client/models/NextTxResponse.ts:14
value
• value: string
Native token amount to be sent with transaction.
Inherited from
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
| Name | Type | Description |
|---|---|---|
hash | string | The hash for this transaction on the network |
Returns
Promise<COMPLETED>
Returns the final status "COMPLETED" once the transaction is complete