Search…
cargo.api
cargo.api exposes methods that can be called without an Ethereum enabled browser (provider) along with methods that require an Ethereum enabled browser. Methods that require a provider can be called after calling cargo.enable . Some methods will require authentication. An authentication token is provided after calling the register, or authenticate methods - both of which require an Ethereum enabled browser.

How things are documented

Each method will be described in English and then an example call of the method will be documented. Arguments are described using English while return types are described using TypeScript types. Arguments are required unless they are specified as optional.

Emoji Legend

🌎 - Open method, authentication not required
🦊 - Method requiring MetaMask, or similar Web3 browser or extension. These methods use Web3 API's.
πŸ”’ - Authenticated method, authentication required. A pre-requisite to authentication is getting an access token and to get an access token requires MetaMask or something like it. So by default all authenticated methods are also 🦊.
πŸ• - Optional authenticated method. Authentication is optional and may affect response.
​

Get a list of collectibles by project ID 🌎

You can use this method to get a paginated list of NFTs for a given project, or smart contract on Cargo. You can get the project ID for your project from the URL bar when viewing the project on the Cargo website.
1
cargo.api.getTokensByProject(options).then(response => {
2
// Do something with response
3
});
Copied!
Arguments
Response
Argument
Description
options
An object containing the following properties:
  • projectId - Required. ID of the contract you wish to query
  • page - Optional. Optional page for pagination.
  • limit - Optional. Limit the number of results returned. Defaults to 10.
  • ownerAddress - Optional. Only tokens owned by this address will be returned in the response.
1
type SuccessResponse = {
2
err: false,
3
status: 200,
4
data: {
5
// Contract name
6
name: string;
7
8
// Contract symbol
9
symbol: string;
10
11
// Array of tokens
12
results: {
13
tokenId: string;
14
metadata: { [key: string]: any };
15
tokenURI: string;
16
resaleItem?: {
17
seller: string;
18
contract: string;
19
tokenId: string;
20
price: string;
21
signatureGenerated: boolean;
22
crate?: string;
23
metadata: { [key: string]: any };
24
}
25
}[],
26
27
// Total number of tokens in contract,
28
// or total number of tokens owned by address
29
// passed as "ownerAddress"
30
totalSupply: string;
31
32
// Current page
33
page: string;
34
35
// Limit
36
limit: string;
37
38
// Total number of pages
39
totalPages: string;
40
}
41
}
Copied!

Get collectible details 🌎

You can use this method the get details for a given collectible.
1
cargo.api.getTokenDetails(projectId, collectibleId).then(response => {
2
// Do something with response
3
});
Copied!
Arguments
Response
Argument
Description
projectId
The ID of the project on Cargo. This can be found in the URL bar when viewing the project on Cargo.
collectibleId
The ID of the collectible within the collection.
1
type Response = {
2
err: boolean,
3
status: number,
4
data: {
5
// Username of owner
6
owner?: string,
7
8
// Address of owner
9
ownerAddress: string,
10
11
// If this item is for sale, details about sale
12
resaleItem?: {
13
seller: string,
14
contract: string,
15
tokenId: string,
16
price: string,
17
signatureGenerator?: boolean,
18
groupId: string
19
crate: string,
20
createdAt: string,
21
},
22
23
// Collectible ID
24
tokenId: string,
25
26
// Name of collection token belongs to
27
contractName: string,
28
29
// Symbol of collection token belongs to
30
contractSymbol: string,
31
}
32
}
Copied!

Get a list of collectibles that are for sale 🌎 πŸ•

You can use this method to get a paginated list of collectibles that are for sale. You can filter collectibles in the response. See arguments for details.
1
cargo.api.getResaleItems(options).then(response => {
2
// Do something with response
3
});
Copied!
Arguments
Response
Argument
Description
options
An object that contains the following properties:
  • showcaseId - Optional. String. Display resale items by a given showcase.
  • projectId - Optional. String. The ID of the project (smart contract) on Cargo. Use this over collectionAddress.
  • collectionId - Optional. String. Display resale items for a given collection.
  • collectionAddress - Optional. String. Display resale items for a given collection address.
  • chain - Optional. eth or xdai. Specify chain.
  • page - Optional. String. Page in results to display.
  • limit - Optional. String. Limit of results per page.
  • owned - Optional. Boolean. Display resale items that are owned by the current authenticated user only.
  • slug - Optional. String. Filter resale items by showcase slug. Can be used as an alternative to showcaseId. slugId required when this is passed.
  • slugId - Optional. String. Required when slug is passed
  • seller - Optional. String. Ethereum wallet address of seller. Will only return items for this seller.
  • sort - Optional. String. One of new , high-to-low , or low-to-high
  • filter- Optional. An Object containing the following keys and values:
    • containsGems - Optional. Boolean.
    • builtOnCargo - Optional. Boolean.
    • currency - Optional. Array<ERC20Address | 'ether'> An array of ERC-20 addresses, or the string ether
    • threed - Optional. Boolean.
    • audio - Optional. Boolean.
    • video - Optional. Boolean.
    • image - Optional. Boolean.
