New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

snacktesting

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snacktesting

A CLI tool for sending USDC payments on Twitter and Farcaster using x402.

latest
npmnpm
Version
0.0.1
Version published
Maintainers
0
Created
Source

🍪 Snack Money API – x402 Example

This repository contains example scripts that demonstrate how to use the Snack Money API to send USDC to any Farcaster or Twitter user — no wallet address required, thanks to the x402 protocol.

Prerequisites

  • Node.js v20+ (Install via nvm)
  • Yarn v1
  • An Ethereum private key to sign and send transactions

Setup

  • Clone the repository:

    git clone https://github.com/snack-money/x402-axios-example.git
    cd x402-axios-example
    
  • Install dependencies:

    yarn install
    
  • Configure environment variables:

    cp .env-local .env
    
    • Edit .env and add your Ethereum private key.

Single Account Payment

Usage

Send USDC to a single user via Twitter or Farcaster:

yarn pay --receiver_identity <identity_type> --receiver_username <receiver_username> --amount <amount>
  • <identity_type>: Either farcaster or twitter
  • <receiver_username>: Receiver’s username (e.g., 0xmesuthere, mesut)
  • <amount>: Amount of USDC to send (e.g., 0.01)

Examples

yarn pay --receiver_identity twitter --receiver_username 0xmesuthere --amount 0.01
yarn pay --receiver_identity farcaster--receiver_username mesut --amount 0.01

Batch Payments

Usage

Send USDC to multiple recipients in a single batch:

yarn batch-pay --receiver_identity <identity_type> --receivers '<receivers_json>'
  • <identity_type>: farcaster or twitter
  • <receivers_json>: A JSON array of recipients containing username and amount

Examples

yarn batch-pay --receiver_identity farcaster --receivers '[{"username":"lincoln","amount":0.5},{"username":"mesut","amount":0.25}]'

yarn batch-pay --receiver_identity twitter --receivers '[{"username":"MurrLincoln","amount":0.5},{"username":"0xmesuthere","amount":0.25}]'

Reward Distribution Creation

Usage

Create a reward distribution order with reward budget:

yarn create-reward-distribution --budget <budget> --platform <platform> --content_id <content_id>
  • <budget>: Amount of USDC to send (e.g., 10)
  • <platform>: farcaster or twitter
  • <content_id>: The platform-provided Content ID associated with the content eligible for reward distribution.

Examples

yarn create-reward-distribution --budget 10 --platform farcaster --content_id 0xb87cf233790dd2d8a3ed9549f9e15069c02b1da0

Reward Distribution Confirmation

Usage

Confirms and distributes reward budget among participants:

yarn confirm-reward-distribution --order_id <order_id>
  • <order_id>: An Order Id obtained from reward distribution creation

Examples

yarn confirm-reward-distribution --order_id x987ASCbjHk

Notes

  • The identity type must match the platform the user is on.
  • Ensure your private key is secure and funded with sufficient USDC.

Keywords

cli

FAQs

Package last updated on 23 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts