When using metaplex
auction-house
contract, some users are unable to complete a sell
command.
Confirmed that if the same NFT
is sent to a different wallet, that wallet can sell
just fine.
The issue seems to be bad ATA
.
Initially , the ATA
account that returned via https://github.com/metaplex-foundation/metaplex/blob/b7760611d0838307757b831505eaaffee25b1b2a/js/packages/cli/src/auction-house-cli.ts#L260 didn't have owner
or token
inside.
When sent to another wallet, was able to complete just fine. https://explorer.solana.com/tx/GUybhU53qY56bu4j2raQyp7uecGLgaFge6GBvRNtX1u8gqDzocKk8MDg52upZV985UPW8FAregpwTv7JGyWdNwf
After manually setting up the ATA
, still didn't help.
https://explorer.solana.com/address/Cu6Dru1j6PZa3f9K2acuqsHcaVDRxniFVqPPk7WX7RaC
Seems like due toe the token being 0
.
Tried finding the correct ATA
by using getTokenLargestAccounts
but then I'm getting 0x12c
which says PublicKeyMismatch
.
Would love some help in finding a stable way to complete this, this is happening to many users sporadically.
The code that you linked, getATAForMint
, does not actually create the ATA, which is why owner
and token
weren't populated.
The succeeding transaction that you linked correctly creates the ATA, which is why it succeeds.
So one way to resolve this is:
getAccountInfo
on the ATA: https://docs.solana.com/developing/clients/jsonrpc-api#getaccountinfoowner
field is the token program, given by TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
. More info about ownership at: https://docs.solana.com/developing/programming-model/accounts#ownership-and-assignment-to-programs