跳到正文
TakoAPI
返回技能列表

trifle-auth

由 okwme 提供

Search & Research
—暂无评分
你的评分

简介

Authenticate with the Trifle API using Sign-In with Ethereum (SIWE)

描述

该技能的功能

Handles wallet-based authentication for the Trifle API using Sign-In with Ethereum (SIWE). Performs the full nonce-fetch, message-sign, and verify handshake, then stores the resulting JWT for use by other Trifle skills like snake-game. Private keys are read from an environment variable or 1Password.

Centralizes the SIWE handshake and token storage so every other Trifle skill can read a valid JWT without reimplementing auth logic.

何时使用

  • Logging in to Trifle before casting snake game votes
  • Generating a fresh Ethereum wallet for a new Trifle agent
  • Checking whether a stored JWT is still valid before an automated run
  • Retrieving a JWT token path to pass into downstream Trifle skill scripts
  • Inspecting current ball balance on a Trifle account

示例工作流

输入

User asks: log in to Trifle with my wallet

智能体
  1. 1

    Reads private key from TRIFLE_PRIVATE_KEY env var or 1Password vault

  2. 2

    Fetches a one-time nonce from /auth/wallet/nonce

  3. 3

    Constructs a SIWE message with domain trifle.life and signs it with the private key

  4. 4

    Posts the signed message to /auth/wallet/verify

  5. 5

    Writes the returned JWT and account metadata to ~/.local/state/trifle-auth/auth-state.json

输出

JWT token stored locally, valid for 30 days, ready for use by other Trifle skills

前置要求

  • TRIFLE_PRIVATE_KEY environment variable (or 1Password vault named "Gigi" with item "EVM Wallet - Trifle Agent" containing the private key)
  • 1Password CLI if using 1Password for key storage

安装

clawhub install okwme/trifle-auth

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接