Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/actions/install-and-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ runs:

- name: Build Contracts
shell: sh
run: npm run build --workspace=contracts
run: npm run build --workspace=packages/contracts

- name: Build SDK
if: ${{ inputs.module == 'sdk' || inputs.module == 'cli' || inputs.module == 'web' }}
shell: sh
run: npm run build --workspace=sdk
run: npm run build --workspace=packages/sdk

- name: Build CLI
if: ${{ inputs.module == 'cli' }}
shell: sh
run: npm run build --workspace=cli
run: npm run build --workspace=apps/cli

- name: Build Web
if: ${{ inputs.module == 'web' }}
shell: sh
run: npm run build --workspace=web
run: npm run build --workspace=apps/web
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
echo "::endgroup::"

echo "::group::Set Artifact Name"
CONTRACTS_VERSION="$(jq -r '.version' './contracts/package.json')"
CONTRACTS_VERSION="$(jq -r '.version' './packages/contracts/package.json')"
PKG_NAME="hashgraph-stablecoin-npm-contracts-${CONTRACTS_VERSION}.tgz"
echo "::endgroup::"

Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
echo "::endgroup::"

echo "::group::Set Artifact Name"
SDK_VERSION="$(jq -r '.version' './sdk/package.json')"
SDK_VERSION="$(jq -r '.version' './packages/sdk/package.json')"
PKG_NAME="hashgraph-stablecoin-npm-sdk-${SDK_VERSION}.tgz"
echo "::endgroup::"

Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
echo "::endgroup::"

echo "::group::Set Artifact Name"
CLI_VERSION="$(jq -r '.version' './cli/package.json')"
CLI_VERSION="$(jq -r '.version' './apps/cli/package.json')"
PKG_NAME="hashgraph-stablecoin-npm-cli-${CLI_VERSION}.tgz"
echo "::endgroup::"

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ name: Test_Backend
on:
pull_request:
paths:
- "backend/src/**"
- "backend/test/**"
- "backend/tsconfig*.json"
- "apps/backend/src/**"
- "apps/backend/test/**"
- "apps/backend/tsconfig*.json"
- "package*.json"
push:
branches:
- main
paths:
- "backend/src/**"
- "backend/test/**"
- "backend/tsconfig*.json"
- "apps/backend/src/**"
- "apps/backend/test/**"
- "apps/backend/tsconfig*.json"
- "package*.json"
# env:
# NODE_VERSION: "20.17.0" # Fixed version for better stability
Expand Down Expand Up @@ -47,10 +47,10 @@ jobs:
run: npm ci

- name: Build Backend
run: npm run build --workspace=backend
run: npm run build --workspace=apps/backend

- name: Run Backend Tests
run: npm run test:ci --workspace=backend
run: npm run test:ci --workspace=apps/backend

- name: Clear Cache
run: npm run clear-cache --workspace=backend
run: npm run clear-cache --workspace=apps/backend
20 changes: 10 additions & 10 deletions .github/workflows/test-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ name: Test_CLI
on:
pull_request:
paths:
- "cli/src/**"
- "cli/test/**"
- "apps/cli/src/**"
- "apps/cli/test/**"
- "package*.json"
- "cli/tsconfig*.json"
- "cli/jest.config.js"
- "apps/cli/tsconfig*.json"
- "apps/cli/jest.config.js"
push:
branches:
- main
paths:
- "cli/src/**"
- "cli/test/**"
- "apps/cli/src/**"
- "apps/cli/test/**"
- "package*.json"
- "cli/tsconfig*.json"
- "cli/jest.config.js"
- "apps/cli/tsconfig*.json"
- "apps/cli/jest.config.js"

# env:
# NODE_VERSION: "20.17.0" # Fixed version for better stability
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:

# * Specific steps for the CLI
- name: Run tests CLI
run: npm run test:ci --workspace=cli
run: npm run test:ci --workspace=apps/cli

