Skip to content

Conversation

@raymondjacobson
Copy link
Member

@raymondjacobson raymondjacobson commented Nov 6, 2025

GET /v1/coins/:mint/redeem
res
{
  amount: 1
}
if code is used or invalid, return 400
{ error: 'used' | 'invalid' }
GET /v1/coins/:mint/redeem/XYZ 
res
{
  code: XYZ,
  amount: 10,
}
if code is used or invalid, return 400
{ error: 'used' | 'invalid' }

@@ -0,0 +1,8 @@
begin;

alter table reward_codes add column if not exists is_used boolean not null default false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that I think about it, we could just join on challenge disbursements w/ that specifier but this is probably simpler

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah good thought. i like this better too though


comment on column reward_codes.is_used is 'Whether the code has been redeemed';

commit;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ew lowercase sql looks awful 😂

@raymondjacobson raymondjacobson merged commit 5f10e7a into main Nov 6, 2025
5 checks passed
@raymondjacobson raymondjacobson deleted the rj-codes-endpoints branch November 6, 2025 20:11
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

Successfully merging this pull request may close these issues.

3 participants