> ## 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](./utils#uploadfiletoipfs)
* [uploadMetadataToIpfs](./utils#uploadmetadatatoipfs)

### References

* [toEnvironmentName](./utils#toenvironmentname)
* [getChainId](./utils#getchainid)
* [getChainName](./utils#getchainname)
* [createChainConfig](./utils#createchainconfig)
* [configureIpfs](./utils#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)
