allow deposit from already wrapped SOL

This commit is contained in:
Maximilian Schneider 2021-06-05 15:39:20 -04:00
parent c86ee0157f
commit d964cb0312
1 changed files with 4 additions and 1 deletions

View File

@ -128,7 +128,10 @@ export async function deposit(
const signers = []
let wrappedSolAccount: Account | null = null
if (token.equals(WRAPPED_SOL_MINT)) {
if (
token.equals(WRAPPED_SOL_MINT) &&
tokenAcc.toBase58() === wallet.publicKey.toBase58()
) {
wrappedSolAccount = new Account()
const lamports = Math.round(quantity * LAMPORTS_PER_SOL) + 1e7
transaction.add(