ShroomDK Migration Guide
As we continue to innovate, we're transitioning from our legacy API/SDK, ShroomDK, to our new and improved API v2. This upgraded API enables users to execute complex SQL queries on Flipside's Blockchain Data Sets and provides enhanced scalability and performance.
Here are the key steps for migrating to API v2:
For Python or JavaScript SDK users, please update to the latest versions:
Python
JavaScript
R
pip install flipside
Then, create a new Flipside instance with your API key and the new API endpoint:
flipside = Flipside("<YOUR_API_KEY>", "https://api-v2.flipsidecrypto.xyz")
npm install @flipsidecrypto/sdk
Subsequently, instantiate a new Flipside object using your API key and the new API endpoint:
const flipside = new Flipside("<YOUR_API_KEY>", "https://api-v2.flipsidecrypto.xyz");
# 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
)
The updated SDKs will automatically target the new API v2 endpoints.
If you're directly accessing the API, replace all ShroomDK API URLs in your codebase with the new v2 API URL:
https://api-v2.flipsidecrypto.xyz
.API v2 introduces changes to JSON responses. Adjust your response handling code to match these new specifications. Detailed information on the new JSON responses is available on our API documentation page.
After making these changes, be sure to thoroughly test your applications to confirm smooth functionality with API v2. For any issues encountered during the migration, please reach out to our support team.
Last modified 3mo ago