-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cowboy credits (aka nov-5 (aka jan-3)) (#1678)
* wip adding cowboy credits * invite gift paid action * remove balance limit * remove p2p zap withdrawal notifications * credits typedefs * squash migrations * remove wallet limit stuff * CCs in item detail * comments with meCredits * begin including CCs in item stats/notifications * buy credits ui/mutation * fix old /settings/wallets paths * bios don't get sats * fix settings * make invites work with credits * restore migration from master * inform backend of send wallets on zap * satistics header * default receive options to true and squash migrations * fix paidAction query * add nav for credits * fix forever stacked count * ek suggested fixes * fix lint * fix freebies wrt CCs * add back disable freebies * trigger cowboy hat job on CC depletion * fix meMsats+meMcredits * Update api/paidAction/README.md Co-authored-by: ekzyis <[email protected]> * remove expireBoost migration that doesn't work --------- Co-authored-by: ekzyis <[email protected]>
- Loading branch information
Showing
57 changed files
with
658 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { PAID_ACTION_PAYMENT_METHODS } from '@/lib/constants' | ||
import { satsToMsats } from '@/lib/format' | ||
|
||
export const anonable = false | ||
|
||
export const paymentMethods = [ | ||
PAID_ACTION_PAYMENT_METHODS.REWARD_SATS, | ||
PAID_ACTION_PAYMENT_METHODS.PESSIMISTIC | ||
] | ||
|
||
export async function getCost ({ credits }) { | ||
return satsToMsats(credits) | ||
} | ||
|
||
export async function perform ({ credits }, { me, cost, tx }) { | ||
await tx.user.update({ | ||
where: { id: me.id }, | ||
data: { | ||
mcredits: { | ||
increment: cost | ||
} | ||
} | ||
}) | ||
|
||
return { | ||
credits | ||
} | ||
} | ||
|
||
export async function describe () { | ||
return 'SN: buy fee credits' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.