Class: Listing
resources/listings.ListingClient
The ListingClient is used to manage listings on the Spaceport marketplace. A listing is an offer made by a licensor to license one or more assets under specific terms, such as price, duration, and royalties. This client handles creating and querying these listings.
Table of contents
Methods
constructor
• new ListingClient(client
): ListingClient
Parameters
Name | Type |
---|---|
client | SpaceportSDK |
Returns
Methods
getAll
▸ getAll(params?
): Promise
<CoreListing
[]>
Gets all listings with optional filtering parameters.
Parameters
Name | Type | Description |
---|---|---|
params? | Object | Optional filtering parameters. |
params.status? | string | - |
params.id? | string | string [] | - |
params.listingAddress? | string | - |
params.listingId? | string | - |
params.organization? | string | - |
Returns
Promise
<CoreListing
[]>
Array of listings or empty array if none found.
getById
▸ getById(id
): Promise
<CoreListing
>
Gets a single listing by ID.
Parameters
Name | Type | Description |
---|---|---|
id | string | The ID of the listing to retrieve. |
Returns
Promise
<CoreListing
>
The listing data or throws error if not found.
create
▸ create(params
): Promise
<{ success
: boolean
; message
: string
; jobId
: string
; listingId
: string
}>
Creates a listing using the server-side API endpoint. This method delegates the listing creation to the backend API which handles the necessary processing and platform interactions via a job queue system.
Parameters
Name | Type | Description |
---|---|---|
params | CreateListingApiParams & { assetIds : string [] ; userId : string ; organizationId? : string } | Parameters for creating the listing. |
Returns
Promise
<{ success
: boolean
; message
: string
; jobId
: string
; listingId
: string
}>
Object containing success status, job ID, and listing ID.
Example