@portalshq/billing-marketplace
v0.0.3
Published
Revenue share and rake calculation for the capability marketplace. Platform rake + provider payout via Stripe Connect. Also handles Portals lineage-weighted royalty splits.
Downloads
42
Readme
@portalshq/billing-marketplace
Three responsibilities:
calculateRake()— single source of truth for platform rake rates. All four transaction types (capability purchase, creator subscription, tip, purchase) run through this. Change rates here, not in ad hoc code.calculateRoyaltySplits()— distributes net royalties across the Portals lineage chain. Implements the "Stripe Connect for fictional IP" model. Deliberately simple at launch — evolve the weighting model with creator feedback.StripeConnectClient— executes provider payouts via Stripe Connect Transfers. Connected account IDs are stored per-provider in the capability registry (TODO: add stripeAccountId field to CapabilityContract).
Stripe Connect fee (0.25% + $0.25/transfer) is absorbed by the platform
rake in calculateRake() — providers always receive the clean net amount.
