-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from LF-Decentralized-Trust-labs/ts-example
Add basic TypeScript example app
- Loading branch information
Showing
35 changed files
with
2,058 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
build/ | ||
src/abis/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run", | ||
"runtimeExecutable": "npm", | ||
"args": ["run", "start"], | ||
"request": "launch", | ||
"type": "node", | ||
"outputCapture": "std" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Example: Bond Issuance | ||
|
||
This example demonstrates a bond issuance scenario on Paladin. It leverages a combination of Noto tokens and | ||
Pente private smart contracts in order to control visibility of various aspects of the bond issuance process. | ||
|
||
## Running | ||
|
||
Requires a local Paladin cluster running on `localhost:31548` and `localhost:31648`. | ||
|
||
Compile [Solidity contracts](../../solidity): | ||
|
||
```shell | ||
cd ../../solidity | ||
npm install | ||
npm run compile | ||
``` | ||
|
||
Run example: | ||
|
||
```shell | ||
npm install | ||
npm run abi | ||
npm run start | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "paladin-example-bond", | ||
"version": "0.0.1", | ||
"description": "", | ||
"main": "build/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"start": "ts-node ./src/index.ts", | ||
"start:prod": "node ./build/index.js", | ||
"abi": "node scripts/abi.mjs" | ||
}, | ||
"author": "", | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@types/node": "^22.8.7", | ||
"copy-file": "^11.0.0", | ||
"typescript": "^5.6.3" | ||
}, | ||
"dependencies": { | ||
"ethers": "^6.13.4", | ||
"paladin-sdk": "file:../../sdk/typescript", | ||
"uuid": "^11.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { copyFile } from "copy-file"; | ||
|
||
await copyFile( | ||
"../../solidity/artifacts/contracts/private/BondSubscription.sol/BondSubscription.json", | ||
"src/abis/BondSubscription.json" | ||
); | ||
|
||
await copyFile( | ||
"../../solidity/artifacts/contracts/private/BondTracker.sol/BondTracker.json", | ||
"src/abis/BondTracker.json" | ||
); | ||
|
||
await copyFile( | ||
"../../solidity/artifacts/contracts/private/InvestorRegistry.sol/InvestorRegistry.json", | ||
"src/abis/InvestorRegistry.json" | ||
); | ||
|
||
await copyFile( | ||
"../../solidity/artifacts/contracts/shared/BondTrackerPublic.sol/BondTrackerPublic.json", | ||
"src/abis/BondTrackerPublic.json" | ||
); | ||
|
||
await copyFile( | ||
"../../solidity/artifacts/contracts/domains/pente/PentePrivacyGroup.sol/PentePrivacyGroup.json", | ||
"src/abis/PentePrivacyGroup.json" | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Smart contract ABIs will be copied here by `npm run abi`. |
Oops, something went wrong.