Pre-seed: notice says payouts were switched on for you (not 'someone was about to buy'); seedAll skips members already on-chain and reports them
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -143,8 +143,10 @@ async function ensureOnChain(acct, depth) {
|
||||
await tx.wait(1);
|
||||
const id = await X.chain.memberIdByAccount(acct.address);
|
||||
logEvent({ type: 'activated', email: acct.email, id, sponsorId, tx: tx.hash });
|
||||
await tell(acct.email, 'We set up your LinkSpin position so you would not miss a payout',
|
||||
'Someone in your line was about to buy on LinkSpin, so the network activated your position on the LinkSpin contract for your wallet ' + acct.address.slice(0, 6) + '…' + acct.address.slice(-4) + ', bound to your own sponsor. Nothing was charged and nothing else was touched. Your share of that purchase lands in this wallet in the same transaction.\n\nSee your line: https://' + (X.host || 'linkspin.co') + '/my');
|
||||
await tell(acct.email, X.seeding ? 'Your LinkSpin payouts are switched on' : 'We set up your LinkSpin position so you would not miss a payout',
|
||||
(X.seeding ? 'Your wallet was already on file with the network, so we switched on your LinkSpin payouts for you, at no cost to you. Your position on the LinkSpin contract is active for your wallet ' + acct.address.slice(0, 6) + '…' + acct.address.slice(-4) + ', bound to your own sponsor, and your team is already placed under you. When anyone in your line buys a LinkSpin package, your share lands in this wallet in the same transaction, and you will be notified.'
|
||||
: 'Someone in your line was about to buy on LinkSpin, so the network activated your position on the LinkSpin contract for your wallet ' + acct.address.slice(0, 6) + '…' + acct.address.slice(-4) + ', bound to your own sponsor. Nothing was charged and nothing else was touched. Your share of that purchase lands in this wallet in the same transaction.')
|
||||
+ '\n\nSee your line: https://' + (X.host || 'linkspin.co') + '/my');
|
||||
return id;
|
||||
} catch (e) { logEvent({ type: 'activateFailed', email: acct.email, error: String(e.shortMessage || e.message).slice(0, 160) }); return 0; }
|
||||
}
|
||||
@@ -153,9 +155,15 @@ async function ensureOnChain(acct, depth) {
|
||||
async function seedAll(limit) {
|
||||
const all = await X.accounts.listAll(5000);
|
||||
const withWallet = all.filter(a => a.address);
|
||||
let done = 0, failed = 0;
|
||||
for (const a of withWallet) { if (limit && done + failed >= limit) break; const id = await ensureOnChain(a, 0); if (id) done++; else failed++; }
|
||||
return { candidates: withWallet.length, done, failed };
|
||||
let done = 0, failed = 0, already = 0; X.seeding = true;
|
||||
try {
|
||||
for (const a of withWallet) {
|
||||
if (limit && done + failed >= limit) break;
|
||||
try { if (await X.chain.memberIdByAccount(a.address)) { already++; continue; } } catch (e) {}
|
||||
const id = await ensureOnChain(a, 0); if (id) done++; else failed++;
|
||||
}
|
||||
} finally { X.seeding = false; }
|
||||
return { candidates: withWallet.length, already, done, failed };
|
||||
}
|
||||
function status() { const s = state(); return { engine: engineReady(), claims: Object.values(s.claims || {}), log: (s.log || []).slice(-50).reverse(), claimDays: claimDays() }; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user