Skip to content

Commit

Permalink
Use size constants
Browse files Browse the repository at this point in the history
  • Loading branch information
febo committed Aug 24, 2023
1 parent 813aa9b commit 2f6e559
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions clients/js/src/hooked/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ import {
findEditionMarkerV2Pda,
findMasterEditionPda,
findTokenRecordPda,
getMasterEditionSize,
getMetadataSize,
printSupply,
} from '../generated';
import { findEditionMarkerFromEditionNumberPda } from './editionMarker';

const METADATA_SIZE: number = 679;

const MASTER_EDITION_SIZE: number = 282;

export const resolveCollectionDetails = (
context: any,
accounts: any,
Expand Down Expand Up @@ -103,9 +105,9 @@ export const resolveCreateV1Bytes = (
programId: any,
isWritable?: boolean
): number => {
const base = getMintSize() + getMetadataSize() + 2 * ACCOUNT_HEADER_SIZE;
const base = getMintSize() + METADATA_SIZE + 2 * ACCOUNT_HEADER_SIZE;
if (isNonFungible(args.tokenStandard)) {
return base + getMasterEditionSize() + ACCOUNT_HEADER_SIZE;
return base + MASTER_EDITION_SIZE + ACCOUNT_HEADER_SIZE;
}
return base;
};
Expand Down

0 comments on commit 2f6e559

Please sign in to comment.