- name: Clear Cache
run: npm run clear-cache --workspace=cli
run: npm run clear-cache --workspace=apps/cli
32 changes: 16 additions & 16 deletions .github/workflows/test-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Test_Contracts
on:
pull_request:
paths:
- "contracts/contracts/**"
- "contracts/test/**"
- "contracts/scripts/**"
- "packages/contracts/contracts/**"
- "packages/contracts/test/**"
- "packages/contracts/scripts/**"
- "package*.json"
- "contracts/hardhat.config.ts"
- "contracts/tsconfig.json"
- "contracts/.solcover.js"
- "packages/contracts/hardhat.config.ts"
- "packages/contracts/tsconfig.json"
- "packages/contracts/.solcover.js"
- ".github/workflows/test-contracts.yaml"
push:
branches:
Expand Down Expand Up @@ -72,9 +72,9 @@ jobs:
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
contracts/artifacts
contracts/cache
contracts/typechain-types
packages/contracts/artifacts
packages/contracts/cache
packages/contracts/typechain-types
key: ${{ runner.os }}-contracts-build-${{ github.sha }}

# ==========================================================================
Expand Down Expand Up @@ -117,9 +117,9 @@ jobs:
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
contracts/artifacts
contracts/typechain-types
contracts/cache
packages/contracts/artifacts
packages/contracts/typechain-types
packages/contracts/cache
key: ${{ runner.os }}-contracts-build-${{ github.sha }}
fail-on-cache-miss: false

Expand Down Expand Up @@ -179,9 +179,9 @@ jobs:
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
contracts/artifacts
contracts/typechain-types
contracts/cache
packages/contracts/artifacts
packages/contracts/typechain-types
packages/contracts/cache
key: ${{ runner.os }}-contracts-build-${{ github.sha }}
fail-on-cache-miss: false

Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
- name: Run tests
if: steps.docker-check.outputs.available == 'true' && steps.solo.outcome == 'success'
run: |
npm run test --workspace=contracts -- --network local
npm run test --workspace=packages/contracts -- --network local

- name: Stop Hiero Solo Network
if: always() && steps.docker-check.outputs.available == 'true'
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ name: Test_SDK
on:
pull_request:
paths:
- "sdk/src/**"
- "sdk/test/**"
- "sdk/scripts/**"
- "packages/sdk/src/**"
- "packages/sdk/test/**"
- "packages/sdk/scripts/**"
- "package*.json"
- "sdk/tsconfig*.json"
- "sdk/jest.config.js"
- "packages/sdk/tsconfig*.json"
- "packages/sdk/jest.config.js"
push:
branches:
- main
paths:
- "sdk/src/**"
- "sdk/test/**"
- "sdk/scripts/**"
- "packages/sdk/src/**"
- "packages/sdk/test/**"
- "packages/sdk/scripts/**"
- "package*.json"
- "sdk/tsconfig*.json"
- "sdk/jest.config.js"
- "packages/sdk/tsconfig*.json"
- "packages/sdk/jest.config.js"
env:
RPC_NODE_BASE_URL: "https://296.rpc.thirdweb.com"

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
# * Specific steps for the SDK

- name: Run SDK Tests
run: npm run test:ci --workspace=sdk
run: npm run test:ci --workspace=packages/sdk

- name: Clear Cache
run: npm run clear-cache --workspace=sdk
run: npm run clear-cache --workspace=packages/sdk
12 changes: 6 additions & 6 deletions .github/workflows/test-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ name: Test_Web
on:
pull_request:
paths:
- "web/src/**"
- "apps/web/src/**"
- "package*.json"
- "web/tsconfig*.json"
- "apps/web/tsconfig*.json"
push:
branches:
- main
paths:
- "web/src/**"
- "apps/web/src/**"
- "package*.json"
- "web/tsconfig*.json"
- "apps/web/tsconfig*.json"
# env:
# NODE_VERSION: "20.17.0" # Fixed version for better stability
jobs:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:

# * Specific steps for the Web
- name: Run tests Web
run: npm run test:ci --workspace=web
run: npm run test:ci --workspace=apps/web

- name: Clear Cache
run: npm run clear:cache --workspace=web
run: npm run clear:cache --workspace=apps/web
58 changes: 30 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,24 @@ This monorepo is structured with **npm workspaces** and is designed for scalabil
## Monorepo Structure

