From 7b350055f77dca39cdc06756d92ad07f9fe23b49 Mon Sep 17 00:00:00 2001 From: Carlos Mercado Date: Mon, 12 Jun 2023 17:10:19 +0000 Subject: [PATCH] GITBOOK-435: change request with no subject merged in GitBook --- flipside-api/sdks.md | 2 +- flipside-api/shroomdk-migration-guide.md | 31 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/flipside-api/sdks.md b/flipside-api/sdks.md index 10a347a..40b80c6 100644 --- a/flipside-api/sdks.md +++ b/flipside-api/sdks.md @@ -2,7 +2,7 @@ Flipside makes available the following SDKs as higher-level, more developer-friendly wrappers over the API. Examples for each SDK are available throughout the [Concepts & Examples Section here](get-started/). -
LanguageVersionSource Code (Github)
✅ Python2.0.7Source Code
✅ JS/TypeScript2.0.0Source Code
🏗 R0.2.1Source Code
+
LanguageVersionSource Code (Github)
✅ Python2.0.7Source Code
✅ JS/TypeScript2.0.0Source Code
✅ R0.2.1Source Code
Want an SDK for another language? Or want to create your own SDK? Please reach out in [Discord](https://discord.gg/ZmU3jQuu6W)! diff --git a/flipside-api/shroomdk-migration-guide.md b/flipside-api/shroomdk-migration-guide.md index 6eecae6..6b5d432 100644 --- a/flipside-api/shroomdk-migration-guide.md +++ b/flipside-api/shroomdk-migration-guide.md @@ -44,6 +44,37 @@ Subsequently, instantiate a new Flipside object using your API key and the new A const flipside = new Flipside("", "https://api-v2.flipsidecrypto.xyz"); ``` {% endtab %} + +{% tab title="R" %} +``` +# Current CRAN version: 0.2.1 +packageVersion("shroomDK") == '0.2.1' +install.packages("shroomDK") +library(shroomDK) + +file.exists("api_key.txt") # always gitignore your API keys! + +api_key <- ReadLines("api_key.txt") + +query <- { +" +SELECT + date_trunc('hour', block_timestamp) as hour, + count(distinct tx_hash) as tx_count +FROM ethereum.core.fact_transactions +WHERE block_timestamp >= GETDATE() - interval'7 days' +GROUP BY 1 +" + } + +# auto_paginate_query "just works" similar to 0.1.1 behavior +# use ?auto_paginate_query to see new detailed parameters. +pull_data <- auto_paginate_query( +query = query, +api_key = api_key +) +``` +{% endtab %} {% endtabs %} The updated SDKs will automatically target the new API v2 endpoints.