DEVELOPER DOCS
Migration Guide

Migration guide

Migrating your application from the Bundlr SDK to the Irys SDK is a simple process.

ℹ️

All existing legacy packages will be maintained until October 2024 and will continue to work until at least October 2025. All domains will be supported in perpetuity (e.g., https://node1.bundlr.network (opens in a new tab))

Installation

Install the Irys SDK using npm:

npm install @irys/sdk

or yarn:

yarn add @irys/sdk

Imports

Change your import statements from:

import Bundlr from "@bundlr-network/client";

to:

import Irys from "@irys/sdk";

Name Changes

Apart from rebrand to Irys, certain elements within the SDK have undergone a name change.

WebBundlr and (Node)Bundlr have been changed to WebIrys and (Node)Irys respectively.
All usage of currency in the SDK has been replaced with token, notably the argument as part of client instantiation (see Constructor) as well as internal APIs (such as currencyConfig -> tokenConfig)

Constructor

In the Bundlr SDK, parameters are passed directly. In the Irys SDK, parameters are passed inside an options object.

Update new Bundlr to new Irys and then wrap your constructor arguments in {}.

const url = "https://devnet.irys.xyz";
// Devnet RPC URLs change often, use a recent one from https://chainlist.org/
const providerUrl = "";
const token = "ethereum";
 
const bundlr = new Bundlr(url, token, process.env.PRIVATE_KEY);
 
const irys = new Irys({
	url, // URL of the node you want to connect to
	token, // Token used to pay for uploads
	key: process.env.PRIVATE_KEY, // ETH or SOL private key
	config: { providerUrl }, // Optional provider URL, only required when using Devnet
});

Domain Changes

With the release of the Irys SDK our domain has changed from https://bundlr.network to https://irys.xyz. When upgrading your code, you shouldsla change your Node URLs:

Bundlr Node AddressIrys Node Address
https://node1.bundlr.networkhttps://node1.irys.xyz
https://node2.bundlr.networkhttps://node2.irys.xyz
https://devnet.bundlr.networkhttps://devnet.irys.xyz

And your GraphQL endpoints

Bundlr GraphQL EndpointIrys GraphQL Endpoint
https://node1.bundlr.network/graphqlhttps://node1.irys.xyz/graphql
https://node2.bundlr.network/graphqlhttps://node2.irys.xyz/graphql
https://devnet.bundlr.network/graphqlhttps://devnet.irys.xyz/graphql

Changes to upload functions

In the Bundlr SDK there were separate upload functions depending on whether you wanted a receipt or not. With the Irys SDK, all upload functions return a receipt.

The following function is deprecated:

  • bundlr.uploadWithReceipt()

The following functions upload data as before however, the return type has changed to be a receipt.

Change to WebBundlr / WebIrys

With the Bundlr SDK, using providers other than Ethers 5 required extra setup code unique to each provider. Now, we natively support multiple different provider types.

When connecting to a WebIrys class, you pass both a reference to a provider and the provider type. The following example is for Ethers 5, we also have a full list of supported provider types see Irys in the browser.

const getWebIrys = async () => {
	// Ethers5 provider
	await window.ethereum.enable();
	const provider = new providers.Web3Provider(window.ethereum);
 
	const url = "https://node1.irys.xyz";
	const token = "ethereum";
	// Devnet RPC URLs change often, use a recent one from https://chainlist.org/
	const rpcUrl = "";
 
	// Create a wallet object
	const wallet = { rpcUrl: rpcUrl, name: "ethersv5", provider: provider };
	// Use the wallet object
	const webIrys = new WebIrys({ url, token, wallet });
	await webIrys.ready();
 
	return webIrys;
};