1
type SuccessResponse = {
2
err: false,
3
status: 200,
4
data: {
5
limit: string;
6
page: string;
7
totalPages: string;
8
results: {
9
// Will be blank if ERC-721. If ERC-1155
10
// type will be '1155'
11
type: '1155' | void;
12
seller: string;
13
// ID of the collection
14
contract: string;
15
// Id of the collectible
16
tokenId: string;
17
// Price in Wei that the collectible is selling for
18
price: string;
19
// If owned is true this will show the user if purchase signatures
20
// have been generated. If they have cancelling the sale safely will
21
// require a transaction to be submitted.
22
signatureGenerated?: boolean;
23
// Will only be in response if owned is set to true. This can be
24
// used to safely cancel a sale. You can use the cancelSale method
25
// and Cargo JS will handle this for you.
26
groupId?: string;
27
// Showcase ID resale item belongs to
28
crate?: string;
29
createdAt: string;
30
}[]
31
}
32
}
Copied!

Get a list of collections on Cargo 🌎 πŸ•

You can use this method to get a paginated list of collections (ERC-721 contracts). You can filter contracts in the response. See arguments for details.
1
cargo.api.getContracts(options).then(response => {
2
// Do something with response
3
});
Copied!
Arguments
Response
Argument
Description
options
An object containing the following properties:
  • page - Optional. String. Page of results to display. Defaults to 1.
  • limit - Optional. String. Limit of collections per page. Defaults to 10.
  • showcaseId - Optional. String. Limit results to show only collections in the given showcase.
  • owned - Optional. Boolean. Show only collections that the current authenticated user owns.
  • address - Optional. String. Ethereum wallet address. If specified will only return collections for a given user.
  • skipAuth - Optional. Boolean. Will not use current logged in users address if true.
  • hasTokens - Optional. Boolean. Will only return collection if the user owns at least one NFT within that collection.
  • cargoContract - Optional. Boolean. Return only collections created on Cargo.
  • useAuthToken - Optional. Boolean. Show only collections that the current authenticated user either owns, or has collectibles in. Collections within response will contain an additional contractTokens property stating how many collectibles the user owns within that collection. This takes precedence over the owned parameter.
1
type Response = {
2
err: boolean,
3
status: number,
4
data: {
5
results: {
6
// ID of collection
7
_id: string,
8
address: string,
9
name: string,
10
symbol: string,
11
supportsMetadata: boolean,
12
createdAt: string,
13
// total number of owned collectibles in collection
14
// Available only when useAuthToken === true
15
totalOwned?: number,
16
// Available only when useAuthToken === true
17
owned?: boolean,
18
}[],
19
limit: string,
20
totalPages: string,
21
total: string,
22
page: string,
23
}
24
}
Copied!

Get a showcase by ID 🌎 πŸ•

You can use this method to get information about a showcase by it's ID. If the showcase is private you will need to be authenticated and be either the owner or the vendor of that showcase.
1
cargo.api.getShowcaseById(showcaseId, auth).then(res => {
2
// do something with response
3
});
Copied!
Arguments
Response
Argument
Description
showcaseId
Required. String. The ID of the showcase
auth
Optional. Boolean. If true you must be authenticated and your authentication token will be sent in with the request. This will be required to get information about a private showcase.
1
type SuccessResponse = {
2
err: false,
3
status: 200,
4
data: {
5
name: string,
6
createdAt: string,
7
public: boolean,
8
slug: string,
9
slugId: string,
10
owner: string,
11
resellingEnabled: boolean,
12
isOwner?: boolean;
13
isVendor?: boolean;
14
}
15
}
Copied!

