osmosis-models/models/bronze/bronze_api/bronze_api__manual_tx_lq.sql
Eric Laurello 3070d2521e remove key
2023-11-02 09:24:17 -04:00

47 lines
781 B
SQL

{{ config(
materialized = 'incremental',
full_refresh = false
) }}
WITH calls AS (
SELECT
'https://osmosis-mainnet-archive.allthatnode.com:1317/key/cosmos/tx/v1beta1/txs/' || tx_id calls,
tx_id
FROM
(
SELECT
tx_id
FROM
{{ ref(
'bronze__rpc_error_blocks_tx_ids'
) }}
{% if is_incremental() %}
EXCEPT
SELECT
tx_id
FROM
{{ this }}
WHERE
DATA :data :tx_response :height IS NOT NULL
{% endif %}
LIMIT
20
)
), results AS (
SELECT
tx_id,
livequery_dev.live.udf_api(
'GET',
calls,{},{}
) DATA
FROM
calls
)
SELECT
*,
SYSDATE() AS _inserted_timestamp
FROM
results