```
├── contracts/ # Solidity smart contracts (Hardhat)
│ ├── contracts/
│ │ ├── extensions/ # Facets (Burn, CashIn, Freeze, KYC, Pause, Rescue, Reserve, Roles, Wipe, Hold)
│ │ ├── resolver/ # BusinessLogicResolver and ResolverProxy
│ │ └── Interfaces/ # Contract interfaces
│ └── test/
├── sdk/ # TypeScript SDK (Hexagonal Architecture + DDD + CQS)
│ └── src/
│ ├── domain/ # Domain entities and business logic
│ ├── app/ # Application layer (commands, queries, handlers)
│ ├── port/ # Inbound/outbound ports
│ └── core/ # Infrastructure and cross-cutting concerns
├── backend/ # NestJS REST API for multisignature transactions
├── cli/ # Command-line interface for stablecoin operations
├── web/ # React DApp for stablecoin management
├── docs/ # Documentation site (Docusaurus)
├── packages/
│ ├── contracts/ # Solidity smart contracts (Hardhat)
│ │ ├── contracts/
│ │ │ ├── extensions/ # Facets (Burn, CashIn, Freeze, KYC, Pause, Rescue, Reserve, Roles, Wipe, Hold)
│ │ │ ├── resolver/ # BusinessLogicResolver and ResolverProxy
│ │ │ └── Interfaces/ # Contract interfaces
│ │ └── test/
│ └── sdk/ # TypeScript SDK (Hexagonal Architecture + DDD + CQS)
│ └── src/
│ ├── domain/ # Domain entities and business logic
│ ├── app/ # Application layer (commands, queries, handlers)
│ ├── port/ # Inbound/outbound ports
│ └── core/ # Infrastructure and cross-cutting concerns
├── apps/
│ ├── backend/ # NestJS REST API for multisignature transactions
│ ├── cli/ # Command-line interface for stablecoin operations
│ ├── web/ # React DApp for stablecoin management
│ └── docs/ # Documentation site (Docusaurus)
├── documentation/ # Technical documentation content
│ ├── gettingStarted/ # Setup and onboarding guides
│ ├── sdk/ # SDK documentation
Expand Down Expand Up @@ -192,17 +194,17 @@ npm run build:backend # Independent

Each module has its own `.env` configuration. Sample files are provided:

- **Contracts**: `contracts/.env` (test account credentials) — use `contracts/.env.sample`
- **CLI**: `cli/hsca-config.yaml` — use `cli/hsca-config.sample.yaml`
- **Web**: `web/.env` (factory addresses, mirror node, RPC endpoints)
- **Backend**: `backend/.env` (database, port configuration)
- **Contracts**: `packages/contracts/.env` (test account credentials) — use `packages/contracts/.env.sample`
- **CLI**: `apps/cli/hsca-config.yaml` — use `apps/cli/hsca-config.sample.yaml`
- **Web**: `apps/web/.env` (factory addresses, mirror node, RPC endpoints)
- **Backend**: `apps/backend/.env` (database, port configuration)

## Development Workflows

### Smart Contracts

```bash
cd contracts
cd packages/contracts
npm run compile # Compile changed contracts
npm run compile:force # Force recompile all
npm test # Run all tests
Expand All @@ -212,7 +214,7 @@ npm run test:parallel # Run tests in parallel
### SDK

```bash
cd sdk
cd packages/sdk
npm run build # Build SDK
npm test # Run tests
npm run test:watch # Watch mode
Expand All @@ -221,7 +223,7 @@ npm run test:watch # Watch mode
### CLI

```bash
cd cli
cd apps/cli
npm run build # Build CLI
npm start # Start CLI
npm run start:wizard # Start in wizard mode
Expand All @@ -230,15 +232,15 @@ npm run start:wizard # Start in wizard mode
### Web DApp

```bash
cd web
cd apps/web
npm run build # Build web app
npm start # Start dev server on http://localhost:3000
```

### Backend

```bash
cd backend
cd apps/backend
npm run build # Build backend
npm run start:dev # Development mode with watch
npm run start:debug # Debug mode
Expand All @@ -251,9 +253,9 @@ npm run test:e2e # End-to-end tests
Run tests for individual modules:

```bash
npm test --workspace=contracts # Smart contract tests
npm test --workspace=sdk # SDK tests
npm test --workspace=backend # Backend unit tests
npm test --workspace=packages/contracts # Smart contract tests
npm test --workspace=packages/sdk # SDK tests
npm test --workspace=apps/backend # Backend unit tests
```

### Code Quality Standards
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading