getContractMetadata
/**
* Get contract metadata by contract address
* @param {string} contractAddress
* @returns {Promise<object>} Contract metadata object
*/
async getContractMetadata({ contractAddress }) {
if (!contractAddress || !utils.isAddress(contractAddress)) {
throw new Error(
errorLogger({
location: ERROR_LOG.location.SDK_getContractMetadata,
message: ERROR_LOG.message.invalid_contract_address,
}),
);
}
const apiUrl = `${this.#apiPath}/nfts/${contractAddress}`;
const {
data: { symbol, name, tokenType },
} = await this.#httpClient.get(apiUrl);
return { symbol, name, tokenType };
}
Last modified 1mo ago
Copy link