Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Rename IpfsUploader to PinataUploader #503

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/core/classes/ipfs-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
replaceHashWithGatewayUrl,
resolveGatewayUrl,
} from "../helpers/storage";
import { IpfsUploader } from "../uploaders/ipfs-uploader";
import { PinataUploader } from "../uploaders/pinata-uploader";
import { UploadProgressEvent } from "../../types/events";
import { File } from "@web-std/file";
import FormData from "form-data";
Expand All @@ -33,7 +33,7 @@ export class IpfsStorage implements IStorage {

constructor(
gatewayUrl: string = DEFAULT_IPFS_GATEWAY,
uploader: IStorageUpload = new IpfsUploader(),
uploader: IStorageUpload = new PinataUploader(),
) {
this.gatewayUrl = `${gatewayUrl.replace(/\/$/, "")}/`;
this.uploader = uploader;
Expand Down Expand Up @@ -297,7 +297,7 @@ export class IpfsStorage implements IStorage {
signerAddress?: string,
): Promise<string> {
// TODO move down to IStorageUpload
const token = await (this.uploader as IpfsUploader).getUploadToken(
const token = await (this.uploader as PinataUploader).getUploadToken(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this function here? It's doing a lot of things that we shouldn't be doing - for one it's using an internal function of a single IPFS implementation in the top-level class (this won't work once we add more uploaders), and also its exposed publicly even though its marked as internal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contractAddress || "",
);
const metadata = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import FormData from "form-data";
/**
* @internal
*/
export class IpfsUploader implements IStorageUpload {
export class PinataUploader implements IStorageUpload {
/**
* Fetches a one-time-use upload token that can used to upload
* a file to storage.
Expand Down