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

@krypc/web3-sdk

v1.0.3

Published

This SDK provides easy tools & power methods to make building in web3 much easier.

Downloads

7

Readme

Table of Contents

  1. Introduction
  2. Features
  3. Supported Chains
  4. Prerequisites
  5. Usage
  6. Suites
  7. Support
  8. Contributing
  9. License

Introduction

This package aims to simplify a developer's experience in building web3 products by providing them with a simple and easy to use suite of tools and methods to accelerate development.

Features

  • Quick and easy setup
  • Ready to use Infrastructure
  • Multiple Protocols Support
  • Different suites for development

Supported Chains

Currently, the SDK supports the following chains. We are working to add more chains. | Chain Name | Chain ID | | :-------- | :------- | | Polygon Mainnet | 137 | | Polygon Mumbai Testnet | 80001 | | Ethereum Mainnet | 1 | | Ethereum Goerli Testnet | 5 |

Prerequisites

The usage of the SDK requires an API key which can be obtained through the KrypC portal after reegistration.

Usage

Install the package from npm registry using the following command:

npm i @krypc/web3-sdk

Once installed, you can use it by following the steps below:

// Import the krypc web3 SDK
const sdk = require("@krypc/web3-sdk")

// Initialize the web3 Engine with your API key
const Web3Engine = new sdk.Web3Engine(<API_KEY>)

Once the Web3Engine is initialized with the API key, you can use all the features of the SDK.

Suites

The SDK offers various methods based on the various suites supported by the SDK. Suites are meant to simplify usage and provide you methods based on particular categories.

Current SDK suites have been listed below.

  • Wallet Suite
  • Storage Suite
  • NFT Suite
  • Utils Suite
  • Marketplace Suite

All of the methods available will be described in the below sections.

Wallet Suite

| Method Usage | Input Parameters | Returns | Description | | :-------- | :------- | :------- | :------------------------- | | Web3Engine.Wallet.getBalance | Address, ChainID | Native token balance in Wei | Get native token balance across supported chains | | Web3Engine.Wallet.transfer | receiver_address, signer, transfer_amount (in wei)| Tx Hash | Transfer native token to any address across our supported chains | | Web3Engine.Wallet.getERC20Balance | User Address, Contract Address, Chain ID | Balance of ERC-20 tokens | Get any ERC-20 token balance across our supported chains | | Web3Engine.Wallet.transferERC20 | receiver_address, signer, Contract Address, transfer_amount (in wei) | Tx Hash | Transfer ERC-20 tokens across our supported chains | | Web3Engine.Wallet.signMessage | message, signer | ECDSA signature | Generate ECDSA signature of a message from wallet | | Web3Engine.Wallet.verifySignatureonChain | message, ECDSA signature, signer Address | boolean | Verify signature on-chain through a deployed smart contract (gasless) | | Web3Engine.Wallet.verifySignatureOffChain | message, ECDSA signature, signer Address | boolean | Verify signature off-chain | | Web3Engine.Wallet.getCurrentChainId | Ethers provider | ChainID | Get chain ID of currently connected network | | Web3Engine.Wallet.getCurrentChainName | Ethers provider | Chain Name | Get chain name of currently connected network | | Web3Engine.Wallet.switchNetwork | provider, chainID | status | Switch network |

Storage Suite

| Method Usage | Input Parameters | Returns | Description | | :-------- | :------- | :------- | :------------------------- | | Web3Engine.Storage.uploadtoIPFS | File| CID Hash | Upload any file to IPFS and get the CID associated with it. | | Web3Engine.Storage.getFileFromIPFS | CID Hash| file content | Retrieve a file from IPFS using the CID | | Web3Engine.Storage.getGatewayLink | CID Hash | Gateway URL | Get the IPFS URL of the file using CID |

Utils Suite

| Method Usage | Input Parameters | Returns | Description | | :-------- | :------- | :------- | :------------------------- | | Web3Engine.Utils.connectWallet | Wallet Array (possible options: coinbase, walletconnect) | provider, signer | Provide multiple wallet connection options by passing input as array of required wallets. Metamask is supported by default. | | Web3Engine.Utils.resolveAddresstoENS | Address | ENS Name | Returns ENS Domain associated with address | | Web3Engine.Utils.resolveENStoAddress | ENS Name | Address | Returns address associated with an ENS Domain | | Web3Engine.Utils.deployContract | signer, abi, bytecode, constructor args | contract address | Returns address of deployed contract | | Web3Engine.Utils.callContractMethod | signer, contractAddress, abi, methodName, args | contract address | Allows you to make a transaction with any deployed contract | | Web3Engine.Utils.callContractViewMethod | provider, contractAddress, abi, methodName, args | contract address | Allows you to call any view functions in the contract (no gas) |

NFT Suite

| Method Usage | Input Parameters | Returns | Description | | :-------- | :------- | :------- | :------------------------- | | Web3Engine.Nft.createNftCollection | signer, collectionName, symbol | contract address | Create an NFT collection across our supported chains | | Web3Engine.Nft.mintNfttoCollection | signer, contractAddress, nftName, nftDescription, nftContent | Tx Hash | Mint a NFT to your collection across our supported chains |

Support

For support, email or join our Discord channel.

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

License

MIT