Automate Cashu Token Management with Configurable Split and Lightning Payouts #3

Open
opened 2024-12-02 14:32:51 +00:00 by dannym · 0 comments
Owner

Currently, redeemed subscription tokens are simply logged as new Cashu tokens.

Lines 201 to 208 in ebec73a
const newToken = await wallet.receive(tokenString);
const encodedToken = getEncodedToken({
token: [{
mint: tokenInfo.mint,
proofs: newToken
}]
});
logger.info(`New cashu token: ${encodedToken}`);

Proposed Solution:

  • Implement configurable split ratios for incoming payments
  • Automatically manage multiple Cashu wallets
  • Set up automatic Lightning payouts when thresholds are reached

Configuration Example:

{
  splits: [
    {
      name: "danny",
      percentage: 45,
      lightningAddress: "blah",
      threshold: 10000 // sats
    },
    {
      name: "gino",
      percentage: 45,
      lightningAddress: "blah2",
      threshold: 10000 // sats
    },
    {
      name: "opensats",
      percentage: 10,
      lightningAddress: "blah3",
      threshold: 20000 // sats
    }
  ]
}

Benefits:

  • Automated revenue distribution
  • No manual token management needed
  • Configurable thresholds for Lightning payouts
  • Better financial organization
Currently, redeemed subscription tokens are simply logged as new Cashu tokens. https://git.arx-ccn.com/Arx/api.npub.email/src/commit/ebec73a666b317aef2ad835deb6a6946e0f44b19/src/httpServer.ts#L201-L208 ### Proposed Solution: - Implement configurable split ratios for incoming payments - Automatically manage multiple Cashu wallets - Set up automatic Lightning payouts when thresholds are reached ### Configuration Example: ```js { splits: [ { name: "danny", percentage: 45, lightningAddress: "blah", threshold: 10000 // sats }, { name: "gino", percentage: 45, lightningAddress: "blah2", threshold: 10000 // sats }, { name: "opensats", percentage: 10, lightningAddress: "blah3", threshold: 20000 // sats } ] } ``` ### Benefits: - Automated revenue distribution - No manual token management needed - Configurable thresholds for Lightning payouts - Better financial organization
dannym added the
priority
high
type
enhancement
effort
medium
labels 2024-12-02 14:32:51 +00:00
Sign in to join this conversation.
No description provided.