Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
07da3a8
Remove DB from server
jonty007 Apr 16, 2025
135fca9
update chess-contracts to support OP_2 OP_# multisig
jonty007 Apr 16, 2025
5b49244
update lib
jonty007 Apr 16, 2025
ad441b8
update chess-app using OP_2 OP_3 flow to clain win
jonty007 Apr 16, 2025
fa19b72
lib build
jonty007 Apr 16, 2025
43a623e
lib build
jonty007 Apr 16, 2025
8306ad8
lint fix
jonty007 Apr 24, 2025
604d831
merge commit
jonty007 Apr 24, 2025
534f787
peer to peer chess game
jonty007 May 12, 2025
5e45df3
remove API_BASE_URL as its not required
jonty007 May 12, 2025
3fc34e0
removed vite api url
jonty007 May 12, 2025
44b3843
UX fixes
jonty007 May 13, 2025
b700dac
remove logs
jonty007 May 13, 2025
da9e411
logs for subscription check
jonty007 May 14, 2025
041cf67
adding logs for subscription test
jonty007 May 16, 2025
6b782bc
upgraded typescript to latest
jonty007 May 19, 2025
a817c7d
UI/UX improvements
jonty007 May 27, 2025
cf64d17
Remove comment
jonty007 Jun 8, 2025
2b29c95
Update ChessBoard.tsx
ClemensLey Jun 9, 2025
e5f680d
Updates chess-app README.md
ltardivo Jun 9, 2025
1c32e53
Fix the UI/UX
jonty007 Jun 11, 2025
ec68f8f
merge commit
jonty007 Jun 13, 2025
ffdbeb9
UI/UX fixes for chess app
jonty007 Jun 18, 2025
0d6b6dd
UI/UX fixes
jonty007 Jun 19, 2025
cccf0b6
UI/UX changes, removed my-games and moved features to home
jonty007 Jun 20, 2025
b7e54cd
Challenge wrapper and UI/UX improvements
jonty007 Jun 25, 2025
b4992a5
Challenge notification UX
jonty007 Jun 26, 2025
53c96e9
Typescript upgrade, nextjs template app, eslint upgrade
jonty007 Jul 3, 2025
1cf4c99
package-lock update
jonty007 Jul 3, 2025
181aaf2
staging merge
jonty007 Jul 3, 2025
8ae571e
merge commit
jonty007 Jul 3, 2025
a30634b
Remove redundant comments in vite.config.ts
ClemensLey Jul 4, 2025
1c7eaf8
Remove empty symbols from on chain expression
ClemensLey Jul 4, 2025
480055d
components: remove deprecated configuration
ClemensLey Jul 4, 2025
490438f
build commit
jonty007 Jul 4, 2025
07d7213
Merge branch 'feat/next-app-template' of https://github.com/bitcoin-c…
jonty007 Jul 4, 2025
1c6f04a
Minor changes:
ClemensLey Jul 8, 2025
11aacd1
rename next-app-template to next-js-template
ClemensLey Jul 8, 2025
c59f1f7
built files
ClemensLey Jul 10, 2025
57c7610
Merge branch 'staging' into feat/claim-tx-with-operator
ClemensLey Jul 10, 2025
007d595
built files
ClemensLey Jul 10, 2025
c1a63df
chess: update readme files
ClemensLey Jul 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ packages/**/chain-setup/**/db-data
# Logs
logs
*.log
.parcel-cache

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down
27,464 changes: 14,457 additions & 13,007 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@
},
"devDependencies": {
"@types/node": "^20.11.21",
"eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint": "9.29.0",
"eslint-config-prettier": "~9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"path": "^0.12.7",
"ts-node": "^10.9.2",
"turbo": "^2.1.3",
"typescript": "^5.5.3",
"typescript": "^5.8.3",
"url": "^0.11.3"
},
"optionalDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{ ignores: ['dist', 'build'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
// remove them later
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
)
2 changes: 1 addition & 1 deletion packages/TBC20/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"mocha": "^10.3.0",
"prettier": "~3.2.5",
"source-map-support": "^0.5.21",
"typescript": "~5.3.3"
"typescript": "^5.8.3"
},
"volta": {
"node": "16.13.0"
Expand Down
24 changes: 24 additions & 0 deletions packages/TBC721/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import js from '@eslint/js'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist', 'build'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
// remove them later
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
)
2 changes: 1 addition & 1 deletion packages/TBC721/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"mocha": "^10.3.0",
"prettier": "~3.2.5",
"source-map-support": "^0.5.21",
"typescript": "~5.3.3"
"typescript": "^5.8.3"
},
"volta": {
"node": "16.13.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/TBC721/src/nft.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable max-classes-per-file */

export class NFT extends Contract {
name: string
Expand Down
2 changes: 0 additions & 2 deletions packages/TBC721/test/nft.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-unused-expressions */
// eslint-disable-next-line import/no-extraneous-dependencies
import * as chai from 'chai'
import { Computer } from '@bitcoin-computer/lib'
import dotenv from 'dotenv'
Expand Down
9 changes: 1 addition & 8 deletions packages/chat/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ export default tseslint.config(
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
},
)
9 changes: 4 additions & 5 deletions packages/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"preview": "vite preview",
"start": "vite",
"test": "vitest run",
"test:dev": "vitest"
"start": "vite"
},
"dependencies": {
"@bitcoin-computer/components": "^0.25.0-beta.0",
Expand All @@ -32,16 +30,17 @@
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.20",
"eslint": "^9.18.0",
"eslint": "9.29.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0",
"jsdom": "^25.0.0",
"postcss": "^8.4.44",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.3",
"typescript": "^5.8.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.1",
"vite-plugin-node-polyfills": "^0.23.0",
"vitest": "^2.0.5"
}
}
28 changes: 26 additions & 2 deletions packages/chat/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,41 @@

