From 2f6e55997e8c262cf4b7f832cb06e5e258d0a24c Mon Sep 17 00:00:00 2001 From: febo Date: Fri, 25 Aug 2023 00:12:11 +0300 Subject: [PATCH] Use size constants --- clients/js/src/hooked/resolvers.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clients/js/src/hooked/resolvers.ts b/clients/js/src/hooked/resolvers.ts index 280e44e4..0ac7f73f 100644 --- a/clients/js/src/hooked/resolvers.ts +++ b/clients/js/src/hooked/resolvers.ts @@ -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, @@ -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; };