Skip to content

cwj526/myGoat-helper

Repository files navigation

myGoat-helper

GOAT Hackathon 2026 Demo project for a "daily GOAT chain concierge".

This app focuses on high-frequency user problems on GOAT Network:

  • Check token balances without remembering contract addresses
  • Find a better swap quote and reduce slippage risk
  • See whether current gas is low or expensive
  • Request faucet funds on testnet
  • Track transaction confirmation status
  • Discover more trustworthy ERC-8004 agents
  • Pay for premium agent services with an x402-style flow

What It Includes

  • A polished frontend demo page built with Next.js
  • GOAT-focused helper APIs for balances, quotes, gas, faucet, tx tracking, and agent lookup
  • ERC-8004-friendly positioning for hackathon demos
  • MetaMask-based x402 payment flow
    • create order
    • sign EIP-712 payload
    • submit signature
    • send ERC20 payment from wallet
    • confirm settlement

Tech Stack

  • Next.js 14
  • TypeScript
  • Tailwind CSS
  • ethers v6
  • local @goatnetwork/agentkit SDK

Project Structure

src/pages/index.tsx                  Main hackathon demo page
src/pages/api/helper.ts              Unified helper API
src/pages/api/x402/*                 x402 order / signature / settlement routes
src/lib/goat.ts                      GOAT chain helper logic
src/lib/x402.ts                      x402 merchant/order logic

Local Setup

Install dependencies:

npm install

Run the app:

npm run dev

Open:

http://localhost:3000

Environment

Create .env.local if needed:

GOAT_MAINNET_RPC_URL=https://rpc.goat.network
GOAT_TESTNET_RPC_URL=https://rpc.testnet3.goat.network
GOAT_FAUCET_URL=https://bridge.testnet3.goat.network/api

X402_NETWORK=goat-testnet
X402_RECEIVER_ADDRESS=0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
X402_TOKEN_ADDRESS=0x29d1ee93e9ecf6e50f309f498e40a6b42d352fa1
X402_ASSET_SYMBOL=USDC
X402_TOKEN_DECIMALS=6

Notes:

  • The current x402 flow is frontend wallet driven, so no server private key is required.
  • X402_RECEIVER_ADDRESS is the merchant/agent receiving wallet.
  • X402_TOKEN_ADDRESS must match a real transferable token on the chosen GOAT network.

Demo Flow

Suggested hackathon demo order:

  1. Show the homepage and explain the 6 user pain points.
  2. Demo balance lookup by token symbol.
  3. Demo swap quote comparison.
  4. Demo gas snapshot.
  5. Demo faucet helper.
  6. Demo tx tracking.
  7. Demo x402 payment with MetaMask.

x402 Flow

The payment flow currently works like this:

  1. Frontend calls /api/x402/create-order
  2. Backend creates a merchant order and returns typed-data payload
  3. User signs with MetaMask
  4. Frontend calls /api/x402/submit-signature
  5. Frontend sends ERC20 transfer from the connected wallet
  6. Frontend calls /api/x402/confirm-settlement

Relevant endpoints:

  • /api/x402/create-order
  • /api/x402/submit-signature
  • /api/x402/order-status/[paymentId]
  • /api/x402/confirm-settlement
  • /api/x402/cancel-order

ERC-8004 Registration

Current agent metadata URI:

myGoat-helper.json

Official registration page:

GOAT Hackathon Register

Repository

GitHub:

cwj526/myGoat-helper

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages