Class: SpaceportUtils
utils.SpaceportUtils
Utility functions for the Spaceport SDK
Table of contents
General Methods
Job Status Methods
IPFS Properties
constructor
• new SpaceportUtils(apiBaseUrl
, client?
): SpaceportUtils
Parameters
Name | Type |
---|---|
apiBaseUrl | string |
client? | SpaceportSDK |
Returns
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
Job Status Methods
pollJobStatus
▸ pollJobStatus(jobId
, options?
): Promise
<JobStatusResponse
>
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 | Polling options |
Returns
Promise
<JobStatusResponse
>
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 > | - |