I have Magiceden API bearer token and using the buyNow endpoint

Which return Buffer data as in the picture. enter image description here

I tried to create the Transaction like this:

  1. const transactionME = Transaction.from(Buffer.from(data.ix.txSigned.data))
  2. const transactionME = VersionedTransaction.deserialize(Buffer.from(data.ix.v0.txSigned.data))

Then sign like this using the wallet adapter:

const signedTxns = await signAllTransactions([transactionME])

Then send like this:

  1. const signature = await sendTransaction(transaction, connection);
  2. let sig = await conn.connection.sendRawTransaction(signedTxns[i].serialize(), preflightCommitment: "confirmed",skipPreflight: false})

But always getting the following error:

"Program log: AnchorError caused by account: seller_trade_state. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized."

I even tried to create everything from IDL getting exactly the same error: enter image description here

I really do not understand how to do it.

1 Answer 1


I have taken a quick glance at my ME API integration code from last year and this was the process for the buy-now endpoint which worked at the time (and I believe still works to this day):

const sellTransaction = Transaction.from(response.txSigned.data)
const signedTransaction = await signTransaction(sellTransaction)
const signature = await connection.sendRawTransaction(signedTransaction.serialize())

// optionally, listen to the signature after the transaction has been sent

I believe your ME integration is correct but the issue is on some other (semi-related) end. Have you tried reaching out to the ME team?

Let me know if this code snippet works for you! If not, I'll try investigating more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.