osmosis-models/models/streamline/core/streamline__blocks.sql
xiuy001 e4c9432131
Add streamline models (#136)
* updated and added the rest api client and call

* updated

* increased sql limit

* updated params

* refresh

* updated

* updated the rest api call format

* updated

* updated

* updated
2023-09-26 16:03:26 -04:00

17 lines
368 B
SQL

{{ config (
materialized = "view",
tags = ['streamline_view']
) }}
{% if execute %}
{% set height = run_query('SELECT streamline.udf_get_chainhead()') %}
{% set block_height = height.columns[0].values()[0] %}
{% else %}
{% set block_height = 0 %}
{% endif %}
SELECT
height as block_number
FROM
TABLE(streamline.udtf_get_base_table({{block_height}}))