Get a showcase by it's slug 🌎

You can use this method to get a showcase by its slug and slug ID.
1
cargo.api.getShowcaseBySlug(slug, slugId).then(res => {
2
// do something
3
});
Copied!
Arguments
Response
Argument
Description
slug
Required. String. The slug of the showcase
slugId
Required. String. Slug ID of the showcase.
1
type SuccessResponse = {
2
err: false,
3
status: 200,
4
data: {
5
name: string,
6
createdAt: string,
7
public: boolean,
8
slug: string,
9
slugId: string,
10
owner: string,
11
resellingEnabled: boolean,
12
isOwner?: boolean;
13
isVendor?: boolean;
14
}
15
}
Copied!

Get information about a collection 🌎 πŸ•

You can use this method to get information about a project on Cargo. If an auth token is present then an additional isOwned value will be returned in the response.
1
cargo.api.getProjectMetadata(id, useAuth)
2
.then(response => {
3
// Use response
4
});
Copied!
Arguments
Response
Argument
Description
projectId
Required. The ID of the project. This can be found in the URL bar when viewing the project on Cargo.
useAuth
Optional. If true this method requires authentication. Will return isOwned boolean in response.
1
type SuccessResponse = {
2
err: false;
3
status: 200;
4
data: {
5
totalSupply: number;
6
address: string;
7
name: string;
8
cargoContract: boolean;
9
symbol: string;
10
supportsMetadata: boolean;
11
createdAt: string;
12
}
13
}
Copied!

Get orders πŸ”’

You can retrieve orders for collectible sales which relate to you.
1
cargo.api.orders(options).then(res => {
2
// do something with response
3
});
Copied!
Arguments
Argument
Description
options
An object that contains the following:
  • contractAddress - Optional. String. Collection address to filter orders by
  • vendorId - Optional. String
  • sellerAddress - Optional. String
  • buyerAddress - Optional. String
  • tokenId - Optional. String
  • crateId - Optional. String. Showcase ID
  • from - Optional. String. ISO date string
  • to - Optional. String. ISO date string
  • limit - Optional. String. Limit of results per page
  • page - Optional. String. Page of paginated results to return

Bulk metadata update πŸ”’

You can use this method to update the metadata for many collectibles in a collection at one time. Existing metadata for specified collectibles will be replaced.
1
// Updates are made using an object where the keys represent the
2
// token ID to be updated and the value is a JSON serializable object
3
// which is the update.
4
​
5
// For example:
6
const updates = {
7
// 1 is the ID of the collectible and the value
8
// is the new metadata
9
1: {
10
name: 'Crypto hero',
11
description: 'Something about this collectible',
12
},
13
2: {
14
name: 'Crypto Goblin',
15
description: 'Something about this collectible',
16
},
17
}
18
​
19
cargo.api.bulkMetadataUpdate(collectionAddress, updates, chain).then(response => {
20
if(response.status === 200) {
21
// success
22
}
23
});
Copied!
Arguments
Response
Argument
Description
collectionAddress
The collection in which to update collectible metadata
updates
An object where keys represent the collectible ID and the value is a JSON serializable object containing the new metadata
chain
Optional. Leave blank for Ethereum, valid options are xdai and matic
1
type SuccessResponse = {
2
status: 200,
3
err: false,
4
data: {
5
code: 'success',
6
}
7
}
Copied!

Add collectibles to a showcase πŸ”’

You can use this method to add individual NFTs to a showcase.
1
cargo.api.addCollectiblesToShowcase(items, showcaseId).then(response => {
2
if(response.status === 200) {
3
// Success
4
}
5
});
Copied!
Arguments
Response
Argument
Description
items
An object where the keys are collection addresses and the values are arrays of token IDs. Ex:{[collectionAddress]: [1, 2, 3]}
showcaseId
The ID of the showcase to add the collectibles to.
1
type SuccessResponse = {
2
err: false,
3
status: 200,
4
data: {
5
success: true,
6
}
7
}
Copied!

Remove collectibles from a showcase πŸ”’

