Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/api/transactions/search to handle search by recipient from multipayment recipients #3741

Closed
air1one opened this issue May 26, 2020 · 6 comments
Assignees

Comments

@air1one
Copy link
Contributor

air1one commented May 26, 2020

POST /api/transactions/search currently doesn't support to search multipayment tx by recipients since the recipients sit in the asset of the multipayment transaction.

@rainydio
Copy link
Contributor

Okay. But as an alternative I can also enable OR condition for search endpoints, so that multipayment can be included like this:

[
  { "recipientId": "<recipient address>" },
  { "asset": { "payment": { "recipientId": "<recipient address>"  } } }
]

Or I can add additional aggregated criteria property:

{ "anyRecipientId": "<recipient address>" }

Otherwise it isn't clear why transactions that are included into result may have unexpected recipientId that doesn't match specified criteria (because asset.payment.recipientId does).

@air1one
Copy link
Contributor Author

air1one commented May 26, 2020

Yeah OR could be good, what do you think @faustbrian ?

@faustbrian
Copy link
Contributor

Not really a fan of that because we don't require special recipient types to be specified for anything else and that just makes it more tedious to retrieve transactions.

When you request transactions via API without a type or typeGroup filter your expectation would be that you get all transactions that could have a recipientId without thinking about what type the transaction is.

Also, this has to work with the addresses parameter which can be used to look up transactions for multiple addresses at the same time.

@rainydio
Copy link
Contributor

rainydio commented May 29, 2020

Not gonna fight for it, that rule was already broken for delegate registration.

@faustbrian
Copy link
Contributor

There is no rule that was broken. There are special transaction types that are sent to yourself because they need to go somewhere but a multi-payment is just a transfer (type 0) that has multiple recipients.

@rainydio
Copy link
Contributor

rainydio commented Jun 4, 2020

  • recipientId now searches through multipayment too
  • added address criteria to filter by either recipientId or senderId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants