Agent Skills by ALSEL
汎用その他⭐ リポ 13品質スコア 81/100

ton-blockchain

TONブロックチェーン操作:ウォレット管理、TON/ジェットン転送、DEXスワップ、トークン分析、イールド/DeFiプール、NFT取引、DNS解決、DCA/リミットオーダー、ステーキング、キャッシュバック、紹介プログラム、コンテスト、Telegraph公開に対応しています。 以下の場合に使用できます: - TONウォレットの作成/インポート/管理 - 残高確認(TON、ジェットン、NFT) - TONまたはジェットンをアドレス/.tonドメインに送信 - DEX経由でトークンをスワップ(TON↔USDTなど) - トークン分析(価格、信頼スコア、詐欺検出) - イールドプール検索、流動性の追加/削除 - NFTの購入/販売/転送 - .tonドメイン解決 - DCAまたはリミットオーダー作成(自動売買) - 各プロトコル経由のTONステーキング/アンステーキング - プロフィール、キャッシュバック、クレーム、紹介の管理 - コンテスト参加、リーダーボード確認 - Telegraphへのマークダウン公開(telegra.ph)

description の原文を見る

TON blockchain operations: wallet management, TON/jetton transfers, DEX swaps, token analytics, yield/DeFi pools, NFT trading, DNS resolution, DCA/limit orders, staking, cashback, referrals, contests, and Telegraph publishing. Use when user wants to: - Create/import/manage TON wallets - Check balances (TON, jettons, NFTs) - Send TON or jettons to address/.ton domain - Swap tokens (TON↔USDT, etc.) via DEX - Analyze tokens (price, trust score, scam detection) - Find yield pools, add/remove liquidity - Buy/sell/transfer NFTs - Resolve .ton domains - Create DCA or limit orders (automated trading) - Stake/unstake TON via various protocols - Manage profile, cashback, claims, referrals - Participate in contests and view leaderboards - Publish markdown to Telegraph (telegra.ph)

SKILL.md 本文

TON ブロックチェーン スキル

スクリプト: ~/.openclaw/workspace/openclaw-ton-skill/scripts/

自動開始: トランザクション モニター

初回使用時またはスキルをインストール後、ウォレットが存在してモニターが実行されていないかを確認します:

python wallet.py -p <password> list
python monitor.py status

ウォレットが存在し、モニターが実行されていない場合:

  1. モニター デーモンを開始します: python monitor.py start -p <password> --daemon
  2. 60秒ごとに ~/.openclaw/ton-skill/monitor.log をチェックする cron ジョブを作成します
  3. 受信/送信トランザクション、スワップ、または NFT イベントについてユーザーに通知します
  4. 処理後にログをクリアします

新しいウォレットを作成またはインポートした後, ユーザーに尋ねます:

  1. "Хочешь включить эмуляцию транзакций перед отправкой?"
    • Да, на всё → config で emulation_mode: all を設定
    • Только на крупные → 閾値を尋ねて emulation_mode: threshold, emulation_threshold_ton: <amount> を設定
    • Только на определённыеemulation_mode: selective を設定 (スワップ/NFT/yield のみをエミュレート、シンプルな転送はスキップ)
    • Нетemulation_mode: none を設定

設定: python utils.py config set emulation_mode <all|threshold|selective|none>

その後は常に:

  1. 新しいウォレットをピックアップするためにモニターを再起動します: python monitor.py stop && python monitor.py start -p <password> --daemon
  2. モニター cron がまだ存在していない場合は作成します

これにより、すべてのウォレットに対してリアルタイムのトランザクション通知が常にアクティブであることが保証されます。

セットアップ

初回セットアップ

初回使用時、APIキーを設定するようユーザーに促します。最低限:

  1. Marketapp (NFT フロア価格、買売に必須): https://marketapp.ws/api-token でトークンを取得
  2. TonAPI (オプション、無料枠あり): https://tonscan.org/api で取得
  3. DYOR (オプション、トークン分析用): https://dyor.io/tonapi?pricing で取得

API キー

CLI 経由で設定するか、~/.openclaw/ton-skill/config.json を編集します:

# TonAPI (ほとんどの操作に必須)
python utils.py config set tonapi_key "YOUR_TONAPI_KEY"

# swap.coffee (スワップと yield 用)
python utils.py config set swap_coffee_key "YOUR_SWAP_COFFEE_KEY"

# DYOR (トークン分析用)
python utils.py config set dyor_key "YOUR_DYOR_KEY"

# Marketapp (NFT トレード用)
python utils.py config set marketapp_key "YOUR_MARKETAPP_KEY"

依存関係

pip install requests cryptography tonsdk

