mirror of
https://github.com/FlipsideCrypto/livequery-models.git
synced 2026-02-06 10:56:46 +00:00
Fix file structure: remove model files from macros directory
- Remove .yaml.sql UDF files from macros (belong in models/) - Remove *_config_utils.sql files from macros - Remove .graphql.sql files from macros - Clean separation between macro definitions and model deployments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5ae7a52fea
commit
48bf1d51a8
@ -1,15 +0,0 @@
|
||||
{% macro alchemy_nft_get_api_call(schema_name, api_path) %}
|
||||
SELECT {{ schema_name -}}.nfts_get(NETWORK, '/{{api_path}}', QUERY_ARGS) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro alchemy_nft_get_api_call_version(schema_name, api_path, version) %}
|
||||
SELECT {{ schema_name -}}.nfts_get(NETWORK, '{{version}}', '/{{api_path}}', QUERY_ARGS) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro alchemy_nft_post_api_call(schema_name, api_path) %}
|
||||
SELECT {{ schema_name -}}.nfts_post(NETWORK, '/{{api_path}}', BODY) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro alchemy_rpc_call(schema_name, method) %}
|
||||
SELECT {{ schema_name -}}.rpc(NETWORK, '{{method}}', PARAMS) as response
|
||||
{% endmacro %}
|
||||
@ -1,216 +0,0 @@
|
||||
{% macro config_alchemy_nfts_udfs(schema_name = "alchemy_nfts", utils_schema_name = "alchemy_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the alchemy nft endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get_nfts
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Gets all NFTs currently owned by a given address. [Alchemy docs here](https://docs.alchemy.com/reference/getnfts).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getNFTs') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_owners_for_token
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get the owner(s) for a token. [Alchemy docs here](https://docs.alchemy.com/reference/getownersfortoken).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getOwnersForToken') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_owners_for_collection
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Gets all owners for a given NFT contract. [Alchemy docs here](https://docs.alchemy.com/reference/getownersforcollection).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getOwnersForCollection') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.is_holder_of_collection
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Checks whether a wallet holds a NFT in a given collection. [Alchemy docs here](https://docs.alchemy.com/reference/isholderofcollection).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'isHolderOfCollection') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_contracts_for_owner
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Gets all NFT contracts held by an owner address. [Alchemy docs here](https://docs.alchemy.com/reference/getcontractsforowner).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getContractsForOwner') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_nft_metadata
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Gets the metadata associated with a given NFT. [Alchemy docs here](https://docs.alchemy.com/reference/getnftmetadata).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getNFTMetadata') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_nft_metadata_batch
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [BODY, OBJECT, JSON Body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Gets the metadata associated with up to 100 given NFT contracts. [Alchemy docs here](https://docs.alchemy.com/reference/getnftmetadatabatch).$$
|
||||
sql: {{ alchemy_nft_post_api_call(utils_schema_name, 'getNFTMetadataBatch') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_contract_metadata
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Queries NFT high-level collection/contract level information. [Alchemy docs here](https://docs.alchemy.com/reference/getcontractmetadata).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getContractMetadata') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_contract_metadata_batch
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [BODY, OBJECT, JSON Body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Gets the metadata associated with the given list of contract addresses. [Alchemy docs here](https://docs.alchemy.com/reference/getcontractmetadatabatch).$$
|
||||
sql: {{ alchemy_nft_post_api_call(utils_schema_name, 'getContractMetadataBatch') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.invalidate_contract
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Marks all cached tokens for the particular contract as stale. So the next time the endpoint is queried it fetches live data instead of fetching from cache. [Alchemy docs here](https://docs.alchemy.com/reference/invalidatecontract).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'invalidateContract') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.reingest_contract
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Triggers metadata refresh for an entire NFT collection and refreshes stale metadata after a collection reveal/collection changes. [Alchemy docs here](https://docs.alchemy.com/reference/reingestcontract).$$
|
||||
sql: {{ alchemy_nft_get_api_call_version(utils_schema_name, 'invalidateContract', 'v3') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.search_contract_metadata
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Search for a keyword across metadata of all ERC-721 and ERC-1155 smart contracts. [Alchemy docs here](https://docs.alchemy.com/reference/searchcontractmetadata).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'searchContractMetadata') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_nfts_for_collection
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Gets all NFTs for a given NFT contract. [Alchemy docs here](https://docs.alchemy.com/reference/getnftsforcollection).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getNFTsForCollection') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_spam_contracts
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns a list of all spam contracts marked by Alchemy. [Alchemy docs here](https://docs.alchemy.com/reference/getspamcontracts).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getSpamContracts') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.is_spam_contract
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns whether a contract is marked as spam or not by Alchemy. [Alchemy docs here](https://docs.alchemy.com/reference/isspamcontract).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'isSpamContract') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.is_airdrop
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns whether a token is marked as an airdrop or not. Airdrops are defined as NFTs that were minted to a user address in a transaction sent by a different address. [Alchemy docs here](https://docs.alchemy.com/reference/isairdrop).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'isAirdrop') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.report_spam
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Report a particular address to our APIs if you think it is spam. [Alchemy docs here](https://docs.alchemy.com/reference/reportspam).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'reportSpam') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_floor_price
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns the floor prices of a NFT collection by marketplace. [Alchemy docs here](https://docs.alchemy.com/reference/getfloorprice).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getFloorPrice') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_nft_sales
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Gets NFT sales that have happened through on-chain marketplaces. [Alchemy docs here](https://docs.alchemy.com/reference/getnftsales).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'getNFTSales') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.compute_rarity
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Computes the rarity of each attribute of an NFT. [Alchemy docs here](https://docs.alchemy.com/reference/computerarity).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'computeRarity') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.summarize_nft_attributes
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Generate a summary of attribute prevalence for an NFT collection. [Alchemy docs here](https://docs.alchemy.com/reference/summarizenftattributes).$$
|
||||
sql: {{ alchemy_nft_get_api_call(utils_schema_name, 'summarizeNFTAttributes') | trim }}
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,35 +0,0 @@
|
||||
{% macro config_alchemy_tokens_udfs(schema_name = "alchemy_tokens", utils_schema_name = "alchemy_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the alchemy token endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get_token_allowance
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [PARAMS, ARRAY, Array of JSON param objects for RPC request]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns the amount which the spender is allowed to withdraw from the owner. [Alchemy docs here](https://docs.alchemy.com/reference/alchemy-gettokenallowance).$$
|
||||
sql: {{alchemy_rpc_call(utils_schema_name, "alchemy_getTokenAllowance") | trim}}
|
||||
|
||||
- name: {{ schema_name -}}.get_token_balances
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [PARAMS, ARRAY, Array of JSON param objects for RPC request]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns ERC20 token balances for all tokens the given address has ever transacted in with. Optionally accepts a list of contracts. [Alchemy docs here](https://docs.alchemy.com/reference/alchemy-gettokenbalances).$$
|
||||
sql: {{alchemy_rpc_call(utils_schema_name, "alchemy_getTokenBalances") | trim}}
|
||||
|
||||
- name: {{ schema_name -}}.get_token_metadata
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [PARAMS, ARRAY, Array of JSON param objects for RPC request]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns metadata (name, symbol, decimals, logo) for a given token contract address. [Alchemy docs here](https://docs.alchemy.com/reference/alchemy-gettokenmetadata).$$
|
||||
sql: {{alchemy_rpc_call(utils_schema_name, "alchemy_getTokenMetadata") | trim}}
|
||||
{% endmacro %}
|
||||
@ -1,16 +0,0 @@
|
||||
{% macro config_alchemy_transfers_udfs(schema_name = "alchemy_transfers", utils_schema_name = "alchemy_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the alchemy transfers endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get_asset_transfers
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [PARAMS, ARRAY, Array of JSON param objects for RPC request]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$The Transfers API allows you to easily fetch historical transactions for any address across Ethereum and supported L2s including Polygon, Arbitrum, and Optimism. [Alchemy docs here](https://docs.alchemy.com/reference/alchemy-getassettransfers).$$
|
||||
sql: {{alchemy_rpc_call(utils_schema_name, "alchemy_getAssetTransfers") | trim}}
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,80 +0,0 @@
|
||||
{% macro config_alchemy_utils_udfs(schema_name = "alchemy_utils", utils_schema_name="alchemy_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the alchemy base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema -}}.nfts_get
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Alchemy NFT API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
concat(
|
||||
'https://', NETWORK,'.g.alchemy.com/nft/v2/{',NETWORK,'}', PATH, '?',
|
||||
utils.udf_object_to_url_query_string(QUERY_ARGS)
|
||||
),
|
||||
'_FSC_SYS/ALCHEMY'
|
||||
) as response
|
||||
|
||||
- name: {{ schema -}}.nfts_get
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [VERSION, STRING, The version of the API to use]
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Alchemy NFT API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
concat(
|
||||
'https://', NETWORK,'.g.alchemy.com/nft/', VERSION, '/{',NETWORK,'}', PATH, '?',
|
||||
utils.udf_object_to_url_query_string(QUERY_ARGS)
|
||||
),
|
||||
'_FSC_SYS/ALCHEMY'
|
||||
) as response
|
||||
|
||||
- name: {{ schema -}}.nfts_post
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Alchemy NFT API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://', NETWORK,'.g.alchemy.com/nft/v2/{',NETWORK,'}', PATH),
|
||||
{},
|
||||
BODY,
|
||||
'_FSC_SYS/ALCHEMY'
|
||||
) as response
|
||||
|
||||
- name: {{ schema -}}.rpc
|
||||
signature:
|
||||
- [NETWORK, STRING, The blockchain/network]
|
||||
- [METHOD, STRING, The RPC method to call]
|
||||
- [PARAMS, ARRAY, The RPC Params arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue an RPC call to Alchemy.$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
concat('https://', NETWORK,'.g.alchemy.com/v2/{',NETWORK,'}'),
|
||||
{},
|
||||
{'id': 1,'jsonrpc': '2.0','method': METHOD,'params': PARAMS},
|
||||
'_FSC_SYS/ALCHEMY') as response
|
||||
{% endmacro %}
|
||||
@ -1,23 +0,0 @@
|
||||
{% macro config_allday_udfs(schema_name = "allday", utils_schema_name = "allday_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the AllDay calls
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.graphql
|
||||
signature:
|
||||
- [QUERY, OBJECT, The GraphQL query]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Run a graphql query on AllDay.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
CONCAT('https://nflallday.com/consumer/graphql?query=', utils.udf_object_to_url_query_string(QUERY)),
|
||||
{'User-Agent': 'Flipside_Flow_metadata/0.1','Accept-Encoding': 'gzip', 'Content-Type': 'application/json', 'Accept': 'application/json','Connection': 'keep-alive'},
|
||||
{},
|
||||
'_FSC_SYS/ALLDAY'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_apilayer_udfs(schema_name = "apilayer", utils_schema_name="apilayer_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the ApiLayer Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the ApiLayer API. [ApiLayer docs here](https://apilayer.com/docs/article/getting-started).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.apilayer.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'apikey': '{API_KEY}'},
|
||||
NULL,
|
||||
'_FSC_SYS/APILAYER'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the ApiLayer API. [ApiLayer docs here](https://apilayer.com/docs/article/getting-started).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.apilayer.com', PATH),
|
||||
{'apikey': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/APILAYER'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_binance_udfs(schema_name = "binance", utils_schema_name="binance_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Binance Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [URL, STRING, The full url including the path]
|
||||
- [QUERY_ARGS, ARRAY, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Binance API. [Binance docs here](https://binance-docs.github.io/apidocs/spot/en/#api-key-setup).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(URL, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'X-MBX-APIKEY': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/BINANCE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [URL, STRING, The full url]
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Binance API. [Binance docs here](https://binance-docs.github.io/apidocs/spot/en/#api-key-setup).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
URL,
|
||||
{'X-MBX-APIKEY': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/BINANCE'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,23 +0,0 @@
|
||||
{% macro config_bitquery_udfs(schema_name = "bitquery", utils_schema_name = "bitquery_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the BitQuery calls
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.graphql
|
||||
signature:
|
||||
- [QUERY, OBJECT, The GraphQL query]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Run a graphql query on BitQuery [BitQuery docs here](https://docs.bitquery.io/docs/start/first-query/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
'https://graphql.bitquery.io',
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
QUERY,
|
||||
'_FSC_SYS/BITQUERY'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,44 +0,0 @@
|
||||
{% macro config_blockpour_utils_udfs(schema_name = "blockpour_utils", utils_schema_name="blockpour_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Blockpour base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Blockpour API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(
|
||||
'https://services.blockpour.com/api', PATH, '?',
|
||||
utils.udf_object_to_url_query_string(QUERY_ARGS)
|
||||
),
|
||||
{'api-key': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/BLOCKPOUR'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the BlockPour API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://services.blockpour.com/api', PATH),
|
||||
{'api-key': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/BLOCKPOUR'
|
||||
) as response
|
||||
{% endmacro %}
|
||||
@ -1,61 +0,0 @@
|
||||
{% macro config_chainbase_utils_udfs(schema_name = "chainbase_utils", utils_schema_name="chainbase_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the alchemy base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Chainbase API. [Chainbase Docs](https://docs.chainbase.com/reference/supported-chains)$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(
|
||||
'https://api.chainbase.online', PATH, '?',
|
||||
utils.udf_object_to_url_query_string(QUERY_ARGS)
|
||||
),
|
||||
{'x-api-key': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/CHAINBASE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Chainbase API. [Chainbase Docs](https://docs.chainbase.com/reference/supported-chains)$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://api.chainbase.online', PATH),
|
||||
{'x-api-key': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/CHAINBASE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.rpc
|
||||
signature:
|
||||
- [METHOD, STRING, The RPC method to call]
|
||||
- [PARAMS, ARRAY, The RPC Params arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue an RPC call to Chainbase. [Chainbase Docs](https://docs.chainbase.com/reference/supported-chains)$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
concat('https://api.chainbase.online'),
|
||||
{'x-api-key': '{API_KEY}'},
|
||||
{'id': 1,'jsonrpc': '2.0','method': METHOD,'params': PARAMS},
|
||||
'_FSC_SYS/CHAINBASE') as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_chainstack_udfs(schema_name = "chainstack", utils_schema_name="chainstack_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Chainstack Base api endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Chainstack API. [Chainstack docs here](https://docs.chainstack.com/reference/blockchain-apis).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.chainstack.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'authorization': 'Bearer {API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/CHAINSTACK'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Chainstack API. [Chainstack docs here](https://docs.chainstack.com/reference/blockchain-apis).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.chainstack.com', PATH),
|
||||
{'authorization': 'Bearer {API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/CHAINSTACK'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,18 +0,0 @@
|
||||
{% macro claude_get_api_call(schema_name, api_path) %}
|
||||
SELECT {{ schema_name }}.get(
|
||||
'{{ api_path }}'
|
||||
) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro claude_post_api_call(schema_name, api_path, body) %}
|
||||
SELECT {{ schema_name }}.post(
|
||||
'{{ api_path }}',
|
||||
{{ body }}
|
||||
) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro claude_delete_api_call(schema_name, api_path) %}
|
||||
SELECT {{ schema_name }}.delete_method(
|
||||
'{{ api_path }}'
|
||||
) as response
|
||||
{% endmacro %}
|
||||
@ -1,112 +0,0 @@
|
||||
{% macro config_claude_messages_batch_udfs(schema_name = "claude", utils_schema_name = "claude_utils") -%}
|
||||
{#
|
||||
This macro is used to generate API calls to Claude API endpoints
|
||||
#}
|
||||
|
||||
{# Claude API Messages Batch #}
|
||||
- name: {{ schema_name -}}.post_messages_batch
|
||||
signature:
|
||||
- [MESSAGES, OBJECT, Object of array of message objects]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Send a batch of messages to Claude and get responses [API docs: Messages Batch](https://docs.anthropic.com/en/api/creating-message-batches)$$
|
||||
sql: |
|
||||
SELECT claude_utils.post(
|
||||
'/v1/messages/batches',
|
||||
MESSAGES
|
||||
) as response
|
||||
|
||||
{# Claude API Messages Batch Operations #}
|
||||
- name: {{ schema_name -}}.get_message_batch
|
||||
signature:
|
||||
- [MESSAGE_BATCH_ID, STRING, ID of the Message Batch to retrieve]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Retrieve details of a specific Message Batch [API docs: Retrieve Message Batch](https://docs.anthropic.com/en/api/retrieving-message-batches)$$
|
||||
sql: |
|
||||
SELECT claude_utils.get(
|
||||
CONCAT('/v1/messages/batches/', MESSAGE_BATCH_ID)
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.get_message_batch_results
|
||||
signature:
|
||||
- [MESSAGE_BATCH_ID, STRING, ID of the Message Batch to retrieve results for]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Retrieve results of a Message Batch [API docs: Retrieve Message Batch Results](https://docs.anthropic.com/en/api/retrieving-message-batches)$$
|
||||
sql: |
|
||||
SELECT claude_utils.get(
|
||||
CONCAT('/v1/messages/batches/', MESSAGE_BATCH_ID, '/results')
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.list_message_batches
|
||||
signature: []
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List all Message Batches [API docs: List Message Batches](https://docs.anthropic.com/en/api/retrieving-message-batches)$$
|
||||
sql: |
|
||||
SELECT claude_utils.get(
|
||||
'/v1/messages/batches'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.list_message_batches_with_before
|
||||
signature:
|
||||
- [BEFORE_ID, STRING, ID of the Message Batch to start listing from]
|
||||
- [LIMIT, INTEGER, Maximum number of Message Batches to return]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List all Message Batches [API docs: List Message Batches](https://docs.anthropic.com/en/api/retrieving-message-batches)$$
|
||||
sql: |
|
||||
SELECT claude_utils.get(
|
||||
CONCAT('/v1/messages/batches',
|
||||
'?before_id=', COALESCE(BEFORE_ID, ''),
|
||||
'&limit=', COALESCE(LIMIT::STRING, '')
|
||||
)
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.list_message_batches_with_after
|
||||
signature:
|
||||
- [AFTER_ID, STRING, ID of the Message Batch to start listing from]
|
||||
- [LIMIT, INTEGER, Maximum number of Message Batches to return]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List all Message Batches [API docs: List Message Batches](https://docs.anthropic.com/en/api/retrieving-message-batches)$$
|
||||
sql: |
|
||||
SELECT claude_utils.get(
|
||||
CONCAT('/v1/messages/batches',
|
||||
'?after_id=', COALESCE(AFTER_ID, ''),
|
||||
'&limit=', COALESCE(LIMIT::STRING, '')
|
||||
)
|
||||
) as response
|
||||
- name: {{ schema_name -}}.cancel_message_batch
|
||||
signature:
|
||||
- [MESSAGE_BATCH_ID, STRING, ID of the Message Batch to cancel]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Cancel a Message Batch [API docs: Cancel Message Batch](https://docs.anthropic.com/en/api/retrieving-message-batches)$$
|
||||
sql: |
|
||||
SELECT claude_utils.post(
|
||||
CONCAT('/v1/messages/batches/', MESSAGE_BATCH_ID, '/cancel'),
|
||||
{}
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.delete_message_batch
|
||||
signature:
|
||||
- [MESSAGE_BATCH_ID, STRING, ID of the Message Batch to delete]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Delete a Message Batch [API docs: Delete Message Batch](https://docs.anthropic.com/en/api/retrieving-message-batches)$$
|
||||
sql: |
|
||||
SELECT claude_utils.delete_method(
|
||||
CONCAT('/v1/messages/batches/', MESSAGE_BATCH_ID)
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,87 +0,0 @@
|
||||
{% macro config_claude_messages_udfs(schema_name = "claude", utils_schema_name = "claude_utils") -%}
|
||||
{#
|
||||
This macro is used to generate API calls to Claude API endpoints
|
||||
#}
|
||||
|
||||
{# Claude API Messages #}
|
||||
- name: {{ schema_name -}}.post_messages
|
||||
signature:
|
||||
- [MESSAGES, ARRAY, Array of message objects]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Send a message to Claude and get a response [API docs: Messages](https://docs.anthropic.com/claude/reference/messages_post)$$
|
||||
sql: |
|
||||
SELECT claude_utils.post(
|
||||
'/v1/messages',
|
||||
{
|
||||
'model': 'claude-3-5-sonnet-20241022',
|
||||
'messages': MESSAGES,
|
||||
'max_tokens': 4096
|
||||
}
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post_messages
|
||||
signature:
|
||||
- [MODEL, STRING, The model to use (e.g. 'claude-3-opus-20240229')]
|
||||
- [MESSAGES, ARRAY, Array of message objects]
|
||||
- [MAX_TOKENS, INTEGER, Maximum number of tokens to generate]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Send a message to Claude and get a response [API docs: Messages](https://docs.anthropic.com/claude/reference/messages_post)$$
|
||||
sql: |
|
||||
SELECT claude_utils.post(
|
||||
'/v1/messages',
|
||||
{
|
||||
'model': COALESCE(MODEL, 'claude-3-5-sonnet-20241022'),
|
||||
'messages': MESSAGES,
|
||||
'max_tokens': COALESCE(MAX_TOKENS, 1024)
|
||||
}
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post_messages
|
||||
signature:
|
||||
- [MODEL, STRING, The model to use (e.g. 'claude-3-opus-20240229')]
|
||||
- [MESSAGES, ARRAY, Array of message objects]
|
||||
- [MAX_TOKENS, INTEGER, Maximum number of tokens to generate]
|
||||
- [TEMPERATURE, FLOAT, Temperature for sampling (0-1)]
|
||||
- [TOP_K, INTEGER, Top K for sampling]
|
||||
- [TOP_P, FLOAT, Top P for sampling]
|
||||
- [SYSTEM, STRING, System prompt to use]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Send a message to Claude and get a response [API docs: Messages](https://docs.anthropic.com/claude/reference/messages_post)$$
|
||||
sql: |
|
||||
SELECT claude_utils.post(
|
||||
'/v1/messages',
|
||||
{
|
||||
'model': MODEL,
|
||||
'messages': MESSAGES,
|
||||
'max_tokens': MAX_TOKENS,
|
||||
'temperature': TEMPERATURE,
|
||||
'top_k': TOP_K,
|
||||
'top_p': TOP_P,
|
||||
'system': SYSTEM
|
||||
}
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.count_message_tokens
|
||||
signature:
|
||||
- [MODEL, STRING, The model to use (e.g. 'claude-3-5-sonnet-20241022')]
|
||||
- [MESSAGES, ARRAY, Array of message objects]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Count tokens in a message array before sending to Claude [API docs: Count Tokens](https://docs.anthropic.com/claude/reference/counting-tokens)$$
|
||||
sql: |
|
||||
SELECT claude_utils.post(
|
||||
'/v1/messages/count_tokens',
|
||||
{
|
||||
'model': COALESCE(MODEL, 'claude-3-5-sonnet-20241022'),
|
||||
'messages': MESSAGES
|
||||
}
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,30 +0,0 @@
|
||||
{% macro config_claude_models_udfs(schema_name = "claude", utils_schema_name = "claude_utils") -%}
|
||||
{#
|
||||
This macro is used to generate API calls to Claude API endpoints
|
||||
#}
|
||||
|
||||
{# Claude API Models #}
|
||||
- name: {{ schema_name -}}.list_models
|
||||
signature: []
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List available Claude models [API docs: List Models](https://docs.anthropic.com/claude/reference/models_get)$$
|
||||
sql: |
|
||||
SELECT claude_utils.get(
|
||||
'/v1/models'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.get_model
|
||||
signature:
|
||||
- [MODEL, STRING, The model name to get details for (e.g. 'claude-3-opus-20240229')]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get details for a specific Claude model [API docs: Get Model](https://docs.anthropic.com/claude/reference/models_retrieve)$$
|
||||
sql: |
|
||||
SELECT claude_utils.get(
|
||||
CONCAT('/v1/models/', MODEL)
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,65 +0,0 @@
|
||||
{% macro config_claude_utils_udfs(schema_name = "claude_utils", utils_schema_name = "claude_utils") -%}
|
||||
{#
|
||||
This macro is used to generate API calls to Claude API endpoints
|
||||
#}
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The API endpoint path]
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Make calls to Claude API [API docs: Claude](https://docs.anthropic.com/claude/reference/getting-started-with-the-api)$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.anthropic.com', PATH),
|
||||
{
|
||||
'anthropic-version': '2023-06-01',
|
||||
'x-api-key': '{API_KEY}',
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
BODY,
|
||||
'_FSC_SYS/CLAUDE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The API endpoint path]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Make GET requests to Claude API [API docs: Get](https://docs.anthropic.com/claude/reference/get)$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'GET',
|
||||
CONCAT('https://api.anthropic.com', PATH),
|
||||
{
|
||||
'anthropic-version': '2023-06-01',
|
||||
'x-api-key': '{API_KEY}',
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
NULL,
|
||||
'_FSC_SYS/CLAUDE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.delete_method
|
||||
signature:
|
||||
- [PATH, STRING, The API endpoint path]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Make DELETE requests to Claude API [API docs: Delete](https://docs.anthropic.com/claude/reference/delete)$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'DELETE',
|
||||
CONCAT('https://api.anthropic.com', PATH),
|
||||
{
|
||||
'anthropic-version': '2023-06-01',
|
||||
'x-api-key': '{API_KEY}',
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
NULL,
|
||||
'_FSC_SYS/CLAUDE'
|
||||
) as response
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_cmc_udfs(schema_name = "cmc", utils_schema_name="cmc_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the CoinmarketCap Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the CoinmarketCap API. [CoinmarketCap docs here](https://coinmarketcap.com/api/documentation/v1/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://pro-api.coinmarketcap.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'X-CMC_PRO_API_KEY': '{API_KEY}'},
|
||||
NULL,
|
||||
'_FSC_SYS/CMC'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the CoinmarketCap API. [CoinmarketCap docs here](https://coinmarketcap.com/api/documentation/v1/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://pro-api.coinmarketcap.com', PATH),
|
||||
{'X-CMC_PRO_API_KEY': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/CMC'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_coingecko_udfs(schema_name = "coingecko", utils_schema_name="coingecko_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Coingecko Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the CoinGecko API. [CoinGecko docs here](https://apiguide.coingecko.com/getting-started/introduction).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://pro-api.coingecko.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'x-cg-pro-api-key': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/COINGECKO'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path after '/api' starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the CoinGecko API. [CoinGecko docs here](https://apiguide.coingecko.com/getting-started/introduction).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://pro-api.coingecko.com', PATH),
|
||||
{'x-cg-pro-api-key': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/COINGECKO'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_covalent_udfs(schema_name = "covalent", utils_schema_name="covalent_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Covalent Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Covalent API. [Covalent docs here](https://www.covalenthq.com/docs/unified-api/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.covalenthq.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'Authorization': 'Bearer {API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/COVALENT'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Covalent API. [Covalent docs here](https://www.covalenthq.com/docs/unified-api/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.covalenthq.com', PATH),
|
||||
{'Authorization': 'Bearer {API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/COVALENT'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,45 +0,0 @@
|
||||
{% macro config_credmark_utils_udfs(schema_name = "credmark_utils", utils_schema_name="credmark_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Credmark base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Credmark API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(
|
||||
'https://gateway.credmark.com', PATH, '?',
|
||||
utils.udf_object_to_url_query_string(QUERY_ARGS)
|
||||
),
|
||||
{'Authorization': 'Bearer {API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/CREDMARK'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Credmark API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://gateway.credmark.com', PATH),
|
||||
{'Authorization': 'Bearer {API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/CREDMARK'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,23 +0,0 @@
|
||||
{% macro config_dapplooker_udfs(schema_name = "dapplooker", utils_schema_name = "dapplooker_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the DappLooker endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get_chart
|
||||
signature:
|
||||
- [CHART_ID, STRING, The UUID of the chart]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns the chart data. [DappLooker docs here](https://github.com/dapplooker/dapplooker-sdk).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.dapplooker.com/chart/', CHART_ID, '?api_key={API_KEY}&output_format=json'),
|
||||
{},
|
||||
{},
|
||||
'_FSC_SYS/DAPPLOOKER'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_dappradar_udfs(schema_name = "dappradar", utils_schema_name="dappradar_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the DappRadar Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the DappRadar API. [DappRadar docs here](https://api-docs.dappradar.com/#section/Introduction).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://apis.dappradar.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/DAPPRADAR'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the DappRadar API. [DappRadar docs here](https://api-docs.dappradar.com/#section/Introduction).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://apis.dappradar.com', PATH),
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/DAPPRADAR'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_deepnftvalue_udfs(schema_name = "deepnftvalue", utils_schema_name="deepnftvalue_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the DeepNftValue Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the DeepNftValue API. [DeepNftValue docs here](https://deepnftvalue.readme.io/reference/getting-started-with-deepnftvalue-api).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.deepnftvalue.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'Authorization': 'Token {API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/DEEPNFTVALUE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the DeepNftValue API. [DeepNftValue docs here](https://deepnftvalue.readme.io/reference/getting-started-with-deepnftvalue-api).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.deepnftvalue.com', PATH),
|
||||
{'Authorization': 'Token {API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/DEEPNFTVALUE'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,24 +0,0 @@
|
||||
{% macro config_defillama_udfs(schema_name = "defillama", utils_schema_name="defillama_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Defillama endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Defillama API. [Defillama docs here](https://defillama.com/docs/api).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.llama.fi', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'Accept': '*/*', 'User-Agent': 'livequery/1.0 (Snowflake)', 'Host':'api.llama.fi', 'Connection': 'keep-alive'},
|
||||
NULL,
|
||||
IFF(ARRAY_CONTAINS('api_key'::VARIANT, OBJECT_KEYS(QUERY_ARGS)), '_FSC_SYS/DEFILLAMA', '')
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_dune_udfs(schema_name = "dune", utils_schema_name="dune_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Dune Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Dune API. [Dune docs here](https://dune.com/docs/api/api-reference/authentication/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.dune.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'x-dune-api-key': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/DUNE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Dune API. [Dune docs here](https://dune.com/docs/api/api-reference/authentication/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.dune.com', PATH),
|
||||
{'x-dune-api-key': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/DUNE'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,39 +0,0 @@
|
||||
{% macro config_espn_udfs(schema_name = "espn", utils_schema_name="espn_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the ESPN Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [URL, STRING, The full url including the path]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the ESPN API. [ESPN docs here](https://gist.github.com/akeaswaran/b48b02f1c94f873c6655e7129910fc3b#file-espn-api-docs-md).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(URL, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{},
|
||||
{}
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [URL, STRING, The full url]
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the ESPN API. [ESPN docs here](https://gist.github.com/akeaswaran/b48b02f1c94f873c6655e7129910fc3b#file-espn-api-docs-md).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
URL,
|
||||
{},
|
||||
BODY
|
||||
) as response
|
||||
{% endmacro %}
|
||||
@ -1,7 +0,0 @@
|
||||
{% macro footprint_get_api_call(schema_name, api_path) %}
|
||||
SELECT {{ schema_name -}}.get('/{{api_path}}', QUERY_PARAMS) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro footprint_post_api_call(schema_name, api_path) %}
|
||||
SELECT {{ schema_name -}}.post('/{{api_path}}', BODY) as response
|
||||
{% endmacro %}
|
||||
@ -1,82 +0,0 @@
|
||||
{% macro config_footprint_utils_udfs(schema_name = "footprint_utils", utils_schema_name="footprint_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Footprint base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, ARRAY, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Footprint API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(
|
||||
'https://api.footprint.network/api', PATH, '?',
|
||||
utils.udf_urlencode(QUERY_ARGS, TRUE)
|
||||
),
|
||||
{'api-key': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/FOOTPRINT'
|
||||
) as response
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Footprint API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(
|
||||
'https://api.footprint.network/api', PATH, '?',
|
||||
utils.udf_urlencode(QUERY_ARGS, TRUE)
|
||||
),
|
||||
{'api-key': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/FOOTPRINT'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Footprint API.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://api.footprint.network/api', PATH),
|
||||
{'api-key': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/FOOTPRINT'
|
||||
) as response
|
||||
|
||||
|
||||
- name: {{ schema_name -}}.rpc
|
||||
signature:
|
||||
- [METHOD, STRING, The RPC method to call]
|
||||
- [PARAMS, ARRAY, The RPC Params arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue an RPC call to Footprint.$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
concat('https://api.footprint.network/api'),
|
||||
{'api-key': '{API_KEY}'},
|
||||
{'id': 1,'jsonrpc': '2.0','method': METHOD,'params': PARAMS},
|
||||
'_FSC_SYS/FOOTPRINT') as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,22 +0,0 @@
|
||||
{% macro config_fred_udfs(schema_name = "fred", utils_schema_name = "fred_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the FRED Calls
|
||||
#}
|
||||
- name: {{ schema_name -}}.get_series
|
||||
signature:
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get a FRED series [FRED docs here](https://fred.stlouisfed.org/docs/api/fred/series.html).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.stlouisfed.org/fred/series/observations?api_key={API_KEY}&', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{},
|
||||
{},
|
||||
'_FSC_SYS/FRED'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,210 +0,0 @@
|
||||
{% macro config_github_actions_udfs(schema_name = "github_actions", utils_schema_name = "github_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Github API Calls
|
||||
#}
|
||||
- name: {{ schema_name -}}.workflows
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [query, "OBJECT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$[List repository workflows](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.GET(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/workflows'),
|
||||
query
|
||||
):data::VARIANT
|
||||
- name: {{ schema_name -}}.workflows
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$[List repository workflows](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ schema_name -}}.workflows(owner, repo, {})
|
||||
|
||||
- name: {{ schema_name -}}.runs
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [query, "OBJECT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Lists all workflow runs for a repository. You can use query parameters to narrow the list of results. [Docs](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.GET(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/runs'),
|
||||
query
|
||||
):data::VARIANT
|
||||
- name: {{ schema_name -}}.runs
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Lists all workflow runs for a repository. You can use query parameters to narrow the list of results. [Docs](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ schema_name -}}.runs(owner, repo, {})
|
||||
|
||||
- name: {{ schema_name -}}.workflow_runs
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [workflow_id, "TEXT"]
|
||||
- [query, "OBJECT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. You can use query parameters to narrow the list of results. [Docs](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.GET(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/workflows', workflow_id, 'runs'),
|
||||
query
|
||||
):data::VARIANT
|
||||
- name: {{ schema_name -}}.workflow_runs
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [workflow_id, "TEXT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. You can use query parameters to narrow the list of results. [Docs](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ schema_name -}}.workflow_runs(owner, repo, workflow_id, {})
|
||||
|
||||
- name: {{ schema_name -}}.workflow_dispatches
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [workflow_id, "TEXT"]
|
||||
- [body, "OBJECT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. [Docs](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.POST(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/workflows', workflow_id, 'dispatches'),
|
||||
COALESCE(body, {'ref': 'main'})::OBJECT
|
||||
)::VARIANT
|
||||
|
||||
- name: {{ schema_name -}}.workflow_dispatches
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [workflow_id, "TEXT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. [Docs](https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ schema_name -}}.workflow_dispatches(owner, repo, workflow_id, NULL)
|
||||
|
||||
- name: {{ schema_name -}}.workflow_enable
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [workflow_id, "TEXT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Enables a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. [Docs](https://docs.github.com/en/rest/reference/actions#enable-a-workflow).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.PUT(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/workflows', workflow_id, 'enable'),
|
||||
{}
|
||||
)::VARIANT
|
||||
- name: {{ schema_name -}}.workflow_disable
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [workflow_id, "TEXT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Disables a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. [Docs](https://docs.github.com/en/rest/reference/actions#disable-a-workflow).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.PUT(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/workflows', workflow_id, 'disable'),
|
||||
{}
|
||||
)::VARIANT
|
||||
|
||||
- name: {{ schema_name -}}.workflow_run_logs
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [run_id, "TEXT"]
|
||||
return_type:
|
||||
- "TEXT"
|
||||
options: |
|
||||
COMMENT = $$Download workflow run logs as a ZIP archive. Gets a redirect URL to the actual log archive. [Docs](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#download-workflow-run-logs).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.GET(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/runs', run_id, 'logs'),
|
||||
{}
|
||||
):data::TEXT
|
||||
|
||||
- name: {{ schema_name -}}.job_logs
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [job_id, "TEXT"]
|
||||
return_type:
|
||||
- "TEXT"
|
||||
options: |
|
||||
COMMENT = $$Download job logs. Gets the plain text logs for a specific job. [Docs](https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#download-job-logs-for-a-workflow-run).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.GET(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/jobs', job_id, 'logs'),
|
||||
{}
|
||||
):data::TEXT
|
||||
|
||||
- name: {{ schema_name -}}.workflow_run_jobs
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [run_id, "TEXT"]
|
||||
- [query, "OBJECT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Lists jobs for a workflow run. [Docs](https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ utils_schema_name }}.GET(
|
||||
CONCAT_WS('/', 'repos', owner, repo, 'actions/runs', run_id, 'jobs'),
|
||||
query
|
||||
):data::VARIANT
|
||||
- name: {{ schema_name -}}.workflow_run_jobs
|
||||
signature:
|
||||
- [owner, "TEXT"]
|
||||
- [repo, "TEXT"]
|
||||
- [run_id, "TEXT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Lists jobs for a workflow run. [Docs](https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run).$$
|
||||
sql: |
|
||||
SELECT
|
||||
{{ schema_name -}}.workflow_run_jobs(owner, repo, run_id, {})
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,88 +0,0 @@
|
||||
{% macro config_github_utils_udfs(schema_name = "github_utils", utils_schema_name = "github_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Github API Calls
|
||||
#}
|
||||
- name: {{ schema_name -}}.octocat
|
||||
signature:
|
||||
- []
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Verify token [Authenticating to the REST API](https://docs.github.com/en/rest/overview/authenticating-to-the-rest-api?apiVersion=2022-11-28).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
'https://api.github.com/octocat',
|
||||
{'Authorization': 'Bearer {TOKEN}',
|
||||
'X-GitHub-Api-Version': '2022-11-28'},
|
||||
{},
|
||||
IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'vault/github/api')
|
||||
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.headers
|
||||
signature: []
|
||||
return_type:
|
||||
- "TEXT"
|
||||
options: |
|
||||
NOT NULL
|
||||
IMMUTABLE
|
||||
MEMOIZABLE
|
||||
sql: |
|
||||
SELECT '{"Authorization": "Bearer {TOKEN}",
|
||||
"X-GitHub-Api-Version": "2022-11-28",
|
||||
"Accept": "application/vnd.github+json"}'
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [route, "TEXT"]
|
||||
- [query, "OBJECT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. You can use parameters to narrow the list of results. [Docs](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
CONCAT_WS('/', 'https://api.github.com', route || '?') || utils.udf_urlencode(query),
|
||||
PARSE_JSON({{ schema_name -}}.headers()),
|
||||
{},
|
||||
IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'vault/github/api')
|
||||
)
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [route, "TEXT"]
|
||||
- [data, "OBJECT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. You can use parameters to narrow the list of results. [Docs](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT_WS('/', 'https://api.github.com', route),
|
||||
PARSE_JSON({{ schema_name -}}.headers()),
|
||||
data,
|
||||
IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'vault/github/api')
|
||||
)
|
||||
- name: {{ schema_name -}}.put
|
||||
signature:
|
||||
- [route, "TEXT"]
|
||||
- [data, "OBJECT"]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. You can use parameters to narrow the list of results. [Docs](https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-workflow).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'PUT',
|
||||
CONCAT_WS('/', 'https://api.github.com', route),
|
||||
PARSE_JSON({{ schema_name -}}.headers()),
|
||||
data,
|
||||
IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GITHUB', 'vault/github/api')
|
||||
)
|
||||
{% endmacro %}
|
||||
@ -1,55 +0,0 @@
|
||||
{% macro config_groq_chat_udfs(schema_name = "groq", utils_schema_name = "groq_utils") -%}
|
||||
{#
|
||||
This macro is used to generate API calls to Groq chat completion endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.chat_completions
|
||||
signature:
|
||||
- [MESSAGES, ARRAY, Array of message objects]
|
||||
- [MODEL, STRING, The model to use (optional, defaults to llama3-8b-8192)]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Send messages to Groq and get a chat completion response with optional model selection [API docs: Chat Completions](https://console.groq.com/docs/api-reference#chat-completions)$$
|
||||
sql: |
|
||||
SELECT groq_utils.post(
|
||||
'/openai/v1/chat/completions',
|
||||
{
|
||||
'model': COALESCE(MODEL, 'llama3-8b-8192'),
|
||||
'messages': MESSAGES,
|
||||
'max_tokens': 1024,
|
||||
'temperature': 0.1
|
||||
}
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.quick_chat
|
||||
signature:
|
||||
- [USER_MESSAGE, STRING, The user message to send]
|
||||
- [MODEL, STRING, The model to use (optional, defaults to llama3-8b-8192)]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Quick single message chat with Groq using optional model selection$$
|
||||
sql: |
|
||||
SELECT {{ schema_name }}.chat_completions(
|
||||
ARRAY_CONSTRUCT(
|
||||
OBJECT_CONSTRUCT('role', 'user', 'content', USER_MESSAGE)
|
||||
),
|
||||
MODEL
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.extract_response_text
|
||||
signature:
|
||||
- [GROQ_RESPONSE, VARIANT, The response object from Groq API]
|
||||
return_type:
|
||||
- "STRING"
|
||||
options: |
|
||||
COMMENT = $$Extract the text content from a Groq chat completion response$$
|
||||
sql: |
|
||||
SELECT COALESCE(
|
||||
GROQ_RESPONSE:choices[0]:message:content::STRING,
|
||||
GROQ_RESPONSE:error:message::STRING,
|
||||
'No response available'
|
||||
)
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,64 +0,0 @@
|
||||
{% macro config_groq_utils_udfs(schema_name = "groq_utils", utils_schema_name = "groq_utils") -%}
|
||||
{#
|
||||
This macro is used to generate API calls to Groq API endpoints
|
||||
#}
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The API endpoint path]
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Make POST requests to Groq API [API docs: Groq](https://console.groq.com/docs/api-reference)$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.groq.com', PATH),
|
||||
{
|
||||
'Authorization': 'Bearer {API_KEY}',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
BODY,
|
||||
IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GROQ', 'Vault/prod/livequery/groq')
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The API endpoint path]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Make GET requests to Groq API [API docs: Groq](https://console.groq.com/docs/api-reference)$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'GET',
|
||||
CONCAT('https://api.groq.com', PATH),
|
||||
{
|
||||
'Authorization': 'Bearer {API_KEY}',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
NULL,
|
||||
IFF(_utils.udf_whoami() <> CURRENT_USER(), '_FSC_SYS/GROQ', 'Vault/prod/livequery/groq')
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.list_models
|
||||
signature:
|
||||
- []
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$List available models from Groq API$$
|
||||
sql: |
|
||||
SELECT {{ schema_name }}.get('/openai/v1/models')
|
||||
|
||||
- name: {{ schema_name -}}.get_model_info
|
||||
signature:
|
||||
- [MODEL_ID, STRING, The model ID to get info for]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get information about a specific model$$
|
||||
sql: |
|
||||
SELECT {{ schema_name }}.get('/openai/v1/models/' || MODEL_ID)
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,49 +0,0 @@
|
||||
{% macro config_helius_apis_udfs(schema_name = "helius_apis", utils_schema_name = "helius_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Helius API endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.token_metadata
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [BODY, OBJECT, The body of the API request]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns metadata for a list of given token mint addresses. [Helius docs here](https://docs.helius.xyz/solana-apis/token-metadata-api).$$
|
||||
sql: {{ helius_post_call(utils_schema_name, '/v0/token-metadata') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.balances
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [ADDRESS, STRING, The address to retrieve balances for]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns the native Solana balance (in lamports) and all token balances for a given address. [Helius docs here](https://docs.helius.xyz/solana-apis/balances-api).$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'GET',
|
||||
CASE
|
||||
WHEN NETWORK = 'devnet' THEN
|
||||
concat('https://api-devnet.helius.xyz/v0/addresses/', ADDRESS, '/balances?api-key={API_KEY}')
|
||||
ELSE
|
||||
concat('https://api.helius.xyz/v0/addresses/', ADDRESS, '/balances?api-key={API_KEY}')
|
||||
END,
|
||||
{},
|
||||
{},
|
||||
'_FSC_SYS/HELIUS'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.parse_transactions
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [TRANSACTIONS, ARRAY, An array of transaction signatures]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns an array of enriched, human-readable transactions of the given transaction signatures. Up to 100 transactions per call. [Helius docs here](https://docs.helius.xyz/solana-apis/enhanced-transactions-api/parse-transaction-s).$$
|
||||
sql: |
|
||||
SELECT {{ utils_schema_name -}}.post(NETWORK, '/v0/transactions', {'transactions': TRANSACTIONS}) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,86 +0,0 @@
|
||||
{% macro config_helius_das_udfs(schema_name = "helius_das", utils_schema_name = "helius_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Helius DAS endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get_asset
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [PARAMS, OBJECT, The RPC Params argument]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get an asset by its ID. [Helius docs here](https://docs.helius.xyz/solana-compression/digital-asset-standard-das-api/get-asset).$$
|
||||
sql: {{ helius_rpc_call(utils_schema_name, 'getAsset') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_signatures_for_asset
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [PARAMS, OBJECT, The RPC Params argument]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get a list of transaction signatures related to a compressed asset. [Helius docs here](https://docs.helius.xyz/solana-compression/digital-asset-standard-das-api/get-signatures-for-asset).$$
|
||||
sql: {{ helius_rpc_call(utils_schema_name, 'getSignaturesForAsset') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.search_assets
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [PARAMS, OBJECT, The RPC Params argument]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Search for assets by a variety of parameters. [Helius docs here](https://docs.helius.xyz/solana-compression/digital-asset-standard-das-api/search-assets).$$
|
||||
sql: {{ helius_rpc_call(utils_schema_name, 'searchAssets') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_asset_proof
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [PARAMS, OBJECT, The RPC Params argument]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get a merkle proof for a compressed asset by its ID. [Helius docs here](https://docs.helius.xyz/solana-compression/digital-asset-standard-das-api/get-asset-proof).$$
|
||||
sql: {{ helius_rpc_call(utils_schema_name, 'getAssetProof') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_assets_by_owner
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [PARAMS, OBJECT, The RPC Params argument]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get a list of assets owned by an address. [Helius docs here](https://docs.helius.xyz/solana-compression/digital-asset-standard-das-api/get-assets-by-owner).$$
|
||||
sql: {{ helius_rpc_call(utils_schema_name, 'getAssetsByOwner') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_assets_by_authority
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [PARAMS, OBJECT, The RPC Params argument]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get a list of assets with a specific authority. [Helius docs here](https://docs.helius.xyz/solana-compression/digital-asset-standard-das-api/get-assets-by-authority).$$
|
||||
sql: {{ helius_rpc_call(utils_schema_name, 'getAssetsByAuthority') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_assets_by_creator
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [PARAMS, OBJECT, The RPC Params argument]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get a list of assets created by an address. [Helius docs here](https://docs.helius.xyz/solana-compression/digital-asset-standard-das-api/get-assets-by-creator).$$
|
||||
sql: {{ helius_rpc_call(utils_schema_name, 'getAssetsByCreator') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_assets_by_group
|
||||
signature:
|
||||
- [NETWORK, STRING, mainnet or devnet]
|
||||
- [PARAMS, OBJECT, The RPC Params argument]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Get a list of assets by a group key and value. [Helius docs here](https://docs.helius.xyz/solana-compression/digital-asset-standard-das-api/get-assets-by-group).$$
|
||||
sql: {{ helius_rpc_call(utils_schema_name, 'getAssetsByGroup') | trim }}
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,11 +0,0 @@
|
||||
{% macro helius_rpc_call(schema_name, method) %}
|
||||
SELECT {{ schema_name -}}.rpc(NETWORK, '{{method}}', PARAMS) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro helius_get_call(schema_name, path) %}
|
||||
SELECT {{ schema_name -}}.get(NETWORK, '{{path}}', QUERY_PARAMS) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro helius_post_call(schema_name, path) %}
|
||||
SELECT {{ schema_name -}}.post(NETWORK, '{{path}}', BODY) as response
|
||||
{% endmacro %}
|
||||
@ -1,75 +0,0 @@
|
||||
{% macro config_helius_utils_udfs(schema = "helius_utils", utils_schema_name="helius_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Helius base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema -}}.get
|
||||
signature:
|
||||
- [NETWORK, STRING, The network 'devnet' or 'mainnet']
|
||||
- [PATH, STRING, The API path starting with '/']
|
||||
- [QUERY_PARAMS, OBJECT, The query parameters]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue an HTTP GET request to Helius.$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'GET',
|
||||
CASE
|
||||
WHEN NETWORK = 'devnet' THEN
|
||||
concat('https://api-devnet.helius.xyz', PATH, '?api-key={API_KEY}&', utils.udf_object_to_url_query_string(QUERY_PARAMS))
|
||||
ELSE
|
||||
concat('https://api.helius.xyz', PATH, '?api-key={API_KEY}&', utils.udf_object_to_url_query_string(QUERY_PARAMS))
|
||||
END,
|
||||
{},
|
||||
{},
|
||||
'_FSC_SYS/HELIUS'
|
||||
) as response
|
||||
|
||||
- name: {{ schema -}}.post
|
||||
signature:
|
||||
- [NETWORK, STRING, The network 'devnet' or 'mainnet']
|
||||
- [PATH, STRING, The API path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue an HTTP POST request to Helius.$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
CASE
|
||||
WHEN NETWORK = 'devnet' THEN
|
||||
concat('https://api-devnet.helius.xyz', PATH, '?api-key={API_KEY}')
|
||||
ELSE
|
||||
concat('https://api.helius.xyz', PATH, '?api-key={API_KEY}')
|
||||
END,
|
||||
{},
|
||||
BODY,
|
||||
'_FSC_SYS/HELIUS'
|
||||
) as response
|
||||
|
||||
- name: {{ schema -}}.rpc
|
||||
signature:
|
||||
- [NETWORK, STRING, The network 'devnet' or 'mainnet']
|
||||
- [METHOD, STRING, The RPC method to call]
|
||||
- [PARAMS, OBJECT, The RPC Params arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue an RPC call to Helius.$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
CASE
|
||||
WHEN NETWORK = 'devnet' THEN
|
||||
'https://devnet.helius-rpc.com?api-key={API_KEY}'
|
||||
ELSE
|
||||
'https://mainnet.helius-rpc.com?api-key={API_KEY}'
|
||||
END,
|
||||
{},
|
||||
{'id': 1,'jsonrpc': '2.0','method': METHOD,'params': PARAMS},
|
||||
'_FSC_SYS/HELIUS'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_nftscan_udfs(schema_name = "nftscan", utils_schema_name="nftscan_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the NFTScan Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [URL, STRING, The full url including the path]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the NFTScan API. [NFTScan docs here](https://docs.nftscan.com/guides/Overview/1).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(URL, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/NFTSCAN'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [URL, STRING, The full url]
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the NFTScan API. [NFTScan docs here](https://docs.nftscan.com/guides/Overview/1).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
URL,
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/NFTSCAN'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_opensea_udfs(schema_name = "opensea", utils_schema_name="opensea_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the OpenSea Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the OpenSea API. [OpenSea docs here](https://docs.opensea.io/reference/api-overview).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.opensea.io', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/OPENSEA'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the OpenSea API. [OpenSea docs here](https://docs.opensea.io/reference/api-overview).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://api.opensea.io', PATH),
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/OPENSEA'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,24 +0,0 @@
|
||||
{% macro config_playgrounds_udfs(schema_name = "playgrounds", utils_schema_name = "playgrounds_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Playgrounds calls
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.query_subgraph
|
||||
signature:
|
||||
- [SUBGRAPH_ID, STRING, The ID of the Subgraph]
|
||||
- [QUERY, OBJECT, The GraphQL query]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Query a subgraph via the Playgrounds Proxy [Playgrounds docs here](https://docs.playgrounds.network/api/subgraph-proxy/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://api.playgrounds.network/v1/proxy/subgraphs/id/', SUBGRAPH_ID),
|
||||
{'Playgrounds-Api-Key': '{API_KEY}', 'Content-Type': 'application/json'},
|
||||
QUERY,
|
||||
'_FSC_SYS/PLAYGROUNDS'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,50 +0,0 @@
|
||||
{% macro config_quicknode_ethereum_nfts_udfs(schema_name = "quicknode_ethereum_nfts", utils_schema_name = "quicknode_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the QuickNode Ethereum NFT endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.fetch_nft_collection_details
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns collection details for specified contracts. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_fetchNFTCollectionDetails_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_fetchNFTCollectionDetails') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.fetch_nfts
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns aggregated data on NFTs for a given wallet. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_fetchNFTs).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_fetchNFTs') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.fetch_nfts_by_collection
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns aggregated data on NFTs within a given collection. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_fetchNFTsByCollection_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_fetchNFTsByCollection') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_transfers_by_nft
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns transfers by given NFT. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_getTransfersByNFT_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_getTransfersByNFT') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.verify_nfts_owner
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Confirms ownership of specified NFTs for a given wallet. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_verifyNFTsOwner_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_verifyNFTsOwner') | trim }}
|
||||
{% endmacro %}
|
||||
@ -1,50 +0,0 @@
|
||||
{% macro config_quicknode_ethereum_tokens_udfs(schema_name = "quicknode_ethereum_tokens", utils_schema_name = "quicknode_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the QuickNode Ethereum Token endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get_token_metadata_by_contract_address
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns token details for specified contract. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_getTokenMetadataByContractAddress_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_getTokenMetadataByContractAddress') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_token_metadata_by_symbol
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns token details for specified token symbol. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_getTokenMetadataBySymbol_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_getTokenMetadataBySymbol') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_transactions_by_address
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns transactions within a specified wallet address. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_getTransactionsByAddress_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_getTransactionsByAddress') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_wallet_token_balance
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns ERC-20 tokens and token balances within a wallet. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_getWalletTokenBalance_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_getWalletTokenBalance') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_wallet_token_transactions
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns transfers of a specified token within a specified wallet address. [QuickNode docs here](https://www.quicknode.com/docs/ethereum/qn_getWalletTokenTransactions_v2).$$
|
||||
sql: {{ quicknode_ethereum_mainnet_rpc_call(utils_schema_name, 'qn_getWalletTokenTransactions') | trim }}
|
||||
{% endmacro %}
|
||||
@ -1,50 +0,0 @@
|
||||
{% macro config_quicknode_polygon_nfts_udfs(schema_name = "quicknode_polygon_nfts", utils_schema_name = "quicknode_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the QuickNode Polygon NFT endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.fetch_nft_collection_details
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns collection details for specified contracts. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_fetchNFTCollectionDetails_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_fetchNFTCollectionDetails') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.fetch_nfts
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns aggregated data on NFTs for a given wallet. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_fetchNFTs_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_fetchNFTs') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.fetch_nfts_by_collection
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns aggregated data on NFTs within a given collection. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_fetchNFTsByCollection_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_fetchNFTsByCollection') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_transfers_by_nft
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns transfers by given NFT. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_getTransfersByNFT_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_getTransfersByNFT') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.verify_nfts_owner
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Confirms ownership of specified NFTs for a given wallet. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_verifyNFTsOwner_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_verifyNFTsOwner') | trim }}
|
||||
{% endmacro %}
|
||||
@ -1,50 +0,0 @@
|
||||
{% macro config_quicknode_polygon_tokens_udfs(schema_name = "quicknode_polygon_tokens", utils_schema_name = "quicknode_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the QuickNode Polygon Token endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get_token_metadata_by_contract_address
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns token details for specified contract. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_getTokenMetadataByContractAddress_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_getTokenMetadataByContractAddress') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_token_metadata_by_symbol
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns token details for specified token symbol. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_getTokenMetadataBySymbol_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_getTokenMetadataBySymbol') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_transactions_by_address
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns transactions within a specified wallet address. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_getTransactionsByAddress_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_getTransactionsByAddress') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_wallet_token_balance
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns ERC-20 tokens and token balances within a wallet. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_getWalletTokenBalance_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_getWalletTokenBalance') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.get_wallet_token_transactions
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns transfers of a specified token within a specified wallet address. [QuickNode docs here](https://www.quicknode.com/docs/polygon/qn_getWalletTokenTransactions_v2).$$
|
||||
sql: {{ quicknode_polygon_mainnet_rpc_call(utils_schema_name, 'qn_getWalletTokenTransactions') | trim }}
|
||||
{% endmacro %}
|
||||
@ -1,11 +0,0 @@
|
||||
{% macro quicknode_ethereum_mainnet_rpc_call(schema_name, method) %}
|
||||
SELECT {{ schema_name -}}.ethereum_mainnet_rpc('{{method}}', PARAMS) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro quicknode_polygon_mainnet_rpc_call(schema_name, method) %}
|
||||
SELECT {{ schema_name -}}.polygon_mainnet_rpc('{{method}}', PARAMS) as response
|
||||
{% endmacro %}
|
||||
|
||||
{% macro quicknode_solana_mainnet_rpc_call(schema_name, method) %}
|
||||
SELECT {{ schema_name -}}.solana_mainnet_rpc('{{method}}', PARAMS) as response
|
||||
{% endmacro %}
|
||||
@ -1,24 +0,0 @@
|
||||
{% macro config_quicknode_solana_nfts_udfs(schema_name = "quicknode_solana_nfts", utils_schema_name = "quicknode_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the QuickNode Solana NFT endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.fetch_nfts
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns aggregated data on NFTs for a given wallet. [QuickNode docs here](https://www.quicknode.com/docs/solana/qn_fetchNFTs).$$
|
||||
sql: {{ quicknode_solana_mainnet_rpc_call(utils_schema_name, 'qn_fetchNFTs') | trim }}
|
||||
|
||||
- name: {{ schema_name -}}.fetch_nfts_by_creator
|
||||
signature:
|
||||
- [PARAMS, OBJECT, The RPC Params]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Returns aggregated data on NFTs that have been created by an address. [QuickNode docs here](https://www.quicknode.com/docs/solana/qn_fetchNFTsByCreator).$$
|
||||
sql: {{ quicknode_solana_mainnet_rpc_call(utils_schema_name, 'qn_fetchNFTsByCreator') | trim }}
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,57 +0,0 @@
|
||||
{% macro config_quicknode_utils_udfs(schema_name = "quicknode_utils", utils_schema_name="quicknode_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the QuickNode base endpoints/RPC calls
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.ethereum_mainnet_rpc
|
||||
signature:
|
||||
- [METHOD, STRING, The RPC method to call]
|
||||
- [PARAMS, OBJECT, The RPC Params arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue an Ethereum RPC call to QuickNode.$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
'{ethereum-mainnet}',
|
||||
{},
|
||||
{'id': 1,'jsonrpc': '2.0','method': METHOD,'params': [PARAMS]},
|
||||
'_FSC_SYS/QUICKNODE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.polygon_mainnet_rpc
|
||||
signature:
|
||||
- [METHOD, STRING, The RPC method to call]
|
||||
- [PARAMS, OBJECT, The RPC Params arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a Polygon RPC call to QuickNode.$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
'{polygon-matic}',
|
||||
{},
|
||||
{'id': 1,'jsonrpc': '2.0','method': METHOD,'params': [PARAMS]},
|
||||
'_FSC_SYS/QUICKNODE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.solana_mainnet_rpc
|
||||
signature:
|
||||
- [METHOD, STRING, The RPC method to call]
|
||||
- [PARAMS, OBJECT, The RPC Params arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a Solana RPC call to QuickNode.$$
|
||||
sql: |
|
||||
SELECT live.udf_api(
|
||||
'POST',
|
||||
'{solana-solana-mainnet}',
|
||||
{},
|
||||
{'id': 1,'jsonrpc': '2.0','method': METHOD,'params': PARAMS},
|
||||
'_FSC_SYS/QUICKNODE'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_reservoir_udfs(schema_name = "reservoir", utils_schema_name="reservoir_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Reservoir Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Reservoir NFT Data API. [Reservoir docs here](https://docs.reservoir.tools/reference/nft-data-overview).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.reservoir.tools', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'x-api-key': '{API_KEY}'},
|
||||
NULL,
|
||||
'_FSC_SYS/RESERVOIR'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Reservoir NFT Data API. [Reservoir docs here](https://docs.reservoir.tools/reference/nft-data-overview).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://api.reservoir.tools', PATH),
|
||||
{'x-api-key': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/RESERVOIR'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,58 +0,0 @@
|
||||
{% macro config_slack_messaging_udfs(schema_name = "slack", utils_schema_name = "slack_utils") -%}
|
||||
{#
|
||||
This macro is used to generate API calls to Slack API endpoints
|
||||
#}
|
||||
|
||||
{# Slack Webhook Messages #}
|
||||
- name: {{ schema_name }}.webhook_send
|
||||
signature:
|
||||
- [WEBHOOK_URL, STRING, Slack webhook URL]
|
||||
- [PAYLOAD, OBJECT, Complete Slack message payload according to Slack API spec]
|
||||
return_type:
|
||||
- "OBJECT"
|
||||
options: |
|
||||
COMMENT = $$Send a message to Slack via webhook [API docs: Webhooks](https://api.slack.com/messaging/webhooks)$$
|
||||
sql: |
|
||||
SELECT slack_utils.post_webhook(
|
||||
WEBHOOK_URL,
|
||||
PAYLOAD
|
||||
) as response
|
||||
|
||||
{# Slack Web API Messages #}
|
||||
- name: {{ schema_name }}.post_message
|
||||
signature:
|
||||
- [BOT_TOKEN, STRING, Slack bot token (xoxb-...)]
|
||||
- [CHANNEL, STRING, Slack channel ID or name]
|
||||
- [PAYLOAD, OBJECT, Message payload according to Slack chat.postMessage API spec]
|
||||
return_type:
|
||||
- "OBJECT"
|
||||
options: |
|
||||
COMMENT = $$Send a message to Slack via Web API [API docs: chat.postMessage](https://api.slack.com/methods/chat.postMessage)$$
|
||||
sql: |
|
||||
SELECT slack_utils.post_message(
|
||||
BOT_TOKEN,
|
||||
CHANNEL,
|
||||
PAYLOAD
|
||||
) as response
|
||||
|
||||
|
||||
- name: {{ schema_name }}.post_reply
|
||||
signature:
|
||||
- [BOT_TOKEN, STRING, Slack bot token (xoxb-...)]
|
||||
- [CHANNEL, STRING, Slack channel ID or name]
|
||||
- [THREAD_TS, STRING, Parent message timestamp for threading]
|
||||
- [PAYLOAD, OBJECT, Message payload according to Slack chat.postMessage API spec]
|
||||
return_type:
|
||||
- "OBJECT"
|
||||
options: |
|
||||
COMMENT = $$Send a threaded reply to Slack via Web API [API docs: chat.postMessage](https://api.slack.com/methods/chat.postMessage)$$
|
||||
sql: |
|
||||
SELECT slack_utils.post_reply(
|
||||
BOT_TOKEN,
|
||||
CHANNEL,
|
||||
THREAD_TS,
|
||||
PAYLOAD
|
||||
) as response
|
||||
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,140 +0,0 @@
|
||||
{% macro config_slack_utils_udfs(schema_name = "slack_utils", utils_schema_name = "slack_utils") -%}
|
||||
{#
|
||||
This macro is used to generate API calls to Slack API endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name }}.post_webhook
|
||||
signature:
|
||||
- [WEBHOOK_URL, STRING, Slack webhook URL]
|
||||
- [PAYLOAD, OBJECT, Complete Slack message payload according to Slack API spec]
|
||||
return_type:
|
||||
- "OBJECT"
|
||||
options: |
|
||||
COMMENT = $$Send a message to Slack via webhook. User provides complete payload according to Slack webhook API spec.$$
|
||||
sql: |
|
||||
SELECT CASE
|
||||
WHEN WEBHOOK_URL IS NULL OR WEBHOOK_URL = '' THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'webhook_url is required')
|
||||
WHEN NOT STARTSWITH(WEBHOOK_URL, 'https://hooks.slack.com/') THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'Invalid webhook URL format')
|
||||
WHEN PAYLOAD IS NULL THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'payload is required')
|
||||
ELSE
|
||||
live.udf_api(
|
||||
'POST',
|
||||
WEBHOOK_URL,
|
||||
OBJECT_CONSTRUCT('Content-Type', 'application/json'),
|
||||
PAYLOAD
|
||||
)
|
||||
END as response
|
||||
|
||||
- name: {{ schema_name }}.post_message
|
||||
signature:
|
||||
- [BOT_TOKEN, STRING, Slack bot token (xoxb-...)]
|
||||
- [CHANNEL, STRING, Slack channel ID or name]
|
||||
- [PAYLOAD, OBJECT, Message payload according to Slack chat.postMessage API spec]
|
||||
return_type:
|
||||
- "OBJECT"
|
||||
options: |
|
||||
COMMENT = $$Send a message to Slack via Web API chat.postMessage. User provides complete payload according to Slack API spec.$$
|
||||
sql: |
|
||||
SELECT CASE
|
||||
WHEN BOT_TOKEN IS NULL OR BOT_TOKEN = '' THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'bot_token is required')
|
||||
WHEN NOT STARTSWITH(BOT_TOKEN, 'xoxb-') THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'Invalid bot token format')
|
||||
WHEN CHANNEL IS NULL OR CHANNEL = '' THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'channel is required')
|
||||
WHEN PAYLOAD IS NULL THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'payload is required')
|
||||
ELSE
|
||||
live.udf_api(
|
||||
'POST',
|
||||
'https://slack.com/api/chat.postMessage',
|
||||
OBJECT_CONSTRUCT(
|
||||
'Authorization', 'Bearer ' || BOT_TOKEN,
|
||||
'Content-Type', 'application/json'
|
||||
),
|
||||
OBJECT_INSERT(PAYLOAD, 'channel', CHANNEL)
|
||||
)
|
||||
END as response
|
||||
|
||||
- name: {{ schema_name }}.post_reply
|
||||
signature:
|
||||
- [BOT_TOKEN, STRING, Slack bot token (xoxb-...)]
|
||||
- [CHANNEL, STRING, Slack channel ID or name]
|
||||
- [THREAD_TS, STRING, Parent message timestamp for threading]
|
||||
- [PAYLOAD, OBJECT, Message payload according to Slack chat.postMessage API spec]
|
||||
return_type:
|
||||
- "OBJECT"
|
||||
options: |
|
||||
COMMENT = $$Send a threaded reply to Slack via Web API. User provides complete payload according to Slack API spec.$$
|
||||
sql: |
|
||||
SELECT CASE
|
||||
WHEN BOT_TOKEN IS NULL OR BOT_TOKEN = '' THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'bot_token is required')
|
||||
WHEN NOT STARTSWITH(BOT_TOKEN, 'xoxb-') THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'Invalid bot token format')
|
||||
WHEN CHANNEL IS NULL OR CHANNEL = '' THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'channel is required')
|
||||
WHEN THREAD_TS IS NULL OR THREAD_TS = '' THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'thread_ts is required')
|
||||
WHEN PAYLOAD IS NULL THEN
|
||||
OBJECT_CONSTRUCT('ok', false, 'error', 'payload is required')
|
||||
ELSE
|
||||
live.udf_api(
|
||||
'POST',
|
||||
'https://slack.com/api/chat.postMessage',
|
||||
OBJECT_CONSTRUCT(
|
||||
'Authorization', 'Bearer ' || BOT_TOKEN,
|
||||
'Content-Type', 'application/json'
|
||||
),
|
||||
OBJECT_INSERT(
|
||||
OBJECT_INSERT(PAYLOAD, 'channel', CHANNEL),
|
||||
'thread_ts', THREAD_TS
|
||||
)
|
||||
)
|
||||
END as response
|
||||
|
||||
- name: {{ schema_name }}.validate_webhook_url
|
||||
signature:
|
||||
- [WEBHOOK_URL, STRING, Webhook URL to validate]
|
||||
return_type:
|
||||
- "BOOLEAN"
|
||||
options: |
|
||||
COMMENT = $$Validate if a string is a proper Slack webhook URL format.$$
|
||||
sql: |
|
||||
SELECT WEBHOOK_URL IS NOT NULL
|
||||
AND STARTSWITH(WEBHOOK_URL, 'https://hooks.slack.com/services/')
|
||||
AND LENGTH(WEBHOOK_URL) > 50
|
||||
|
||||
- name: {{ schema_name }}.validate_bot_token
|
||||
signature:
|
||||
- [BOT_TOKEN, STRING, Bot token to validate]
|
||||
return_type:
|
||||
- "BOOLEAN"
|
||||
options: |
|
||||
COMMENT = $$Validate if a string is a proper Slack bot token format.$$
|
||||
sql: |
|
||||
SELECT BOT_TOKEN IS NOT NULL
|
||||
AND STARTSWITH(BOT_TOKEN, 'xoxb-')
|
||||
AND LENGTH(BOT_TOKEN) > 20
|
||||
|
||||
- name: {{ schema_name }}.validate_channel
|
||||
signature:
|
||||
- [CHANNEL, STRING, Channel ID or name to validate]
|
||||
return_type:
|
||||
- "BOOLEAN"
|
||||
options: |
|
||||
COMMENT = $$Validate if a string is a proper Slack channel ID or name format.$$
|
||||
sql: |
|
||||
SELECT CHANNEL IS NOT NULL
|
||||
AND LENGTH(CHANNEL) > 0
|
||||
AND (
|
||||
STARTSWITH(CHANNEL, 'C') OR -- Channel ID
|
||||
STARTSWITH(CHANNEL, 'D') OR -- DM ID
|
||||
STARTSWITH(CHANNEL, 'G') OR -- Group/Private channel ID
|
||||
STARTSWITH(CHANNEL, '#') -- Channel name
|
||||
)
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,22 +0,0 @@
|
||||
{% macro config_snapshot_udfs(schema_name = "snapshot", utils_schema_name="snapshot_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Snapshot Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.query
|
||||
signature:
|
||||
- [QUERY, OBJECT, The GraphQL query]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a Graphql Query to the Snapshot API. [Snapshot docs here](https://docs.snapshot.org/tools/api).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
'https://hub.snapshot.org/graphql',
|
||||
{},
|
||||
QUERY
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,79 +0,0 @@
|
||||
{% macro config_solscan_udfs(schema_name = "solscan", utils_schema_name="solscan_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Solscan Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.pro_api_get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Private Solscan API. [Solscan docs here](https://pro-api.solscan.io/pro-api-docs/v1.0).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://pro-api.solscan.io', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'token': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/SOLSCAN'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.pro_api_post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Private Solscan API. [Solscan docs here](https://pro-api.solscan.io/pro-api-docs/v1.0).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://pro-api.solscan.io', PATH),
|
||||
{'token': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/SOLSCAN'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.public_api_get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Public Solscan API. [Solscan docs here](https://public-api.solscan.io/docs/#/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://public-api.solscan.io', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'token': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/SOLSCAN'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.public_api_post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Public Solscan API. [Solscan docs here](https://public-api.solscan.io/docs/#/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://public-api.solscan.io', PATH),
|
||||
{'token': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/SOLSCAN'
|
||||
) as response
|
||||
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,23 +0,0 @@
|
||||
{% macro config_stakingrewards_udfs(schema_name = "stakingrewards", utils_schema_name="stakingrewards_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the StakingRewards Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.query
|
||||
signature:
|
||||
- [QUERY, OBJECT, The GraphQL query]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a Graphql Query to the StakingRewards API. [StakingRewards docs here](https://api-docs.stakingrewards.com/api-docs/get-started/quick-start-guide).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
'https://api.stakingrewards.com/public/query',
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
QUERY,
|
||||
'_FSC_SYS/STAKINGREWARDS'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,45 +0,0 @@
|
||||
{% macro config_strangelove_udfs(schema_name = "strangelove", utils_schema_name = "strangelove_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Subquery Calls
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [URL, STRING, The url to issue a get request to]
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Issue a GET request to a Strangelove Endpoint [Strangelove docs here](https://voyager.strange.love/docs/cosmoshub/mainnet#/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat(
|
||||
URL, '?',
|
||||
utils.udf_object_to_url_query_string(QUERY_ARGS)
|
||||
),
|
||||
{'x-apikey': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/STRANGELOVE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [URL, STRING, The url to issue a post request to]
|
||||
- [QUERY, OBJECT, The body of the request]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Issue a POST request to a Strangelove Endpoint [Strangelove docs here](https://voyager.strange.love/docs/cosmoshub/mainnet#/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
URL,
|
||||
{'x-apikey': '{API_KEY}'},
|
||||
QUERY,
|
||||
'_FSC_SYS/STRANGELOVE'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,22 +0,0 @@
|
||||
{% macro config_subquery_udfs(schema_name = "subquery", utils_schema_name = "subquery_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Subquery Calls
|
||||
#}
|
||||
- name: {{ schema_name -}}.graphql
|
||||
signature:
|
||||
- [PROJECT, STRING, The sub-query project name]
|
||||
- [QUERY, OBJECT, The graphql query]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Query a SubQuery Project [SubQuery docs here](https://explorer.subquery.network/subquery/subquery/kepler-network).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
concat('https://api.subquery.network/sq/subquery/', PROJECT),
|
||||
{},
|
||||
QUERY
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,23 +0,0 @@
|
||||
{% macro config_topshot_udfs(schema_name = "topshot", utils_schema_name = "topshot_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Topshot calls
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.graphql
|
||||
signature:
|
||||
- [QUERY, OBJECT, The GraphQL query]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Run a graphql query on TopShot.$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
'https://public-api.nbatopshot.com/graphql',
|
||||
{'User-Agent': 'Flipside_Flow_metadata/0.1','Accept-Encoding': 'gzip', 'Content-Type': 'application/json', 'Accept': 'application/json','Connection': 'keep-alive'},
|
||||
QUERY,
|
||||
'_FSC_SYS/TOPSHOT'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_transpose_udfs(schema_name = "transpose", utils_schema_name="transpose_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Transpose Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Transpose API. [Transpose docs here](https://docs.transpose.io/rest/overview/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.transpose.io', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/TRANSPOSE'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Transpose API. [Transpose docs here](https://docs.transpose.io/rest/overview/).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.transpose.io', PATH),
|
||||
{'X-API-KEY': '{API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/TRANSPOSE'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_zapper_udfs(schema_name = "zapper", utils_schema_name="zapper_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Zapper Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Zapper API. [Zapper docs here](https://studio.zapper.xyz/docs/apis/getting-started).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.zapper.xyz', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'Authorization': 'Basic {API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/ZAPPER'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Zapper API. [Zapper docs here](https://studio.zapper.xyz/docs/apis/getting-started).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.zapper.xyz', PATH),
|
||||
{'Authorization': 'Basic {API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/ZAPPER'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
@ -1,42 +0,0 @@
|
||||
{% macro config_zettablock_udfs(schema_name = "zettablock", utils_schema_name="zettablock_utils") -%}
|
||||
{#
|
||||
This macro is used to generate the Zettablock Base endpoints
|
||||
#}
|
||||
|
||||
- name: {{ schema_name -}}.get
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [QUERY_ARGS, OBJECT, The query arguments]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'GET' request to the Zettablock API. [Zettablock docs here](https://docs.zettablock.com/reference/api-intro).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET',
|
||||
concat('https://api.zettablock.com', PATH, '?', utils.udf_object_to_url_query_string(QUERY_ARGS)),
|
||||
{'Authorization': 'Bearer {API_KEY}'},
|
||||
{},
|
||||
'_FSC_SYS/ZETTABLOCK'
|
||||
) as response
|
||||
|
||||
- name: {{ schema_name -}}.post
|
||||
signature:
|
||||
- [PATH, STRING, The path starting with '/']
|
||||
- [BODY, OBJECT, The request body]
|
||||
return_type:
|
||||
- "VARIANT"
|
||||
options: |
|
||||
COMMENT = $$Used to issue a 'POST' request to the Zettablock API. [Zettablock docs here](https://docs.zettablock.com/reference/api-intro).$$
|
||||
sql: |
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'POST',
|
||||
CONCAT('https://api.zettablock.com', PATH),
|
||||
{'Authorization': 'Bearer {API_KEY}'},
|
||||
BODY,
|
||||
'_FSC_SYS/ZETTABLOCK'
|
||||
) as response
|
||||
|
||||
{% endmacro %}
|
||||
Loading…
Reference in New Issue
Block a user