You can use this method to remove NFTs from a showcase.
1
cargo.api.removeCollectiblesFromShowcase(items, showcaseId).then(res => {
2
if(res.err === false) {
3
// done
4
}
5
});
Copied!
Arguments
Response
Argument
Description
items
An object where the keys are collection addresses and the values are arrays of token IDs. Ex:{[collectionAddress]: [1, 2, 3]}
showcaseId
The ID of the showcase to remove collectibles from.
1
type SuccessResponse = {
2
err: false,
3
status: 200,
4
data: {
5
success: true,
6
}
7
}
Copied!

Get collectibles for a user by collection 🌎 πŸ•

You can use this to get the owned collectibles for a user in a given collection. The contractId is not the address of the collection, but the ID which can be retrieved using the getContracts method.
1
cargo.api.getUserTokensByContract(options).then(response => {
2
// Do something with response
3
});
Copied!
Arguments
Response
Argument
Description
options
An object that has the following properties:
  • page - Optional. String. Page of results to display.
  • limit - Optional. String. Limit of results to display per page.
  • contractId - Required. String. ID of collection
  • address - Optional. String. Ethereum wallet address of user. Should set skipAuth option to true when using address.
  • skipAuth - Optional. Boolean. Skips using the current logged in users address and will use the address value.
1
type SuccessResponse = {
2
err: false,
3
status: 200,
4
data: {
5
results: {
6
tokenId: string,
7
metadata: {},
8
tokenURI: string,
9
}[],
10
limit: string,
11
totalPages: string,
12
page: string,
13
total: string
14
}
15
}
Copied!

Get all collectibles for a user 🌎

You can use this method to get all compatible collectibles for a given Ethereum wallet. The wallet needs to be associated with a registered user on Cargo.
1
cargo.api.getAllUserCollectibles(options).then(res => {
2
if(res.err === false) {
3
// do something
4
}
5
});
Copied!
Arguments
Response
Argument
Description
options
An Object containing the following properties
  • address - Required. String. The Ethereum wallet to fetch NFTs for.
  • page - Optional. String. The page used for pagination.
  • limit - Optional. String. The max number of results to return.
1
type SuccessResponse = {
2
results: {
3
tokenId: string;
4
metadata: Record<string, any>;
5
tokenURI: string;
6
resaleItem?: {
7
sellerAddress: string;
8
tokenAddress: string;
9
tokenId: string;
10
resaleItemId: string;
11
price: string;
12
fromVendor: boolean;
13
metadata: Record<string, any>;
14
};
15
owner: string;
16
collection: {
17
_id: string;
18
address: string;
19
name: string;
20
symbol: string;
21
supportsMetadata: boolean;
22
tags?: string[];
23
owned?: boolean;
24
totalOwned?: number;
25
createdAt: string;
26
};
27
}[];
28
page: string;
29
limit: string;
30
totalPages: string;
31
};
Copied!

Get showcases for a user πŸ”’

You can use this method to get a paginated list of the showcases the authenticated user has created.
1
cargo.api.getUserShowcases(options).then(response => {
2
// Do something with response
3
});
Copied!
Arguments
Response
Argument
Description
options
An optional object with the following properties:
  • page - String. Optional. Page number of results to return.
  • limit - String. Optional. Limit of results to display on each page.
1
type Response = {
2
err: boolean,
3
status: number,
4
data: {
5
results: {
6
name: string,
7
id: string,
8
}[],
9
10
// Total number of showcases created
11
total: string,
12
13
// Current page
14
page: string,
15
16
// Limit
17
limit: string,
18
19
// Total number of pages
20
totalPages: string,
21
}
22
}
Copied!

Get all collectibles in a showcase 🌎

You can use this method to get all collectibles in a given showcase.
1
cargo.api.getAllShowcaseItems(showcaseId, page, limit).then((res) => {
2
if(res.err === false){
3
// console.log(res.data);
4
}
5
});
Copied!
Arguments
Response
Argument
Description
showcaseId
Required. String. The ID of the showcase to retrieve items for
page
Optional. String. The page specified for pagination
limit
Optional. String. The max number of items to return in the response.
1
type SuccessResponse = {
2
err: false;
3
status: 200;
4
data: {
5
results: {
6
tokenId: string;
7
metadata: Record<string, any>;
8
resaleItem?: {
9
sellerAddress: string;
10
tokenAddress: string;
11
tokenId: string;
12
resaleItemId: string;
13
price: string;
14
fromVendor: boolean;
15
metadata: Record<string, any>;
16
};
17
collection: {
18
_id: string;
19
address: string;
20
name: string;
21
symbol: string;
22
supportsMetadata: boolean;
23
tags?: string[];
24
owned?: boolean;
25
totalOwned?: number;
26
createdAt: string
27
};
28
}[];
29
page: string;
30
totalPages: string;
31
limit: string;
32
}
33
}
Copied!

