diff --git a/packages/cli/package.json b/packages/cli/package.json index d0935e6..74b4826 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -28,7 +28,7 @@ "@nestjs/common": "^10.0.0", "@nestjs/core": "^10.0.0", "@nestjs/platform-express": "^10.0.0", - "@cat-protocol/cat-smartcontracts": "0.2.1", + "@cat-protocol/cat-smartcontracts": "0.2.2", "@types/inquirer": "^8.1.3", "bigi": "^1.4.2", "bip32": "^4.0.0", diff --git a/packages/smartcontracts/package.json b/packages/smartcontracts/package.json index 79aea5c..9723913 100644 --- a/packages/smartcontracts/package.json +++ b/packages/smartcontracts/package.json @@ -1,6 +1,6 @@ { "name": "@cat-protocol/cat-smartcontracts", - "version": "0.2.1", + "version": "0.2.2", "description": "CAT protocol smart contracts.", "author": "", "main": "./dist/index.js", @@ -40,7 +40,7 @@ "ecpair": "^2.1.0", "ecurve": "^1.0.6", "js-sha256": "^0.9.0", - "scrypt-ts": "1.4.0", + "scrypt-ts": "^1.4.1", "varuint-bitcoin": "=1.1.2" }, "devDependencies": { diff --git a/packages/smartcontracts/src/contracts/nft/nftOpenMinterProto.ts b/packages/smartcontracts/src/contracts/nft/nftOpenMinterProto.ts index 7ec2db9..1ffdf94 100644 --- a/packages/smartcontracts/src/contracts/nft/nftOpenMinterProto.ts +++ b/packages/smartcontracts/src/contracts/nft/nftOpenMinterProto.ts @@ -3,6 +3,7 @@ import { hash160, int2ByteString, method, + Ripemd160, SmartContractLib, toByteString, } from 'scrypt-ts' @@ -97,7 +98,13 @@ export class NftOpenMinterMerkleTreeData { return this.hashNodes[this.hashNodes.length - 1][0] } - getMerklePath(leafIndex: number) { + getMerklePath(leafIndex: number): { + leaf: Ripemd160, + leafNode: NftMerkleLeaf, + neighbor: string[], + neighborType: boolean[], + merkleRoot: string, + } { const leafNode = this.leafArray[leafIndex] let prevHash = this.hashNodes[0] const neighbor: string[] = [] diff --git a/packages/tracker/package.json b/packages/tracker/package.json index 8ebbed1..bccb7db 100644 --- a/packages/tracker/package.json +++ b/packages/tracker/package.json @@ -34,7 +34,7 @@ }, "dependencies": { "@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3", - "@cat-protocol/cat-smartcontracts": "0.2.1", + "@cat-protocol/cat-smartcontracts": "0.2.2", "@nestjs/common": "^10.0.0", "@nestjs/config": "^3.2.3", "@nestjs/core": "^10.0.0", diff --git a/yarn.lock b/yarn.lock index 3c8d7ef..4b521be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1226,6 +1226,22 @@ inherits "2.0.3" unorm "1.4.1" +"@scrypt-inc/bsv@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@scrypt-inc/bsv/-/bsv-1.0.2.tgz#af6b9c069575af83fb76f56bcf36deb39f2e3c20" + integrity sha512-uegmZ6PieSoiQEjSysidII4z+JZKmJTh3K8P+KYvfstrH0mCzJOvsZXZllhYpwL0F3SfWhDvZ18PVQ3I18Gbmw== + dependencies: + aes-js "^3.1.2" + assert "^2.1.0" + bn.js "=4.11.9" + bs58 "=4.0.1" + buffer "^6.0.3" + clone-deep "^4.0.1" + elliptic "6.5.4" + hash.js "^1.1.7" + inherits "2.0.3" + unorm "1.4.1" + "@scure/base@^1.1.1", "@scure/base@^1.1.5": version "1.1.7" resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz" @@ -7084,17 +7100,17 @@ scrypt-ts-transpiler@^1.2.26: ts-patch "=3.0.1" typescript "~5.3.0" -scrypt-ts@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/scrypt-ts/-/scrypt-ts-1.4.0.tgz#d72b9aa4e28ba16d2b33e58e93c503f10d97f448" - integrity sha512-mmdnJ0zDopUo44sfXbgUOlxBF1mXNJhL8lyTy77GgC/rez85vS1nzeLf9SuKe9/BZJDM/vu7rIu08mpMkS/8ag== +scrypt-ts@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/scrypt-ts/-/scrypt-ts-1.4.1.tgz#6fd969a7beb34f67671c67b680e9c2ec59aab52a" + integrity sha512-xiHw5rT7lyi3zkwpQ/CTNHkWvmMmoZrtTGutpEqdfIuscAFh6DEHH+QBd7fK1nUD1L0Q1vIcNmMKy3Gl+l+93Q== dependencies: deep-equal "^2.2.0" fast-diff "^1.2.0" lodash "^4.17.21" object-hash "^3.0.0" reflect-metadata "^0.1.13" - scryptlib "^2.2.0" + scryptlib "^2.2.2" socket.io-client "^4.6.1" superagent "^8.0.9" @@ -7118,6 +7134,26 @@ scryptlib@^2.2.0, scryptlib@~2.2.1: rimraf "^3.0.2" yargs "^17.6.2" +scryptlib@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/scryptlib/-/scryptlib-2.2.2.tgz#7f47ddfe0a1379897631f38243fb414a680d451e" + integrity sha512-pvckNQYy4dXum8U2jFKL4XAtyeBWmjwY1BqV3lAaDT9mCy0kgCpyWokEGoCyfXDYji1tA8HvctYDz37tLdjq0A== + dependencies: + "@discoveryjs/json-ext" "^0.5.7" + "@jridgewell/sourcemap-codec" "^1.4.15" + "@scrypt-inc/bsv" "^1.0.2" + chalk "2.4.2" + compare-versions "^3.6.0" + find-node-modules "^2.1.3" + get-proxy-settings "^0.1.13" + glob "^7.2.3" + https-proxy-agent "^7.0.2" + json-bigint "^1.0.0" + node-fetch "^3.0.0" + patch-package "^6.4.7" + rimraf "^3.0.2" + yargs "^17.6.2" + semver-diff@^3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz"