UNPKG

@aut-labs/sdk

Version:

The TS/JS SDK package aims to make it easy for frontends/backends to integrate with Aut Smart Contracts

47 lines 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AutIDNFT = exports.AutIDProperties = void 0; const baseNFTModel_1 = require("./baseNFTModel"); const social_1 = require("./social"); const storage_api_1 = require("./storage.api"); class AutIDProperties { constructor(data) { if (!data) { this.socials = social_1.DefaultSocials; } else { this.timestamp = data.timestamp; this.avatar = data.avatar; this.thumbnailAvatar = data.thumbnailAvatar; this.tokenId = data.tokenId; this.socials = data.socials?.length ? data.socials : social_1.DefaultSocials; this.bio = data.bio; this.email = data.email; } } } exports.AutIDProperties = AutIDProperties; class AutIDNFT extends baseNFTModel_1.BaseNFTModel { static updateAutIDNFT(updatedUser) { const autID = new AutIDNFT(updatedUser); return { name: autID.name, description: autID.description, image: (0, storage_api_1.httpUrlToIpfsCID)(autID.image), properties: { avatar: (0, storage_api_1.httpUrlToIpfsCID)(autID.properties.avatar), thumbnailAvatar: (0, storage_api_1.httpUrlToIpfsCID)(autID.properties.thumbnailAvatar), email: autID.properties.email, bio: autID.properties.bio, timestamp: autID.properties.timestamp, socials: autID.properties.socials } }; } constructor(data = {}) { super(data); this.properties = new AutIDProperties(data.properties); } } exports.AutIDNFT = AutIDNFT; //# sourceMappingURL=aut.model.js.map