Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/provider list #207

Merged
merged 3 commits into from
May 21, 2024
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
4 changes: 2 additions & 2 deletions minipfs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kodadot1/minipfs",
"version": "0.4.3-rc.1",
"version": "0.4.3-rc.2",
"description": "",
"repository": "kodadot/packages",
"license": "MIT",
Expand Down Expand Up @@ -28,7 +28,7 @@
"test": "vitest run"
},
"dependencies": {
"ofetch": "^1.3.3"
"ofetch": "^1.3.4"
},
"devDependencies": {
"@nuxtjs/eslint-config-typescript": "latest",
Expand Down
30 changes: 21 additions & 9 deletions minipfs/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions minipfs/src/gateways.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,46 @@ export const PINATA_GATEWAY: HTTPS_URI = 'https://gateway.pinata.cloud'

// LIST: https://ipfs.github.io/public-gateway-checker/
export type IPFSProviders =
| 'apillon'
| 'aragon'
| 'astyanax'
| 'cf'
| 'cloudflare'
| 'dweb'
| 'filebase_kodadot'
| 'fission'
| 'fleek'
| 'gateway'
| 'infura'
| 'infura_kodadot1'
| 'ipfs'
| 'kodadot'
| 'kodadot_beta'
| 'nectarnode'
| 'nftstorage'
| 'rmrk'
| 'storry'
| 'w3s'

export type AvailableProviders = IPFSProviders[]

export const ipfsProviders: Record<IPFSProviders, HTTPS_URI> = {
apillon: 'https://ipfs.apillon.io',
aragon: 'https://ipfs.eth.aragon.network',
astyanax: 'https://ipfs.astyanax.io',
cf: 'https://cf-ipfs.com',
cloudflare: 'https://cloudflare-ipfs.com',
dweb: 'https://dweb.link',
filebase_kodadot: 'https://kodadot-ultra.myfilebase.com',
fission: 'https://ipfs.runfission.com',
fleek: 'https://ipfs.fleek.co',
gateway: 'https://gateway.ipfs.io',
infura: 'https://infura-ipfs.io',
infura_kodadot1: 'https://kodadot1.infura-ipfs.io',
ipfs: 'https://ipfs.io',
kodadot: 'https://image.w.kodadot.xyz',
kodadot_beta: 'https://image-beta.w.kodadot.xyz',
nectarnode: 'https://ipfs.nectarnode.io',
nftstorage: 'https://nftstorage.link',
rmrk: 'https://ipfs2.rmrk.link'
rmrk: 'https://ipfs2.rmrk.link',
storry: 'https://ipfs.storry.tv',
w3s: 'https://ipfs.w3s.link'
}

const DEFAULT_PROVIDER_LIST: AvailableProviders = [
Expand All @@ -64,7 +68,6 @@ export const getProperURI = (
}

export const getGatewayURI =
(uri: IPFS_PATH | IPNS_PATH) =>
(provider: IPFSProviders): HTTPS_URI => {
return `${ipfsProviders[provider]}${uri}`
}
(uri: IPFS_PATH | IPNS_PATH) => (provider: IPFSProviders): HTTPS_URI => {
return `${ipfsProviders[provider]}${uri}`
}
2 changes: 1 addition & 1 deletion minipfs/src/magic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AvailableProviders, IPFSProviders, getProperURI } from './gateways'
import { AvailableProviders, getProperURI, IPFSProviders } from './gateways'
import { obtain, obtainFast } from './obtain'
import { competition } from './race'
import { sanitize } from './sanitize'
Expand Down