Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions filters/mutable.filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ export class MutableFilter implements Filter {
}

const deserialize = this.metadataSerializer.deserialize(metadataAccount.data);
const mutable = !this.checkMutable || deserialize[0].isMutable;
const hasSocials = !this.checkSocials || (await this.hasSocials(deserialize[0]));
const ok = !mutable && hasSocials;
const mutable = deserialize[0].isMutable;
const hasSocials = await this.hasSocials(deserialize[0]);
let ok = true;
const message: string[] = [];

if (mutable) {
if (this.checkMutable && mutable) {
ok = false;
message.push('metadata can be changed');
}

if (!hasSocials) {
if (this.checkSocials && !hasSocials) {
ok = false;
message.push('has no socials');
}

Expand Down
8 changes: 5 additions & 3 deletions filters/renounced.filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ export class RenouncedFreezeFilter implements Filter {
}

const deserialize = MintLayout.decode(accountInfo.data);
const renounced = !this.checkRenounced || deserialize.mintAuthorityOption === 0;
const freezable = !this.checkFreezable || deserialize.freezeAuthorityOption !== 0;
const ok = renounced && !freezable;
const renounced = deserialize.mintAuthorityOption === 0;
const freezable = deserialize.freezeAuthorityOption !== 0;
let ok = true;
const message: string[] = [];

if (!renounced) {
ok = false;
message.push('mint');
}

if (freezable) {
ok = false;
message.push('freeze');
}

Expand Down