ウォレット パスワード

ウォレット操作に WALLET_PASSWORD 環境変数を設定するか、--password フラグを使用します。


ウォレット管理

スクリプト: wallet.py

ウォレットを作成

python wallet.py create --label "trading"
python wallet.py create --label "cold" --version v4r2

出力にはニーモニックが含まれます — 保存してください! 1 回のみ表示されます。

ウォレットをインポート

python wallet.py import --mnemonic "word1 word2 ... word24" --label "imported"

ウォレットを一覧表示

python wallet.py list
python wallet.py list --balances   # TON 残高を含める (遅い)

残高を取得

python wallet.py balance trading
python wallet.py balance trading --full   # jetton を含める
python wallet.py balance UQBvW8Z5huBk...  # アドレスで

ウォレットの名前を変更

python wallet.py label trading "main-trading"

ニーモニックをエクスポート

python wallet.py export trading

ウォレットを削除

python wallet.py remove old-wallet

カスタムウォレットを作成

カスタムアドレスパターンを持つウォレットを生成します (例: "CAFE"、"TON"、"777" を含むアドレス):

# アドレスが EQ + パターンで開始 (EQ プレフィックスの後)
python wallet.py create-vanity --prefix "CAFE" --label "cafe-wallet"

# アドレスが任意の場所にパターンを含む
python wallet.py create-vanity --contains "TON" --label "ton-wallet"

# アドレスがパターンで終了
python wallet.py create-vanity --suffix "777" --label "lucky"

# 大文字小文字を区別したマッチング (遅い)
python wallet.py create-vanity --prefix "ABC" --case-sensitive --label "abc-wallet"

# カスタムスレッド数とタイムアウト
python wallet.py create-vanity --contains "DEAD" --threads 8 --timeout 7200 --label "dead-wallet"

オプション:

  • --prefix — アドレスが EQ + パターンで開始
  • --contains — アドレスが任意の場所にパターンを含む
  • --suffix — アドレスがパターンで終了
  • --case-sensitive — 大文字小文字を区別したマッチング (デフォルト: 区別しない)
  • --threads — ワーカープロセス (デフォルト: CPU コア数)
  • --timeout — 最大検索時間 (秒単位) (デフォルト: 3600 = 1 時間)
  • --label — ウォレットラベル

難度評価:

パターン長難度推定時間
2文字簡単1秒未満
3文字簡単数秒
4文字中程度数分
5文字数時間
6文字以上非常に難数日以上

⚠️ base64url 文字のみ使用可能: A-Za-z0-9-_


転送

スクリプト: transfer.py

TON を送信

# エミュレート (送信しない)
python transfer.py ton --from trading --to UQBvW8Z5... --amount 5

# コメント付き
python transfer.py ton --from trading --to wallet.ton --amount 1 --comment "Thanks!"

# 転送を実行
python transfer.py ton --from trading --to UQBvW8Z5... --amount 5 --confirm

Jetton を送信

# USDT 転送をエミュレート
python transfer.py jetton --from trading --to wallet.ton --jetton USDT --amount 100

# 実行
python transfer.py jetton --from trading --to UQBvW8Z5... --jetton USDT --amount 100 --confirm

常に先にエミュレートします。実行するには --confirm を追加します。


スワップ (DEX)

スクリプト: swap.py

クォートを取得

python swap.py quote --from TON --to USDT --amount 10 --wallet UQBvW8...
python swap.py quote --from USDT --to TON --amount 100 --wallet trading --slippage 1.0

スワップを実行

# エミュレート
python swap.py execute --wallet trading --from TON --to USDT --amount 10

# スリッページで実行
python swap.py execute --wallet trading --from USDT --to NOT --amount 50 --slippage 1.0 --confirm

ステータスを確認

python swap.py status --hash abc123...

既知のトークン

python swap.py tokens

サポート: TON, USDT, USDC, NOT, STON, DUST


DNS (.ton ドメイン)

スクリプト: dns.py

ドメインを解決

python dns.py resolve wallet.ton
python dns.py resolve foundation   # .ton サフィックスはオプション

ドメイン情報

python dns.py info wallet.ton   # オーナー、有効期限、NFT アドレス

アドレスまたはドメインを確認

python dns.py check wallet.ton
python dns.py check UQBvW8Z5...

トークン API (swap.coffee)

スクリプト: tokens.py

swap.coffee トークン API からの豊富なトークンデータ: 市場統計、価格チャート、ホルダー、検索。

Jetton を一覧表示

python tokens.py list --search USDT --size 10
python tokens.py list --verification WHITELISTED,COMMUNITY
python tokens.py list --page 2 --size 50

