udf_bitcoin_transaction_parser

The udf_bitcoin_transaction_parser method is a powerful tool for extracting and processing Bitcoin transaction data within the core_decoded_function_call table.

Below is an example of how to effectively utilize this method:

To extract specific information from Bitcoin transactions related to the 'delegateBtc' function, use the following SQL query:

SELECT 
   * ,
   JSON_EXTRACT_SCALAR(udf_bitcoin_transaction_parser(SUBSTR(JSON_VALUE(decoded_data,'lax $.btcTx'), 3)), '$[0].value') AS amount,
   udf_bitcoin_transaction_parser(SUBSTR(JSON_VALUE(decoded_data,'lax $.btcTx'), 3)) AS tx_parser,
   JSON_VALUE(decoded_data,'lax $.script') AS script,
   JSON_VALUE(decoded_data,'lax $.blockHeight') AS block_height
 FROM core_decoded_function_call
 WHERE function_name ='delegateBtc'

Query result:

Interpret the Query Results

  • amount: Retrieves the transaction amount from the Bitcoin transaction data.
  • tx_parser: Parses and processes the Bitcoin transaction data for detailed analysis.
  • script: Displays the script associated with the Bitcoin transaction.
  • block_height: Indicates the block height of the Bitcoin transaction.