Skip to content

Instantly share code, notes, and snippets.

View dalechyn's full-sized avatar
🏠
Working from home

Vladyslav Dalechyn dalechyn

🏠
Working from home
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dalechyn
dalechyn / abi.ts
Last active March 22, 2025 12:53
abi.ts
const abi = [
{
"type": "constructor",
"inputs": [
{
"name": "_router",
"type": "address",
"internalType": "contract IUniswapV2Router02"
},
{
@dalechyn
dalechyn / ssr-patch.diff
Created November 25, 2024 23:11
patch to fix ssr issues within frame sdk
diff --git a/node_modules/@farcaster/frame-sdk/dist/endpoint.js b/node_modules/@farcaster/frame-sdk/dist/endpoint.js
index b034ca0..697a451 100644
--- a/node_modules/@farcaster/frame-sdk/dist/endpoint.js
+++ b/node_modules/@farcaster/frame-sdk/dist/endpoint.js
@@ -1,18 +1,32 @@
var _a;
import { windowEndpoint } from "comlink";
+const mockEndpoint = {
+ // noop
+ postMessage() { },
@dalechyn
dalechyn / query-provider.ts
Last active November 25, 2024 17:29
query-provider.tsx
'use client'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import * as React from 'react'
// import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental'
// import superjson from 'superjson'
import { hashFn, structuralSharing } from '~/_lib/query'
This file has been truncated, but you can view the full file.
import {
jsxs as e,
jsx as t,
Fragment as r
} from "react/jsx-runtime";
import {
getAddress as n
} from "@ethersproject/address";
import {
Web3Provider as i
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="fc:frame" content="vNext" />
<meta property="fc:frame:image:aspect_ratio" content="1:1" />
<meta property="fc:frame:image"
content="https://beliefs.social/api/frames/tip/0x93Df8835B411cebd01F3F9AAF1d297ef14b7F220/0x1aB9F44798f87758F1913e6b68E000aC2a38f886/11517/frame?previousState=%2523O_%257B%2522token%2522%253A%2522%257B%255C%2522json%255C%2522%253A%257B%255C%2522isCreatorHunter%255C%2522%253Afalse%252C%255C%2522amountToDistributeAirdropToken%255C%2522%253A%255C%252250000000000000000000000000%255C%2522%252C%255C%2522amountToDistributeClaimableRewardsToken%255C%2522%253A%255C%252210000000000000000000000000%255C%2522%252C%255C%2522creatorFid%255C%2522%253A10906%252C%255C%2522id%255C%2522%253A48%252C%255C%2522address%255C%2522%253A%255C%25220x93Df8835B411cebd01F3F9AAF1d297ef14b7F220%255C%2522%252C%255C%2522name%255C%2522%253A%255C%2522Hubble%2520Protocol%255C%2522%252C%255C%2522symbol%255C%2522%253A%255C%2522HUBGR%255C%2522%252C%255C%2522imageUrl%25
BOOBA 0
[
"",
{
"children": [
"home",
{
"realTimeUpdatesCheckbox": [
"__PAGE__",
{
@dalechyn
dalechyn / generateRadixColors.ts
Last active July 15, 2024 13:49
Generate Custom Radix Color Scales
import * as RadixColors from '@radix-ui/colors'
import Color from 'colorjs.io'
import BezierEasing from 'bezier-easing'
type ArrayOf12<T> = [T, T, T, T, T, T, T, T, T, T, T, T]
const arrayOf12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] as const
// prettier-ignore
const grayScaleNames = ['gray', 'mauve', 'slate', 'sage', 'olive', 'sand'] as const;
FROM node:20-alpine AS base
# Install pnpm with corepack
RUN corepack enable && corepack prepare pnpm@latest --activate
# Enable `pnpm add --global` on Alpine Linux by setting
# home location environment variable to a location already in $PATH
# https://github.com/pnpm/pnpm/issues/784#issuecomment-1518582235
ENV PNPM_HOME=/usr/local/bin
# Add a global package
RUN pnpm add --global @upleveled/preflight@latest
RUN pnpm -g add turbo
@dalechyn
dalechyn / running-dockerized-subgraph.md
Created May 17, 2024 18:43
running-dockerized-subgraph.md

This readme describes how to run Abstract API via docker and how to pass custom network configurations.

Firstly, prepare a set of the networks you're planning to pass to the API instance. Such should conform the schema {[chainId]:{ rpc: string; versionControl: string }}.

In chainId parameter you must specify the chain id which will hold the following properties:

In rpc parameter you must specify network RPC URL. In versionControl parameter you must specify the address of Version Control contract deployed in that network.

I.e: { "phoenix-1": {"rpc":"https://rpc-proxy.abstract-os.workers.dev/phoenix-1/rpc","versionControl":"terra1hstp8gfjlg2reet90mgada3h8n9jf2d7tnd9r554h0d0q95lgq5q2fhp8v"}}