From 80483c56c80aa20a6a4b731e4319741b4d25263e Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Wed, 4 Oct 2023 20:41:28 +0000 Subject: [PATCH 1/7] refactor: :truck: Rename umi-uploader-bundlr -> umi-uploader-irys --- packages/{umi-uploader-bundlr => umi-uploader-irys}/CHANGELOG.md | 0 packages/{umi-uploader-bundlr => umi-uploader-irys}/README.md | 0 .../{umi-uploader-bundlr => umi-uploader-irys}/babel.config.json | 0 packages/{umi-uploader-bundlr => umi-uploader-irys}/package.json | 0 .../{umi-uploader-bundlr => umi-uploader-irys}/rollup.config.js | 0 .../src/createBundlrUploader.ts | 0 packages/{umi-uploader-bundlr => umi-uploader-irys}/src/errors.ts | 0 packages/{umi-uploader-bundlr => umi-uploader-irys}/src/index.ts | 0 packages/{umi-uploader-bundlr => umi-uploader-irys}/src/plugin.ts | 0 .../test/BundlrUploader.test.ts | 0 .../test/modules/cjs.test.cjs | 0 .../test/modules/esm.test.mjs | 0 .../{umi-uploader-bundlr => umi-uploader-irys}/test/tsconfig.json | 0 packages/{umi-uploader-bundlr => umi-uploader-irys}/tsconfig.json | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/CHANGELOG.md (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/README.md (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/babel.config.json (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/package.json (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/rollup.config.js (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/src/createBundlrUploader.ts (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/src/errors.ts (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/src/index.ts (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/src/plugin.ts (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/test/BundlrUploader.test.ts (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/test/modules/cjs.test.cjs (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/test/modules/esm.test.mjs (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/test/tsconfig.json (100%) rename packages/{umi-uploader-bundlr => umi-uploader-irys}/tsconfig.json (100%) diff --git a/packages/umi-uploader-bundlr/CHANGELOG.md b/packages/umi-uploader-irys/CHANGELOG.md similarity index 100% rename from packages/umi-uploader-bundlr/CHANGELOG.md rename to packages/umi-uploader-irys/CHANGELOG.md diff --git a/packages/umi-uploader-bundlr/README.md b/packages/umi-uploader-irys/README.md similarity index 100% rename from packages/umi-uploader-bundlr/README.md rename to packages/umi-uploader-irys/README.md diff --git a/packages/umi-uploader-bundlr/babel.config.json b/packages/umi-uploader-irys/babel.config.json similarity index 100% rename from packages/umi-uploader-bundlr/babel.config.json rename to packages/umi-uploader-irys/babel.config.json diff --git a/packages/umi-uploader-bundlr/package.json b/packages/umi-uploader-irys/package.json similarity index 100% rename from packages/umi-uploader-bundlr/package.json rename to packages/umi-uploader-irys/package.json diff --git a/packages/umi-uploader-bundlr/rollup.config.js b/packages/umi-uploader-irys/rollup.config.js similarity index 100% rename from packages/umi-uploader-bundlr/rollup.config.js rename to packages/umi-uploader-irys/rollup.config.js diff --git a/packages/umi-uploader-bundlr/src/createBundlrUploader.ts b/packages/umi-uploader-irys/src/createBundlrUploader.ts similarity index 100% rename from packages/umi-uploader-bundlr/src/createBundlrUploader.ts rename to packages/umi-uploader-irys/src/createBundlrUploader.ts diff --git a/packages/umi-uploader-bundlr/src/errors.ts b/packages/umi-uploader-irys/src/errors.ts similarity index 100% rename from packages/umi-uploader-bundlr/src/errors.ts rename to packages/umi-uploader-irys/src/errors.ts diff --git a/packages/umi-uploader-bundlr/src/index.ts b/packages/umi-uploader-irys/src/index.ts similarity index 100% rename from packages/umi-uploader-bundlr/src/index.ts rename to packages/umi-uploader-irys/src/index.ts diff --git a/packages/umi-uploader-bundlr/src/plugin.ts b/packages/umi-uploader-irys/src/plugin.ts similarity index 100% rename from packages/umi-uploader-bundlr/src/plugin.ts rename to packages/umi-uploader-irys/src/plugin.ts diff --git a/packages/umi-uploader-bundlr/test/BundlrUploader.test.ts b/packages/umi-uploader-irys/test/BundlrUploader.test.ts similarity index 100% rename from packages/umi-uploader-bundlr/test/BundlrUploader.test.ts rename to packages/umi-uploader-irys/test/BundlrUploader.test.ts diff --git a/packages/umi-uploader-bundlr/test/modules/cjs.test.cjs b/packages/umi-uploader-irys/test/modules/cjs.test.cjs similarity index 100% rename from packages/umi-uploader-bundlr/test/modules/cjs.test.cjs rename to packages/umi-uploader-irys/test/modules/cjs.test.cjs diff --git a/packages/umi-uploader-bundlr/test/modules/esm.test.mjs b/packages/umi-uploader-irys/test/modules/esm.test.mjs similarity index 100% rename from packages/umi-uploader-bundlr/test/modules/esm.test.mjs rename to packages/umi-uploader-irys/test/modules/esm.test.mjs diff --git a/packages/umi-uploader-bundlr/test/tsconfig.json b/packages/umi-uploader-irys/test/tsconfig.json similarity index 100% rename from packages/umi-uploader-bundlr/test/tsconfig.json rename to packages/umi-uploader-irys/test/tsconfig.json diff --git a/packages/umi-uploader-bundlr/tsconfig.json b/packages/umi-uploader-irys/tsconfig.json similarity index 100% rename from packages/umi-uploader-bundlr/tsconfig.json rename to packages/umi-uploader-irys/tsconfig.json From 4d341134dd142042ca3fb684d1bf7d1a27a2022a Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Wed, 4 Oct 2023 20:50:42 +0000 Subject: [PATCH 2/7] feat: :sparkles: Transition umi-uploader-bundlr to umi-uploader-irys --- docs/implementations.md | 2 +- packages/umi-uploader-irys/CHANGELOG.md | 2 +- packages/umi-uploader-irys/README.md | 6 +- packages/umi-uploader-irys/package.json | 10 +- ...undlrUploader.ts => createIrysUploader.ts} | 149 ++--- packages/umi-uploader-irys/src/errors.ts | 34 +- packages/umi-uploader-irys/src/index.ts | 2 +- packages/umi-uploader-irys/src/plugin.ts | 10 +- ...rUploader.test.ts => IrysUploader.test.ts} | 10 +- .../test/modules/cjs.test.cjs | 20 +- .../test/modules/esm.test.mjs | 20 +- pnpm-lock.yaml | 524 ++++++++++-------- 12 files changed, 436 insertions(+), 353 deletions(-) rename packages/umi-uploader-irys/src/{createBundlrUploader.ts => createIrysUploader.ts} (71%) rename packages/umi-uploader-irys/test/{BundlrUploader.test.ts => IrysUploader.test.ts} (85%) diff --git a/docs/implementations.md b/docs/implementations.md index de8e39cb..93372672 100644 --- a/docs/implementations.md +++ b/docs/implementations.md @@ -41,7 +41,7 @@ The page aims to list all the available implementations of [the interfaces defin | Description | Maintainer | Links | | --- | --- | --- | | Uses AWS | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-uploader-aws) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-uploader-aws) | -| Uses Bundlr Network | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-uploader-bundlr) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-uploader-bundlr) | +| Uses Irys.xyz | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-uploader-irys) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-uploader-irys) | | Uses NFT.Storage | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-uploader-nft-storage) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-uploader-nft-storage) | | Uses a local cache to mock uploads and downloads | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-storage-mock) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-storage-mock) | diff --git a/packages/umi-uploader-irys/CHANGELOG.md b/packages/umi-uploader-irys/CHANGELOG.md index 1257628d..e6bd8864 100644 --- a/packages/umi-uploader-irys/CHANGELOG.md +++ b/packages/umi-uploader-irys/CHANGELOG.md @@ -1,4 +1,4 @@ -# @metaplex-foundation/umi-uploader-bundlr +# @metaplex-foundation/umi-uploader-irys ## 0.8.9 diff --git a/packages/umi-uploader-irys/README.md b/packages/umi-uploader-irys/README.md index a3c3859a..c0616c6a 100644 --- a/packages/umi-uploader-irys/README.md +++ b/packages/umi-uploader-irys/README.md @@ -1,9 +1,9 @@ -# umi-uploader-bundlr +# umi-uploader-irys -An uploader implementation relying on Bundlr. +An uploader implementation relying on Irys. ## Installation ```sh -npm install @metaplex-foundation/umi-uploader-bundlr +npm install @metaplex-foundation/umi-uploader-irys ``` diff --git a/packages/umi-uploader-irys/package.json b/packages/umi-uploader-irys/package.json index aad52cf6..6360b7c3 100644 --- a/packages/umi-uploader-irys/package.json +++ b/packages/umi-uploader-irys/package.json @@ -1,7 +1,7 @@ { - "name": "@metaplex-foundation/umi-uploader-bundlr", + "name": "@metaplex-foundation/umi-uploader-irys", "version": "0.8.9", - "description": "An uploader implementation relying on Bundlr", + "description": "An uploader implementation relying on Irys", "license": "MIT", "sideEffects": false, "module": "dist/esm/index.mjs", @@ -28,7 +28,7 @@ "test": "ava" }, "dependencies": { - "@bundlr-network/client": "^0.8.8", + "@irys/sdk": "^0.0.2", "@metaplex-foundation/umi-web3js-adapters": "workspace:^", "bignumber.js": "^9.0.2", "buffer": "^6.0.3" @@ -58,7 +58,7 @@ "typedoc": { "entryPoint": "./src/index.ts", "readmeFile": "./README.md", - "displayName": "umi-uploader-bundlr" + "displayName": "umi-uploader-irys" }, "ava": { "typescript": { @@ -69,4 +69,4 @@ } } } -} +} \ No newline at end of file diff --git a/packages/umi-uploader-irys/src/createBundlrUploader.ts b/packages/umi-uploader-irys/src/createIrysUploader.ts similarity index 71% rename from packages/umi-uploader-irys/src/createBundlrUploader.ts rename to packages/umi-uploader-irys/src/createIrysUploader.ts index d1d40a48..a3a790f8 100644 --- a/packages/umi-uploader-irys/src/createBundlrUploader.ts +++ b/packages/umi-uploader-irys/src/createIrysUploader.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line import/no-named-default -import type { default as NodeBundlr, WebBundlr } from '@bundlr-network/client'; +import type { default as NodeIrys, WebIrys } from '@irys/sdk'; import { Commitment, Context, @@ -36,34 +36,34 @@ import BigNumber from 'bignumber.js'; import { Buffer } from 'buffer'; import { AssetUploadFailedError, - BundlrWithdrawError, - FailedToConnectToBundlrAddressError, - FailedToInitializeBundlrError, + IrysWithdrawError, + FailedToConnectToIrysAddressError, + FailedToInitializeIrysError, } from './errors'; /** - * This method is necessary to import the Bundlr package on both ESM and CJS modules. + * This method is necessary to import the Irys package on both ESM and CJS modules. * Without this, we get a different structure on each module: - * - CJS: { default: [Getter], WebBundlr: [Getter] } - * - ESM: { default: { default: [Getter], WebBundlr: [Getter] } } + * - CJS: { default: [Getter], WebIrys: [Getter] } + * - ESM: { default: { default: [Getter], WebIrys: [Getter] } } * This method fixes this by ensure there is not double default in the imported package. */ // eslint-disable-next-line @typescript-eslint/naming-convention -function _removeDoubleDefault(pkg: any) { +function _removeDoubleDefault(pkg: T): T { if ( pkg && typeof pkg === 'object' && 'default' in pkg && - 'default' in pkg.default + 'default' in (pkg as any).default ) { - return pkg.default; + return (pkg as any).default; } return pkg; } -export type BundlrUploader = UploaderInterface & { - bundlr: () => Promise; +export type IrysUploader = UploaderInterface & { + irys: () => Promise; getUploadPriceFromBytes: (bytes: number) => Promise; getBalance: () => Promise; fund: (amount: SolAmount, skipBalanceCheck: boolean) => Promise; @@ -71,7 +71,7 @@ export type BundlrUploader = UploaderInterface & { withdraw: (amount: SolAmount) => Promise; }; -export type BundlrUploaderOptions = { +export type IrysUploaderOptions = { address?: string; timeout?: number; providerUrl?: string; @@ -79,7 +79,7 @@ export type BundlrUploaderOptions = { payer?: Signer; }; -export type BundlrWalletAdapter = { +export type IrysWalletAdapter = { publicKey: Web3JsPublicKey | null; signMessage?: (message: Uint8Array) => Promise; signTransaction?: ( @@ -95,26 +95,26 @@ 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 function createBundlrUploader( +export function createIrysUploader( context: Pick, - options: BundlrUploaderOptions = {} -): BundlrUploader { + options: IrysUploaderOptions = {} +): IrysUploader { // eslint-disable-next-line @typescript-eslint/naming-convention - let _bundlr: WebBundlr | NodeBundlr | null = null; + let _irys: WebIrys | NodeIrys | null = null; options = { providerUrl: context.rpc.getEndpoint(), ...options, }; const getUploadPriceFromBytes = async (bytes: number): Promise => { - const bundlr = await getBundlr(); - const price = await bundlr.getPrice(bytes); + const irys = await getIrys(); + const price = await irys.getPrice(bytes); return bigNumberToAmount( price.multipliedBy(options.priceMultiplier ?? 1.1) @@ -132,15 +132,17 @@ export function createBundlrUploader( }; const upload = async (files: GenericFile[]): Promise => { - const bundlr = await getBundlr(); + const irys = await getIrys(); const amount = await getUploadPrice(files); await fund(amount); const promises = files.map(async (file) => { const buffer = Buffer.from(file.buffer); - const { status, data } = await bundlr.uploader.upload(buffer, { - tags: getGenericFileTagsWithContentType(file), - }); + const irysTx = irys.createTransaction(buffer, { tags: getGenericFileTagsWithContentType(file)}) + await irysTx.sign() + + const { status, data } = await irys.uploader.uploadTransaction(irysTx); + if (status >= 300) { throw new AssetUploadFailedError(status); @@ -159,8 +161,8 @@ export function createBundlrUploader( }; const getBalance = async (): Promise => { - const bundlr = await getBundlr(); - const balance = await bundlr.getLoadedBalance(); + const irys = await getIrys(); + const balance = await irys.getLoadedBalance(); return bigNumberToAmount(balance); }; @@ -169,11 +171,11 @@ export function createBundlrUploader( amount: SolAmount, skipBalanceCheck = false ): Promise => { - const bundlr = await getBundlr(); + const irys = await getIrys(); let toFund = amountToBigNumber(amount); if (!skipBalanceCheck) { - const balance = await bundlr.getLoadedBalance(); + const balance = await irys.getLoadedBalance(); toFund = toFund.isGreaterThan(balance) ? toFund.minus(balance) @@ -184,13 +186,13 @@ export function createBundlrUploader( return; } - await bundlr.fund(toFund); + await irys.fund(toFund); }; const withdrawAll = async (): Promise => { - // TODO(loris): Replace with "withdrawAll" when available on Bundlr. - const bundlr = await getBundlr(); - const balance = await bundlr.getLoadedBalance(); + // TODO(loris): Replace with "withdrawAll" when available on Irys. + const irys = await getIrys(); + const balance = await irys.getLoadedBalance(); const minimumBalance = new BigNumber(5000); if (balance.isLessThan(minimumBalance)) { @@ -202,88 +204,87 @@ export function createBundlrUploader( }; const withdraw = async (amount: SolAmount): Promise => { - const bundlr = await getBundlr(); - - const { status } = await bundlr.withdrawBalance(amountToBigNumber(amount)); - - if (status >= 300) { - throw new BundlrWithdrawError(status); + const irys = await getIrys(); + try{ + await irys.withdrawBalance(amountToBigNumber(amount)); + }catch(e: any){ + throw new IrysWithdrawError( (e instanceof Error) ? e.message : e.toString()); } }; - const getBundlr = async (): Promise => { - const oldPayer = _bundlr?.getSigner().publicKey; + const getIrys = async (): Promise => { + const oldPayer = _irys?.getSigner().publicKey; const newPayer = options.payer ?? context.payer; if ( oldPayer && publicKey(new Uint8Array(oldPayer)) !== newPayer.publicKey ) { - _bundlr = null; + _irys = null; } - if (!_bundlr) { - _bundlr = await initBundlr(); + if (!_irys) { + _irys = await initIrys(); } - return _bundlr; + return _irys; }; - const initBundlr = async (): Promise => { + const initIrys = async (): Promise => { const currency = 'solana'; const defaultAddress = context.rpc.getCluster() === 'devnet' - ? 'https://devnet.bundlr.network' - : 'https://node1.bundlr.network'; + ? 'https://devnet.irys.xyz' + : 'https://node1.irys.xyz'; const address = options?.address ?? defaultAddress; - const bundlrOptions = { + const irysOptions = { timeout: options.timeout, providerUrl: options.providerUrl, }; const payer: Signer = options.payer ?? context.payer; - // If in node use node bundlr, else use web bundlr. + // If in node use node irys, else use web irys. const isNode = // eslint-disable-next-line no-prototype-builtins typeof window === 'undefined' || window.process?.hasOwnProperty('type'); - let bundlr; + let irys; if (isNode && isKeypairSigner(payer)) - bundlr = await initNodeBundlr(address, currency, payer, bundlrOptions); + irys = await initNodeIrys(address, currency, payer, irysOptions); else { - bundlr = await initWebBundlr(address, currency, payer, bundlrOptions); + irys = await initWebIrys(address, currency, payer, irysOptions); } 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; }; - const initNodeBundlr = async ( + const initNodeIrys = async ( address: string, currency: string, keypair: Keypair, options: any - ): Promise => { + ): Promise => { const bPackage = _removeDoubleDefault( - await import('@bundlr-network/client') + await import('@irys/sdk') ); // eslint-disable-next-line new-cap - return new bPackage.default(address, currency, keypair.secretKey, options); + return new bPackage.default({url: address, token: currency, key: keypair.secretKey, config: options}); }; - const initWebBundlr = async ( + const initWebIrys = async ( address: string, currency: string, payer: Signer, options: any - ): Promise => { - const wallet: BundlrWalletAdapter = { + ): Promise => { + const wallet: IrysWalletAdapter = { publicKey: toWeb3JsPublicKey(payer.publicKey), signMessage: (message: Uint8Array) => payer.signMessage(message), signTransaction: async (web3JsTransaction: Web3JsTransaction) => @@ -329,18 +330,18 @@ export function createBundlrUploader( }; 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; }; return { @@ -352,14 +353,14 @@ export function createBundlrUploader( fund, withdrawAll, withdraw, - bundlr: getBundlr, + irys: getIrys, }; } -export const isBundlrUploader = ( +export const isIrysUploader = ( uploader: UploaderInterface -): uploader is BundlrUploader => - 'bundlr' in uploader && +): uploader is IrysUploader => + 'irys' in uploader && 'getBalance' in uploader && 'fund' in uploader && 'withdrawAll' in uploader; diff --git a/packages/umi-uploader-irys/src/errors.ts b/packages/umi-uploader-irys/src/errors.ts index 6fa63729..713e5218 100644 --- a/packages/umi-uploader-irys/src/errors.ts +++ b/packages/umi-uploader-irys/src/errors.ts @@ -1,54 +1,54 @@ import { UmiError } from '@metaplex-foundation/umi'; -export class BundlrError extends UmiError { - readonly name: string = 'BundlrError'; +export class IrysError extends UmiError { + readonly name: string = 'IrysError'; constructor(message: string, cause?: Error) { - super(message, 'plugin', 'Bundlr', cause); + super(message, 'plugin', 'Irys', cause); } } -export class FailedToInitializeBundlrError extends BundlrError { - readonly name: string = 'FailedToInitializeBundlrError'; +export class FailedToInitializeIrysError extends IrysError { + readonly name: string = 'FailedToInitializeIrysError'; constructor(cause: Error) { const message = - 'Bundlr could not be initialized. ' + + 'Irys could not be initialized. ' + 'Please check the underlying error below for more details.'; super(message, cause); } } -export class FailedToConnectToBundlrAddressError extends BundlrError { - readonly name: string = 'FailedToConnectToBundlrAddressError'; +export class FailedToConnectToIrysAddressError extends IrysError { + readonly name: string = 'FailedToConnectToIrysAddressError'; constructor(address: string, cause: Error) { const message = - `Bundlr could not connect to the provided address [${address}]. ` + + `Irys 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'; + '"https://node1.irys.xyz" for mainnet and "https://devnet.irys.xyz" for devnet'; super(message, cause); } } -export class AssetUploadFailedError extends BundlrError { +export class AssetUploadFailedError extends IrysError { readonly name: string = 'AssetUploadFailedError'; constructor(status: number) { const message = - `The asset could not be uploaded to the Bundlr network and ` + + `The asset could not be uploaded to the Irys network and ` + `returned the following status code [${status}].`; super(message); } } -export class BundlrWithdrawError extends BundlrError { - readonly name: string = 'BundlrWithdrawError'; +export class IrysWithdrawError extends IrysError { + readonly name: string = 'IrysWithdrawError'; - constructor(status: number) { + constructor(error: string) { const message = - `The balance could not be withdrawn from the Bundlr network and ` + - `returned the following status code [${status}].`; + `The balance could not be withdrawn from the Irys network and ` + + `returned the following error: ${error}.`; super(message); } } diff --git a/packages/umi-uploader-irys/src/index.ts b/packages/umi-uploader-irys/src/index.ts index e61cc02f..0f1fca39 100644 --- a/packages/umi-uploader-irys/src/index.ts +++ b/packages/umi-uploader-irys/src/index.ts @@ -1,3 +1,3 @@ -export * from './createBundlrUploader'; +export * from './createIrysUploader'; export * from './errors'; export * from './plugin'; diff --git a/packages/umi-uploader-irys/src/plugin.ts b/packages/umi-uploader-irys/src/plugin.ts index 683c2394..f5f0cbd1 100644 --- a/packages/umi-uploader-irys/src/plugin.ts +++ b/packages/umi-uploader-irys/src/plugin.ts @@ -1,11 +1,11 @@ import type { UmiPlugin } from '@metaplex-foundation/umi'; import { - BundlrUploaderOptions, - createBundlrUploader, -} from './createBundlrUploader'; + IrysUploaderOptions, + createIrysUploader, +} from './createIrysUploader'; -export const bundlrUploader = (options?: BundlrUploaderOptions): UmiPlugin => ({ +export const irysUploader = (options?: IrysUploaderOptions): UmiPlugin => ({ install(umi) { - umi.uploader = createBundlrUploader(umi, options); + umi.uploader = createIrysUploader(umi, options); }, }); diff --git a/packages/umi-uploader-irys/test/BundlrUploader.test.ts b/packages/umi-uploader-irys/test/IrysUploader.test.ts similarity index 85% rename from packages/umi-uploader-irys/test/BundlrUploader.test.ts rename to packages/umi-uploader-irys/test/IrysUploader.test.ts index 79c8f959..7931c579 100644 --- a/packages/umi-uploader-irys/test/BundlrUploader.test.ts +++ b/packages/umi-uploader-irys/test/IrysUploader.test.ts @@ -11,16 +11,16 @@ import { web3JsEddsa } from '@metaplex-foundation/umi-eddsa-web3js'; import { fetchHttp } from '@metaplex-foundation/umi-http-fetch'; import { web3JsRpc } from '@metaplex-foundation/umi-rpc-web3js'; import test from 'ava'; -import { bundlrUploader, BundlrUploaderOptions } from '../src'; +import { irysUploader, IrysUploaderOptions } from '../src'; test('example test', async (t) => { - t.is(typeof bundlrUploader, 'function'); + t.is(typeof irysUploader, 'function'); }); -// TODO(loris): Unskip these tests when we can mock the Bundlr API. +// TODO(loris): Unskip these tests when we can mock the Irys API. const getContext = async ( - options?: BundlrUploaderOptions + options?: IrysUploaderOptions ): Promise => { const context = createUmi().use({ install(umi) { @@ -28,7 +28,7 @@ const getContext = async ( umi.use(web3JsEddsa()); umi.use(fetchHttp()); umi.use(httpDownloader()); - umi.use(bundlrUploader(options)); + umi.use(irysUploader(options)); umi.use(generatedSignerIdentity()); }, }); diff --git a/packages/umi-uploader-irys/test/modules/cjs.test.cjs b/packages/umi-uploader-irys/test/modules/cjs.test.cjs index e936fcfd..8d661ce7 100644 --- a/packages/umi-uploader-irys/test/modules/cjs.test.cjs +++ b/packages/umi-uploader-irys/test/modules/cjs.test.cjs @@ -11,20 +11,20 @@ const exported = require('../../dist/cjs/index.cjs'); test('it successfully exports commonjs named exports', (t) => { const exportedKeys = Object.keys(exported); - t.true(exportedKeys.includes('createBundlrUploader')); + t.true(exportedKeys.includes('createIrysUploader')); }); -test('it can import the Bundlr client', async (t) => { - const { createBundlrUploader } = exported; +test('it can import the Irys client', async (t) => { + const { createIrysUploader } = exported; const context = createUmi() .use(web3JsRpc('http://localhost:8899')) .use(web3JsEddsa()) .use(generatedSignerIdentity()); - const bundlrUploader = createBundlrUploader(context); - const bundlr = await bundlrUploader.bundlr(); - t.true(typeof bundlr === 'object', 'Bundlr is an object'); - t.true('uploader' in bundlr, 'Bundlr can upload'); - t.true('getLoadedBalance' in bundlr, 'Bundlr can get the loaded balance'); - t.true('fund' in bundlr, 'Bundlr can fund'); - t.true('withdrawBalance' in bundlr, 'Bundlr can withdraw'); + const irysUploader = createIrysUploader(context); + const irys = await irysUploader.irys(); + t.true(typeof irys === 'object', 'Irys is an object'); + t.true('uploader' in irys, 'Irys can upload'); + t.true('getLoadedBalance' in irys, 'Irys can get the loaded balance'); + t.true('fund' in irys, 'Irys can fund'); + t.true('withdrawBalance' in irys, 'Irys can withdraw'); }); diff --git a/packages/umi-uploader-irys/test/modules/esm.test.mjs b/packages/umi-uploader-irys/test/modules/esm.test.mjs index d83bc185..7151ffb1 100644 --- a/packages/umi-uploader-irys/test/modules/esm.test.mjs +++ b/packages/umi-uploader-irys/test/modules/esm.test.mjs @@ -9,20 +9,20 @@ import * as exported from '../../dist/esm/index.mjs'; test('it successfully exports esm named exports', (t) => { const exportedKeys = Object.keys(exported); - t.true(exportedKeys.includes('createBundlrUploader')); + t.true(exportedKeys.includes('createIrysUploader')); }); -test('it can import the Bundlr client', async (t) => { - const { createBundlrUploader } = exported; +test('it can import the Irys client', async (t) => { + const { createIrysUploader } = exported; const context = createUmi() .use(web3JsRpc('http://localhost:8899')) .use(web3JsEddsa()) .use(generatedSignerIdentity()); - const bundlrUploader = createBundlrUploader(context); - const bundlr = await bundlrUploader.bundlr(); - t.true(typeof bundlr === 'object', 'Bundlr is an object'); - t.true('uploader' in bundlr, 'Bundlr can upload'); - t.true('getLoadedBalance' in bundlr, 'Bundlr can get the loaded balance'); - t.true('fund' in bundlr, 'Bundlr can fund'); - t.true('withdrawBalance' in bundlr, 'Bundlr can withdraw'); + const irysUploader = createIrysUploader(context); + const irys = await irysUploader.irys(); + t.true(typeof irys === 'object', 'Irys is an object'); + t.true('uploader' in irys, 'Irys can upload'); + t.true('getLoadedBalance' in irys, 'Irys can get the loaded balance'); + t.true('fund' in irys, 'Irys can fund'); + t.true('withdrawBalance' in irys, 'Irys can withdraw'); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30f721f5..ec2e3f5b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + patchedDependencies: '@changesets/assemble-release-plan@5.2.3': hash: psjonfb234vefryc6hzdzm5ple @@ -526,11 +530,11 @@ importers: specifier: ^13.0.1 version: 13.0.2 - packages/umi-uploader-bundlr: + packages/umi-uploader-irys: dependencies: - '@bundlr-network/client': - specifier: ^0.8.8 - version: 0.8.9 + '@irys/sdk': + specifier: ^0.0.2 + version: 0.0.2(arweave@1.12.4) '@metaplex-foundation/umi-web3js-adapters': specifier: workspace:^ version: link:../umi-web3js-adapters @@ -2945,37 +2949,6 @@ packages: to-fast-properties: 2.0.0 dev: true - /@bundlr-network/client@0.8.9: - resolution: {integrity: sha512-SJ7BAt/KhONeFQ0+nbqrw2DUWrsev6y6cmlXt+3x7fPCkw7OJwudtxV/h2nBteZd65NXjqw8yzkmLiLfZ7CCRA==} - hasBin: true - dependencies: - '@solana/wallet-adapter-base': 0.9.20(@solana/web3.js@1.72.0) - '@solana/web3.js': 1.72.0 - '@supercharge/promise-pool': 2.3.2 - algosdk: 1.24.1 - arbundles: 0.6.22(@solana/web3.js@1.72.0) - arweave: 1.12.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.6 - 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 - - supports-color - - utf-8-validate - dev: false - /@changesets/apply-release-plan@6.1.3: resolution: {integrity: sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==} dependencies: @@ -3668,17 +3641,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: @@ -3701,14 +3663,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: @@ -3811,6 +3765,67 @@ packages: multiformats: 9.9.0 dev: false + /@irys/arweave@0.0.2: + resolution: {integrity: sha512-ddE5h4qXbl0xfGlxrtBIwzflaxZUDlDs43TuT0u1OMfyobHul4AA1VEX72Rpzw2bOh4vzoytSqA1jCM7x9YtHg==} + dependencies: + asn1.js: 5.4.1 + async-retry: 1.3.3 + axios: 1.5.1 + base64-js: 1.5.1 + bignumber.js: 9.1.1 + transitivePeerDependencies: + - debug + dev: false + + /@irys/query@0.0.1: + resolution: {integrity: sha512-7TCyR+Qn+F54IQQx5PlERgqNwgIQik8hY55iZl/silTHhCo1MI2pvx5BozqPUVCc8/KqRsc2nZd8Bc29XGUjRQ==} + engines: {node: '>=16.10.0'} + dependencies: + async-retry: 1.3.3 + axios: 1.5.1 + transitivePeerDependencies: + - debug + dev: false + + /@irys/sdk@0.0.2(arweave@1.12.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 + '@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.72.0 + '@supercharge/promise-pool': 3.1.0 + algosdk: 1.24.1 + aptos: 1.8.5 + arbundles: 0.10.0(arweave@1.12.4) + async-retry: 1.3.3 + axios: 1.5.1 + 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 + - supports-color + - utf-8-validate + dev: false + /@jridgewell/gen-mapping@0.1.1: resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} engines: {node: '>=6.0.0'} @@ -3987,6 +4002,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.9 + 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.9)(typescript@4.9.5): resolution: {integrity: sha512-ffT/cZv1GWXDVrwzNUGGxApDwQJSxUZJAqnPpTk5VBc55T2RtUm2yZ11p74h2fyam1erJH38zg7S9IoaTxSZ8w==} dependencies: @@ -4026,6 +4165,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.2.0: resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} @@ -4125,13 +4268,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 /@remix-run/dev@1.12.0: resolution: {integrity: sha512-lBiA2FlDi+DjpOAE/vn93zFTSxudKag/FGpmbV6O+LQItDCpFARfbBMhTck/uKcc95nyhRd1GGhQ4ZDgQnyjaQ==} @@ -4349,6 +4496,17 @@ packages: picomatch: 2.3.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.3 + '@scure/base': 1.1.3 + dev: false + /@sideway/address@4.1.4: resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==} dependencies: @@ -4451,16 +4609,6 @@ packages: - utf-8-validate dev: true - /@solana/wallet-adapter-base@0.9.20(@solana/web3.js@1.72.0): - resolution: {integrity: sha512-ZvnhJ4EJk61oyuBH/a9tMpUfeWQ3g3Cc0Nzl1NzE4SdqEhiNoEW8HXDig9HMemZ9bIEUxIpPWxp+SwjVl0u+rg==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.58.0 - dependencies: - '@solana/web3.js': 1.72.0 - eventemitter3: 4.0.7 - dev: false - /@solana/web3.js@1.72.0: resolution: {integrity: sha512-xMoCk0y/GpiQhHbRjMcrd5NpmkwhAA0c01id7lrr6nhNdz6Uc/CywPdBeZw3Qz6BVZ/qlUoerpKPWeiXqMUjwA==} engines: {node: '>=12.20.0'} @@ -4487,8 +4635,8 @@ packages: - supports-color - 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 @@ -5388,27 +5536,42 @@ packages: resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} dev: true - /arbundles@0.6.22(@solana/web3.js@1.72.0): - resolution: {integrity: sha512-QlSavBHk59mNqgQ6ScxlqaBJlDbSmSrK/uTcF3HojLAZ/4aufTkVTBjl1hSfZ/ZN45oIPgJC05R8SmVARF+8VA==} + /aptos@1.8.5: + 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 + form-data: 4.0.0 + tweetnacl: 1.0.3 + transitivePeerDependencies: + - debug + dev: false + + /arbundles@0.10.0(arweave@1.12.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 '@noble/ed25519': 1.7.1 - '@randlabs/myalgo-connect': 1.4.2 - '@solana/wallet-adapter-base': 0.9.20(@solana/web3.js@1.72.0) - algosdk: 1.24.1 - arweave: 1.12.4 - arweave-stream-tx: 1.2.2(arweave@1.12.4) - 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.3 + secp256k1: 5.0.0 + optionalDependencies: + '@randlabs/myalgo-connect': 1.4.2 + algosdk: 1.24.1 + arweave-stream-tx: 1.2.2(arweave@1.12.4) 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 @@ -5420,6 +5583,7 @@ packages: dependencies: arweave: 1.12.4 dev: false + optional: true /are-we-there-yet@2.0.0: resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} @@ -5540,12 +5704,14 @@ packages: /arweave-stream-tx@1.2.2(arweave@1.12.4): resolution: {integrity: sha512-bNt9rj0hbAEzoUZEF2s6WJbIz8nasZlZpxIw03Xm8fzb9gRiiZlZGW3lxQLjfc9Z0VRUWDzwtqoYeEoB/JDToQ==} + requiresBuild: true peerDependencies: arweave: ^1.10.0 dependencies: arweave: 1.12.4 exponential-backoff: 3.1.0 dev: false + optional: true /arweave@1.12.4: resolution: {integrity: sha512-W5z7hb9/ZP2vy6BiYC+2obfGMhlhz/DaCkEXpkj/4hjaecWYUnvlUX5aCI2i0+lCrzbBUFbz+maDihUpBrdZpg==} @@ -5556,6 +5722,7 @@ packages: base64-js: 1.5.1 bignumber.js: 9.1.1 dev: false + optional: true /asn1.js@5.4.1: resolution: {integrity: sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==} @@ -5603,7 +5770,6 @@ packages: /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true /ava@5.1.0(@ava/typescript@3.0.1): resolution: {integrity: sha512-e5VFrSQ0WBPyZJWRXVrO7RFOizFeNM0t2PORwrPvWtApgkORI6cvGnY3GX1G+lzpd0HjqNx5Jus22AhxVnUMNA==} @@ -5676,6 +5842,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==} @@ -5683,6 +5850,26 @@ packages: follow-redirects: 1.15.2(debug@4.3.4) transitivePeerDependencies: - debug + dev: true + + /axios@0.27.2: + resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} + dependencies: + follow-redirects: 1.15.2(debug@4.3.4) + form-data: 4.0.0 + transitivePeerDependencies: + - debug + dev: false + + /axios@1.5.1: + resolution: {integrity: sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==} + 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-polyfill-corejs2@0.3.3(@babel/core@7.20.5): resolution: {integrity: sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==} @@ -5732,6 +5919,10 @@ packages: dependencies: safe-buffer: 5.2.1 + /base-x@4.0.0: + resolution: {integrity: sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==} + dev: false + /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -5849,10 +6040,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==} @@ -5876,14 +6063,6 @@ packages: - supports-color 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: @@ -5950,6 +6129,12 @@ packages: dependencies: base-x: 3.0.9 + /bs58@5.0.0: + resolution: {integrity: sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==} + dependencies: + base-x: 4.0.0 + dev: false + /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true @@ -6079,10 +6264,6 @@ packages: resolution: {integrity: sha512-AZ+9tFXw1sS0o0jcpJQIXvFTOB/xGiQ4OQ2t98QX3NDn2EZTSRBC801gxrsGgViuq2ak/NLkNgSNEPtCr5lfKg==} 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: @@ -6304,7 +6485,6 @@ packages: engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 - dev: true /comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} @@ -6539,27 +6719,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.4: - resolution: {integrity: sha512-f2E4NzkIX4bVIx5Ff2gKT1BlVwyFQ+2iFy+QrqgUXaFLUo7vSzN6XQ8LV5V/T/p/9g7mJdtYHKLkwG5PiG82fg==} - 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==} @@ -6569,17 +6734,6 @@ packages: csv-parse: 4.16.3 csv-stringify: 5.6.5 stream-transform: 2.1.3 - dev: true - - /csv@6.2.6: - resolution: {integrity: sha512-0grPtZ92uscXTGw52f/wARz66f5TrDy6nD5lG77idnH94sgOVmDiimHeLQTj7x9bkK0nmbWuHXywWluwG04xtA==} - engines: {node: '>= 0.1.90'} - dependencies: - csv-generate: 4.2.1 - csv-parse: 5.3.4 - csv-stringify: 6.2.3 - stream-transform: 3.2.1 - dev: false /currently-unhandled@0.4.1: resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} @@ -6757,7 +6911,6 @@ packages: /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} - dev: true /delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} @@ -7036,14 +7189,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 - /errorhandler@1.5.1: resolution: {integrity: sha512-rcOwbfvP1WTViVoUjcfZicVzjhjTuhSMntHh6mW3IrEiyE6mJyXvsToJUJGlGlw/2xU9P5whlWNGlIDVeCiT4A==} engines: {node: '>= 0.8'} @@ -7699,44 +7844,6 @@ packages: engines: {node: '>= 0.6'} dev: true - /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 - /eval@0.1.6: resolution: {integrity: sha512-o0XUw+5OGkXw4pJZzQoXUk+H87DHuC+7ZE//oSrRGtatTmr12oTnLfg6QOq9DyTt0c/p4TwzgmkKrBzWTSizyQ==} engines: {node: '>= 0.8'} @@ -7786,7 +7893,9 @@ packages: /exponential-backoff@3.1.0: resolution: {integrity: sha512-oBuz5SYz5zzyuHINoe9ooePwSu0xApKWgeNzok4hZ5YKXFh9zrQBEM15CXqoZkJJPuI2ArvqjPQd8UKJA753XA==} + requiresBuild: true dev: false + optional: true /express-urlrewrite@1.4.0: resolution: {integrity: sha512-PI5h8JuzoweS26vFizwQl6UTF25CAHSggNv0J25Dn/IKZscJHWZzPrI5z2Y2jgOzIaw2qh8l6+/jUcig23Z2SA==} @@ -8077,6 +8186,15 @@ packages: mime-types: 2.1.35 dev: true + /form-data@4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + /format@0.2.2: resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} engines: {node: '>=0.4.x'} @@ -10388,7 +10506,6 @@ packages: /mixme@0.5.4: resolution: {integrity: sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw==} engines: {node: '>= 8.0.0'} - dev: true /mkdirp-classic@0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} @@ -10486,10 +10603,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==} @@ -10533,24 +10652,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.9 - 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: @@ -10637,6 +10738,7 @@ packages: /node-addon-api@1.7.2: resolution: {integrity: sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==} + requiresBuild: true dev: true optional: true @@ -10644,6 +10746,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} @@ -10740,12 +10846,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'} @@ -11384,11 +11484,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 - /promise-inflight@1.0.1: resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} peerDependencies: @@ -11448,7 +11543,6 @@ packages: /proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true /ps-tree@1.2.0: resolution: {integrity: sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==} @@ -11947,13 +12041,13 @@ packages: lodash: 4.17.21 dev: true - /secp256k1@4.0.3: - resolution: {integrity: sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==} - engines: {node: '>=10.0.0'} + /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: 2.0.2 + node-addon-api: 5.1.0 node-gyp-build: 4.5.0 dev: false @@ -12367,11 +12461,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==} @@ -12630,9 +12719,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==} @@ -12643,9 +12734,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==} @@ -12965,10 +13058,6 @@ packages: engines: {node: '>=8'} dev: false - /u3@0.1.1: - resolution: {integrity: sha512-+J5D5ir763y+Am/QY6hXNRlwljIeRMZMGs0cT6qqZVVzzT3X3nFPXVyPOFRMOR4kupB0T8JnCdpWdp6Q/iXn3w==} - dev: false - /ufo@1.0.1: resolution: {integrity: sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==} dev: true @@ -13620,10 +13709,3 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} 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 From 0eb6d60ee564aeddc0a4614df54e5180b08667df Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Sat, 4 Nov 2023 20:04:14 +0000 Subject: [PATCH 3/7] feat: :truck: Restore umi-uploader-bundlr --- packages/umi-uploader-bundlr/CHANGELOG.md | 318 +++++++++++++++ packages/umi-uploader-bundlr/README.md | 9 + .../umi-uploader-bundlr/babel.config.json | 3 + packages/umi-uploader-bundlr/package.json | 72 ++++ packages/umi-uploader-bundlr/rollup.config.js | 16 + .../src/createBundlrUploader.ts | 381 ++++++++++++++++++ packages/umi-uploader-bundlr/src/errors.ts | 54 +++ packages/umi-uploader-bundlr/src/index.ts | 3 + packages/umi-uploader-bundlr/src/plugin.ts | 11 + .../test/BundlrUploader.test.ts | 55 +++ .../test/modules/cjs.test.cjs | 30 ++ .../test/modules/esm.test.mjs | 28 ++ .../umi-uploader-bundlr/test/tsconfig.json | 11 + packages/umi-uploader-bundlr/tsconfig.json | 8 + 14 files changed, 999 insertions(+) create mode 100644 packages/umi-uploader-bundlr/CHANGELOG.md create mode 100644 packages/umi-uploader-bundlr/README.md create mode 100644 packages/umi-uploader-bundlr/babel.config.json create mode 100644 packages/umi-uploader-bundlr/package.json create mode 100644 packages/umi-uploader-bundlr/rollup.config.js create mode 100644 packages/umi-uploader-bundlr/src/createBundlrUploader.ts create mode 100644 packages/umi-uploader-bundlr/src/errors.ts create mode 100644 packages/umi-uploader-bundlr/src/index.ts create mode 100644 packages/umi-uploader-bundlr/src/plugin.ts create mode 100644 packages/umi-uploader-bundlr/test/BundlrUploader.test.ts create mode 100644 packages/umi-uploader-bundlr/test/modules/cjs.test.cjs create mode 100644 packages/umi-uploader-bundlr/test/modules/esm.test.mjs create mode 100644 packages/umi-uploader-bundlr/test/tsconfig.json create mode 100644 packages/umi-uploader-bundlr/tsconfig.json diff --git a/packages/umi-uploader-bundlr/CHANGELOG.md b/packages/umi-uploader-bundlr/CHANGELOG.md new file mode 100644 index 00000000..1257628d --- /dev/null +++ b/packages/umi-uploader-bundlr/CHANGELOG.md @@ -0,0 +1,318 @@ +# @metaplex-foundation/umi-uploader-bundlr + +## 0.8.9 + +### Patch Changes + +- [#86](https://github.com/metaplex-foundation/umi/pull/86) [`05e4f9f`](https://github.com/metaplex-foundation/umi/commit/05e4f9ffa4e73d9db8442b26cd32577dc32075c2) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add types file to package.json exports + +- Updated dependencies [[`05e4f9f`](https://github.com/metaplex-foundation/umi/commit/05e4f9ffa4e73d9db8442b26cd32577dc32075c2)]: + - @metaplex-foundation/umi-web3js-adapters@0.8.9 + - @metaplex-foundation/umi@0.8.9 + +## 0.8.8 + +### Patch Changes + +- Updated dependencies []: + - @metaplex-foundation/umi@0.8.8 + - @metaplex-foundation/umi-web3js-adapters@0.8.8 + +## 0.8.7 + +### Patch Changes + +- Updated dependencies [[`7b675bc`](https://github.com/metaplex-foundation/umi/commit/7b675bc08b9442148282f35219cf8163545f160d)]: + - @metaplex-foundation/umi@0.8.7 + - @metaplex-foundation/umi-web3js-adapters@0.8.7 + +## 0.8.6 + +### Patch Changes + +- Updated dependencies [[`aba3519`](https://github.com/metaplex-foundation/umi/commit/aba35199c9f481b5aaf81f812ce945e07796a6aa)]: + - @metaplex-foundation/umi@0.8.6 + - @metaplex-foundation/umi-web3js-adapters@0.8.6 + +## 0.8.5 + +### Patch Changes + +- Updated dependencies []: + - @metaplex-foundation/umi@0.8.5 + - @metaplex-foundation/umi-web3js-adapters@0.8.5 + +## 0.8.4 + +### Patch Changes + +- Updated dependencies [[`d1e0c09`](https://github.com/metaplex-foundation/umi/commit/d1e0c09550bf07fe8bc0865f9732f025c3d8dafe), [`99bf51d`](https://github.com/metaplex-foundation/umi/commit/99bf51d6f58d7fe5b73d7678478ac8463c87d857)]: + - @metaplex-foundation/umi@0.8.4 + - @metaplex-foundation/umi-web3js-adapters@0.8.4 + +## 0.8.2 + +### Patch Changes + +- Updated dependencies [[`4accd34`](https://github.com/metaplex-foundation/umi/commit/4accd34f0a70d360321c42f395a2ad45cbadca16), [`4342375`](https://github.com/metaplex-foundation/umi/commit/43423750c9b351446b868ede57ecb634cebde42a), [`4342375`](https://github.com/metaplex-foundation/umi/commit/43423750c9b351446b868ede57ecb634cebde42a)]: + - @metaplex-foundation/umi@0.8.2 + - @metaplex-foundation/umi-web3js-adapters@0.8.2 + +## 0.8.1 + +### Patch Changes + +- Updated dependencies [[`bc11e6e`](https://github.com/metaplex-foundation/umi/commit/bc11e6e6f964594c75d04f78ef6c86a87aae6749)]: + - @metaplex-foundation/umi@0.8.1 + - @metaplex-foundation/umi-web3js-adapters@0.8.1 + +## 0.8.0 + +### Minor Changes + +- [#62](https://github.com/metaplex-foundation/umi/pull/62) [`15392cd`](https://github.com/metaplex-foundation/umi/commit/15392cd9a98d55750be09268c8ee93611d159e03) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Use PublicKeys as base58 strings. See `@metaplex-foundation/umi` changelog for more details. + +### Patch Changes + +- Updated dependencies [[`15392cd`](https://github.com/metaplex-foundation/umi/commit/15392cd9a98d55750be09268c8ee93611d159e03), [`15392cd`](https://github.com/metaplex-foundation/umi/commit/15392cd9a98d55750be09268c8ee93611d159e03)]: + - @metaplex-foundation/umi-web3js-adapters@0.8.0 + - @metaplex-foundation/umi@0.8.0 + +## 0.7.14 + +### Patch Changes + +- Updated dependencies [[`f530089`](https://github.com/metaplex-foundation/umi/commit/f5300891d0bad4b13431a11d87bfa35b6881ae56)]: + - @metaplex-foundation/umi@0.7.14 + - @metaplex-foundation/umi-web3js-adapters@0.7.14 + +## 0.7.13 + +### Patch Changes + +- Updated dependencies [[`6a33ea3`](https://github.com/metaplex-foundation/umi/commit/6a33ea32937f37cb34114582f2c365ac21c6d8e5), [`6a33ea3`](https://github.com/metaplex-foundation/umi/commit/6a33ea32937f37cb34114582f2c365ac21c6d8e5)]: + - @metaplex-foundation/umi@0.7.13 + - @metaplex-foundation/umi-web3js-adapters@0.7.13 + +## 0.7.12 + +### Patch Changes + +- Updated dependencies [[`3ce198a`](https://github.com/metaplex-foundation/umi/commit/3ce198a8c1eaf257dbd568053a032a601375eed2)]: + - @metaplex-foundation/umi-web3js-adapters@0.7.12 + +## 0.7.11 + +### Patch Changes + +- Updated dependencies [[`38c98dc`](https://github.com/metaplex-foundation/umi/commit/38c98dcc7c61ce212198381765b80fa695c51fa7)]: + - @metaplex-foundation/umi@0.7.11 + - @metaplex-foundation/umi-web3js-adapters@0.7.11 + +## 0.7.10 + +### Patch Changes + +- Updated dependencies [[`c1c1da6`](https://github.com/metaplex-foundation/umi/commit/c1c1da6bbed341492c3d81a4edc7aebb43471345), [`1139bcf`](https://github.com/metaplex-foundation/umi/commit/1139bcfedc541d6b89df2d61b10c4fdc169c4eee)]: + - @metaplex-foundation/umi@0.7.10 + - @metaplex-foundation/umi-web3js-adapters@0.7.10 + +## 0.7.7 + +### Patch Changes + +- Updated dependencies [[`bf9b550`](https://github.com/metaplex-foundation/umi/commit/bf9b550ae945f3963f2c96361b7d7ab38921c6a7)]: + - @metaplex-foundation/umi@0.7.7 + - @metaplex-foundation/umi-web3js-adapters@0.7.7 + +## 0.7.6 + +### Patch Changes + +- Updated dependencies [[`5b275d5`](https://github.com/metaplex-foundation/umi/commit/5b275d53680d66fcd77b1b09a30bf101036e22b3)]: + - @metaplex-foundation/umi@0.7.6 + - @metaplex-foundation/umi-web3js-adapters@0.7.6 + +## 0.7.5 + +### Patch Changes + +- Updated dependencies [[`670e7d4`](https://github.com/metaplex-foundation/umi/commit/670e7d4ba00e41802226ee7c722a116ef141891f)]: + - @metaplex-foundation/umi@0.7.5 + - @metaplex-foundation/umi-web3js-adapters@0.7.5 + +## 0.7.4 + +### Patch Changes + +- Updated dependencies [[`3718fae`](https://github.com/metaplex-foundation/umi/commit/3718faeafc28400313aa93f8e4db3945218ffb0b), [`00cb767`](https://github.com/metaplex-foundation/umi/commit/00cb7671976a63670bd71b70a06d5452b0761f62), [`f56fc59`](https://github.com/metaplex-foundation/umi/commit/f56fc59eee0deebf347e22a097c19aca1332a52a)]: + - @metaplex-foundation/umi@0.7.4 + - @metaplex-foundation/umi-web3js-adapters@0.7.4 + +## 0.7.2 + +### Patch Changes + +- Updated dependencies [[`2756a69`](https://github.com/metaplex-foundation/umi/commit/2756a693fb1d5d1a90608744ca73165b663cc729)]: + - @metaplex-foundation/umi@0.7.2 + - @metaplex-foundation/umi-web3js-adapters@0.7.2 + +## 0.7.0 + +### Minor Changes + +- [#34](https://github.com/metaplex-foundation/umi/pull/34) [`a963320`](https://github.com/metaplex-foundation/umi/commit/a9633202645a23b19c00ec973e93f5e5fda0776d) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Use functions instead of classes to implement interfaces + +### Patch Changes + +- Updated dependencies [[`a963320`](https://github.com/metaplex-foundation/umi/commit/a9633202645a23b19c00ec973e93f5e5fda0776d)]: + - @metaplex-foundation/umi@0.7.0 + - @metaplex-foundation/umi-web3js-adapters@0.7.0 + +## 0.6.0 + +### Patch Changes + +- Updated dependencies [[`b1e898f`](https://github.com/metaplex-foundation/umi/commit/b1e898fb8f78eb3b7acedd6b77dcdfd161164b00)]: + - @metaplex-foundation/umi@0.6.0 + - @metaplex-foundation/umi-web3js-adapters@0.6.0 + +## 0.5.3 + +### Patch Changes + +- Updated dependencies [[`c20d154`](https://github.com/metaplex-foundation/umi/commit/c20d15448537a93d7fe7a5f4765e0d3880ccc8cf), [`13acda9`](https://github.com/metaplex-foundation/umi/commit/13acda9d8c968716289e47b3e19b888f8ba11857)]: + - @metaplex-foundation/umi@0.5.3 + - @metaplex-foundation/umi-web3js-adapters@0.5.3 + +## 0.5.2 + +### Patch Changes + +- Updated dependencies [[`3db36d1`](https://github.com/metaplex-foundation/umi/commit/3db36d13e281a171f407e9652e2404d54c2971bd)]: + - @metaplex-foundation/umi@0.5.2 + - @metaplex-foundation/umi-web3js-adapters@0.5.2 + +## 0.5.1 + +### Patch Changes + +- [#24](https://github.com/metaplex-foundation/umi/pull/24) [`27276f4`](https://github.com/metaplex-foundation/umi/commit/27276f4ab5865bd55a5682990c5e48aa2d9b10cd) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Rename umi, umi-core and umi-test + +- Updated dependencies [[`27276f4`](https://github.com/metaplex-foundation/umi/commit/27276f4ab5865bd55a5682990c5e48aa2d9b10cd)]: + - @metaplex-foundation/umi@0.5.1 + - @metaplex-foundation/umi-web3js-adapters@0.5.1 + +## 0.4.1 + +### Patch Changes + +- Updated dependencies [[`807b469`](https://github.com/metaplex-foundation/umi/commit/807b4691ed843f6a4247317362d71b6457ad291d)]: + - @metaplex-foundation/umi-core@0.4.1 + - @metaplex-foundation/umi-web3js-adapters@0.4.1 + +## 0.4.0 + +### Patch Changes + +- Updated dependencies [[`d6ae534`](https://github.com/metaplex-foundation/umi/commit/d6ae5345ef4b8b8abca1cef04fd64e95f517e656), [`9f86429`](https://github.com/metaplex-foundation/umi/commit/9f8642945f000d84b07005bebe479be9a562db87), [`8d09519`](https://github.com/metaplex-foundation/umi/commit/8d0951983756a8c147ac3f4f95bb7cfc86294aa4), [`95586fa`](https://github.com/metaplex-foundation/umi/commit/95586fa4f06a356706ca2a8d29dd934cfff2395e)]: + - @metaplex-foundation/umi-core@0.4.0 + - @metaplex-foundation/umi-web3js-adapters@0.4.0 + +## 0.3.4 + +### Patch Changes + +- Updated dependencies [[`c93f1c4`](https://github.com/metaplex-foundation/umi/commit/c93f1c487d347fa27163d29a8caefd1d035e9052)]: + - @metaplex-foundation/umi-core@0.3.4 + - @metaplex-foundation/umi-web3js-adapters@0.3.4 + +## 0.3.3 + +### Patch Changes + +- Updated dependencies [[`422dc73`](https://github.com/metaplex-foundation/umi/commit/422dc73b5a5d84e89665ef69972a90cc947a20e5)]: + - @metaplex-foundation/umi-core@0.3.3 + - @metaplex-foundation/umi-web3js-adapters@0.3.3 + +## 0.3.2 + +### Patch Changes + +- Updated dependencies [[`66a7d91`](https://github.com/metaplex-foundation/umi/commit/66a7d919146ee348739438f7b0e33cc746d5d1ba)]: + - @metaplex-foundation/umi-core@0.3.2 + - @metaplex-foundation/umi-web3js-adapters@0.3.2 + +## 0.3.1 + +### Patch Changes + +- Updated dependencies [[`e566c1b`](https://github.com/metaplex-foundation/umi/commit/e566c1ba7232e1020234a750ec83607d50f60c56), [`acdc77a`](https://github.com/metaplex-foundation/umi/commit/acdc77af0f6c6e231b42b22e116497908043c57c)]: + - @metaplex-foundation/umi-core@0.3.1 + - @metaplex-foundation/umi-web3js-adapters@0.3.1 + +## 0.3.0 + +### Patch Changes + +- Updated dependencies [[`95d56e9`](https://github.com/metaplex-foundation/umi/commit/95d56e969b3da53e7b60758db4c530d206765697)]: + - @metaplex-foundation/umi-core@0.3.0 + - @metaplex-foundation/umi-web3js-adapters@0.3.0 + +## 0.2.3 + +### Patch Changes + +- Updated dependencies [[`697bddd`](https://github.com/metaplex-foundation/umi/commit/697bddd6cdd520bd1f9190eb9827c3f351512145)]: + - @metaplex-foundation/umi-core@0.2.3 + - @metaplex-foundation/umi-web3js-adapters@0.2.3 + +## 0.2.2 + +### Patch Changes + +- [`e1c9595`](https://github.com/metaplex-foundation/umi/commit/e1c9595dd7f0aeb4469e86a496bc25bbb43a1b5d) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Rename MetaplexError to UmiError + +- Updated dependencies [[`e1c9595`](https://github.com/metaplex-foundation/umi/commit/e1c9595dd7f0aeb4469e86a496bc25bbb43a1b5d)]: + - @metaplex-foundation/umi-core@0.2.2 + - @metaplex-foundation/umi-web3js-adapters@0.2.2 + +## 0.2.1 + +### Patch Changes + +- Updated dependencies [[`d28f4dc`](https://github.com/metaplex-foundation/umi/commit/d28f4dc05c45f35a429fa818e060aed648778718)]: + - @metaplex-foundation/umi-core@0.2.1 + - @metaplex-foundation/umi-web3js-adapters@0.2.1 + +## 0.2.0 + +### Minor Changes + +- [`b4d681f`](https://github.com/metaplex-foundation/umi/commit/b4d681fd173fb5cc6fe7907c610a23703695c4f6) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Rename Metaplex to Umi + +### Patch Changes + +- Updated dependencies [[`b4d681f`](https://github.com/metaplex-foundation/umi/commit/b4d681fd173fb5cc6fe7907c610a23703695c4f6)]: + - @metaplex-foundation/umi-core@0.2.0 + - @metaplex-foundation/umi-web3js-adapters@0.2.0 + +## 0.1.2 + +### Patch Changes + +- [`d3ee23a`](https://github.com/metaplex-foundation/umi/commit/d3ee23aa7ee19a4c6db0e3556e58ee4d12b8ab2b) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Ensure all packages are built before trying to publish + +- Updated dependencies [[`d3ee23a`](https://github.com/metaplex-foundation/umi/commit/d3ee23aa7ee19a4c6db0e3556e58ee4d12b8ab2b)]: + - @metaplex-foundation/umi-core@0.1.2 + - @metaplex-foundation/umi-web3js-adapters@0.1.2 + +## 0.1.1 + +### Patch Changes + +- [`f30119d`](https://github.com/metaplex-foundation/umi/commit/f30119daf5c51d893c654a064f5fabeb9246aa41) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Publish a new version with changelog and a release tag + +- Updated dependencies [[`f30119d`](https://github.com/metaplex-foundation/umi/commit/f30119daf5c51d893c654a064f5fabeb9246aa41)]: + - @metaplex-foundation/umi-core@0.1.1 + - @metaplex-foundation/umi-web3js-adapters@0.1.1 diff --git a/packages/umi-uploader-bundlr/README.md b/packages/umi-uploader-bundlr/README.md new file mode 100644 index 00000000..a3c3859a --- /dev/null +++ b/packages/umi-uploader-bundlr/README.md @@ -0,0 +1,9 @@ +# umi-uploader-bundlr + +An uploader implementation relying on Bundlr. + +## Installation + +```sh +npm install @metaplex-foundation/umi-uploader-bundlr +``` diff --git a/packages/umi-uploader-bundlr/babel.config.json b/packages/umi-uploader-bundlr/babel.config.json new file mode 100644 index 00000000..ac08da0a --- /dev/null +++ b/packages/umi-uploader-bundlr/babel.config.json @@ -0,0 +1,3 @@ +{ + "extends": "../../babel.config.json" +} diff --git a/packages/umi-uploader-bundlr/package.json b/packages/umi-uploader-bundlr/package.json new file mode 100644 index 00000000..aad52cf6 --- /dev/null +++ b/packages/umi-uploader-bundlr/package.json @@ -0,0 +1,72 @@ +{ + "name": "@metaplex-foundation/umi-uploader-bundlr", + "version": "0.8.9", + "description": "An uploader implementation relying on Bundlr", + "license": "MIT", + "sideEffects": false, + "module": "dist/esm/index.mjs", + "main": "dist/cjs/index.cjs", + "types": "dist/types/index.d.ts", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/esm/index.mjs", + "require": "./dist/cjs/index.cjs" + } + }, + "files": [ + "/dist/cjs", + "/dist/esm", + "/dist/types", + "/src" + ], + "scripts": { + "lint": "eslint --ext js,ts,tsx src", + "lint:fix": "eslint --fix --ext js,ts,tsx src", + "clean": "rimraf dist", + "build": "pnpm clean && tsc && tsc -p test/tsconfig.json && rollup -c", + "test": "ava" + }, + "dependencies": { + "@bundlr-network/client": "^0.8.8", + "@metaplex-foundation/umi-web3js-adapters": "workspace:^", + "bignumber.js": "^9.0.2", + "buffer": "^6.0.3" + }, + "peerDependencies": { + "@metaplex-foundation/umi": "workspace:^", + "@solana/web3.js": "^1.72.0" + }, + "devDependencies": { + "@ava/typescript": "^3.0.1", + "@metaplex-foundation/umi": "workspace:^", + "@metaplex-foundation/umi-downloader-http": "workspace:^", + "@metaplex-foundation/umi-eddsa-web3js": "workspace:^", + "@metaplex-foundation/umi-http-fetch": "workspace:^", + "@metaplex-foundation/umi-rpc-web3js": "workspace:^", + "@solana/web3.js": "^1.72.0", + "ava": "^5.1.0" + }, + "publishConfig": { + "access": "public" + }, + "author": "Metaplex Maintainers ", + "homepage": "https://metaplex.com", + "repository": { + "url": "https://github.com/metaplex-foundation/umi.git" + }, + "typedoc": { + "entryPoint": "./src/index.ts", + "readmeFile": "./README.md", + "displayName": "umi-uploader-bundlr" + }, + "ava": { + "typescript": { + "compile": false, + "rewritePaths": { + "src/": "dist/test/src/", + "test/": "dist/test/test/" + } + } + } +} diff --git a/packages/umi-uploader-bundlr/rollup.config.js b/packages/umi-uploader-bundlr/rollup.config.js new file mode 100644 index 00000000..ba38fd10 --- /dev/null +++ b/packages/umi-uploader-bundlr/rollup.config.js @@ -0,0 +1,16 @@ +import { createConfigs } from '../../rollup.config'; +import pkg from './package.json'; + +export default createConfigs({ + pkg, + builds: [ + { + dir: 'dist/esm', + format: 'es', + }, + { + dir: 'dist/cjs', + format: 'cjs', + }, + ], +}); diff --git a/packages/umi-uploader-bundlr/src/createBundlrUploader.ts b/packages/umi-uploader-bundlr/src/createBundlrUploader.ts new file mode 100644 index 00000000..d1d40a48 --- /dev/null +++ b/packages/umi-uploader-bundlr/src/createBundlrUploader.ts @@ -0,0 +1,381 @@ +// eslint-disable-next-line import/no-named-default +import type { default as NodeBundlr, WebBundlr } from '@bundlr-network/client'; +import { + Commitment, + Context, + GenericFile, + GenericFileTag, + Keypair, + Signer, + SolAmount, + UploaderInterface, + base58, + createGenericFileFromJson, + createSignerFromKeypair, + isKeypairSigner, + lamports, + publicKey, + signTransaction, +} from '@metaplex-foundation/umi'; +import { + fromWeb3JsKeypair, + fromWeb3JsLegacyTransaction, + toWeb3JsLegacyTransaction, + toWeb3JsPublicKey, +} from '@metaplex-foundation/umi-web3js-adapters'; +import { + Connection as Web3JsConnection, + Keypair as Web3JsKeypair, + PublicKey as Web3JsPublicKey, + SendOptions as Web3JsSendOptions, + Signer as Web3JsSigner, + Transaction as Web3JsTransaction, + TransactionSignature as Web3JsTransactionSignature, +} from '@solana/web3.js'; +import BigNumber from 'bignumber.js'; +import { Buffer } from 'buffer'; +import { + AssetUploadFailedError, + BundlrWithdrawError, + FailedToConnectToBundlrAddressError, + FailedToInitializeBundlrError, +} from './errors'; + +/** + * This method is necessary to import the Bundlr package on both ESM and CJS modules. + * Without this, we get a different structure on each module: + * - CJS: { default: [Getter], WebBundlr: [Getter] } + * - ESM: { default: { default: [Getter], WebBundlr: [Getter] } } + * This method fixes this by ensure there is not double default in the imported package. + */ +// eslint-disable-next-line @typescript-eslint/naming-convention +function _removeDoubleDefault(pkg: any) { + if ( + pkg && + typeof pkg === 'object' && + 'default' in pkg && + 'default' in pkg.default + ) { + return pkg.default; + } + + return pkg; +} + +export type BundlrUploader = UploaderInterface & { + bundlr: () => Promise; + getUploadPriceFromBytes: (bytes: number) => Promise; + getBalance: () => Promise; + fund: (amount: SolAmount, skipBalanceCheck: boolean) => Promise; + withdrawAll: (amount: SolAmount) => Promise; + withdraw: (amount: SolAmount) => Promise; +}; + +export type BundlrUploaderOptions = { + address?: string; + timeout?: number; + providerUrl?: string; + priceMultiplier?: number; + payer?: Signer; +}; + +export type BundlrWalletAdapter = { + publicKey: Web3JsPublicKey | null; + signMessage?: (message: Uint8Array) => Promise; + signTransaction?: ( + transaction: Web3JsTransaction + ) => Promise; + signAllTransactions?: ( + transactions: Web3JsTransaction[] + ) => Promise; + sendTransaction: ( + transaction: Web3JsTransaction, + connection: Web3JsConnection, + options?: Web3JsSendOptions & { signers?: Web3JsSigner[] } + ) => Promise; +}; + +// Size of Bundlr transaction header. +const HEADER_SIZE = 2_000; + +// Minimum file size for cost calculation. +const MINIMUM_SIZE = 80_000; + +export function createBundlrUploader( + context: Pick, + options: BundlrUploaderOptions = {} +): BundlrUploader { + // eslint-disable-next-line @typescript-eslint/naming-convention + let _bundlr: WebBundlr | NodeBundlr | null = null; + options = { + providerUrl: context.rpc.getEndpoint(), + ...options, + }; + + const getUploadPriceFromBytes = async (bytes: number): Promise => { + const bundlr = await getBundlr(); + const price = await bundlr.getPrice(bytes); + + return bigNumberToAmount( + price.multipliedBy(options.priceMultiplier ?? 1.1) + ); + }; + + const getUploadPrice = async (files: GenericFile[]): Promise => { + const bytes: number = files.reduce( + (sum, file) => + sum + HEADER_SIZE + Math.max(MINIMUM_SIZE, file.buffer.byteLength), + 0 + ); + + return getUploadPriceFromBytes(bytes); + }; + + const upload = async (files: GenericFile[]): Promise => { + const bundlr = await getBundlr(); + const amount = await getUploadPrice(files); + await fund(amount); + + const promises = files.map(async (file) => { + const buffer = Buffer.from(file.buffer); + const { status, data } = await bundlr.uploader.upload(buffer, { + tags: getGenericFileTagsWithContentType(file), + }); + + if (status >= 300) { + throw new AssetUploadFailedError(status); + } + + return `https://arweave.net/${data.id}`; + }); + + return Promise.all(promises); + }; + + const uploadJson = async (json: T): Promise => { + const file = createGenericFileFromJson(json); + const uris = await upload([file]); + return uris[0]; + }; + + const getBalance = async (): Promise => { + const bundlr = await getBundlr(); + const balance = await bundlr.getLoadedBalance(); + + return bigNumberToAmount(balance); + }; + + const fund = async ( + amount: SolAmount, + skipBalanceCheck = false + ): Promise => { + const bundlr = await getBundlr(); + let toFund = amountToBigNumber(amount); + + if (!skipBalanceCheck) { + const balance = await bundlr.getLoadedBalance(); + + toFund = toFund.isGreaterThan(balance) + ? toFund.minus(balance) + : new BigNumber(0); + } + + if (toFund.isLessThanOrEqualTo(0)) { + return; + } + + await bundlr.fund(toFund); + }; + + const withdrawAll = async (): Promise => { + // TODO(loris): Replace with "withdrawAll" when available on Bundlr. + const bundlr = await getBundlr(); + const balance = await bundlr.getLoadedBalance(); + const minimumBalance = new BigNumber(5000); + + if (balance.isLessThan(minimumBalance)) { + return; + } + + const balanceToWithdraw = balance.minus(minimumBalance); + await withdraw(bigNumberToAmount(balanceToWithdraw)); + }; + + const withdraw = async (amount: SolAmount): Promise => { + const bundlr = await getBundlr(); + + const { status } = await bundlr.withdrawBalance(amountToBigNumber(amount)); + + if (status >= 300) { + throw new BundlrWithdrawError(status); + } + }; + + const getBundlr = async (): Promise => { + const oldPayer = _bundlr?.getSigner().publicKey; + const newPayer = options.payer ?? context.payer; + if ( + oldPayer && + publicKey(new Uint8Array(oldPayer)) !== newPayer.publicKey + ) { + _bundlr = null; + } + + if (!_bundlr) { + _bundlr = await initBundlr(); + } + + return _bundlr; + }; + + const initBundlr = async (): Promise => { + const currency = 'solana'; + const defaultAddress = + context.rpc.getCluster() === 'devnet' + ? 'https://devnet.bundlr.network' + : 'https://node1.bundlr.network'; + const address = options?.address ?? defaultAddress; + const bundlrOptions = { + timeout: options.timeout, + providerUrl: options.providerUrl, + }; + + const payer: Signer = options.payer ?? context.payer; + + // If in node use node bundlr, else use web bundlr. + const isNode = + // eslint-disable-next-line no-prototype-builtins + typeof window === 'undefined' || window.process?.hasOwnProperty('type'); + + let bundlr; + if (isNode && isKeypairSigner(payer)) + bundlr = await initNodeBundlr(address, currency, payer, bundlrOptions); + else { + bundlr = await initWebBundlr(address, currency, payer, bundlrOptions); + } + + try { + // Check for valid bundlr node. + await bundlr.utils.getBundlerAddress(currency); + } catch (error) { + throw new FailedToConnectToBundlrAddressError(address, error as Error); + } + + return bundlr; + }; + + const initNodeBundlr = async ( + address: string, + currency: string, + keypair: Keypair, + options: any + ): Promise => { + const bPackage = _removeDoubleDefault( + await import('@bundlr-network/client') + ); + // eslint-disable-next-line new-cap + return new bPackage.default(address, currency, keypair.secretKey, options); + }; + + const initWebBundlr = async ( + address: string, + currency: string, + payer: Signer, + options: any + ): Promise => { + const wallet: BundlrWalletAdapter = { + publicKey: toWeb3JsPublicKey(payer.publicKey), + signMessage: (message: Uint8Array) => payer.signMessage(message), + signTransaction: async (web3JsTransaction: Web3JsTransaction) => + toWeb3JsLegacyTransaction( + await payer.signTransaction( + fromWeb3JsLegacyTransaction(web3JsTransaction) + ) + ), + signAllTransactions: async (web3JsTransactions: Web3JsTransaction[]) => { + const transactions = web3JsTransactions.map( + fromWeb3JsLegacyTransaction + ); + const signedTransactions = await payer.signAllTransactions( + transactions + ); + return signedTransactions.map(toWeb3JsLegacyTransaction); + }, + sendTransaction: async ( + web3JsTransaction: Web3JsTransaction, + connection: Web3JsConnection, + options: Web3JsSendOptions & { signers?: Web3JsSigner[] } = {} + ): Promise => { + const { signers: web3JsSigners = [], ...sendOptions } = options; + const signers = web3JsSigners.map((web3JsSigner) => + createSignerFromKeypair( + context, + fromWeb3JsKeypair( + Web3JsKeypair.fromSecretKey(web3JsSigner.secretKey) + ) + ) + ); + + let transaction = fromWeb3JsLegacyTransaction(web3JsTransaction); + transaction = await signTransaction(transaction, [payer, ...signers]); + + const signature = await context.rpc.sendTransaction(transaction, { + ...sendOptions, + preflightCommitment: sendOptions.preflightCommitment as Commitment, + }); + + return base58.deserialize(signature)[0]; + }, + }; + + const bPackage = _removeDoubleDefault( + await import('@bundlr-network/client') + ); + const bundlr = new bPackage.WebBundlr(address, currency, wallet, options); + + try { + // Try to initiate bundlr. + await bundlr.ready(); + } catch (error) { + throw new FailedToInitializeBundlrError(error as Error); + } + + return bundlr; + }; + + return { + getUploadPriceFromBytes, + getUploadPrice, + upload, + uploadJson, + getBalance, + fund, + withdrawAll, + withdraw, + bundlr: getBundlr, + }; +} + +export const isBundlrUploader = ( + uploader: UploaderInterface +): uploader is BundlrUploader => + 'bundlr' in uploader && + 'getBalance' in uploader && + 'fund' in uploader && + 'withdrawAll' in uploader; + +const bigNumberToAmount = (bigNumber: BigNumber): SolAmount => + lamports(bigNumber.decimalPlaces(0).toString()); + +const amountToBigNumber = (amount: SolAmount): BigNumber => + new BigNumber(amount.basisPoints.toString()); + +const getGenericFileTagsWithContentType = ( + file: GenericFile +): GenericFileTag[] => { + if (!file.contentType) { + return file.tags; + } + + return [{ name: 'Content-Type', value: file.contentType }, ...file.tags]; +}; diff --git a/packages/umi-uploader-bundlr/src/errors.ts b/packages/umi-uploader-bundlr/src/errors.ts new file mode 100644 index 00000000..6fa63729 --- /dev/null +++ b/packages/umi-uploader-bundlr/src/errors.ts @@ -0,0 +1,54 @@ +import { UmiError } from '@metaplex-foundation/umi'; + +export class BundlrError extends UmiError { + readonly name: string = 'BundlrError'; + + constructor(message: string, cause?: Error) { + super(message, 'plugin', 'Bundlr', cause); + } +} + +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); + } +} + +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); + } +} + +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); + } +} + +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/umi-uploader-bundlr/src/index.ts b/packages/umi-uploader-bundlr/src/index.ts new file mode 100644 index 00000000..e61cc02f --- /dev/null +++ b/packages/umi-uploader-bundlr/src/index.ts @@ -0,0 +1,3 @@ +export * from './createBundlrUploader'; +export * from './errors'; +export * from './plugin'; diff --git a/packages/umi-uploader-bundlr/src/plugin.ts b/packages/umi-uploader-bundlr/src/plugin.ts new file mode 100644 index 00000000..683c2394 --- /dev/null +++ b/packages/umi-uploader-bundlr/src/plugin.ts @@ -0,0 +1,11 @@ +import type { UmiPlugin } from '@metaplex-foundation/umi'; +import { + BundlrUploaderOptions, + createBundlrUploader, +} from './createBundlrUploader'; + +export const bundlrUploader = (options?: BundlrUploaderOptions): UmiPlugin => ({ + install(umi) { + umi.uploader = createBundlrUploader(umi, options); + }, +}); diff --git a/packages/umi-uploader-bundlr/test/BundlrUploader.test.ts b/packages/umi-uploader-bundlr/test/BundlrUploader.test.ts new file mode 100644 index 00000000..79c8f959 --- /dev/null +++ b/packages/umi-uploader-bundlr/test/BundlrUploader.test.ts @@ -0,0 +1,55 @@ +import { + Context, + createGenericFile, + createUmi, + generatedSignerIdentity, + sol, + utf8, +} from '@metaplex-foundation/umi'; +import { httpDownloader } from '@metaplex-foundation/umi-downloader-http'; +import { web3JsEddsa } from '@metaplex-foundation/umi-eddsa-web3js'; +import { fetchHttp } from '@metaplex-foundation/umi-http-fetch'; +import { web3JsRpc } from '@metaplex-foundation/umi-rpc-web3js'; +import test from 'ava'; +import { bundlrUploader, BundlrUploaderOptions } from '../src'; + +test('example test', async (t) => { + t.is(typeof bundlrUploader, 'function'); +}); + +// TODO(loris): Unskip these tests when we can mock the Bundlr API. + +const getContext = async ( + options?: BundlrUploaderOptions +): Promise => { + const context = createUmi().use({ + install(umi) { + umi.use(web3JsRpc('https://metaplex.devnet.rpcpool.com/')); + umi.use(web3JsEddsa()); + umi.use(fetchHttp()); + umi.use(httpDownloader()); + umi.use(bundlrUploader(options)); + umi.use(generatedSignerIdentity()); + }, + }); + await context.rpc.airdrop(context.payer.publicKey, sol(1)); + return context; +}; + +test.skip('it can upload one file', async (t) => { + // Given a Context using NFT.Storage. + const context = await getContext(); + + // When we upload some asset. + const [uri] = await context.uploader.upload([ + createGenericFile('some-image', 'some-image.jpg'), + ]); + + // Then the URI should be a valid IPFS URI. + t.truthy(uri); + t.true(uri.startsWith('https://nftstorage.link/ipfs/')); + + // and it should point to the uploaded asset. + const [asset] = await context.downloader.download([uri]); + t.is(utf8.deserialize(asset.buffer)[0], 'some-image'); +}); diff --git a/packages/umi-uploader-bundlr/test/modules/cjs.test.cjs b/packages/umi-uploader-bundlr/test/modules/cjs.test.cjs new file mode 100644 index 00000000..e936fcfd --- /dev/null +++ b/packages/umi-uploader-bundlr/test/modules/cjs.test.cjs @@ -0,0 +1,30 @@ +/* eslint-disable import/no-extraneous-dependencies */ +const test = require('ava'); +const { + createUmi, + generatedSignerIdentity, +} = require('@metaplex-foundation/umi'); +const { web3JsRpc } = require('@metaplex-foundation/umi-rpc-web3js'); +const { web3JsEddsa } = require('@metaplex-foundation/umi-eddsa-web3js'); +const exported = require('../../dist/cjs/index.cjs'); + +test('it successfully exports commonjs named exports', (t) => { + const exportedKeys = Object.keys(exported); + + t.true(exportedKeys.includes('createBundlrUploader')); +}); + +test('it can import the Bundlr client', async (t) => { + const { createBundlrUploader } = exported; + const context = createUmi() + .use(web3JsRpc('http://localhost:8899')) + .use(web3JsEddsa()) + .use(generatedSignerIdentity()); + const bundlrUploader = createBundlrUploader(context); + const bundlr = await bundlrUploader.bundlr(); + t.true(typeof bundlr === 'object', 'Bundlr is an object'); + t.true('uploader' in bundlr, 'Bundlr can upload'); + t.true('getLoadedBalance' in bundlr, 'Bundlr can get the loaded balance'); + t.true('fund' in bundlr, 'Bundlr can fund'); + t.true('withdrawBalance' in bundlr, 'Bundlr can withdraw'); +}); diff --git a/packages/umi-uploader-bundlr/test/modules/esm.test.mjs b/packages/umi-uploader-bundlr/test/modules/esm.test.mjs new file mode 100644 index 00000000..d83bc185 --- /dev/null +++ b/packages/umi-uploader-bundlr/test/modules/esm.test.mjs @@ -0,0 +1,28 @@ +/* eslint-disable import/extensions */ +/* eslint-disable import/no-extraneous-dependencies */ +import test from 'ava'; +import { createUmi, generatedSignerIdentity } from '@metaplex-foundation/umi'; +import { web3JsRpc } from '@metaplex-foundation/umi-rpc-web3js'; +import { web3JsEddsa } from '@metaplex-foundation/umi-eddsa-web3js'; +import * as exported from '../../dist/esm/index.mjs'; + +test('it successfully exports esm named exports', (t) => { + const exportedKeys = Object.keys(exported); + + t.true(exportedKeys.includes('createBundlrUploader')); +}); + +test('it can import the Bundlr client', async (t) => { + const { createBundlrUploader } = exported; + const context = createUmi() + .use(web3JsRpc('http://localhost:8899')) + .use(web3JsEddsa()) + .use(generatedSignerIdentity()); + const bundlrUploader = createBundlrUploader(context); + const bundlr = await bundlrUploader.bundlr(); + t.true(typeof bundlr === 'object', 'Bundlr is an object'); + t.true('uploader' in bundlr, 'Bundlr can upload'); + t.true('getLoadedBalance' in bundlr, 'Bundlr can get the loaded balance'); + t.true('fund' in bundlr, 'Bundlr can fund'); + t.true('withdrawBalance' in bundlr, 'Bundlr can withdraw'); +}); diff --git a/packages/umi-uploader-bundlr/test/tsconfig.json b/packages/umi-uploader-bundlr/test/tsconfig.json new file mode 100644 index 00000000..2390f598 --- /dev/null +++ b/packages/umi-uploader-bundlr/test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.json", + "include": ["./**/*"], + "compilerOptions": { + "module": "commonjs", + "outDir": "../dist/test", + "declarationDir": null, + "declaration": false, + "emitDeclarationOnly": false + } +} diff --git a/packages/umi-uploader-bundlr/tsconfig.json b/packages/umi-uploader-bundlr/tsconfig.json new file mode 100644 index 00000000..89a681d0 --- /dev/null +++ b/packages/umi-uploader-bundlr/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src"], + "compilerOptions": { + "outDir": "dist/esm", + "declarationDir": "dist/types" + } +} From 8fea160adf53a85bc0c178c1c63fc52daa9886d9 Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Sat, 4 Nov 2023 20:07:27 +0000 Subject: [PATCH 4/7] chore: :memo: Add changeset for umi-uploader-irys --- .changeset/rich-camels-roll.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/rich-camels-roll.md diff --git a/.changeset/rich-camels-roll.md b/.changeset/rich-camels-roll.md new file mode 100644 index 00000000..73e1b876 --- /dev/null +++ b/.changeset/rich-camels-roll.md @@ -0,0 +1,5 @@ +--- +'@metaplex-foundation/umi-uploader-irys': patch +--- + +Add new Irys uploader to replace the deprecated Bundlr uploader From 11445a582d32a702314ef919b0824fb89441addb Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Mon, 6 Nov 2023 16:11:36 +0000 Subject: [PATCH 5/7] chore: :memo: Update PNPM lock, add Bundlr back to implementations list --- docs/implementations.md | 1 + pnpm-lock.yaml | 305 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 295 insertions(+), 11 deletions(-) diff --git a/docs/implementations.md b/docs/implementations.md index 93372672..99c2f1ca 100644 --- a/docs/implementations.md +++ b/docs/implementations.md @@ -44,6 +44,7 @@ The page aims to list all the available implementations of [the interfaces defin | Uses Irys.xyz | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-uploader-irys) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-uploader-irys) | | Uses NFT.Storage | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-uploader-nft-storage) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-uploader-nft-storage) | | Uses a local cache to mock uploads and downloads | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-storage-mock) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-storage-mock) | +| Uses Bundlr.network (Deprecated - use `umi-uploader-irys`) | Metaplex | [GitHub](https://github.com/metaplex-foundation/umi/tree/main/packages/umi-uploader-bundlr) / [NPM](https://www.npmjs.com/package/@metaplex-foundation/umi-uploader-bundlr) | ## Downloader Interface diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec2e3f5b..05f0d5c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -530,6 +530,46 @@ importers: specifier: ^13.0.1 version: 13.0.2 + packages/umi-uploader-bundlr: + dependencies: + '@bundlr-network/client': + specifier: ^0.8.8 + version: 0.8.9 + '@metaplex-foundation/umi-web3js-adapters': + specifier: workspace:^ + version: link:../umi-web3js-adapters + bignumber.js: + specifier: ^9.0.2 + version: 9.1.1 + buffer: + specifier: ^6.0.3 + version: 6.0.3 + devDependencies: + '@ava/typescript': + specifier: ^3.0.1 + version: 3.0.1 + '@metaplex-foundation/umi': + specifier: workspace:^ + version: link:../umi + '@metaplex-foundation/umi-downloader-http': + specifier: workspace:^ + version: link:../umi-downloader-http + '@metaplex-foundation/umi-eddsa-web3js': + specifier: workspace:^ + version: link:../umi-eddsa-web3js + '@metaplex-foundation/umi-http-fetch': + specifier: workspace:^ + version: link:../umi-http-fetch + '@metaplex-foundation/umi-rpc-web3js': + specifier: workspace:^ + version: link:../umi-rpc-web3js + '@solana/web3.js': + specifier: ^1.72.0 + version: 1.72.0 + ava: + specifier: ^5.1.0 + version: 5.1.0(@ava/typescript@3.0.1) + packages/umi-uploader-irys: dependencies: '@irys/sdk': @@ -2949,6 +2989,38 @@ packages: to-fast-properties: 2.0.0 dev: true + /@bundlr-network/client@0.8.9: + resolution: {integrity: sha512-SJ7BAt/KhONeFQ0+nbqrw2DUWrsev6y6cmlXt+3x7fPCkw7OJwudtxV/h2nBteZd65NXjqw8yzkmLiLfZ7CCRA==} + deprecated: Bundlr is now Irys - please switch to @irys/sdk - this package will remain compatible with Irys for the foreseeable future. + hasBin: true + dependencies: + '@solana/wallet-adapter-base': 0.9.23(@solana/web3.js@1.72.0) + '@solana/web3.js': 1.72.0 + '@supercharge/promise-pool': 2.4.0 + algosdk: 1.24.1 + arbundles: 0.6.23(@solana/web3.js@1.72.0) + arweave: 1.12.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.3.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 + - supports-color + - utf-8-validate + dev: false + /@changesets/apply-release-plan@6.1.3: resolution: {integrity: sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==} dependencies: @@ -3641,6 +3713,17 @@ 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: @@ -3663,6 +3746,14 @@ 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: @@ -4270,7 +4361,6 @@ packages: resolution: {integrity: sha512-CzS0U8IFfXNK7QaJFE4pjbxDGfPjbXBEsEaCn9FN15F+ouSAEUQkva3Gl66hrkBZOGexKFEWMwUHIDKpZ2hfVg==} requiresBuild: true dev: false - optional: true /@randlabs/myalgo-connect@1.4.2: resolution: {integrity: sha512-K9hEyUi7G8tqOp7kWIALJLVbGCByhilcy6123WfcorxWwiE1sbQupPyIU5f3YdQK6wMjBsyTWiLW52ZBMp7sXA==} @@ -4278,7 +4368,6 @@ packages: dependencies: '@randlabs/communication-bridge': 1.0.1 dev: false - optional: true /@remix-run/dev@1.12.0: resolution: {integrity: sha512-lBiA2FlDi+DjpOAE/vn93zFTSxudKag/FGpmbV6O+LQItDCpFARfbBMhTck/uKcc95nyhRd1GGhQ4ZDgQnyjaQ==} @@ -4609,6 +4698,27 @@ packages: - utf-8-validate dev: true + /@solana/wallet-adapter-base@0.9.23(@solana/web3.js@1.72.0): + resolution: {integrity: sha512-apqMuYwFp1jFi55NxDfvXUX2x1T0Zh07MxhZ/nCCTGys5raSfYUh82zen2BLv8BSDj/JxZ2P/s7jrQZGrX8uAw==} + engines: {node: '>=16'} + peerDependencies: + '@solana/web3.js': ^1.77.3 + dependencies: + '@solana/wallet-standard-features': 1.1.0 + '@solana/web3.js': 1.72.0 + '@wallet-standard/base': 1.0.1 + '@wallet-standard/features': 1.0.3 + eventemitter3: 4.0.7 + dev: false + + /@solana/wallet-standard-features@1.1.0: + resolution: {integrity: sha512-oVyygxfYkkF5INYL0GuD8GFmNO/wd45zNesIqGCFE6X66BYxmI6HmyzQJCcZTZ0BNsezlVg4t+3MCL5AhfFoGA==} + engines: {node: '>=16'} + dependencies: + '@wallet-standard/base': 1.0.1 + '@wallet-standard/features': 1.0.3 + dev: false + /@solana/web3.js@1.72.0: resolution: {integrity: sha512-xMoCk0y/GpiQhHbRjMcrd5NpmkwhAA0c01id7lrr6nhNdz6Uc/CywPdBeZw3Qz6BVZ/qlUoerpKPWeiXqMUjwA==} engines: {node: '>=12.20.0'} @@ -4635,6 +4745,11 @@ packages: - supports-color - utf-8-validate + /@supercharge/promise-pool@2.4.0: + resolution: {integrity: sha512-O9CMipBlq5OObdt1uKJGIzm9cdjpPWfj+a+Zw9EgWKxaMNHKC7EU7X9taj3H0EGQNLOSq2jAcOa3EzxlfHsD6w==} + engines: {node: '>=8'} + dev: false + /@supercharge/promise-pool@3.1.0: resolution: {integrity: sha512-gB3NukbIcYzRtPoE6dx9svQYPodxvnfQlaaQd8N/z87E6WaMfRE7o5HwB+LZ+KeM0nsNAq1n4TmBtfz1VCUR+Q==} engines: {node: '>=8'} @@ -5260,6 +5375,18 @@ packages: resolution: {integrity: sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==} dev: true + /@wallet-standard/base@1.0.1: + resolution: {integrity: sha512-1To3ekMfzhYxe0Yhkpri+Fedq0SYcfrOfJi3vbLjMwF2qiKPjTGLwZkf2C9ftdQmxES+hmxhBzTwF4KgcOwf8w==} + engines: {node: '>=16'} + dev: false + + /@wallet-standard/features@1.0.3: + resolution: {integrity: sha512-m8475I6W5LTatTZuUz5JJNK42wFRgkJTB0I9tkruMwfqBF2UN2eomkYNVf9RbrsROelCRzSFmugqjKZBFaubsA==} + engines: {node: '>=16'} + dependencies: + '@wallet-standard/base': 1.0.1 + dev: false + /@web-std/blob@2.1.3: resolution: {integrity: sha512-K94rkZpa8yDEylkniNmK0aCYpkZe7wWn8GHNpyM+ckBQuRqhRmX0NG9d1b1f4pX3FKdLcfp7vTj6FjfdcjO3rQ==} dependencies: @@ -5578,12 +5705,38 @@ packages: - utf-8-validate dev: false + /arbundles@0.6.23(@solana/web3.js@1.72.0): + resolution: {integrity: sha512-+gr93F3fivN+6dhiImT6BQNaXz4oECPn2GYjCZjS2yEoq7hM78FRvVp6kQyjEdhnuBFQr/q4oS/nkjnQlHdj9Q==} + dependencies: + '@noble/ed25519': 1.7.1 + '@randlabs/myalgo-connect': 1.4.2 + '@solana/wallet-adapter-base': 0.9.23(@solana/web3.js@1.72.0) + algosdk: 1.24.1 + arweave: 1.12.4 + arweave-stream-tx: 1.2.2(arweave@1.12.4) + avsc: github.com/Irys-xyz/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.3 + multistream: 4.1.0 + process: 0.11.10 + secp256k1: 4.0.3 + tmp-promise: 3.0.3 + transitivePeerDependencies: + - '@solana/web3.js' + - bufferutil + - debug + - encoding + - utf-8-validate + dev: false + /arconnect@0.4.2: resolution: {integrity: sha512-Jkpd4QL3TVqnd3U683gzXmZUVqBUy17DdJDuL/3D9rkysLgX6ymJ2e+sR+xyZF5Rh42CBqDXWNMmCjBXeP7Gbw==} dependencies: arweave: 1.12.4 dev: false - optional: true /are-we-there-yet@2.0.0: resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} @@ -5711,7 +5864,6 @@ packages: arweave: 1.12.4 exponential-backoff: 3.1.0 dev: false - optional: true /arweave@1.12.4: resolution: {integrity: sha512-W5z7hb9/ZP2vy6BiYC+2obfGMhlhz/DaCkEXpkj/4hjaecWYUnvlUX5aCI2i0+lCrzbBUFbz+maDihUpBrdZpg==} @@ -5722,7 +5874,6 @@ packages: base64-js: 1.5.1 bignumber.js: 9.1.1 dev: false - optional: true /asn1.js@5.4.1: resolution: {integrity: sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==} @@ -5842,7 +5993,6 @@ 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==} @@ -5850,7 +6000,6 @@ packages: follow-redirects: 1.15.2(debug@4.3.4) transitivePeerDependencies: - debug - dev: true /axios@0.27.2: resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} @@ -6040,6 +6189,10 @@ 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==} @@ -6063,6 +6216,14 @@ packages: - supports-color 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: @@ -6264,6 +6425,10 @@ packages: resolution: {integrity: sha512-AZ+9tFXw1sS0o0jcpJQIXvFTOB/xGiQ4OQ2t98QX3NDn2EZTSRBC801gxrsGgViuq2ak/NLkNgSNEPtCr5lfKg==} 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: @@ -6720,12 +6885,24 @@ packages: /csv-generate@3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} + /csv-generate@4.3.0: + resolution: {integrity: sha512-7KdVId/2RgwPIKfWHaHtjBq7I9mgdi8ICzsUyIhP8is6UwpwVGGSC/aPnrZ8/SkgBcCP20lXrdPuP64Irs1VBg==} + dev: false + /csv-parse@4.16.3: resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} + /csv-parse@5.5.2: + resolution: {integrity: sha512-YRVtvdtUNXZCMyK5zd5Wty1W6dNTpGKdqQd4EQ8tl/c6KW1aMBB1Kg1ppky5FONKmEqGJ/8WjLlTNLPne4ioVA==} + dev: false + /csv-stringify@5.6.5: resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} + /csv-stringify@6.4.4: + resolution: {integrity: sha512-NDshLupGa7gp4UG4sSNIqwYJqgSwvds0SvENntxoVoVvTzXcrHvd5gG2MWpbRpSNvk59dlmIe1IwNvSxN4IVmg==} + dev: false + /csv@5.5.3: resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} engines: {node: '>= 0.1.90'} @@ -6735,6 +6912,16 @@ packages: csv-stringify: 5.6.5 stream-transform: 2.1.3 + /csv@6.3.5: + resolution: {integrity: sha512-Y+KTCAUljtq2JaGP42ZL1bymqlU5BkfnFpZhxRczGFDZox2VXhlRHnG5DRshyUrwQzmCdEiLjSqNldCfm1OVCA==} + engines: {node: '>= 0.1.90'} + dependencies: + csv-generate: 4.3.0 + csv-parse: 5.5.2 + csv-stringify: 6.4.4 + stream-transform: 3.2.10 + dev: false + /currently-unhandled@0.4.1: resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} engines: {node: '>=0.10.0'} @@ -7189,6 +7376,14 @@ 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 + /errorhandler@1.5.1: resolution: {integrity: sha512-rcOwbfvP1WTViVoUjcfZicVzjhjTuhSMntHh6mW3IrEiyE6mJyXvsToJUJGlGlw/2xU9P5whlWNGlIDVeCiT4A==} engines: {node: '>= 0.8'} @@ -7844,6 +8039,44 @@ packages: engines: {node: '>= 0.6'} dev: true + /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 + /eval@0.1.6: resolution: {integrity: sha512-o0XUw+5OGkXw4pJZzQoXUk+H87DHuC+7ZE//oSrRGtatTmr12oTnLfg6QOq9DyTt0c/p4TwzgmkKrBzWTSizyQ==} engines: {node: '>= 0.8'} @@ -7895,7 +8128,6 @@ packages: resolution: {integrity: sha512-oBuz5SYz5zzyuHINoe9ooePwSu0xApKWgeNzok4hZ5YKXFh9zrQBEM15CXqoZkJJPuI2ArvqjPQd8UKJA753XA==} requiresBuild: true dev: false - optional: true /express-urlrewrite@1.4.0: resolution: {integrity: sha512-PI5h8JuzoweS26vFizwQl6UTF25CAHSggNv0J25Dn/IKZscJHWZzPrI5z2Y2jgOzIaw2qh8l6+/jUcig23Z2SA==} @@ -10608,7 +10840,6 @@ packages: once: 1.4.0 readable-stream: 3.6.0 dev: false - optional: true /murmurhash3js-revisited@3.0.0: resolution: {integrity: sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g==} @@ -10652,6 +10883,24 @@ 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.9 + 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: @@ -10846,6 +11095,12 @@ 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'} @@ -11484,6 +11739,11 @@ 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 + /promise-inflight@1.0.1: resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} peerDependencies: @@ -12041,6 +12301,16 @@ packages: lodash: 4.17.21 dev: true + /secp256k1@4.0.3: + resolution: {integrity: sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==} + engines: {node: '>=10.0.0'} + requiresBuild: true + dependencies: + elliptic: 6.5.4 + node-addon-api: 2.0.2 + node-gyp-build: 4.5.0 + dev: false + /secp256k1@5.0.0: resolution: {integrity: sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==} engines: {node: '>=14.0.0'} @@ -12462,6 +12732,10 @@ packages: dependencies: mixme: 0.5.4 + /stream-transform@3.2.10: + resolution: {integrity: sha512-Yu+x7zcWbWdyB0Td8dFzHt2JEyD6694CNq2lqh1rbuEBVxPtjb/GZ7xDnZcdYiU5E/RtufM54ClSEOzZDeWguA==} + dev: false + /streaming-iterables@6.2.0: resolution: {integrity: sha512-3AYC8oB60WyD1ic7uHmN/vm2oRGzRnQ3XFBl/bFMDi1q1+nc5/vjMmiE4vroIya3jG59t87VpyAj/iXYxyw9AA==} engines: {node: '>=10'} @@ -12723,7 +12997,6 @@ packages: dependencies: tmp: 0.2.1 dev: false - optional: true /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} @@ -12738,7 +13011,6 @@ packages: dependencies: rimraf: 3.0.2 dev: false - optional: true /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} @@ -13058,6 +13330,10 @@ packages: engines: {node: '>=8'} dev: false + /u3@0.1.1: + resolution: {integrity: sha512-+J5D5ir763y+Am/QY6hXNRlwljIeRMZMGs0cT6qqZVVzzT3X3nFPXVyPOFRMOR4kupB0T8JnCdpWdp6Q/iXn3w==} + dev: false + /ufo@1.0.1: resolution: {integrity: sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==} dev: true @@ -13709,3 +13985,10 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: true + + github.com/Irys-xyz/avsc/a730cc8018b79e114b6a3381bbb57760a24c6cef: + resolution: {tarball: https://codeload.github.com/Irys-xyz/avsc/tar.gz/a730cc8018b79e114b6a3381bbb57760a24c6cef} + name: avsc + version: 5.4.7 + engines: {node: '>=0.11'} + dev: false From 4a356faede6611b38a1b07bda36421b78cab380a Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Tue, 7 Nov 2023 14:41:17 +0000 Subject: [PATCH 6/7] chore: :fire: Remove umi-uploader-irys changelog --- packages/umi-uploader-irys/CHANGELOG.md | 318 ------------------------ 1 file changed, 318 deletions(-) delete mode 100644 packages/umi-uploader-irys/CHANGELOG.md diff --git a/packages/umi-uploader-irys/CHANGELOG.md b/packages/umi-uploader-irys/CHANGELOG.md deleted file mode 100644 index e6bd8864..00000000 --- a/packages/umi-uploader-irys/CHANGELOG.md +++ /dev/null @@ -1,318 +0,0 @@ -# @metaplex-foundation/umi-uploader-irys - -## 0.8.9 - -### Patch Changes - -- [#86](https://github.com/metaplex-foundation/umi/pull/86) [`05e4f9f`](https://github.com/metaplex-foundation/umi/commit/05e4f9ffa4e73d9db8442b26cd32577dc32075c2) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Add types file to package.json exports - -- Updated dependencies [[`05e4f9f`](https://github.com/metaplex-foundation/umi/commit/05e4f9ffa4e73d9db8442b26cd32577dc32075c2)]: - - @metaplex-foundation/umi-web3js-adapters@0.8.9 - - @metaplex-foundation/umi@0.8.9 - -## 0.8.8 - -### Patch Changes - -- Updated dependencies []: - - @metaplex-foundation/umi@0.8.8 - - @metaplex-foundation/umi-web3js-adapters@0.8.8 - -## 0.8.7 - -### Patch Changes - -- Updated dependencies [[`7b675bc`](https://github.com/metaplex-foundation/umi/commit/7b675bc08b9442148282f35219cf8163545f160d)]: - - @metaplex-foundation/umi@0.8.7 - - @metaplex-foundation/umi-web3js-adapters@0.8.7 - -## 0.8.6 - -### Patch Changes - -- Updated dependencies [[`aba3519`](https://github.com/metaplex-foundation/umi/commit/aba35199c9f481b5aaf81f812ce945e07796a6aa)]: - - @metaplex-foundation/umi@0.8.6 - - @metaplex-foundation/umi-web3js-adapters@0.8.6 - -## 0.8.5 - -### Patch Changes - -- Updated dependencies []: - - @metaplex-foundation/umi@0.8.5 - - @metaplex-foundation/umi-web3js-adapters@0.8.5 - -## 0.8.4 - -### Patch Changes - -- Updated dependencies [[`d1e0c09`](https://github.com/metaplex-foundation/umi/commit/d1e0c09550bf07fe8bc0865f9732f025c3d8dafe), [`99bf51d`](https://github.com/metaplex-foundation/umi/commit/99bf51d6f58d7fe5b73d7678478ac8463c87d857)]: - - @metaplex-foundation/umi@0.8.4 - - @metaplex-foundation/umi-web3js-adapters@0.8.4 - -## 0.8.2 - -### Patch Changes - -- Updated dependencies [[`4accd34`](https://github.com/metaplex-foundation/umi/commit/4accd34f0a70d360321c42f395a2ad45cbadca16), [`4342375`](https://github.com/metaplex-foundation/umi/commit/43423750c9b351446b868ede57ecb634cebde42a), [`4342375`](https://github.com/metaplex-foundation/umi/commit/43423750c9b351446b868ede57ecb634cebde42a)]: - - @metaplex-foundation/umi@0.8.2 - - @metaplex-foundation/umi-web3js-adapters@0.8.2 - -## 0.8.1 - -### Patch Changes - -- Updated dependencies [[`bc11e6e`](https://github.com/metaplex-foundation/umi/commit/bc11e6e6f964594c75d04f78ef6c86a87aae6749)]: - - @metaplex-foundation/umi@0.8.1 - - @metaplex-foundation/umi-web3js-adapters@0.8.1 - -## 0.8.0 - -### Minor Changes - -- [#62](https://github.com/metaplex-foundation/umi/pull/62) [`15392cd`](https://github.com/metaplex-foundation/umi/commit/15392cd9a98d55750be09268c8ee93611d159e03) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Use PublicKeys as base58 strings. See `@metaplex-foundation/umi` changelog for more details. - -### Patch Changes - -- Updated dependencies [[`15392cd`](https://github.com/metaplex-foundation/umi/commit/15392cd9a98d55750be09268c8ee93611d159e03), [`15392cd`](https://github.com/metaplex-foundation/umi/commit/15392cd9a98d55750be09268c8ee93611d159e03)]: - - @metaplex-foundation/umi-web3js-adapters@0.8.0 - - @metaplex-foundation/umi@0.8.0 - -## 0.7.14 - -### Patch Changes - -- Updated dependencies [[`f530089`](https://github.com/metaplex-foundation/umi/commit/f5300891d0bad4b13431a11d87bfa35b6881ae56)]: - - @metaplex-foundation/umi@0.7.14 - - @metaplex-foundation/umi-web3js-adapters@0.7.14 - -## 0.7.13 - -### Patch Changes - -- Updated dependencies [[`6a33ea3`](https://github.com/metaplex-foundation/umi/commit/6a33ea32937f37cb34114582f2c365ac21c6d8e5), [`6a33ea3`](https://github.com/metaplex-foundation/umi/commit/6a33ea32937f37cb34114582f2c365ac21c6d8e5)]: - - @metaplex-foundation/umi@0.7.13 - - @metaplex-foundation/umi-web3js-adapters@0.7.13 - -## 0.7.12 - -### Patch Changes - -- Updated dependencies [[`3ce198a`](https://github.com/metaplex-foundation/umi/commit/3ce198a8c1eaf257dbd568053a032a601375eed2)]: - - @metaplex-foundation/umi-web3js-adapters@0.7.12 - -## 0.7.11 - -### Patch Changes - -- Updated dependencies [[`38c98dc`](https://github.com/metaplex-foundation/umi/commit/38c98dcc7c61ce212198381765b80fa695c51fa7)]: - - @metaplex-foundation/umi@0.7.11 - - @metaplex-foundation/umi-web3js-adapters@0.7.11 - -## 0.7.10 - -### Patch Changes - -- Updated dependencies [[`c1c1da6`](https://github.com/metaplex-foundation/umi/commit/c1c1da6bbed341492c3d81a4edc7aebb43471345), [`1139bcf`](https://github.com/metaplex-foundation/umi/commit/1139bcfedc541d6b89df2d61b10c4fdc169c4eee)]: - - @metaplex-foundation/umi@0.7.10 - - @metaplex-foundation/umi-web3js-adapters@0.7.10 - -## 0.7.7 - -### Patch Changes - -- Updated dependencies [[`bf9b550`](https://github.com/metaplex-foundation/umi/commit/bf9b550ae945f3963f2c96361b7d7ab38921c6a7)]: - - @metaplex-foundation/umi@0.7.7 - - @metaplex-foundation/umi-web3js-adapters@0.7.7 - -## 0.7.6 - -### Patch Changes - -- Updated dependencies [[`5b275d5`](https://github.com/metaplex-foundation/umi/commit/5b275d53680d66fcd77b1b09a30bf101036e22b3)]: - - @metaplex-foundation/umi@0.7.6 - - @metaplex-foundation/umi-web3js-adapters@0.7.6 - -## 0.7.5 - -### Patch Changes - -- Updated dependencies [[`670e7d4`](https://github.com/metaplex-foundation/umi/commit/670e7d4ba00e41802226ee7c722a116ef141891f)]: - - @metaplex-foundation/umi@0.7.5 - - @metaplex-foundation/umi-web3js-adapters@0.7.5 - -## 0.7.4 - -### Patch Changes - -- Updated dependencies [[`3718fae`](https://github.com/metaplex-foundation/umi/commit/3718faeafc28400313aa93f8e4db3945218ffb0b), [`00cb767`](https://github.com/metaplex-foundation/umi/commit/00cb7671976a63670bd71b70a06d5452b0761f62), [`f56fc59`](https://github.com/metaplex-foundation/umi/commit/f56fc59eee0deebf347e22a097c19aca1332a52a)]: - - @metaplex-foundation/umi@0.7.4 - - @metaplex-foundation/umi-web3js-adapters@0.7.4 - -## 0.7.2 - -### Patch Changes - -- Updated dependencies [[`2756a69`](https://github.com/metaplex-foundation/umi/commit/2756a693fb1d5d1a90608744ca73165b663cc729)]: - - @metaplex-foundation/umi@0.7.2 - - @metaplex-foundation/umi-web3js-adapters@0.7.2 - -## 0.7.0 - -### Minor Changes - -- [#34](https://github.com/metaplex-foundation/umi/pull/34) [`a963320`](https://github.com/metaplex-foundation/umi/commit/a9633202645a23b19c00ec973e93f5e5fda0776d) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Use functions instead of classes to implement interfaces - -### Patch Changes - -- Updated dependencies [[`a963320`](https://github.com/metaplex-foundation/umi/commit/a9633202645a23b19c00ec973e93f5e5fda0776d)]: - - @metaplex-foundation/umi@0.7.0 - - @metaplex-foundation/umi-web3js-adapters@0.7.0 - -## 0.6.0 - -### Patch Changes - -- Updated dependencies [[`b1e898f`](https://github.com/metaplex-foundation/umi/commit/b1e898fb8f78eb3b7acedd6b77dcdfd161164b00)]: - - @metaplex-foundation/umi@0.6.0 - - @metaplex-foundation/umi-web3js-adapters@0.6.0 - -## 0.5.3 - -### Patch Changes - -- Updated dependencies [[`c20d154`](https://github.com/metaplex-foundation/umi/commit/c20d15448537a93d7fe7a5f4765e0d3880ccc8cf), [`13acda9`](https://github.com/metaplex-foundation/umi/commit/13acda9d8c968716289e47b3e19b888f8ba11857)]: - - @metaplex-foundation/umi@0.5.3 - - @metaplex-foundation/umi-web3js-adapters@0.5.3 - -## 0.5.2 - -### Patch Changes - -- Updated dependencies [[`3db36d1`](https://github.com/metaplex-foundation/umi/commit/3db36d13e281a171f407e9652e2404d54c2971bd)]: - - @metaplex-foundation/umi@0.5.2 - - @metaplex-foundation/umi-web3js-adapters@0.5.2 - -## 0.5.1 - -### Patch Changes - -- [#24](https://github.com/metaplex-foundation/umi/pull/24) [`27276f4`](https://github.com/metaplex-foundation/umi/commit/27276f4ab5865bd55a5682990c5e48aa2d9b10cd) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Rename umi, umi-core and umi-test - -- Updated dependencies [[`27276f4`](https://github.com/metaplex-foundation/umi/commit/27276f4ab5865bd55a5682990c5e48aa2d9b10cd)]: - - @metaplex-foundation/umi@0.5.1 - - @metaplex-foundation/umi-web3js-adapters@0.5.1 - -## 0.4.1 - -### Patch Changes - -- Updated dependencies [[`807b469`](https://github.com/metaplex-foundation/umi/commit/807b4691ed843f6a4247317362d71b6457ad291d)]: - - @metaplex-foundation/umi-core@0.4.1 - - @metaplex-foundation/umi-web3js-adapters@0.4.1 - -## 0.4.0 - -### Patch Changes - -- Updated dependencies [[`d6ae534`](https://github.com/metaplex-foundation/umi/commit/d6ae5345ef4b8b8abca1cef04fd64e95f517e656), [`9f86429`](https://github.com/metaplex-foundation/umi/commit/9f8642945f000d84b07005bebe479be9a562db87), [`8d09519`](https://github.com/metaplex-foundation/umi/commit/8d0951983756a8c147ac3f4f95bb7cfc86294aa4), [`95586fa`](https://github.com/metaplex-foundation/umi/commit/95586fa4f06a356706ca2a8d29dd934cfff2395e)]: - - @metaplex-foundation/umi-core@0.4.0 - - @metaplex-foundation/umi-web3js-adapters@0.4.0 - -## 0.3.4 - -### Patch Changes - -- Updated dependencies [[`c93f1c4`](https://github.com/metaplex-foundation/umi/commit/c93f1c487d347fa27163d29a8caefd1d035e9052)]: - - @metaplex-foundation/umi-core@0.3.4 - - @metaplex-foundation/umi-web3js-adapters@0.3.4 - -## 0.3.3 - -### Patch Changes - -- Updated dependencies [[`422dc73`](https://github.com/metaplex-foundation/umi/commit/422dc73b5a5d84e89665ef69972a90cc947a20e5)]: - - @metaplex-foundation/umi-core@0.3.3 - - @metaplex-foundation/umi-web3js-adapters@0.3.3 - -## 0.3.2 - -### Patch Changes - -- Updated dependencies [[`66a7d91`](https://github.com/metaplex-foundation/umi/commit/66a7d919146ee348739438f7b0e33cc746d5d1ba)]: - - @metaplex-foundation/umi-core@0.3.2 - - @metaplex-foundation/umi-web3js-adapters@0.3.2 - -## 0.3.1 - -### Patch Changes - -- Updated dependencies [[`e566c1b`](https://github.com/metaplex-foundation/umi/commit/e566c1ba7232e1020234a750ec83607d50f60c56), [`acdc77a`](https://github.com/metaplex-foundation/umi/commit/acdc77af0f6c6e231b42b22e116497908043c57c)]: - - @metaplex-foundation/umi-core@0.3.1 - - @metaplex-foundation/umi-web3js-adapters@0.3.1 - -## 0.3.0 - -### Patch Changes - -- Updated dependencies [[`95d56e9`](https://github.com/metaplex-foundation/umi/commit/95d56e969b3da53e7b60758db4c530d206765697)]: - - @metaplex-foundation/umi-core@0.3.0 - - @metaplex-foundation/umi-web3js-adapters@0.3.0 - -## 0.2.3 - -### Patch Changes - -- Updated dependencies [[`697bddd`](https://github.com/metaplex-foundation/umi/commit/697bddd6cdd520bd1f9190eb9827c3f351512145)]: - - @metaplex-foundation/umi-core@0.2.3 - - @metaplex-foundation/umi-web3js-adapters@0.2.3 - -## 0.2.2 - -### Patch Changes - -- [`e1c9595`](https://github.com/metaplex-foundation/umi/commit/e1c9595dd7f0aeb4469e86a496bc25bbb43a1b5d) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Rename MetaplexError to UmiError - -- Updated dependencies [[`e1c9595`](https://github.com/metaplex-foundation/umi/commit/e1c9595dd7f0aeb4469e86a496bc25bbb43a1b5d)]: - - @metaplex-foundation/umi-core@0.2.2 - - @metaplex-foundation/umi-web3js-adapters@0.2.2 - -## 0.2.1 - -### Patch Changes - -- Updated dependencies [[`d28f4dc`](https://github.com/metaplex-foundation/umi/commit/d28f4dc05c45f35a429fa818e060aed648778718)]: - - @metaplex-foundation/umi-core@0.2.1 - - @metaplex-foundation/umi-web3js-adapters@0.2.1 - -## 0.2.0 - -### Minor Changes - -- [`b4d681f`](https://github.com/metaplex-foundation/umi/commit/b4d681fd173fb5cc6fe7907c610a23703695c4f6) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Rename Metaplex to Umi - -### Patch Changes - -- Updated dependencies [[`b4d681f`](https://github.com/metaplex-foundation/umi/commit/b4d681fd173fb5cc6fe7907c610a23703695c4f6)]: - - @metaplex-foundation/umi-core@0.2.0 - - @metaplex-foundation/umi-web3js-adapters@0.2.0 - -## 0.1.2 - -### Patch Changes - -- [`d3ee23a`](https://github.com/metaplex-foundation/umi/commit/d3ee23aa7ee19a4c6db0e3556e58ee4d12b8ab2b) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Ensure all packages are built before trying to publish - -- Updated dependencies [[`d3ee23a`](https://github.com/metaplex-foundation/umi/commit/d3ee23aa7ee19a4c6db0e3556e58ee4d12b8ab2b)]: - - @metaplex-foundation/umi-core@0.1.2 - - @metaplex-foundation/umi-web3js-adapters@0.1.2 - -## 0.1.1 - -### Patch Changes - -- [`f30119d`](https://github.com/metaplex-foundation/umi/commit/f30119daf5c51d893c654a064f5fabeb9246aa41) Thanks [@lorisleiva](https://github.com/lorisleiva)! - Publish a new version with changelog and a release tag - -- Updated dependencies [[`f30119d`](https://github.com/metaplex-foundation/umi/commit/f30119daf5c51d893c654a064f5fabeb9246aa41)]: - - @metaplex-foundation/umi-core@0.1.1 - - @metaplex-foundation/umi-web3js-adapters@0.1.1 From 4f5653fa66a4aa86ef77d78bff0bed5894dcb3cb Mon Sep 17 00:00:00 2001 From: JesseTheRobot Date: Thu, 9 Nov 2023 21:34:59 +0000 Subject: [PATCH 7/7] chore: :art: Apply linting & formatting --- .../src/createIrysUploader.ts | 39 ++++++++++++------- packages/umi-uploader-irys/src/plugin.ts | 5 +-- .../test/IrysUploader.test.ts | 6 +-- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/packages/umi-uploader-irys/src/createIrysUploader.ts b/packages/umi-uploader-irys/src/createIrysUploader.ts index a3a790f8..99d5602d 100644 --- a/packages/umi-uploader-irys/src/createIrysUploader.ts +++ b/packages/umi-uploader-irys/src/createIrysUploader.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line import/no-named-default -import type { default as NodeIrys, WebIrys } from '@irys/sdk'; +import type { default as NodeIrys, WebIrys } from '@irys/sdk'; import { Commitment, Context, @@ -138,12 +138,13 @@ export function createIrysUploader( const promises = files.map(async (file) => { const buffer = Buffer.from(file.buffer); - const irysTx = irys.createTransaction(buffer, { tags: getGenericFileTagsWithContentType(file)}) - await irysTx.sign() + const irysTx = irys.createTransaction(buffer, { + tags: getGenericFileTagsWithContentType(file), + }); + await irysTx.sign(); const { status, data } = await irys.uploader.uploadTransaction(irysTx); - if (status >= 300) { throw new AssetUploadFailedError(status); } @@ -205,10 +206,12 @@ export function createIrysUploader( const withdraw = async (amount: SolAmount): Promise => { const irys = await getIrys(); - try{ + try { await irys.withdrawBalance(amountToBigNumber(amount)); - }catch(e: any){ - throw new IrysWithdrawError( (e instanceof Error) ? e.message : e.toString()); + } catch (e: any) { + throw new IrysWithdrawError( + e instanceof Error ? e.message : e.toString() + ); } }; @@ -271,11 +274,14 @@ export function createIrysUploader( keypair: Keypair, options: any ): Promise => { - const bPackage = _removeDoubleDefault( - await import('@irys/sdk') - ); + const bPackage = _removeDoubleDefault(await import('@irys/sdk')); // eslint-disable-next-line new-cap - return new bPackage.default({url: address, token: currency, key: keypair.secretKey, config: options}); + return new bPackage.default({ + url: address, + token: currency, + key: keypair.secretKey, + config: options, + }); }; const initWebIrys = async ( @@ -329,10 +335,13 @@ export function createIrysUploader( }, }; - const bPackage = _removeDoubleDefault( - await import('@irys/sdk') - ); - const irys = new bPackage.WebIrys({url: address, token: currency, wallet: {provider: wallet}, config: options}); + const bPackage = _removeDoubleDefault(await import('@irys/sdk')); + const irys = new bPackage.WebIrys({ + url: address, + token: currency, + wallet: { provider: wallet }, + config: options, + }); try { // Try to initiate irys. diff --git a/packages/umi-uploader-irys/src/plugin.ts b/packages/umi-uploader-irys/src/plugin.ts index f5f0cbd1..c9980d74 100644 --- a/packages/umi-uploader-irys/src/plugin.ts +++ b/packages/umi-uploader-irys/src/plugin.ts @@ -1,8 +1,5 @@ import type { UmiPlugin } from '@metaplex-foundation/umi'; -import { - IrysUploaderOptions, - createIrysUploader, -} from './createIrysUploader'; +import { IrysUploaderOptions, createIrysUploader } from './createIrysUploader'; export const irysUploader = (options?: IrysUploaderOptions): UmiPlugin => ({ install(umi) { diff --git a/packages/umi-uploader-irys/test/IrysUploader.test.ts b/packages/umi-uploader-irys/test/IrysUploader.test.ts index 7931c579..7dcd0167 100644 --- a/packages/umi-uploader-irys/test/IrysUploader.test.ts +++ b/packages/umi-uploader-irys/test/IrysUploader.test.ts @@ -11,7 +11,7 @@ import { web3JsEddsa } from '@metaplex-foundation/umi-eddsa-web3js'; import { fetchHttp } from '@metaplex-foundation/umi-http-fetch'; import { web3JsRpc } from '@metaplex-foundation/umi-rpc-web3js'; import test from 'ava'; -import { irysUploader, IrysUploaderOptions } from '../src'; +import { irysUploader, IrysUploaderOptions } from '../src'; test('example test', async (t) => { t.is(typeof irysUploader, 'function'); @@ -19,9 +19,7 @@ test('example test', async (t) => { // TODO(loris): Unskip these tests when we can mock the Irys API. -const getContext = async ( - options?: IrysUploaderOptions -): Promise => { +const getContext = async (options?: IrysUploaderOptions): Promise => { const context = createUmi().use({ install(umi) { umi.use(web3JsRpc('https://metaplex.devnet.rpcpool.com/'));