interledger / web-monetization-extension

An open-source browser extension that enables Web Monetization.
Apache License 2.0
72 stars 5 forks source link

fix(content/KeyAutoAdd): get output of any step, not just of previous #640

Closed sidvishnoi closed 1 month ago

sidvishnoi commented 1 month ago

Simplifies KeyAutoAdd's step runner to let us get output of any step (that has been previously run), not just result of previous. Getting result of previous had limitation that any intermediate steps had to pass through data from previous steps. Now we store outputs in a Map and get those with the output(fn) helper (WeakMap not needed, as we store reference to function anyway in steps array).

Also update signature of StepRun function.

Additionally, turn skip call to throw an instance of SkipError instead of object with symbol.

github-actions[bot] commented 1 month ago

Extension builds preview

Name Link
Latest commit 4f01b7cb3dfb3c878c37395705309d2f6263a9bc
Latest job logs Run #11161797214
BadgeDownload
BadgeDownload
sidvishnoi commented 1 month ago

I would suggest adding the base URLs in environment variables. It would be easier to update them when the Test Wallet is going to move to the new domain.

I thought of doing that, until I found there's api.rafiki.money too, then thought hard-coding is fine. Might revisit as I work on Fynbos one.