Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
ef7f081
fix cache delete issue
wizicer May 4, 2023
1e673d0
allow configurable external rpc url
wizicer May 4, 2023
da51cdf
fix version
wizicer Jul 15, 2023
674c3c2
disable usds and init swap
wizicer Jul 18, 2023
09e898d
sign swap
wizicer Jul 18, 2023
c370fb2
bundle summary show account name
wizicer Jul 18, 2023
ed4c23c
swap summary and reverse convert
wizicer Jul 19, 2023
48532bf
extract tibet functions and i18n
wizicer Jul 19, 2023
7c5879c
format swap page
wizicer Jul 19, 2023
83e418b
some dapp removed from experiment
wizicer Jul 19, 2023
7e289a4
move most of functions out of experiment
wizicer Jul 19, 2023
0a64215
put swap in debug mode
wizicer Jul 19, 2023
595224e
show donation button
wizicer Jul 21, 2023
7830086
add special thanks
wizicer Jul 21, 2023
760dab9
fix: multiple notification raised for same block height
wizicer Jul 21, 2023
882dea9
drop USDS and add BDOG, changed image url
wizicer Jul 21, 2023
682b8b4
reduce DEFAULT_ADDRESS_RETRIEVAL_COUNT to 1
wizicer Jul 21, 2023
ab31891
allow to make offer for wallet connect
wizicer Jul 21, 2023
4eb6281
split cat offer to 3 function test
wizicer Jul 23, 2023
fc85906
new make offer test
wizicer Jul 23, 2023
cde4783
make test.data.ts plaintext to ease the burden of syntax highlighting…
wizicer Jul 23, 2023
c8787bb
show error when no coins to create plan
wizicer Jul 23, 2023
37544d5
throw error when abnormal number output from clvm
wizicer Jul 23, 2023
7bf33f4
fix offer by using getofferentities
wizicer Jul 23, 2023
1868ba8
add extra targets in generate offer plan
wizicer Jul 23, 2023
74a36bd
remove accidently console log from puzzle.ts
wizicer Jul 23, 2023
230a394
revert wrong assert in bundler
wizicer Jul 23, 2023
44250b0
serve -> dev
wizicer Nov 25, 2023
acc0dd2
update package files
wizicer Dec 4, 2023
dda57d1
move subprojects out of packages
wizicer Dec 5, 2023
c24d5ba
fix path
wizicer Dec 5, 2023
e3c4a72
internal function: mnemonic 12
wizicer Dec 6, 2023
b24d091
update thanks
wizicer Dec 6, 2023
b318fe2
remove bdog
wizicer Dec 6, 2023
63d29fa
fix azure pipeline env path
wizicer Dec 6, 2023
45a72dd
fix build issue
wizicer Dec 6, 2023
3c1c6a3
add babel eslint parser, try to workaround azure pipeline error
wizicer Dec 6, 2023
a8d0914
try ubuntu 20.04
wizicer Dec 6, 2023
b40f4c7
try windows latest
wizicer Dec 6, 2023
5c5082d
try add cache for npm packages
wizicer Dec 6, 2023
ed07ad2
try remove module in eslintrc
wizicer Dec 6, 2023
1bf19a7
froze lock file
wizicer Dec 6, 2023
89be6b8
try eslint ts parser
wizicer Dec 6, 2023
fe999af
update cache mechanism
wizicer Dec 6, 2023
103f01e
fix warning
wizicer Dec 6, 2023
240f79d
update eslint parser
wizicer Dec 6, 2023
7b0c583
update cache folder
wizicer Dec 6, 2023
276d9ca
try set source type
wizicer Dec 6, 2023
fe2f8be
update github action
wizicer Dec 6, 2023
ee0a4b9
update test name
wizicer Dec 6, 2023
b3adf5c
add parser for lib
wizicer Dec 6, 2023
d80ef53
turn off no-console warning
wizicer Dec 6, 2023
30f2dfb
add env for eslint
wizicer Dec 7, 2023
416f179
change pipeline to use ubuntu
wizicer Dec 7, 2023
4be09cf
try add eslint-loader
wizicer Dec 7, 2023
b65400d
try change eslintrc
wizicer Dec 7, 2023
f0e83fa
try disable eslintrc
wizicer Dec 7, 2023
b123ce8
add eslint config in packages
wizicer Dec 7, 2023
ab6eaa3
try use same vue eslint
wizicer Dec 7, 2023
cc90b34
fix error
wizicer Dec 7, 2023
fc68e1d
eslint the project
wizicer Dec 9, 2023
2b14a87
eslint the code and fix styles
wizicer Dec 9, 2023
df20622
draft the inscription page
wizicer Dec 10, 2023
84160ec
init inscription ui with sign and summary
wizicer Dec 10, 2023
c7573f4
add service address and enhance bundle summary
wizicer Dec 10, 2023
f397957
remove unlock height
wizicer Dec 11, 2023
f25bdbb
add hint for inscription
wizicer Dec 11, 2023
ef1e9c1
include memo and extra targets in getting bootstrap spendbundle
wizicer Dec 11, 2023
03da485
combine deploy with transfer logic
wizicer Dec 11, 2023
5c31195
working
wizicer Dec 11, 2023
d9543a0
update service address
wizicer Dec 11, 2023
1b79793
remove no used i18n keys
wizicer Dec 11, 2023
a9dd5ea
remove unused keys (again)
wizicer Dec 11, 2023
dbae2d3
move inscribe to first one
wizicer Dec 11, 2023
c3e1198
set number range and repeat cap
wizicer Dec 11, 2023
18d8c10
hide donate dapp
wizicer Dec 12, 2023
e1a0ef7
change fee of inscription
wizicer Dec 12, 2023
9ea53fa
change default fee and allowed max fee
wizicer Dec 12, 2023
ce82c2f
add direct mode for inscription (test)
wizicer Dec 12, 2023
7128724
add direct mode for inscription
wizicer Dec 12, 2023
4cbf408
analyze inscription and add corresponding test case
wizicer Dec 12, 2023
f28efa4
store raw in p2 xchs analysis
wizicer Dec 13, 2023
d199627
minor updates for inscriptions
wizicer Dec 13, 2023
8dcfd32
disable repeat
wizicer Dec 13, 2023
22e446d
more control on repeat
wizicer Dec 13, 2023
355dd43
show repeat times in summary only when greater than 1
wizicer Dec 14, 2023
cee337d
modify repeat unit
wizicer Dec 14, 2023
50350fa
cli to inscribe(draft)
wizicer Dec 14, 2023
fdeaa73
make inscription compatible by removing first hint
wizicer Dec 14, 2023
475a719
update number
wizicer Dec 15, 2023
f83a39b
patch USDT price -> USD
wizicer Dec 16, 2023
1fe48c1
repeat is allowed
wizicer Dec 16, 2023
d078b85
update transfer fee
wizicer Dec 16, 2023
d99805f
repeat warning and max to 50
wizicer Dec 17, 2023
367d45b
error for coin load failure and choose from in transfer
wizicer Dec 17, 2023
aec8044
p2 analysis result with amount
wizicer Dec 21, 2023
51caf4f
better dev exp in generate coin without proper puzzle
wizicer Dec 21, 2023
dc1306d
test account enabled first wallet address for rich test
wizicer Dec 21, 2023
ce41c8b
inscription combine test works
wizicer Dec 21, 2023
57249fe
extract inscribe mint to coin service
wizicer Dec 21, 2023
ef1c392
update test case due to p2 analyzer changes
wizicer Dec 21, 2023
5c23108
fix warnings
wizicer Dec 21, 2023
5972966
allow merge coin
wizicer Dec 21, 2023
a7a14e7
await timeout to show loading animation during signing
wizicer Dec 22, 2023
768cd23
clean code: amount -> service fee
wizicer Dec 22, 2023
9ae978e
change the fee
wizicer Dec 22, 2023
c591730
combine/wrap -> merge
wizicer Dec 22, 2023
a1306c0
load/store session for inscription
wizicer Dec 22, 2023
895f88f
change the default show log for cli
wizicer Feb 13, 2024
931900c
batch convert
wizicer Feb 14, 2024
6fd1268
extract shared code for offline signing
wizicer Feb 15, 2024
212575f
allow dense option and compression in offline signing
wizicer Feb 16, 2024
fdd5092
allow coin gallery inspection and add nft+xch<->nft example
wizicer Feb 16, 2024
4704394
trim offer in offer debug panel
wizicer Feb 16, 2024
3b91b73
add xch-cns offer to coin gallery
wizicer Feb 16, 2024
df6c51b
add nft -> nft +xch offer to coin gallery
wizicer Feb 16, 2024
a4a1863
split offerentity to dedicated requesttype and offerplan
wizicer Feb 17, 2024
f076e6c
remove nft_uri/royalty in nft offer entity, and fix UI
wizicer Feb 17, 2024
3cdd6f7
update name of coin gallery
wizicer Feb 17, 2024
af6cf7b
fix offerpanel
wizicer Feb 17, 2024
feeee7f
offer plan includes royalty plan
wizicer Feb 17, 2024
6d01ffd
give error of invalid bundle in bundle panel
wizicer Feb 18, 2024
099f3e0
split bigint stringify helper function
wizicer Feb 18, 2024
bf524da
change the hint puzzle to right one in get offer summary function
wizicer Feb 18, 2024
7f07739
update debug launch path
wizicer Feb 18, 2024
30cb7ae
add compatible side effect parameter to getoffersummary function
wizicer Feb 18, 2024
c23cfb5
pass renew cns test case
wizicer Feb 19, 2024
277e55a
remove nft_detail from summary which is redundant
wizicer Feb 19, 2024
f211ef7
unify bundle combine logic, remove one legacy test case
wizicer Feb 19, 2024
0eaa88a
add "NFT + XCH -> NFT Offer Take" to gallery
wizicer Feb 19, 2024
ac1edc5
split cli app to routes
wizicer Mar 2, 2024
7420824
more precise lineage parent coin collection
wizicer Mar 2, 2024
0a4e690
if legacyNft parameter provided, renew offer would be created
wizicer Mar 3, 2024
22dbc53
add test case to cns api
wizicer Mar 3, 2024
b4d7f65
testnet10->testnet11
wizicer Mar 5, 2024
74bcb2a
clean cache when something error
wizicer Mar 9, 2024
456410d
multiple txs analysis
wizicer Mar 9, 2024
37e9cfc
fix docker build script
wizicer Mar 9, 2024
ca286ac
click to show qr code in only address mode, and also enhanced the qr …
wizicer Mar 10, 2024
1acb31e
extract get next singleton coins from get next coin name
wizicer Mar 12, 2024
489126d
show version in bundle panel
wizicer Mar 13, 2024
735dd3a
enhance diagnostic output
wizicer Mar 13, 2024
c9bb41a
minor fix: default no version for offer decoding
wizicer Mar 13, 2024
3f41189
take offer of renew cns with nextcoin field in analysis
wizicer Mar 13, 2024
9ef875a
update dist cli path
wizicer Mar 13, 2024
69a6e76
initial testnet cns changes together with renew function
wizicer Mar 14, 2024
361cd01
show renew button when renew
wizicer Mar 14, 2024
dbc7fcf
fix testnet not switching
wizicer Mar 14, 2024
178ded3
default analyze coin include next coin details
wizicer Mar 15, 2024
3812f08
update text for not open to exclude the specific length to allow serv…
wizicer Mar 15, 2024
abf7b40
extend expiry date
wizicer Mar 15, 2024
7a1a368
fix: take offer in cat/xch raise error
wizicer Mar 15, 2024
f331526
persistent max address of account
wizicer Mar 15, 2024
c399432
fix nft make offer(sell nft)
wizicer Mar 15, 2024
68b0681
deal with testnet when generate cns bundle
wizicer Mar 20, 2024
53b2ccf
fix p2owner is empty for settlement_payments_v1
wizicer Apr 1, 2024
a42e0e2
update clvm script detection
wizicer Apr 6, 2024
ca3d9d9
allow cns to update metadata
wizicer Apr 6, 2024
2d4e770
fix when cns metadata contain empty string
wizicer Apr 6, 2024
130a7f1
show min length according to response
wizicer Apr 7, 2024
67dfdfb
constraint reg year
wizicer Apr 7, 2024
8f17bd2
show reg year
wizicer Apr 7, 2024
a7a4746
extend valid date
wizicer Apr 7, 2024
ca5806e
fix cns mainnet api address
wizicer Apr 13, 2024
4ddfaf3
check for renew in take offer (avoid incorrectly check the request cns)
wizicer Apr 14, 2024
dbd7dad
fix when new cns is registering
wizicer Apr 15, 2024
5ded61b
make testnet verified special badge when take offer
wizicer Apr 15, 2024
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
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
38 changes: 38 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
root: true,
env: {
node: true,
es6: true,
browser: true,
},
extends: [
"plugin:vue/essential",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint",
],
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
sourceType: "module",
},
rules: {
"no-console": "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"vue/valid-v-if": "off",
"valid-v-if": "off",
// note you must disable the base rule
// as it can report incorrect errors
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
},
};
2 changes: 1 addition & 1 deletion .github/workflows/build-pawket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Install Dependencies
run: |
sed -i 's/0.0.0.0/${VERSION}/' packages/pawket/.env.production
sed -i "s/0.0.0.0/${VERSION}/" ui/.env.production
- name: Build pawket
run: |
yarn build:pawket
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-chia-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
branches:
- master
paths:
- "pawket-chia-lib/**"
- "lib-chia/**"
- ".github/workflows/**"
pull_request:
branches:
- master
paths:
- "pawket-chia-lib/**"
- "lib-chia/**"
- ".github/workflows/**"

