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

HIP-904 Add Outstanding Token Airdrops endpoint to REST API #8276

Open
Tracked by #8081
edwin-greene opened this issue May 10, 2024 · 0 comments
Open
Tracked by #8081

HIP-904 Add Outstanding Token Airdrops endpoint to REST API #8276

edwin-greene opened this issue May 10, 2024 · 0 comments
Labels
enhancement Type: New feature rest-java Area: Java REST API

Comments

@edwin-greene
Copy link
Contributor

edwin-greene commented May 10, 2024

Problem

Add the outstanding airdrops endpoint to Rest-Java.

Solution

List outstanding airdrops:

/api/v1/accounts/{senderIdOrEvmAddress}/airdrops/outstanding

List of outstanding airdrops in the PENDING state. The primary use case is for the sender 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__sender_id index.
Input validation will be applied to the senderIdOrEvmAddress 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 to 25 with a max of 100.
  • order - The direction to sort the items in the response. Sorted by the token_airdrop__sender_id index. Can be asc or desc with a default of asc.
  • receiver.id - The receiver account the outstanding airdrop was intended for. Supports eq, gt, gte, lt, and lte operators. Only one occurrence is allowed.
  • serialnumber - The specific serial number associated with airdrop. Supports eq, gt, gte, lt, and lte operators. Only one occurrence is allowed.
  • token.id - The token ID this airdrop is associated with. Supports eq, gt, gte, lt, and lte operators. Only one occurrence is allowed.

Alternatives

No response

@edwin-greene edwin-greene added enhancement Type: New feature rest-java Area: Java REST API labels May 10, 2024
@edwin-greene edwin-greene changed the title HIP-904 Add token airdrop REST APIS HIP-904 Add token airdrop Outstanding REST API May 10, 2024
@edwin-greene edwin-greene changed the title HIP-904 Add token airdrop Outstanding REST API HIP-904 Add Outstanding Token Airdrops endpoint to REST API May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature rest-java Area: Java REST API
Projects
None yet
Development

No branches or pull requests

1 participant