From b5c11249d1012a2d7f5f7112e530ec5d363ce371 Mon Sep 17 00:00:00 2001 From: markus <55011443+mdymalla@users.noreply.github.com> Date: Tue, 28 May 2024 12:39:27 +1000 Subject: [PATCH] TD1453 fix type issue (#1830) --- packages/checkout/sdk/src/smartCheckout/sell/sell.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/checkout/sdk/src/smartCheckout/sell/sell.ts b/packages/checkout/sdk/src/smartCheckout/sell/sell.ts index c06a92a439..ad60075714 100644 --- a/packages/checkout/sdk/src/smartCheckout/sell/sell.ts +++ b/packages/checkout/sdk/src/smartCheckout/sell/sell.ts @@ -253,10 +253,7 @@ export const sell = async ( let tokenQuantity = BigNumber.from(1); // if type exists in sellToken then it is valid ERC721 or ERC1155 and not deprecated type - if ('type' in sellToken) { - const erc1155Token = sellToken as unknown as ERC1155Item | ERC721Item; - if (erc1155Token.type === ItemType.ERC1155) tokenQuantity = BigNumber.from(erc1155Token.amount); - } + if (sellTokenHasType && sellToken.type === ItemType.ERC1155) tokenQuantity = BigNumber.from(sellToken.amount); const orderBookFees = calculateFees(makerFees, buyTokenOrNative.amount, decimals, tokenQuantity); if (orderBookFees.length !== makerFees.length) {