fix/overview-docs (#10)

This commit is contained in:
drethereum 2023-02-01 14:19:07 -07:00 committed by GitHub
parent 83ca575b57
commit 56d47f7d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 38 deletions

View File

@ -29,7 +29,7 @@ tests:
on-run-start:
- "{{ create_sps() }}"
- "{{ create_udfs() }}"
# - "{{ create_udfs() }}"
on-run-end:
- '{{ apply_meta_as_tags(results) }}'

View File

@ -1,12 +1,8 @@
{% macro create_udfs() %}
{% if var("UPDATE_UDFS_AND_SPS") %}
{% set sql %}
CREATE schema if NOT EXISTS silver;
{{ create_udf_hex_to_int(
schema = "public"
) }}
{% endset %}
{% do run_query(sql) %}
{% endif %}
{% endmacro %}
-- {% macro create_udfs() %}
-- {% if var("UPDATE_UDFS_AND_SPS") %}
-- {% set sql %}
-- CREATE schema if NOT EXISTS silver;
-- {% endset %}
-- {% do run_query(sql) %}
-- {% endif %}
-- {% endmacro %}

View File

@ -1,21 +0,0 @@
{% macro create_udf_hex_to_int(schema) %}
create or replace function {{ schema }}.udf_hex_to_int(hex string)
returns string
language python
runtime_version = '3.8'
handler = 'hex_to_int'
as
$$
def hex_to_int(hex) -> str:
"""
Converts hex (of any size) to int (as a string). Snowflake and java script can only handle up to 64-bit (38 digits of precision)
select hex_to_int('200000000000000000000000000000211');
>> 680564733841876926926749214863536423441
select hex_to_int('0x200000000000000000000000000000211');
>> 680564733841876926926749214863536423441
select hex_to_int(NULL);
>> NULL
"""
return str(int(hex, 16)) if hex else None
$$;
{% endmacro %}

View File

@ -3,11 +3,12 @@
# Welcome to the Flipside Crypto External Models Documentation!
## **What does this documentation cover?**
The documentation included here details the design of the External tables and views available via [Flipside Crypto.](https://flipsidecrypto.xyz/earn). For more information on how these models are built, please see [the github repository.](https://github.com/FlipsideCrypto/external-models)
The documentation included here details the design of the External tables and views available via [Flipside Crypto](https://flipsidecrypto.xyz/earn). For more information on how these models are built, please see [the github repository.](https://github.com/FlipsideCrypto/external-models)
### **Quick Links to Table Documentation**
**Token Flow: Ethereum**
**Token Flow: Ethereum**
[Token Flow Documentation](https://docs.tokenflow.live/)
- [tokenflow_eth__blocks](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.blocks)
@ -16,11 +17,12 @@ The documentation included here details the design of the External tables and vi
- [tokenflow_eth__state_diffs](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.state_diffs)
- [tokenflow_eth__storage_diffs](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.storage_diffs)
- [tokenflow_eth__storage_reads](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.storage_reads)
- [tokenflow_eth__transactions](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.transactions)</p>
- [tokenflow_eth__transactions](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_eth.transactions)
**Token Flow: Starknet**
[Token Flow Documentation](https://docs.tokenflow.live/)
- [tokenflow_starknet__decoded_blocks](https://flipsidecrypto.github.io/external-models/#!/source/source.external_models.tokenflow_starknet_decoded.blocks)
@ -46,7 +48,6 @@ The dimension tables are sourced from a variety of on-chain and off-chain source
Convenience views (denoted ez_) are a combination of different fact and dimension tables.
A user-defined-function (UDF) is available to decode hex encoded values to integers in this database. You can call this UDF by using `external.public.udf_hex_to_int(FIELD::string)`.
## **Using dbt docs**
### Navigation