Jetton 情報を取得 (市場統計付き)

python tokens.py info EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs

返値: price_usd, price_change (5m/1h/6h/24h/7d), volume_24h, tvl, mcap, fdmc, holders_count, trust_score。

価格チャート

python tokens.py price-chart EQCxE6... --hours 24
python tokens.py price-chart EQCxE6... --from "2024-01-01T00:00:00Z" --to "2024-01-02T00:00:00Z"
python tokens.py price-chart EQCxE6... --currency ton

トップホルダー

python tokens.py holders EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs

ハイブリッド検索 (Memepad 付き)

python tokens.py search --query pepe --kind MEMES_ALL
python tokens.py search --query NOT --sort VOLUME_24H
python tokens.py search --kind MEMES_MEMEPADS --sort TVL

種類: ALL, DEXES, MEMES_ALL, MEMES_DEXES, MEMES_MEMEPADS ソート: FDMC, TVL, MCAP, VOLUME_24H, PRICE_CHANGE_24H

アカウント Jetton 残高

python tokens.py balances UQBvW8Z5huBkMJYdnfAEM5JqTNkgxvhw...

一括取得

python tokens.py bulk EQCxE6... EQBlqs... EQAvlW...

ラベル

python tokens.py labels

トークン分析

スクリプト: analytics.py

完全なトークン情報

python analytics.py info --token DUST
python analytics.py info --token EQBlqsm144Dq...  # アドレスで

トラストスコア (詐欺検出)

python analytics.py trust --token NOT

出力には評価が含まれます:

  • ✅ 高トラスト (≥80) — 一般的に安全
  • ⚠️ 中トラスト (50-79) — 注意が必要
  • 🔴 低トラスト (20-49) — 高リスク
  • 🚨 非常に低トラスト (<20) — 詐欺の可能性

価格履歴

python analytics.py history --token STON --days 7
python analytics.py history --token TON --days 30

DEX プール

python analytics.py pools --token USDT

トークンを比較

python analytics.py compare --tokens "DUST,NOT,STON"

API ステータス

python analytics.py status   # DYOR/TonAPI の可用性を確認

Yield / DeFi

スクリプト: yield_cmd.py

swap.coffee yield API は 16 のプロトコルから 2000 個のプールを集約します: stonfi, stonfi_v2, dedust, tonco, evaa, tonstakers, stakee, bemo, bemo_v2, hipo, kton, storm_trade, torch_finance, dao_lama_vault, bidask, coffee

プールを一覧表示

python yield_cmd.py pools --sort apr
python yield_cmd.py pools --sort tvl --limit 50
python yield_cmd.py pools --page 2 --limit 100   # ページネーション
python yield_cmd.py pools --all                   # 全 2000 プール

# クライアント側フィルター (すべてのプールを自動取得、5 分キャッシュ)
python yield_cmd.py pools --protocol stonfi
python yield_cmd.py pools --token TON
python yield_cmd.py pools --min-tvl 1000000
python yield_cmd.py pools --trusted-only
python yield_cmd.py pools --protocol dedust --token USDT --min-tvl 100000

ソート: apr, tvl, volume ページネーション: --page N (1 から始まる), ページあたり最大 100 キャッシュ: python yield_cmd.py cache --status / --clear

**注:**サーバー側フィルターは機能しません — すべてのフィルタリングはクライアント側です。

プール詳細

python yield_cmd.py pool --id EQD...abc

返値: TVL (USD), volume, fees, APR, LP APR, boost APR, tokens, protocol。

推奨事項

python yield_cmd.py recommend --risk low
python yield_cmd.py recommend --token TON --risk medium
python yield_cmd.py recommend --risk high --amount 100

リスクレベル:

  • low — TVL ≥1M、安定ペア、最小の無常損失
  • medium — TVL ≥100K、中程度の無常損失
  • high — TVL ≥10K、任意のペア

ポジションを表示

python yield_cmd.py positions --wallet EQD...xyz

TonAPI 経由でウォレット内の LP トークンを検出 (名前ヒューリスティック)。

プロトコルを一覧表示

python yield_cmd.py protocols

デポジット / ウィッスロー (API 経由ではサポートされていません)

デポジットおよびウィッスロー操作には、DEX スマートコントラクト (STON.fi, DeDust, TONCO など) との直接的な相互作用が必要です。DEX 固有の SDK または swap.py を使用して流動性操作を実行します。


NFT

スクリプト: nft.py

ウォレット内の NFT を一覧表示

python nft.py list --wallet trading
python nft.py list --wallet UQBvW8... --limit 50

NFT 情報

python nft.py info --address EQC7...

