From 3b223aba0364f94827fabb55b3566e0fae86ddda Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Wed, 4 Oct 2023 19:57:00 +0000 Subject: [PATCH 1/3] feat: :sparkles: plugins: Transition from Bundlr to Irys storage driver Transitions from a deprecated Bundlr js sdk version to the latest Irys SDK --- packages/js/README.md | 28 ++-- packages/js/package.json | 4 +- packages/js/src/errors/BundlrError.ts | 54 -------- packages/js/src/errors/IrysError.ts | 54 ++++++++ packages/js/src/errors/index.ts | 2 +- .../js/src/plugins/bundlrStorage/index.ts | 2 - .../js/src/plugins/bundlrStorage/plugin.ts | 9 -- packages/js/src/plugins/corePlugins/plugin.ts | 4 +- packages/js/src/plugins/index.ts | 2 +- .../IrysStorageDriver.ts} | 125 +++++++++--------- packages/js/src/plugins/irysStorage/index.ts | 2 + packages/js/src/plugins/irysStorage/plugin.ts | 9 ++ packages/js/test/cjs-export.test.cjs | 18 +-- packages/js/test/esm-export.test.mjs | 18 +-- 14 files changed, 165 insertions(+), 166 deletions(-) delete mode 100644 packages/js/src/errors/BundlrError.ts create mode 100644 packages/js/src/errors/IrysError.ts delete mode 100644 packages/js/src/plugins/bundlrStorage/index.ts delete mode 100644 packages/js/src/plugins/bundlrStorage/plugin.ts rename packages/js/src/plugins/{bundlrStorage/BundlrStorageDriver.ts => irysStorage/IrysStorageDriver.ts} (68%) create mode 100644 packages/js/src/plugins/irysStorage/index.ts create mode 100644 packages/js/src/plugins/irysStorage/plugin.ts diff --git a/packages/js/README.md b/packages/js/README.md index b63ca3993..46e6e90d0 100644 --- a/packages/js/README.md +++ b/packages/js/README.md @@ -27,7 +27,7 @@ const metaplex = new Metaplex(connection); On top of that, you can customise who the SDK should interact on behalf of and which storage provider to use when uploading assets. We refer to these as "Identity Drivers" and "Storage Drivers" respectively. You may change these drivers by calling the `use` method on the Metaplex instance like so. We'll see all available drivers in more detail below. ```ts -import { Metaplex, keypairIdentity, bundlrStorage } from "@metaplex-foundation/js"; +import { Metaplex, keypairIdentity, irysStorage } from "@metaplex-foundation/js"; import { Connection, clusterApiUrl, Keypair } from "@solana/web3.js"; const connection = new Connection(clusterApiUrl("mainnet-beta")); @@ -35,7 +35,7 @@ const wallet = Keypair.generate(); const metaplex = Metaplex.make(connection) .use(keypairIdentity(wallet)) - .use(bundlrStorage()); + .use(irysStorage()); ``` Notice how you can create a `Metaplex` instance using `Metaplex.make(...)` instead of `new Metaplex(...)` in order to make the fluent API more readable. @@ -547,36 +547,36 @@ const file: MetaplexFile = await toMetaplexFileFromBrowser(browserFile); Okay, now let’s talk about the concrete storage drivers available to us and how to set them up. -### bundlrStorage +### irysStorage -The `bundlrStorage` driver is the default driver and uploads assets on Arweave using the [Bundlr network](https://bundlr.network/). +The `irysStorage` driver is the default driver and uploads assets on Arweave using [Irys](https://irys.xyz/). -By default, it will use the same RPC endpoint used by the `Metaplex` instance as a `providerUrl` and the mainnet address `"https://node1.bundlr.network"` as the Bundlr address. +By default, it will use the same RPC endpoint used by the `Metaplex` instance as a `providerUrl` and the mainnet address `"https://node1.irys.xyz"` as the Irys address. -You may customise these by passing a parameter object to the `bundlrStorage` method. For instance, here’s how you can use Bundlr on devnet. +You may customise these by passing a parameter object to the `irysStorage` method. For instance, here’s how you can use Irys on devnet. ```ts -import { bundlrStorage } from "@metaplex-foundation/js"; +import { irysStorage } from "@metaplex-foundation/js"; -metaplex.use(bundlrStorage({ - address: 'https://devnet.bundlr.network', +metaplex.use(irysStorage({ + address: 'https://devnet.irys.xyz', providerUrl: 'https://api.devnet.solana.com', timeout: 60000, })); ``` -To fund your bundlr storage account you can cast it in TypeScript like so: +To fund your irys storage account you can cast it in TypeScript like so: ```ts -const bundlrStorage = metaplex.storage().driver() as BundlrStorageDriver; +const irysStorage = metaplex.storage().driver() as IrysStorageDriver; ``` This gives you access to useful public methods such as: ```ts -bundlrStorage.fund([metaplexFile1, metaplexFile2]); // Fund using file size. -bundlrStorage.fund(1000); // Fund using byte size. -(await bundlrStorage.bundlr()).fund(1000); // Fund using lamports directly. +irysStorage.fund([metaplexFile1, metaplexFile2]); // Fund using file size. +irysStorage.fund(1000); // Fund using byte size. +(await irysStorage.irys()).fund(1000); // Fund using lamports directly. ``` ### mockStorage diff --git a/packages/js/package.json b/packages/js/package.json index a8d10ae00..17582f1cf 100644 --- a/packages/js/package.json +++ b/packages/js/package.json @@ -43,7 +43,7 @@ "test:exports": "node ./test/cjs-export.test.cjs && node ./test/esm-export.test.mjs" }, "dependencies": { - "@bundlr-network/client": "^0.8.8", + "@irys/sdk": "^0.0.2", "@metaplex-foundation/beet": "0.7.1", "@metaplex-foundation/mpl-auction-house": "^2.3.0", "@metaplex-foundation/mpl-bubblegum": "^0.6.2", @@ -73,4 +73,4 @@ "readmeFile": "./README.md", "displayName": "js" } -} +} \ No newline at end of file diff --git a/packages/js/src/errors/BundlrError.ts b/packages/js/src/errors/BundlrError.ts deleted file mode 100644 index 75b8dbfcb..000000000 --- a/packages/js/src/errors/BundlrError.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { MetaplexError } from './MetaplexError'; - -/** @group Errors */ -export class BundlrError extends MetaplexError { - readonly name: string = 'BundlrError'; - constructor(message: string, cause?: Error) { - super(message, 'plugin', 'Bundlr', cause); - } -} - -/** @group Errors */ -export class FailedToInitializeBundlrError extends BundlrError { - readonly name: string = 'FailedToInitializeBundlrError'; - constructor(cause: Error) { - const message = - 'Bundlr could not be initialized. ' + - 'Please check the underlying error below for more details.'; - super(message, cause); - } -} - -/** @group Errors */ -export class FailedToConnectToBundlrAddressError extends BundlrError { - readonly name: string = 'FailedToConnectToBundlrAddressError'; - constructor(address: string, cause: Error) { - const message = - `Bundlr could not connect to the provided address [${address}]. ` + - 'Please ensure the provided address is valid. Some valid addresses include: ' + - '"https://node1.bundlr.network" for mainnet and "https://devnet.bundlr.network" for devnet'; - super(message, cause); - } -} - -/** @group Errors */ -export class AssetUploadFailedError extends BundlrError { - readonly name: string = 'AssetUploadFailedError'; - constructor(status: number) { - const message = - `The asset could not be uploaded to the Bundlr network and ` + - `returned the following status code [${status}].`; - super(message); - } -} - -/** @group Errors */ -export class BundlrWithdrawError extends BundlrError { - readonly name: string = 'BundlrWithdrawError'; - constructor(status: number) { - const message = - `The balance could not be withdrawn from the Bundlr network and ` + - `returned the following status code [${status}].`; - super(message); - } -} diff --git a/packages/js/src/errors/IrysError.ts b/packages/js/src/errors/IrysError.ts new file mode 100644 index 000000000..18e63251f --- /dev/null +++ b/packages/js/src/errors/IrysError.ts @@ -0,0 +1,54 @@ +import { MetaplexError } from './MetaplexError'; + +/** @group Errors */ +export class IrysError extends MetaplexError { + readonly name: string = 'IrysError'; + constructor(message: string, cause?: Error) { + super(message, 'plugin', 'Irys', cause); + } +} + +/** @group Errors */ +export class FailedToInitializeIrysError extends IrysError { + readonly name: string = 'FailedToInitializeIrysError'; + constructor(cause: Error) { + const message = + 'Irys could not be initialized. ' + + 'Please check the underlying error below for more details.'; + super(message, cause); + } +} + +/** @group Errors */ +export class FailedToConnectToIrysAddressError extends IrysError { + readonly name: string = 'FailedToConnectToIrysAddressError'; + constructor(address: string, cause: Error) { + const message = + `Irys could not connect to the provided address [${address}]. ` + + 'Please ensure the provided address is valid. Some valid addresses include: ' + + '"https://node1.irys.xyz" for mainnet and "https://devnet.irys.xyz" for devnet'; + super(message, cause); + } +} + +/** @group Errors */ +export class AssetUploadFailedError extends IrysError { + readonly name: string = 'AssetUploadFailedError'; + constructor(status: number) { + const message = + `The asset could not be uploaded to the Irys network and ` + + `returned the following status code [${status}].`; + super(message); + } +} + +/** @group Errors */ +export class IrysWithdrawError extends IrysError { + readonly name: string = 'IrysWithdrawError'; + constructor(error: string) { + const message = + `The balance could not be withdrawn from the Irys network and ` + + `returned the following error: ${error}.`; + super(message); + } +} diff --git a/packages/js/src/errors/index.ts b/packages/js/src/errors/index.ts index d5c0143e9..c75275a51 100644 --- a/packages/js/src/errors/index.ts +++ b/packages/js/src/errors/index.ts @@ -1,4 +1,4 @@ -export * from './BundlrError'; +export * from './IrysError'; export * from './MetaplexError'; export * from './ProgramError'; export * from './RpcError'; diff --git a/packages/js/src/plugins/bundlrStorage/index.ts b/packages/js/src/plugins/bundlrStorage/index.ts deleted file mode 100644 index edbb7d38a..000000000 --- a/packages/js/src/plugins/bundlrStorage/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './BundlrStorageDriver'; -export * from './plugin'; diff --git a/packages/js/src/plugins/bundlrStorage/plugin.ts b/packages/js/src/plugins/bundlrStorage/plugin.ts deleted file mode 100644 index ba6383775..000000000 --- a/packages/js/src/plugins/bundlrStorage/plugin.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { BundlrOptions, BundlrStorageDriver } from './BundlrStorageDriver'; -import { Metaplex } from '@/Metaplex'; -import { MetaplexPlugin } from '@/types'; - -export const bundlrStorage = (options: BundlrOptions = {}): MetaplexPlugin => ({ - install(metaplex: Metaplex) { - metaplex.storage().setDriver(new BundlrStorageDriver(metaplex, options)); - }, -}); diff --git a/packages/js/src/plugins/corePlugins/plugin.ts b/packages/js/src/plugins/corePlugins/plugin.ts index d3df09cfa..977e8e58f 100644 --- a/packages/js/src/plugins/corePlugins/plugin.ts +++ b/packages/js/src/plugins/corePlugins/plugin.ts @@ -10,7 +10,7 @@ import { utilsModule } from '../utilsModule'; // Default drivers. import { guestIdentity } from '../guestIdentity'; -import { bundlrStorage } from '../bundlrStorage'; +import { irysStorage } from '../irysStorage'; // Verticals. import { systemModule } from '../systemModule'; @@ -32,7 +32,7 @@ export const corePlugins = () => ({ // Default drivers. metaplex.use(guestIdentity()); - metaplex.use(bundlrStorage()); + metaplex.use(irysStorage()); // Verticals. metaplex.use(systemModule()); diff --git a/packages/js/src/plugins/index.ts b/packages/js/src/plugins/index.ts index a6a84a780..7c4a8ec47 100644 --- a/packages/js/src/plugins/index.ts +++ b/packages/js/src/plugins/index.ts @@ -1,5 +1,5 @@ export * from './auctionHouseModule'; -export * from './bundlrStorage'; +export * from './irysStorage'; export * from './candyMachineModule'; export * from './candyMachineV2Module'; export * from './corePlugins'; diff --git a/packages/js/src/plugins/bundlrStorage/BundlrStorageDriver.ts b/packages/js/src/plugins/irysStorage/IrysStorageDriver.ts similarity index 68% rename from packages/js/src/plugins/bundlrStorage/BundlrStorageDriver.ts rename to packages/js/src/plugins/irysStorage/IrysStorageDriver.ts index 3486db1ba..343b62026 100644 --- a/packages/js/src/plugins/bundlrStorage/BundlrStorageDriver.ts +++ b/packages/js/src/plugins/irysStorage/IrysStorageDriver.ts @@ -1,4 +1,6 @@ -import type { default as NodeBundlr, WebBundlr } from '@bundlr-network/client'; +import type { default as NodeIrys, WebIrys } from '@irys/sdk'; + + import BigNumber from 'bignumber.js'; import { Connection, @@ -28,14 +30,11 @@ import { toBigNumber, } from '@/types'; import { - AssetUploadFailedError, - BundlrWithdrawError, - FailedToConnectToBundlrAddressError, - FailedToInitializeBundlrError, + AssetUploadFailedError, FailedToConnectToIrysAddressError, FailedToInitializeIrysError, IrysWithdrawError, } from '@/errors'; import { _removeDoubleDefault } from '@/utils'; -export type BundlrOptions = { +export type IrysOptions = { address?: string; timeout?: number; providerUrl?: string; @@ -43,7 +42,7 @@ export type BundlrOptions = { identity?: Signer; }; -export type BundlrWalletAdapter = { +export type IrysWalletAdapter = { publicKey: PublicKey | null; signMessage?: (message: Uint8Array) => Promise; signTransaction?: (transaction: Transaction) => Promise; @@ -55,18 +54,18 @@ export type BundlrWalletAdapter = { ) => Promise; }; -/// Size of Bundlr transaction header +/// Size of irys transaction header const HEADER_SIZE = 2_000; /// Minimum file size for cost calculation const MINIMUM_SIZE = 80_000; -export class BundlrStorageDriver implements StorageDriver { +export class IrysStorageDriver implements StorageDriver { protected _metaplex: Metaplex; - protected _bundlr: WebBundlr | NodeBundlr | null = null; - protected _options: BundlrOptions; + protected _irys: WebIrys | NodeIrys | null = null; + protected _options: IrysOptions; - constructor(metaplex: Metaplex, options: BundlrOptions = {}) { + constructor(metaplex: Metaplex, options: IrysOptions = {}) { this._metaplex = metaplex; this._options = { providerUrl: metaplex.connection.rpcEndpoint, @@ -75,8 +74,8 @@ export class BundlrStorageDriver implements StorageDriver { } async getUploadPrice(bytes: number): Promise { - const bundlr = await this.bundlr(); - const price = await bundlr.getPrice(bytes); + const irys = await this.irys(); + const price = await irys.getPrice(bytes); return bigNumberToAmount( price.multipliedBy(this._options.priceMultiplier ?? 1.1) @@ -98,16 +97,17 @@ export class BundlrStorageDriver implements StorageDriver { } async uploadAll(files: MetaplexFile[]): Promise { - const bundlr = await this.bundlr(); + const irys = await this.irys(); const amount = await this.getUploadPrice( getBytesFromMetaplexFiles(...files) ); await this.fund(amount); const promises = files.map(async (file) => { - const { status, data } = await bundlr.uploader.upload(file.buffer, { - tags: getMetaplexFileTagsWithContentType(file), - }); + const irysTx = irys.createTransaction(file.buffer, { tags: getMetaplexFileTagsWithContentType(file)}) + await irysTx.sign() + + const { status, data } = await irys.uploader.uploadTransaction(irysTx); if (status >= 300) { throw new AssetUploadFailedError(status); @@ -120,18 +120,18 @@ export class BundlrStorageDriver implements StorageDriver { } async getBalance(): Promise { - const bundlr = await this.bundlr(); - const balance = await bundlr.getLoadedBalance(); + const irys = await this.irys(); + const balance = await irys.getLoadedBalance(); return bigNumberToAmount(balance); } async fund(amount: Amount, skipBalanceCheck = false): Promise { - const bundlr = await this.bundlr(); + const irys = await this.irys(); let toFund = amountToBigNumber(amount); if (!skipBalanceCheck) { - const balance = await bundlr.getLoadedBalance(); + const balance = await irys.getLoadedBalance(); toFund = toFund.isGreaterThan(balance) ? toFund.minus(balance) @@ -142,14 +142,14 @@ export class BundlrStorageDriver implements StorageDriver { return; } - // TODO: Catch errors and wrap in BundlrErrors. - await bundlr.fund(toFund); + // TODO: Catch errors and wrap in irysErrors. + await irys.fund(toFund); } async withdrawAll(): Promise { - // TODO(loris): Replace with "withdrawAll" when available on Bundlr. - const bundlr = await this.bundlr(); - const balance = await bundlr.getLoadedBalance(); + // TODO(loris): Replace with "withdrawAll" when available on irys. + const irys = await this.irys(); + const balance = await irys.getLoadedBalance(); const minimumBalance = new BigNumber(5000); if (balance.isLessThan(minimumBalance)) { @@ -161,26 +161,25 @@ export class BundlrStorageDriver implements StorageDriver { } async withdraw(amount: Amount): Promise { - const bundlr = await this.bundlr(); - - const { status } = await bundlr.withdrawBalance(amountToBigNumber(amount)); - - if (status >= 300) { - throw new BundlrWithdrawError(status); + const irys = await this.irys(); + try{ + await irys.withdrawBalance(amountToBigNumber(amount)); + }catch(e: any){ + throw new IrysWithdrawError( (e instanceof Error) ? e.message : e.toString()); } } - async bundlr(): Promise { - if (this._bundlr) { - return this._bundlr; + async irys(): Promise { + if (this._irys) { + return this._irys; } - return (this._bundlr = await this.initBundlr()); + return (this._irys = await this.initIrys()); } - async initBundlr(): Promise { + async initIrys(): Promise { const currency = 'solana'; - const address = this._options?.address ?? 'https://node1.bundlr.network'; + const address = this._options?.address ?? 'https://node1.irys.xyz'; const options = { timeout: this._options.timeout, providerUrl: this._options.providerUrl, @@ -189,13 +188,13 @@ export class BundlrStorageDriver implements StorageDriver { const identity: Signer = this._options.identity ?? this._metaplex.identity(); - // if in node use node bundlr, else use web bundlr + // if in node use node irys, else use web irys // see: https://github.com/metaplex-foundation/js/issues/202 const isNode = typeof window === 'undefined' || window.process?.hasOwnProperty('type'); - let bundlr; + let irys; if (isNode && isKeypairSigner(identity)) - bundlr = await this.initNodeBundlr(address, currency, identity, options); + irys = await this.initNodeirys(address, currency, identity, options); else { let identitySigner: IdentitySigner; if (isIdentitySigner(identity)) identitySigner = identity; @@ -204,7 +203,7 @@ export class BundlrStorageDriver implements StorageDriver { Keypair.fromSecretKey((identity as KeypairSigner).secretKey) ); - bundlr = await this.initWebBundlr( + irys = await this.initWebirys( address, currency, identitySigner, @@ -213,34 +212,34 @@ export class BundlrStorageDriver implements StorageDriver { } try { - // Check for valid bundlr node. - await bundlr.utils.getBundlerAddress(currency); + // Check for valid irys node. + await irys.utils.getBundlerAddress(currency); } catch (error) { - throw new FailedToConnectToBundlrAddressError(address, error as Error); + throw new FailedToConnectToIrysAddressError(address, error as Error); } - return bundlr; + return irys; } - async initNodeBundlr( + async initNodeirys( address: string, currency: string, keypair: KeypairSigner, options: any - ): Promise { + ): Promise { const bPackage = _removeDoubleDefault( - await import('@bundlr-network/client') + await import('@irys/sdk') ); - return new bPackage.default(address, currency, keypair.secretKey, options); + return new bPackage.default({url: address, token: currency, key: keypair.secretKey, config: options}); } - async initWebBundlr( + async initWebirys( address: string, currency: string, identity: IdentitySigner, options: any - ): Promise { - const wallet: BundlrWalletAdapter = { + ): Promise { + const wallet: IrysWalletAdapter = { publicKey: identity.publicKey, signMessage: (message: Uint8Array) => identity.signMessage(message), signTransaction: (transaction: Transaction) => @@ -261,26 +260,26 @@ export class BundlrStorageDriver implements StorageDriver { }; const bPackage = _removeDoubleDefault( - await import('@bundlr-network/client') + await import('@irys/sdk') ); - const bundlr = new bPackage.WebBundlr(address, currency, wallet, options); + const irys = new bPackage.WebIrys({url: address, token: currency, wallet: {provider: wallet}, config: options}); try { - // Try to initiate bundlr. - await bundlr.ready(); + // Try to initiate irys. + await irys.ready(); } catch (error) { - throw new FailedToInitializeBundlrError(error as Error); + throw new FailedToInitializeIrysError(error as Error); } - return bundlr; + return irys; } } -export const isBundlrStorageDriver = ( +export const isirysStorageDriver = ( storageDriver: StorageDriver -): storageDriver is BundlrStorageDriver => { +): storageDriver is IrysStorageDriver => { return ( - 'bundlr' in storageDriver && + 'irys' in storageDriver && 'getBalance' in storageDriver && 'fund' in storageDriver && 'withdrawAll' in storageDriver diff --git a/packages/js/src/plugins/irysStorage/index.ts b/packages/js/src/plugins/irysStorage/index.ts new file mode 100644 index 000000000..d74e4c4c2 --- /dev/null +++ b/packages/js/src/plugins/irysStorage/index.ts @@ -0,0 +1,2 @@ +export * from './IrysStorageDriver'; +export * from './plugin'; diff --git a/packages/js/src/plugins/irysStorage/plugin.ts b/packages/js/src/plugins/irysStorage/plugin.ts new file mode 100644 index 000000000..e250af5fb --- /dev/null +++ b/packages/js/src/plugins/irysStorage/plugin.ts @@ -0,0 +1,9 @@ +import { IrysOptions, IrysStorageDriver } from './IrysStorageDriver'; +import { Metaplex } from '@/Metaplex'; +import { MetaplexPlugin } from '@/types'; + +export const irysStorage = (options: IrysOptions = {}): MetaplexPlugin => ({ + install(metaplex: Metaplex) { + metaplex.storage().setDriver(new IrysStorageDriver(metaplex, options)); + }, +}); diff --git a/packages/js/test/cjs-export.test.cjs b/packages/js/test/cjs-export.test.cjs index 2ec4fc121..96f93ba85 100644 --- a/packages/js/test/cjs-export.test.cjs +++ b/packages/js/test/cjs-export.test.cjs @@ -10,17 +10,17 @@ test('[cjs] it successfully exports commonjs named exports', (t) => { t.end(); }); -test('[cjs] it can import the Bundlr client', async (t) => { - const { BundlrStorageDriver, Metaplex } = exported; +test('[cjs] it can import the Irys client', async (t) => { + const { IrysStorageDriver, Metaplex } = exported; const connection = new Connection(LOCALHOST); const metaplex = new Metaplex(connection); - const bundlrDriver = new BundlrStorageDriver(metaplex); - const bundlr = await bundlrDriver.bundlr(); - t.ok(typeof bundlr === 'object', 'Bundlr is an object'); - t.ok('uploader' in bundlr, 'Bundlr can upload'); - t.ok('getLoadedBalance' in bundlr, 'Bundlr can get the loaded balance'); - t.ok('fund' in bundlr, 'Bundlr can fund'); - t.ok('withdrawBalance' in bundlr, 'Bundlr can withdraw'); + const irysDriver = new IrysStorageDriver(metaplex); + const irys = await irysDriver.irys(); + t.ok(typeof irys === 'object', 'Irys is an object'); + t.ok('uploader' in irys, 'Irys can upload'); + t.ok('getLoadedBalance' in irys, 'Irys can get the loaded balance'); + t.ok('fund' in irys, 'Irys can fund'); + t.ok('withdrawBalance' in irys, 'Irys can withdraw'); t.end(); }); diff --git a/packages/js/test/esm-export.test.mjs b/packages/js/test/esm-export.test.mjs index f009c2404..873a703f0 100644 --- a/packages/js/test/esm-export.test.mjs +++ b/packages/js/test/esm-export.test.mjs @@ -10,17 +10,17 @@ test('[esm] it successfully exports esm named exports', (t) => { t.end(); }); -test('[esm] it can import the Bundlr client', async (t) => { - const { BundlrStorageDriver, Metaplex } = exported; +test('[esm] it can import the Irys client', async (t) => { + const { IrysStorageDriver, Metaplex } = exported; const connection = new Connection(LOCALHOST); const metaplex = new Metaplex(connection); - const bundlrDriver = new BundlrStorageDriver(metaplex); - const bundlr = await bundlrDriver.bundlr(); - t.ok(typeof bundlr === 'object', 'Bundlr is an object'); - t.ok('uploader' in bundlr, 'Bundlr can upload'); - t.ok('getLoadedBalance' in bundlr, 'Bundlr can get the loaded balance'); - t.ok('fund' in bundlr, 'Bundlr can fund'); - t.ok('withdrawBalance' in bundlr, 'Bundlr can withdraw'); + const irysDriver = new IrysStorageDriver(metaplex); + const irys = await irysDriver.irys(); + t.ok(typeof irys === 'object', 'Irys is an object'); + t.ok('uploader' in irys, 'Irys can upload'); + t.ok('getLoadedBalance' in irys, 'Irys can get the loaded balance'); + t.ok('fund' in irys, 'Irys can fund'); + t.ok('withdrawBalance' in irys, 'Irys can withdraw'); t.end(); }); From f2d02ac5672983613ac965a94011da10d949c49f Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Wed, 4 Oct 2023 20:06:00 +0000 Subject: [PATCH 2/3] chore: :memo: Add changeset --- .changeset/empty-trainers-suffer.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/empty-trainers-suffer.md diff --git a/.changeset/empty-trainers-suffer.md b/.changeset/empty-trainers-suffer.md new file mode 100644 index 000000000..65b5b37fd --- /dev/null +++ b/.changeset/empty-trainers-suffer.md @@ -0,0 +1,5 @@ +--- +'@metaplex-foundation/js': minor +--- + +Transition from Bundlr to Irys From 496b73b0549bca6cbfc7904f01f6669bcafdc399 Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Sat, 4 Nov 2023 20:09:22 +0000 Subject: [PATCH 3/3] chore: :memo: Update pnpm-lock file --- pnpm-lock.yaml | 493 ++++++++++++++++++++++++++++--------------------- 1 file changed, 282 insertions(+), 211 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 314b7bb3b..691c4d807 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + importers: .: @@ -160,9 +164,9 @@ importers: packages/js: dependencies: - '@bundlr-network/client': - specifier: ^0.8.8 - version: 0.8.9(debug@4.3.4) + '@irys/sdk': + specifier: ^0.0.2 + version: 0.0.2(arweave@1.11.8)(debug@4.3.4) '@metaplex-foundation/beet': specifier: 0.7.1 version: 0.7.1 @@ -2416,36 +2420,6 @@ packages: to-fast-properties: 2.0.0 dev: true - /@bundlr-network/client@0.8.9(debug@4.3.4): - resolution: {integrity: sha512-SJ7BAt/KhONeFQ0+nbqrw2DUWrsev6y6cmlXt+3x7fPCkw7OJwudtxV/h2nBteZd65NXjqw8yzkmLiLfZ7CCRA==} - hasBin: true - dependencies: - '@solana/wallet-adapter-base': 0.9.19(@solana/web3.js@1.70.0) - '@solana/web3.js': 1.70.0 - '@supercharge/promise-pool': 2.3.2 - algosdk: 1.24.0 - arbundles: 0.6.22(@solana/web3.js@1.70.0)(debug@4.3.4) - arweave: 1.11.8(debug@4.3.4) - async-retry: 1.3.3 - axios: 0.25.0(debug@4.3.4) - base64url: 3.0.1 - bignumber.js: 9.1.1 - bs58: 4.0.1 - commander: 8.3.0 - csv: 6.2.5 - ethers: 5.7.2 - inquirer: 8.2.5 - js-sha256: 0.9.0 - mime-types: 2.1.35 - near-api-js: 0.44.2 - near-seed-phrase: 0.2.0 - transitivePeerDependencies: - - bufferutil - - debug - - encoding - - utf-8-validate - dev: false - /@changesets/apply-release-plan@6.1.2: resolution: {integrity: sha512-H8TV9E/WtJsDfoDVbrDGPXmkZFSv7W2KLqp4xX4MKZXshb0hsQZUNowUa8pnus9qb/5OZrFFRVsUsDCVHNW/AQ==} dependencies: @@ -2902,17 +2876,6 @@ packages: hash.js: 1.1.7 dev: false - /@ethersproject/solidity@5.7.0: - resolution: {integrity: sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==} - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/strings': 5.7.0 - dev: false - /@ethersproject/strings@5.7.0: resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} dependencies: @@ -2935,14 +2898,6 @@ packages: '@ethersproject/signing-key': 5.7.0 dev: false - /@ethersproject/units@5.7.0: - resolution: {integrity: sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==} - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - dev: false - /@ethersproject/wallet@5.7.0: resolution: {integrity: sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==} dependencies: @@ -3056,6 +3011,66 @@ packages: multiformats: 9.9.0 dev: false + /@irys/arweave@0.0.2(debug@4.3.4): + resolution: {integrity: sha512-ddE5h4qXbl0xfGlxrtBIwzflaxZUDlDs43TuT0u1OMfyobHul4AA1VEX72Rpzw2bOh4vzoytSqA1jCM7x9YtHg==} + dependencies: + asn1.js: 5.4.1 + async-retry: 1.3.3 + axios: 1.6.0(debug@4.3.4) + base64-js: 1.5.1 + bignumber.js: 9.1.1 + transitivePeerDependencies: + - debug + dev: false + + /@irys/query@0.0.1(debug@4.3.4): + resolution: {integrity: sha512-7TCyR+Qn+F54IQQx5PlERgqNwgIQik8hY55iZl/silTHhCo1MI2pvx5BozqPUVCc8/KqRsc2nZd8Bc29XGUjRQ==} + engines: {node: '>=16.10.0'} + dependencies: + async-retry: 1.3.3 + axios: 1.6.0(debug@4.3.4) + transitivePeerDependencies: + - debug + dev: false + + /@irys/sdk@0.0.2(arweave@1.11.8)(debug@4.3.4): + resolution: {integrity: sha512-un/e/CmTpgT042gDwCN3AtISrR9OYGMY6V+442pFmSWKrwrsDoIXZ8VlLiYKnrtTm+yquGhjfYy0LDqGWq41pA==} + engines: {node: '>=16.10.0'} + hasBin: true + dependencies: + '@ethersproject/bignumber': 5.7.0 + '@ethersproject/contracts': 5.7.0 + '@ethersproject/providers': 5.7.2 + '@ethersproject/wallet': 5.7.0 + '@irys/query': 0.0.1(debug@4.3.4) + '@near-js/crypto': 0.0.3 + '@near-js/keystores-browser': 0.0.3 + '@near-js/providers': 0.0.4 + '@near-js/transactions': 0.1.1 + '@solana/web3.js': 1.70.0 + '@supercharge/promise-pool': 3.1.0 + algosdk: 1.24.0 + aptos: 1.8.5(debug@4.3.4) + arbundles: 0.10.0(arweave@1.11.8)(debug@4.3.4) + async-retry: 1.3.3 + axios: 1.6.0(debug@4.3.4) + base64url: 3.0.1 + bignumber.js: 9.1.1 + bs58: 5.0.0 + commander: 8.3.0 + csv: 5.5.3 + inquirer: 8.2.5 + js-sha256: 0.9.0 + mime-types: 2.1.35 + near-seed-phrase: 0.2.0 + transitivePeerDependencies: + - arweave + - bufferutil + - debug + - encoding + - utf-8-validate + dev: false + /@jridgewell/gen-mapping@0.1.1: resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} engines: {node: '>=6.0.0'} @@ -3332,6 +3347,130 @@ packages: murmurhash3js-revisited: 3.0.0 dev: false + /@near-js/crypto@0.0.3: + resolution: {integrity: sha512-3WC2A1a1cH8Cqrx+0iDjp1ASEEhxN/KHEMENYb0KZH6Hp5bXIY7Akt4quC7JlgJS5ESvEiLa40tS5h0zAhBWGw==} + dependencies: + '@near-js/types': 0.0.3 + bn.js: 5.2.1 + borsh: 0.7.0 + tweetnacl: 1.0.3 + dev: false + + /@near-js/crypto@0.0.4: + resolution: {integrity: sha512-2mSIVv6mZway1rQvmkktrXAFoUvy7POjrHNH3LekKZCMCs7qMM/23Hz2+APgxZPqoV2kjarSNOEYJjxO7zQ/rQ==} + dependencies: + '@near-js/types': 0.0.4 + bn.js: 5.2.1 + borsh: 0.7.0 + tweetnacl: 1.0.3 + dev: false + + /@near-js/keystores-browser@0.0.3: + resolution: {integrity: sha512-Ve/JQ1SBxdNk3B49lElJ8Y54AoBY+yOStLvdnUIpe2FBOczzwDCkcnPcMDV0NMwVlHpEnOWICWHbRbAkI5Vs+A==} + dependencies: + '@near-js/crypto': 0.0.3 + '@near-js/keystores': 0.0.3 + dev: false + + /@near-js/keystores@0.0.3: + resolution: {integrity: sha512-mnwLYUt4Td8u1I4QE1FBx2d9hMt3ofiriE93FfOluJ4XiqRqVFakFYiHg6pExg5iEkej/sXugBUFeQ4QizUnew==} + dependencies: + '@near-js/crypto': 0.0.3 + '@near-js/types': 0.0.3 + dev: false + + /@near-js/keystores@0.0.4: + resolution: {integrity: sha512-+vKafmDpQGrz5py1liot2hYSjPGXwihveeN+BL11aJlLqZnWBgYJUWCXG+uyGjGXZORuy2hzkKK6Hi+lbKOfVA==} + dependencies: + '@near-js/crypto': 0.0.4 + '@near-js/types': 0.0.4 + dev: false + + /@near-js/providers@0.0.4: + resolution: {integrity: sha512-g/2pJTYmsIlTW4mGqeRlqDN9pZeN+1E2/wfoMIf3p++boBVxVlaSebtQgawXAf2lkfhb9RqXz5pHqewXIkTBSw==} + dependencies: + '@near-js/transactions': 0.1.0 + '@near-js/types': 0.0.3 + '@near-js/utils': 0.0.3 + bn.js: 5.2.1 + borsh: 0.7.0 + http-errors: 1.8.1 + optionalDependencies: + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: false + + /@near-js/signers@0.0.3: + resolution: {integrity: sha512-u1R+DDIua5PY1PDFnpVYqdMgQ7c4dyeZsfqMjE7CtgzdqupgTYCXzJjBubqMlAyAx843PoXmLt6CSSKcMm0WUA==} + dependencies: + '@near-js/crypto': 0.0.3 + '@near-js/keystores': 0.0.3 + js-sha256: 0.9.0 + dev: false + + /@near-js/signers@0.0.4: + resolution: {integrity: sha512-xCglo3U/WIGsz/izPGFMegS5Q3PxOHYB8a1E7RtVhNm5QdqTlQldLCm/BuMg2G/u1l1ZZ0wdvkqRTG9joauf3Q==} + dependencies: + '@near-js/crypto': 0.0.4 + '@near-js/keystores': 0.0.4 + js-sha256: 0.9.0 + dev: false + + /@near-js/transactions@0.1.0: + resolution: {integrity: sha512-OrrDFqhX0rtH+6MV3U3iS+zmzcPQI+L4GJi9na4Uf8FgpaVPF0mtSmVrpUrS5CC3LwWCzcYF833xGYbXOV4Kfg==} + dependencies: + '@near-js/crypto': 0.0.3 + '@near-js/signers': 0.0.3 + '@near-js/types': 0.0.3 + '@near-js/utils': 0.0.3 + bn.js: 5.2.1 + borsh: 0.7.0 + js-sha256: 0.9.0 + dev: false + + /@near-js/transactions@0.1.1: + resolution: {integrity: sha512-Fk83oLLFK7nz4thawpdv9bGyMVQ2i48iUtZEVYhuuuqevl17tSXMlhle9Me1ZbNyguJG/cWPdNybe1UMKpyGxA==} + dependencies: + '@near-js/crypto': 0.0.4 + '@near-js/signers': 0.0.4 + '@near-js/types': 0.0.4 + '@near-js/utils': 0.0.4 + bn.js: 5.2.1 + borsh: 0.7.0 + js-sha256: 0.9.0 + dev: false + + /@near-js/types@0.0.3: + resolution: {integrity: sha512-gC3iGUT+r2JjVsE31YharT+voat79ToMUMLCGozHjp/R/UW1M2z4hdpqTUoeWUBGBJuVc810gNTneHGx0jvzwQ==} + dependencies: + bn.js: 5.2.1 + dev: false + + /@near-js/types@0.0.4: + resolution: {integrity: sha512-8TTMbLMnmyG06R5YKWuS/qFG1tOA3/9lX4NgBqQPsvaWmDsa+D+QwOkrEHDegped0ZHQwcjAXjKML1S1TyGYKg==} + dependencies: + bn.js: 5.2.1 + dev: false + + /@near-js/utils@0.0.3: + resolution: {integrity: sha512-J72n/EL0VfLRRb4xNUF4rmVrdzMkcmkwJOhBZSTWz3PAZ8LqNeU9ZConPfMvEr6lwdaD33ZuVv70DN6IIjPr1A==} + dependencies: + '@near-js/types': 0.0.3 + bn.js: 5.2.1 + depd: 2.0.0 + mustache: 4.2.0 + dev: false + + /@near-js/utils@0.0.4: + resolution: {integrity: sha512-mPUEPJbTCMicGitjEGvQqOe8AS7O4KkRCxqd0xuE/X6gXF1jz1pYMZn4lNUeUz2C84YnVSGLAM0o9zcN6Y4hiA==} + dependencies: + '@near-js/types': 0.0.4 + bn.js: 5.2.1 + depd: 2.0.0 + mustache: 4.2.0 + dev: false + /@nftstorage/metaplex-auth@1.2.0(node-fetch@2.6.7): resolution: {integrity: sha512-ffT/cZv1GWXDVrwzNUGGxApDwQJSxUZJAqnPpTk5VBc55T2RtUm2yZ11p74h2fyam1erJH38zg7S9IoaTxSZ8w==} dependencies: @@ -3362,6 +3501,10 @@ packages: /@noble/ed25519@1.7.1: resolution: {integrity: sha512-Rk4SkJFaXZiznFyC/t77Q0NKS4FL7TLJJsVG2V2oiEq3kJVeTdxysEe/yRWSpnWMe808XRDJ+VFh5pt/FN5plw==} + /@noble/hashes@1.1.3: + resolution: {integrity: sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A==} + dev: false + /@noble/hashes@1.1.4: resolution: {integrity: sha512-+PYsVPrTSqtVjatKt2A/Proukn2Yrz61OBThOCKErc5w2/r1Fh37vbDv0Eah7pyNltrmacjwTvdw3JoR+WE4TA==} @@ -3434,13 +3577,17 @@ packages: /@randlabs/communication-bridge@1.0.1: resolution: {integrity: sha512-CzS0U8IFfXNK7QaJFE4pjbxDGfPjbXBEsEaCn9FN15F+ouSAEUQkva3Gl66hrkBZOGexKFEWMwUHIDKpZ2hfVg==} + requiresBuild: true dev: false + optional: true /@randlabs/myalgo-connect@1.4.2: resolution: {integrity: sha512-K9hEyUi7G8tqOp7kWIALJLVbGCByhilcy6123WfcorxWwiE1sbQupPyIU5f3YdQK6wMjBsyTWiLW52ZBMp7sXA==} + requiresBuild: true dependencies: '@randlabs/communication-bridge': 1.0.1 dev: false + optional: true /@rollup/plugin-babel@5.3.1(@babel/core@7.20.5)(rollup@2.79.1): resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} @@ -3564,6 +3711,17 @@ packages: rollup: 2.79.1 dev: true + /@scure/base@1.1.3: + resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==} + dev: false + + /@scure/bip39@1.1.0: + resolution: {integrity: sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==} + dependencies: + '@noble/hashes': 1.1.4 + '@scure/base': 1.1.3 + dev: false + /@sideway/address@4.1.4: resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==} dependencies: @@ -3711,16 +3869,6 @@ packages: - utf-8-validate dev: false - /@solana/wallet-adapter-base@0.9.19(@solana/web3.js@1.70.0): - resolution: {integrity: sha512-c/F3xyuSNDUjbYM6E4be5bMx9YmNqE6XIpLcM9U3ohviwDF8hO+v5N8KSvnMaztL4Lr6+TEtCLi3Q5AT0r06JA==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.58.0 - dependencies: - '@solana/web3.js': 1.70.0 - eventemitter3: 4.0.7 - dev: false - /@solana/web3.js@1.70.0: resolution: {integrity: sha512-HwdI9LaHaszfpzgxJI44iP68mJWUeqK1TeSheKQsGkH5zlVyGWGmim50MyDWu2vXiuL8Akf2xEMSrDYyLordgg==} engines: {node: '>=12.20.0'} @@ -3745,8 +3893,8 @@ packages: - encoding - utf-8-validate - /@supercharge/promise-pool@2.3.2: - resolution: {integrity: sha512-f5+C7zv+QQivcUO1FH5lXi7GcuJ3CFuJF3Eg06iArhUs5ma0szCLEQwIY4+VQyh7m/RLVZdzvr4E4ZDnLe9MNg==} + /@supercharge/promise-pool@3.1.0: + resolution: {integrity: sha512-gB3NukbIcYzRtPoE6dx9svQYPodxvnfQlaaQd8N/z87E6WaMfRE7o5HwB+LZ+KeM0nsNAq1n4TmBtfz1VCUR+Q==} engines: {node: '>=8'} dev: false @@ -4325,27 +4473,42 @@ packages: picomatch: 2.3.1 dev: true - /arbundles@0.6.22(@solana/web3.js@1.70.0)(debug@4.3.4): - resolution: {integrity: sha512-QlSavBHk59mNqgQ6ScxlqaBJlDbSmSrK/uTcF3HojLAZ/4aufTkVTBjl1hSfZ/ZN45oIPgJC05R8SmVARF+8VA==} + /aptos@1.8.5(debug@4.3.4): + resolution: {integrity: sha512-iQxliWesNHjGQ5YYXCyss9eg4+bDGQWqAZa73vprqGQ9tungK0cRjUI2fmnp63Ed6UG6rurHrL+b0ckbZAOZZQ==} + engines: {node: '>=11.0.0'} + dependencies: + '@noble/hashes': 1.1.3 + '@scure/bip39': 1.1.0 + axios: 0.27.2(debug@4.3.4) + form-data: 4.0.0 + tweetnacl: 1.0.3 + transitivePeerDependencies: + - debug + dev: false + + /arbundles@0.10.0(arweave@1.11.8)(debug@4.3.4): + resolution: {integrity: sha512-Prbkjb0RSR6ToXPaBFhsBiMYSq78vHWbG/Zzy1tALRGvnKYlNLq93cqtmCNHqaYP6YCBZZV05ZpbO5C6269saw==} dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/providers': 5.7.2 + '@ethersproject/signing-key': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/wallet': 5.7.0 + '@irys/arweave': 0.0.2(debug@4.3.4) '@noble/ed25519': 1.7.1 - '@randlabs/myalgo-connect': 1.4.2 - '@solana/wallet-adapter-base': 0.9.19(@solana/web3.js@1.70.0) - algosdk: 1.24.0 - arweave: 1.11.8(debug@4.3.4) - arweave-stream-tx: 1.2.2(arweave@1.11.8) - avsc: github.com/Bundlr-Network/avsc/a730cc8018b79e114b6a3381bbb57760a24c6cef - axios: 0.21.4(debug@4.3.4) base64url: 3.0.1 bs58: 4.0.1 - ethers: 5.7.2 keccak: 3.0.2 + secp256k1: 5.0.0 + optionalDependencies: + '@randlabs/myalgo-connect': 1.4.2 + algosdk: 1.24.0 + arweave-stream-tx: 1.2.2(arweave@1.11.8) multistream: 4.1.0 - process: 0.11.10 - secp256k1: 4.0.3 tmp-promise: 3.0.3 transitivePeerDependencies: - - '@solana/web3.js' + - arweave - bufferutil - debug - encoding @@ -4359,6 +4522,7 @@ packages: transitivePeerDependencies: - debug dev: false + optional: true /arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -4448,12 +4612,14 @@ packages: /arweave-stream-tx@1.2.2(arweave@1.11.8): resolution: {integrity: sha512-bNt9rj0hbAEzoUZEF2s6WJbIz8nasZlZpxIw03Xm8fzb9gRiiZlZGW3lxQLjfc9Z0VRUWDzwtqoYeEoB/JDToQ==} + requiresBuild: true peerDependencies: arweave: ^1.10.0 dependencies: arweave: 1.11.8(debug@4.3.4) exponential-backoff: 3.1.0 dev: false + optional: true /arweave@1.11.8(debug@4.3.4): resolution: {integrity: sha512-58ODeNPIC4OjaOCl2bXjKbOFGsiVZFs+DkQg3BvQGvFWNqw1zTJ4Jp01xGUz+GbdOaDyJcCC0g3l0HwdJfFPyw==} @@ -4468,6 +4634,7 @@ packages: transitivePeerDependencies: - debug dev: false + optional: true /asn1.js@5.4.1: resolution: {integrity: sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==} @@ -4502,6 +4669,7 @@ packages: follow-redirects: 1.15.2(debug@4.3.4) transitivePeerDependencies: - debug + dev: true /axios@0.25.0(debug@4.3.4): resolution: {integrity: sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==} @@ -4509,6 +4677,7 @@ packages: follow-redirects: 1.15.2(debug@4.3.4) transitivePeerDependencies: - debug + dev: true /axios@0.27.2(debug@4.3.4): resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} @@ -4519,6 +4688,16 @@ packages: - debug dev: false + /axios@1.6.0(debug@4.3.4): + resolution: {integrity: sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==} + dependencies: + follow-redirects: 1.15.2(debug@4.3.4) + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /babel-plugin-module-resolver@4.1.0: resolution: {integrity: sha512-MlX10UDheRr3lb3P0WcaIdtCSRlxdQsB1sBqL7W0raF070bGl1HQQq5K3T2vf2XAYie+ww+5AKC/WrkjRO2knA==} engines: {node: '>= 8.0.0'} @@ -4688,10 +4867,6 @@ packages: resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} dev: false - /bn.js@5.2.0: - resolution: {integrity: sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==} - dev: false - /bn.js@5.2.1: resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} @@ -4704,14 +4879,6 @@ packages: text-encoding-utf-8: 1.0.2 dev: true - /borsh@0.6.0: - resolution: {integrity: sha512-sl5k89ViqsThXQpYa9XDtz1sBl3l1lI313cFUY1HKr+wvMILnb+58xpkqTNrYbelh99dY7K8usxoCusQmqix9Q==} - dependencies: - bn.js: 5.2.1 - bs58: 4.0.1 - text-encoding-utf-8: 1.0.2 - dev: false - /borsh@0.7.0: resolution: {integrity: sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==} dependencies: @@ -4884,10 +5051,6 @@ packages: resolution: {integrity: sha512-ZmWkKsnC2ifEPoWUvSAIGyOYwT+keAaaWPHiQ9DfMqS1t6tfuyFYoWR78TeZtznkEQ64+vGXH9cZrElwR2Mrxg==} dev: true - /capability@0.2.5: - resolution: {integrity: sha512-rsJZYVCgXd08sPqwmaIqjAd5SUTfonV0z/gDJ8D6cN8wQphky1kkAYEqQ+hmDxTw7UihvBfjUVUSY+DBEe44jg==} - dev: false - /carbites@1.0.6: resolution: {integrity: sha512-dS9IQvnrb5VIRvSTNz5Ff+mB9d2MFfi5mojtJi7Rlss79VeF190jr0sZdA7eW0CGHotvHkZaWuM6wgfD9PEFRg==} dependencies: @@ -5180,27 +5343,12 @@ packages: /csv-generate@3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} - dev: true - - /csv-generate@4.2.1: - resolution: {integrity: sha512-w6GFHjvApv6bcJ2xdi9JGsH6ZvUBfC+vUdfefnEzurXG6hMRwzkBLnhztU2H7v7+zfCk1I/knnQ+tGbgpxWrBw==} - dev: false /csv-parse@4.16.3: resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} - dev: true - - /csv-parse@5.3.3: - resolution: {integrity: sha512-kEWkAPleNEdhFNkHQpFHu9RYPogsFj3dx6bCxL847fsiLgidzWg0z/O0B1kVWMJUc5ky64zGp18LX2T3DQrOfw==} - dev: false /csv-stringify@5.6.5: resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} - dev: true - - /csv-stringify@6.2.3: - resolution: {integrity: sha512-4qGjUMwnlaRc00gc2jrIYh2w/h1fo25B0mTuY9K8fBiIgtmCX3LcgUbrEGViL98Ci4Se/F5LFEtu8k+dItJVZQ==} - dev: false /csv@5.5.3: resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} @@ -5210,17 +5358,6 @@ packages: csv-parse: 4.16.3 csv-stringify: 5.6.5 stream-transform: 2.1.3 - dev: true - - /csv@6.2.5: - resolution: {integrity: sha512-T+K0H7MIrlrnP6KxYKo3lK+uLl6OC2Gmwdd81TG/VdkhKvpatl35sR7tyRSpDLGl22y2T+q9KvNHnVtn4OAscQ==} - engines: {node: '>= 0.1.90'} - dependencies: - csv-generate: 4.2.1 - csv-parse: 5.3.3 - csv-stringify: 6.2.3 - stream-transform: 3.2.1 - dev: false /data-uri-to-buffer@3.0.1: resolution: {integrity: sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==} @@ -5534,14 +5671,6 @@ packages: dependencies: is-arrayish: 0.2.1 - /error-polyfill@0.1.3: - resolution: {integrity: sha512-XHJk60ufE+TG/ydwp4lilOog549iiQF2OAPhkk9DdiYWMrltz5yhDz/xnKuenNwP7gy3dsibssO5QpVhkrSzzg==} - dependencies: - capability: 0.2.5 - o3: 1.0.3 - u3: 0.1.1 - dev: false - /es-abstract@1.20.4: resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==} engines: {node: '>= 0.4'} @@ -6151,44 +6280,6 @@ packages: rlp: 2.2.7 dev: false - /ethers@5.7.2: - resolution: {integrity: sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==} - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/base64': 5.7.0 - '@ethersproject/basex': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/contracts': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/hdnode': 5.7.0 - '@ethersproject/json-wallets': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/networks': 5.7.1 - '@ethersproject/pbkdf2': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/providers': 5.7.2 - '@ethersproject/random': 5.7.0 - '@ethersproject/rlp': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/solidity': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/units': 5.7.0 - '@ethersproject/wallet': 5.7.0 - '@ethersproject/web': 5.7.1 - '@ethersproject/wordlists': 5.7.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: false - /ethjs-unit@0.1.6: resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} engines: {node: '>=6.5.0', npm: '>=3'} @@ -6241,7 +6332,9 @@ packages: /exponential-backoff@3.1.0: resolution: {integrity: sha512-oBuz5SYz5zzyuHINoe9ooePwSu0xApKWgeNzok4hZ5YKXFh9zrQBEM15CXqoZkJJPuI2ArvqjPQd8UKJA753XA==} + requiresBuild: true dev: false + optional: true /extendable-error@0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} @@ -7851,7 +7944,6 @@ packages: /mixme@0.5.4: resolution: {integrity: sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw==} engines: {node: '>= 8.0.0'} - dev: true /move-file@2.1.0: resolution: {integrity: sha512-i9qLW6gqboJ5Ht8bauZi7KlTnQ3QFpBCvMvFfEcHADKgHGeJ9BZMO7SFCTwHPV9Qa0du9DYY1Yx3oqlGt30nXA==} @@ -7912,10 +8004,12 @@ packages: /multistream@4.1.0: resolution: {integrity: sha512-J1XDiAmmNpRCBfIWJv+n0ymC4ABcf/Pl+5YvC5B/D2f/2+8PtHvCNxMPKiQcZyi922Hq69J2YOpb1pTywfifyw==} + requiresBuild: true dependencies: once: 1.4.0 readable-stream: 3.6.0 dev: false + optional: true /murmurhash3js-revisited@3.0.0: resolution: {integrity: sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==} @@ -7973,24 +8067,6 @@ packages: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true - /near-api-js@0.44.2: - resolution: {integrity: sha512-eMnc4V+geggapEUa3nU2p8HSHn/njtloI4P2mceHQWO8vDE1NGpnAw8FuTBrLmXSgIv9m6oocgFc9t3VNf5zwg==} - dependencies: - bn.js: 5.2.0 - borsh: 0.6.0 - bs58: 4.0.1 - depd: 2.0.0 - error-polyfill: 0.1.3 - http-errors: 1.8.1 - js-sha256: 0.9.0 - mustache: 4.2.0 - node-fetch: 2.6.7 - text-encoding-utf-8: 1.0.2 - tweetnacl: 1.0.3 - transitivePeerDependencies: - - encoding - dev: false - /near-hd-key@1.2.1: resolution: {integrity: sha512-SIrthcL5Wc0sps+2e1xGj3zceEa68TgNZDLuCx0daxmfTP7sFTB3/mtE2pYhlFsCxWoMn+JfID5E1NlzvvbRJg==} dependencies: @@ -8074,6 +8150,10 @@ packages: resolution: {integrity: sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==} dev: false + /node-addon-api@5.1.0: + resolution: {integrity: sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==} + dev: false + /node-fetch@2.6.1: resolution: {integrity: sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==} engines: {node: 4.x || >=6.0.0} @@ -8140,12 +8220,6 @@ packages: resolution: {integrity: sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA==} dev: true - /o3@1.0.3: - resolution: {integrity: sha512-f+4n+vC6s4ysy7YO7O2gslWZBUu8Qj2i2OUJOvjRxQva7jVjYjB29jrr9NCjmxZQR0gzrOcv1RnqoYOeMs5VRQ==} - dependencies: - capability: 0.2.5 - dev: false - /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -8523,11 +8597,6 @@ packages: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true - /process@0.11.10: - resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} - engines: {node: '>= 0.6.0'} - dev: false - /protobufjs@6.11.3: resolution: {integrity: sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==} hasBin: true @@ -8548,6 +8617,10 @@ packages: long: 4.0.0 dev: false + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /ps-tree@1.2.0: resolution: {integrity: sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==} engines: {node: '>= 0.10'} @@ -8958,6 +9031,16 @@ packages: node-gyp-build: 4.5.0 dev: false + /secp256k1@5.0.0: + resolution: {integrity: sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==} + engines: {node: '>=14.0.0'} + requiresBuild: true + dependencies: + elliptic: 6.5.4 + node-addon-api: 5.1.0 + node-gyp-build: 4.5.0 + dev: false + /selective-whitespace@1.0.4: resolution: {integrity: sha512-DyL/pLbb9poQNQOVndVohclAO8lq+6gEBW8q3H9c2fX+ODkugQMvjBilPjw09lrIuVRFRQ/nwhLdzn60sFh9lQ==} dependencies: @@ -9241,11 +9324,6 @@ packages: resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} dependencies: mixme: 0.5.4 - dev: true - - /stream-transform@3.2.1: - resolution: {integrity: sha512-ApK+WTJ5bCOf0A2tlec1qhvr8bGEBM/sgXXB7mysdCYgZJO5DZeaV3h3G+g0HnAQ372P5IhiGqnW29zoLOfTzQ==} - dev: false /streaming-iterables@6.2.0: resolution: {integrity: sha512-3AYC8oB60WyD1ic7uHmN/vm2oRGzRnQ3XFBl/bFMDi1q1+nc5/vjMmiE4vroIya3jG59t87VpyAj/iXYxyw9AA==} @@ -9494,9 +9572,11 @@ packages: /tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} + requiresBuild: true dependencies: tmp: 0.2.1 dev: false + optional: true /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} @@ -9507,9 +9587,11 @@ packages: /tmp@0.2.1: resolution: {integrity: sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==} engines: {node: '>=8.17.0'} + requiresBuild: true dependencies: rimraf: 3.0.2 dev: false + optional: true /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} @@ -9766,10 +9848,6 @@ packages: engines: {node: '>=8'} dev: false - /u3@0.1.1: - resolution: {integrity: sha512-+J5D5ir763y+Am/QY6hXNRlwljIeRMZMGs0cT6qqZVVzzT3X3nFPXVyPOFRMOR4kupB0T8JnCdpWdp6Q/iXn3w==} - dev: false - /uint8arrays@3.1.1: resolution: {integrity: sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==} dependencies: @@ -10227,10 +10305,3 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true - - github.com/Bundlr-Network/avsc/a730cc8018b79e114b6a3381bbb57760a24c6cef: - resolution: {tarball: https://codeload.github.com/Bundlr-Network/avsc/tar.gz/a730cc8018b79e114b6a3381bbb57760a24c6cef} - name: avsc - version: 5.4.7 - engines: {node: '>=0.11'} - dev: false