This is a new Bundlr js client for Bundlr network. The current library js-client should need raw private keys which may not possible if user are using wallets like ledger or Metamask.
This library provides a WalletProvider interface which is to provider signing function to the Bundlr client, which will ask the user's permission when signing the request.
Currently the InjectedWalletProvider(like Metemask) has been implemented. But it is easy to implement other WalletProvider like WalletConnect or even Solana Wallet.
yarn install
import { BundlrClient, InjectedWalletProvider } from '../build/src/index';
const network = "matic";
const unit = "wei";
const nodeUrl = "https://node1.bundlr.network";
const wp = new InjectedWalletProvider(network, unit);
const bc = new BundlrClient(nodeUrl, network, wp)
bundlr.address
await bundlr.getLoadedBalance() // 109864
await bundlr.fund(amount);
please ensure you have Metamask installed and added the Matic network, run the following command to see the demo
yarn demo
please check the sample folder for detail and code.
