Skip to content

Instantly share code, notes, and snippets.

View ries9112's full-sized avatar

ries9112

View GitHub Profile
import * as ethUtil from 'ethereumjs-util';
console.log('got here');
window.ethUtil = ethUtil;
@ries9112
ries9112 / CV_TheGraph_delegation_pull.R
Created May 16, 2022 09:44
A script that makes an API request using the users's address to make a plot of the user's delegation on The Graph
let image_show = parcel.getFeatureById('image_show_delegation')
feature.on('click',e=>{
image_show.set({'url':"http://r-cv-api.org/delegation/delegations_unrealized_rewards?delegator="+e.player.wallet})
console.log(e.player.wallet)
})
library(ghql)
library(jsonlite)
library(tidyverse)
# connect to endpoint
con = GraphqlClient$new(
url = "https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-analytics"
)
# initialize a new query
graphql_request = Query$new()
@ries9112
ries9112 / CV_arweave_backups.yml
Created March 13, 2022 21:48
Script to automate upload of CV parcel content to arweave
name: Automated Backups Cryptovoxels
on:
schedule:
- cron: '0 10 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@ries9112
ries9112 / flexdashboard_hicdex_lookup
Created September 5, 2021 20:39
A dashboard to plot cumulative sales over time for either an artist or a given tag: https://predictcrypto.shinyapps.io/HEN_lookup/
---
title: "HEN Data Lookup"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: fill
theme: spacelab
source_code: embed
social: ['twitter','facebook','linkedin']
runtime: shiny
@ries9112
ries9112 / plot_by_artist.R
Created September 5, 2021 19:27
Plot cumulative sales in Tezos for your favorite HEN artist
library(ghql)
library(jsonlite)
library(tidyverse)
library(ggdark)
library(ggfx)
library(scales)
# Tag to lookup:
artist = "tz2Pkj2xWJovKKCsABjnr3NbyMVJTMBkpTvb"
@ries9112
ries9112 / Plot objkt4objkt tag sales - HEN
Last active September 5, 2021 13:01
You can run this code at any time to view the cumulative sales over time of objkts with the "objkt4objkt" tag
library(ghql)
library(jsonlite)
library(tidyverse)
library(ggdark)
library(ggfx)
library(scales)
# Tag to lookup:
tag = "objkt4objkt"
@ries9112
ries9112 / CV_API_pull.R
Created August 22, 2021 02:31
R script that pulls all data for CV parcels, then collects data about their prices using opensea API
# https://wiki.cryptovoxels.com/en/External-API
# Pull data from opensea using vox tokenIDs pulled in grt_vox_pull_tokenID.R
library(jsonlite)
library(httr)
library(tidyverse)
# example
url <- 'https://www.cryptovoxels.com/api/parcels.json'
# Get the data from the url
@ries9112
ries9112 / CV_archive_tx_id
Last active July 23, 2021 14:45
Query to find CryptoVoxels Archives. Copy/paste into https://arweave.net/graphql
query {
transactions(
tags: [
{
name: "Content-Type",
values: ["application/zip"]
},
{
name: "Tag-Name",
values: ["CryptoVoxelsArchive"]
@ries9112
ries9112 / CV_backup.yml
Created July 15, 2021 12:37
arweave CV backups GithubActions
name: Automated Backups Cryptovoxels
on:
schedule:
- cron: '0 10 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2