jobs:
Expand All @@ -33,4 +33,4 @@ jobs:

- name: Test
run: |
yarn test:chia
yarn test:lib
4 changes: 2 additions & 2 deletions .github/workflows/ci-pawket-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
branches:
- master
paths:
- "pawket/**"
- "ui/**"
- ".github/workflows/**"
pull_request:
branches:
- master
paths:
- "pawket/**"
- "ui/**"
- ".github/workflows/**"

jobs:
Expand Down
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"endOfLine": "auto",
"printWidth": 130
}
78 changes: 39 additions & 39 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "Debug Server Jest script",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}/cli",
"port": 9229
},
{
"type": "node",
"name": "Debug Jest script",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--coverage=false",
// "-t",
// "Multi Cat Coin",
// "catTransfer",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}",
"port": 9229
}
]
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "Debug Server Jest script",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}/cli",
"port": 9229
},
{
"type": "node",
"name": "Debug Jest script",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--coverage=false",
// "-t",
// "Multi Cat Coin",
// "catTransfer",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}/lib-chia",
"port": 9229
}
]
}
21 changes: 4 additions & 17 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
{
"eslint.enable": true,
"eslint.packageManager": "yarn",
"eslint.validate": [
"vue",
"ts"
],
"vetur.validation.template": false,
"vetur.validation.script": true,
"vetur.validation.style": false,
"typescript.validate.enable": true,
"javascript.validate.enable": true,
"prettier.printWidth": 130,
"vetur.format.defaultFormatter.ts": "vscode-typescript",
"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"prettier": {
"printWidth": 130
}
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand All @@ -35,9 +21,10 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.associations": {
"*.clvm": "lisp"
"*.clvm": "lisp",
"**/test/**/*.test.data.ts": "plaintext",
}
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ yarn install
### Compiles and hot-reloads for development

