diff --git a/CHANGELOG.md b/CHANGELOG.md index db15aeed..bc79ed85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.109.4](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.3...v0.109.4) (2024-11-15) + + +### Bug Fixes + +* commonjs support ([#639](https://github.com/ckb-js/ckb-sdk-js/issues/639)) ([b229d4e](https://github.com/ckb-js/ckb-sdk-js/commit/b229d4ede84e34820d236ccf22af9e24dd518c19)) +* fix data2 validation in 'isPayloadValid' method ([#648](https://github.com/ckb-js/ckb-sdk-js/issues/648)) ([8b7dcb6](https://github.com/ckb-js/ckb-sdk-js/commit/8b7dcb6bb42124989284f66ab9fa4a96cce3d0b2)) + + + + + ## [0.109.3](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.2...v0.109.3) (2024-08-01) diff --git a/README.md b/README.md index 2a6189f9..e740319c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -⚠️ **This SDK is obsolete and maintained passively. Please check [Lumos](https://github.com/ckb-js/lumos/) which is updated actively.** +⚠️ **This SDK is obsolete and maintained passively.** + +## Recommended SDK: CCC + +It’s highly recommended to use the [CCC SDK](https://github.com/ckb-ecofund/ccc) as your primary development tool within the CKB ecosystem. [CCC](https://github.com/ckb-ecofund/ccc) is the latest and most robust JavaScript SDK designed to streamline and enhance your development process. By choosing [CCC](https://github.com/ckb-ecofund/ccc), you'll be leveraging the best practices and most up-to-date features available for CKB development. + +To get started with [CCC](https://github.com/ckb-ecofund/ccc), follow the [installation guide](https://github.com/ckb-ecofund/ccc#installing) and explore the [documentation](https://docs.ckbccc.com/) to integrate it seamlessly into your projects. --- diff --git a/lerna.json b/lerna.json index a6231866..7f487af8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,3 +1,3 @@ { - "version": "0.109.3" + "version": "0.109.4" } diff --git a/package-lock.json b/package-lock.json index 6aee27aa..47ffbc29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2893,10 +2893,9 @@ "license": "ISC" }, "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "license": "MIT", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.0.tgz", + "integrity": "sha512-dpwoQcLc/2WLQvJvLRHKZ+f9FgOdjnq11rurqwekGQygGPsYSK29OMMD2WalatiqQ+XGFDglTNixpPfI+lpaAA==", "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -8173,12 +8172,12 @@ }, "packages/ckb-sdk-core": { "name": "@nervosnetwork/ckb-sdk-core", - "version": "0.109.2-alpha.1", + "version": "0.109.3", "license": "MIT", "dependencies": { - "@nervosnetwork/ckb-sdk-rpc": "0.109.2-alpha.1", - "@nervosnetwork/ckb-sdk-utils": "0.109.2-alpha.1", - "@nervosnetwork/ckb-types": "0.109.2-alpha.1", + "@nervosnetwork/ckb-sdk-rpc": "0.109.3", + "@nervosnetwork/ckb-sdk-utils": "0.109.3", + "@nervosnetwork/ckb-types": "0.109.3", "tslib": "2.3.1" } }, @@ -8190,15 +8189,15 @@ }, "packages/ckb-sdk-rpc": { "name": "@nervosnetwork/ckb-sdk-rpc", - "version": "0.109.2-alpha.1", + "version": "0.109.3", "license": "MIT", "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "0.109.2-alpha.1", + "@nervosnetwork/ckb-sdk-utils": "0.109.3", "axios": "1.6.7", "tslib": "2.3.1" }, "devDependencies": { - "@nervosnetwork/ckb-types": "0.109.2-alpha.1" + "@nervosnetwork/ckb-types": "0.109.3" } }, "packages/ckb-sdk-rpc/node_modules/tslib": { @@ -8209,12 +8208,12 @@ }, "packages/ckb-sdk-utils": { "name": "@nervosnetwork/ckb-sdk-utils", - "version": "0.109.2-alpha.1", + "version": "0.109.3", "license": "MIT", "dependencies": { - "@nervosnetwork/ckb-types": "0.109.2-alpha.1", + "@nervosnetwork/ckb-types": "0.109.3", "bech32": "2.0.0", - "elliptic": "6.5.4", + "elliptic": "6.6.0", "jsbi": "3.1.3", "tslib": "2.3.1" }, @@ -8230,7 +8229,7 @@ }, "packages/ckb-types": { "name": "@nervosnetwork/ckb-types", - "version": "0.109.2-alpha.1", + "version": "0.109.3", "license": "MIT" } } diff --git a/packages/ckb-sdk-core/CHANGELOG.md b/packages/ckb-sdk-core/CHANGELOG.md index 22e40db6..e8786c81 100644 --- a/packages/ckb-sdk-core/CHANGELOG.md +++ b/packages/ckb-sdk-core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.109.4](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.3...v0.109.4) (2024-11-15) + +**Note:** Version bump only for package @nervosnetwork/ckb-sdk-core + + + + + ## [0.109.3](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.2...v0.109.3) (2024-08-01) diff --git a/packages/ckb-sdk-core/package.json b/packages/ckb-sdk-core/package.json index ac234645..958ec7a6 100644 --- a/packages/ckb-sdk-core/package.json +++ b/packages/ckb-sdk-core/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-sdk-core", - "version": "0.109.3", + "version": "0.109.4", "description": "JavaScript SDK for Nervos Network CKB Project", "author": "Nervos ", "homepage": "https://github.com/ckb-js/ckb-sdk-js#readme", @@ -48,10 +48,10 @@ "url": "https://github.com/ckb-js/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-rpc": "0.109.3", - "@nervosnetwork/ckb-sdk-utils": "0.109.3", - "@nervosnetwork/ckb-types": "0.109.3", + "@nervosnetwork/ckb-sdk-rpc": "0.109.4", + "@nervosnetwork/ckb-sdk-utils": "0.109.4", + "@nervosnetwork/ckb-types": "0.109.4", "tslib": "2.3.1" }, - "gitHead": "bb703e9a16b9f467a88d6a1067162d296808fbc1" + "gitHead": "969387fe6574d0130e8014332a87cd6b5e404a03" } diff --git a/packages/ckb-sdk-rpc/CHANGELOG.md b/packages/ckb-sdk-rpc/CHANGELOG.md index a3001bbd..99a0519b 100644 --- a/packages/ckb-sdk-rpc/CHANGELOG.md +++ b/packages/ckb-sdk-rpc/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.109.4](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.3...v0.109.4) (2024-11-15) + +**Note:** Version bump only for package @nervosnetwork/ckb-sdk-rpc + + + + + ## [0.109.3](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.2...v0.109.3) (2024-08-01) diff --git a/packages/ckb-sdk-rpc/package.json b/packages/ckb-sdk-rpc/package.json index be01da00..d1af3f2b 100644 --- a/packages/ckb-sdk-rpc/package.json +++ b/packages/ckb-sdk-rpc/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-sdk-rpc", - "version": "0.109.3", + "version": "0.109.4", "description": "RPC module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/ckb-js/ckb-sdk-js/packages/ckb-rpc#readme", @@ -43,12 +43,12 @@ "url": "https://github.com/ckb-js/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "0.109.3", - "axios": "1.6.7", + "@nervosnetwork/ckb-sdk-utils": "0.109.4", + "axios": "1.7.4", "tslib": "2.3.1" }, "devDependencies": { - "@nervosnetwork/ckb-types": "0.109.3" + "@nervosnetwork/ckb-types": "0.109.4" }, - "gitHead": "bb703e9a16b9f467a88d6a1067162d296808fbc1" + "gitHead": "969387fe6574d0130e8014332a87cd6b5e404a03" } diff --git a/packages/ckb-sdk-utils/CHANGELOG.md b/packages/ckb-sdk-utils/CHANGELOG.md index 0f8be7b6..fb0decb6 100644 --- a/packages/ckb-sdk-utils/CHANGELOG.md +++ b/packages/ckb-sdk-utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.109.4](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.3...v0.109.4) (2024-11-15) + + +### Bug Fixes + +* fix data2 validation in 'isPayloadValid' method ([#648](https://github.com/ckb-js/ckb-sdk-js/issues/648)) ([8b7dcb6](https://github.com/ckb-js/ckb-sdk-js/commit/8b7dcb6bb42124989284f66ab9fa4a96cce3d0b2)) + + + + + ## [0.109.3](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.2...v0.109.3) (2024-08-01) diff --git a/packages/ckb-sdk-utils/__tests__/address/fixtures.json b/packages/ckb-sdk-utils/__tests__/address/fixtures.json index 71b7016d..6378e6a3 100644 --- a/packages/ckb-sdk-utils/__tests__/address/fixtures.json +++ b/packages/ckb-sdk-utils/__tests__/address/fixtures.json @@ -257,6 +257,14 @@ "hashType": "data1", "args": "0xb39bbc0b3673c7d36450bc14cfcdad2d559c6c64" } + }, + "full version address identifies hash_type = data2": { + "params": ["ckt1qzn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvp9nnw7qkdnnclfkg59uzn8umtfd2kwxceqskl3c2"], + "expected": { + "codeHash": "0xa656f172b6b45c245307aeb5a7a37a176f002f6f22e92582c58bf7ba362e4176", + "hashType": "data2", + "args": "0xb39bbc0b3673c7d36450bc14cfcdad2d559c6c64" + } } }, "scriptToAddress": { @@ -302,6 +310,17 @@ ], "expected": "ckt1qzn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvq4nnw7qkdnnclfkg59uzn8umtfd2kwxceq225jvu" }, + "full version testnet address identifies hash_type = data2": { + "params": [ + { + "codeHash": "0xa656f172b6b45c245307aeb5a7a37a176f002f6f22e92582c58bf7ba362e4176", + "hashType": "data2", + "args": "0xb39bbc0b3673c7d36450bc14cfcdad2d559c6c64" + }, + false + ], + "expected": "ckt1qzn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvp9nnw7qkdnnclfkg59uzn8umtfd2kwxceqskl3c2" + }, "should throw an error when args doesn't start with 0x": { "params": [ { diff --git a/packages/ckb-sdk-utils/package.json b/packages/ckb-sdk-utils/package.json index 27b09f80..6360159f 100644 --- a/packages/ckb-sdk-utils/package.json +++ b/packages/ckb-sdk-utils/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-sdk-utils", - "version": "0.109.3", + "version": "0.109.4", "description": "Utils module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/ckb-js/ckb-sdk-js#readme", @@ -41,9 +41,9 @@ "url": "https://github.com/ckb-js/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-types": "0.109.3", + "@nervosnetwork/ckb-types": "0.109.4", "bech32": "2.0.0", - "elliptic": "6.5.4", + "elliptic": "6.6.0", "jsbi": "3.1.3", "tslib": "2.3.1" }, @@ -51,5 +51,5 @@ "@types/bitcoinjs-lib": "5.0.0", "@types/elliptic": "6.4.12" }, - "gitHead": "bb703e9a16b9f467a88d6a1067162d296808fbc1" + "gitHead": "969387fe6574d0130e8014332a87cd6b5e404a03" } diff --git a/packages/ckb-sdk-utils/src/address/index.ts b/packages/ckb-sdk-utils/src/address/index.ts index f9d1f5f1..1fb48d11 100644 --- a/packages/ckb-sdk-utils/src/address/index.ts +++ b/packages/ckb-sdk-utils/src/address/index.ts @@ -259,7 +259,12 @@ const isPayloadValid = (payload: Uint8Array, bech32Type: Bech32Type) => { } const hashType = parseInt(data[32].toString(), 16) - if (hashType > 2) { + + if ( + !Object.values(AddressType) + .map(i => +i) + .includes(hashType) + ) { throw new HashTypeException(`0x${hashType.toString(16)}`) } diff --git a/packages/ckb-types/CHANGELOG.md b/packages/ckb-types/CHANGELOG.md index e0d919a3..f0a0d21a 100644 --- a/packages/ckb-types/CHANGELOG.md +++ b/packages/ckb-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.109.4](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.3...v0.109.4) (2024-11-15) + +**Note:** Version bump only for package @nervosnetwork/ckb-types + + + + + ## [0.109.3](https://github.com/ckb-js/ckb-sdk-js/compare/v0.109.2...v0.109.3) (2024-08-01) **Note:** Version bump only for package @nervosnetwork/ckb-types diff --git a/packages/ckb-types/package.json b/packages/ckb-types/package.json index 94f8cbaf..89463c79 100644 --- a/packages/ckb-types/package.json +++ b/packages/ckb-types/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-types", - "version": "0.109.3", + "version": "0.109.4", "description": "Type module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/ckb-js/ckb-sdk-js#readme", @@ -20,5 +20,5 @@ "bugs": { "url": "https://github.com/ckb-js/ckb-sdk-js/issues" }, - "gitHead": "bb703e9a16b9f467a88d6a1067162d296808fbc1" + "gitHead": "969387fe6574d0130e8014332a87cd6b5e404a03" }