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

feat: Complete challenge rewards #62

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daviroo
Copy link
Collaborator

@daviroo daviroo commented Nov 28, 2024

I've tested it with my blink account and it works. You need to define 3 env variables in vercel to get this to work:

BLINK_API_TOKEN
REWARD_IN_SATS
BLINK_WALLET_ID

I've DM'd you the values for these. It uses basic rate limiting for now to try and make it harder to exploit the endpoint.

image

The only part I haven't been able to test is if it works correctly with the course progress. You might need to fix that part up before merging.

@daviroo daviroo requested a review from Extheoisah November 28, 2024 17:11
@daviroo daviroo self-assigned this Nov 28, 2024
Copy link

railway-app bot commented Nov 28, 2024

This PR was not deployed automatically as @daviroo does not have access to the Railway project.

In order to get automatic PR deploys, please add @daviroo to your team on Railway.

@daviroo daviroo force-pushed the complete-challenge-rewards branch from fcd6934 to 4af92f1 Compare December 5, 2024 09:33
(repo) => sluggify(repo?.challenge?.title) === sluggify(challenge.title)
);

const isCompleted = repository?.progress?.status === Status.Completed;
Copy link
Member

Choose a reason for hiding this comment

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

The Status.Completed in types folder is not the same as the one for progress status.

Suggested change
const isCompleted = repository?.progress?.status === Status.Completed;
const isCompleted = repository?.progress?.status === "completed";

</p>
</section>
</div>
{isCompleted ? (
Copy link
Member

Choose a reason for hiding this comment

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

This will always pay the user when they come to the challenge page after they've completed the challenge

Copy link
Member

Choose a reason for hiding this comment

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

The user should be paid once only

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.

2 participants