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

okweb3

v1.0.1

Published

Fastest library for bep20 and ethers interfaces

Downloads

16

Readme

OKWEB3 CORE LIB

Function list

  1. Make a custom token transfer to any bep20 address
  2. Access to major functions
  3. Subscribe to incoming blocks
  4. Transaction confirmation
  5. Block check and status resolver

Prerequisite

Must have installed npm i web3

LIBRARY USAGE

Declare a config object based on your wallet

let config = { credential: {fromAddress: '', fromPkey: '', contractAddress: ''}, abiArray: [], log: 'print', };

  1. credential contain your details from the parent wallet or target wallet

  2. abiArray already present, you can choose to ignore else supply abiArray

  3. log if it is print all error log will be dumped with console.log automatically, if null no log will be printed

    you can also provide a custom function with two arguments: (status, message) if any successful event occur, status will be true else false you can do whatever you want with message

    if you want to override predefined values, follow the above

SEE QUICK USAGE

let {Transactions, CONFIG, PROVIDERS} = require('okweb3');

CONFIG.provider = PROVIDERS.binance;

CONFIG.credential.contractAddress = "xxxxxxxxxxx_contrac_address";

CONFIG.credential.fromPkey = "xxxxxxxxxxx_primary_key";

CONFIG.credential.fromAddress = "xxxxxxxxxxx_master_account";

regroup config and apply to okweb3 class as seen below

let con = CONFIG;

con.log = function (s, m) { console.log("i want my log here", m); };

let lb = new Transactions(con);

lb.sendTokenBEB20("0x000112343xxxxxxx", 20).then(res=>{ //get whole result here... });

Decimal passed to amt will be converted in ethers 1e9, so no conversion needed, example: 1BNB is 1, 1 unit of your token is 1

Web3 Initialized Object

lb.okweb3() will return an instance of web3 (initialized)

lb.getAccurateGasLimit(address, amount) will return only the required gas fee for the transaction and can be consume on an external web3 agent

PROVIDERS contains default providers and can be customized but default is binance

Transaction this is your mother class as okweb3

abiArray can be collected via lb.abiArray or __ABI_ARRAY as import from library