@epicchain/epicvault-dappkit-types v1.0.2
EpicVault-DappKit
EpicVault-DappKit is an all-in-one, developer-friendly toolkit designed to simplify the process of building decentralized applications (dApps) on the EpicChain blockchain. Whether you're connecting Web Applications, managing Off-chain JS Servers, or creating React-Native Apps, EpicVault-DappKit seamlessly bridges your app to the powerful EpicChain ecosystem.
Why Choose EpicVault-DappKit?
- Comprehensive & Flexible: Integrates seamlessly with existing projects using the WalletConnectSDK.
- User-Centric: Simplified tools for dApp development without compromising functionality.
- Scalable & Robust: Designed to support small projects and large-scale blockchain solutions alike.
π Pro Tip: EpicVault-DappKit leverages types compatible with WalletConnectSDK, enabling you to alternate between implementations while reusing existing code. Check out the comprehensive WalletConnect Guide for more insights.
π Installation
To get started with EpicVault-DappKit, install the core package using npm:
npm i @epicchain/epicvault-dappkit-types
To ensure compatibility with Vite, update your vite.config.ts
file with the following snippet:
import { defineConfig } from 'vite';
export default defineConfig({
// Custom configuration
define: {
global: 'globalThis',
process: {
version: 'globalThis',
},
},
});
π Components Overview
EpicVault-DappKit comes packed with powerful modules tailored to streamline dApp development:
EpicVaultInvoker
A smart contract invocation tool for efficient blockchain interactions.EpicVaultParser
A versatile parser for managing EpicChain-specific data types.EpicVaultSigner
Handles cryptographic signing, verification, encryption, and decryption.EpicVaultEventListener
A robust event listener to capture real-time blockchain updates.
π Explore sample implementations in the examples folder.
π Quick Start Guide
Hereβs a simple example to illustrate how to interact with EpicChain using EpicVault-DappKit:
import { EpicVaultInvoker, EpicVaultParser, TypeChecker } from '@epicchain/epicvault-dappkit';
import { ContractInvocationMulti } from '@epicchain/epicvault-dappkit-types';
// Initialize the EpicVaultInvoker
const invoker = await EpicVaultInvoker.init({
rpcAddress: EpicVaultInvoker.TESTNET,
});
// Define the contract invocation
const invocation: ContractInvocationMulti = {
invocations: [
{
scriptHash: '0x309b6b2e0538fe4095ecc48e81bb4735388432b5',
operation: 'getMetaData',
args: [
{
type: 'Hash160',
value: '0x6dc3bff7b2e6061f3cad5744edf307c14823328e',
},
],
},
],
};
// Test the invocation
const testInvokeResult = await invoker.testInvoke(invocation);
// Log results
console.log(`Invocation state returned: ${testInvokeResult.state}`);
console.log(`Estimated EpicPulse consumed: ${testInvokeResult.epicpulseconsumed} EpicPulse`);
console.log(`Returned a map? ${TypeChecker.isStackTypeMap(testInvokeResult.stack[0])}`);
console.log(`Parsed data: ${JSON.stringify(EpicVaultParser.parseRpcResponse(testInvokeResult.stack[0]), null, 2)}`);
π Key Features at a Glance
- Zero Gas Fee Testing: Use
testInvoke
to simulate smart contract calls without consuming EpicPulse. - Real-Time Parsing: Effortlessly convert blockchain data into developer-friendly formats.
- Modular Architecture: Adapt components to fit specific project needs.
- Cross-Platform Compatibility: Supports a wide range of environments including Web, Node.js, and React-Native.
Join the Revolution π
Take your dApp development to the next level with EpicVault-DappKit. Visit our official repository to get started. Let's shape the future of blockchain technology together!