Skip to content

EpicChain Wallet Connect is a secure and seamless bridge for connecting decentralized applications (dApps) to wallets on the EpicChain blockchain.

Notifications You must be signed in to change notification settings

epicchainlabs/epicchain-wallet-connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

EpicChain WalletConnect SDK

Welcome to the EpicChain WalletConnect SDK! This toolkit is your gateway to integrating the EpicChain blockchain with various wallet providers seamlessly. With WalletConnect, users can securely interact with your decentralized applications (dApps) using their mobile wallets, providing a simple, user-friendly experience while interacting with the EpicChain ecosystem.


๐Ÿ” Introduction

The WalletConnect SDK is a powerful tool designed to allow seamless communication between decentralized apps (dApps) and mobile wallets in the EpicChain ecosystem. Whether you are building DeFi protocols, games, or NFT platforms, this SDK will enable users to sign transactions and messages securely from their preferred wallet, directly from their mobile device.

WalletConnect is an open-source protocol that connects wallets and dApps through a secure, peer-to-peer connection. By using the SDK, EpicChain developers can ensure that their users have a smooth, safe, and intuitive experience when interacting with their blockchain-based applications.


๐Ÿš€ Getting Started

To get started with the WalletConnect SDK for EpicChain, follow these steps:

  1. Create an EpicChain Wallet: Ensure you have an EpicChain wallet, as this will be needed for user interactions.
  2. Install Dependencies: Before using this SDK, ensure your project has all the necessary dependencies installed.
  3. Integrate WalletConnect: Use the provided classes and methods to integrate WalletConnect into your dApp or platform.

๐Ÿ›  Installation

To install the SDK into your project, follow the steps below:

1. Install via npm/yarn

You can install the SDK through npm or yarn:

npm install @epicchain/walletconnect-sdk

or

yarn add @epicchain/walletconnect-sdk

2. Include the SDK in Your Project

Once installed, import the SDK into your codebase:

import WalletConnect from '@epicchain/walletconnect-sdk';

โš™๏ธ Setup and Configuration

After installation, youโ€™ll need to configure the SDK to connect to the EpicChain network. This involves setting up the walletConnect object with the necessary parameters.

const walletConnect = new WalletConnect({
  bridge: "https://bridge.walletconnect.org",  // WalletConnect Bridge URL
  chainId: 1,  // EpicChain Network ID
  rpc: {
    1: "https://rpc.epic-chain.org",  // RPC URL for EpicChain
  },
});

if (!walletConnect.connected) {
  await walletConnect.connect();
}

In this example, we set the bridge URL and RPC provider for EpicChain. Be sure to update the rpc field to the EpicChain RPC URL, which ensures the SDK communicates with the EpicChain blockchain.


๐Ÿ“œ API Reference

Below are the key functions and properties available in the WalletConnect SDK for EpicChain:

1. WalletConnect()

Constructor to instantiate a new WalletConnect object.

const walletConnect = new WalletConnect({
  bridge: "https://bridge.walletconnect.org",
  chainId: 1,
  rpc: {
    1: "https://rpc.epic-chain.org",
  },
});

2. .connect()

Initiates a connection between the dApp and the wallet.

await walletConnect.connect();

3. .disconnect()

Disconnects the userโ€™s wallet from the dApp.

walletConnect.disconnect();

4. .sendTransaction()

Used to send a transaction through the connected wallet.

const tx = {
  to: "0xAddress",
  data: "0xData",
  gas: 21000,
  gasPrice: "20000000000",
  value: "1000000000000000000",
};
await walletConnect.sendTransaction(tx);

5. .signMessage()

Signs a custom message with the userโ€™s wallet.

const message = "Sign this message for authentication";
await walletConnect.signMessage(message);

โšก Security Considerations

1. Always Use HTTPS

Make sure to always use HTTPS endpoints to avoid man-in-the-middle attacks when connecting to wallets or APIs.

2. Never Share Private Keys

Never store or share private keys in your application. Always rely on the connected wallet for signing transactions and messages.

3. Secure WalletConnect Sessions

Ensure that WalletConnect sessions are properly secured with an appropriate session timeout and that users are notified when their session ends or becomes invalid.


๐Ÿ’ก Use Cases

The WalletConnect SDK for EpicChain is designed for a variety of use cases within the EpicChain ecosystem:

  • DeFi: Integrate decentralized finance (DeFi) applications for users to interact with liquidity pools, staking, and yield farming.
  • NFTs: Allow users to sign transactions when buying, selling, or minting non-fungible tokens (NFTs) on EpicChain.
  • Games: Enable in-game wallet interactions such as signing in-game purchases, earning rewards, and connecting to decentralized gaming networks.
  • dApps: Build decentralized applications that interact with the EpicChain blockchain and allow users to send transactions directly from their mobile wallets.

๐Ÿ’ก Example Usage

Hereโ€™s a simple example to show how you can integrate WalletConnect into your dApp:

import WalletConnect from '@epicchain/walletconnect-sdk';

// Create a WalletConnect instance
const walletConnect = new WalletConnect({
  bridge: "https://bridge.walletconnect.org",
  chainId: 1,
  rpc: {
    1: "https://rpc.epic-chain.org",
  },
});

// Connect to wallet
if (!walletConnect.connected) {
  await walletConnect.connect();
}

// Sign a transaction
const tx = {
  to: "0xReceiverAddress",
  data: "0xData",
  value: "1000000000000000000",
};
await walletConnect.sendTransaction(tx);

This code snippet allows users to connect their EpicChain wallet and send a transaction directly to the blockchain, all through WalletConnect.


๐Ÿค Contributing

We welcome contributions from the community! Whether youโ€™re fixing bugs, adding features, or improving documentation, your help is always appreciated.

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Submit a pull request.

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ’ฌ Stay Connected

For any issues or suggestions, feel free to open an issue or reach out to us on social media.


๐Ÿ‘จโ€๐Ÿ’ป EpicChain Labs Team
Connecting the World with Blockchain

Releases

No releases published

Packages

No packages published