> ## 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.

# Class: SpaceportUtils

[utils](./utils).SpaceportUtils

Utility functions for the Spaceport SDK

## Table of contents

#### General Methods

* [getNonce](#getnonce)
* [fetchQueueNonce](#fetchqueuenonce)

### Job Status Methods

* [pollJobStatus](#polljobstatus)

### IPFS Properties

* [ipfs](#ipfs)

### constructor

• **new SpaceportUtils**(`apiBaseUrl`, `client?`): [`SpaceportUtils`](./spaceport-utils)

#### Parameters

| Name         | Type                               |
| :----------- | :--------------------------------- |
| `apiBaseUrl` | `string`                           |
| `client?`    | [`SpaceportSDK`](../spaceport-sdk) |

#### Returns

[`SpaceportUtils`](./spaceport-utils)

## General Methods

### getNonce

▸ **getNonce**(`userAddress`): `Promise`\<`number`>

Gets the current nonce for a user from the blockchain contract.
This is required for generating valid signatures for contract interactions.

#### Parameters

| Name          | Type              | Description                      |
| :------------ | :---------------- | :------------------------------- |
| `userAddress` | \`0x\$\{string}\` | The address to get the nonce for |

#### Returns

`Promise`\<`number`>

The current nonce for the user

### fetchQueueNonce

▸ **fetchQueueNonce**(`walletAddress`): `Promise`\<`number`>

Fetch nonce from the queue service
This gets the current nonce for transaction ordering from the queue management system.

#### Parameters

| Name            | Type     | Description                       |
| :-------------- | :------- | :-------------------------------- |
| `walletAddress` | `string` | Wallet address to fetch nonce for |

#### Returns

`Promise`\<`number`>

Promise resolving to nonce number

**`Example`**

```typescript theme={null}
const nonce = await sdk.utils.fetchQueueNonce('0x1234567890abcdef...');
console.log(`Current queue nonce: ${nonce}`);
```

## Job Status Methods

### pollJobStatus

▸ **pollJobStatus**(`jobId`, `options?`): `Promise`\<[`JobStatusResponse`](../types/job-status-response)>

Polls job status until completion or timeout.
This function continuously checks the status of a job until it completes, fails, or times out.

#### Parameters

| Name      | Type                                              | Description               |
| :-------- | :------------------------------------------------ | :------------------------ |
| `jobId`   | `string`                                          | The ID of the job to poll |
| `options` | [`JobStatusOptions`](../types/job-status-options) | Polling options           |

#### Returns

`Promise`\<[`JobStatusResponse`](../types/job-status-response)>

Promise that resolves with the final job status

## IPFS Properties

### ipfs

• **ipfs**: `Object`

IPFS utilities

#### Type declaration

| Name             | Type                                                                 | Description |
| :--------------- | :------------------------------------------------------------------- | :---------- |
| `uploadFile`     | (`file`: `File`) => `Promise`\<`string`>                             | -           |
| `uploadMetadata` | (`metadata`: `Record`\<`string`, `unknown`>) => `Promise`\<`string`> | -           |
