stargaze-studio/services/upload/nft-storage.ts
Serkan Reis 7d22328543
Include the whitelist contract address in the collection creation info box (#6)
* Add whitelist contract address to the collection creation result box

* Account for the no whitelist option
2022-09-11 20:54:28 +03:00

9 lines
348 B
TypeScript

import type { CIDString } from 'nft.storage'
import { NFTStorage } from 'nft.storage'
export const uploadToNftStorage = async (fileArray: File[], nftStorageApiKey: string): Promise<CIDString> => {
console.log('Uploading to NFT.Storage...')
const client = new NFTStorage({ token: nftStorageApiKey })
return client.storeDirectory(fileArray)
}