mirror of
https://github.com/FlipsideCrypto/livequery-base.git
synced 2026-02-06 11:16:44 +00:00
merge main
This commit is contained in:
commit
426fda5910
@ -1,45 +0,0 @@
|
||||
{% set schema = "strangelove" %}
|
||||
{% set config = fromyaml(config_strangelove_udfs(schema_name = schema, utils_schema_name = "quicknode_utils")) %}
|
||||
{% set raw_test_queries %}
|
||||
strangelove.get:
|
||||
- |
|
||||
'https://api.strange.love/cosmoshub/mainnet/rpc/block_by_hash'
|
||||
- |
|
||||
{
|
||||
'blockHash': '0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED'
|
||||
}
|
||||
|
||||
|
||||
strangelove.post:
|
||||
- |
|
||||
'https://endpoint'
|
||||
- |
|
||||
{
|
||||
'foo': 'bar'
|
||||
}
|
||||
|
||||
{% endset %}
|
||||
{% set test_queries = fromyaml(raw_test_queries) %}
|
||||
{{ test_queries }}
|
||||
{{ schema }}
|
||||
_____
|
||||
columns:
|
||||
{%- for item in config %}
|
||||
- name: {{ item["name"] | replace(schema~".", "") }}
|
||||
tests:
|
||||
- test_marketplace_udf:
|
||||
name: test_{{ item["name"].replace(".", "__") ~ "_status_200" }}
|
||||
args: >
|
||||
{{ test_queries[item["name"]] | join(", ") | indent(16) }}
|
||||
validations:
|
||||
- result:status_code = 200
|
||||
{%- endfor %}
|
||||
|
||||
=====================
|
||||
|
||||
{{ config | pprint}}
|
||||
{# {% for item in config %}
|
||||
{% if item["return_type"][0] != "VARIANT"%}
|
||||
{{ item["return_type"][0] }}
|
||||
{% endif %}
|
||||
{% endfor %} #}
|
||||
@ -1,3 +0,0 @@
|
||||
{{crud_udfs_by_chain(config_evm_high_level_abstractions, 'ethereum', 'mainnet', false)}}
|
||||
{{- crud_udfs_by_chain(config_evm_rpc_primitives, "ethereum", None, False) -}}
|
||||
{{- crud_udfs_by_chain(config_evm_rpc_primitives, "ethereum", None, true) -}}
|
||||
@ -1,7 +1,7 @@
|
||||
# Name your project! Project names should contain only lowercase characters
|
||||
# and underscores. A good package name should reflect your organization's
|
||||
# name or the intended use of these models
|
||||
name: "livequery_models"
|
||||
name: "livequery_base"
|
||||
version: "1.0.0"
|
||||
config-version: 2
|
||||
|
||||
@ -25,7 +25,7 @@ clean-targets: # directories to be removed by `dbt clean`
|
||||
- "dbt_packages"
|
||||
|
||||
models:
|
||||
livequery_models:
|
||||
livequery_base:
|
||||
deploy:
|
||||
+materialized: ephemeral
|
||||
core:
|
||||
@ -34,17 +34,13 @@ models:
|
||||
+enabled: '{{ true if env_var("ENABLE_SNOWFLAKE_SECRETS", "") else false }}'
|
||||
evm:
|
||||
+tags: evm
|
||||
marketplace:
|
||||
+tags: marketplace
|
||||
|
||||
|
||||
tests:
|
||||
+store_failures: true # all tests
|
||||
livequery_models:
|
||||
deploy:
|
||||
marketplace:
|
||||
blockpour:
|
||||
# TODO: enable tests for blockpour once we get an API key
|
||||
+enabled: false
|
||||
|
||||
seeds:
|
||||
+enabled: "{{ target.database not in ['livequery', 'livequery_dev'] }}"
|
||||
|
||||
on-run-start:
|
||||
- "{{ create_sps() }}"
|
||||
@ -64,8 +60,8 @@ vars:
|
||||
UPDATE_UDFS_AND_SPS: false
|
||||
DROP_UDFS_AND_SPS: false
|
||||
UPDATE_SNOWFLAKE_TAGS: true
|
||||
STREAMLINE_INVOKE_STREAMS: False
|
||||
STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False
|
||||
STREAMLINE_INVOKE_STREAMS: false
|
||||
STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: false
|
||||
STUDIO_TEST_USER_ID: '{{ env_var("STUDIO_TEST_USER_ID", "98d15c30-9fa5-43cd-9c69-3d4c0bb269f5") }}'
|
||||
|
||||
API_INTEGRATION: '{{ var("config")[target.name]["API_INTEGRATION"] }}'
|
||||
|
||||
@ -1,399 +0,0 @@
|
||||
{% macro config_evm_high_level_abstractions(blockchain, network) -%}
|
||||
{#
|
||||
This macro is used to generate the high level abstractions for an EVM
|
||||
blockchain.
|
||||
#}
|
||||
{% set schema = blockchain ~ "_" ~ network %}
|
||||
- name: {{ schema -}}.tf_latest_native_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the latest block]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, symbol STRING, raw_balance STRING, balance FLOAT)"
|
||||
- |
|
||||
The table has the following columns:
|
||||
* `blockchain` - The blockchain
|
||||
* `network` - The network
|
||||
* `wallet_address` - The wallet address
|
||||
* `symbol` - The symbol of the native asset
|
||||
* `raw_balance` - The unadjusted native asset balance
|
||||
* `balance` - The adjusted native asset balance
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the native asset balance at the latest block for a given address.$$
|
||||
sql: |
|
||||
{{ evm_latest_native_balance_string(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_native_balance
|
||||
signature:
|
||||
- [wallets, ARRAY, An array of addresses string to get the balance of at the latest block]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, symbol STRING, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the native asset balances at the latest block for given addresses.$$
|
||||
sql: |
|
||||
{{ evm_latest_native_balance_array(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_token_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the latest block]
|
||||
- [token, STRING, The address of the token to get the balance of]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balance at the latest block for a given address and token address. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_latest_token_balance_ss(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_token_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the latest block]
|
||||
- [tokens, ARRAY, An array of address strings of the tokens to get the balance of]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances at the latest block for a given address and multiple token addresses. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_latest_token_balance_sa(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_token_balance
|
||||
signature:
|
||||
- [wallets, ARRAY, An array of addresses string to get the balance of at the latest block]
|
||||
- [token, STRING, The address of the token to get the balance of]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances at the latest block for multiple addresses and a single token address. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_latest_token_balance_as(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_token_balance
|
||||
signature:
|
||||
- [wallets, ARRAY, An array of addresses string to get the balance of at the latest block]
|
||||
- [tokens, ARRAY, An array of address strings of the tokens to get the balance of]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances at the latest block for multiple addresses and multiple token addresses. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_latest_token_balance_aa(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_token_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the input block]
|
||||
- [token, STRING, The address of the token to get the balance of]
|
||||
- [block_number, INTEGER, The block number to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balance for a given address and token address at a specific block. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_historical_token_balance_ssi(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_token_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the input block]
|
||||
- [token, STRING, The address of the token to get the balance of]
|
||||
- [block_numbers, ARRAY, The block numbers to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances for a given address and token address at multiple specific blocks. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_historical_token_balance_ssa(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_token_balance
|
||||
signature:
|
||||
- [wallets, ARRAY, The addresses to get the balance of at the input block]
|
||||
- [token, STRING, The address of the token to get the balance of]
|
||||
- [block_number, INTEGER, The block number to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances for multiple addresses and a given token addresses at a specific block. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_historical_token_balance_asi(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_token_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the input block]
|
||||
- [tokens, ARRAY, An array of address strings of the tokens to get the balance of]
|
||||
- [block_number, INTEGER, The block number to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances for a given address and multiple token addresses at a specific block. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_historical_token_balance_sai(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_token_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the input block]
|
||||
- [tokens, ARRAY, An array of address strings of the tokens to get the balance of]
|
||||
- [block_numbers, ARRAY, The block numbers to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances for a given address and multiple token addresses at multiple specific blocks. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_historical_token_balance_saa(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_token_balance
|
||||
signature:
|
||||
- [wallets, ARRAY, An array of address strings to get the balance of at the input block]
|
||||
- [tokens, ARRAY, An array of address strings of the tokens to get the balance of]
|
||||
- [block_number, INTEGER, The block number to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances for multiple addresses and multiple token addresses at a specific block. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_historical_token_balance_aai(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_token_balance
|
||||
signature:
|
||||
- [wallets, ARRAY, An array of address strings to get the balance of at the input block]
|
||||
- [tokens, ARRAY, An array of address strings of the tokens to get the balance of]
|
||||
- [block_numbers, ARRAY, The block numbers to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, token_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the token balances for multiple addresses and multiple token addresses at multiple specific blocks. Supports ERC20 and ERC721 tokens.$$
|
||||
sql: |
|
||||
{{ evm_historical_token_balance_aaa(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_native_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the input block]
|
||||
- [block_number, INTEGER, The block number to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the native asset balance for a given address at a specific block.$$
|
||||
sql: |
|
||||
{{ evm_historical_native_balance_si(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_native_balance
|
||||
signature:
|
||||
- [wallet, STRING, The address to get the balance of at the input block]
|
||||
- [block_numbers, ARRAY, The block numbers to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the native asset balances for a given address at multiple specific blocks.$$
|
||||
sql: |
|
||||
{{ evm_historical_native_balance_sa(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_native_balance
|
||||
signature:
|
||||
- [wallets, ARRAY, An array of address strings to get the balance of at the input block]
|
||||
- [block_number, INTEGER, The block number to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the native asset balances for multiple addresses at a specific block.$$
|
||||
sql: |
|
||||
{{ evm_historical_native_balance_ai(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_historical_native_balance
|
||||
signature:
|
||||
- [wallets, ARRAY, An array of address strings to get the balance of at the input block]
|
||||
- [block_numbers, ARRAY, The block numbers to get the balance at]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, wallet_address STRING, symbol STRING, block_number INTEGER, raw_balance STRING, balance FLOAT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the native asset balances for multiple addresses at multiple specific blocks.$$
|
||||
sql: |
|
||||
{{ evm_historical_native_balance_aa(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_contract_events
|
||||
signature:
|
||||
- [address, STRING, The address of the contract to get the events of]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, contract_address STRING, event_topics ARRAY, event_data STRING)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the latest events emitted by a contract in the last 100 blocks.$$
|
||||
sql: |
|
||||
{{ evm_latest_contract_events_s(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_contract_events
|
||||
signature:
|
||||
- [address, STRING, The address of the contract to get the events of]
|
||||
- [lookback, INTEGER, The number of blocks to look back. Please note there are RPC limitations on this method.]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, contract_address STRING, event_topics ARRAY, event_data STRING)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the latest events emitted by a contract within the last `lookback` blocks. *Please note there are RPC limitations on this method.*$$
|
||||
sql: |
|
||||
{{ evm_latest_contract_events_si(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_contract_events
|
||||
signature:
|
||||
- [addresses, ARRAY, The addresses of the contracts to get the events of]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, contract_address STRING, event_topics ARRAY, event_data STRING)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the latest events emitted by multiple contracts in the last 100 blocks.$$
|
||||
sql: |
|
||||
{{ evm_latest_contract_events_a(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_contract_events
|
||||
signature:
|
||||
- [addresses, ARRAY, The addresses of the contracts to get the events of]
|
||||
- [lookback, INTEGER, The number of blocks to look back. Please note there are RPC limitations on this method.]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, contract_address STRING, event_topics ARRAY, event_data STRING)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the latest events emitted by multiple contracts within the last `lookback` blocks. *Please note there are RPC limitations on this method.*$$
|
||||
sql: |
|
||||
{{ evm_latest_contract_events_ai(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_contract_events_decoded
|
||||
signature:
|
||||
- [address, STRING, The address of the contract to get the decoded events of]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, event_name STRING, contract_address STRING, event_topics ARRAY, event_data STRING, decoded_data OBJECT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$RReturns the latest decoded events emitted by a contract in the last 100 blocks. Submit missing ABIs [here](https://science.flipsidecrypto.xyz/abi-requestor/).$$
|
||||
sql: |
|
||||
{{ evm_latest_contract_events_decoded_s(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_contract_events_decoded
|
||||
signature:
|
||||
- [addresses, ARRAY, The addresses of the contracts to get the decoded events of]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, event_name STRING, contract_address STRING, event_topics ARRAY, event_data STRING, decoded_data OBJECT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the latest decoded events emitted by multiple contracts in the last 100 blocks. Submit missing ABIs [here](https://science.flipsidecrypto.xyz/abi-requestor/).$$
|
||||
sql: |
|
||||
{{ evm_latest_contract_events_decoded_a(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_contract_events_decoded
|
||||
signature:
|
||||
- [address, STRING, The address of the contract to get the decoded events of]
|
||||
- [lookback, INTEGER, The number of blocks to look back. Please note there are RPC limitations on this method.]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, event_name STRING, contract_address STRING, event_topics ARRAY, event_data STRING, decoded_data OBJECT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the latest decoded events emitted by a contract within the last `lookback` blocks. Submit missing ABIs [here](https://science.flipsidecrypto.xyz/abi-requestor/). *Please note there are RPC limitations on this method.*$$
|
||||
sql: |
|
||||
{{ evm_latest_contract_events_decoded_si(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_latest_contract_events_decoded
|
||||
signature:
|
||||
- [addresses, ARRAY, The addresses of the contracts to get the decoded events of]
|
||||
- [lookback, INTEGER, The number of blocks to look back. Please note there are RPC limitations on this method.]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, event_name STRING, contract_address STRING, event_topics ARRAY, event_data STRING, decoded_data OBJECT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the latest decoded events emitted by multiple contracts within the last `lookback` blocks. Submit missing ABIs [here](https://science.flipsidecrypto.xyz/abi-requestor/). *Please note there are RPC limitations on this method.* $$
|
||||
sql: |
|
||||
{{ evm_latest_contract_events_decoded_ai(schema, blockchain, network) | indent(4) -}}
|
||||
{%- endmacro -%}
|
||||
|
||||
{% macro config_eth_high_level_abstractions(blockchain, network) -%}
|
||||
{#
|
||||
This macro is used to generate high level abstractions for Ethereum mainnet only.
|
||||
#}
|
||||
{% set schema = blockchain ~ "_" ~ network %}
|
||||
- name: {{ schema -}}.tf_all_contract_events
|
||||
signature:
|
||||
- [address, STRING, The address of the contracts to get the events of]
|
||||
- [min_block, INTEGER, The minimum block number to get the events from]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, contract_address STRING, event_topics ARRAY, event_data STRING)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the events emitted by a contract from a specific block to the latest block.$$
|
||||
sql: |
|
||||
{{ evm_contract_events(schema, blockchain, network) | indent(4) -}}
|
||||
|
||||
- name: {{ schema -}}.tf_all_contract_events_decoded
|
||||
signature:
|
||||
- [address, STRING, The address of the contracts to get the events of]
|
||||
- [min_block, INTEGER, The minimum block number to get the events from]
|
||||
return_type:
|
||||
- "TABLE(status STRING, blockchain STRING, network STRING, tx_hash STRING, block_number INTEGER, event_index INTEGER, event_name STRING, contract_address STRING, event_topics ARRAY, event_data STRING, decoded_data OBJECT)"
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the decoded events emitted by a contract from a specific block to the latest block. Submit missing ABIs [here](https://science.flipsidecrypto.xyz/abi-requestor/).$$
|
||||
sql: |
|
||||
{{ evm_contract_events_decoded(schema, blockchain, network) | indent(4) -}}
|
||||
{%- endmacro -%}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,91 +0,0 @@
|
||||
{%- macro config_evm_rpc_primitives(blockchain, network) -%}
|
||||
{#-
|
||||
Generates a set of UDFs that call the Ethereum JSON RPC API
|
||||
|
||||
- rpc: Executes an RPC call on the {{ blockchain }} blockchain
|
||||
- eth_call: Executes a new message call immediately without creating a transaction on the block chain
|
||||
- eth_getLogs: Returns an array of all logs matching filter with given address
|
||||
- eth_getBalance: Returns the balance of the account of given address
|
||||
|
||||
-#}
|
||||
{% set schema = blockchain ~ "_" ~ network -%}
|
||||
|
||||
- name: {{ schema -}}.udf_rpc
|
||||
signature:
|
||||
- [method, STRING, RPC method to call]
|
||||
- [parameters, VARIANT, Parameters to pass to the RPC method]
|
||||
return_type: [VARIANT, The return value of the RPC method]
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Executes an RPC call on the {{ blockchain }} blockchain.$$
|
||||
sql: |
|
||||
SELECT live.udf_rpc('{{ blockchain }}', '{{ network }}', method, parameters)
|
||||
|
||||
- name: {{ schema -}}.udf_rpc_eth_call
|
||||
signature:
|
||||
- [transaction, OBJECT, The transaction object]
|
||||
- [block_or_tag, STRING, The block number or tag to execute the call on]
|
||||
return_type: [VARIANT, The return value of the executed contract code]
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Executes a new message call immediately without creating a transaction on the block chain.$$
|
||||
sql: |
|
||||
SELECT {{ schema -}}.udf_rpc('eth_call', [transaction, block_or_tag])
|
||||
|
||||
- name: {{ schema -}}.udf_rpc_eth_get_logs
|
||||
signature:
|
||||
- [filter, OBJECT, The filter object]
|
||||
return_type: [VARIANT, An array of all logs matching filter with given address]
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns an array of all logs matching filter with given address.$$
|
||||
sql: |
|
||||
SELECT {{ schema -}}.udf_rpc('eth_getLogs', [filter])
|
||||
|
||||
- name: {{ schema -}}.udf_rpc_eth_get_balance
|
||||
signature:
|
||||
- [address, STRING, The address to get the balance of]
|
||||
- [block_or_tag, STRING, The block number or tag to execute the call on]
|
||||
return_type: [VARIANT, The balance of the account of given address]
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the balance of the account of given address.$$
|
||||
sql: |
|
||||
SELECT {{ schema -}}.udf_rpc('eth_getBalance', [address, block_or_tag])
|
||||
|
||||
- name: {{ schema -}}.udf_get_token_balance
|
||||
signature:
|
||||
- [wallet_address, STRING, The address to get the balance of]
|
||||
- [token_address, STRING, The token to get the balance of]
|
||||
return_type: [STRING, The balance of the account of given address]
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the balance of the wallet of given token address at the latest block.$$
|
||||
sql: |
|
||||
SELECT utils.udf_hex_to_int({{ schema -}}.udf_rpc_eth_call(object_construct_keep_null('from', null, 'to', token_address, 'data', concat('0x70a08231',LPAD(REPLACE(wallet_address, '0x', ''), 64, 0))),'latest')::string)
|
||||
|
||||
- name: {{ schema -}}.udf_get_token_balance
|
||||
signature:
|
||||
- [wallet_address, STRING, The address to get the balance of]
|
||||
- [token_address, STRING, The token to get the balance of]
|
||||
- [block_number, INTEGER, The block number to retrieve the balance at]
|
||||
return_type: [STRING, The balance of the account of given address]
|
||||
options: |
|
||||
NOT NULL
|
||||
RETURNS NULL ON NULL INPUT
|
||||
VOLATILE
|
||||
COMMENT = $$Returns the balance of the wallet of given token address at the given block.$$
|
||||
sql: |
|
||||
SELECT utils.udf_hex_to_int({{schema}}.udf_rpc_eth_call(OBJECT_CONSTRUCT_KEEP_NULL('from', NULL, 'to', token_address, 'data', concat('0x70a08231',LPAD(REPLACE(wallet_address, '0x', ''), 64, 0))), CONCAT('0x', TRIM(TO_CHAR(block_number, 'XXXXXXXXXX'))))::STRING)
|
||||
|
||||
{%- endmacro -%}
|
||||
@ -1,11 +0,0 @@
|
||||
{% macro create_aws_ethereum_api() %}
|
||||
{% if target.name == "prod" %}
|
||||
{% set sql %}
|
||||
CREATE api integration IF NOT EXISTS aws_ethereum_api api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::661245089684:role/snowflake-api-ethereum' api_allowed_prefixes = (
|
||||
'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/',
|
||||
'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/'
|
||||
) enabled = TRUE;
|
||||
{% endset %}
|
||||
{% do run_query(sql) %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
@ -117,36 +117,6 @@
|
||||
{%- endfor -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{% macro crud_udfs_by_marketplace(config_func, schema, utility_schema, drop_) %}
|
||||
{#
|
||||
Generate create or drop statements for a list of udf configs for a given blockchain and network
|
||||
|
||||
config_func: function that returns a list of udf configs
|
||||
schema: schema name
|
||||
utility_schema: utility schema name
|
||||
#}
|
||||
CREATE SCHEMA IF NOT EXISTS {{ schema }};
|
||||
{%- set configs = fromyaml(config_func(schema, utility_schema)) if utility_schema else fromyaml(config_func(schema, schema)) -%}
|
||||
{%- for udf in configs -%}
|
||||
{{- create_or_drop_function_from_config(udf, drop_=drop_) -}}
|
||||
{%- endfor -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{% macro crud_marketplace_udfs(config_func, schemaName, base_api_schema_name, drop_) %}
|
||||
{#
|
||||
Generate create or drop statements for a list of udf configs for a given schema and api
|
||||
|
||||
config_func: function that returns a list of udf configs
|
||||
schemaName: the target schema to build the udfs
|
||||
base_api_schema_name: the schema that contains base api functions
|
||||
drop_: whether to drop or create the udfs
|
||||
#}
|
||||
{%- set udfs = fromyaml(config_func(schemaName, base_api_schema_name)) -%}
|
||||
{%- for udf in udfs -%}
|
||||
{{- create_or_drop_function_from_config(udf, drop_=drop_) -}}
|
||||
{%- endfor -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{% macro ephemeral_deploy_core(config) %}
|
||||
{#
|
||||
This macro is used to deploy functions using ephemeral models.
|
||||
@ -190,26 +160,4 @@
|
||||
SELECT '{{ model.schema }}' as schema_
|
||||
{%- endmacro -%}
|
||||
|
||||
{% macro ephemeral_deploy_marketplace(configs) %}
|
||||
{#
|
||||
This macro is used to deploy functions using ephemeral models.
|
||||
It should only be used within an ephemeral model.
|
||||
#}
|
||||
{%- set schema = this.schema -%}
|
||||
{%- set utility_schema = this.identifier -%}
|
||||
{% if execute and (var("UPDATE_UDFS_AND_SPS") or var("DROP_UDFS_AND_SPS")) and model.unique_id in selected_resources %}
|
||||
{% set sql %}
|
||||
{% for config in configs %}
|
||||
{{- crud_udfs_by_marketplace(config, schema, utility_schema, var("DROP_UDFS_AND_SPS")) -}}
|
||||
{%- endfor -%}
|
||||
{%- endset -%}
|
||||
{%- if var("DROP_UDFS_AND_SPS") -%}
|
||||
{%- do log("Drop marketplace udfs: " ~ this.database ~ "." ~ schema, true) -%}
|
||||
{%- else -%}
|
||||
{%- do log("Deploy marketplace udfs: " ~ this.database ~ "." ~ schema, true) -%}
|
||||
{%- endif -%}
|
||||
{%- do run_query(sql ~ apply_grants_by_schema(schema)) -%}
|
||||
{%- endif -%}
|
||||
SELECT '{{ model.schema }}' as schema_
|
||||
{%- endmacro -%}
|
||||
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,13 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('_eth__logs') }}
|
||||
-- depends_on: {{ ref('_eth__decoded_logs') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions,
|
||||
config_eth_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,10 +0,0 @@
|
||||
-- depends_on: {{ ref('_evm__contracts_map') }}
|
||||
-- depends_on: {{ ref('_evm__abi_map') }}
|
||||
-- depends_on: {{ ref('_evm__native_symbol_map') }}
|
||||
-- depends_on: {{ ref('live') }}
|
||||
-- depends_on: {{ ref('utils') }}
|
||||
{%- set configs = [
|
||||
config_evm_rpc_primitives,
|
||||
config_evm_high_level_abstractions
|
||||
] -%}
|
||||
{{- ephemeral_deploy(configs) -}}
|
||||
@ -1,11 +0,0 @@
|
||||
{{ config(
|
||||
materialized = 'view',
|
||||
grants = {'+select': fromyaml(var('ROLES'))}
|
||||
) }}
|
||||
|
||||
SELECT *
|
||||
FROM
|
||||
{{ source(
|
||||
'ethereum_core',
|
||||
'ez_decoded_event_logs'
|
||||
) }}
|
||||
@ -1,11 +0,0 @@
|
||||
{{ config(
|
||||
materialized = 'view',
|
||||
grants = {'+select': fromyaml(var('ROLES'))}
|
||||
) }}
|
||||
|
||||
SELECT *
|
||||
FROM
|
||||
{{ source(
|
||||
'ethereum_core',
|
||||
'fact_event_logs'
|
||||
) }}
|
||||
@ -1,22 +0,0 @@
|
||||
{{ config(
|
||||
materialized = 'view',
|
||||
grants = {'+select': fromyaml(var('ROLES'))}
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
parent_contract_address,
|
||||
event_name,
|
||||
event_signature,
|
||||
abi,
|
||||
start_block,
|
||||
end_block,
|
||||
CASE blockchain
|
||||
WHEN 'avalanche' THEN 'avalanche_c'
|
||||
WHEN 'arbitrum' THEN 'arbitrum_one'
|
||||
ELSE blockchain
|
||||
END AS blockchain
|
||||
FROM
|
||||
{{ source(
|
||||
'crosschain',
|
||||
'dim_evm_event_abis'
|
||||
) }}
|
||||
@ -1,20 +0,0 @@
|
||||
{{ config(
|
||||
materialized = 'view',
|
||||
grants = {'+select': fromyaml(var('ROLES'))}
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
address,
|
||||
symbol,
|
||||
decimals,
|
||||
CASE
|
||||
blockchain
|
||||
WHEN 'avalanche' THEN 'avalanche_c'
|
||||
WHEN 'arbitrum' THEN 'arbitrum_one'
|
||||
ELSE blockchain
|
||||
END AS blockchain
|
||||
FROM
|
||||
{{ source(
|
||||
'crosschain',
|
||||
'dim_contracts'
|
||||
) }}
|
||||
@ -1,129 +0,0 @@
|
||||
{{ config(
|
||||
materialized = 'view',
|
||||
grants = {'+select': fromyaml(var('ROLES'))}
|
||||
) }}
|
||||
|
||||
WITH blockchain_assets AS (
|
||||
|
||||
SELECT
|
||||
'avalanche' AS blockchain,
|
||||
'AVAX' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'avalanche' AS blockchain,
|
||||
'AVAX' AS asset_symbol,
|
||||
'testnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'binance' AS blockchain,
|
||||
'BNB' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'binance' AS blockchain,
|
||||
'BNB' AS asset_symbol,
|
||||
'testnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'gnosis' AS blockchain,
|
||||
'xDAI' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'ethereum' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'goerli' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'ethereum' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'ethereum' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'sepolia' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'arbitrum_nova' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'arbitrum_one' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'goerli' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'arbitrum_one' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'base' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'goerli' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'fantom' AS blockchain,
|
||||
'FTM' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'gnosis' AS blockchain,
|
||||
'xDAI' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'harmony' AS blockchain,
|
||||
'ONE' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'harmony' AS blockchain,
|
||||
'ONE' AS asset_symbol,
|
||||
'testnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'optimism' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'goerli' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'optimism' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'polygon' AS blockchain,
|
||||
'MATIC' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'polygon' AS blockchain,
|
||||
'MATIC' AS asset_symbol,
|
||||
'testnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'polygon_zkevm' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'polygon_zkevm' AS blockchain,
|
||||
'ETH' AS asset_symbol,
|
||||
'testnet' AS network
|
||||
UNION ALL
|
||||
SELECT
|
||||
'CELO' AS blockchain,
|
||||
'CELO' AS asset_symbol,
|
||||
'mainnet' AS network
|
||||
)
|
||||
|
||||
SELECT
|
||||
blockchain,
|
||||
network,
|
||||
asset_symbol AS symbol
|
||||
FROM
|
||||
blockchain_assets
|
||||
Loading…
Reference in New Issue
Block a user