```sh
yarn serve # for Pawket
yarn serve:mixch # for Mixch
yarn serve:ext # for Extension
yarn serve:server # for Wallet CLI RPC API
yarn dev # for Pawket
yarn dev:mixch # for Mixch
yarn dev:ext # for Extension
yarn dev:server # for Wallet CLI RPC API
```

### Compiles and minifies for production
Expand Down
18 changes: 14 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pool:
vmImage: 'ubuntu-latest'

variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
webArtifactName: chia-wallet
extArtifactName: chia-wallet-ext
mixchArtifactName: chia-mixch
Expand All @@ -35,17 +36,26 @@ stages:
versionSpec: '16.x'
displayName: 'Install Node.js'

- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
yarn
path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages

- task: CmdLine@2
inputs:
workingDirectory: '$(Build.SourcesDirectory)'
script: 'yarn'
script: 'yarn --frozen-lockfile'
displayName: 'yarn'

- task: CmdLine@2
inputs:
workingDirectory: '$(Build.SourcesDirectory)'
script: |
sed -i 's/0.0.0.0/$(versionNumber)/' .env.production
sed -i 's/0.0.0.0/$(versionNumber)/' ui/.env.production
displayName: 'set version'

- task: CmdLine@2
Expand Down Expand Up @@ -81,7 +91,7 @@ stages:
- task: CmdLine@2
inputs:
workingDirectory: '$(Build.SourcesDirectory)'
script: 'echo $(versionNumber)>$(Build.SourcesDirectory)/dist/cli/version.txt'
script: 'echo $(versionNumber)>$(Build.SourcesDirectory)/cli/dist/cli/version.txt'
displayName: 'write version file(cli)'

