@nftgo/gorarity
Version:
An algorithm to calculate rarity of NFT(how special it is), based on Jaccard Distance.
27 lines (26 loc) • 848 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EVMContractTokenIdentifier = void 0;
const attribute_utils_1 = require("./utils/attribute-utils");
class EVMContractTokenIdentifier {
constructor(contractAddress, tokenId) {
this._contractAddress = (0, attribute_utils_1.normalizeContractString)(contractAddress);
this._tokenId = tokenId;
}
get tokenId() {
return this._tokenId;
}
get contractAddress() {
return this._contractAddress;
}
static fromDict(dict) {
return new EVMContractTokenIdentifier(dict.contractAddress, dict.tokenId);
}
toDict() {
return {
contractAddress: this._contractAddress,
tokenId: this._tokenId,
};
}
}
exports.EVMContractTokenIdentifier = EVMContractTokenIdentifier;