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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sero-pp

v1.0.8

Published

Use for develop DApp on sero popup and sero pullup.

Downloads

7

Readme

sero-pp

SERO js-sdk for popup and pullup DApp market .

Whate is sero-pp?

sero-pp provided to developers who need to develop DApps in the popup and pullup DApp market. It provides interface for querying accounts and executing smart contract methods.

How to use sero-pp

Installation

 npm install sero-pp

Usage

import seropp from 'sero-pp'

APIs

  • seropp.init
  • seropp.getAccountList
  • seropp.getAccountDetail
  • seropp.call
  • seropp.executeContract
  • seropp.estimateGas
  • seropp.getInfo

seropp.init

It must be inited before invoke other interface.

const dapp = {
          name: "Hello DApp",
          contractAddress: contractAddress,
          github: "https://github.com/sero-cash/sero-pp/example",
          author: "tom",
          url: "http://127.0.0.1:3000",
          logo: "http://127.0.0.1:3000/logo192.png",
      }

      seropp.init(dapp,function (rest) {
          console.log("init result >>> " , rest);
      })

Account structure

  • Name wallet name
  • PK is the address of the account, can be used as a tag for the account, not as a transfer from address.
  • MainPKr can be used as a common address, call and execute smart contract.
  • Balance is a map. key = currency ,value = Minimum unit amount.

Transaction structure

  • from Use PK
  • to Use Contract Address
  • data It is the data that return from serojs packMethod
  • value It is amount of transfer to the contract. It need contract support payable method.
  • cy It is short word of currency ,default SERO
  • gas It is pay to miner
  • gasPrice Price of gas
  • catg Catagory of ticket
  • value Value of ticket

Usage

  • seropp.getAccountList

Return all wallet account

seropp.getAccountList(function(accounts){
    console.log(accounts);
});

Result:

[{
        "Name":"Tom",
        "PK": "kvaztfuz3ZS6sNcksQYZpdGC1rUwcuv1aPkuzkLdgeNSvq5FQiURuBsqghLCY3MkxZLNm7WQ9yV2ib2UWoRpJys",
        "MainPKr": "fHBQfR5t9j3D4CsKQG78sQ3Qzdz9SS6m3XsgvgkNcpKjD1TMBEVmcJ4vhDUpkZrvPtE47DnzxRjz4Gk7xMaGZfxstnMeBjZF1dWeQaC3dxLrPPa4wQoGdXeJuihdTKwxf5K",
	"Balance": {
		"SERO": 88999438296000000000
	}
}]
  • seropp.getAccountDetail

Return the PK wallet account

  seropp.getAccountDetail(PK,function(account){
      console.log(account);
  });

Result:

  {
          "Name":"Tom",
          "PK": "kvaztfuz3ZS6sNcksQYZpdGC1rUwcuv1aPkuzkLdgeNSvq5FQiURuBsqghLCY3MkxZLNm7WQ9yV2ib2UWoRpJys",
          "MainPKr": "fHBQfR5t9j3D4CsKQG78sQ3Qzdz9SS6m3XsgvgkNcpKjD1TMBEVmcJ4vhDUpkZrvPtE47DnzxRjz4Gk7xMaGZfxstnMeBjZF1dWeQaC3dxLrPPa4wQoGdXeJuihdTKwxf5K",
  	"Balance": {
  		"SERO": 88999438296000000000
  	}
  }
  • seropp.executeContract

Send a transaction to update smart contract state. It is asynchronous on the block chain. and return transaction hash.

seropp.executeContract(tx,function(txHash){
    console.log(txHash);
});
  • seropp.call

It use to get data from gero node . and it will be convert to basic data structure.

seropp.call(data,function(rest){
    console.log(rest);
});
  • seropp.estimateGas

It use to estimate gas begin send transaction .

seropp.estimateGas(data,function(gas){
    console.log(gas);
});

Embed Popup wallet using iframe in DApp

let walletUrl = 'http://popup-github.sero.cash/?language=en_US';
<iframe className="popupiframe" src={walletUrl}  frameBorder="no" />