From 42f92c23611b643a509a2b0611ffa7a13d39043a Mon Sep 17 00:00:00 2001 From: Nathaniel Parke Date: Fri, 5 Mar 2021 14:08:08 +0800 Subject: [PATCH] Turn off automatically creating token accounts when an spl token account is provided --- src/utils/tokens/index.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/utils/tokens/index.js b/src/utils/tokens/index.js index 600fe3e..d391cd6 100644 --- a/src/utils/tokens/index.js +++ b/src/utils/tokens/index.js @@ -246,15 +246,7 @@ export async function transferTokens({ memo, }); } - return await createAndTransferToAccount({ - connection, - owner, - sourcePublicKey, - destinationPublicKey, - amount, - memo, - mint, - }); + throw new Error('Destination token account does not exist.'); } function createTransferBetweenSplTokenAccountsInstruction({