@@ -21,10 +21,28 @@ class NFTs extends BaseExtend {
2121 super ( config , request ) ;
2222 }
2323
24+ /**
25+ * Returns a merchant's Marketplace data if there is one
26+ * @method getMerchantMarketplace
27+ * @async
28+ * @param {string } merchantUuid The Merchant's unique universal identifier (Merchant UUID).
29+ * @returns Promise<AxiosResponse<GetMerchantMarketplaceResponse>>
30+ */
2431 async getMerchantMarketplace ( merchantUuid : string ) : Promise < AxiosResponse < GetMerchantMarketplaceResponse > > {
2532 return this . request . get ( API . getMerchantMarketplace ( merchantUuid ) ) ;
2633 }
2734
35+ /**
36+ * Returns a list of NFT items sold by a merchant
37+ * @method getMerchantNFTList
38+ * @async
39+ * @param {string } merchantUuid The Merchant's unique universal identifier (Merchant UUID).
40+ * @param {number } page The current page number.
41+ * If it is not set the starting page will be returned. Defaults to 1
42+ * @param {number } size The maximum mumber of items returned in the response. Defaults to 50
43+ * @param {string } filter Parameter by which the returned items in the list to be filtered. Defaults to "published"
44+ * @returns Promise<AxiosResponse<GetMerchantNFTListResponse>>
45+ */
2846 async getMerchantNFTList (
2947 merchantUuid : string ,
3048 page = 1 ,
@@ -34,28 +52,59 @@ class NFTs extends BaseExtend {
3452 return this . request . get ( API . getMerchantNFTList ( merchantUuid , page , size , filter ) ) ;
3553 }
3654
55+ /**
56+ * Returns a specific NFT item sold by a merchant
57+ * @method getMerchantNFT
58+ * @async
59+ * @param {string } merchantUuid The Merchant's unique universal identifier (Merchant UUID).
60+ * @param {number } nftId The unique NFT identifier
61+ * @returns Promise<AxiosResponse<GetMerchantNFTResponse>>
62+ */
3763 async getMerchantNFT ( merchantUuid : string , nftId : number ) : Promise < AxiosResponse < GetMerchantNFTResponse > > {
3864 return this . request . get ( API . getMerchantNFT ( merchantUuid , nftId ) ) ;
3965 }
4066
67+ /**
68+ * Returns exchange rates of a specific FIAT currency in respect to a list crypto currencies
69+ * @method getExchangeRates
70+ * @param {string } fiat The FIAT currency
71+ * @param {boolean } invert Whether the returned rates to be in their inverted exchange rates
72+ * @returns Promise<AxiosResponse<GetExchangeRatesResponse>>
73+ */
4174 async getExchangeRates ( fiat : string , invert = false ) : Promise < AxiosResponse < GetExchangeRatesResponse > > {
4275 return this . request . get ( API . getExchangeRates ( fiat , invert ) ) ;
4376 }
4477
45- async getMyNFTs ( page = 1 , size = 50 ) : Promise < AxiosResponse < GetMyNFTsResponse > > {
78+ /**
79+ * Returns a list of NFTs bought and owned by an authenticated user
80+ * @method getUserBoughtNFTs
81+ * @param {number } page The current page number.
82+ * If it is not set the starting page will be returned. Defaults to 1
83+ * @param {number } size The maximum mumber of items returned in the response. Defaults to 50
84+ * @returns Promise<AxiosResponse<GetMyNFTsResponse>>
85+ */
86+ async getUserBoughtNFTs ( page = 1 , size = 50 ) : Promise < AxiosResponse < GetMyNFTsResponse > > {
4687 const tokenObject = await this . request . getToken ( ) ;
4788
48- return this . request . authenticatedGet ( API . getMyNFTs ( page , size ) , {
89+ return this . request . authenticatedGet ( API . getUserBoughtNFTs ( page , size ) , {
4990 headers : {
5091 Authorization : `Bearer ${ tokenObject . token } ` ,
5192 } ,
5293 } ) ;
5394 }
5495
55- async makeNFTReservation ( merchantUuid : string , nftId : number ) : Promise < AxiosResponse < MakeNFTReservationResponse > > {
96+ /**
97+ * Makes a reservation request for a specific NFT and returns the relevant data when
98+ * that reservation is completed successfully
99+ * @method makeReservation
100+ * @param {string } merchantUuid The Merchant's unique universal identifier (Merchant UUID).
101+ * @param {number } nftId The unique NFT identifier
102+ * @returns Promise<AxiosResponse<MakeNFTReservationResponse>>
103+ */
104+ async makeReservation ( merchantUuid : string , nftId : number ) : Promise < AxiosResponse < MakeNFTReservationResponse > > {
56105 const tokenObject = await this . request . getToken ( ) ;
57106
58- return this . request . authenticatedPost ( API . makeNFTReservation ( merchantUuid , nftId ) , {
107+ return this . request . authenticatedPost ( API . makeReservation ( merchantUuid , nftId ) , {
59108 headers : {
60109 Authorization : `Bearer ${ tokenObject . token } ` ,
61110 } ,
0 commit comments