Skip to main content

Interface: AssetsModule

AssetsModule is exposed by the main context under 'assets' object

Table of contents

Properties

Properties

downloadAsset

downloadAsset: (did: string) => Promise<boolean>

Type declaration

▸ (did): Promise<boolean>

Download an asset already ordered and transfered to the buyer, if the user is the owner of the asset

Parameters
NameTypeDescription
didstringid of the NFT (721 & 1155) asset
Returns

Promise<boolean>

if the NFT is downloaded successfully the method will return a true

Defined in

types/index.ts:518


downloadNFT

downloadNFT: (did: string) => Promise<boolean>

Type declaration

▸ (did): Promise<boolean>

Download a NFT asset already ordered and transfered to the buyer, if the user is the owner of the asset

Parameters
NameTypeDescription
didstringid of the NFT (721 & 1155) asset
Returns

Promise<boolean>

if the NFT is downloaded successfully the method will return a true

Defined in

types/index.ts:505


findOne

findOne: (did: string) => Promise<DDO>

Type declaration

▸ (did): Promise<DDO>

Get the asset object by the did given

Parameters
NameTypeDescription
didstringid of the asset
Returns

Promise<DDO>

Defined in

types/index.ts:455


getCustomErc20Token

getCustomErc20Token: (customErc20TokenAddress: string) => Promise<CustomErc20Token>

Type declaration

▸ (customErc20TokenAddress): Promise<CustomErc20Token>

Get all the details about a custom erc20 token

Parameters
NameTypeDescription
customErc20TokenAddressstringThe custom token address
Returns

Promise<CustomErc20Token>

Custom token details

Defined in

types/index.ts:511


nftDetails

nftDetails: (did: string) => Promise<NFTDetails>

Type declaration

▸ (did): Promise<NFTDetails>

Get the aggreement details of the NFT asset (owner, nfts supplay, royalties, etc...)

Parameters
NameTypeDescription
didstringid of the NFT (721 & 1155) asset
Returns

Promise<NFTDetails>

Agreement details of the NFT asset

Defined in

types/index.ts:475


orderAsset

orderAsset: (did: string) => Promise<string>

Type declaration

▸ (did): Promise<string>

This method order a asset to allow after transfer to the buyer (the method only order but not transfer)

Parameters
NameTypeDescription
didstringid of the asset
Returns

Promise<string>

In case the order is completed successfully it returns the agreementId which is needed to transfer the asset to the buyer

Defined in

types/index.ts:482


orderNFT1155

orderNFT1155: (did: string, amount: default) => Promise<string>

Type declaration

▸ (did, amount): Promise<string>

This method order a NFT1155 asset to allow after transfer to the buyer (the method only order but not transfer)

Parameters
NameTypeDescription
didstringid of the NFT1155 asset
amountdefaultAmount of NFT1155 assets to order
Returns

Promise<string>

In case the order is completed successfully it returns the agreementId which is needed to transfer the NFT1155 asset to the buyer

Defined in

types/index.ts:498


orderNFT721

orderNFT721: (did: string, nftTokenAddress: string) => Promise<string>

Type declaration

▸ (did, nftTokenAddress): Promise<string>

This method order a NFT721 asset to allow after transfer to the buyer (the method only order but not transfer)

Parameters
NameTypeDescription
didstringid of the NFT721 asset
nftTokenAddressstring-
Returns

Promise<string>

In case the order is completed successfully it returns the agreementId which is needed to transfer the NFT721 asset to the buyer

Defined in

types/index.ts:490


query

query: (q: SearchQuery) => Promise<QueryResult>

Type declaration

▸ (q): Promise<QueryResult>

Parameters
NameTypeDescription
qSearchQueryQuery to custom the search: order result, filtering, etc...
Returns

Promise<QueryResult>

List of assets according with the query given

Defined in

types/index.ts:461


transfer

transfer: (assetInfo: { amount: number ; did: string }) => Promise<boolean>

Type declaration

▸ (assetInfo): Promise<boolean>

Transfer the ownership of the asset to other account

Parameters
NameTypeDescription
assetInfoObject
assetInfo.amountnumberThe amount of asset to transfer
assetInfo.didstringThe id of the asset
Returns

Promise<boolean>

Return true if asset was transferred successfully

Defined in

types/index.ts:469


uploadAssetToFilecoin

uploadAssetToFilecoin: (File: File, filecoinUrl: string) => Promise<string>

Type declaration

▸ (File, filecoinUrl): Promise<string>

Upload files to Filecoin

Parameters
NameTypeDescription
FileFile-
filecoinUrlstringThe url of the Filecoin server
Returns

Promise<string>

The url where is located the file already uploaded

Defined in

types/index.ts:525