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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mobit-wallet

v0.6.1

Published

Mobit Wallet 是一个轻量级的 TypeScript 库,用于在各种加密货币钱包中进行比特币交易操作。

Downloads

188

Readme

Mobit Wallet

Mobit Wallet 是一个轻量级的 TypeScript 库,用于在各种加密货币钱包中进行比特币交易操作。

特性

  • 支持多种流行的加密货币钱包
  • 提供签署 PSBT 和发送比特币的功能
  • 简单易用的 API
  • 完全用 TypeScript 编写,提供类型安全
  • 专为浏览器环境设计

支持的钱包

  • JoyID
  • UniSat
  • OKX Wallet

安装

使用 npm 安装:

npm install mobit-wallet

使用方法

import { JoyIDWallet, UniSatWallet, OKXWallet } from 'mobit-wallet';
import { DataSource } from '@rgbpp-sdk/btc';

// 创建钱包实例
const joyidWallet = new JoyIDWallet(DataSource.Mempool); // 为 JoyID 指定数据源
const unisatWallet = new UniSatWallet();
const okxWallet = new OKXWallet();

// 签署 PSBT
async function signTransaction(wallet, psbtHex) {
  try {
    const signedPsbtHex = await wallet.signPsbt(psbtHex);
    console.log("Signed PSBT:", signedPsbtHex);
  } catch (error) {
    console.error("Error signing PSBT:", error);
  }
}

// 发送比特币
async function sendBitcoin(wallet, address, amount, feeRate) {
  try {
    const txid = await wallet.sendBitcoin({ address, amount, feeRate });
    console.log("Transaction ID:", txid);
  } catch (error) {
    console.error("Error sending Bitcoin:", error);
  }
}

// 使用示例
signTransaction(joyidWallet, "your_psbt_hex_here");
sendBitcoin(unisatWallet, "recipient_address", 0.001, 1);

注意事项

  • 确保在使用前已安装相应的钱包浏览器扩展。
  • JoyID 钱包需要指定一个 DataSource
  • 在生产环境中使用前,请务必进行充分的测试。
  • 不同钱包可能有不同的特性和限制,请参考各自的文档。