Get items for sale in a showcase 🌎

You can use this method to get a list of NFTs for sale in a given showcase.
1
cargo.api.getShowcaseItemsForSale(options).then((res) => {
2
if(res.err === false){
3
// do something
4
}
5
});
Copied!
Arguments
Argument
Description
options
Required. An Object containing the following keys and values
  • page - Optional. String. The page specified for pagination.
  • limit - Optional. String. The max number of items to return in the response.
  • showcaseId - Required. String. The showcase ID to retrieve items for.
  • sort - Optional. String. One of new , high-to-low , or low-to-high
  • filter - Optional. An Object containing the following keys and values:
    • containsGems - Optional. Boolean.
    • builtOnCargo - Optional. Boolean.
    • currency - Optional. Array<ERC20Address | 'ether'> An array of ERC-20 addresses, or the string ether
    • threed - Optional. Boolean.
    • audio - Optional. Boolean.
    • video - Optional. Boolean.
    • image - Optional. Boolean.

Get vendors in a showcase πŸ”’

You can use this method to get a paginated list of vendors for a given showcase. The authenticated user must be the owner of the showcase.
1
cargo.api.getShowcaseVendors(showcaseId, page, limit).then(response => {
2
// Do something with response
3
});
Copied!
Arguments
Response
Argument
Description
showcaseId
ID of showcase to return vendors for.
page
Page of results to start returning results at.
limit
Limit of results per page
1
type Response = {
2
err: boolean,
3
status: number,
4
data: {
5
results: {
6
// Address of vendor
7
address: string
8
9
// Cargo id of vendor
10
_id: string,
11
12
// Username of vendor
13
displayUsername: string,
14
}[],
15
16
// Total number of showcases created
17
total: string,
18
19
// Current page
20
page: string,
21
22
// Limit
23
limit: string,
24
25
// Total number of pages
26
totalPages: string,
27
}
28
}
Copied!

Get beneficiaries for a vendor πŸ”’

You can use this method to get a paginated list of beneficiaries for the given vendor. Vendors are in relation to a showcase so a showcase ID is also required.
1
cargo.api.getVendorBeneficiaries(vendorAddress, showcaseId).then(results => {
2
// Do something with results
3
});
Copied!
Arguments
Response
Argument
Description
vendorAddress
The address of the vendor
showcaseId
The showcase the vendor belongs to for which you'd like to retrieve beneficiaries for.
1
type Response = {
2
err: boolean,
3
status: number,
4
data: {
5
results: {
6
// The address of the beneficiary
7
address: string,
8
9
// The commission of the beneficiary
10
commission: string,
11
12
// The address of the vendor for whom this
13
// beneficiary belongs to
14
vendorAddress: string,
15
16
// The showcase ID
17
crateId: string,
18
19
// Timestamp for when the vendor was created
20
createdAt: string,
21
}[],
22
23
// Total number of showcases created
24
total: string,
25
26
// Current page
27
page: string,
28
29
// Limit
30
limit: string,
31
32
// Total number of pages
33
totalPages: string,
34
}
35
}
Copied!

Create an account 🦊

You can use this method to create a new Cargo account. The response will contain an JSON web token that is used to make authenticated requests. Cargo JS stores this token for you so you don't need to worry about storing it. When creating an account the user will be asked to sign a message to prove they are who they say they are. Email and username are optional. The email will be used to send notifications when the users collectibles have sold. The username will be displayed on Cargo and returned in various responses. The only requirement is that the user has a Web3 enabled wallet.
When creating accounts on Cargo your users must agree to the Cargo Terms of Service​
1
cargo.api.register(email, username).then(response => {
2
if(response.status === 200) {
3
// User has been created and is authenticated
4
// for future requests
5
}
6
});
Copied!
Arguments
Response
Argument
Description
email
Optional. Valid email address that will be tied to the account
username
Optional. Username to be used for new account
1
type Response = {
2
err: boolean,
3
status: number,
4
data: {
5
// JSON web token
6
token: string,
7
}
8
}
Copied!

Authenticate existing account 🦊

