hedera-mirror-node
hedera-mirror-node copied to clipboard
HIP-904 Add Pending Token Airdrops endpoint to REST API
Problem
Add the list pending airdrops endpoint to Rest Java.
Solution
List Pending Airdrops:
/api/v1/accounts/{receiverIdOrEvmAddress}/airdrops/pending
List of airdrops in the PENDING state. The primary use case is for the receiver of the airdrop. All information returned to the requester will be queried from the token_airdrop table and should be performant based on the token_airdrop__receiver_id index.
Input validation will be applied to the receiverIdOrEvmAddress path parameter and the optional query parameters. An error code response of 400 will be returned if any parameters fail validation.
Response:
{
"airdrops": [
{
"amount": 333,
"receiver_id": "0.0.999",
"sender_id": "0.0.222",
"serial_number": null,
"timestamp": {
"from": "1111111111.111111111",
"to": null
},
"token_id": "0.0.111"
},
{
"amount": 555,
"receiver_id": "0.0.999",
"sender_id": "0.0.222",
"serial_number": null,
"timestamp": {
"from": "1111111111.111111112",
"to": null
},
"token_id": "0.0.444"
},
{
"amount": null,
"receiver_id": "0.0.999",
"sender_id": "0.0.222",
"serial_number": 888,
"timestamp": {
"from": "1111111111.111111113",
"to": null
},
"token_id": "0.0.666"
}
],
"links": {
"next": null
}
}
Optional Filters
-
limit- The maximum number of airdrops to return in the response. Defaults to25with a max of100. -
order- The direction to sort the items in the response. Sorting by thetoken_airdrop__receiver_idindex. Can beascordescwith a default ofasc. -
sender.id- The sender account that initiated the pending airdrop. Supportseq,gt,gte,lt, andlteoperators. Only one occurrence is allowed. -
serialnumber- The specific serial number associated with airdrop. Supportseq,gt,gte,lt, andlteoperators. Only one occurrence is allowed. -
token.id- The token ID this airdrop is associated with. Supportseq,gt,gte,lt, andlteoperators. Only one occurrence is allowed.
Alternatives
No response