Spaces:
Sleeping
Sleeping
Download meteora/node_modules/@solana/web3.js/src/fetch-impl.ts from Trireme/hyper_dashboard: direct link, hf CLI and curl.
- Browser
- Download file 608 Bytes
-
https://huggingface.co/spaces/Trireme/hyper_dashboard/resolve/main/meteora/node_modules/%40solana/web3.js/src/fetch-impl.ts
- Command line
-
hf download hf://spaces/Trireme/hyper_dashboard/meteora/node_modules/@solana/web3.js/src/fetch-impl.ts
-
curl -L -o fetch-impl.ts https://huggingface.co/spaces/Trireme/hyper_dashboard/resolve/main/meteora/node_modules/%40solana/web3.js/src/fetch-impl.ts
608 Bytes
| import * as nodeFetch from 'node-fetch'; | |
| export default (typeof globalThis.fetch === 'function' | |
| ? // The Fetch API is supported experimentally in Node 17.5+ and natively in Node 18+. | |
| globalThis.fetch | |
| : // Otherwise use the polyfill. | |
| async function ( | |
| input: nodeFetch.RequestInfo, | |
| init?: nodeFetch.RequestInit, | |
| ): Promise<nodeFetch.Response> { | |
| const processedInput = | |
| typeof input === 'string' && input.slice(0, 2) === '//' | |
| ? 'https:' + input | |
| : input; | |
| return await nodeFetch.default(processedInput, init); | |
| }) as typeof globalThis.fetch; | |