You can use this method to authenticate and existing account. The response will contain an JSON web token that is used to make authenticated requests. Cargo JS stores this token for you so you don't need to worry about storing it. When authenticating an account the user will be asked to sign a message to prove they are who they say they are.
1
cargo.api.authenticate().then((response) => {
2
if(response.status === 200){
3
// User is authenticated
4
}
5
});
Copied!
Arguments
Response
This method does not take any arguments.
1
type SuccessResponse = {
2
err: false,
3
status: 200,
4
data: {
5
// JSON web token
6
token: string
7
}
8
}
9
​
10
​
11
// If an account is required you will get this response
12
type AccountRequiredResponse = {
13
err: true,
14
status: 401,
15
data: {
16
code: 'account-required'
17
}
18
}
Copied!

Purchase a collectible 🦊

You can use this method to purchase a collectible. You do not need to have registered an account on Cargo to use this method. You will just need a Web3 enabled browser.
1
cargo.api.purchase(saleId, chain).then(txHash => {
2
// Transaction submitted
3
});
Copied!
Arguments
Response
Argument
Description
saleId
Required. The ID of the sale
chain
Required. Valid options arexdai or ethThe chain the NFT lives on.
The response will contain a transaction hash.

Transfer a collectible 🦊

You can use this method to transfer a collectible you own to another address.
1
cargo.api.transferCollectible(contractAddress, tokenId, toAddress).then(txHash => {
2
// Transaction submitted
3
});
Copied!
Arguments
Response
Argument
Description
contractAddress
The collection address for which the collectible belongs to.
tokenId
The ID of the collectible to transfer.
toAddress
The Ethereum address to transfer the collectible to.
The response will contain a transaction hash.

Burn a collectible 🦊

You can use this method to transfer a collectible you own to another address. The contract needs to be an ERC-721 contract created on Cargo, or a contract that supports the following function:
function burn(uint256 tokenId) public
1
cargo.api.burn(collectionAddress, tokenId).then(txHash => {
2
// Transaction submitted
3
});
Copied!
Arguments
Response
Argument
Description
collectionAddress
Address of collection
tokenId
The ID of the collectible to burn.
The response will contain a transaction hash.

Sell a collectible 🦊 πŸ•

Owners of a collectible can sell a collectible through Cargo by using this method. Cargo must be approved to transfer the collectible on your behalf. This method will verify that Cargo is approved to transfer your collectible. If Cargo is not approved the setApprovalForAll method will be called before marking the item for sale. Cargo
1
/**
2
Price should be converted to Wei if selling in Ether.
3
If selling in another currency the price should be converted based on the
4
decimal place set.
5
6
For example:
7
GEM uses 18 decimal places.
8
9
If selling an item for 5 GEM the price should be converted as such:
10
price = new cargo.BigNumber(5).times(10 ** 18).toFixed();
11
12
TST uses 4 decimal places.
13
14
If selling an item for 5 TST the price should be converted as such:
15
price = new cargo.BigNumber(5).times(10 ** 4).toFixed();
16
*/
17
​
18
cargo.api.sell(options, unapprovedFn).then(response => {
19
if(!response.err) {
20
// Item has been marked for sale
21
}
22
});
Copied!
Arguments
Response
Argument
Description
options
An object with the following properties:
  • projectId - Required. The project ID of the collection containing the collectible to sell. This can be found in the URL bar when viewing the project on Cargo.
  • tokenId - Required. The ID of the collectible.
  • contractAddress - Required. The contract address.
  • chain - Required. xdai or eth. The chain that the NFT lives on.
  • price - Required. The price, in Wei or unit in specified currency, of the collectible. See above for example of proper conversion.
  • currencyId - Optional. The ID of the currency the item will be sold in.
  • crateId - Optional. Showcase ID
  • payees - Optional. An array of valid Ethereum wallet addresses that will receive a specified split of this sale. Must match commissions array. Payee at index 0 must receive commission at index 0 in commissions array.
  • commissions - Optional. An array of numbers between 0 and 1 representing the percentage the corresponding payee will receive from this sale.
​
unapprovedFn
This is an optional function that will be called if the sale requires an approval from the collection smart contract. This is could be used to display a blocking modal which can then be removed once the method resolves completely.
1
type Response = {
2
err: boolean,
3
status: number,
4
data: {
5
// ID of newly created resale item
6
resaleItemId: string,
7
}