All challenges

TypeScript · easy

Pending receipt

#26

Situation

Payments still relies on a callback nest from another decade. The payout finishes, but the receipt says "pending:42" instead of paid. Keep the helpers callback-based and fix the result.

Objective

When the payout finishes, return the paid receipt rather than the pending one. runPayout(42) resolves to "paid:42".

The repo at start

workspace/
└── src/
    └── payout.ts   (nest from 2014; receipt says pending)

Checks you will turn green

  • exports runPayout
  • runPayout(42) pays
  • the receipt carries its own id

Concepts

callbacksstrings

Play it in your terminal

With sharpen installed, this command opens exactly this challenge in your local arena:

sharpen 26

First time? The full install is right below.

How to play

  1. 1 Install Claude Code if you do not have it yet: claude.com/claude-code
  2. 2 Install sharpen from npm:
    npm install -g @juanwmedia/sharpen
  3. 3 Then launch it; the arena opens in your browser:
    sharpen 26
  4. or Or try it without installing anything:
    npx @juanwmedia/sharpen 26
  5. 4 And to update when a new version ships:
    sharpen update