From 3055dfa93735e3407410f71e458173599b43920d Mon Sep 17 00:00:00 2001 From: William Chong Date: Mon, 22 Jan 2024 15:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Throw=20error=20if=20not=20enoug?= =?UTF-8?q?h=20nft=20to=20send?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/cosmos.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/cosmos.ts b/utils/cosmos.ts index f197fb567..0f77e034e 100644 --- a/utils/cosmos.ts +++ b/utils/cosmos.ts @@ -347,6 +347,10 @@ export async function sendNFTsToAPIWallet ( const nftIds = nfts.map(nft => nft.id).slice(0, nftCount) const classIds = nftIds.map(_ => classId) + if (nftIds.length !== nftCount) { + throw new Error('Not enough NFTs') + } + const { transactionHash, code } = await signSendNFTs( LIKER_NFT_TARGET_ADDRESS, classIds,