Skip to content

Add a vesting claim endpoint that records the claimed amount and updates the vesting schedule in the database #822

Description

@Chucks1093

Summary

When a beneficiary claims vested keys on-chain the server vesting record is not updated. A POST /vesting/:keyId/claim endpoint that submits the claim_vested contract call and updates the claimedAmount on the vesting record should be added.

Scope

  • Add POST /vesting/:keyId/claim requiring a JWT matching the vesting beneficiary
  • Read the current claimableAmount from the on-chain contract before submitting
  • Submit the claim_vested contract call and update the claimedAmount on the vesting_schedules record
  • Write a keys_claimed activity record to the activity_log table
  • Return the amount claimed and the updated claimableAmount in the response

Acceptance Criteria

  • claimedAmount updated correctly on the vesting record after claim
  • Activity log record written after successful claim
  • Claim with nothing available returns 400 with 'NothingToClaim'
  • Non-beneficiary JWT returns 403
  • On-chain failure returns 502 with no database change

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions