strade-stx 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/package.json +10 -1
  2. package/contracts/CoreMarketPlace.clar +0 -227
  3. package/contracts/DisputeResolution_clar.clar +0 -265
  4. package/contracts/EscrowService.clar +0 -171
  5. package/contracts/UserProfile.clar +0 -280
  6. package/contracts/ft-trait.clar +0 -24
  7. package/contracts/token.clar +0 -178
  8. package/frontend/README.md +0 -10
  9. package/frontend/components.json +0 -22
  10. package/frontend/dist/assets/index-BacuuL66.css +0 -1
  11. package/frontend/dist/assets/index-jryypd5B.js +0 -194
  12. package/frontend/dist/favicon.png +0 -0
  13. package/frontend/dist/index.html +0 -15
  14. package/frontend/dist/manifest.json +0 -15
  15. package/frontend/dist/vite.svg +0 -1
  16. package/frontend/empty-mock.js +0 -1
  17. package/frontend/eslint.config.js +0 -23
  18. package/frontend/eslint.config.mjs +0 -25
  19. package/frontend/index.html +0 -14
  20. package/frontend/next.config.ts +0 -17
  21. package/frontend/package-lock.json +0 -14740
  22. package/frontend/package.json +0 -56
  23. package/frontend/postcss.config.js +0 -5
  24. package/frontend/postcss.config.mjs +0 -5
  25. package/frontend/public/favicon.png +0 -0
  26. package/frontend/public/file.svg +0 -1
  27. package/frontend/public/globe.svg +0 -1
  28. package/frontend/public/manifest.json +0 -15
  29. package/frontend/public/next.svg +0 -1
  30. package/frontend/public/vercel.svg +0 -1
  31. package/frontend/public/vite.svg +0 -1
  32. package/frontend/public/window.svg +0 -1
  33. package/frontend/src/App.css +0 -42
  34. package/frontend/src/App.tsx +0 -177
  35. package/frontend/src/app/about/page.tsx +0 -208
  36. package/frontend/src/app/favicon.ico +0 -0
  37. package/frontend/src/app/globals.css +0 -129
  38. package/frontend/src/app/help/page.tsx +0 -167
  39. package/frontend/src/app/how-it-works/page.tsx +0 -274
  40. package/frontend/src/app/layout.tsx +0 -55
  41. package/frontend/src/app/marketplace/page.tsx +0 -324
  42. package/frontend/src/app/my-listings/page.tsx +0 -318
  43. package/frontend/src/app/page.tsx +0 -15
  44. package/frontend/src/assets/react.svg +0 -1
  45. package/frontend/src/components/ConfirmDialog.tsx +0 -54
  46. package/frontend/src/components/CreateListingForm.tsx +0 -231
  47. package/frontend/src/components/ErrorBoundary.tsx +0 -73
  48. package/frontend/src/components/FilterPanel.tsx +0 -10
  49. package/frontend/src/components/Footer.tsx +0 -100
  50. package/frontend/src/components/Header.tsx +0 -268
  51. package/frontend/src/components/ImageUpload.tsx +0 -147
  52. package/frontend/src/components/LandingPage.tsx +0 -322
  53. package/frontend/src/components/ListingCard.tsx +0 -154
  54. package/frontend/src/components/LoadingSkeleton.tsx +0 -44
  55. package/frontend/src/components/MobileNav.tsx +0 -89
  56. package/frontend/src/components/NotificationBell.tsx +0 -8
  57. package/frontend/src/components/NotificationPanel.tsx +0 -14
  58. package/frontend/src/components/README.md +0 -14
  59. package/frontend/src/components/SearchBar.tsx +0 -10
  60. package/frontend/src/components/TestnetBanner.tsx +0 -29
  61. package/frontend/src/components/ThemeToggle.tsx +0 -32
  62. package/frontend/src/components/__tests__/Header.test.tsx +0 -70
  63. package/frontend/src/components/__tests__/ListingCard.test.tsx +0 -86
  64. package/frontend/src/components/providers/ThemeProvider.tsx +0 -9
  65. package/frontend/src/components/ui/alert-dialog.tsx +0 -141
  66. package/frontend/src/components/ui/avatar.tsx +0 -53
  67. package/frontend/src/components/ui/badge.tsx +0 -46
  68. package/frontend/src/components/ui/button.tsx +0 -60
  69. package/frontend/src/components/ui/card.tsx +0 -92
  70. package/frontend/src/components/ui/dialog.tsx +0 -143
  71. package/frontend/src/components/ui/dropdown-menu.tsx +0 -257
  72. package/frontend/src/components/ui/input.tsx +0 -21
  73. package/frontend/src/components/ui/label.tsx +0 -24
  74. package/frontend/src/components/ui/select.tsx +0 -187
  75. package/frontend/src/components/ui/sonner.tsx +0 -40
  76. package/frontend/src/components/ui/textarea.tsx +0 -18
  77. package/frontend/src/context/README.md +0 -27
  78. package/frontend/src/index.css +0 -166
  79. package/frontend/src/lib/notificationEvents.ts +0 -10
  80. package/frontend/src/lib/notificationStore.ts +0 -13
  81. package/frontend/src/lib/notifications.ts +0 -13
  82. package/frontend/src/lib/search.ts +0 -28
  83. package/frontend/src/lib/stacks.ts +0 -189
  84. package/frontend/src/lib/utils.ts +0 -6
  85. package/frontend/src/main.tsx +0 -10
  86. package/frontend/src/test/setup.ts +0 -23
  87. package/frontend/src/types.d.ts +0 -9
  88. package/frontend/tsconfig.app.json +0 -28
  89. package/frontend/tsconfig.json +0 -41
  90. package/frontend/tsconfig.node.json +0 -26
  91. package/frontend/vercel.json +0 -4
  92. package/frontend/vite.config.ts +0 -6
  93. package/frontend/vitest.config.ts +0 -17
  94. package/scripts/auto-activity.sh +0 -9
  95. package/scripts/cancel-pending.ts +0 -67
  96. package/scripts/check-balances.ts +0 -23
  97. package/scripts/distribute-evenly.ts +0 -56
  98. package/scripts/drain-accounts.ts +0 -70
  99. package/scripts/fund-accounts.ts +0 -88
  100. package/scripts/fund-active.ts +0 -59
  101. package/scripts/fund-unfunded.ts +0 -88
  102. package/scripts/generate-activity.ts +0 -181
  103. package/scripts/git-activity-generator.ts +0 -154
  104. package/scripts/mobile-server.ts +0 -123
