Conecting To A Node

Connecting To A Node

To connect to a Bundlr node, provide your private key to allow for access to stored funds and for signing transactions.

The Bundlr constructor accepts three arguments:

  1. Node address: Address of the node you’ll connect to, current options are:
  2. Currency: Name of the currency used to pay.
  3. Key: Your private key.

Uploads to nodes 1 and 2 are permanent. Uploads to Devnet are kept for approximately 60 days.

import Bundlr from "@bundlr-network/client";
const myPrivateKey = ""; // Change to match your private key
const bundlr = new Bundlr("", "matic", myPrivateKey);
// Print your wallet address
console.log(`wallet address = ${bundlr.address}`);

Custom RPC

You can optionally specify a custom RPC:

const bundlr = new Bundlr(
		providerUrl: "",

As of the 0.11.0 SDK release, it is no longer required to use the following format when instantiating a Bundlr object via JavaScript. If your code still uses the .default() format, you will need to update it when upgrading your SDK.

const bundlr = new Bundlr.default("", "matic", “<polygon-private-key>”);