create_query_token: Create Query Token

View source: R/create_query_token.R

create_query_tokenR Documentation

Create Query Token

Description

Uses Flipside ShroomDK to create a Query Token to access Flipside Crypto data. The query token is kept 'ttl' hours and available for no-additional cost reads up to 'mam' minutes (i.e., cached to the same exact result). allowing for pagination and multiple requests before expending more daily request uses.

Usage

create_query_token(
  query,
  api_key,
  ttl = 1,
  mam = 10,
  data_source = "snowflake-default",
  data_provider = "flipside",
  api_url = "https://api-v2.flipsidecrypto.xyz/json-rpc"
)

Arguments

query

Flipside Crypto Snowflake SQL compatible query as a string.

api_key

Flipside Crypto ShroomDK API Key

ttl

time-to-live (in hours) to keep query results available. Default 1 hour.

mam

max-age-minutes, lifespan of cache. set to 0 to always re-execute. Default 10 minutes.

data_source

Where data is sourced, including specific computation warehouse. Default "snowflake-default". Non default data sources may require registration of api_key to allowlist.

data_provider

Who provides data, Default "flipside". Non default data providers may require registration of api_key to allowlist.

api_url

default to https://api-v2.flipsidecrypto.xyz/json-rpc but upgradeable for user.

Value

list of 'token' and 'cached' use 'token' in 'get_query_from_token()'

Examples

## Not run: 
create_query_token(
query = "SELECT * FROM ethereum.core.fact_transactions LIMIT 33",
api_key = readLines("api_key.txt"),
ttl = 1,
mam = 5
)

## End(Not run)

shroomDK documentation built on May 29, 2024, 1:21 a.m.