コレクション情報

python nft.py collection --address EQCV...
python nft.py collection --address EQCV... --filter onsale --limit 20

コレクションを検索

python nft.py search --query "TON Diamonds"

Telegram ギフト販売中

python nft.py gifts
python nft.py gifts --min-price 1 --max-price 10
python nft.py gifts --model "Plush Pepe" --symbol "🐸"

NFT を購入

# エミュレート
python nft.py buy --nft EQC7... --wallet trading

# 実行
python nft.py buy --nft EQC7... --wallet trading --confirm

NFT を売却

python nft.py sell --nft EQC7... --price 5.5 --wallet trading --confirm

価格を変更

python nft.py change-price --nft EQC7... --price 10 --wallet trading --confirm

販売をキャンセル

python nft.py cancel-sale --nft EQC7... --wallet trading --confirm

NFT を転送

python nft.py transfer --nft EQC7... --from trading --to wallet.ton --confirm

ユーティリティ

スクリプト: utils.py

設定

python utils.py config show
python utils.py config get tonapi_key
python utils.py config set tonapi_key "YOUR_KEY"
python utils.py config set limits.max_transfer_ton 500

アドレス変換

python utils.py address to-raw UQBvW8Z5huBk...
python utils.py address to-friendly 0:6f5bc679...
python utils.py address validate UQBvW8Z5huBk...

セキュリティ

重要なルール

  1. 暗号化ストレージ — 秘密鍵は ~/.openclaw/ton-skill/wallets.enc に AES-256 で暗号化して保存
  2. 先にエミュレート — すべてのトランザクションは実行前にエミュレート (手数料、残高変更を表示)
  3. 明示的な確認 — ブロックチェーン書き込みには --confirm が必須
  4. 秘密情報をログに記録しない — ニーモニック/鍵はログに絶対に書き込まない

トランザクション フロー

  1. トランザクションを構築
  2. TonAPI でエミュレート (手数料、結果を表示)
  3. インラインボタン付きで確認メッセージを表示 (下記参照)
  4. ユーザーが ✅ または ❌ をクリック
  5. サインして放送、またはキャンセル

インラインボタン付き確認

トランザクションが確認を必要とする場合 (転送、スワップ、デポジット、ウィッスロー、NFT 買売)、 常に message ツールを使用してインラインボタン付きで確認メッセージを送信します:

message action=send buttons=[[{"text":"✅ Подтвердить","callback_data":"ton_tx_confirm"},{"text":"❌ Отменить","callback_data":"ton_tx_cancel"}]]

メッセージには以下を含める必要があります:

  • トランザクションタイプ (転送/スワップ/デポジット等)
  • 金額と宛先
  • エミュレーションからの推定手数料
  • 警告 (大口金額、未検証トークン等)

確認メッセージの例:

🔄 Свап 3.7 TON → ~5.09 USDT
📍 DEX: Moon (swap.coffee)
💰 Fee: ~0.15 TON
⚠️ Slippage: 1%

ユーザーがクリックすると:

  • ton_tx_confirm/tmp/ton_pending_tx.json から事前署名済み BOC をすぐに送信、結果を報告
  • ton_tx_cancel → "Отменено ✅" と返信、/tmp/ton_pending_tx.json を削除

事前署名フロー (高速応答に重要)

トランザクションを確認用に準備する際:

  1. API 経由でトランザクションを構築
  2. すべてのトランザクションをウォレットで署名 (seqno を取得、転送メッセージを作成)
  3. 署名済み BOC を /tmp/ton_pending_tx.json に保存:
{
  "description": "Deposit 7.2 TON + 10 USDT → Coffee DEX",
  "txs": [
    {"boc": "base64...", "amount_ton": 7.4, "to": "0:db2e..."},
    {"boc": "base64...", "amount_ton": 0.19, "to": "0:2b25..."}
  ],
  "query_id": 123456,
  "created_at": 1234567890
}
  1. インラインボタン付きで確認メッセージを表示
  2. ton_tx_confirm が到着したら → 各 BOC を /blockchain/message に POST するだけ、完了!

確認時に再構築または再署名しないでください! BOC は送信準備ができています。 保留中の TX が 60 秒より古い場合、送信前に再署名 (valid_until 有効期限の期限切れ)。

callback_data の処理

ton_tx_confirm と一致するメッセージを受け取った場合:

  1. /tmp/ton_pending_tx.json を読む
  2. TonAPI 経由で各 boc を送信
  3. ✅ 結果で返信
  4. ペンディングファイルを削除

ton_tx_cancel を受け取った場合:

  1. /tmp/ton_pending_tx.json を削除
  2. "Отменено ✅" と返信

