explorer
explorer copied to clipboard
The parser for `NFTokenAcceptOffer` will sometimes return an incorrect address as buyer/accepter
I found an example where the parser for NFTokenAcceptOffer returns the wrong buyer: https://livenet.xrpl.org/transactions/E6CE3C3C554BA01891A9D12E89062C34BBEA6282CF8AA4D9AF8BF7D0E7D26B7D/simple
Looking at the detailed view it's possible to see who the real buyer is
The ownership history shown on Bithomp does also specify the actual buyer
I've quickly looked at src/containers/shared/components/Transaction/NFTokenAcceptOffer/parser.ts
. It seems like the accepter maybe should be defined as const accepter = acceptedOfferNode.Destination ? acceptedOfferNode.Destination : tx.Account;
.
Fixed by https://github.com/ripple/explorer/pull/493
The #493 pull request isn't gonna fix this.
The AffectedNodes
array has two DeletedNode
objects. Both with the LedgerEntryType
set to NFTokenOffer
. It's the second one that has the correct NFT owner, but it's the first one that gets chosen.
For privacy-ish reasons, I'm attaching an image so searching for their wallet on Google won't link to this issue
The #493 pull request isn't gonna fix this.
The
AffectedNodes
array has twoDeletedNode
objects. Both with theLedgerEntryType
set toNFTokenOffer
. It's the second one that has the correct NFT owner, but it's the first one that gets chosen.For privacy-ish reasons, I'm attaching an image so searching for their wallet on Google won't link to this issue
Thanks we will take a look
The problem is that the parser only takes the first accepted offer, but in a brokered transfer, two offers are accepted, and the account submitting the transaction is neither the seller nor the buyer. The tx.Account
is the broker (which should probably also be specified, but separately).
So a fix would probably be to find all the accepted offer nodes (instead of just the first), make sure the number of nodes matches the number of offers, figure out which is the sell offer and which is the buy offer, and use that to determine the buyer and seller.
@mvadari @ckniffen @will2022 I have opened a PR that would choose the NFTokenOffer
node without the Destination
field to fetch the buyer in brokered mode. Im open to discuss the correctness of this approach and whether there is a better way
EDIT 1: PR is still in progress, still need to correctly fetch the seller EDIT 2: PR is fixed