Wrapper Packages

Wrapper Packages

The KrypCore Web3 SDK includes several wrapper packages that simplify web3 DApp development. These packages provide convenient abstractions and utilities for interacting with specific functionalities and services. The following wrapper packages are currently available:

1. ipfs-http-client

The ipfs-http-client package is a wrapper for the IPFS (InterPlanetary File System) HTTP API. It provides an easy-to-use interface for uploading and retrieving files from the IPFS network.

Usage

// Import the SDK
const krypcore_web3_sdk = require("krypcore-web3-sdk")

// Provide path to config file
const configFilePath = '../../config.json'

// Initialize the SDK
const Web3Engine = new krypcore_web3_sdk.Web3Engine(configFilePath)

// Create an IPFS client
const ipfshttpclient = Web3Engine.wrappers.ipfsHttpClient(new URL(${YOUR_IPFS_CLIENT_URL})

2. ethers

The ethers package is a widely-used JavaScript library for interacting with Ethereum and other EVM-compatible blockchains. It provides a simple and intuitive API for contract interaction, wallet management, and more.

Usage

// Import the SDK
const krypcore_web3_sdk = require("krypcore-web3-sdk")

// Provide path to config file
const configFilePath = '../../config.json'

// Initialize the SDK
const Web3Engine = new krypcore_web3_sdk.Web3Engine(configFilePath)

// Access the ethers package
const ipfshttpclient = Web3Engine.wrappers.ethers

3. web3modal

The web3modal package is a wrapper that simplifies the integration of web3 provider selection and connection handling. It offers a standardized interface for users to select their preferred wallet and seamlessly connect to your DApp.

// Import the SDK
const krypcore_web3_sdk = require("krypcore-web3-sdk")

// Provide path to config file
const configFilePath = '../../config.json'

// Initialize the SDK
const Web3Engine = new krypcore_web3_sdk.Web3Engine(configFilePath)

// Access the web3Modal package
const ipfshttpclient = Web3Engine.wrappers.web3Modal

Last updated