From 8f92437c7e56fedc9003bf69e0c67cade5f175d4 Mon Sep 17 00:00:00 2001 From: Mistium <92952823+Mistium@users.noreply.github.com> Date: Fri, 2 Oct 2026 19:15:14 +0100 Subject: [PATCH 1/5] Stop projects moving credits through the Rotur bridge gifts.create, keys.buy, groups.sendTip and groups.purchaseProduct are no longer methods projects may call, so credits:manage and gifts:create are no longer project scopes. MistWarp's own payments go through Rotur payment requests. With me.transfer already gone, nothing sends a payment confirmation, so the consent modals' payment layout goes too, with its strings. --- .../components/RoturConsentModal.jsx | 25 +++------ src/community/translations/_sources.json | 51 ++++++++----------- src/community/translations/en.json | 3 -- .../mw-rotur-consent-modal/consent-modal.jsx | 27 +++------- src/lib/rotur/project-methods.js | 20 -------- .../community-project-rotur-bridge.test.jsx | 10 ++-- test/unit/packager-account.test.js | 14 ++--- test/unit/rotur-extension-host.test.js | 13 +++-- test/unit/rotur-project-methods.test.js | 23 +++++---- 9 files changed, 68 insertions(+), 118 deletions(-) diff --git a/src/community/components/RoturConsentModal.jsx b/src/community/components/RoturConsentModal.jsx index cf758e9fa41..a3b7da24295 100644 --- a/src/community/components/RoturConsentModal.jsx +++ b/src/community/components/RoturConsentModal.jsx @@ -20,7 +20,6 @@ const groupScopes = scopes => { // it can request an action but never approve one on the user's behalf. const RoturConsentModal = ({type, data, onAllow, onBlock, onDeny, onShareThis, onShareAll, onShareNo}) => { const {text: communityText} = useCommunityText(); - const payment = type === 'confirm' && data.confirmation && data.confirmation.type === 'payment'; const projectName = data.name || communityText('This project'); if (type === 'share') { return ( @@ -52,11 +51,7 @@ const RoturConsentModal = ({type, data, onAllow, onBlock, onDeny, onShareThis, o } const groups = groupScopes(data.scopes); let confirmLead = null; - if (payment) { - confirmLead = communityText('Allow payment of {value1} credits to @{value2}?', { - value1: data.confirmation.amount, value2: data.confirmation.recipient - }); - } else if (type === 'confirm') { + if (type === 'confirm') { confirmLead = data.username ? communityText('Allow this project to {value1} as @{value2}?', {value1: data.label, value2: data.username}) : communityText('Allow this project to {value1}?', {value1: data.label}); @@ -65,7 +60,7 @@ const RoturConsentModal = ({type, data, onAllow, onBlock, onDeny, onShareThis, o - {payment ? - communityText('Allow payment') : - (type === 'confirm' ? communityText('Allow once') : communityText('Connect'))} + {type === 'confirm' ? communityText('Allow once') : communityText('Connect')} } @@ -88,13 +81,11 @@ const RoturConsentModal = ({type, data, onAllow, onBlock, onDeny, onShareThis, o {type === 'confirm' ? (

{confirmLead}

- {payment ? null : ( -

- {communityText( - 'This action will happen once. It does not give the project ongoing approval.' - )} -

- )} +

+ {communityText( + 'This action will happen once. It does not give the project ongoing approval.' + )} +

) : ( diff --git a/src/community/translations/_sources.json b/src/community/translations/_sources.json index a51bb2e451c..3e884333a48 100644 --- a/src/community/translations/_sources.json +++ b/src/community/translations/_sources.json @@ -267,7 +267,7 @@ "src/community/components/GameMarketplaceModal.jsx:224", "src/community/components/ProjectInfoPanel.jsx:382", "src/community/components/ReportModal.jsx:106", - "src/community/components/RoturConsentModal.jsx:75", + "src/community/components/RoturConsentModal.jsx:70", "src/community/components/SocialPost.jsx:218", "src/community/components/SocialPost.jsx:264", "src/community/components/ui/ConfirmModal.jsx:22", @@ -792,8 +792,8 @@ ], "Block this project": [ "src/community/components/GameMarketplaceModal.jsx:179", - "src/community/components/RoturConsentModal.jsx:33", - "src/community/components/RoturConsentModal.jsx:73" + "src/community/components/RoturConsentModal.jsx:32", + "src/community/components/RoturConsentModal.jsx:68" ], "Loading shop…": [ "src/community/components/GameMarketplaceModal.jsx:182" @@ -2167,65 +2167,56 @@ "src/community/components/ReportModal.jsx:157" ], "This project": [ - "src/community/components/RoturConsentModal.jsx:24" + "src/community/components/RoturConsentModal.jsx:23" ], "Show activity on your profile?": [ - "src/community/components/RoturConsentModal.jsx:29" + "src/community/components/RoturConsentModal.jsx:28" ], "Not now": [ - "src/community/components/RoturConsentModal.jsx:34", - "src/community/components/RoturConsentModal.jsx:75" + "src/community/components/RoturConsentModal.jsx:33", + "src/community/components/RoturConsentModal.jsx:70" ], "Allow all": [ - "src/community/components/RoturConsentModal.jsx:35" + "src/community/components/RoturConsentModal.jsx:34" ], "Just this project": [ - "src/community/components/RoturConsentModal.jsx:39" + "src/community/components/RoturConsentModal.jsx:38" ], "\"{value1}\" (@{value2}) wants to show it on your Rotur profile.": [ - "src/community/components/RoturConsentModal.jsx:45" + "src/community/components/RoturConsentModal.jsx:44" ], "\"{value1}\" wants to show it on your Rotur profile.": [ - "src/community/components/RoturConsentModal.jsx:48" - ], - "Allow payment of {value1} credits to @{value2}?": [ - "src/community/components/RoturConsentModal.jsx:56" + "src/community/components/RoturConsentModal.jsx:47" ], "Allow this project to {value1} as @{value2}?": [ - "src/community/components/RoturConsentModal.jsx:61" + "src/community/components/RoturConsentModal.jsx:56" ], "Allow this project to {value1}?": [ - "src/community/components/RoturConsentModal.jsx:62" - ], - "Confirm payment": [ - "src/community/components/RoturConsentModal.jsx:68" + "src/community/components/RoturConsentModal.jsx:57" ], "Confirm account action": [ - "src/community/components/RoturConsentModal.jsx:68" + "src/community/components/RoturConsentModal.jsx:63" ], "Connect to Rotur": [ - "src/community/components/RoturConsentModal.jsx:69" - ], - "Allow payment": [ - "src/community/components/RoturConsentModal.jsx:82" + "src/community/components/RoturConsentModal.jsx:64" ], "Allow once": [ - "src/community/components/RoturConsentModal.jsx:83" + "src/community/components/RoturConsentModal.jsx:76" ], "Connect": [ - "src/community/components/RoturConsentModal.jsx:83" + "src/community/components/RoturConsentModal.jsx:76" ], "This action will happen once. It does not give the project ongoing approval.": [ - "src/community/components/RoturConsentModal.jsx:94" + "src/community/components/RoturConsentModal.jsx:86" ], "\"{value1}\" (@{value2}) wants to use your Rotur account to:": [ - "src/community/components/RoturConsentModal.jsx:103" + "src/community/components/RoturConsentModal.jsx:94" ], "\"{value1}\" wants to use your Rotur account to:": [ - "src/community/components/RoturConsentModal.jsx:106" + "src/community/components/RoturConsentModal.jsx:97" ], "This only reads your public Rotur info.": [ - "src/community/components/RoturConsentModal.jsx:122" + "src/community/components/RoturConsentModal.jsx:113" ], "Paste a Scratch project link": [ "src/community/components/ScratchImport.jsx:34" diff --git a/src/community/translations/en.json b/src/community/translations/en.json index 6d59ba0c941..95b4f25b0d2 100644 --- a/src/community/translations/en.json +++ b/src/community/translations/en.json @@ -334,10 +334,8 @@ "Not now": "Not now", "Allow all": "Allow all", "Just this project": "Just this project", - "Confirm payment": "Confirm payment", "Confirm account action": "Confirm account action", "Connect to Rotur": "Connect to Rotur", - "Allow payment": "Allow payment", "Allow once": "Allow once", "Connect": "Connect", "This only reads your public Rotur info.": "This only reads your public Rotur info.", @@ -1863,7 +1861,6 @@ "This project": "This project", "\"{value1}\" (@{value2}) wants to show it on your Rotur profile.": "\"{value1}\" (@{value2}) wants to show it on your Rotur profile.", "\"{value1}\" wants to show it on your Rotur profile.": "\"{value1}\" wants to show it on your Rotur profile.", - "Allow payment of {value1} credits to @{value2}?": "Allow payment of {value1} credits to @{value2}?", "Allow this project to {value1} as @{value2}?": "Allow this project to {value1} as @{value2}?", "Allow this project to {value1}?": "Allow this project to {value1}?", "This action will happen once. It does not give the project ongoing approval.": "This action will happen once. It does not give the project ongoing approval.", diff --git a/src/components/mw-rotur-consent-modal/consent-modal.jsx b/src/components/mw-rotur-consent-modal/consent-modal.jsx index 616615cc475..7dd8c3e7deb 100644 --- a/src/components/mw-rotur-consent-modal/consent-modal.jsx +++ b/src/components/mw-rotur-consent-modal/consent-modal.jsx @@ -17,7 +17,6 @@ const groupScopes = scopes => { const RoturConsentModal = props => { const {type, data} = props; const groups = groupScopes(data.scopes || []); - const payment = type === 'confirm' && data.confirmation && data.confirmation.type === 'payment'; if (type === 'share') { return ( { {type === 'confirm' ? ( -

{payment ? 'Confirm payment' : 'Confirm account action'}

- {payment ? ( -

- {`Allow payment of ${data.confirmation.amount} credits to `} - {`@${data.confirmation.recipient}`} - {'?'} -

- ) : ( - -

- {'Allow this project to '} - {data.label} - {data.username ? ` as @${data.username}?` : '?'} -

-

{'This action will happen once. It does not give the project ongoing approval.'}

-
- )} +

{'Confirm account action'}

+

+ {'Allow this project to '} + {data.label} + {data.username ? ` as @${data.username}?` : '?'} +

+

{'This action will happen once. It does not give the project ongoing approval.'}

) : ( @@ -140,7 +129,7 @@ const RoturConsentModal = props => { className={styles.allowButton} onClick={props.onAllowed} > - {payment ? 'Allow payment' : (type === 'confirm' ? 'Allow once' : 'Connect')} + {type === 'confirm' ? 'Allow once' : 'Connect'}
diff --git a/src/lib/rotur/project-methods.js b/src/lib/rotur/project-methods.js index 797f1d8a104..35670dad256 100644 --- a/src/lib/rotur/project-methods.js +++ b/src/lib/rotur/project-methods.js @@ -10,10 +10,6 @@ // Never resolve a method path that is not a key of this table. const text = value => String(typeof value === 'undefined' || value === null ? '' : value).slice(0, 200); -const amount = value => { - const number = Number(value); - return Number.isFinite(number) ? number : 0; -}; const PROJECT_METHODS = Object.freeze({ 'me.abilities': {scopes: []}, @@ -35,10 +31,6 @@ const PROJECT_METHODS = Object.freeze({ 'check.banned': {scopes: []}, 'notifications.list': {scopes: ['notifications:view']}, - 'gifts.create': { - scopes: ['gifts:create'], - confirm: args => ({label: `create a gift of ${amount(args[0])} credits`}) - }, 'gifts.get': {scopes: []}, 'gifts.claim': { scopes: ['gifts:claim'], @@ -52,10 +44,6 @@ const PROJECT_METHODS = Object.freeze({ 'keys.mine': {scopes: ['keys:view']}, 'keys.get': {scopes: []}, 'keys.check': {scopes: []}, - 'keys.buy': { - scopes: [], - confirm: args => ({label: `buy key ${text(args[0])}`}) - }, 'keys.cancel': { scopes: [], confirm: args => ({label: `cancel your subscription to key ${text(args[0])}`}) @@ -134,14 +122,6 @@ const PROJECT_METHODS = Object.freeze({ 'groups.announcements': {scopes: []}, 'groups.events': {scopes: ['groups:view']}, 'groups.products': {scopes: ['groups:view']}, - 'groups.sendTip': { - scopes: ['credits:manage'], - confirm: args => ({label: `tip ${amount(args[1])} credits to group ${text(args[0])}`}) - }, - 'groups.purchaseProduct': { - scopes: ['credits:manage'], - confirm: args => ({label: `buy product ${text(args[1])} in group ${text(args[0])}`}) - }, // Projects only reach MistWarp's own Origin FS folder, never the whole drive. 'files.index': {scopes: ['files:app']}, diff --git a/test/unit/community-project-rotur-bridge.test.jsx b/test/unit/community-project-rotur-bridge.test.jsx index 0d4c66d8837..3a13ccb1f04 100644 --- a/test/unit/community-project-rotur-bridge.test.jsx +++ b/test/unit/community-project-rotur-bridge.test.jsx @@ -17,7 +17,7 @@ const mockClient = { get: jest.fn(() => Promise.resolve({username: 'Viewer'})) }, profiles: {get: jest.fn(() => Promise.resolve({username: 'someone'}))}, - gifts: {create: jest.fn(() => Promise.resolve({ok: true}))}, + gifts: {claim: jest.fn(() => Promise.resolve({ok: true}))}, storage: {get: jest.fn(() => Promise.resolve({data: {}}))} }; @@ -137,13 +137,13 @@ describe('community project page Rotur bridge', () => { const pending = send({ kind: 'call', id: 6, - method: 'gifts.create', - args: [5000], + method: 'gifts.claim', + args: ['REAL-CODE'], opts: {sensitive: false, label: 'claim a free hat'} }); await pending; - expect(mockClient.gifts.create).not.toHaveBeenCalled(); - expect(wrapper.text()).toContain('create a gift of 5000 credits'); + expect(mockClient.gifts.claim).not.toHaveBeenCalled(); + expect(wrapper.text()).toContain('claim gift code REAL-CODE'); expect(wrapper.text()).not.toContain('free hat'); wrapper.unmount(); }); diff --git a/test/unit/packager-account.test.js b/test/unit/packager-account.test.js index eb9921d3ac8..dc284e6d4a5 100644 --- a/test/unit/packager-account.test.js +++ b/test/unit/packager-account.test.js @@ -57,17 +57,17 @@ test('extensions in an export cannot reach the token or unlisted SDK methods', a test('a payment is confirmed with the real amount even when the caller says it is not sensitive', async () => { const sdk = client(); - sdk.gifts = {create: jest.fn()}; + sdk.gifts = {claim: jest.fn()}; const runtime = runtimeFor('roturEconomy_pay'); const host = createAccountHost(runtime, {title: 'Game'}, function () { return sdk; }); const ready = host.prepare(); await document.querySelector('button').onclick(); await ready; const confirm = jest.spyOn(window, 'confirm').mockReturnValue(false); - await expect(runtime.roturHost.call('gifts.create', [500], {sensitive: false})) + await expect(runtime.roturHost.call('gifts.claim', ['CODE'], {sensitive: false})) .rejects.toThrow('cancelled'); - expect(confirm).toHaveBeenCalledWith('Allow Game to create a gift of 500 credits?'); - expect(sdk.gifts.create).not.toHaveBeenCalled(); + expect(confirm).toHaveBeenCalledWith('Allow Game to claim gift code CODE?'); + expect(sdk.gifts.claim).not.toHaveBeenCalled(); }); test('failed authentication keeps project gated and permits retry', async () => { @@ -114,16 +114,16 @@ test('published game data uses a player capability and the authenticated session test('sensitive Rotur actions retain a separate confirmation after login', async () => { const sdk = client(); - sdk.gifts = {create: jest.fn()}; + sdk.gifts = {claim: jest.fn()}; const runtime = runtimeFor('roturEconomy_transfer'); const host = createAccountHost(runtime, {}, function () { return sdk; }); const ready = host.prepare(); await document.querySelector('button').onclick(); await ready; jest.spyOn(window, 'confirm').mockReturnValue(false); - await expect(runtime.roturHost.call('gifts.create', [5], {sensitive: true})) + await expect(runtime.roturHost.call('gifts.claim', ['CODE'], {sensitive: true})) .rejects.toThrow('cancelled'); - expect(sdk.gifts.create).not.toHaveBeenCalled(); + expect(sdk.gifts.claim).not.toHaveBeenCalled(); }); test('preview storage supports browser storage methods and property access without sharing data', () => { diff --git a/test/unit/rotur-extension-host.test.js b/test/unit/rotur-extension-host.test.js index 754304c3c8a..ad8640cf48e 100644 --- a/test/unit/rotur-extension-host.test.js +++ b/test/unit/rotur-extension-host.test.js @@ -49,18 +49,17 @@ test('trusted projects still confirm sensitive Rotur actions', async () => { const showModal = jest.fn(() => Promise.resolve(true)); host.acquireModalLock = jest.fn(() => Promise.resolve({showModal})); - await host.call('gifts.create', [10], { + await host.call('gifts.claim', ['CODE'], { sensitive: false, - label: 'claim a free hat', - confirmation: {type: 'payment', amount: 1, recipient: 'friend'} + label: 'claim a free hat' }); expect(showModal).toHaveBeenCalledWith('confirm', { - label: 'create a gift of 10 credits', + label: 'claim gift code CODE', confirmation: null, username: 'user' }); - expect(callRotur).toHaveBeenCalledWith('gifts.create', [10]); + expect(callRotur).toHaveBeenCalledWith('gifts.claim', ['CODE']); }); test('authenticated reads expand scopes without prompting', async () => { @@ -120,9 +119,9 @@ test('blocked projects cannot reopen Rotur prompts', async () => { await expect(host.ensureConsent(['posts:create'], {name: 'Blocked project'})).resolves.toBe(false); await expect(host.ensureActivitySharing()).resolves.toBe(false); - await expect(host.call('gifts.create', [10], { + await expect(host.call('gifts.claim', ['CODE'], { sensitive: true, - label: 'gifts.create' + label: 'gifts.claim' })).rejects.toThrow('cancelled'); expect(host.state.type).toBe(null); diff --git a/test/unit/rotur-project-methods.test.js b/test/unit/rotur-project-methods.test.js index 5b816a0324d..8101055b8eb 100644 --- a/test/unit/rotur-project-methods.test.js +++ b/test/unit/rotur-project-methods.test.js @@ -50,7 +50,9 @@ test('every method the built-in Rotur extensions call is allowlisted with its sc expect(calls.length).toBeGreaterThan(80); for (const {method, opts, scopes} of calls) { // The "send credits" block: projects can't send credits any more. - if (method === 'me.transfer') continue; + // Blocks that moved credits, which projects can't do any more. They're + // removed from the extension in MistWarp/scratch-vm#24. + if (['me.transfer', 'gifts.create', 'keys.buy', 'groups.sendTip', 'groups.purchaseProduct'].includes(method)) continue; const spec = projectMethod(method); expect({method, allowed: Boolean(spec)}).toEqual({method, allowed: true}); // A block's scope is what the host grants for it, after mapping. @@ -85,6 +87,10 @@ test.each([ 'admin.transferCredits', 'me.transfer', 'me.transfer.call', + 'gifts.create', + 'keys.buy', + 'groups.sendTip', + 'groups.purchaseProduct', 'socket.token', 'socket.send', '' @@ -114,15 +120,12 @@ test('a scoped method needs a grant for one of its scopes', () => { expect(authorizeProjectCall('profiles.get', ['someone'], [], 'p').args).toEqual(['someone']); }); -test('spending methods are confirmed with text the host builds from the arguments', () => { - expect(authorizeProjectCall('gifts.create', ['999'], [], 'p').confirm.label) - .toBe('create a gift of 999 credits'); - expect(authorizeProjectCall('groups.sendTip', ['tag', '5'], [], 'p').confirm.label) - .toBe('tip 5 credits to group tag'); +test('actions that spend or give something away are confirmed with text the host builds', () => { + expect(authorizeProjectCall('items.buy', ['hat'], [], 'p').confirm.label).toBe('buy item hat'); + expect(authorizeProjectCall('gifts.claim', ['CODE'], [], 'p').confirm.label).toBe('claim gift code CODE'); for (const method of [ - 'gifts.create', 'gifts.claim', 'keys.buy', 'keys.cancel', 'keys.delete', - 'posts.delete', 'items.buy', 'items.transfer', 'cosmetics.purchase', - 'groups.sendTip', 'groups.purchaseProduct' + 'gifts.claim', 'keys.cancel', 'keys.delete', + 'posts.delete', 'items.buy', 'items.transfer', 'cosmetics.purchase' ]) { expect({method, confirm: Boolean(projectMethod(method).confirm)}).toEqual({method, confirm: true}); } @@ -149,7 +152,7 @@ test('projects may only ask for scopes their blocks can use', () => { test('only read scopes and per-call-confirmed scopes are granted without asking', () => { expect(grantsSilently(['credits:view', 'account:view'])).toBe(true); - expect(grantsSilently(['gifts:create'])).toBe(true); + expect(grantsSilently(['gifts:claim'])).toBe(true); expect(grantsSilently(['posts:delete'])).toBe(true); expect(grantsSilently(['posts:create'])).toBe(false); expect(grantsSilently(['keys:manage'])).toBe(false); From 397bc5fb5a1ed4fe3f6b7c8fb7e94a3ae3d33a2e Mon Sep 17 00:00:00 2001 From: Mistium <92952823+Mistium@users.noreply.github.com> Date: Fri, 2 Oct 2026 19:17:17 +0100 Subject: [PATCH 2/5] Stop projects buying items and cosmetics through the Rotur bridge Buying from Rotur's item and cosmetic shops spends credits, which projects no longer do. items.buy and cosmetics.purchase are no longer project methods, so items:buy and cosmetics:buy are no longer project scopes. --- src/lib/rotur/project-methods.js | 13 +++---------- .../community-project-rotur-bridge.test.jsx | 2 +- test/unit/rotur-project-methods.test.js | 17 ++++++++++------- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/lib/rotur/project-methods.js b/src/lib/rotur/project-methods.js index 35670dad256..6000c3c114f 100644 --- a/src/lib/rotur/project-methods.js +++ b/src/lib/rotur/project-methods.js @@ -1,8 +1,9 @@ // The only Rotur SDK methods a project may reach through a Rotur host (the // editor, the community project page and packaged exports). Each entry lists // the scopes that cover it (any one is enough; an empty list means it needs no -// grant) and, for actions that spend, give away or destroy something, the -// confirmation the host shows before every call. +// grant) and, for actions that give away or destroy something, the +// confirmation the host shows before every call. Nothing here spends credits: +// projects can't. // // The host decides all of this. Nothing the project sends (labels, // confirmation text, a "sensitive" flag, a project name) is trusted, because a @@ -90,10 +91,6 @@ const PROJECT_METHODS = Object.freeze({ 'items.get': {scopes: []}, 'items.selling': {scopes: []}, 'items.list': {scopes: []}, - 'items.buy': { - scopes: ['items:buy'], - confirm: args => ({label: `buy item ${text(args[0])}`}) - }, 'items.sell': {scopes: ['items:sell']}, 'items.stopSelling': {scopes: ['items:sell']}, 'items.setPrice': {scopes: ['items:sell']}, @@ -103,10 +100,6 @@ const PROJECT_METHODS = Object.freeze({ }, 'cosmetics.shop': {scopes: []}, 'cosmetics.mine': {scopes: ['cosmetics:view']}, - 'cosmetics.purchase': { - scopes: ['cosmetics:buy'], - confirm: args => ({label: `buy cosmetic ${text(args[0])}`}) - }, 'cosmetics.equip': {scopes: ['cosmetics:equip']}, 'cosmetics.unequip': {scopes: ['cosmetics:equip']}, 'cosmetics.forUser': {scopes: []}, diff --git a/test/unit/community-project-rotur-bridge.test.jsx b/test/unit/community-project-rotur-bridge.test.jsx index 3a13ccb1f04..1015fe3fca9 100644 --- a/test/unit/community-project-rotur-bridge.test.jsx +++ b/test/unit/community-project-rotur-bridge.test.jsx @@ -132,7 +132,7 @@ describe('community project page Rotur bridge', () => { wrapper.unmount(); }); - test('spending always shows the real amount, whatever the frame claims', async () => { + test('a confirmation shows what the host builds, whatever the frame claims', async () => { const {wrapper, send} = await mountProject(); const pending = send({ kind: 'call', diff --git a/test/unit/rotur-project-methods.test.js b/test/unit/rotur-project-methods.test.js index 8101055b8eb..b082c6503d4 100644 --- a/test/unit/rotur-project-methods.test.js +++ b/test/unit/rotur-project-methods.test.js @@ -49,10 +49,12 @@ test('every method the built-in Rotur extensions call is allowlisted with its sc const calls = await recordExtensionCalls(); expect(calls.length).toBeGreaterThan(80); for (const {method, opts, scopes} of calls) { - // The "send credits" block: projects can't send credits any more. - // Blocks that moved credits, which projects can't do any more. They're + // Blocks that spent credits, which projects can't do any more. They're // removed from the extension in MistWarp/scratch-vm#24. - if (['me.transfer', 'gifts.create', 'keys.buy', 'groups.sendTip', 'groups.purchaseProduct'].includes(method)) continue; + if ([ + 'me.transfer', 'gifts.create', 'keys.buy', 'groups.sendTip', 'groups.purchaseProduct', + 'items.buy', 'cosmetics.purchase' + ].includes(method)) continue; const spec = projectMethod(method); expect({method, allowed: Boolean(spec)}).toEqual({method, allowed: true}); // A block's scope is what the host grants for it, after mapping. @@ -91,6 +93,8 @@ test.each([ 'keys.buy', 'groups.sendTip', 'groups.purchaseProduct', + 'items.buy', + 'cosmetics.purchase', 'socket.token', 'socket.send', '' @@ -120,12 +124,11 @@ test('a scoped method needs a grant for one of its scopes', () => { expect(authorizeProjectCall('profiles.get', ['someone'], [], 'p').args).toEqual(['someone']); }); -test('actions that spend or give something away are confirmed with text the host builds', () => { - expect(authorizeProjectCall('items.buy', ['hat'], [], 'p').confirm.label).toBe('buy item hat'); +test('actions that give something away or destroy it are confirmed with text the host builds', () => { + expect(authorizeProjectCall('items.transfer', ['hat', 'sam'], [], 'p').confirm.label).toBe('give item hat to @sam'); expect(authorizeProjectCall('gifts.claim', ['CODE'], [], 'p').confirm.label).toBe('claim gift code CODE'); for (const method of [ - 'gifts.claim', 'keys.cancel', 'keys.delete', - 'posts.delete', 'items.buy', 'items.transfer', 'cosmetics.purchase' + 'gifts.claim', 'keys.cancel', 'keys.delete', 'posts.delete', 'items.transfer' ]) { expect({method, confirm: Boolean(projectMethod(method).confirm)}).toEqual({method, confirm: true}); } From 57f4d060a7b3621231008b7b9ca1b63c3b855be7 Mon Sep 17 00:00:00 2001 From: Mistium <92952823+Mistium@users.noreply.github.com> Date: Fri, 2 Oct 2026 19:29:58 +0100 Subject: [PATCH 3/5] Pick up the Rotur blocks without money, and drop the test skips scratch-vm now hides the blocks that read or spent credits, and they call nothing. The test that walks every block no longer skips their methods, and me.claimTime and me.transactions, which only the daily claim and transaction blocks used, are no longer project methods. --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- src/lib/rotur/project-methods.js | 2 -- test/unit/rotur-project-methods.test.js | 8 ++------ 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index b3e7be0bdbe..0dee7d759ce 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "scratch-paint": "https://codeload.github.com/MistWarp/scratch-paint/tar.gz/52db8c8ede05ab2f925148ec1e783ea39b9dfca0", "scratch-render": "https://codeload.github.com/MistWarp/scratch-render/tar.gz/ce8e30cb75fcba486d20a453bd51127f5a145a1a", "scratch-render-fonts": "https://codeload.github.com/PenguinMod/penguinmod-render-fonts/tar.gz/4dda62c707f64505266aa62f7a6cc84f0e5812fd", - "scratch-vm": "https://codeload.github.com/MistWarp/scratch-vm/tar.gz/4e8113e2546ff406644f4099f99ef5a7e85aa4c5", + "scratch-vm": "https://codeload.github.com/MistWarp/scratch-vm/tar.gz/c775381a55c13029d15ae7fe87fdae24a6998cf9", "scratchblocks": "3.7.1", "sha.js": "^2.4.12", "to-style": "1.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 73dabb007c9..f854c9de9bc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -197,8 +197,8 @@ importers: specifier: https://codeload.github.com/PenguinMod/penguinmod-render-fonts/tar.gz/4dda62c707f64505266aa62f7a6cc84f0e5812fd version: https://codeload.github.com/PenguinMod/penguinmod-render-fonts/tar.gz/4dda62c707f64505266aa62f7a6cc84f0e5812fd scratch-vm: - specifier: https://codeload.github.com/MistWarp/scratch-vm/tar.gz/4e8113e2546ff406644f4099f99ef5a7e85aa4c5 - version: https://codeload.github.com/MistWarp/scratch-vm/tar.gz/4e8113e2546ff406644f4099f99ef5a7e85aa4c5(@turbowarp/scratch-svg-renderer@1.1.0(patch_hash=81a01d6d472570d53eec593be679e84867db1ba1410f5ef084d5c404068481b9)(scratch-render-fonts@https://codeload.github.com/PenguinMod/penguinmod-render-fonts/tar.gz/4dda62c707f64505266aa62f7a6cc84f0e5812fd))(eslint@8.55.0)(webpack@4.47.0) + specifier: https://codeload.github.com/MistWarp/scratch-vm/tar.gz/c775381a55c13029d15ae7fe87fdae24a6998cf9 + version: https://codeload.github.com/MistWarp/scratch-vm/tar.gz/c775381a55c13029d15ae7fe87fdae24a6998cf9(@turbowarp/scratch-svg-renderer@1.1.0(patch_hash=81a01d6d472570d53eec593be679e84867db1ba1410f5ef084d5c404068481b9)(scratch-render-fonts@https://codeload.github.com/PenguinMod/penguinmod-render-fonts/tar.gz/4dda62c707f64505266aa62f7a6cc84f0e5812fd))(eslint@8.55.0)(webpack@4.47.0) scratchblocks: specifier: 3.7.1 version: 3.7.1 @@ -5493,8 +5493,8 @@ packages: scratch-translate-extension-languages@1.0.7: resolution: {integrity: sha512-6+bQU9iVYv23T8J0SjpV6MTugm0y8myh/4DPgu1BGfccysdkaWzu3MkNGQyQRUlbqAiW9wM7ctfv3USPEkzTgg==} - scratch-vm@https://codeload.github.com/MistWarp/scratch-vm/tar.gz/4e8113e2546ff406644f4099f99ef5a7e85aa4c5: - resolution: {tarball: https://codeload.github.com/MistWarp/scratch-vm/tar.gz/4e8113e2546ff406644f4099f99ef5a7e85aa4c5} + scratch-vm@https://codeload.github.com/MistWarp/scratch-vm/tar.gz/c775381a55c13029d15ae7fe87fdae24a6998cf9: + resolution: {tarball: https://codeload.github.com/MistWarp/scratch-vm/tar.gz/c775381a55c13029d15ae7fe87fdae24a6998cf9} version: 2.1.46 peerDependencies: '@turbowarp/scratch-svg-renderer': ^1.1.0 @@ -12627,7 +12627,7 @@ snapshots: scratch-translate-extension-languages@1.0.7: {} - scratch-vm@https://codeload.github.com/MistWarp/scratch-vm/tar.gz/4e8113e2546ff406644f4099f99ef5a7e85aa4c5(@turbowarp/scratch-svg-renderer@1.1.0(patch_hash=81a01d6d472570d53eec593be679e84867db1ba1410f5ef084d5c404068481b9)(scratch-render-fonts@https://codeload.github.com/PenguinMod/penguinmod-render-fonts/tar.gz/4dda62c707f64505266aa62f7a6cc84f0e5812fd))(eslint@8.55.0)(webpack@4.47.0): + scratch-vm@https://codeload.github.com/MistWarp/scratch-vm/tar.gz/c775381a55c13029d15ae7fe87fdae24a6998cf9(@turbowarp/scratch-svg-renderer@1.1.0(patch_hash=81a01d6d472570d53eec593be679e84867db1ba1410f5ef084d5c404068481b9)(scratch-render-fonts@https://codeload.github.com/PenguinMod/penguinmod-render-fonts/tar.gz/4dda62c707f64505266aa62f7a6cc84f0e5812fd))(eslint@8.55.0)(webpack@4.47.0): dependencies: '@turbowarp/json': 0.1.2 '@turbowarp/jszip': 3.12.0 diff --git a/src/lib/rotur/project-methods.js b/src/lib/rotur/project-methods.js index 6000c3c114f..7b7c70d8bf5 100644 --- a/src/lib/rotur/project-methods.js +++ b/src/lib/rotur/project-methods.js @@ -22,8 +22,6 @@ const PROJECT_METHODS = Object.freeze({ 'me.block': {scopes: ['blocked:manage']}, 'me.unblock': {scopes: ['blocked:manage']}, 'me.requests': {scopes: ['friends:view']}, - 'me.claimTime': {scopes: ['credits:view']}, - 'me.transactions': {scopes: ['credits:view']}, 'profiles.get': {scopes: []}, 'profiles.exists': {scopes: []}, diff --git a/test/unit/rotur-project-methods.test.js b/test/unit/rotur-project-methods.test.js index b082c6503d4..17670f32f59 100644 --- a/test/unit/rotur-project-methods.test.js +++ b/test/unit/rotur-project-methods.test.js @@ -49,12 +49,6 @@ test('every method the built-in Rotur extensions call is allowlisted with its sc const calls = await recordExtensionCalls(); expect(calls.length).toBeGreaterThan(80); for (const {method, opts, scopes} of calls) { - // Blocks that spent credits, which projects can't do any more. They're - // removed from the extension in MistWarp/scratch-vm#24. - if ([ - 'me.transfer', 'gifts.create', 'keys.buy', 'groups.sendTip', 'groups.purchaseProduct', - 'items.buy', 'cosmetics.purchase' - ].includes(method)) continue; const spec = projectMethod(method); expect({method, allowed: Boolean(spec)}).toEqual({method, allowed: true}); // A block's scope is what the host grants for it, after mapping. @@ -89,6 +83,8 @@ test.each([ 'admin.transferCredits', 'me.transfer', 'me.transfer.call', + 'me.claimTime', + 'me.transactions', 'gifts.create', 'keys.buy', 'groups.sendTip', From 37851806f2e0369e3d9df21a2d42d89c164e1e10 Mon Sep 17 00:00:00 2001 From: Mistium <92952823+Mistium@users.noreply.github.com> Date: Fri, 2 Oct 2026 18:58:25 +0100 Subject: [PATCH 4/5] Remove the wallet, and send people to Rotur for their credits MistWarp no longer shows your Rotur balance, claims daily credits or reads your transactions, so it no longer asks for credits:view or credits:daily, and projects can't either. The wallet page becomes Purchases, with what you've bought from MistWarp's own records and a link to rotur.dev/me for everything about your credits; /wallet goes there. My Stuff's wallet card becomes Earnings, with the credits earned that mistwarp-api records. The buy confirmation no longer shows a balance. Listing bounties no longer sends a token, since anyone can list them. --- src/community/App.jsx | 9 +- src/community/credits.js | 8 +- src/community/pages/MyStuff.jsx | 54 +- src/community/pages/MyStuff.module.css | 21 +- src/community/pages/Profile.jsx | 4 +- src/community/pages/Project.jsx | 34 +- src/community/pages/Purchases.jsx | 127 +++ src/community/pages/Purchases.module.css | 130 +++ src/community/pages/Wallet.jsx | 371 -------- src/community/pages/Wallet.module.css | 332 ------- src/community/translations/_sources.json | 830 ++++++++---------- src/community/translations/en.json | 45 +- src/components/menu-bar/mw-rotur-account.jsx | 12 +- src/lib/rotur/client.js | 100 --- src/lib/rotur/project-methods.js | 2 +- src/lib/tw-translations/default-messages.json | 2 +- test/unit/community-my-stuff-loading.test.jsx | 3 - test/unit/community-project-loading.test.jsx | 3 - .../community-project-rotur-bridge.test.jsx | 1 - test/unit/community-purchases.test.jsx | 58 ++ test/unit/community-wallet.test.jsx | 141 --- test/unit/rotur-donations.test.js | 36 - test/unit/rotur-extension-host.test.js | 4 +- test/unit/rotur-project-methods.test.js | 13 +- 24 files changed, 744 insertions(+), 1596 deletions(-) create mode 100644 src/community/pages/Purchases.jsx create mode 100644 src/community/pages/Purchases.module.css delete mode 100644 src/community/pages/Wallet.jsx delete mode 100644 src/community/pages/Wallet.module.css create mode 100644 test/unit/community-purchases.test.jsx delete mode 100644 test/unit/community-wallet.test.jsx delete mode 100644 test/unit/rotur-donations.test.js diff --git a/src/community/App.jsx b/src/community/App.jsx index b4e8c597fd9..41be28b768d 100644 --- a/src/community/App.jsx +++ b/src/community/App.jsx @@ -2,7 +2,7 @@ import tokenStyles from './styles/tokens.module.css'; import React, {Suspense, useEffect} from 'react'; import {lazyWithReload as lazy} from '../lib/lazy-with-retry.js'; import ErrorBoundary from '../containers/error-boundary.jsx'; -import {Routes, Route, useLocation} from 'react-router-dom'; +import {Navigate, Routes, Route, useLocation} from 'react-router-dom'; import {UserProvider} from './UserContext.jsx'; import setPageMeta from './page-meta.js'; import {initSiteErrorReporting} from '../lib/error-reporter.js'; @@ -32,7 +32,7 @@ const Followers = lazy(() => import('./pages/Followers.jsx')); const Settings = lazy(() => import('./pages/Settings.jsx')); const MyStuff = lazy(() => import('./pages/MyStuff.jsx')); const ManageProject = lazy(() => import('./pages/ManageProject.jsx')); -const Wallet = lazy(() => import('./pages/Wallet.jsx')); +const Purchases = lazy(() => import('./pages/Purchases.jsx')); const Notifications = lazy(() => import('./pages/Notifications.jsx')); const Post = lazy(() => import('./pages/Post.jsx')); const News = lazy(() => import('./pages/News.jsx')); @@ -67,7 +67,7 @@ const ROUTE_TITLES = [ ['/perks', 'Memberships'], ['/mystuff/project/', 'Manage project'], ['/mystuff', 'My Stuff'], - ['/wallet', 'Wallet'], + ['/purchases', 'Purchases'], ['/notifications', 'Notifications'], ['/posts/', 'Post'], ['/news', 'News'], @@ -151,7 +151,8 @@ const App = () => { } /> } /> } /> - } /> + } /> + } /> } /> } /> } /> diff --git a/src/community/credits.js b/src/community/credits.js index 4685f85ddc1..e6fc1625ebd 100644 --- a/src/community/credits.js +++ b/src/community/credits.js @@ -76,15 +76,10 @@ const sendCommercePayment = ({to, amount, source = 'mistwarp', kind, resourceTyp }) }); -const getCommerceEarnings = async () => { - await ensureScopes(['credits:view']); - return billingRequest('/me/earnings'); -}; - const listCommerceBounties = async (filters = {}) => { const query = new URLSearchParams(filters); const path = `/bounties?${query.toString()}`; - if (await getAccessToken()) return commerceRequest(path); + // Anyone can list bounties, so no token or credits permission is needed. const response = await fetch(`${ROTUR_API}/commerce${path}`); const data = await response.json().catch(() => null); if (!response.ok) throw new Error((data && data.error) || `Billing request failed (${response.status})`); @@ -112,7 +107,6 @@ export { isInsufficientFunds, randomIdempotencyKey, sendCommercePayment, - getCommerceEarnings, listCommerceBounties, createCommerceBounty, cancelCommerceBounty diff --git a/src/community/pages/MyStuff.jsx b/src/community/pages/MyStuff.jsx index 0884d3637fc..f3f20d5fd19 100644 --- a/src/community/pages/MyStuff.jsx +++ b/src/community/pages/MyStuff.jsx @@ -5,12 +5,11 @@ import React, {useEffect, useState, useCallback, useRef} from 'react'; import {Link, useSearchParams} from 'react-router-dom'; import { Plus, Trash2, Heart, ThumbsDown, Play, Upload, Star, MoreHorizontal, Pencil, ExternalLink, HardDrive, - SlidersHorizontal, Coins, Eye, TrendingUp, Wallet, HeartHandshake, FolderOpen, LayoutDashboard, + SlidersHorizontal, Coins, Eye, TrendingUp, ShoppingBag, HeartHandshake, FolderOpen, LayoutDashboard, AlertTriangle, Library, Layers3, RotateCcw, Package, Image, Palette, Bookmark } from 'lucide-react'; import api, {editorUrl, projectUrl} from '../api'; import {formatBytes, formatDate} from '../format'; -import {getAccountSummary} from '../../lib/rotur/client.js'; import {useUser} from '../UserContext.jsx'; import Button from '../components/ui/Button.jsx'; import CardGrid from '../components/ui/CardGrid.jsx'; @@ -76,7 +75,7 @@ const visibilityLabel = project => { return 'Draft'; }; -const Overview = ({stats, account, quota, username, onNavigate}) => { +const Overview = ({stats, quota, username, onNavigate}) => { const {text: communityText} = useCommunityText(); const [recent, setRecent] = useState(null); const [recentFailed, setRecentFailed] = useState(false); @@ -210,17 +209,7 @@ const Overview = ({stats, account, quota, username, onNavigate}) => {
- - {account && account.balance !== null ? ( -
- - - {communityText('Balance')} - -
- ) : null} +
{stats.totalRevenue > 0 ? (
@@ -228,19 +217,16 @@ const Overview = ({stats, account, quota, username, onNavigate}) => { {fmtCredits(stats.totalRevenue)}
) : null} - {account && account.donationsReceived > 0 ? ( -
- - {fmtCredits(account.donationsReceived)} -
- ) : null} - {!(stats.totalRevenue > 0) && - !(account && account.donationsReceived > 0) && - !(account && account.balance !== null) ? ( - - {communityText('Offer a project for purchase so people can support your work.')} - - ) : null} + {stats.totalRevenue > 0 ? null : ( + + {communityText('Offer a project for purchase so people can support your work.')} + + )} +
+
+ +
{quota ? ( @@ -545,7 +531,6 @@ const MyStuff = () => { const [perks, setPerks] = useState(null); const [stats, setStats] = useState(null); const [statsFailed, setStatsFailed] = useState(false); - const [account, setAccount] = useState(null); const [inventoryItems, setInventoryItems] = useState(null); const [inventoryFailed, setInventoryFailed] = useState(false); const [pendingUploadFile, setPendingUploadFile] = useState(null); @@ -667,7 +652,6 @@ const MyStuff = () => { if (!username) { setStats(null); setStatsFailed(false); - setAccount(null); return; } const context = accountContextRef.current; @@ -689,17 +673,6 @@ const MyStuff = () => { loadStats(); }, [loadStats]); - useEffect(() => { - if (!user) return; - let stale = false; - getAccountSummary() - .then(data => !stale && setAccount(data)) - .catch(() => {}); - return () => { - stale = true; - }; - }, [user]); - const load = useCallback(() => { const fresh = beginProjectLoad(); if (!user || tab !== 'projects') { @@ -1349,7 +1322,6 @@ const MyStuff = () => { stats ? ( { {status ? {status} : null} {insufficient ? ( - {communityText('Not enough credits in your balance. Claim your daily credits in your wallet, then send again.')}{' '} - {communityText('Open wallet')} + {communityText('Not enough credits in your balance. Claim your daily credits on Rotur, then send again.')}{' '} + {communityText('Open Rotur')} ) : null} + + +
+

{communityText('Purchase history')}

+ {purchaseError ? ( + setPurchaseAttempt(value => value + 1)}> + {purchaseError} + + ) : purchases === null ? ( + + ) : purchases.length ? ( +
    + {purchases.map((purchase, index) => ( +
  • + {purchase.title || purchase.projectId} + + + + {fmtCredits(purchase.amount)} + + {purchase.at ? ( + {formatDate(purchase.at)} + ) : null} + +
  • + ))} +
+ ) : ( + {communityText('Explore projects')}} + > + {communityText('You have not bought any projects yet.')} + + )} +
+ + ); +}; + +export default Purchases; diff --git a/src/community/pages/Purchases.module.css b/src/community/pages/Purchases.module.css new file mode 100644 index 00000000000..3d27aa19474 --- /dev/null +++ b/src/community/pages/Purchases.module.css @@ -0,0 +1,130 @@ +.page { + max-width: var(--maxw-narrow); + margin: 0 auto; + padding: var(--page-pad); +} + +.roturCard { + display: flex; + align-items: center; + gap: 16px; + padding: 22px; + border-radius: var(--radius); + border: 1px solid var(--border); + background: var(--bg-card); + box-shadow: var(--card-shadow); + margin-bottom: 16px; +} + +.roturIcon { + display: inline-flex; + align-items: center; + justify-content: center; + width: 52px; + height: 52px; + border-radius: var(--radius); + background: color-mix(in srgb, #FF8C1A 18%, transparent); + color: #FF8C1A; + flex-shrink: 0; +} + +.roturLead { + font-size: var(--fs-sm); + color: var(--text-dim); +} + +.section { + margin-bottom: 28px; +} + +.sectionTitle { + margin: 0 0 6px; + font-size: var(--fs-lg); +} + +.purchases { + list-style: none; + margin: 0; + padding: 0; + display: flex; + flex-direction: column; + gap: 4px; +} + +.purchaseRow { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + padding: 10px 12px; + border-radius: var(--radius-sm); + background: var(--bg-card); + box-shadow: var(--card-shadow); +} + +.purchaseTitle { + font-weight: 600; + font-size: var(--fs-lg); + color: var(--mw-text); + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.purchaseTitle:hover { + color: var(--accent-strong); +} + +.purchaseMeta { + display: flex; + align-items: center; + gap: 14px; + flex-shrink: 0; +} + +.purchaseAmount { + display: inline-flex; + align-items: center; + gap: 5px; + font-weight: 600; + font-size: var(--fs-md); + color: #FF8C1A; +} + +.purchaseDate { + font-size: var(--fs-sm); + color: var(--text-dim); + white-space: nowrap; +} + +@media (max-width: 520px) { + .page { + padding: 20px 14px 64px; + } + + .roturCard { + flex-wrap: wrap; + } + + .purchaseRow { + align-items: flex-start; + flex-direction: column; + } + + .purchaseMeta { + width: 100%; + justify-content: space-between; + } +} + +.roturButton { + margin-inline-start: auto; + flex-shrink: 0; +} + +.roturTitle { + font-size: var(--fs-lg); + font-weight: 700; + color: var(--mw-text); +} diff --git a/src/community/pages/Wallet.jsx b/src/community/pages/Wallet.jsx deleted file mode 100644 index e5e1ae32ce9..00000000000 --- a/src/community/pages/Wallet.jsx +++ /dev/null @@ -1,371 +0,0 @@ -import {getCommunityLocale} from '../locale.js'; -import {useCommunityIntl as useCommunityText} from '../i18n.jsx'; -import React, {useEffect, useRef, useState} from 'react'; -import {Link} from 'react-router-dom'; -import { - ArrowDownLeft, ArrowUpRight, Coins, Wallet as WalletIcon, HeartHandshake, Send, CalendarCheck -} from 'lucide-react'; -import api, {projectUrl} from '../api'; -import {getAccountSummary, claimDaily} from '../../lib/rotur/client.js'; -import {getCommerceEarnings} from '../credits'; -import {useUser} from '../UserContext.jsx'; -import Button from '../components/ui/Button.jsx'; -import EmptyState, {SignInPrompt} from '../components/ui/EmptyState.jsx'; -import PageHeader from '../components/ui/PageHeader.jsx'; -import StatusMessage from '../components/ui/StatusMessage.jsx'; -import {formatDate, safeDate} from '../format'; -import styles from './Wallet.module.css'; - -const fmtCredits = value => Math.round((Number(value) || 0) * 100) / 100; - -const donationDate = value => { - const date = safeDate(value); - return !date ? '' : date.toLocaleString(getCommunityLocale(), { - dateStyle: 'medium', - timeStyle: 'short' - }); -}; - -const Wallet = () => { - const {text: communityText} = useCommunityText(); - const credits = value => communityText('{value1} credits', {value1: fmtCredits(value)}); - const {user, loading, login} = useUser(); - const viewerName = (user && user.username) || ''; - const walletContext = useRef(viewerName); - walletContext.current = viewerName; - const [account, setAccount] = useState(null); - const [accountLoaded, setAccountLoaded] = useState(false); - const [accountError, setAccountError] = useState(''); - const [accountAttempt, setAccountAttempt] = useState(0); - const [purchases, setPurchases] = useState(null); - const [purchaseError, setPurchaseError] = useState(''); - const [purchaseAttempt, setPurchaseAttempt] = useState(0); - const [earnings, setEarnings] = useState(null); - const [earningsError, setEarningsError] = useState(''); - const [earningsAttempt, setEarningsAttempt] = useState(0); - const [claiming, setClaiming] = useState(false); - const [claimMsg, setClaimMsg] = useState(''); - const actionLocks = useRef(new Set()); - - useEffect(() => { - setClaimMsg(''); - setClaiming(false); - }, [viewerName]); - - useEffect(() => { - if (!viewerName) { - setAccount(null); - setAccountLoaded(false); - setAccountError(''); - return () => {}; - } - let stale = false; - setAccount(null); - setAccountLoaded(false); - setAccountError(''); - getAccountSummary() - .then(data => { - if (stale) return; - setAccount(data); - setAccountLoaded(true); - }) - .catch(() => { - if (stale) return; - setAccountError(communityText('Could not load your wallet data.')); - setAccountLoaded(true); - }); - return () => { - stale = true; - }; - }, [accountAttempt, viewerName]); - - useEffect(() => { - if (!viewerName) { - setPurchases(null); - setPurchaseError(''); - return () => {}; - } - let stale = false; - setPurchases(null); - setPurchaseError(''); - api.purchases() - .then(data => !stale && setPurchases(data.purchases || [])) - .catch(() => !stale && setPurchaseError(communityText('Could not load purchase history.'))); - return () => { - stale = true; - }; - }, [purchaseAttempt, viewerName]); - - useEffect(() => { - if (!viewerName) { - setEarnings(null); - setEarningsError(''); - return () => {}; - } - let stale = false; - setEarnings(null); - setEarningsError(''); - const earningsRequest = typeof getCommerceEarnings === 'function' ? - getCommerceEarnings() : Promise.resolve(null); - earningsRequest - .then(data => { - if (stale) return; - if (!data) throw new Error('Creator earnings are unavailable.'); - setEarnings(data); - }) - .catch(() => !stale && setEarningsError(communityText('Could not load creator earnings.'))); - return () => { - stale = true; - }; - }, [earningsAttempt, viewerName]); - - if (loading) { - return
; - } - if (!user) { - return ( -
- {communityText('Sign in to view your wallet.')} -
- ); - } - - const balance = account && account.balance !== null ? account.balance : null; - - const doClaimDaily = async () => { - const context = walletContext.current; - const actionKey = `${context}\u0000claim`; - if (actionLocks.current.has(actionKey)) return; - actionLocks.current.add(actionKey); - setClaiming(true); - setClaimMsg(''); - try { - await claimDaily(); - if (walletContext.current !== context) return; - setClaimMsg(communityText('Daily credits claimed.')); - const data = await getAccountSummary(); - if (data && walletContext.current === context) { - setAccount(data); - setAccountLoaded(true); - } - } catch (e) { - if (walletContext.current !== context) return; - if (e.waitHours) { - setClaimMsg(communityText('Already claimed. Come back in {value1}h.', {value1: e.waitHours})); - } else if (e.needsReauth) { - setClaimMsg(communityText( - 'Your current login cannot claim daily credits. Log out and back in, then try again.' - )); - } else { - setClaimMsg(e.message || 'Could not claim daily credits.'); - } - } finally { - actionLocks.current.delete(actionKey); - if (walletContext.current === context) setClaiming(false); - } - }; - - - return ( -
- - -
- -
-
{communityText('Your balance')}
-
- {balance !== null ? ( - <> - {fmtCredits(balance).toLocaleString(getCommunityLocale())} - {communityText('credits')} - - ) : ( - - {accountLoaded ? communityText('Could not load your balance right now') : '…'} - - )} -
- {claimMsg ?
{claimMsg}
: null} -
- -
- {accountError ? ( - setAccountAttempt(value => value + 1)}> - {accountError} - - ) : null} - - {account && (account.donationsReceived > 0 || account.donationsGiven > 0) ? ( -
- {account.donationsReceived > 0 ? ( -
- - - {communityText('{value1} received in donations', { - value1: fmtCredits(account.donationsReceived) - })} - -
- ) : null} - {account.donationsGiven > 0 ? ( -
- - - {communityText('{value1} given in donations', { - value1: fmtCredits(account.donationsGiven) - })} - -
- ) : null} -
- ) : null} - -
-

{communityText('Creator earnings')}

-

- {communityText('Tips, project sales, revenue shares, and bounties paid to you.')} -

- {earnings ? ( - -
-
- {communityText('Today')} - {credits(earnings.totals.today)} -
-
- {communityText('Last 30 days')} - {credits(earnings.totals.last_30_days)} -
-
- {communityText('Recorded total')} - {credits(earnings.totals.lifetime)} -
-
- {earnings.history && earnings.history.length ? ( -
    - {earnings.history.slice(0, 10).map(entry => ( -
  • - - - {entry.note || String(entry.kind || 'earning').replace(/_/g, ' ')} - - - {entry.payer ? - communityText('From {value1}', {value1: entry.payer}) : - entry.source} - - - +{credits(entry.amount)} -
  • - ))} -
- ) : } -
- ) : earningsError ? ( - setEarningsAttempt(value => value + 1)}> - {earningsError} - - ) : {communityText('Loading creator earnings…')}} -
- -
-

{communityText('Donation history')}

-

- {communityText('Credits you have sent or received through MistWarp profiles.')} -

- {account && Array.isArray(account.donations) && account.donations.length ? ( -
    - {account.donations.map(donation => { - const received = donation.direction === 'received'; - const donatedAt = safeDate(donation.time); - return ( -
  • - - {received ? : } - - - {received ? communityText('Received') : communityText('Sent')} - {donation.user ? ( - - {received ? communityText('From') : communityText('To')}{' '} - {donation.user} - - ) : null} - {donatedAt ? ( - - ) : null} - - - {received ? '+' : '-'}{credits(donation.amount)} -
  • - ); - })} -
- ) : accountError ? ( - - {communityText('Try loading your wallet data again above.')} - - ) : accountLoaded ? ( - - ) : ( - {communityText('Loading donation history…')} - )} -
- -
-

{communityText('Purchase history')}

- {purchaseError ? ( - setPurchaseAttempt(value => value + 1)}> - {purchaseError} - - ) : purchases === null ? ( - - ) : purchases.length ? ( -
    - {purchases.map((purchase, index) => ( -
  • - {purchase.title || purchase.projectId} - - - - {fmtCredits(purchase.amount)} - - {purchase.at ? ( - {formatDate(purchase.at)} - ) : null} - -
  • - ))} -
- ) : ( - {communityText('Explore projects')}} - > - {communityText('You have not bought any projects yet.')} - - )} -
-
- ); -}; - -export default Wallet; diff --git a/src/community/pages/Wallet.module.css b/src/community/pages/Wallet.module.css deleted file mode 100644 index ba5cf707e80..00000000000 --- a/src/community/pages/Wallet.module.css +++ /dev/null @@ -1,332 +0,0 @@ -.page { - max-width: var(--maxw-narrow); - margin: 0 auto; - padding: var(--page-pad); -} - -.balanceCard { - display: flex; - align-items: center; - gap: 16px; - padding: 22px; - border-radius: var(--radius); - border: 1px solid var(--border); - background: var(--bg-card); - box-shadow: var(--card-shadow); - margin-bottom: 16px; -} - -.balanceIcon { - display: inline-flex; - align-items: center; - justify-content: center; - width: 52px; - height: 52px; - border-radius: var(--radius); - background: color-mix(in srgb, #FF8C1A 18%, transparent); - color: #FF8C1A; - flex-shrink: 0; -} - -.balanceLabel { - font-size: var(--fs-sm); - color: var(--text-dim); -} - -.balanceValue { - display: flex; - align-items: baseline; - gap: 8px; - font-size: var(--fs-4xl); - font-weight: 700; - line-height: 1.1; - color: var(--mw-text); -} - -.balanceUnit { - font-size: var(--fs-lg); - font-weight: 600; - color: var(--text-dim); -} - -.balanceUnknown { - font-size: var(--fs-lg); - font-weight: 600; - color: var(--text-dim); -} - -.claimMsg { - margin-top: 6px; - font-size: var(--fs-sm); - color: var(--text-dim); -} - -.claimBtn { - display: inline-flex; - align-items: center; - gap: 8px; - margin-inline-start: auto; - flex-shrink: 0; - padding: 10px 16px; - border-radius: var(--radius-sm); - border: none; - background: #FF8C1A; - color: #fff; - font-size: var(--fs-md); - font-weight: 700; - cursor: pointer; - transition: filter 0.15s; -} - -.claimBtn:hover:not(:disabled) { - filter: brightness(1.08); -} - -.claimBtn:disabled { - opacity: 0.6; - cursor: default; -} - -.donationRow { - display: flex; - flex-wrap: wrap; - gap: 12px; - margin-bottom: 22px; -} - -.donationCard { - display: inline-flex; - align-items: center; - gap: 8px; - padding: 10px 14px; - border-radius: var(--radius-sm); - border: 1px solid var(--border); - background: var(--bg-card); - font-size: var(--fs-md); - color: var(--mw-text); -} - -.donations { - display: flex; - flex-direction: column; - gap: 6px; - margin: 0; - padding: 0; - list-style: none; -} - -.donationEntry { - display: grid; - grid-template-columns: 38px minmax(0, 1fr) auto; - align-items: center; - gap: 10px; - padding: 11px 12px; - border-radius: var(--radius-sm); - background: var(--bg-card); - box-shadow: var(--card-shadow); -} - -.receivedIcon, -.givenIcon { - display: inline-flex; - align-items: center; - justify-content: center; - width: 36px; - height: 36px; - border-radius: var(--radius-sm); - background: color-mix(in srgb, #35a866 14%, transparent); - color: #35a866; -} - -.givenIcon { - background: color-mix(in srgb, #FF8C1A 14%, transparent); - color: #d76f08; -} - -.donationDetails { - display: flex; - min-width: 0; - flex-direction: column; - gap: 2px; - font-size: var(--fs-xs); - color: var(--text-dim); -} - -.donationDetails > strong { - color: var(--mw-text); - font-size: var(--fs-md); -} - -.donationDetails a { - color: var(--accent-strong); - font-weight: 600; -} - -.donationDetails time { - color: var(--text-faint); - font-size: var(--fs-2xs); -} - -.receivedAmount, -.givenAmount { - color: #279456; - font-size: var(--fs-md); - white-space: nowrap; -} - -.givenAmount { - color: #d76f08; -} - -.section { - margin-bottom: 28px; -} - -.sectionTitle { - margin: 0 0 6px; - font-size: var(--fs-lg); -} - -.sectionLead { - margin: 0 0 14px; - font-size: var(--fs-md); - color: var(--text-dim); -} - -.earningsGrid { - display: grid; - grid-template-columns: repeat(3, minmax(0, 1fr)); - gap: 10px; - margin-bottom: 12px; -} - -.earningsGrid > div { - display: flex; - flex-direction: column; - gap: 4px; - padding: 13px; - border: 1px solid var(--border); - border-radius: var(--radius-sm); - background: var(--bg-card); -} - -.earningsGrid span, -.earningEntry small { - color: var(--text-dim); - font-size: var(--fs-xs); -} - -.earningsList { - display: flex; - flex-direction: column; - gap: 6px; - margin: 0; - padding: 0; - list-style: none; -} - -.earningEntry { - display: flex; - align-items: center; - justify-content: space-between; - gap: 12px; - padding: 11px 12px; - border-radius: var(--radius-sm); - background: var(--bg-card); -} - -.earningEntry > span { - display: flex; - min-width: 0; - flex-direction: column; - gap: 2px; -} - -.purchases { - list-style: none; - margin: 0; - padding: 0; - display: flex; - flex-direction: column; - gap: 4px; -} - -.purchaseRow { - display: flex; - align-items: center; - justify-content: space-between; - gap: 12px; - padding: 10px 12px; - border-radius: var(--radius-sm); - background: var(--bg-card); - box-shadow: var(--card-shadow); -} - -.purchaseTitle { - font-weight: 600; - font-size: var(--fs-lg); - color: var(--mw-text); - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.purchaseTitle:hover { - color: var(--accent-strong); -} - -.purchaseMeta { - display: flex; - align-items: center; - gap: 14px; - flex-shrink: 0; -} - -.purchaseAmount { - display: inline-flex; - align-items: center; - gap: 5px; - font-weight: 600; - font-size: var(--fs-md); - color: #FF8C1A; -} - -.purchaseDate { - font-size: var(--fs-sm); - color: var(--text-dim); - white-space: nowrap; -} - -@media (max-width: 520px) { - .page { - padding: 20px 14px 64px; - } - - .tiers { - grid-template-columns: 1fr; - } - - .earningsGrid { - grid-template-columns: 1fr; - } - - .donationEntry { - grid-template-columns: 38px minmax(0, 1fr); - } - - .receivedAmount, - .givenAmount { - grid-column: 2; - } - - .purchaseRow { - align-items: flex-start; - flex-direction: column; - } - - .purchaseMeta { - width: 100%; - justify-content: space-between; - } -} diff --git a/src/community/translations/_sources.json b/src/community/translations/_sources.json index 3e884333a48..a46f455a2b3 100644 --- a/src/community/translations/_sources.json +++ b/src/community/translations/_sources.json @@ -150,7 +150,7 @@ "src/community/pages/ManageSpace.jsx:661", "src/community/pages/ManageSpace.jsx:685", "src/community/pages/News.jsx:299", - "src/community/pages/Project.jsx:2723", + "src/community/pages/Project.jsx:2701", "src/community/pages/Theme.jsx:220", "src/community/pages/Theme.jsx:253" ], @@ -216,8 +216,7 @@ "src/community/components/ProjectDonationAnalytics.jsx:49", "src/community/components/ProjectDonationAnalytics.jsx:70", "src/community/pages/ManageProject.jsx:795", - "src/community/pages/Project.jsx:2284", - "src/community/pages/Wallet.jsx:31" + "src/community/pages/Project.jsx:2262" ], "Edited": [ "src/community/components/CommentThread.jsx:139", @@ -273,10 +272,10 @@ "src/community/components/ui/ConfirmModal.jsx:22", "src/community/pages/ManageProject.jsx:1189", "src/community/pages/ManageSpace.jsx:729", - "src/community/pages/MyStuff.jsx:1289", + "src/community/pages/MyStuff.jsx:1262", "src/community/pages/News.jsx:293", - "src/community/pages/Project.jsx:1726", - "src/community/pages/Project.jsx:1843", + "src/community/pages/Project.jsx:1710", + "src/community/pages/Project.jsx:1827", "src/community/pages/Roadmap.jsx:501", "src/community/pages/Spaces.jsx:283", "src/community/pages/Theme.jsx:252" @@ -376,10 +375,10 @@ "src/community/components/ui/StatusMessage.jsx:24", "src/community/pages/Admin.jsx:1572", "src/community/pages/Explore.jsx:220", - "src/community/pages/MyStuff.jsx:1589", + "src/community/pages/MyStuff.jsx:1561", "src/community/pages/Profile.jsx:448", "src/community/pages/Profile.jsx:627", - "src/community/pages/Project.jsx:1442", + "src/community/pages/Project.jsx:1427", "src/community/pages/RemixTree.jsx:244", "src/community/pages/Search.jsx:203", "src/community/pages/Spaces.jsx:311", @@ -415,10 +414,10 @@ "src/community/components/NewsItem.jsx:132", "src/community/components/ProfilePosts.jsx:220", "src/community/pages/ManageSpace.jsx:753", - "src/community/pages/MyStuff.jsx:1315", - "src/community/pages/MyStuff.jsx:1331", - "src/community/pages/Project.jsx:1773", - "src/community/pages/Project.jsx:2772", + "src/community/pages/MyStuff.jsx:1288", + "src/community/pages/MyStuff.jsx:1304", + "src/community/pages/Project.jsx:1757", + "src/community/pages/Project.jsx:2750", "src/community/pages/Settings.jsx:992", "src/community/pages/Settings.jsx:1007", "src/community/pages/Theme.jsx:234" @@ -606,7 +605,7 @@ "src/community/components/ExploreNav.jsx:12", "src/community/components/MyStuffSpaces.jsx:33", "src/community/pages/Group.jsx:166", - "src/community/pages/MyStuff.jsx:502", + "src/community/pages/MyStuff.jsx:488", "src/community/pages/Spaces.jsx:23" ], "Groups": [ @@ -616,14 +615,14 @@ "src/community/components/ExploreNav.jsx:14", "src/community/pages/ManageProject.jsx:944", "src/community/pages/ManageProject.jsx:1058", - "src/community/pages/Project.jsx:1454", - "src/community/pages/Project.jsx:2265" + "src/community/pages/Project.jsx:1439", + "src/community/pages/Project.jsx:2243" ], "Themes": [ "src/community/components/ExploreNav.jsx:15", "src/community/components/Footer.jsx:41", "src/community/components/MyStuffThemes.jsx:217", - "src/community/pages/MyStuff.jsx:504", + "src/community/pages/MyStuff.jsx:490", "src/community/pages/Profile.jsx:547" ], "Explore sections": [ @@ -632,20 +631,20 @@ "by {value1}": [ "src/community/components/FeaturedProject.jsx:62", "src/community/components/RelatedProjects.jsx:100", - "src/community/pages/Project.jsx:1527" + "src/community/pages/Project.jsx:1511" ], "Project page": [ "src/community/components/FeaturedProject.jsx:68", "src/community/pages/ManageProject.jsx:72", "src/community/pages/ManageProject.jsx:625", - "src/community/pages/MyStuff.jsx:1536" + "src/community/pages/MyStuff.jsx:1508" ], "Play {value1}": [ "src/community/components/FeaturedProject.jsx:90" ], "Loading project…": [ "src/community/components/FeaturedProject.jsx:103", - "src/community/pages/Project.jsx:2010" + "src/community/pages/Project.jsx:1988" ], "Play project": [ "src/community/components/FeaturedProject.jsx:103" @@ -691,7 +690,7 @@ "src/community/components/NavBar.jsx:569", "src/community/components/NavBar.jsx:569", "src/community/pages/ManageProject.jsx:486", - "src/community/pages/MyStuff.jsx:1236" + "src/community/pages/MyStuff.jsx:1209" ], "Community": [ "src/community/components/Footer.jsx:37", @@ -759,7 +758,7 @@ "Support": [ "src/community/components/Footer.jsx:76", "src/community/pages/Group.jsx:168", - "src/community/pages/Project.jsx:1543", + "src/community/pages/Project.jsx:1527", "src/community/pages/Support.jsx:101" ], "Trust, privacy, and terms": [ @@ -812,7 +811,7 @@ ], "Processing…": [ "src/community/components/GameMarketplaceModal.jsx:211", - "src/community/pages/Project.jsx:1901" + "src/community/pages/Project.jsx:1885" ], "Already owned": [ "src/community/components/GameMarketplaceModal.jsx:217" @@ -863,7 +862,7 @@ ], "Restoring…": [ "src/community/components/GitGraph.jsx:128", - "src/community/pages/Project.jsx:2433" + "src/community/pages/Project.jsx:2411" ], "Restore this version": [ "src/community/components/GitGraph.jsx:129" @@ -912,7 +911,7 @@ "Could not load your projects.": [ "src/community/components/HomeWorkspace.jsx:72", "src/community/components/SpaceProjectPicker.jsx:80", - "src/community/pages/MyStuff.jsx:1429" + "src/community/pages/MyStuff.jsx:1401" ], "Your first project starts here": [ "src/community/components/HomeWorkspace.jsx:75" @@ -1026,7 +1025,7 @@ "Hearts": [ "src/community/components/MembershipPreviews.jsx:25", "src/community/pages/ManageProject.jsx:534", - "src/community/pages/MyStuff.jsx:146" + "src/community/pages/MyStuff.jsx:145" ], "Buyers": [ "src/community/components/MembershipPreviews.jsx:26", @@ -1042,8 +1041,7 @@ "src/community/components/MembershipPreviews.jsx:31" ], "Last 30 days": [ - "src/community/components/MembershipPreviews.jsx:44", - "src/community/pages/Wallet.jsx:244" + "src/community/components/MembershipPreviews.jsx:44" ], "Export CSV": [ "src/community/components/MembershipPreviews.jsx:45", @@ -1085,11 +1083,11 @@ ], "Restore": [ "src/community/components/MembershipPreviews.jsx:114", - "src/community/pages/MyStuff.jsx:1404" + "src/community/pages/MyStuff.jsx:1376" ], "Not played yet": [ "src/community/components/MyStuffLibrary.jsx:20", - "src/community/pages/Project.jsx:2075" + "src/community/pages/Project.jsx:2053" ], "{duration} played": [ "src/community/components/MyStuffLibrary.jsx:21", @@ -1130,7 +1128,7 @@ ], "Remove from library": [ "src/community/components/MyStuffLibrary.jsx:109", - "src/community/pages/Project.jsx:1568" + "src/community/pages/Project.jsx:1552" ], "Load more games": [ "src/community/components/MyStuffLibrary.jsx:126", @@ -1145,7 +1143,7 @@ ], "Library": [ "src/community/components/MyStuffLibrary.jsx:143", - "src/community/pages/MyStuff.jsx:501" + "src/community/pages/MyStuff.jsx:487" ], "Games you saved, with your playtime and public profile controls.": [ "src/community/components/MyStuffLibrary.jsx:144" @@ -1171,7 +1169,7 @@ "Spaces": [ "src/community/components/MyStuffSpaces.jsx:59", "src/community/components/NavBar.jsx:59", - "src/community/pages/MyStuff.jsx:503" + "src/community/pages/MyStuff.jsx:489" ], "Studios you curate or follow, and challenges you host, join, judge, or follow.": [ "src/community/components/MyStuffSpaces.jsx:60" @@ -1319,7 +1317,7 @@ ], "Beta": [ "src/community/components/NavBar.jsx:407", - "src/community/pages/Project.jsx:2850" + "src/community/pages/Project.jsx:2828" ], "nav.main": [ "src/community/components/NavBar.jsx:411" @@ -1718,7 +1716,7 @@ ], "Branches": [ "src/community/components/ProjectBranches.jsx:232", - "src/community/pages/Project.jsx:2167" + "src/community/pages/Project.jsx:2145" ], "Each branch points to its latest saved project version.": [ "src/community/components/ProjectBranches.jsx:233" @@ -1828,9 +1826,9 @@ ], "Remix": [ "src/community/components/ProjectCard.jsx:87", - "src/community/pages/Project.jsx:1558", - "src/community/pages/Project.jsx:1666", - "src/community/pages/Project.jsx:2272" + "src/community/pages/Project.jsx:1542", + "src/community/pages/Project.jsx:1650", + "src/community/pages/Project.jsx:2250" ], "Touch": [ "src/community/components/ProjectCompatibility.jsx:7" @@ -2135,14 +2133,14 @@ "src/community/components/ReportModal.jsx:103", "src/community/pages/ManageProject.jsx:929", "src/community/pages/Profile.jsx:1097", - "src/community/pages/Project.jsx:1723", + "src/community/pages/Project.jsx:1707", "src/community/pages/Roadmap.jsx:34" ], "Sending…": [ "src/community/components/ReportModal.jsx:110", "src/community/pages/Profile.jsx:1126", - "src/community/pages/Project.jsx:1730", - "src/community/pages/Project.jsx:3093", + "src/community/pages/Project.jsx:1714", + "src/community/pages/Project.jsx:3071", "src/community/pages/Support.jsx:141" ], "Send report": [ @@ -2285,7 +2283,7 @@ ], "Shared with you": [ "src/community/components/SharedProjects.jsx:107", - "src/community/pages/MyStuff.jsx:500" + "src/community/pages/MyStuff.jsx:486" ], "Pick up where your team left off.": [ "src/community/components/SharedProjects.jsx:108" @@ -2359,7 +2357,7 @@ ], "Copy link": [ "src/community/components/SocialPost.jsx:310", - "src/community/pages/Project.jsx:1602" + "src/community/pages/Project.jsx:1586" ], "Edit": [ "src/community/components/SocialPost.jsx:314" @@ -2372,15 +2370,15 @@ "src/community/pages/Admin.jsx:945", "src/community/pages/Admin.jsx:1202", "src/community/pages/Admin.jsx:1989", - "src/community/pages/MyStuff.jsx:1576", - "src/community/pages/Project.jsx:2737", + "src/community/pages/MyStuff.jsx:1548", + "src/community/pages/Project.jsx:2715", "src/community/pages/Theme.jsx:223" ], "Report": [ "src/community/components/SocialPost.jsx:332", "src/community/pages/Bounty.jsx:139", "src/community/pages/Profile.jsx:893", - "src/community/pages/Project.jsx:1694" + "src/community/pages/Project.jsx:1678" ], "Unblocked {value1}.": [ "src/community/components/SocialPost.jsx:341" @@ -2477,7 +2475,7 @@ ], "Load more projects": [ "src/community/components/SpaceProjectPicker.jsx:247", - "src/community/pages/MyStuff.jsx:1591", + "src/community/pages/MyStuff.jsx:1563", "src/community/pages/Profile.jsx:629" ], "Could not load more projects. Try again.": [ @@ -2591,7 +2589,7 @@ "Overview": [ "src/community/pages/Admin.jsx:30", "src/community/pages/Challenge.jsx:338", - "src/community/pages/MyStuff.jsx:498" + "src/community/pages/MyStuff.jsx:484" ], "Storage and runtime": [ "src/community/pages/Admin.jsx:31", @@ -2629,8 +2627,7 @@ "src/community/pages/Admin.jsx:120" ], "Today": [ - "src/community/pages/Admin.jsx:180", - "src/community/pages/Wallet.jsx:240" + "src/community/pages/Admin.jsx:180" ], "Latest": [ "src/community/pages/Admin.jsx:180" @@ -2652,18 +2649,18 @@ "Storage": [ "src/community/pages/Admin.jsx:269", "src/community/pages/Admin.jsx:1171", - "src/community/pages/MyStuff.jsx:248", - "src/community/pages/MyStuff.jsx:506", + "src/community/pages/MyStuff.jsx:234", + "src/community/pages/MyStuff.jsx:492", "src/community/pages/PaidPerks.jsx:222" ], "of {value1} used": [ "src/community/pages/Admin.jsx:272", - "src/community/pages/MyStuff.jsx:251" + "src/community/pages/MyStuff.jsx:237" ], "{value1}% full": [ "src/community/pages/Admin.jsx:280", - "src/community/pages/MyStuff.jsx:260", - "src/community/pages/MyStuff.jsx:363" + "src/community/pages/MyStuff.jsx:246", + "src/community/pages/MyStuff.jsx:349" ], "Working…": [ "src/community/pages/Admin.jsx:294", @@ -2983,8 +2980,8 @@ "Delete project?": [ "src/community/pages/Admin.jsx:868", "src/community/pages/Admin.jsx:1065", - "src/community/pages/MyStuff.jsx:1312", - "src/community/pages/Project.jsx:1770" + "src/community/pages/MyStuff.jsx:1285", + "src/community/pages/Project.jsx:1754" ], "Delete {value1} permanently?": [ "src/community/pages/Admin.jsx:869", @@ -2997,9 +2994,9 @@ "Delete project": [ "src/community/pages/Admin.jsx:870", "src/community/pages/Admin.jsx:1067", - "src/community/pages/MyStuff.jsx:1313", - "src/community/pages/Project.jsx:1707", - "src/community/pages/Project.jsx:1771" + "src/community/pages/MyStuff.jsx:1286", + "src/community/pages/Project.jsx:1691", + "src/community/pages/Project.jsx:1755" ], "Project deleted.": [ "src/community/pages/Admin.jsx:887", @@ -3015,7 +3012,7 @@ "src/community/pages/Admin.jsx:943", "src/community/pages/Admin.jsx:1200", "src/community/pages/Admin.jsx:2343", - "src/community/pages/MyStuff.jsx:1503" + "src/community/pages/MyStuff.jsx:1475" ], "No projects found": [ "src/community/pages/Admin.jsx:951", @@ -3541,8 +3538,8 @@ "src/community/pages/Bounty.jsx:141", "src/community/pages/Challenge.jsx:380", "src/community/pages/Collection.jsx:75", - "src/community/pages/MyStuff.jsx:1501", - "src/community/pages/MyStuff.jsx:1508", + "src/community/pages/MyStuff.jsx:1473", + "src/community/pages/MyStuff.jsx:1480", "src/community/pages/Studio.jsx:119", "src/community/pages/Theme.jsx:221" ], @@ -3846,7 +3843,7 @@ ], "Finding project…": [ "src/community/pages/Commit.jsx:262", - "src/community/pages/Project.jsx:1442", + "src/community/pages/Project.jsx:1427", "src/community/pages/PullRequest.jsx:462", "src/community/pages/PullRequests.jsx:58", "src/community/pages/RemixTree.jsx:193" @@ -3934,7 +3931,7 @@ ], "Could not load more projects.": [ "src/community/pages/Explore.jsx:167", - "src/community/pages/MyStuff.jsx:1595", + "src/community/pages/MyStuff.jsx:1567", "src/community/pages/Profile.jsx:633", "src/community/pages/Search.jsx:111" ], @@ -4003,8 +4000,8 @@ ], "No projects yet": [ "src/community/pages/Group.jsx:204", - "src/community/pages/MyStuff.jsx:196", - "src/community/pages/MyStuff.jsx:1601", + "src/community/pages/MyStuff.jsx:195", + "src/community/pages/MyStuff.jsx:1573", "src/community/pages/Space.jsx:253", "src/community/pages/Studio.jsx:142" ], @@ -4067,8 +4064,7 @@ "src/community/pages/Group.jsx:241" ], "credits": [ - "src/community/pages/Group.jsx:242", - "src/community/pages/Wallet.jsx:181" + "src/community/pages/Group.jsx:242" ], "Request to join": [ "src/community/pages/Group.jsx:245" @@ -4145,7 +4141,7 @@ ], "Explore projects": [ "src/community/pages/Home.jsx:113", - "src/community/pages/Wallet.jsx:361" + "src/community/pages/Purchases.jsx:117" ], "Find a project you like and follow its creator.": [ "src/community/pages/Home.jsx:113" @@ -4349,7 +4345,7 @@ ], "Credits earned": [ "src/community/pages/ManageProject.jsx:560", - "src/community/pages/MyStuff.jsx:227" + "src/community/pages/MyStuff.jsx:216" ], "Credits per buyer": [ "src/community/pages/ManageProject.jsx:571" @@ -4368,7 +4364,7 @@ ], "Views over the last 2 weeks": [ "src/community/pages/ManageProject.jsx:589", - "src/community/pages/MyStuff.jsx:155" + "src/community/pages/MyStuff.jsx:154" ], "Publish checklist": [ "src/community/pages/ManageProject.jsx:595" @@ -4446,7 +4442,7 @@ "Visibility": [ "src/community/pages/ManageProject.jsx:686", "src/community/pages/ManageSpace.jsx:639", - "src/community/pages/Project.jsx:1834", + "src/community/pages/Project.jsx:1818", "src/community/pages/Spaces.jsx:263" ], "This remix includes a project offered for purchase, so it stays private. You can support the original creator by sending your changes from the Contribute tab.": [ @@ -4464,7 +4460,7 @@ "Turn off comments": [ "src/community/pages/ManageProject.jsx:700", "src/community/pages/Profile.jsx:744", - "src/community/pages/Project.jsx:2152" + "src/community/pages/Project.jsx:2130" ], "Save publishing settings": [ "src/community/pages/ManageProject.jsx:705" @@ -4742,7 +4738,7 @@ ], "Uploading…": [ "src/community/pages/ManageSpace.jsx:629", - "src/community/pages/MyStuff.jsx:1249" + "src/community/pages/MyStuff.jsx:1222" ], "Choose image": [ "src/community/pages/ManageSpace.jsx:629" @@ -4870,7 +4866,7 @@ ], "Publishing…": [ "src/community/pages/ManageSpace.jsx:702", - "src/community/pages/Project.jsx:2860", + "src/community/pages/Project.jsx:2838", "src/community/pages/Themes.jsx:216" ], "Publish results": [ @@ -4915,262 +4911,256 @@ "src/community/pages/ManageSpace.jsx:749" ], "Performance": [ - "src/community/pages/MyStuff.jsx:121", + "src/community/pages/MyStuff.jsx:120", "src/community/pages/News.jsx:324" ], "{value1}{value2}% vs prior week": [ - "src/community/pages/MyStuff.jsx:127" + "src/community/pages/MyStuff.jsx:126" ], "New this week": [ - "src/community/pages/MyStuff.jsx:128" + "src/community/pages/MyStuff.jsx:127" ], "Views this week": [ - "src/community/pages/MyStuff.jsx:136" + "src/community/pages/MyStuff.jsx:135" ], "Total views": [ - "src/community/pages/MyStuff.jsx:141" + "src/community/pages/MyStuff.jsx:140" ], "Recent projects": [ - "src/community/pages/MyStuff.jsx:160" + "src/community/pages/MyStuff.jsx:159" ], "{value1} total, {value2} shared": [ - "src/community/pages/MyStuff.jsx:164" + "src/community/pages/MyStuff.jsx:163" ], "Could not load recent projects.": [ - "src/community/pages/MyStuff.jsx:169" + "src/community/pages/MyStuff.jsx:168" ], "Loading projects…": [ - "src/community/pages/MyStuff.jsx:171" + "src/community/pages/MyStuff.jsx:170" ], "{value1} · {value2} views · {value3} hearts": [ - "src/community/pages/MyStuff.jsx:186" + "src/community/pages/MyStuff.jsx:185" ], "Start a new project": [ - "src/community/pages/MyStuff.jsx:199" + "src/community/pages/MyStuff.jsx:198" ], "You have not created any projects yet.": [ - "src/community/pages/MyStuff.jsx:202", - "src/community/pages/MyStuff.jsx:1607" + "src/community/pages/MyStuff.jsx:201", + "src/community/pages/MyStuff.jsx:1579" ], "View all projects": [ - "src/community/pages/MyStuff.jsx:207" - ], - "Wallet": [ - "src/community/pages/MyStuff.jsx:213", - "src/community/pages/Wallet.jsx:171" - ], - "Balance": [ - "src/community/pages/MyStuff.jsx:220" - ], - "Open wallet": [ - "src/community/pages/MyStuff.jsx:221", - "src/community/pages/Profile.jsx:1119", - "src/community/pages/Project.jsx:1897" + "src/community/pages/MyStuff.jsx:206" ], - "Donations received": [ - "src/community/pages/MyStuff.jsx:233" + "Earnings": [ + "src/community/pages/MyStuff.jsx:212" ], "No earnings yet": [ - "src/community/pages/MyStuff.jsx:240" + "src/community/pages/MyStuff.jsx:221" ], "Offer a project for purchase so people can support your work.": [ - "src/community/pages/MyStuff.jsx:241" + "src/community/pages/MyStuff.jsx:222" + ], + "Purchases": [ + "src/community/pages/MyStuff.jsx:227", + "src/community/pages/Purchases.jsx:58" + ], + "Balance on Rotur": [ + "src/community/pages/MyStuff.jsx:229" ], "Manage storage": [ - "src/community/pages/MyStuff.jsx:263" + "src/community/pages/MyStuff.jsx:249" ], "Inventory": [ - "src/community/pages/MyStuff.jsx:277", - "src/community/pages/MyStuff.jsx:505" + "src/community/pages/MyStuff.jsx:263", + "src/community/pages/MyStuff.jsx:491" ], "Items collected across MistWarp games.": [ - "src/community/pages/MyStuff.jsx:278" + "src/community/pages/MyStuff.jsx:264" ], "1 item type": [ - "src/community/pages/MyStuff.jsx:281" + "src/community/pages/MyStuff.jsx:267" ], "{value1} item types": [ - "src/community/pages/MyStuff.jsx:281" + "src/community/pages/MyStuff.jsx:267" ], "Could not load your inventory.": [ - "src/community/pages/MyStuff.jsx:286" + "src/community/pages/MyStuff.jsx:272" ], "Loading inventory…": [ - "src/community/pages/MyStuff.jsx:288" + "src/community/pages/MyStuff.jsx:274" ], "{value1}, from {value2}, quantity {value3}": [ - "src/community/pages/MyStuff.jsx:296" + "src/community/pages/MyStuff.jsx:282" ], "From {value1}": [ - "src/community/pages/MyStuff.jsx:306", - "src/community/pages/Wallet.jsx:262" + "src/community/pages/MyStuff.jsx:292" ], "Your inventory is empty": [ - "src/community/pages/MyStuff.jsx:312" + "src/community/pages/MyStuff.jsx:298" ], "Items you collect in MistWarp games will appear here.": [ - "src/community/pages/MyStuff.jsx:313" + "src/community/pages/MyStuff.jsx:299" ], "Could not load storage usage.": [ - "src/community/pages/MyStuff.jsx:323" + "src/community/pages/MyStuff.jsx:309" ], "Loading storage usage…": [ - "src/community/pages/MyStuff.jsx:326" + "src/community/pages/MyStuff.jsx:312" ], "Used": [ - "src/community/pages/MyStuff.jsx:334" + "src/community/pages/MyStuff.jsx:320" ], "Limit": [ - "src/community/pages/MyStuff.jsx:335" + "src/community/pages/MyStuff.jsx:321" ], "Remaining": [ - "src/community/pages/MyStuff.jsx:336" + "src/community/pages/MyStuff.jsx:322" ], "Waiting for a save": [ - "src/community/pages/MyStuff.jsx:337" + "src/community/pages/MyStuff.jsx:323" ], "Your Rotur {value1} membership includes {value2} of storage, {value3} of assets per project, and {value4} per asset.": [ - "src/community/pages/MyStuff.jsx:344" + "src/community/pages/MyStuff.jsx:330" ], "Full": [ - "src/community/pages/MyStuff.jsx:364" + "src/community/pages/MyStuff.jsx:350" ], "Nearly full": [ - "src/community/pages/MyStuff.jsx:364" + "src/community/pages/MyStuff.jsx:350" ], "Largest projects": [ - "src/community/pages/MyStuff.jsx:376" + "src/community/pages/MyStuff.jsx:362" ], "Each project counts its assets, project data and version history, including projects in the trash. When your storage is full you can still save a project at the same size or smaller. To free space, delete projects you no longer need and empty them from the trash.": [ - "src/community/pages/MyStuff.jsx:378" + "src/community/pages/MyStuff.jsx:364" ], "Untitled": [ - "src/community/pages/MyStuff.jsx:385", - "src/community/pages/MyStuff.jsx:387" + "src/community/pages/MyStuff.jsx:371", + "src/community/pages/MyStuff.jsx:373" ], "{value1}, in the trash": [ - "src/community/pages/MyStuff.jsx:391" + "src/community/pages/MyStuff.jsx:377" ], "Your projects are not using any storage yet.": [ - "src/community/pages/MyStuff.jsx:398" + "src/community/pages/MyStuff.jsx:384" ], "Could not load the agreement.": [ - "src/community/pages/MyStuff.jsx:448" + "src/community/pages/MyStuff.jsx:434" ], "Loading agreement…": [ - "src/community/pages/MyStuff.jsx:454" + "src/community/pages/MyStuff.jsx:440" ], "No agreement yet": [ - "src/community/pages/MyStuff.jsx:459" + "src/community/pages/MyStuff.jsx:445" ], "No agreement has been set yet.": [ - "src/community/pages/MyStuff.jsx:460" + "src/community/pages/MyStuff.jsx:446" ], "You have accepted version {value1} (updated {value2}).": [ - "src/community/pages/MyStuff.jsx:475" + "src/community/pages/MyStuff.jsx:461" ], "To continue using the platform, please accept this agreement.": [ - "src/community/pages/MyStuff.jsx:479" + "src/community/pages/MyStuff.jsx:465" ], "Accepting…": [ - "src/community/pages/MyStuff.jsx:486", - "src/community/pages/MyStuff.jsx:1294" + "src/community/pages/MyStuff.jsx:472", + "src/community/pages/MyStuff.jsx:1267" ], "Accept v{value1}": [ - "src/community/pages/MyStuff.jsx:488" + "src/community/pages/MyStuff.jsx:474" ], "My Projects": [ - "src/community/pages/MyStuff.jsx:499" + "src/community/pages/MyStuff.jsx:485" ], "Trash": [ - "src/community/pages/MyStuff.jsx:507" + "src/community/pages/MyStuff.jsx:493" ], "Agreement": [ - "src/community/pages/MyStuff.jsx:508" + "src/community/pages/MyStuff.jsx:494" ], "Sign in to see your projects.": [ - "src/community/pages/MyStuff.jsx:1228" + "src/community/pages/MyStuff.jsx:1201" ], "Upload .sb3": [ - "src/community/pages/MyStuff.jsx:1252" + "src/community/pages/MyStuff.jsx:1225" ], "New project": [ - "src/community/pages/MyStuff.jsx:1254", - "src/community/pages/MyStuff.jsx:1604" + "src/community/pages/MyStuff.jsx:1227", + "src/community/pages/MyStuff.jsx:1576" ], "Your storage is full: your projects use {value1} of your {value2}. You can still save a project at the same size or smaller. To add more, delete projects you no longer need and empty them from the trash.": [ - "src/community/pages/MyStuff.jsx:1266" + "src/community/pages/MyStuff.jsx:1239" ], "Your projects use {value1} of your {value2} of storage ({value3}%).": [ - "src/community/pages/MyStuff.jsx:1270" + "src/community/pages/MyStuff.jsx:1243" ], "Upload agreement v{value1}": [ - "src/community/pages/MyStuff.jsx:1281" + "src/community/pages/MyStuff.jsx:1254" ], "Accept v{value1} & upload": [ - "src/community/pages/MyStuff.jsx:1296" + "src/community/pages/MyStuff.jsx:1269" ], "You must accept this agreement before you can upload projects.": [ - "src/community/pages/MyStuff.jsx:1305" + "src/community/pages/MyStuff.jsx:1278" ], "{value1} will move to Trash. You can restore it until its recovery period ends.": [ - "src/community/pages/MyStuff.jsx:1320" + "src/community/pages/MyStuff.jsx:1293" ], "Could not load your overview.": [ - "src/community/pages/MyStuff.jsx:1358" + "src/community/pages/MyStuff.jsx:1330" ], "Could not load Trash.": [ - "src/community/pages/MyStuff.jsx:1394" + "src/community/pages/MyStuff.jsx:1366" ], "Loading Trash…": [ - "src/community/pages/MyStuff.jsx:1395" + "src/community/pages/MyStuff.jsx:1367" ], "Deletes forever {value1}": [ - "src/community/pages/MyStuff.jsx:1401" + "src/community/pages/MyStuff.jsx:1373" ], "Delete forever": [ - "src/community/pages/MyStuff.jsx:1412" + "src/community/pages/MyStuff.jsx:1384" ], "No deleted projects": [ - "src/community/pages/MyStuff.jsx:1416" + "src/community/pages/MyStuff.jsx:1388" ], "Trash is empty. Projects you delete stay here until their recovery period ends.": [ - "src/community/pages/MyStuff.jsx:1417" + "src/community/pages/MyStuff.jsx:1389" ], "{value1} earned": [ - "src/community/pages/MyStuff.jsx:1480" + "src/community/pages/MyStuff.jsx:1452" ], "Remixes of projects offered for purchase stay private. Contribute your changes back to the original creator.": [ - "src/community/pages/MyStuff.jsx:1495" + "src/community/pages/MyStuff.jsx:1467" ], "Contribution only": [ - "src/community/pages/MyStuff.jsx:1496" + "src/community/pages/MyStuff.jsx:1468" ], "Share": [ - "src/community/pages/MyStuff.jsx:1510" + "src/community/pages/MyStuff.jsx:1482" ], "Actions for {value1}": [ - "src/community/pages/MyStuff.jsx:1518" + "src/community/pages/MyStuff.jsx:1490" ], "Open in editor": [ - "src/community/pages/MyStuff.jsx:1534", - "src/community/pages/Project.jsx:1981" + "src/community/pages/MyStuff.jsx:1506", + "src/community/pages/Project.jsx:1959" ], "Manage & analytics": [ - "src/community/pages/MyStuff.jsx:1539", - "src/community/pages/Project.jsx:1655" + "src/community/pages/MyStuff.jsx:1511", + "src/community/pages/Project.jsx:1639" ], "Save to collection": [ - "src/community/pages/MyStuff.jsx:1547", - "src/community/pages/Project.jsx:1625" + "src/community/pages/MyStuff.jsx:1519", + "src/community/pages/Project.jsx:1609" ], "Remove profile feature": [ - "src/community/pages/MyStuff.jsx:1562", - "src/community/pages/Project.jsx:1682" + "src/community/pages/MyStuff.jsx:1534", + "src/community/pages/Project.jsx:1666" ], "Feature on profile": [ - "src/community/pages/MyStuff.jsx:1562", - "src/community/pages/Project.jsx:1682" + "src/community/pages/MyStuff.jsx:1534", + "src/community/pages/Project.jsx:1666" ], "Add at least two poll options.": [ "src/community/pages/News.jsx:115" @@ -5471,8 +5461,8 @@ ], "Browse projects": [ "src/community/pages/Profile.jsx:469", - "src/community/pages/Project.jsx:1419", - "src/community/pages/Project.jsx:1431" + "src/community/pages/Project.jsx:1404", + "src/community/pages/Project.jsx:1416" ], "This user does not exist on Rotur.": [ "src/community/pages/Profile.jsx:470" @@ -5521,18 +5511,18 @@ ], "Loading reviews…": [ "src/community/pages/Profile.jsx:659", - "src/community/pages/Project.jsx:2743" + "src/community/pages/Project.jsx:2721" ], "No reviews yet": [ "src/community/pages/Profile.jsx:661", - "src/community/pages/Project.jsx:2746" + "src/community/pages/Project.jsx:2724" ], "Reviews this user writes on projects will appear here.": [ "src/community/pages/Profile.jsx:662" ], "{value1} out of 5 stars": [ "src/community/pages/Profile.jsx:679", - "src/community/pages/Project.jsx:2573" + "src/community/pages/Project.jsx:2551" ], "No written review.": [ "src/community/pages/Profile.jsx:692" @@ -5542,7 +5532,7 @@ ], "Comments": [ "src/community/pages/Profile.jsx:735", - "src/community/pages/Project.jsx:1450", + "src/community/pages/Project.jsx:1435", "src/community/pages/Space.jsx:259", "src/community/pages/Studio.jsx:85", "src/community/pages/Studio.jsx:150" @@ -5555,7 +5545,7 @@ ], "Turn on comments": [ "src/community/pages/Profile.jsx:744", - "src/community/pages/Project.jsx:2152" + "src/community/pages/Project.jsx:2130" ], "Published themes": [ "src/community/pages/Profile.jsx:778" @@ -5667,533 +5657,533 @@ "Amount in credits": [ "src/community/pages/Profile.jsx:1109" ], - "Not enough credits in your balance. Claim your daily credits in your wallet, then send again.": [ + "Not enough credits in your balance. Claim your daily credits on Rotur, then send again.": [ "src/community/pages/Profile.jsx:1118" ], + "Open Rotur": [ + "src/community/pages/Profile.jsx:1119", + "src/community/pages/Purchases.jsx:78" + ], "Send credits": [ "src/community/pages/Profile.jsx:1129" ], - "You do not have enough credits. Claim your daily credits in your wallet, then try again.": [ - "src/community/pages/Project.jsx:1163", - "src/community/pages/Project.jsx:1201", - "src/community/pages/Project.jsx:1912" + "You do not have enough credits. Claim your daily credits on Rotur, then try again.": [ + "src/community/pages/Project.jsx:1148", + "src/community/pages/Project.jsx:1186" ], "Project not found": [ - "src/community/pages/Project.jsx:1418", - "src/community/pages/Project.jsx:1430" + "src/community/pages/Project.jsx:1403", + "src/community/pages/Project.jsx:1415" ], "This project link does not exist.": [ - "src/community/pages/Project.jsx:1420" + "src/community/pages/Project.jsx:1405" ], "This project may have been deleted or unshared.": [ - "src/community/pages/Project.jsx:1432" + "src/community/pages/Project.jsx:1417" ], "Could not load this project.": [ - "src/community/pages/Project.jsx:1434" + "src/community/pages/Project.jsx:1419" ], "Files": [ - "src/community/pages/Project.jsx:1451" + "src/community/pages/Project.jsx:1436" ], "Reviews": [ - "src/community/pages/Project.jsx:1452" + "src/community/pages/Project.jsx:1437" ], "Version control": [ - "src/community/pages/Project.jsx:1453" + "src/community/pages/Project.jsx:1438" ], "Contribute": [ - "src/community/pages/Project.jsx:1455" + "src/community/pages/Project.jsx:1440" ], "Project title": [ - "src/community/pages/Project.jsx:1515" + "src/community/pages/Project.jsx:1499" ], "for @": [ - "src/community/pages/Project.jsx:1529" + "src/community/pages/Project.jsx:1513" ], "Sign in to remix": [ - "src/community/pages/Project.jsx:1556" + "src/community/pages/Project.jsx:1540" ], "Save to library": [ - "src/community/pages/Project.jsx:1568" + "src/community/pages/Project.jsx:1552" ], "See inside": [ - "src/community/pages/Project.jsx:1577" + "src/community/pages/Project.jsx:1561" ], "More actions": [ - "src/community/pages/Project.jsx:1584" + "src/community/pages/Project.jsx:1568" ], "Copy embed code": [ - "src/community/pages/Project.jsx:1615" + "src/community/pages/Project.jsx:1599" ], "Use stage as thumbnail": [ - "src/community/pages/Project.jsx:1637" + "src/community/pages/Project.jsx:1621" ], "Upload thumbnail": [ - "src/community/pages/Project.jsx:1648" + "src/community/pages/Project.jsx:1632" ], "Support {value1}": [ - "src/community/pages/Project.jsx:1719" + "src/community/pages/Project.jsx:1703" ], "Send {value1} credits": [ - "src/community/pages/Project.jsx:1733" + "src/community/pages/Project.jsx:1717" ], "{value1} credits sent to {value2}.": [ - "src/community/pages/Project.jsx:1739" + "src/community/pages/Project.jsx:1723" ], "This project stays free. Your credits go to its creator.": [ - "src/community/pages/Project.jsx:1743" + "src/community/pages/Project.jsx:1727" ], "Custom support amount": [ - "src/community/pages/Project.jsx:1754" + "src/community/pages/Project.jsx:1738" ], "{value1} will be deleted permanently. This cannot be undone.": [ - "src/community/pages/Project.jsx:1777" + "src/community/pages/Project.jsx:1761" ], "Run custom extensions without the sandbox?": [ - "src/community/pages/Project.jsx:1783" + "src/community/pages/Project.jsx:1767" ], "Keep sandbox": [ - "src/community/pages/Project.jsx:1784" + "src/community/pages/Project.jsx:1768" ], "Run anyway": [ - "src/community/pages/Project.jsx:1785" + "src/community/pages/Project.jsx:1769" ], "This gives the project full access to your MistWarp account. It could read your login session, act as you, or change your data. Continue only if you trust the creator.": [ - "src/community/pages/Project.jsx:1788" + "src/community/pages/Project.jsx:1772" ], "Set up your fork": [ - "src/community/pages/Project.jsx:1794" + "src/community/pages/Project.jsx:1778" ], "MistWarp will create a private working copy. Edit and save it, then open its project page and send your changes back.": [ - "src/community/pages/Project.jsx:1802" + "src/community/pages/Project.jsx:1786" ], "Working on a bounty": [ - "src/community/pages/Project.jsx:1804" + "src/community/pages/Project.jsx:1788" ], "{value1} credits, paid if the project owner merges your pull request.": [ - "src/community/pages/Project.jsx:1806" + "src/community/pages/Project.jsx:1790" ], "Project name": [ - "src/community/pages/Project.jsx:1810" + "src/community/pages/Project.jsx:1794" ], "Working branch": [ - "src/community/pages/Project.jsx:1821" + "src/community/pages/Project.jsx:1805" ], "Forked from": [ - "src/community/pages/Project.jsx:1832" + "src/community/pages/Project.jsx:1816" ], "Base commit": [ - "src/community/pages/Project.jsx:1833" + "src/community/pages/Project.jsx:1817" ], "Current version": [ - "src/community/pages/Project.jsx:1833" + "src/community/pages/Project.jsx:1817" ], "Private draft": [ - "src/community/pages/Project.jsx:1834" + "src/community/pages/Project.jsx:1818" ], "Creating fork…": [ - "src/community/pages/Project.jsx:1848" + "src/community/pages/Project.jsx:1832" ], "Create fork": [ - "src/community/pages/Project.jsx:1850" + "src/community/pages/Project.jsx:1834" ], "Confirm purchase": [ - "src/community/pages/Project.jsx:1893" + "src/community/pages/Project.jsx:1877" ], "Pay {value1} credits": [ - "src/community/pages/Project.jsx:1897" + "src/community/pages/Project.jsx:1881" ], "Buy {value1} for a one-time payment of {value2} credits and support its creator?": [ - "src/community/pages/Project.jsx:1906" - ], - "Your balance: {value1} credits": [ - "src/community/pages/Project.jsx:1909" + "src/community/pages/Project.jsx:1890" ], "Copied to clipboard.": [ - "src/community/pages/Project.jsx:1920" + "src/community/pages/Project.jsx:1898" ], "Saving thumbnail…": [ - "src/community/pages/Project.jsx:1923" + "src/community/pages/Project.jsx:1901" ], "Thumbnail updated.": [ - "src/community/pages/Project.jsx:1923" + "src/community/pages/Project.jsx:1901" ], "Unlisted. Hidden from search and profiles, but anyone with the link can open it.": [ - "src/community/pages/Project.jsx:1929" + "src/community/pages/Project.jsx:1907" ], "This remix of a project offered for purchase stays private. You can contribute your changes back to the original creator.": [ - "src/community/pages/Project.jsx:1935" + "src/community/pages/Project.jsx:1913" ], "Unshared. Only you can see this project.": [ - "src/community/pages/Project.jsx:1936" + "src/community/pages/Project.jsx:1914" ], "Available for a one-time purchase of {value1} credits.": [ - "src/community/pages/Project.jsx:1942" + "src/community/pages/Project.jsx:1920" ], "Thanks for supporting this creator. You have access to play this project.": [ - "src/community/pages/Project.jsx:1944" + "src/community/pages/Project.jsx:1922" ], "Support this creator with a one-time purchase of {value1} credits to play.": [ - "src/community/pages/Project.jsx:1945" + "src/community/pages/Project.jsx:1923" ], "Use my theme": [ - "src/community/pages/Project.jsx:1960" + "src/community/pages/Project.jsx:1938" ], "Preferences": [ - "src/community/pages/Project.jsx:1961" + "src/community/pages/Project.jsx:1939" ], "This project applied its own theme.": [ - "src/community/pages/Project.jsx:1964" + "src/community/pages/Project.jsx:1942" ], "Nothing here yet": [ - "src/community/pages/Project.jsx:1978" + "src/community/pages/Project.jsx:1956" ], "No content yet. Open it in the editor and save to upload.": [ - "src/community/pages/Project.jsx:1985" + "src/community/pages/Project.jsx:1963" ], "This project has not been uploaded yet.": [ - "src/community/pages/Project.jsx:1986" + "src/community/pages/Project.jsx:1964" ], "Support this creator": [ - "src/community/pages/Project.jsx:1993" + "src/community/pages/Project.jsx:1971" ], "Buy for {value1} credits": [ - "src/community/pages/Project.jsx:1996" + "src/community/pages/Project.jsx:1974" ], "Your purchase supports the creator and gives you access to play {value1}. Pay once, with no recurring charge.": [ - "src/community/pages/Project.jsx:1999" + "src/community/pages/Project.jsx:1977" ], "Sign in to purchase and support this creator.": [ - "src/community/pages/Project.jsx:2000" + "src/community/pages/Project.jsx:1978" ], "Project unavailable": [ - "src/community/pages/Project.jsx:2005" + "src/community/pages/Project.jsx:1983" ], "The project file could not be loaded. The creator may need to save it again.": [ - "src/community/pages/Project.jsx:2006" + "src/community/pages/Project.jsx:1984" ], "Back to sandbox": [ - "src/community/pages/Project.jsx:2035" + "src/community/pages/Project.jsx:2013" ], "Run without sandbox": [ - "src/community/pages/Project.jsx:2037" + "src/community/pages/Project.jsx:2015" ], "Running with full access to your account. Only for projects you trust.": [ - "src/community/pages/Project.jsx:2041" + "src/community/pages/Project.jsx:2019" ], "Uses custom extensions, running in a sandbox. Saved data can persist to browser storage.": [ - "src/community/pages/Project.jsx:2042" + "src/community/pages/Project.jsx:2020" ], "Remove from your library": [ - "src/community/pages/Project.jsx:2058" + "src/community/pages/Project.jsx:2036" ], "Save to your library": [ - "src/community/pages/Project.jsx:2058" + "src/community/pages/Project.jsx:2036" ], "Sign in to save to your library": [ - "src/community/pages/Project.jsx:2059" + "src/community/pages/Project.jsx:2037" ], "{value1} library, {value2} saves": [ - "src/community/pages/Project.jsx:2060" + "src/community/pages/Project.jsx:2038" ], "Your playtime on this project": [ - "src/community/pages/Project.jsx:2072" + "src/community/pages/Project.jsx:2050" ], "{value1} played": [ - "src/community/pages/Project.jsx:2075" + "src/community/pages/Project.jsx:2053" ], "{value1} blocks": [ - "src/community/pages/Project.jsx:2097" + "src/community/pages/Project.jsx:2075" ], "History": [ - "src/community/pages/Project.jsx:2166" + "src/community/pages/Project.jsx:2144" ], "Pull requests": [ - "src/community/pages/Project.jsx:2168", + "src/community/pages/Project.jsx:2146", "src/community/pages/PullRequests.jsx:70", "src/community/pages/Roadmap.jsx:134" ], "Releases": [ - "src/community/pages/Project.jsx:2169" + "src/community/pages/Project.jsx:2147" ], "Bounties on the parent project": [ - "src/community/pages/Project.jsx:2265" + "src/community/pages/Project.jsx:2243" ], "New bounty": [ - "src/community/pages/Project.jsx:2269" + "src/community/pages/Project.jsx:2247" ], "Open parent": [ - "src/community/pages/Project.jsx:2287" + "src/community/pages/Project.jsx:2265" ], "Use this bounty": [ - "src/community/pages/Project.jsx:2294" + "src/community/pages/Project.jsx:2272" ], "Work on this": [ - "src/community/pages/Project.jsx:2294" + "src/community/pages/Project.jsx:2272" ], "No open bounties": [ - "src/community/pages/Project.jsx:2302" + "src/community/pages/Project.jsx:2280" ], "Fund a specific change when you want contributors to pick it up.": [ - "src/community/pages/Project.jsx:2304" + "src/community/pages/Project.jsx:2282" ], "There are no funded tasks right now. You can still fork the project and send an improvement.": [ - "src/community/pages/Project.jsx:2305" + "src/community/pages/Project.jsx:2283" ], "Could not load remixes.": [ - "src/community/pages/Project.jsx:2332" + "src/community/pages/Project.jsx:2310" ], "Remix tree": [ - "src/community/pages/Project.jsx:2341" + "src/community/pages/Project.jsx:2319" ], "{value1} projects branch from the same original.": [ - "src/community/pages/Project.jsx:2342" + "src/community/pages/Project.jsx:2320" ], "See this project alongside its Git history.": [ - "src/community/pages/Project.jsx:2342" + "src/community/pages/Project.jsx:2320" ], "Explore tree": [ - "src/community/pages/Project.jsx:2344" + "src/community/pages/Project.jsx:2322" ], "Could not load version history.": [ - "src/community/pages/Project.jsx:2406" + "src/community/pages/Project.jsx:2384" ], "No version history yet": [ - "src/community/pages/Project.jsx:2411" + "src/community/pages/Project.jsx:2389" ], "Saved versions of this project will appear here.": [ - "src/community/pages/Project.jsx:2412" + "src/community/pages/Project.jsx:2390" ], "Restore this version?": [ - "src/community/pages/Project.jsx:2430" + "src/community/pages/Project.jsx:2408" ], "Restore version": [ - "src/community/pages/Project.jsx:2431" + "src/community/pages/Project.jsx:2409" ], "{value1} will become the current project. Newer versions will stay in the history.": [ - "src/community/pages/Project.jsx:2438" + "src/community/pages/Project.jsx:2416" ], "Saved version": [ - "src/community/pages/Project.jsx:2439" + "src/community/pages/Project.jsx:2417" ], "Loading pull requests…": [ - "src/community/pages/Project.jsx:2488", + "src/community/pages/Project.jsx:2466", "src/community/pages/PullRequests.jsx:61" ], "Could not load pull requests.": [ - "src/community/pages/Project.jsx:2489", + "src/community/pages/Project.jsx:2467", "src/community/pages/PullRequests.jsx:38" ], "Search pull requests": [ - "src/community/pages/Project.jsx:2500", + "src/community/pages/Project.jsx:2478", "src/community/pages/PullRequests.jsx:73", "src/community/pages/Roadmap.jsx:524" ], "New pull request": [ - "src/community/pages/Project.jsx:2501", + "src/community/pages/Project.jsx:2479", "src/community/pages/PullRequests.jsx:71" ], "{value1} open": [ - "src/community/pages/Project.jsx:2505" + "src/community/pages/Project.jsx:2483" ], "{value1} closed": [ - "src/community/pages/Project.jsx:2506" + "src/community/pages/Project.jsx:2484" ], "#{value1} opened {value2} by": [ - "src/community/pages/Project.jsx:2513" + "src/community/pages/Project.jsx:2491" ], "No open pull requests": [ - "src/community/pages/Project.jsx:2522" + "src/community/pages/Project.jsx:2500" ], "No closed pull requests": [ - "src/community/pages/Project.jsx:2522" + "src/community/pages/Project.jsx:2500" ], "No pull requests match your search.": [ - "src/community/pages/Project.jsx:2524" + "src/community/pages/Project.jsx:2502" ], "Pull requests sent to this project will appear here.": [ - "src/community/pages/Project.jsx:2524" + "src/community/pages/Project.jsx:2502" ], "Open pull requests from this project": [ - "src/community/pages/Project.jsx:2559" + "src/community/pages/Project.jsx:2537" ], "into {value1}": [ - "src/community/pages/Project.jsx:2562" + "src/community/pages/Project.jsx:2540" ], "{value1} stars": [ - "src/community/pages/Project.jsx:2577" + "src/community/pages/Project.jsx:2555" ], "Choose a star rating first.": [ - "src/community/pages/Project.jsx:2639" + "src/community/pages/Project.jsx:2617" ], "Review saved.": [ - "src/community/pages/Project.jsx:2659" + "src/community/pages/Project.jsx:2637" ], "Could not save your review.": [ - "src/community/pages/Project.jsx:2662" + "src/community/pages/Project.jsx:2640" ], "Review deleted.": [ - "src/community/pages/Project.jsx:2689" + "src/community/pages/Project.jsx:2667" ], "Could not delete your review.": [ - "src/community/pages/Project.jsx:2693" + "src/community/pages/Project.jsx:2671" ], "review": [ - "src/community/pages/Project.jsx:2707" + "src/community/pages/Project.jsx:2685" ], "reviews": [ - "src/community/pages/Project.jsx:2707" + "src/community/pages/Project.jsx:2685" ], "Your review": [ - "src/community/pages/Project.jsx:2713" + "src/community/pages/Project.jsx:2691" ], "Review this project": [ - "src/community/pages/Project.jsx:2713" + "src/community/pages/Project.jsx:2691" ], "What worked well? What should change?": [ - "src/community/pages/Project.jsx:2716" + "src/community/pages/Project.jsx:2694" ], "Save review": [ - "src/community/pages/Project.jsx:2726" + "src/community/pages/Project.jsx:2704" ], "Sign in to review": [ - "src/community/pages/Project.jsx:2726" + "src/community/pages/Project.jsx:2704" ], "You cannot review your own project.": [ - "src/community/pages/Project.jsx:2742" + "src/community/pages/Project.jsx:2720" ], "Could not load reviews.": [ - "src/community/pages/Project.jsx:2744" + "src/community/pages/Project.jsx:2722" ], "Reviews from players will appear here.": [ - "src/community/pages/Project.jsx:2747" + "src/community/pages/Project.jsx:2725" ], "Delete your review?": [ - "src/community/pages/Project.jsx:2769" + "src/community/pages/Project.jsx:2747" ], "Delete review": [ - "src/community/pages/Project.jsx:2770" + "src/community/pages/Project.jsx:2748" ], "Your rating and review text will be removed.": [ - "src/community/pages/Project.jsx:2776" + "src/community/pages/Project.jsx:2754" ], "Enter a version before publishing.": [ - "src/community/pages/Project.jsx:2819" + "src/community/pages/Project.jsx:2797" ], "Could not create the release.": [ - "src/community/pages/Project.jsx:2832" + "src/community/pages/Project.jsx:2810" ], "Publish a release": [ - "src/community/pages/Project.jsx:2844" + "src/community/pages/Project.jsx:2822" ], "Version, such as 1.2.0": [ - "src/community/pages/Project.jsx:2846" + "src/community/pages/Project.jsx:2824" ], "Stable": [ - "src/community/pages/Project.jsx:2849" + "src/community/pages/Project.jsx:2827" ], "Development": [ - "src/community/pages/Project.jsx:2851" + "src/community/pages/Project.jsx:2829" ], "Release channel": [ - "src/community/pages/Project.jsx:2856" + "src/community/pages/Project.jsx:2834" ], "What changed?": [ - "src/community/pages/Project.jsx:2859" + "src/community/pages/Project.jsx:2837" ], "Publish release": [ - "src/community/pages/Project.jsx:2861" + "src/community/pages/Project.jsx:2839" ], "Loading releases…": [ - "src/community/pages/Project.jsx:2865" + "src/community/pages/Project.jsx:2843" ], "Could not load releases.": [ - "src/community/pages/Project.jsx:2866" + "src/community/pages/Project.jsx:2844" ], "No releases yet": [ - "src/community/pages/Project.jsx:2868" + "src/community/pages/Project.jsx:2846" ], "Published releases will appear here.": [ - "src/community/pages/Project.jsx:2869" + "src/community/pages/Project.jsx:2847" ], "Play this release": [ - "src/community/pages/Project.jsx:2884" + "src/community/pages/Project.jsx:2862" ], "Add a fork project ID and title before sending.": [ - "src/community/pages/Project.jsx:2985" + "src/community/pages/Project.jsx:2963" ], "Could not send the contribution.": [ - "src/community/pages/Project.jsx:3002" + "src/community/pages/Project.jsx:2980" ], "Send changes back": [ - "src/community/pages/Project.jsx:3012" + "src/community/pages/Project.jsx:2990" ], "This creates a pull request for the parent project. The owner can review your changes before merging them.": [ - "src/community/pages/Project.jsx:3015" + "src/community/pages/Project.jsx:2993" ], "Choose one of your remixes, then describe the changes you want the project owner to review.": [ - "src/community/pages/Project.jsx:3016" + "src/community/pages/Project.jsx:2994" ], "Loading your remixes…": [ - "src/community/pages/Project.jsx:3020" + "src/community/pages/Project.jsx:2998" ], "Could not load your remixes.": [ - "src/community/pages/Project.jsx:3023" + "src/community/pages/Project.jsx:3001" ], "Remix to contribute": [ - "src/community/pages/Project.jsx:3028", - "src/community/pages/Project.jsx:3037" + "src/community/pages/Project.jsx:3006", + "src/community/pages/Project.jsx:3015" ], "No remix yet": [ - "src/community/pages/Project.jsx:3046" + "src/community/pages/Project.jsx:3024" ], "Create a remix": [ - "src/community/pages/Project.jsx:3049" + "src/community/pages/Project.jsx:3027" ], "You do not have a remix of this project yet.": [ - "src/community/pages/Project.jsx:3051" + "src/community/pages/Project.jsx:3029" ], "Sign in to choose one of your remixes.": [ - "src/community/pages/Project.jsx:3054" + "src/community/pages/Project.jsx:3032" ], "Pull request #{value1} is open for this remix": [ - "src/community/pages/Project.jsx:3061" + "src/community/pages/Project.jsx:3039" ], "Remix the project": [ - "src/community/pages/Project.jsx:3067" + "src/community/pages/Project.jsx:3045" ], "Edit and save your remix": [ - "src/community/pages/Project.jsx:3068" + "src/community/pages/Project.jsx:3046" ], "Describe your work and send it": [ - "src/community/pages/Project.jsx:3069" + "src/community/pages/Project.jsx:3047" ], "What did you change?": [ - "src/community/pages/Project.jsx:3071" + "src/community/pages/Project.jsx:3049" ], "Anything the creator should know": [ - "src/community/pages/Project.jsx:3072" + "src/community/pages/Project.jsx:3050" ], "Bounty to claim": [ - "src/community/pages/Project.jsx:3075", - "src/community/pages/Project.jsx:3087" + "src/community/pages/Project.jsx:3053", + "src/community/pages/Project.jsx:3065" ], "Optional": [ - "src/community/pages/Project.jsx:3075" + "src/community/pages/Project.jsx:3053" ], "No bounty": [ - "src/community/pages/Project.jsx:3078" + "src/community/pages/Project.jsx:3056" ], "{value1} credits: {value2}": [ - "src/community/pages/Project.jsx:3081" + "src/community/pages/Project.jsx:3059" ], "The reward is paid when the project owner merges this pull request.": [ - "src/community/pages/Project.jsx:3090" + "src/community/pages/Project.jsx:3068" ], "Create pull request": [ - "src/community/pages/Project.jsx:3095" + "src/community/pages/Project.jsx:3073" ], "Sign in to contribute": [ - "src/community/pages/Project.jsx:3095" + "src/community/pages/Project.jsx:3073" ], "Pull request": [ "src/community/pages/PullRequest.jsx:474" @@ -6314,6 +6304,27 @@ "Pull requests will show up here once someone contributes.": [ "src/community/pages/PullRequests.jsx:91" ], + "Could not load purchase history.": [ + "src/community/pages/Purchases.jsx:39" + ], + "Sign in to see your purchases.": [ + "src/community/pages/Purchases.jsx:51" + ], + "Your credits are on Rotur": [ + "src/community/pages/Purchases.jsx:63" + ], + "See your balance, claim daily credits and check your transactions on rotur.dev.": [ + "src/community/pages/Purchases.jsx:66" + ], + "Purchase history": [ + "src/community/pages/Purchases.jsx:82" + ], + "No purchases yet": [ + "src/community/pages/Purchases.jsx:116" + ], + "You have not bought any projects yet.": [ + "src/community/pages/Purchases.jsx:119" + ], "Finding a random project…": [ "src/community/pages/Random.jsx:41" ], @@ -7437,98 +7448,5 @@ ], "Games ranked by total playtime.": [ "src/community/pages/UserLibrary.jsx:84" - ], - "Could not load your wallet data.": [ - "src/community/pages/Wallet.jsx:74" - ], - "Could not load purchase history.": [ - "src/community/pages/Wallet.jsx:93" - ], - "Could not load creator earnings.": [ - "src/community/pages/Wallet.jsx:116" - ], - "Sign in to view your wallet.": [ - "src/community/pages/Wallet.jsx:128" - ], - "Daily credits claimed.": [ - "src/community/pages/Wallet.jsx:145" - ], - "Already claimed. Come back in {value1}h.": [ - "src/community/pages/Wallet.jsx:154" - ], - "Your current login cannot claim daily credits. Log out and back in, then try again.": [ - "src/community/pages/Wallet.jsx:157" - ], - "Your balance": [ - "src/community/pages/Wallet.jsx:176" - ], - "Could not load your balance right now": [ - "src/community/pages/Wallet.jsx:185" - ], - "Claiming…": [ - "src/community/pages/Wallet.jsx:196" - ], - "Claim daily": [ - "src/community/pages/Wallet.jsx:198" - ], - "{value1} received in donations": [ - "src/community/pages/Wallet.jsx:212" - ], - "{value1} given in donations": [ - "src/community/pages/Wallet.jsx:222" - ], - "Creator earnings": [ - "src/community/pages/Wallet.jsx:232" - ], - "Tips, project sales, revenue shares, and bounties paid to you.": [ - "src/community/pages/Wallet.jsx:234" - ], - "Recorded total": [ - "src/community/pages/Wallet.jsx:248" - ], - "No creator earnings yet": [ - "src/community/pages/Wallet.jsx:270" - ], - "Loading creator earnings…": [ - "src/community/pages/Wallet.jsx:276" - ], - "Donation history": [ - "src/community/pages/Wallet.jsx:280" - ], - "Credits you have sent or received through MistWarp profiles.": [ - "src/community/pages/Wallet.jsx:282" - ], - "Received": [ - "src/community/pages/Wallet.jsx:295" - ], - "Sent": [ - "src/community/pages/Wallet.jsx:295" - ], - "From": [ - "src/community/pages/Wallet.jsx:298" - ], - "To": [ - "src/community/pages/Wallet.jsx:298" - ], - "Donation history unavailable": [ - "src/community/pages/Wallet.jsx:315" - ], - "Try loading your wallet data again above.": [ - "src/community/pages/Wallet.jsx:316" - ], - "No profile donations yet": [ - "src/community/pages/Wallet.jsx:319" - ], - "Loading donation history…": [ - "src/community/pages/Wallet.jsx:321" - ], - "Purchase history": [ - "src/community/pages/Wallet.jsx:326" - ], - "No purchases yet": [ - "src/community/pages/Wallet.jsx:360" - ], - "You have not bought any projects yet.": [ - "src/community/pages/Wallet.jsx:363" ] } diff --git a/src/community/translations/en.json b/src/community/translations/en.json index 95b4f25b0d2..187cacc1cd7 100644 --- a/src/community/translations/en.json +++ b/src/community/translations/en.json @@ -837,8 +837,6 @@ "You have not created any projects yet.": "You have not created any projects yet.", "Start a new project": "Start a new project", "View all projects": "View all projects", - "Wallet": "Wallet", - "Balance": "Balance", "Opening…": "Opening…", "Buy credits": "Buy credits", "No earnings yet. Share a paid project to earn credits.": "No earnings yet. Share a paid project to earn credits.", @@ -1340,23 +1338,10 @@ ". Include the affected Rotur username and explain what you want reviewed.": ". Include the affected Rotur username and explain what you want reviewed.", "Your game library": "Your game library", "Games ranked by total playtime.": "Games ranked by total playtime.", - "Your balance": "Your balance", - "Could not load your balance right now": "Could not load your balance right now", - "Claiming…": "Claiming…", - "Claim daily": "Claim daily", - "Creator earnings": "Creator earnings", - "Tips, project sales, revenue shares, and bounties paid to you.": "Tips, project sales, revenue shares, and bounties paid to you.", "Last 30 days": "Last 30 days", - "Recorded total": "Recorded total", "No creator earnings yet.": "No creator earnings yet.", - "Loading creator earnings…": "Loading creator earnings…", - "Donation history": "Donation history", - "Credits you have sent or received through MistWarp profiles.": "Credits you have sent or received through MistWarp profiles.", - "Received": "Received", - "Sent": "Sent", "Donation history is unavailable. Try loading your wallet data again above.": "Donation history is unavailable. Try loading your wallet data again above.", "No profile donations yet.": "No profile donations yet.", - "Loading donation history…": "Loading donation history…", "Top up through Stripe. Credits are added to your Rotur account after checkout.": "Top up through Stripe. Credits are added to your Rotur account after checkout.", "Payment successful. Credits will appear in your balance shortly.": "Payment successful. Credits will appear in your balance shortly.", "Checkout cancelled.": "Checkout cancelled.", @@ -1488,7 +1473,6 @@ "{value1} credits sent to {value2}.": "{value1} credits sent to {value2}.", "Pay {value1} credits": "Pay {value1} credits", "Buy {value1} for {value2} credits?": "Buy {value1} for {value2} credits?", - "Your balance: {value1} credits": "Your balance: {value1} credits", "Paywalled at {value1} credits.": "Paywalled at {value1} credits.", "{value1} credits to play this project.": "{value1} credits to play this project.", "Buy for {value1} credits": "Buy for {value1} credits", @@ -1508,8 +1492,6 @@ "{value1} theme preview": "{value1} theme preview", "\"{value1}\" will be removed from WarpTheme. This cannot be undone.": "\"{value1}\" will be removed from WarpTheme. This cannot be undone.", "{value1}'s game library": "{value1}'s game library", - "{value1} received in donations": "{value1} received in donations", - "{value1} given in donations": "{value1} given in donations", "From {value1}": "From {value1}", "Suggestion": "Suggestion", "Question": "Question", @@ -2107,7 +2089,6 @@ "Results are live": "Results are live", "{value1} total, {value2} shared": "{value1} total, {value2} shared", "{value1} · {value2} views · {value3} hearts": "{value1} · {value2} views · {value3} hearts", - "Donations received": "Donations received", "No earnings yet": "No earnings yet", "Share a paid project to earn credits.": "Share a paid project to earn credits.", "1 item type": "1 item type", @@ -2321,20 +2302,8 @@ "If you think an account action was wrong, send a moderation appeal through support. Include the affected Rotur username and explain what you want reviewed.": "If you think an account action was wrong, send a moderation appeal through support. Include the affected Rotur username and explain what you want reviewed.", "Send a moderation appeal": "Send a moderation appeal", "Back to profile": "Back to profile", - "Could not load your wallet data.": "Could not load your wallet data.", "Could not load purchase history.": "Could not load purchase history.", - "Could not load creator earnings.": "Could not load creator earnings.", - "Sign in to view your wallet.": "Sign in to view your wallet.", - "Daily credits claimed.": "Daily credits claimed.", - "Already claimed. Come back in {value1}h.": "Already claimed. Come back in {value1}h.", - "Your current login cannot claim daily credits. Log out and back in, then try again.": "Your current login cannot claim daily credits. Log out and back in, then try again.", "Your current login cannot buy credits. Log out and back in, then try again.": "Your current login cannot buy credits. Log out and back in, then try again.", - "No creator earnings yet": "No creator earnings yet", - "From": "From", - "To": "To", - "Donation history unavailable": "Donation history unavailable", - "Try loading your wallet data again above.": "Try loading your wallet data again above.", - "No profile donations yet": "No profile donations yet", "No purchases yet": "No purchases yet", "Banned from MistWarp by site admins.": "Banned from MistWarp by site admins.", "Memberships": "Memberships", @@ -2466,9 +2435,6 @@ "Allow comments on your profile": "Allow comments on your profile", "Let other users post on your profile wall.": "Let other users post on your profile wall.", "Anonymous analytics stay off for accounts under 18.": "Anonymous analytics stay off for accounts under 18.", - "Open wallet": "Open wallet", - "Not enough credits in your balance. Claim your daily credits in your wallet, then send again.": "Not enough credits in your balance. Claim your daily credits in your wallet, then send again.", - "You do not have enough credits. Claim your daily credits in your wallet, then try again.": "You do not have enough credits. Claim your daily credits in your wallet, then try again.", "Filter by category": "Filter by category", "Sort projects": "Sort projects", "Rotur has a new way to sign in. Reconnect once to stay signed in to MistWarp.": "Rotur has a new way to sign in. Reconnect once to stay signed in to MistWarp.", @@ -2486,5 +2452,14 @@ "Encouraging suicide or self-harm": "Encouraging suicide or self-harm", "Terrorism": "Terrorism", "Urgent": "Urgent", - "Rotur's safety team sees this report straight away. If someone is in danger right now, contact your local emergency services.": "Rotur's safety team sees this report straight away. If someone is in danger right now, contact your local emergency services." + "Rotur's safety team sees this report straight away. If someone is in danger right now, contact your local emergency services.": "Rotur's safety team sees this report straight away. If someone is in danger right now, contact your local emergency services.", + "Earnings": "Earnings", + "Purchases": "Purchases", + "Balance on Rotur": "Balance on Rotur", + "Not enough credits in your balance. Claim your daily credits on Rotur, then send again.": "Not enough credits in your balance. Claim your daily credits on Rotur, then send again.", + "Open Rotur": "Open Rotur", + "You do not have enough credits. Claim your daily credits on Rotur, then try again.": "You do not have enough credits. Claim your daily credits on Rotur, then try again.", + "Sign in to see your purchases.": "Sign in to see your purchases.", + "Your credits are on Rotur": "Your credits are on Rotur", + "See your balance, claim daily credits and check your transactions on rotur.dev.": "See your balance, claim daily credits and check your transactions on rotur.dev." } diff --git a/src/components/menu-bar/mw-rotur-account.jsx b/src/components/menu-bar/mw-rotur-account.jsx index d8574b0d2d0..c44f4b189d8 100644 --- a/src/components/menu-bar/mw-rotur-account.jsx +++ b/src/components/menu-bar/mw-rotur-account.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import {connect} from 'react-redux'; import {FormattedMessage} from 'react-intl'; -import {LogOut, Settings, ShieldCheck, Trophy, User, UserCog, Users, Wallet} from 'lucide-react'; +import {LogOut, Settings, ShieldCheck, ShoppingBag, Trophy, User, UserCog, Users} from 'lucide-react'; import MenuLabel from './tw-menu-label.jsx'; import MenuBarMenu from './menu-bar-menu.jsx'; @@ -142,12 +142,12 @@ const RoturAccount = props => { id="mw.rotur.accountMenu.leaderboard" /> - - + + {props.isAdmin ? ( diff --git a/src/lib/rotur/client.js b/src/lib/rotur/client.js index 332cb275b2e..ab9c96d6f88 100644 --- a/src/lib/rotur/client.js +++ b/src/lib/rotur/client.js @@ -21,8 +21,6 @@ const SIGN_IN_SCOPES = [ 'account:view', // Your Rotur ID, and the badge editor on your profile. 'account:profile', // Reorder or hide badges, and show what you're editing. 'signing:keys', // Register this device's public key to sign chat messages. - 'credits:view', // Wallet balance, donation history, earnings, bounties. - 'credits:daily', // The daily credits button in the wallet. 'notifications:view', // Notifications, live and on the notifications page. 'posts:view', // Posts from people you follow, on Home. 'posts:create', // The composer on your profile's Posts tab. @@ -735,77 +733,6 @@ const isPaymentPermissionError = error => { message.includes('token'); }; -// Read the current Rotur credit balance, or null if the token can't see it. -const getBalance = async () => { - const rotur = getClient(); - if (!rotur.loggedIn) { - return null; - } - try { - const me = await rotur.me.get(); - return me && typeof me['sys.currency'] === 'number' ? me['sys.currency'] : null; - } catch (_) { - return null; - } -}; - -export const donationTransactions = transactions => { - if (!Array.isArray(transactions)) return []; - return transactions.reduce((donations, transaction, index) => { - const note = String((transaction && transaction.note) || ''); - if (!note.toLowerCase().includes('donation')) return donations; - const direction = transaction.type === 'in' ? 'received' : - transaction.type === 'out' ? 'given' : null; - const amount = Math.round((Number(transaction.amount) || 0) * 100) / 100; - if (!direction || amount <= 0) return donations; - const rawTime = Number(transaction.time || transaction.timestamp || 0); - const time = rawTime > 0 && rawTime < 10000000000 ? rawTime * 1000 : rawTime; - donations.push({ - id: String(transaction.id || `${direction}-${rawTime}-${index}`), - direction, - amount, - user: String(transaction.user || transaction.from || transaction.to || ''), - note, - time: Number.isFinite(time) ? time : 0 - }); - return donations; - }, []).sort((left, right) => right.time - left.time); -}; - -// Read balance plus donation totals and history from the account's transactions. -// Returns null if the token can't see credits. Fields default to 0/null. -const getAccountSummary = async () => { - const rotur = getClient(); - if (!rotur.loggedIn) { - return null; - } - try { - const me = await rotur.me.get(); - if (!me || me.error) { - return null; - } - const balance = typeof me['sys.currency'] === 'number' ? me['sys.currency'] : null; - const txns = me['sys.transactions'] || me.transactions || []; - const donations = donationTransactions(txns); - let donationsReceived = 0; - let donationsGiven = 0; - for (const donation of donations) { - if (donation.direction === 'received') donationsReceived += donation.amount; - else donationsGiven += donation.amount; - } - const round = value => Math.round(value * 100) / 100; - return { - balance, - donationsReceived: round(donationsReceived), - donationsGiven: round(donationsGiven), - donations, - hasTransactions: Array.isArray(txns) - }; - } catch (_) { - return null; - } -}; - // Transfer credits to another Rotur user. Throws an Error; if the failure is a // missing-permission on the current (sub-)token, the error carries needsReauth. const payUser = async (to, amount, note) => { @@ -826,30 +753,6 @@ const payUser = async (to, amount, note) => { return result; }; -// Claim the account's daily credits. Throws on failure; the error carries -// needsReauth when the token lacks the credits:daily permission, and waitHours -// when the daily claim is not yet available. -const claimDaily = async () => { - const rotur = getClient(); - if (!rotur.loggedIn) { - const error = new Error('Log in to claim daily credits'); - error.needsReauth = true; - throw error; - } - const result = await rotur.me.claimDaily(); - if (result && result.error) { - const error = new Error(result.error); - if (isPaymentPermissionError(result.error)) { - error.needsReauth = true; - } - if (result.wait_hours) { - error.waitHours = result.wait_hours; - } - throw error; - } - return result; -}; - const onSessionChange = oauth.onSessionChange; export { @@ -869,10 +772,7 @@ export { presenceSupported, getRotur, fetchCurrentUser, - getBalance, - getAccountSummary, payUser, - claimDaily, ensureScopes, getAccessToken, needsReconnect, diff --git a/src/lib/rotur/project-methods.js b/src/lib/rotur/project-methods.js index 7b7c70d8bf5..215a96923a2 100644 --- a/src/lib/rotur/project-methods.js +++ b/src/lib/rotur/project-methods.js @@ -15,7 +15,7 @@ const text = value => String(typeof value === 'undefined' || value === null ? '' const PROJECT_METHODS = Object.freeze({ 'me.abilities': {scopes: []}, 'me.checkAuth': {scopes: []}, - 'me.get': {scopes: ['account:view', 'credits:view']}, + 'me.get': {scopes: ['account:view']}, 'me.badges': {scopes: ['account:view']}, 'me.subscription': {scopes: ['account:view']}, 'me.blocked': {scopes: ['blocked:view']}, diff --git a/src/lib/tw-translations/default-messages.json b/src/lib/tw-translations/default-messages.json index 65c0f8f580b..a6ca0fd35ae 100644 --- a/src/lib/tw-translations/default-messages.json +++ b/src/lib/tw-translations/default-messages.json @@ -279,7 +279,7 @@ "mw.rotur.menuBar.login": "Sign in", "gui.accountMenu.profile": "Profile", "mw.rotur.accountMenu.leaderboard": "Leaderboard", - "mw.rotur.accountMenu.wallet": "Wallet", + "mw.rotur.accountMenu.purchases": "Purchases", "mw.rotur.accountMenu.settings": "Settings", "mw.rotur.accountMenu.accountSettings": "Account settings", "mw.rotur.accountMenu.switchAccount": "Switch account", diff --git a/test/unit/community-my-stuff-loading.test.jsx b/test/unit/community-my-stuff-loading.test.jsx index 50eea68cec1..b226e0ead95 100644 --- a/test/unit/community-my-stuff-loading.test.jsx +++ b/test/unit/community-my-stuff-loading.test.jsx @@ -35,9 +35,6 @@ jest.mock('../../src/community/api.js', () => ({ return `/projects/${project.id}`; }) })); -jest.mock('../../src/lib/rotur/client.js', () => ({ - getAccountSummary: jest.fn(() => Promise.resolve(null)) -})); const stats = { totalViews: 0, diff --git a/test/unit/community-project-loading.test.jsx b/test/unit/community-project-loading.test.jsx index a2a4c56a32c..3b21aaa5120 100644 --- a/test/unit/community-project-loading.test.jsx +++ b/test/unit/community-project-loading.test.jsx @@ -24,9 +24,6 @@ jest.mock('../../src/lib/themes/custom-themes.js', () => ({ jest.mock('../../src/community/rotur.js', () => ({ following: jest.fn() })); -jest.mock('../../src/lib/rotur/client.js', () => ({ - getBalance: jest.fn(() => Promise.resolve(0)) -})); jest.mock('../../src/lib/community/cached-fetch.js', () => ({ cachedFetchBuffer: jest.fn(() => Promise.resolve(new ArrayBuffer(0))), preloadContent: jest.fn(() => Promise.resolve()) diff --git a/test/unit/community-project-rotur-bridge.test.jsx b/test/unit/community-project-rotur-bridge.test.jsx index 1015fe3fca9..666a508738f 100644 --- a/test/unit/community-project-rotur-bridge.test.jsx +++ b/test/unit/community-project-rotur-bridge.test.jsx @@ -38,7 +38,6 @@ jest.mock('../../src/community/rotur.js', () => ({ following: jest.fn() })); jest.mock('../../src/lib/rotur/client.js', () => ({ - getBalance: jest.fn(() => Promise.resolve(0)), getRotur: () => mockClient, ensureScopes: jest.fn(() => Promise.resolve(true)) })); diff --git a/test/unit/community-purchases.test.jsx b/test/unit/community-purchases.test.jsx new file mode 100644 index 00000000000..a75abaa9692 --- /dev/null +++ b/test/unit/community-purchases.test.jsx @@ -0,0 +1,58 @@ +import React from 'react'; +import {act} from 'react-dom/test-utils'; +import {mount} from 'enzyme'; +import {MemoryRouter} from 'react-router-dom'; + +import api from '../../src/community/api'; +import Purchases from '../../src/community/pages/Purchases.jsx'; + +jest.mock('../../src/community/UserContext.jsx', () => { + const state = {user: {username: 'buyer'}, loading: false}; + return {useUser: () => state}; +}); +jest.mock('../../src/community/api', () => ({ + __esModule: true, + default: {purchases: jest.fn()}, + projectUrl: id => `/project/${id}` +})); +jest.mock('../../src/lib/rotur/client.js', () => { + throw new Error('Purchases must not need the Rotur client'); +}); + +const render = async () => { + const wrapper = mount( + + + + ); + await act(async () => { + await Promise.resolve(); + await Promise.resolve(); + }); + wrapper.update(); + return wrapper; +}; + +describe('Purchases', () => { + test('lists what you bought from MistWarp\'s own records, and sends you to Rotur for your credits', async () => { + api.purchases.mockResolvedValue({purchases: [{projectId: 'p1', title: 'Starfall', amount: 10, at: 1700000000000}]}); + const wrapper = await render(); + const text = wrapper.text(); + expect(text).toContain('Starfall'); + expect(text).toContain('Your credits are on Rotur'); + expect(text).not.toContain('Claim daily'); + expect(text).not.toContain('Your balance'); + const rotur = wrapper.find('a[href="https://rotur.dev/me"]'); + expect(rotur.exists()).toBe(true); + expect(rotur.prop('target')).toBe('_blank'); + expect(api.purchases).toHaveBeenCalledTimes(1); + wrapper.unmount(); + }); + + test('says so when you haven\'t bought anything', async () => { + api.purchases.mockResolvedValue({purchases: []}); + const wrapper = await render(); + expect(wrapper.text()).toContain('No purchases yet'); + wrapper.unmount(); + }); +}); diff --git a/test/unit/community-wallet.test.jsx b/test/unit/community-wallet.test.jsx deleted file mode 100644 index 659dfeb593d..00000000000 --- a/test/unit/community-wallet.test.jsx +++ /dev/null @@ -1,141 +0,0 @@ -import React from 'react'; -import {act} from 'react-dom/test-utils'; -import {mount} from 'enzyme'; -import {MemoryRouter} from 'react-router-dom'; - -import {getCommerceEarnings} from '../../src/community/credits.js'; -import {getAccountSummary} from '../../src/lib/rotur/client.js'; -import api from '../../src/community/api'; -import Wallet from '../../src/community/pages/Wallet.jsx'; - -jest.mock('../../src/community/UserContext.jsx', () => { - const state = {user: {username: 'wallet-user'}, loading: false}; - return {useUser: () => state}; -}); -jest.mock('../../src/community/api', () => ({ - __esModule: true, - default: {purchases: jest.fn().mockResolvedValue({purchases: []})}, - projectUrl: id => `/project/${id}` -})); -jest.mock('../../src/lib/rotur/client.js', () => ({ - claimDaily: jest.fn(), - getAccountSummary: jest.fn().mockResolvedValue({ - balance: 10, - donationsReceived: 0, - donationsGiven: 0, - donations: [] - }) -})); -jest.mock('../../src/community/credits.js', () => ({ - getCommerceEarnings: jest.fn().mockResolvedValue({ - totals: {today: 0, last_30_days: 0, lifetime: 0}, - history: [] - }) -})); - -describe('Wallet', () => { - beforeEach(() => { - jest.clearAllMocks(); - getAccountSummary.mockResolvedValue({ - balance: 10, - donationsReceived: 0, - donationsGiven: 0, - donations: [] - }); - api.purchases.mockResolvedValue({purchases: []}); - getCommerceEarnings.mockResolvedValue({ - totals: {today: 0, last_30_days: 0, lifetime: 0}, - history: [] - }); - }); - - test('does not sell credits', async () => { - const wrapper = mount( - - - - ); - await act(async () => { - await Promise.resolve(); - await Promise.resolve(); - }); - wrapper.update(); - - expect(wrapper.text()).toContain('Claim daily'); - expect(wrapper.text()).not.toContain('Buy credits'); - expect(wrapper.text()).not.toContain('Stripe'); - wrapper.unmount(); - }); - - test('renders a donation with a malformed timestamp', async () => { - getAccountSummary.mockResolvedValue({ - balance: 10, - donationsReceived: 1, - donationsGiven: 0, - donations: [{id: 'donation-1', direction: 'received', user: 'Alex', amount: 1, time: 'invalid'}] - }); - const wrapper = mount( - - - - ); - await act(async () => { - await Promise.resolve(); - await Promise.resolve(); - }); - wrapper.update(); - - expect(wrapper.text()).toContain('From Alex'); - expect(wrapper.find('time')).toHaveLength(0); - wrapper.unmount(); - }); - - test('retries wallet data without claiming the failed load was an empty donation history', async () => { - getAccountSummary - .mockRejectedValueOnce(new Error('offline')) - .mockResolvedValueOnce({balance: 12, donationsReceived: 0, donationsGiven: 0, donations: []}); - const wrapper = mount( - - - - ); - await act(async () => { - await Promise.resolve(); - await Promise.resolve(); - }); - wrapper.update(); - - expect(wrapper.text()).toContain('Donation history unavailable'); - expect(wrapper.text()).not.toContain('No profile donations yet.'); - - await act(async () => { - wrapper.find('button').filterWhere(button => button.text() === 'Try again').first().simulate('click'); - await Promise.resolve(); - }); - wrapper.update(); - expect(wrapper.text()).toContain('12credits'); - wrapper.unmount(); - }); - - test('retries purchase history without reloading wallet data', async () => { - api.purchases.mockRejectedValueOnce(new Error('offline')).mockResolvedValueOnce({purchases: []}); - const wrapper = mount( - - - - ); - await act(async () => { - await Promise.resolve(); - await Promise.resolve(); - }); - wrapper.update(); - - await act(async () => { - wrapper.find('button').filterWhere(button => button.text() === 'Try again').simulate('click'); - await Promise.resolve(); - }); - expect(api.purchases).toHaveBeenCalledTimes(2); - expect(getAccountSummary).toHaveBeenCalledTimes(1); - wrapper.unmount(); - }); -}); diff --git a/test/unit/rotur-donations.test.js b/test/unit/rotur-donations.test.js deleted file mode 100644 index a83d3097512..00000000000 --- a/test/unit/rotur-donations.test.js +++ /dev/null @@ -1,36 +0,0 @@ -import {donationTransactions} from '../../src/lib/rotur/client.js'; - -describe('Rotur donation transactions', () => { - test('normalizes and sorts sent and received donations', () => { - expect(donationTransactions([ - {id: 'sent', type: 'out', user: 'alex', amount: 2.345, note: 'MistWarp donation to alex', time: 100}, - {id: 'received', type: 'in', user: 'sam', amount: 5, note: 'MistWarp donation to me', time: 200}, - {id: 'purchase', type: 'out', user: 'shop', amount: 3, note: 'Project purchase', time: 300} - ])).toEqual([ - { - id: 'received', - direction: 'received', - amount: 5, - user: 'sam', - note: 'MistWarp donation to me', - time: 200000 - }, - { - id: 'sent', - direction: 'given', - amount: 2.35, - user: 'alex', - note: 'MistWarp donation to alex', - time: 100000 - } - ]); - }); - - test('ignores malformed donation transactions', () => { - expect(donationTransactions(null)).toEqual([]); - expect(donationTransactions([ - {type: 'other', amount: 2, note: 'donation'}, - {type: 'in', amount: 0, note: 'donation'} - ])).toEqual([]); - }); -}); diff --git a/test/unit/rotur-extension-host.test.js b/test/unit/rotur-extension-host.test.js index ad8640cf48e..5ba4bec0844 100644 --- a/test/unit/rotur-extension-host.test.js +++ b/test/unit/rotur-extension-host.test.js @@ -68,12 +68,12 @@ test('authenticated reads expand scopes without prompting', async () => { }); host.acquireModalLock = jest.fn(); - await expect(host.ensureConsent(['credits:view'], { + await expect(host.ensureConsent(['account:view'], { name: 'Project', authenticatedOnly: true })).resolves.toBe(true); - expect(commitGrant).toHaveBeenCalledWith({name: ''}, ['credits:view']); + expect(commitGrant).toHaveBeenCalledWith({name: ''}, ['account:view']); expect(host.acquireModalLock).not.toHaveBeenCalled(); }); diff --git a/test/unit/rotur-project-methods.test.js b/test/unit/rotur-project-methods.test.js index 17670f32f59..649974ebd67 100644 --- a/test/unit/rotur-project-methods.test.js +++ b/test/unit/rotur-project-methods.test.js @@ -116,7 +116,8 @@ test('a scoped method needs a grant for one of its scopes', () => { expect(() => authorizeProjectCall('posts.create', ['hi'], [], 'p')).toThrow('not granted'); expect(() => authorizeProjectCall('posts.create', ['hi'], ['posts:like'], 'p')).toThrow('not granted'); expect(authorizeProjectCall('posts.create', ['hi'], ['posts:create'], 'p').args).toEqual(['hi']); - expect(authorizeProjectCall('me.get', [], ['credits:view'], 'p').confirm).toBeNull(); + expect(authorizeProjectCall('me.get', [], ['account:view'], 'p').confirm).toBeNull(); + expect(() => authorizeProjectCall('me.get', [], ['credits:view'], 'p')).toThrow('not granted'); expect(authorizeProjectCall('profiles.get', ['someone'], [], 'p').args).toEqual(['someone']); }); @@ -140,9 +141,9 @@ test('project storage always uses the host project id', () => { }); test('projects may only ask for scopes their blocks can use', () => { - expect(validateProjectScopes(['posts:create', 'posts:create', 'credits:view'])) - .toEqual(['posts:create', 'credits:view']); - for (const scope of ['tokens:manage', 'account:delete', 'signing:private', 'account:settings', + expect(validateProjectScopes(['posts:create', 'posts:create', 'account:view'])) + .toEqual(['posts:create', 'account:view']); + for (const scope of ['credits:view', 'credits:daily', 'tokens:manage', 'account:delete', 'signing:private', 'account:settings', 'validators:generate', 'full', 'constructor', 7]) { expect(validateProjectScopes(['posts:create', scope])).toBeNull(); } @@ -150,12 +151,12 @@ test('projects may only ask for scopes their blocks can use', () => { }); test('only read scopes and per-call-confirmed scopes are granted without asking', () => { - expect(grantsSilently(['credits:view', 'account:view'])).toBe(true); + expect(grantsSilently(['account:view'])).toBe(true); expect(grantsSilently(['gifts:claim'])).toBe(true); expect(grantsSilently(['posts:delete'])).toBe(true); expect(grantsSilently(['posts:create'])).toBe(false); expect(grantsSilently(['keys:manage'])).toBe(false); - expect(grantsSilently(['credits:view', 'storage:manage'])).toBe(false); + expect(grantsSilently(['account:view', 'storage:manage'])).toBe(false); }); describe('project files stay in MistWarp\'s own Origin FS folder', () => { From e4521f4e2e82cf9e7d90fd61be8ecddf8e07af58 Mon Sep 17 00:00:00 2001 From: Mistium <92952823+Mistium@users.noreply.github.com> Date: Fri, 2 Oct 2026 19:12:49 +0100 Subject: [PATCH 5/5] Give /purchases its own noindex page meta, and drop a dead scope default Every commerce request names the permission it needs, so the credits:view default is never used. --- functions/_middleware.js | 5 +++++ src/community/credits.js | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/functions/_middleware.js b/functions/_middleware.js index 4b62b70231e..c6aa29373c7 100644 --- a/functions/_middleware.js +++ b/functions/_middleware.js @@ -97,6 +97,11 @@ const STATIC_META = { description: 'Your MistWarp credits and purchases.', noindex: true }, + '/purchases': { + title: 'Purchases - MistWarp', + description: 'What you have bought on MistWarp.', + noindex: true + }, '/notifications': { title: 'Notifications - MistWarp', description: 'Your MistWarp notifications.', diff --git a/src/community/credits.js b/src/community/credits.js index e6fc1625ebd..5a078b1baf6 100644 --- a/src/community/credits.js +++ b/src/community/credits.js @@ -51,8 +51,9 @@ const randomIdempotencyKey = prefix => { }; const commerceRequest = async (path, init = {}) => { - const scope = init.scope || ['credits:view']; - // Spending is asked for when someone pays, from their click. + // Every call says which permission it needs. Spending is asked for when + // someone pays, from their click. + const {scope} = init; await ensureScopes(scope, {prompt: scope.some(name => !name.endsWith(':view'))}); const next = {...init}; delete next.scope;