Skip to content

Commit 9b8225d

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/setup-node-4.3.0
2 parents 5f7265b + d9e4ced commit 9b8225d

File tree

606 files changed

+55192
-45019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

606 files changed

+55192
-45019
lines changed

.github/pull_request_template.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Description
2+
3+
Summarize the change and the issue fixed. Include motivation and context. List dependencies. 📝
4+
5+
Fixes # (issue) 🛠️
6+
7+
## Type of change
8+
9+
- [ ] Bug fix 🐞
10+
- [ ] New feature ✨
11+
- [ ] Breaking change 💥
12+
- [ ] Documentation update 📖
13+
- [ ] Refactor 🔧
14+
15+
## Testing
16+
17+
Describe tests and instructions to reproduce. 🧪
18+
19+
- [ ] Local Tests (npm run test)
20+
- [ ] Manual (CLI or web interface)
21+
- [ ] Local GitHub Actions (act pull_request)
22+
23+
**Node version**:
24+
25+
- [ ] 18
26+
- [ ] 20
27+
- [x] 22
28+
- [ ] 23
29+
30+
### Test Results (if any)
31+
32+
## Checklist
33+
34+
- [ ] Style Guidelines followed ✅
35+
- [ ] Self-Reviewed 👀
36+
- [ ] Documentation Updated 📚
37+
- [ ] **Linters** - No New Warnings ⚠️
38+
- [ ] Effective Tests Added ✔️
39+
- [ ] Local Tests Pass ✅
40+
- [ ] No reduction of **Coverage**

.github/workflows/all.publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Harden Runner
16-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
16+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
1717
with:
1818
egress-policy: audit
1919

.github/workflows/all.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Harden Runner
41-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
41+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
4242
with:
4343
egress-policy: audit
4444

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ web_modules/
8585

8686
# Next.js build output
8787
.next
88-
out
8988

9089
# Nuxt.js build / generate output
9190
.nuxt

.husky/pre-commit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
npm run pre-commit:sdk
1+
npm run pre-commit:contracts
2+
npm run pre-commit:sdk

README.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88

99
### Table of Contents
1010