- task: PublishBuildArtifacts@1
Expand All @@ -104,7 +114,7 @@ stages:

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/dist/cli'
PathtoPublish: '$(Build.SourcesDirectory)/cli/dist/cli'
ArtifactName: '$(cliArtifactName)'
publishLocation: 'Container'

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/.env → cli/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SHOW_LOG=
SHOW_LOG=true
SERVER_PORT=3030
MAX_THREAD=1
1 change: 1 addition & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
File renamed without changes.
37 changes: 37 additions & 0 deletions cli/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import "dotenv/config";
import express from "express";
import { Instance } from "../lib-chia/services/util/instance";
import fetch from "cross-fetch";
import { parseBlockFunc, parsePuzzleFunc, parseTxFunc, parseTxsFunc } from "./route/parse";
import { getBatchSendFunc } from "./route/send";
import { getCreateCnsOfferFunc } from "./route/cns";
import { puzzleFunc } from "./route/puzzle";
import { getInscribeMintFunc } from "./route/inscription";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
(BigInt.prototype as any).toJSON = function () {
return this.toString();
};
global.fetch = fetch;
const app: express.Express = express();
app.use(express.json({ limit: "3mb" }));
app.use(express.urlencoded({ extended: true }));
const defaultRpcUrl = "https://walletapi.chiabee.net/";