制限

~/.openclaw/ton-skill/config.json で設定:

{
  "limits": {
    "max_transfer_ton": 100,
    "require_confirmation": true
  }
}

一般的なパターン

転送前に残高を確認

python wallet.py balance trading --full
python transfer.py ton --from trading --to recipient.ton --amount 10
# エミュレーション出力を確認
python transfer.py ton --from trading --to recipient.ton --amount 10 --confirm

スワップ前にトークンを分析

python analytics.py trust --token NEWTOKEN
python analytics.py info --token NEWTOKEN
python swap.py quote --from TON --to NEWTOKEN --amount 1 --wallet trading

最高の Yield を探す

python yield_cmd.py recommend --risk medium --token TON
python yield_cmd.py pool --id <recommended_pool_id>
python yield_cmd.py deposit --pool <id> --amount 100 --wallet trading

エラー処理

すべてのコマンドは success フィールドを含む JSON を返します:

{"success": true, "data": ...}
{"success": false, "error": "Error message"}

終了コード: 0 = 成功、1 = エラー


トランザクション モニター

スクリプト: monitor.py

TonAPI SSE (Server-Sent Events) またはポーリング フォールバックを通じたウォレットのリアルタイムトランザクション監視。

モニターを開始

# フォアグラウンド
python monitor.py start -p <password>

# バックグラウンド (デーモン)
python monitor.py start -p <password> --daemon

# 特定のウォレットのみ
python monitor.py start -p <password> --wallet trading --wallet main

# ポーリングを強制 (SSE の代わりに)
python monitor.py start -p <password> --polling

ステータス

python monitor.py status

出力:

{
  "running": true,
  "pid": 12345,
  "started_at": "2026-02-13T02:15:00",
  "wallets": ["trading", "main"],
  "mode": "sse",
  "last_seen": {...}
}

モニターを停止

python monitor.py stop

イベント フォーマット

標準出力 JSON (エージェント解析用):

{
  "type": "incoming_transfer",
  "wallet": "trading",
  "address": "EQ...",
  "amount": "5.0 TON",
  "from": "EQ...",
  "timestamp": "2026-02-13T02:12:00",
  "tx_hash": "abc..."
}

イベントタイプ:

  • incoming_transfer — TON/jetton の受信
  • outgoing_transfer — TON/jetton の送信
  • swap — DEX スワップ
  • nft_transfer — NFT 転送
  • other — その他の操作

LaunchAgent (自動起動)

# パスワード付きでインストール
WALLET_PASSWORD=xxx ./scripts/install-launchagent.sh

# 実行
launchctl load ~/Library/LaunchAgents/com.openclaw.ton-monitor.plist

# 停止
launchctl unload ~/Library/LaunchAgents/com.openclaw.ton-monitor.plist

# ログ
tail -f ~/Library/Logs/ton-monitor.log

ストレージ

  • ステート: ~/.openclaw/ton-skill/monitor_state.json
  • ログ: ~/.openclaw/ton-skill/monitor.log
  • PID: ~/.openclaw/ton-skill/monitor.pid

依存関係

pip install sseclient-py  # SSE モード用 (推奨)

DCA とリミット オーダー (ストラテジー)

スクリプト: strategies.py

swap.coffee ストラテジー API を使用して自動トレーディング ストラテジーを作成します。

アーキテクチャ

  • 各ユーザーはストラテジー ウォレット (オンチェーン スマートコントラクト) を取得
  • ユーザーはこのコントラクトに資金 + メッセージを送信してオーダーを作成/キャンセル
  • バックエンドがオフチェーンでオーダーを実行し、ウォレットでトランザクションを開始

⚠️ 重要: ストラテジー ウォレットが必須

DCA/リミット オーダーを作成する前に、ストラテジー ウォレット コントラクト (1 回のみ) をデプロイする必要があります。

フロー:

  1. check — ストラテジー ウォレットが存在するか確認
  2. eligible

ライセンス: MIT(寛容ライセンスのため全文を引用しています) · 原本リポジトリ

詳細情報

作者
swapcoffee
リポジトリ
swapcoffee/openclaw-ton-skill
ライセンス
MIT
最終更新
2026/2/14

Source: https://github.com/swapcoffee/openclaw-ton-skill / ライセンス: MIT

本サイトは GitHub 上で公開されているオープンソースの SKILL.md ファイルをクロール・インデックス化したものです。 各スキルの著作権は原作者に帰属します。掲載に問題がある場合は info@alsel.co.jp または /takedown フォームよりご連絡ください。
原作者: swapcoffee · swapcoffee/openclaw-ton-skill · ライセンス: MIT