@@ -1,154 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Git Activity Generator for Strade
4
- * Creates commits for GitHub activity. Supports resuming from existing commits.
5
- *
6
- * Usage:
7
- * npx tsx scripts/git-activity-generator.ts --help
8
- * npx tsx scripts/git-activity-generator.ts --dry-run
9
- * npx tsx scripts/git-activity-generator.ts
10
- * npx tsx scripts/git-activity-generator.ts --total 500
11
- *
12
- * WARNINGS:
13
- * - Creates temp files in ./temp-commits/ and commits them.
14
- * - Rate limited by GitHub (consider delays).
15
- * - Check GitHub TOS; for testing only.
16
- * - Runs `git push`, `gh pr create`. Ensure authenticated.
17
- * - Cleanup: rm -rf temp-commits/ && git branch -D fake-activity-pr-*
18
- */
19
-
20
- import { execSync } from 'child_process';
21
- import { mkdirSync, writeFileSync, existsSync, rmSync, readdirSync } from 'fs';
22
- import { dirname, join } from 'path';
23
- import { fileURLToPath } from 'url';
24
-
25
- const __dirname = dirname(fileURLToPath(import.meta.url));
26
- const TEMP_DIR = join(__dirname, '../temp-commits');
27
- const NUM_PRS = 5;
28
- const TOTAL_COMMITS = process.argv.includes('--total') ? parseInt(process.argv[process.argv.indexOf('--total') + 1] || '100') : 100;
29
- const COMMITS_PER_PR = Math.ceil(TOTAL_COMMITS / NUM_PRS);
30
- const PR_START = 183;
31
- const COUNTER_OFFSET = 34824;
32
- const DRY_RUN = process.argv.includes('--dry-run');
33
- const HELP = process.argv.includes('--help');
34
-
35
- if (HELP) {
36
- console.log(`Usage: npx tsx ${join('scripts/git-activity-generator.ts')} [--dry-run] [--help] [--total <num>]\n`);
37
- console.log('Options:\n --dry-run Simulate without git/gh commands\n --help Show this help\n --total Number of commits to make (default: 500)\n');
38
- process.exit(0);
39
- }
40
-
41
- function run(cmd: string, options: { cwd?: string; dryRun?: boolean } = {}) {
42
- const { cwd, dryRun } = options;
43
- if (dryRun || DRY_RUN) {
44
- console.log(`[DRY-RUN] cd ${cwd || process.cwd()} && ${cmd}`);
45
- return;
46
- }
47
- try {
48
- execSync(cmd, { cwd, stdio: 'inherit' });
49
- } catch (e: any) {
50
- console.error(`Error: ${e.message}`);
51
- process.exit(1);
52
- }
53
- }
54
-
55
- function log(msg: string) {
56
- console.log(`\n>>> ${msg}`);
57
- }
58
-
59
- async function main() {
60
- // Get existing file count to continue from where we left off
61
- let startCommit = 1;
62
- if (existsSync(TEMP_DIR)) {
63
- const existingFiles = readdirSync(TEMP_DIR).filter(f => f.startsWith('counter') && f.endsWith('.txt'));
64
- if (existingFiles.length > 0) {
65
- const maxCounter = Math.max(...existingFiles.map(f => parseInt(f.replace('counter', '').replace('.txt', ''))));
66
- startCommit = maxCounter - COUNTER_OFFSET + 1;
67
- console.log(`\n>>> Continuing from existing commit ${startCommit} (found ${existingFiles.length} existing files, max counter: ${maxCounter})`);
68
- } else {
69
- // Cleanup previous if empty
70
- rmSync(TEMP_DIR, { recursive: true });
71
- mkdirSync(TEMP_DIR, { recursive: true });
72
- }
73
- } else {
74
- mkdirSync(TEMP_DIR, { recursive: true });
75
- }
76
-
77
- // Create new temp files only for commits that don't exist yet
78
- for (let i = startCommit; i <= TOTAL_COMMITS; i++) {
79
- const file = join(TEMP_DIR, `counter${COUNTER_OFFSET + i}.txt`);
80
- if (!existsSync(file)) {
81
- writeFileSync(file, `Commit counter #${COUNTER_OFFSET + i} - ${Date.now()}\nMinor change for activity.\n`);
82
- }
83
- }
84
-
85
- run('git add temp-commits/');
86
- try { execSync('git commit -m "chore: add temp-commits dir for activity tracking"', { stdio: 'inherit' }); } catch {}
87
-
88
- for (let pr = 1; pr <= NUM_PRS; pr++) {
89
- log(`=== PR ${pr}/${NUM_PRS} (commits ${((pr-1)*COMMITS_PER_PR + 1)}-${pr*COMMITS_PER_PR}) ===`);
90
-
91
- const branch = `fake-activity-pr-${PR_START + pr - 1}-${COUNTER_OFFSET}`;
92
-
93
- // Create & switch branch
94
- run(`git checkout -b ${branch}`, { dryRun: DRY_RUN });
95
-
96
- // Make commits for this PR
97
- for (let c = (pr-1)*COMMITS_PER_PR + 1; c <= Math.min(pr*COMMITS_PER_PR, TOTAL_COMMITS); c++) {
98
- if (c > TOTAL_COMMITS) break;
99
- const file = join(TEMP_DIR, `counter${COUNTER_OFFSET + c}.txt`);
100
- const content = `Commit counter #${COUNTER_OFFSET + c} - ${Date.now() + c}\nUpdated at ${new Date().toISOString()}\nMinor change for activity.\n`;
101
- writeFileSync(file, content);
102
-
103
- run(`git add temp-commits/counter${COUNTER_OFFSET + c}.txt`, { cwd: process.cwd(), dryRun: DRY_RUN });
104
- if ((c - 1) % 50 === 0 || c === Math.min(pr*COMMITS_PER_PR, TOTAL_COMMITS)) {
105
- console.log(` Progress: PR${pr} commit ${c}/${Math.min(pr*COMMITS_PER_PR, TOTAL_COMMITS)} (${Math.min(TOTAL_COMMITS, pr*COMMITS_PER_PR)}/${TOTAL_COMMITS} total)`);
106
- }
107
- run(`git commit -m "chore: bump counter ${COUNTER_OFFSET + c} for activity tracking"`, { dryRun: DRY_RUN });
108
- }
109
-
110
- // Push & create PR
111
- run(`git push origin ${branch}`, { dryRun: DRY_RUN });
112
- run(`gh pr create --title "chore: activity batch #${pr} - ${COMMITS_PER_PR} minor updates" --body "Batch of ${COMMITS_PER_PR} commits for activity tracking. Changes in temp-commits/. #automation" --base main`, { dryRun: DRY_RUN });
113
-
114
- log(`PR ${pr} created! Merging to main...`);
115
-
116
- // Switch back to main
117
- run(`git checkout main`, { dryRun: DRY_RUN });
118
-
119
- // Merge the PR and delete the remote branch
120
- run(`gh pr merge ${branch} --merge --delete-branch --subject "chore: merge activity batch #${pr}"`, { dryRun: DRY_RUN });
121
-
122
- // Delete local branch if it still exists
123
- try { execSync(`git branch -D ${branch}`, { stdio: 'inherit' }); } catch {}
124
-
125
- // Pull latest main
126
- run(`git pull origin main`, { dryRun: DRY_RUN });
127
-
128
- log(`PR ${pr} merged and deleted!`);
129
- }
130
-
131
- // Safety: stash if dirty, checkout main
132
- try { execSync('git stash push -m "pre-activity auto-save"', { stdio: 'inherit' }); } catch {}
133
- try { execSync('git checkout main', { stdio: 'inherit' }); } catch {
134
- execSync('git checkout master', { stdio: 'inherit' });
135
- }
136
- try { execSync('git stash pop', { stdio: 'inherit' }); } catch {}
137
-
138
- // Clean up temp-commits
139
- if (existsSync(TEMP_DIR)) {
140
- rmSync(TEMP_DIR, { recursive: true });
141
- log('Temp files cleaned up');
142
- }
143
-
144
- // Update counter file
145
- writeFileSync('.activity_counter', TOTAL_COMMITS.toString());
146
- console.log(`Updated .activity_counter to ${TOTAL_COMMITS}`);
147
-
148
- log('✅ Complete! All PRs merged and deleted.');
149
- if (!DRY_RUN) {
150
- console.log(`\nSummary: ${TOTAL_COMMITS} commits across ${NUM_PRS} PRs, all merged to main and PRs deleted.`);
151
- }
152
- }
153
-
154
- main().catch(console.error);
@@ -1,123 +0,0 @@
1
- #!/usr/bin/env tsx
2
- import { createServer } from "node:http";
3
- import { spawn } from "node:child_process";
4
- import { join, dirname } from "node:path";
5
- import { fileURLToPath } from "node:url";
6
- import { networkInterfaces } from "node:os";
7
-
8
- const PORT = parseInt(process.env.PORT || "3456", 10);
9
- const __dirname = dirname(fileURLToPath(import.meta.url));
10
- const REPO_DIR = join(__dirname, "..");
11
-
12
- let childProcess: ReturnType<typeof spawn> | null = null;
13
-
14
- const html = `<!DOCTYPE html>
15
- <html lang="en">
16
- <head>
17
- <meta charset="UTF-8">
18
- <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
19
- <title>Strade Auto-Activity</title>
20
- <style>
21
- *{box-sizing:border-box;margin:0;padding:0}
22
- body{font-family:system-ui,-apple-system,sans-serif;display:flex;align-items:center;justify-content:center;min-height:100dvh;background:#0f172a;color:#e2e8f0}
23
- .container{text-align:center;padding:2rem;width:100%;max-width:400px}
24
- h1{font-size:1.5rem;margin-bottom:.5rem;color:#f8fafc}
25
- p{font-size:.875rem;color:#94a3b8;margin-bottom:2rem}
26
- .btn{display:block;width:100%;padding:1rem;font-size:1.25rem;font-weight:600;border:none;border-radius:12px;cursor:pointer;margin-bottom:1rem;transition:opacity .2s}
27
- .btn:active{opacity:.7}
28
- .btn:disabled{opacity:.4;cursor:not-allowed}
29
- .btn-start{background:#22c55e;color:#052e16}
30
- .btn-stop{background:#ef4444;color:#450a0a}
31
- #status{margin-top:1rem;padding:.75rem 1rem;border-radius:8px;font-weight:600;font-size:1rem}
32
- .running{background:#166534;color:#86efac}
33
- .idle{background:#1e293b;color:#94a3b8}
34
- .error{background:#7f1d1d;color:#fca5a5}
35
- .log{background:#1e293b;border-radius:8px;padding:.75rem;margin-top:1rem;max-height:200px;overflow-y:auto;text-align:left;font-family:monospace;font-size:.75rem;line-height:1.4;color:#94a3b8}
36
- </style>
37
- </head>
38
- <body>
39
- <div class="container">
40
- <h1>Strade Auto-Activity</h1>
41
- <p>Start or stop the auto-activity loop</p>
42
- <button class="btn btn-start" id="startBtn" onclick="run('/start')">▶ Start</button>
43
- <button class="btn btn-stop" id="stopBtn" onclick="run('/stop')">■ Stop</button>
44
- <div id="status" class="idle">Idle</div>
45
- <div class="log" id="log">Ready.</div>
46
- </div>
47
- <script>
48
- function log(msg){const el=document.getElementById('log');el.textContent+=msg;el.scrollTop=el.scrollHeight}
49
- async function run(path){const btn=event.target;btn.disabled=true;try{const r=await fetch(path,{method:'POST'});log(await r.text()+'. ')}catch(e){log('Error: '+e.message+'. ')}finally{btn.disabled=false;poll()}}
50
- async function poll(){try{const r=await fetch('/status');const d=await r.json();const el=document.getElementById('status');if(d.running){el.textContent='Running';el.className='running'}else if(d.error){el.textContent='Error';el.className='error';log('['+d.error+'] ')}else{el.textContent='Idle';el.className='idle'}}catch(e){const el=document.getElementById('status');el.textContent='Offline';el.className='error'}}
51
- setInterval(poll,3000);poll()
52
- </script>
53
- </body>
54
- </html>`;
55
-
56
- const server = createServer((req, res) => {
57
- res.setHeader("Access-Control-Allow-Origin", "*");
58
-
59
- if (req.method === "GET" && req.url === "/") {
60
- res.writeHead(200, { "Content-Type": "text/html" });
61
- res.end(html);
62
- return;
63
- }
64
-
65
- if (req.method === "POST" && req.url === "/start") {
66
- if (childProcess) {
67
- res.writeHead(200, { "Content-Type": "text/plain" });
68
- res.end("Already running");
69
- return;
70
- }
71
- const scriptPath = join(REPO_DIR, "scripts", "auto-activity.sh");
72
- childProcess = spawn("bash", [scriptPath], {
73
- cwd: REPO_DIR,
74
- stdio: "inherit",
75
- });
76
- childProcess.on("exit", (code) => {
77
- childProcess = null;
78
- });
79
- childProcess.on("error", () => {
80
- childProcess = null;
81
- });
82
- res.writeHead(200, { "Content-Type": "text/plain" });
83
- res.end("Started");
84
- return;
85
- }
86
-
87
- if (req.method === "POST" && req.url === "/stop") {
88
- if (childProcess) {
89
- childProcess.kill("SIGTERM");
90
- childProcess = null;
91
- }
92
- res.writeHead(200, { "Content-Type": "text/plain" });
93
- res.end("Stopped");
94
- return;
95
- }
96
-
97
- if (req.method === "GET" && req.url === "/status") {
98
- res.writeHead(200, { "Content-Type": "application/json" });
99
- res.end(JSON.stringify({ running: childProcess !== null }));
100
- return;
101
- }
102
-
103
- res.writeHead(404);
104
- res.end("Not found");
105
- });
106
-
107
- server.listen(PORT, "0.0.0.0", () => {
108
- const ifaces = networkInterfaces();
109
- const ips: string[] = [];
110
- for (const name of Object.keys(ifaces)) {
111
- for (const iface of ifaces[name] || []) {
112
- if (iface.family === "IPv4" && !iface.internal) {
113
- ips.push(iface.address);
114
- }
115
- }
116
- }
117
- console.log(`Mobile control server running:`);
118
- console.log(` Local: http://localhost:${PORT}`);
119
- for (const ip of ips) {
120
- console.log(` Network: http://${ip}:${PORT}`);
121
- }
122
- console.log(`Open one of the Network URLs on your phone's browser.`);
123
- });