Instance.init().then(() => {
app.get("/version", async (_req: express.Request, res: express.Response) => {
res.send(JSON.stringify({ version: "0.1" }));
});

app.post("/parse_block", parseBlockFunc);
app.post("/parse_puzzle", parsePuzzleFunc);
app.post("/analyze_tx", parseTxFunc);
app.post("/analyze_txs", parseTxsFunc);

app.post("/batch_send", getBatchSendFunc({ defaultRpcUrl }));
app.post("/cns_offer", getCreateCnsOfferFunc({ defaultRpcUrl }));
app.post("/puzzle", puzzleFunc);
app.post("/inscribe_mint", getInscribeMintFunc({ defaultRpcUrl }));
});

export default app;
10 changes: 5 additions & 5 deletions packages/cli/brun.ts → cli/brun.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { readFileSync, writeFileSync } from 'fs';
import puzzle from '../pawket-chia-lib/services/crypto/puzzle';
import { Instance } from "../pawket-chia-lib/services/util/instance";
import { readFileSync, writeFileSync } from "fs";
import puzzle from "../lib-chia/services/crypto/puzzle";
import { Instance } from "../lib-chia/services/util/instance";

const args = process.argv.slice(2);

Instance.init().then(async () => {
const filename = args[0];
const clvm = readFileSync(filename, 'utf-8');
const clvm = readFileSync(filename, "utf-8");
const compiled = await puzzle.compileRun(clvm);
const hex = await puzzle.encodePuzzle(compiled);
const hash = await puzzle.getPuzzleHashFromPuzzle(compiled);
writeFileSync(filename + ".hex", hex);
writeFileSync(filename + ".hex.sha256tree", hash);
});
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 9 additions & 10 deletions packages/cli/compile.ts → cli/compile.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readdirSync, readFileSync, writeFileSync } from 'fs';
import puzzle from '../pawket-chia-lib/services/crypto/puzzle';
import { Instance } from "../pawket-chia-lib/services/util/instance";
import { sha256tree } from 'clvm_tools';
import { sexpAssemble } from '../pawket-chia-lib/services/coin/analyzer';
import { readdirSync, readFileSync, writeFileSync } from "fs";
import puzzle from "../lib-chia/services/crypto/puzzle";
import { Instance } from "../lib-chia/services/util/instance";
import { sha256tree } from "clvm_tools";
import { sexpAssemble } from "../lib-chia/services/coin/analyzer";

const suffix = ".clvm";

Expand All @@ -12,7 +12,7 @@ Instance.init().then(async () => {
for (let i = 0; i < filenames.length; i++) {
const filename = filenames[i];
if (!filename.endsWith(suffix)) continue;
const content = readFileSync(dirname + filename, 'utf-8');
const content = readFileSync(dirname + filename, "utf-8");
if (content.indexOf("unknown operator") >= 0) continue;

try {
Expand All @@ -24,12 +24,11 @@ Instance.init().then(async () => {

writeFileSync(dirname + filename + ".hex", hex);
writeFileSync(dirname + filename + ".hex.sha256tree", hash);
}
catch (err) {
} catch (err) {
console.warn(`File ${filename} cannot be parsed! err:`, err);
}
};
}
};

await compile("clvm/");
});
});
File renamed without changes.
Loading
Loading