miniappkit-sdk
v1.1.6
Published
A miniappkit implementation
Readme
Miniappkit-sdk
Aggregating all wallets in your browser to ease user experience
🚀 Overview
Miniappkit-sdk is a lightweight modal-style SDK that enables dapp users to see all the wallets on their browser and select one. It returns an EIP1193 provider consumable by ethers, etc.
📦 Installation Steps
# Clone the repository
git clone https://github.com/Atanda1/miniappkit-sdk.git
# Navigate into the project directory
cd miniappkit-sdk
# Install dependencies
npm install
### Production
To build the application
```sh
npm run buildTo test in an app
npm packUsage
import { MiniAppKitProvider } from "miniappkit-sdk";
import { ethers, Eip1193Provider } from "ethers";
const connectWallet = async () => {
const standardProvider = await MiniAppKitProvider.init({
walletConnectProjectId: process.env.REACT_APP_WC_PROJECT_ID,
});
const provider = new ethers.BrowserProvider(standardProvider);
getBalanceAndAddress(provider)
};
const getBalanceandAddress = async (provider: Eip1193Provider) => {
const signer = await provider.getSigner();
const address = await signer.getAddress();
const balanceWei = await provider.getBalance(address);
// Convert from wei to ether
const balanceEther = ethers.formatEther(balanceWei);
console.log(`Address: ${address}`);
console.log(`Balance: ${balanceEther} ETH`);
};App demo: https://screen.studio/share/QJuXVClz App: https://miniappkit-app.vercel.app/
