| asReadableStream | Convert AsyncIterable or ReadableStream to ReadableStream |
| asyncIterableToReadableStream | Convert AsyncIterable to ReadableStream with broad browser compatibility. Provides fallback for environments where ReadableStream.from() is not available. |
| calculateLastProofDate | Calculate when the last proof should have been submitted based on current time |
| capabilitiesListToObject | Convert capability arrays to object map |
| claimTokens | - |
| clientFromTransport | Create a Viem public client from a transport configuration |
| createPieceUrl | Create a piece URL for the CDN or PDP API |
| createPieceUrlPDP | Create a piece URL for the PDP API |
| datasetMetadataObjectToEntry | Convert a dataset metadata object to an array of metadata entries to be signed. |
| dateToEpoch | Convert a JavaScript Date to a Filecoin epoch |
| decodeAddressCapability | Matches the behavior of address(uint160(BigEndian.decode(values[i]))) |
| decodePDPCapabilities | Decode PDP capabilities from keys/values arrays into a PDPOffering object. Based on Curio’s capabilitiesToOffering function. |
| decodePDPError | - |
| decodePDPOffering | Decode the PDP offering from the provider. |
| encodePDPCapabilities | Encode a PDPOffering plus optional user-supplied extras into the (keys[], values[]) tuple consumed by registerProvider / addProduct / updateProduct on ServiceProviderRegistry. |
| epochsToDays | Convert a number of epochs to whole days (floor division). |
| epochsToHours | Convert a number of epochs to whole hours (floor division). |
| epochToDate | Convert a Filecoin epoch to a JavaScript Date |
| fallbackRandIndex | - |
| fallbackRandU256 | - |
| formatBalance | - |
| formatFraction | - |
| formatUnits | - |
| isAsyncIterable | Type guard to check if a value is an AsyncIterable |
| isProviderExistsRevert | Check whether the given error is a revert emitted by the ServiceProviderRegistry.providerExists modifier (i.e. the provider ID is out of range or maps to an unoccupied storage slot). |
| isReadableStream | Type guard to check if a value is a ReadableStream |
| isUint8Array | Check if value is Uint8Array |
| isViemError | Check if the error is a viem error |
| metadataArrayToObject | - |
| parseUnits | Parse a value to a bigint. |
| pieceMetadataObjectToEntry | Convert a dataset metadata object to an array of metadata entries to be signed. |
| randIndex | Provides a random index into an array of supplied length (0 <= index < length) |
| randU256 | - |
| stringErrorEquals | Check if the error message equals the expected string |
| supportsStreamingFetchBody | Detect whether the current environment supports ReadableStream as a fetch request body. Firefox stringifies the stream to “[object ReadableStream]” instead of consuming it, and Safari silently ignores the stream body and the duplex option. This check catches both: a browser that stringifies will set Content-Type to text/plain (string body), and one that ignores duplex will fail the duplexAccessed gate. The try/catch handles any future browser that throws on the Request constructor. |
| timeUntilEpoch | Calculate the time until a future epoch |
| transportFromTransportConfig | Create a Viem public client from a transport configuration |
| uint8ArrayToAsyncIterable | Convert Uint8Array to async iterable with optimal chunk size. |