Skip to content

Instantly share code, notes, and snippets.

View tedim52's full-sized avatar

Tedi Mitiku tedim52

View GitHub Profile
@tedim52
tedim52 / revert-7702.ts
Last active March 6, 2026 01:28
Revert 7702 authorization with Privy
import {randomUUID} from 'node:crypto';
import {PrivyClient, type AuthorizationContext} from '@privy-io/node';
import {createPublicClient, http} from 'viem';
import {mainnet} from 'viem/chains'; // replace with your chain
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' as const;
const privy = new PrivyClient({
 appId: process.env.PRIVY_APP_ID!,
 appSecret: process.env.PRIVY_APP_SECRET!,
@tedim52
tedim52 / headless-export.ts
Last active March 10, 2026 10:01
Headless Wallet Export
/**
* Headless Wallet Export Script
*
* This script exports a Privy embedded wallet's private key using HPKE encryption.
*
* Required dependencies:
* npm install @hpke/core @hpke/chacha20poly1305 @noble/curves @noble/hashes @scure/base axios canonicalize
*
* Usage:
* const privateKey = await exportWalletHeadlessly({