> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spaceport.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Module: utils

## Table of contents

### General Classes

* [SpaceportUtils](../classes/utils.SpaceportUtils)

### IPFS Functions

* [uploadFileToIpfs](https://docs.spaceport.xyz/sdk-reference/v0.1.0/utils/utils.md#uploadfiletoipfs)
* [uploadMetadataToIpfs](https://docs.spaceport.xyz/sdk-reference/v0.1.0/utils/utils.md#uploadmetadatatoipfs)

### References

* [toEnvironmentName](https://docs.spaceport.xyz/sdk-reference/v0.1.0/utils/utils.md#toenvironmentname)
* [getChainId](https://docs.spaceport.xyz/sdk-reference/v0.1.0/utils/utils.md#getchainid)
* [getChainName](https://docs.spaceport.xyz/sdk-reference/v0.1.0/utils/utils.md#getchainname)
* [createChainConfig](https://docs.spaceport.xyz/sdk-reference/v0.1.0/utils/utils.md#createchainconfig)
* [configureIpfs](https://docs.spaceport.xyz/sdk-reference/v0.1.0/utils/utils.md#configureipfs)

## IPFS Functions

### uploadFileToIpfs

▸ **uploadFileToIpfs**(`file`): `Promise`\<`string`>

Uploads a file to IPFS and returns the IPFS URL

#### Parameters

| Name | Type | Description |
| :- | :- | :- |
| `file` | `File` | The file to upload |

#### Returns

`Promise`\<`string`>

The IPFS URL of the uploaded file

### uploadMetadataToIpfs

▸ **uploadMetadataToIpfs**(`metadata`): `Promise`\<`string`>

Uploads metadata to IPFS and returns the IPFS URL

#### Parameters

| Name | Type | Description |
| :- | :- | :- |
| `metadata` | `Record`\<`string`, `unknown`> | The metadata to upload |

#### Returns

`Promise`\<`string`>

The IPFS URL of the uploaded metadata

## References

### toEnvironmentName

Re-exports [toEnvironmentName](utils_chain.md#toenvironmentname)

***

### getChainId

Re-exports [getChainId](utils_chain.md#getchainid)

***

### getChainName

Re-exports [getChainName](utils_chain.md#getchainname)

***

### createChainConfig

Re-exports [createChainConfig](utils_chain.md#createchainconfig)

***

### configureIpfs

Re-exports [configureIpfs](utils_ipfs.md#configureipfs)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.