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

@wepin/provider

v0.0.6-alpha

Published

Wepin Provider Widget SDK for Web

Downloads

17

Readme

@wepin/provider

Wepin Provider Widget SDK for Web.

This package is only available in the web environment. It cannot be used in Android and iOS apps(Webview).

Wipin supports providers that return JSON-RPC request responses to connect with blockchain networks in webs. With Wipin Provider, you can easily connect to various networks supported by Wipin.

The providers supported by Wipin are as follows.

  • EVM compatible Networks
  • Klaytn Network (Comming soon)

EVM compatible Networks

Ethers.js or Web3.js can be used with Wepin Provider to interoperate with EVM compatible blockchains.

Support Networks

| Chain ID | Network Name | Network Variable | | -------- | ----------------------- | ------------------ | | 1 | Ethereum Mainnet | ethereum | | 5 | Ethereum Goerli Testnet | evmeth-goerli | | 19 | Songbird Canary Network | evmsongbird | | 137 | Polygon Mainnet | evmpolygon | | 1001 | Klaytn Testnet | klaytn-testnet | | 8217 | Klaytn Mainnet | klaytn | | 80001 | Polygon Mumbai | evmpolygon-testnet |

Install

First, import @wepin/widget-sdk and @wepin/provider into the project. You must import @wepin/widget-sdk widget-sdk first.

import '@wepin/widget-sdk'
import '@wepin/provider'

Method

  • Get Accounts You can receive account information through the initialized web3.
const accounts = await web3.eth.getAccounts()
  • Get Balance You can get account's balance using your account information.
const balance = await web3.eth.getBalance(accounts[0])

You can refer to the link below to check balance as well as fee information, block number, etc.

Document: web3.js 1.0.0 documentation

  • Send Transaction Transaction can be sent.
const accounts = await web3.eth.getAccounts()
const tx = {
    from: accounts[0],
    gasPrice: "2000000000",
    gas: "21000",
    to: '0x11f4d0A3c1......13F7E19D048276DAe',
    value: "10000000000000000",
}
const response = await web3.eth.sendTransaction(tx)
  • Contract Call A contract call can be performed.
const callObject = {
	to: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', //contract address
	data: '0xc6888fa10000000000000000000000000000000000000000000000000000000000000003'
}
const response = await web3.eth.call(callObject)

For details of Ethereum compatible network providers, please refer to the link below.

EIP-1193: Ethereum Provider Javascript API