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

@apip-io/wallet

v1.0.3

Published

apip.io Wallet SDK - BTC ETH USDT/USDC Payment Gateway with Contract Event Monitoring

Readme

@apip-io/wallet

apip.io Payment Gateway - BTC ETH USDT/USDC Payment Gateway SDK for Node.js

apip.io 官网

安装

npm install @apip-io/wallet

使用方法

初始化

import { Apip } from '@apip-io/wallet';

// 从环境变量或配置中获取
const apip = new Apip({
  uri: process.env.APIP_URL || 'https://apip.io/api/',
  app_id: process.env.APIP_APP_ID,
  app_key: process.env.APIP_APP_KEY
});

环境变量配置

.env 文件中添加:

APIP_URL=https://apip.io/api/
APIP_APP_ID=your_app_id_here
APIP_APP_KEY=your_app_key_here

API 方法

创建钱包

// 创建所有协议的钱包
await apip.create('test_label');

// 创建指定协议
await apip.create('test_label', 'erc20');

// 支持多个协议多个币种
await apip.create('test_label', 'bsc20,erc20');
await apip.create('test_label', 'bnb,bsc20');

查询余额

await apip.balance('test_label');

导入钱包

await apip.import('bsc20', 'test_label', '0xwalletaddress', 'private_key');

提现

// 使用热钱包提现
await apip.withdraw('1.00', '0x0000towallet', 'bsc20_usdt');

// 指定发送钱包来提现
await apip.withdraw('1.00', '0x0000towallet', 'bsc20_usdt', '0x000from_wallet');

获取汇总数据

// 获取单个数据
await apip.data('bsc20_usdt');

// 支持多个协议多个币种
await apip.data('bnb,bsc20_usdt');

汇总钱包

// 汇总指定币种
await apip.collect('bsc20_usdt');

// 支持多个协议多个币种
await apip.collect('bnb,bsc20_usdt');

// 使用默认参数 (bsc20_usdt,trc20_usdt)
await apip.collect();

验证回调签名

在处理支付回调时,验证签名和请求参数:

// 在回调处理函数中
try {
  apip.validate(request.body);
  // 签名验证通过,继续处理
} catch (error) {
  // 签名验证失败
  console.error('Invalid callback:', error.message);
}

工具方法

格式化以太坊数量 (uint256 -> 普通数值)

apip.formatUints('1000000000000000000', 18); // '1'
apip.formatUints('1000000', 6);              // '1'

转换为 uint256 格式 (普通数值 -> uint256)

apip.toUints('1', 18);   // '1000000000000000000'
apip.toUints('1.5', 6);  // '1500000'

许可证

MIT