import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import path from 'path'

export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [react()],
plugins: [
react(),
nodePolyfills({
globals: {
Buffer: true,
global: true,
},
protocolImports: true, // Polyfill modules like stream, crypto, etc.
}),
],
resolve: {
alias: {
// Alias for @bitcoin-computer/lib to browser-compatible version
'@bitcoin-computer/lib': path.resolve(__dirname, '../lib/dist/bc-lib.browser.min.mjs'),
},
},
server: {
port: parseInt(env.VITE_PORT),
port: parseInt(env.VITE_PORT) || 3000, // Fallback port if env.VITE_PORT is undefined
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
},
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
},
},
}
})
3 changes: 2 additions & 1 deletion packages/chess-app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
VITE_CHAIN=LTC
VITE_NETWORK=regtest
VITE_URL=http://127.0.0.1:1031
VITE_API_BASE_URL=http://127.0.0.1:4000
VITE_PATH=m/44'/1'/0'

# Application Port
Expand All @@ -11,3 +10,5 @@ VITE_PORT=1032
# Smart Contract Locations
# Run 'npm run deploy' to generate module specifiers
VITE_CHESS_GAME_MOD_SPEC=
VITE_CHESS_USER_MOD_SPEC=
VITE_CHESS_CHALLENGE_MOD_SPEC=
17 changes: 12 additions & 5 deletions packages/chess-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@ Start a Bitcoin Computer Node in the package `node`. Then copy the `.env.example
cp .env.example .env
```

Then start the chess server in the package `chess-server` and run the deploy script there.

### Test
Deploy the smart contracts in the package `chess-contracts`.

```
npm test
cd ../chess-contracts
cp .env.example .env
npm run deploy
cd ../chess-app
```

### Start the App
Start the App

```
npm start
```

### Test

```
npm test
```
9 changes: 1 addition & 8 deletions packages/chess-app/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ export default tseslint.config(
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
},
)
12 changes: 6 additions & 6 deletions packages/chess-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"build": "tsc -b && vite build",
"build": "tsc -b && NODE_OPTIONS=\"--max-old-space-size=4096\" vite build",
"build:contract": "tsc --project tsconfig.build.json && mv ./build-contract/chess-module.js ./src/contracts/chess.mjs && rm -rf build-contract",
"build:turbo": "turbo run build",
"deploy": "npm run build:contract && node --loader ts-node/esm ./scripts/deploy.ts",
Expand All @@ -13,9 +13,7 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"preview": "vite preview",
"start": "vite",
"test": "vitest run",
"test:dev": "vitest"
"start": "vite"
},
"dependencies": {
"@bitcoin-computer/chess-contracts": "^0.25.0-beta.0",
Expand All @@ -29,6 +27,7 @@
"react": "^18.3.1",
"react-chessboard": "^4.7.2",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"url": "^0.11.4"
},
"devDependencies": {
Expand All @@ -43,17 +42,18 @@
"autoprefixer": "^10.4.20",
"crypto": "1.0.1",
"ecpair": "^2.1.0",
"eslint": "^9.18.0",
"eslint": "9.29.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0",
"jsdom": "^25.0.0",
"postcss": "^8.4.44",
"rollup-plugin-node-polyfills": "^0.2.1",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.3",
"typescript": "^5.8.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.1",
"vite-plugin-node-polyfills": "^0.23.0",
"vitest": "^2.0.5"
}
}
3 changes: 2 additions & 1 deletion packages/chess-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Auth, UtilsContext, Wallet, ComputerContext } from '@bitcoin-computer/c
import { ChessBoard } from './components/ChessBoard'

import { Navbar } from './components/Navbar'
import { Home } from './components/Home'

export default function App() {
const [computer] = useState(Auth.getComputer())
Expand All @@ -24,7 +25,7 @@ export default function App() {
<Navbar />
<div className="w-full h-screen bg-white border-gray-200 dark:bg-gray-900 px-4 lg:px-24">
<Routes>
<Route path="/" element={<ChessBoard />} />
<Route path="/" element={<Home />} />
<Route path="/game/:id" element={<ChessBoard />} />
<Route path="*" element={<Navigate to="/" replace={true} />} />
</Routes>
Expand Down
Loading