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

@pooldao/js

v0.2.0

Published

# 基本用法

Readme

Pooldao

基本用法

const { Pooldao } = require('@pooldao/js');

async function run() {
  const pooldao = new Pooldao({
    host: 'http://47.106.144.61:8545',
    proxyAddress: '0x1e92877766c94c9913A4EcC90B45E18968dc662D'
  });

  await pooldao.init(); // 等待初始化完成

  // NodeManager
  pooldao.contracts.NodeManager.contract; // 合约实例
  pooldao.contracts.NodeManager.abi; // abi json
  pooldao.contracts.NodeManager.address; // 合约地址
  pooldao.contracts.NodeManager.name; // abi Name

  // OperatorManager
  pooldao.contracts.OperatorManager.contract; // 合约实例
  pooldao.contracts.OperatorManager.abi; // abi json
  pooldao.contracts.OperatorManager.address; // 合约地址
  pooldao.contracts.OperatorManager.name; // abi Name

  // Oracle
  pooldao.contracts.Oracle.contract; // 合约实例
  pooldao.contracts.Oracle.abi; // abi json
  pooldao.contracts.Oracle.address; // 合约地址
  pooldao.contracts.Oracle.name; // abi Name

  // PoolETHToken
  pooldao.contracts.PoolETHToken.contract; // 合约实例
  pooldao.contracts.PoolETHToken.abi; // abi json
  pooldao.contracts.PoolETHToken.address; // 合约地址
  pooldao.contracts.PoolETHToken.name; // abi Name

  await pooldao.getNodeContract('15'); // 获取对应 node id 的合约
}

run();

Operator

createOperator(name: string)

注册运营商

const { Pooldao } = require('@pooldao/js');

async function run() {
  const pooldao = new Pooldao({
    host: 'http://47.106.144.61:8545',
    proxyAddress: '0x1e92877766c94c9913A4EcC90B45E18968dc662D'
  });

  await pooldao.init();

  await pooldao.operator.createOperator('aaa').send({
    from: '....',
    gas: '100000'
  });
}

run();

createNode(info: string, duration: number, feePercentage: number, partner: string)

注册节点

duration 周期单位月 [1, 6];feePercentage 0 - 100;

initNode(id: string, validatorPubkey: string, validatorSignature: string, withdrawalCredentials: string, depositData: string)

抵押及初始化节点

revoked(contract: Contract)

撤销节点

const { Pooldao } = require('@pooldao/js');

async function run() {
  const pooldao = new Pooldao({
    host: 'http://47.106.144.61:8545',
    proxyAddress: '0x1e92877766c94c9913A4EcC90B45E18968dc662D'
  });

  await pooldao.init();

  const nodeContract = await pooldao.getNodeContract('15');

  await pooldao.operator.revoked().send({
    from: '....',
    gas: 1000000000
  });
}

run();

startStaking(contract: Contract)

节点开启挖矿

user

deposit(contract: Contract)

参与节点挖矿

const { Pooldao } = require('@pooldao/js');

async function run() {
  const pooldao = new Pooldao({
    host: 'http://47.106.144.61:8545',
    proxyAddress: '0x1e92877766c94c9913A4EcC90B45E18968dc662D'
  });

  await pooldao.init();

  const nodeContract = await pooldao.getNodeContract('15');

  await pooldao.user.deposit(nodeContract).send({
    from: '....',
    value: 1000000,
    gas: 1000000000
  });
}

run();

refund(contract: Contract)

退出节点

swap(value: string)

兑换 poolETH

oracle

reputationChange(operator: string, change: string)

变更运营商声誉值

validatorExit(validatorPubkey: string)

标记验证人退出

validatorSettlement(validatorPubkey: string, finalBalance: string)

结算发币