new()

List an Asset, multiple Assets or a Collection of Assets

Create a new listing for a provided assetId, or new listings for provided assetIds or collectionId. Price and (currency or currencyId) are required.

Parameters

export type ListingNewProps = {
    price: number;
    assetId?: string; 
    assetIds?: string[]; 
    collectionId?: string;
    liveTime?: number;
    status?: ListingUpdateStatus;
    walletUserId?: string;
    currencyId?: string;
    currency?: string;
}

Examples

const createListingResponse = await assetlayer.listings.new({
    assetId: 'assetId',
    currency: 'USD',
    price: 1
});
const createListingsResponse = await assetlayer.listings.new({
    assetIds: ['assetId_1', 'assetId_2'],
    currencyId: 'currencyId',
    price: 100
});

Return Types

type ReturnType = CreateListingResponse | CreateListingsResponse;

Alternatives

Last updated