Skip to content

Instantly share code, notes, and snippets.

@anastasiarods
anastasiarods / index.ts
Created January 28, 2025 13:10
Get Farcaster User Data
import { createPublicClient, http } from "viem";
import { base, optimism } from "viem/chains";
const HUB_URL = "https://hub.pinata.cloud";
const CONTRACTS = {
NEYNAR: "0xdB1eCF22d195dF9e03688C33707b19C68BdEd142",
REGISTRY: "0x00000000Fc6c5F01Fc30151999387Bb99A9f489b"
} as const;
interface User {
@anastasiarods
anastasiarods / index.ts
Created October 20, 2024 19:37
Example of decoding EVM Gnosis Safe Calldata with Loop Decoder
import { createPublicClient, http } from 'viem'
// Create a public client for the Ethereum Mainnet network
const getPublicClient = (chainId: number) => {
return {
client: createPublicClient({
transport: http('https://rpc.ankr.com/eth'),
}),
}
}
@anastasiarods
anastasiarods / index.ts
Created October 20, 2024 19:12
Example of decoding EVM tx with Loop Decoder
import { createPublicClient, http } from 'viem'
// Create a public client for the Ethereum Mainnet network
const getPublicClient = (chainId: number) => {
return {
client: createPublicClient({
transport: http('https://rpc.ankr.com/eth'),
}),
}
}
@anastasiarods
anastasiarods / index.ts
Last active November 21, 2024 06:17
Create Farcaster signer
//@ts-nocheck
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable no-console */
import {
createWalletClient,
http,
toHex,
encodeAbiParameters,
type EncodeAbiParametersReturnType,
type Hex,