Web3Hooks API
Transaction Lifecycle

Transaction Lifecycle

Overview

The Transaction Lifecycle endpoints allow you to create a hook for a particular transaction by specifying its hash in the body of the request. The number of transaction confirmations should be in the range of 3 and 12. When it is set to 12, you will receive 12 deliveries for each confirmation, or fewer, depending on the number of confirmations that have already been committed by the time the hook becomes active. If your transaction has already had more than 12 confirmations, there will be only one delivery.

Additionally, you can obtain information on a specific transaction hook by using the Get Tx Hook endpoint or retrieve the details of all created transaction hooks with their IDs by using the List Hooks endpoint. To delete no longer required transaction hooks, use the Delete Hook endpoint and specify id in the corresponding field.

Usage

In this example, we create a monitoring hook for the transaction with the hash 0x751c6eff9a287d5fcbaa416d4676f90dc0284ebe3a6564a6a83458c0ca6186d7.

import * as Parsiq from '@parsiq/parsiq.js';
import {HttpAuthType} from '@parsiq/parsiq.js';
 
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
 
const txHook = await client.txLifecycleHooks.create({
    transaction_hash: '0x751c6eff9a287d5fcbaa416d4676f90dc0284ebe3a6564a6a83458c0ca6186d7',
    confirmations: 12,
    endpoint_url: 'https://webhook.site/07c14b1f-fa30-4f6a-b5ad-f687879803fc',
    endpoint_auth: {
        type: HttpAuthType.basic,
        credentials: {
            username: "user",
            password: "qwerty"
          }
      }
})
console.log(txHook)
    `bc2a82df-4310-4edc-925f-d7e250844360`

Parameters

Path params
chainId
string
REQUIRED
version
string
REQUIRED
Body params
txHash
string
REQUIRED
confirmations
number
REQUIRED
endpoint_url
string
REQUIRED
endpoint_auth
object