11-
- **[Development manifesto](#development-manifesto)**<br>
12-
- **[Prerequisites](#prerequisites)**<br>
13-
- **[Installation](#installation)**<br>
14-
- **[Build](#build)**<br>
15-
- **[Setting Up the Environment](#setting-up-the-environment)**<br>
16-
- **[Required Environment Variables](#required-environment-variables)**<br>
17-
- **[Optional Environment Variables (Hedera Wallet Connect)](#optional-environment-variables-hedera-wallet-connect)**<br>
18-
- **[Steps to set up the `.env` file](#steps-to-set-up-the-env-file)**<br>
19-
- **[Run](#run)**<br>
20-
- **[Support](#support)**<br>
21-
- **[Contributing](#contributing)**<br>
22-
- **[Code of conduct](#code-of-conduct)**<br>
23-
- **[License](#license)**<br>
11+
- **[Development manifesto](#development-manifesto)**<br>
12+
- **[Prerequisites](#prerequisites)**<br>
13+
- **[Installation](#installation)**<br>
14+
- **[Build](#build)**<br>
15+
- **[Setting Up the Environment](#setting-up-the-environment)**<br>
16+
- **[Required Environment Variables](#required-environment-variables)**<br>
17+
- **[Optional Environment Variables (Hedera Wallet Connect)](#optional-environment-variables-hedera-wallet-connect)**<br>
18+
- **[Steps to set up the `.env` file](#steps-to-set-up-the-env-file)**<br>
19+
- **[Run](#run)**<br>
20+
- **[Support](#support)**<br>
21+
- **[Contributing](#contributing)**<br>
22+
- **[Code of conduct](#code-of-conduct)**<br>
23+
- **[License](#license)**<br>
2424

2525
# Development manifesto
2626

@@ -34,9 +34,9 @@ By using DDD (Domain-Driven Design), we aim to create a shared language among al
3434

3535
Ensure the following tools are installed with these versions:
3636

37-
- **Node:**`v20.17.0`
38-
- **NPM:** `v10.8.3`
39-
- **Yarn:** `v1.22.22`
37+
- **Node:**`v20.17.0`
38+
- **NPM:** `v10.8.3`
39+
- **Yarn:** `v1.22.22`
4040

4141
# Installation
4242

@@ -71,72 +71,72 @@ To run the project, you'll need to configure environment variables in the `.env`
7171

7272
### _General Settings_
7373

74-
- **`REACT_APP_EQUITY_CONFIG_ID`**: Configuration Id for Equities.
75-
- **`REACT_APP_EQUITY_CONFIG_VERSION`**: Equity Version.
76-
- **`REACT_APP_BOND_CONFIG_ID`**: configuration Id for Bonds.
77-
- **`REACT_APP_BOND_CONFIG_VERSION`**: Bond Version.
78-
- **`REACT_APP_SHOW_DISCLAIMER`**: Set this value to `"true"` to show a disclaimer in the application.
74+
- **`REACT_APP_EQUITY_CONFIG_ID`**: Configuration Id for Equities.
75+
- **`REACT_APP_EQUITY_CONFIG_VERSION`**: Equity Version.
76+
- **`REACT_APP_BOND_CONFIG_ID`**: configuration Id for Bonds.
77+
- **`REACT_APP_BOND_CONFIG_VERSION`**: Bond Version.
78+
- **`REACT_APP_SHOW_DISCLAIMER`**: Set this value to `"true"` to show a disclaimer in the application.
7979

8080
### _Network Configuration_
8181

82-
- **`REACT_APP_MIRROR_NODE`**: The URL of the Hedera Mirror Node API used to query historical data from the Hedera testnet. Example: `https://testnet.mirrornode.hedera.com/api/v1/`
83-
- **`REACT_APP_RPC_NODE`**: The RPC node URL used to communicate with the Hedera testnet. Example: `https://testnet.hashio.io/api`
84-
- **`REACT_APP_RPC_RESOLVER`**: The Hedera testnet account ID for the resolver. Example: `0.0.5479997`
85-
- **`REACT_APP_RPC_FACTORY`**: The Hedera testnet account ID for the factory. Example: `0.0.5480051`
82+
- **`REACT_APP_MIRROR_NODE`**: The URL of the Hedera Mirror Node API used to query historical data from the Hedera testnet. Example: `https://testnet.mirrornode.hedera.com/api/v1/`
83+
- **`REACT_APP_RPC_NODE`**: The RPC node URL used to communicate with the Hedera testnet. Example: `https://testnet.hashio.io/api`
84+
- **`REACT_APP_RPC_RESOLVER`**: The Hedera testnet account ID for the resolver. Example: `0.0.5479997`
85+
- **`REACT_APP_RPC_FACTORY`**: The Hedera testnet account ID for the factory. Example: `0.0.5480051`
8686

8787
## Optional Environment Variables (Hedera Wallet Connect)
8888

8989
These variables are only required if you are integrating Hedera Wallet Connect for decentralized application (dApp) interactions. If not needed, they can be omitted.
9090

91-
- **`REACT_APP_PROJECT_ID`**: Project ID for Wallet Connect integration. You can obtain it from the [WalletConnect website](https://walletconnect.com/).
92-
- **`REACT_APP_DAPP_NAME`**: The name of your dApp as displayed in Wallet Connect.
93-
- **`REACT_APP_DAPP_DESCRIPTION`**: A description of your dApp, typically displayed in Wallet Connect.
94-
- **`REACT_APP_DAPP_URL`**: The URL of your dApp that will be referenced in Wallet Connect.
95-
- **`REACT_APP_DAPP_ICONS`**: An array of URLs pointing to icons for the dApp, typically used in Wallet Connect interfaces. Example: `['https://stablecoinstudio.com/static/media/hedera-hbar-logo.4fd73fb360de0fc15d378e0c3ebe6c80.svg']`
91+
- **`REACT_APP_PROJECT_ID`**: Project ID for Wallet Connect integration. You can obtain it from the [WalletConnect website](https://walletconnect.com/).
92+
- **`REACT_APP_DAPP_NAME`**: The name of your dApp as displayed in Wallet Connect.
93+
- **`REACT_APP_DAPP_DESCRIPTION`**: A description of your dApp, typically displayed in Wallet Connect.
94+
- **`REACT_APP_DAPP_URL`**: The URL of your dApp that will be referenced in Wallet Connect.
95+
- **`REACT_APP_DAPP_ICONS`**: An array of URLs pointing to icons for the dApp, typically used in Wallet Connect interfaces. Example: `['https://stablecoinstudio.com/static/media/hedera-hbar-logo.4fd73fb360de0fc15d378e0c3ebe6c80.svg']`
9696

9797
## Steps to set up the `.env` file:
9898

9999
1. Navigate to the `web` module folder.
100100
2. Copy the `.env.sample` file to create a new `.env` file:
101101

102-
```bash
103-
cp .env.sample .env
104-
```
102+
```bash
103+
cp .env.sample .env
104+
```
105105

106106
3. Open the `.env` file in your preferred text editor.
107107
4. Replace the placeholder values with your actual environment settings. For example:
108108

109-
```bash
110-
REACT_APP_EQUITY_CONFIG_ID='0x0000000000000000000000000000000000000000000000000000000000000001'
111-
REACT_APP_EQUITY_CONFIG_VERSION="0"
112-
REACT_APP_BOND_CONFIG_ID="0x0000000000000000000000000000000000000000000000000000000000000002"
113-
REACT_APP_BOND_CONFIG_VERSION="0"
114-
REACT_APP_SHOW_DISCLAIMER="true"
115-
116-
REACT_APP_MIRROR_NODE="https://testnet.mirrornode.hedera.com/api/v1/"
117-
REACT_APP_RPC_NODE="https://testnet.hashio.io/api"
118-
REACT_APP_RPC_RESOLVER='0.0.5479997'
119-
REACT_APP_RPC_FACTORY='0.0.5480051'
120-
121-
REACT_APP_PROJECT_ID="your_project_id_from_walletconnect"
122-
REACT_APP_DAPP_NAME="Asset Tokenization Studio"
123-
REACT_APP_DAPP_DESCRIPTION="Asset Tokenization Studio. Built on Hedera Hashgraph."
124-
REACT_APP_DAPP_URL="https://wc.ats.com/"
125-
REACT_APP_DAPP_ICONS='["https://stablecoinstudio.com/static/media/hedera-hbar-logo.4fd73fb360de0fc15d378e0c3ebe6c80.svg"]'
126-
```
109+
```bash
110+
REACT_APP_EQUITY_CONFIG_ID='0x0000000000000000000000000000000000000000000000000000000000000001'
111+
REACT_APP_EQUITY_CONFIG_VERSION="0"
112+
REACT_APP_BOND_CONFIG_ID="0x0000000000000000000000000000000000000000000000000000000000000002"
113+
REACT_APP_BOND_CONFIG_VERSION="0"
114+
REACT_APP_SHOW_DISCLAIMER="true"
115+
116+
REACT_APP_MIRROR_NODE="https://testnet.mirrornode.hedera.com/api/v1/"
117+
REACT_APP_RPC_NODE="https://testnet.hashio.io/api"
118+
REACT_APP_RPC_RESOLVER='0.0.5827968'
119+
REACT_APP_RPC_FACTORY='0.0.5828112'
120+
121+
REACT_APP_PROJECT_ID="your_project_id_from_walletconnect"
122+
REACT_APP_DAPP_NAME="Asset Tokenization Studio"
123+
REACT_APP_DAPP_DESCRIPTION="Asset Tokenization Studio. Built on Hedera Hashgraph."
124+
REACT_APP_DAPP_URL="https://wc.ats.com/"
125+
REACT_APP_DAPP_ICONS='["https://stablecoinstudio.com/static/media/hedera-hbar-logo.4fd73fb360de0fc15d378e0c3ebe6c80.svg"]'
126+
```
127127

128128
5. Save the file and proceed with running the application.
129129

130130
# Run
131131

132132
In order to run the application locally:
133133

134-
- Clone the repository
135-
- Install the application as described in the _Installation_ section
136-
- Create a ".env" file in the _web_ module (using the ".env.sample" file as a template)
137-
- Open a terminal and go to the _web_ folder
138-
- Run the command : **yarn dev**
139-
- Open a browser and type in the URL displayed in the terminal (by default it will be : _http://localhost:5173_)
134+
- Clone the repository
135+
- Install the application as described in the _Installation_ section
136+
- Create a ".env" file in the _web_ module (using the ".env.sample" file as a template)
137+
- Open a terminal and go to the _web_ folder
138+
- Run the command : **yarn dev**
139+
- Open a browser and type in the URL displayed in the terminal (by default it will be : _http://localhost:5173_)
140140

141141
# Support
142142

addLicence.js

Lines changed: 91 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,95 @@
11
#!/usr/bin/env node
2-
const fs = require("fs-extra");
3-
const glob = require("glob");
4-
5-
// Function to prepend content to each TypeScript file
6-
async function prependContentToFiles(rootDirectory, contentFile, fileExtension) {
7-
try {
8-
// Read the content to be prepended
9-
const content = await fs.readFile(contentFile, "utf8");
10-
const comment = `/*\n${content}\n*/\n\n`;
11-
12-
// Find all TypeScript files in the specified root directory, excluding node_modules
13-
const files = glob.sync(`${rootDirectory}/**/*.${fileExtension}`, {
14-
ignore: "**/node_modules/**", // Exclude node_modules
15-
});
16-
17-
// Prepend the comment to each file
18-
for (const file of files) {
19-
const existingContent = await fs.readFile(file, "utf8");
20-
21-
// Check if the license header is already present at the beginning of the file
22-
if (!existingContent.startsWith(comment)) {
23-
// If not, prepend the comment
24-
await fs.writeFile(file, comment + existingContent);
25-
console.log(`Prepended content to ${file}`);
26-
} else {
27-
console.log(`License header already exists in ${file}, skipping.`);
28-
}
2+
const { promises: fs } = require('fs');
3+
const path = require('path');
4+
5+
async function findFiles(dir, extension) {
6+
let files = [];
7+
try {
8+
const entries = await fs.readdir(dir, { withFileTypes: true });
9+
for (const entry of entries) {
10+
const fullPath = path.join(dir, entry.name);
11+
if (entry.isDirectory()) {
12+
if (entry.name === 'node_modules') continue;
13+
files = files.concat(await findFiles(fullPath, extension));
14+
} else if (
15+
entry.isFile() &&
16+
path.extname(fullPath) === `.${extension}`
17+
) {
18+
files.push(fullPath);
19+
}
20+
}
21+
} catch (error) {
22+
console.error(`Error reading directory ${dir}:`, error);
23+
}
24+
return files;
25+
}
26+
27+
function normalizeLicenseContent(content) {
28+
return content
29+
.trim()
30+
.replace(/\r\n/g, '\n') // Normalize line endings
31+
.split('\n')
32+
.map((line) => line.trim().replace(/^\*/, '').trim())
33+
.join('\n')
34+
.replace(/\s+/g, ' ')
35+
.replace(/\n+/g, '\n');
36+
}
37+
38+
async function prependContentToFiles(
39+
rootDirectory,
40+
contentFile,
41+
fileExtension
42+
) {
43+
try {
44+
const content = await fs.readFile(contentFile, 'utf8');
45+
const comment = `/*\n${content}\n*/\n\n`;
46+
47+
// Create normalized version for comparison
48+
const licenseNormalized = normalizeLicenseContent(content);
49+
50+
const files = await findFiles(rootDirectory, fileExtension);
51+
if (files.length === 0) {
52+
console.log('No matching files found.');
53+
return;
54+
}
55+
56+
for (const file of files) {
57+
try {
58+
const existingContent = await fs.readFile(file, 'utf8');
59+
60+
// Check for existing license using more sophisticated detection
61+
const existingHeaderMatch =
62+
existingContent.match(/^\/\*[\s\S]*?\*\//);
63+
let hasExistingLicense = false;
64+
65+
if (existingHeaderMatch) {
66+
const existingHeader = existingHeaderMatch[0];
67+
const existingNormalized = normalizeLicenseContent(
68+
existingHeader
69+
.replace(/^\/\*+/, '')
70+
.replace(/\*+\/$/, '')
71+
);
72+
73+
// Compare normalized content
74+
hasExistingLicense =
75+
existingNormalized === licenseNormalized;
76+
}
77+
78+
if (!hasExistingLicense) {
79+
await fs.writeFile(file, comment + existingContent);
80+
console.log(`Prepended content to ${file}`);
81+
} else {
82+
console.log(
83+
`Valid license header already exists in ${file}, skipping.`
84+
);
85+
}
86+
} catch (error) {
87+
console.error(`Error processing file ${file}:`, error);
88+
}
89+
}
90+
} catch (error) {
91+
console.error('Error:', error);
2992
}
30-
} catch (error) {
31-
console.error("Error:", error);
32-
}
3393
}
3494

35-
// Usage example: Applies to all `.ts` files in the current directory and its subdirectories, excluding node_modules
36-
prependContentToFiles("./", "./LICENSE", "ts");
95+
prependContentToFiles('./', './LICENSE', 'ts');

0 commit comments

Comments
 (0)