npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

peertube-plugin-xmr-superchat

v0.1.0

Published

XMR/LTC superchat plugin for PeerTube

Downloads

88

Readme

PeerTube XMR Superchat Plugin

XMR (Monero) スーパーチャット機能をPeerTubeに追加するプラグイン(まだ試作段階)

機能

  • ✅ XMRでの投げ銭
  • ✅ リアルタイム着金通知
  • ✅ YouTube風のオーバーレイ表示
  • ✅ QRコード生成
  • ✅ WebSocket経由のリアルタイム通知
  • ✅ 金額に応じた演出の変化

必要要件

  • PeerTube >= 5.0.0
  • monero-wallet-rpc (リモートまたはローカル)
  • Node.js >= 18

セットアップ

1. monero-wallet-rpcの起動

リモートノードを使う場合(推奨 - 簡単)

monero-wallet-rpc \
  --daemon-address your-remote-node.onion:18081 \
  --wallet-file /path/to/your/wallet \
  --password "your-password" \
  --rpc-bind-port 18082 \
  --rpc-bind-ip 127.0.0.1 \
  --disable-rpc-login \
  --trusted-daemon

Tor経由でOnionノードに接続する場合:

monero-wallet-rpc \
  --daemon-address your-remote-node.onion:18081 \
  --proxy 127.0.0.1:9050 \
  --wallet-file /path/to/your/wallet \
  --password "your-password" \
  --rpc-bind-port 18082 \
  --rpc-bind-ip 127.0.0.1 \
  --disable-rpc-login \
  --trusted-daemon

2. (ローカルの場合での)プラグインのビルド

npm install
npm run build

3. (ローカルの場合での)プラグインのインストール

# PeerTubeのCLIを使用
cd /var/www/peertube
sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config \
  NODE_ENV=production \
  npm run plugin:install -- --path /path/to/peertube-plugin-xmr-superchat

4. プラグインの設定

PeerTube管理画面 → プラグイン → XMR Superchat で以下を設定:

  • Monero Wallet RPC URL: http://localhost (または http://127.0.0.1)
  • Monero Wallet RPC Port: 18082
  • RPC Username: (オプション - 設定していない場合は空)
  • RPC Password: (オプション - 設定していない場合は空)
  • Minimum Confirmations: 1 (推奨)

5. 動作確認

  1. 任意の動画を再生
  2. プレイヤーコントロールに💰ボタンが表示される
  3. ボタンをクリックしてモーダルを開く
  4. 金額とメッセージを入力
  5. QRコードが生成される
  6. XMRウォレットから支払い
  7. 確認後、動画上にオーバーレイが表示される

開発

ディレクトリ構造

peertube-plugin-xmr-superchat/
├── client/                  # クライアント側コード
│   ├── common-client-plugin.ts
│   └── video-watch-client-plugin.ts
├── server/                  # サーバー側コード
│   ├── main.ts
│   └── lib/
│       ├── xmr-wallet.ts
│       └── payment-monitor.ts
├── assets/styles/          # スタイル
│   └── superchat.scss
└── scripts/                # ビルドスクリプト
    └── build-client.mjs

ビルドコマンド

npm run build              # 全体ビルド
npm run build:client       # クライアントのみ
npm run build:server       # サーバーのみ
npm run build:css          # CSSのみ
npm run clean              # distフォルダを削除

API エンドポイント

POST /plugins/xmr-superchat/router/create-payment

支払い用のアドレスを生成

リクエスト:

{
  "videoId": "video-uuid",
  "amount": "0.1",
  "message": "Great video!"
}

レスポンス:

{
  "address": "4...",
  "paymentId": "abc123...",
  "qrCode": "data:image/png;base64,...",
  "amount": "0.1"
}

GET /plugins/xmr-superchat/router/health

ウォレットRPCのヘルスチェック

レスポンス:

{
  "healthy": true
}

WebSocket Events

クライアント → サーバー

  • join-video: 動画ルームに参加 { videoId: string }
  • leave-video: 動画ルームから退出 { videoId: string }

サーバー → クライアント

  • superchat: 新しいスパチャ通知
{
  "amount": 0.1,
  "message": "Great video!",
  "txid": "abc123...",
  "confirmations": 1
}

トラブルシューティング

ウォレットRPCに接続できない

  1. monero-wallet-rpcが起動しているか確認
  2. ファイアウォール設定を確認
  3. /plugins/xmr-superchat/router/health でヘルスチェック

オーバーレイが表示されない

  1. ブラウザのコンソールでエラーを確認
  2. WebSocket接続が確立されているか確認
  3. 支払いが1確認以上受けているか確認

QRコードが表示されない

  1. サーバーログでエラーを確認
  2. qrcode パッケージが正しくインストールされているか確認

ライセンス

AGPL-3.0

TODO

  • [ ] LTC対応
  • [ ] BTC対応
  • [ ] サウンド通知
  • [ ] 管理画面での統計表示
  • [ ] 複数通貨対応
  • [ ] OBS専用オーバーレイページ

peertube-plugin-xmr-superchat