@ckb-ccc/lumos-patches 0.0.12-alpha.6 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +5 -5
- package/dist/default.d.ts +6 -4
- package/dist/default.d.ts.map +1 -1
- package/dist/default.js +13 -12
- package/dist/utils.d.ts +4 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -2
- package/dist.commonjs/default.d.ts +6 -4
- package/dist.commonjs/default.d.ts.map +1 -1
- package/dist.commonjs/default.js +13 -12
- package/dist.commonjs/utils.d.ts +4 -2
- package/dist.commonjs/utils.d.ts.map +1 -1
- package/dist.commonjs/utils.js +4 -2
- package/package.json +9 -10
- package/src/default.ts +13 -12
- package/src/utils.ts +4 -2
- package/typedoc.json +6 -0
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="https://ckbccc
|
|
2
|
+
<a href="https://app.ckbccc.com/">
|
|
3
3
|
<img alt="Logo" src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/logo.svg" width="20%" />
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/ckb-ecofund/ccc" />
|
|
16
16
|
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/ckb-ecofund/ccc/master" />
|
|
17
17
|
<img alt="GitHub deployments" src="https://img.shields.io/github/deployments/ckb-ecofund/ccc/production" />
|
|
18
|
-
<a href="https://ckbccc
|
|
18
|
+
<a href="https://app.ckbccc.com/"><img
|
|
19
19
|
alt="Demo" src="https://img.shields.io/website?url=https%3A%2F%2Fckbccc-demo.vercel.app%2F&label=Demo"
|
|
20
20
|
/></a>
|
|
21
21
|
</p>
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
## Preview
|
|
34
34
|
|
|
35
35
|
<p align="center">
|
|
36
|
-
<a href="https://ckbccc
|
|
36
|
+
<a href="https://app.ckbccc.com/">
|
|
37
37
|
<img src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/preview.png" width="30%" />
|
|
38
38
|
</a>
|
|
39
39
|
</p>
|
|
40
40
|
|
|
41
|
-
This project is still under active development, and we are looking forward to your feedback. [Try its demo now here](https://ckbccc
|
|
41
|
+
This project is still under active development, and we are looking forward to your feedback. [Try its demo now here](https://app.ckbccc.com/). It showcases how to use CCC for some basic scenarios in CKB.
|
|
42
42
|
|
|
43
43
|
<h3 align="center">
|
|
44
|
-
Read more about CCC on
|
|
44
|
+
Read more about CCC on <a href="https://docs.ckbccc.com">our website</a> or <a href="https://github.com/ckb-ecofund/ccc">GitHub Repo</a>.
|
|
45
45
|
</h3>
|
package/dist/default.d.ts
CHANGED
|
@@ -2,14 +2,16 @@ import { ccc } from "@ckb-ccc/core";
|
|
|
2
2
|
import { LockScriptInfo } from "@ckb-lumos/common-scripts";
|
|
3
3
|
/**
|
|
4
4
|
* Generates custom lock script information.
|
|
5
|
-
* @
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
5
|
+
* @public
|
|
6
|
+
*
|
|
7
|
+
* @param codeHash - The code hash of the custom script.
|
|
8
|
+
* @param cellDeps - The cell dependencies for the custom script.
|
|
9
|
+
* @returns The lock script information.
|
|
8
10
|
*/
|
|
9
11
|
export declare function generateScriptInfo(codeHash: string, cellDeps: ccc.CellDepInfoLike[], dummyLockLength: number): LockScriptInfo;
|
|
10
12
|
/**
|
|
11
13
|
* Generates default script information for CCC.
|
|
12
|
-
* @returns
|
|
14
|
+
* @returns An array of lock script information.
|
|
13
15
|
*/
|
|
14
16
|
export declare function generateDefaultScriptInfos(): LockScriptInfo[];
|
|
15
17
|
//# sourceMappingURL=default.d.ts.map
|
package/dist/default.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../src/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAWpC,OAAO,EAEL,cAAc,EAEf,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../src/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAWpC,OAAO,EAEL,cAAc,EAEf,MAAM,2BAA2B,CAAC;AAoGnC;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,GAAG,CAAC,eAAe,EAAE,EAC/B,eAAe,EAAE,MAAM,GACtB,cAAc,CAmGhB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,cAAc,EAAE,CAwB7D"}
|
package/dist/default.js
CHANGED
|
@@ -21,22 +21,21 @@ function addCellDep(txSkeleton, newCellDep) {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Generates a class for collecting custom script cells.
|
|
24
|
-
* @param
|
|
25
|
-
* @returns
|
|
24
|
+
* @param codeHash - The code hash of the custom script.
|
|
25
|
+
* @returns The CustomCellCollector class.
|
|
26
26
|
*/
|
|
27
27
|
function generateCollectorClass(codeHash) {
|
|
28
28
|
/**
|
|
29
29
|
* Class representing a collector for custom script cells.
|
|
30
|
-
* @class
|
|
31
30
|
*/
|
|
32
31
|
return class CustomCellCollector {
|
|
33
32
|
/**
|
|
34
33
|
* Creates an instance of CustomCollector.
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
34
|
+
* @param fromInfo - The information about the address to collect cells from.
|
|
35
|
+
* @param cellProvider - The provider to collect cells from.
|
|
36
|
+
* @param options - The options for the collector.
|
|
37
|
+
* @param] - The query options for collecting cells.
|
|
38
|
+
* @param [options.config=getConfig()] - The Lumos configuration.
|
|
40
39
|
* @throws {Error} If cellProvider is not provided or fromInfo is not a string.
|
|
41
40
|
*/
|
|
42
41
|
constructor(fromInfo, cellProvider, { queryOptions = {}, config = getConfig(), }) {
|
|
@@ -75,9 +74,11 @@ function generateCollectorClass(codeHash) {
|
|
|
75
74
|
}
|
|
76
75
|
/**
|
|
77
76
|
* Generates custom lock script information.
|
|
78
|
-
* @
|
|
79
|
-
*
|
|
80
|
-
* @
|
|
77
|
+
* @public
|
|
78
|
+
*
|
|
79
|
+
* @param codeHash - The code hash of the custom script.
|
|
80
|
+
* @param cellDeps - The cell dependencies for the custom script.
|
|
81
|
+
* @returns The lock script information.
|
|
81
82
|
*/
|
|
82
83
|
export function generateScriptInfo(codeHash, cellDeps, dummyLockLength) {
|
|
83
84
|
return {
|
|
@@ -150,7 +151,7 @@ export function generateScriptInfo(codeHash, cellDeps, dummyLockLength) {
|
|
|
150
151
|
}
|
|
151
152
|
/**
|
|
152
153
|
* Generates default script information for CCC.
|
|
153
|
-
* @returns
|
|
154
|
+
* @returns An array of lock script information.
|
|
154
155
|
*/
|
|
155
156
|
export function generateDefaultScriptInfos() {
|
|
156
157
|
const mainnet = cccA.MAINNET_SCRIPTS;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Asserts that a condition is true, throwing an error if it is not.
|
|
3
|
-
* @
|
|
4
|
-
*
|
|
3
|
+
* @public
|
|
4
|
+
*
|
|
5
|
+
* @param condition - The condition to assert.
|
|
6
|
+
* @param [message="Assert failed"] - The error message to throw if the condition is false.
|
|
5
7
|
* @throws {Error} If the condition is false.
|
|
6
8
|
*/
|
|
7
9
|
export declare function asserts(condition: unknown, message?: string): asserts condition;
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,SAAS,EAAE,OAAO,EAClB,OAAO,SAAkB,GACxB,OAAO,CAAC,SAAS,CAInB"}
|
package/dist/utils.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Asserts that a condition is true, throwing an error if it is not.
|
|
3
|
-
* @
|
|
4
|
-
*
|
|
3
|
+
* @public
|
|
4
|
+
*
|
|
5
|
+
* @param condition - The condition to assert.
|
|
6
|
+
* @param [message="Assert failed"] - The error message to throw if the condition is false.
|
|
5
7
|
* @throws {Error} If the condition is false.
|
|
6
8
|
*/
|
|
7
9
|
export function asserts(condition, message = "Assert failed") {
|
|
@@ -2,14 +2,16 @@ import { ccc } from "@ckb-ccc/core";
|
|
|
2
2
|
import { LockScriptInfo } from "@ckb-lumos/common-scripts";
|
|
3
3
|
/**
|
|
4
4
|
* Generates custom lock script information.
|
|
5
|
-
* @
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
5
|
+
* @public
|
|
6
|
+
*
|
|
7
|
+
* @param codeHash - The code hash of the custom script.
|
|
8
|
+
* @param cellDeps - The cell dependencies for the custom script.
|
|
9
|
+
* @returns The lock script information.
|
|
8
10
|
*/
|
|
9
11
|
export declare function generateScriptInfo(codeHash: string, cellDeps: ccc.CellDepInfoLike[], dummyLockLength: number): LockScriptInfo;
|
|
10
12
|
/**
|
|
11
13
|
* Generates default script information for CCC.
|
|
12
|
-
* @returns
|
|
14
|
+
* @returns An array of lock script information.
|
|
13
15
|
*/
|
|
14
16
|
export declare function generateDefaultScriptInfos(): LockScriptInfo[];
|
|
15
17
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../src/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAWpC,OAAO,EAEL,cAAc,EAEf,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../src/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAWpC,OAAO,EAEL,cAAc,EAEf,MAAM,2BAA2B,CAAC;AAoGnC;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,GAAG,CAAC,eAAe,EAAE,EAC/B,eAAe,EAAE,MAAM,GACtB,cAAc,CAmGhB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,cAAc,EAAE,CAwB7D"}
|
package/dist.commonjs/default.js
CHANGED
|
@@ -24,22 +24,21 @@ function addCellDep(txSkeleton, newCellDep) {
|
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Generates a class for collecting custom script cells.
|
|
27
|
-
* @param
|
|
28
|
-
* @returns
|
|
27
|
+
* @param codeHash - The code hash of the custom script.
|
|
28
|
+
* @returns The CustomCellCollector class.
|
|
29
29
|
*/
|
|
30
30
|
function generateCollectorClass(codeHash) {
|
|
31
31
|
/**
|
|
32
32
|
* Class representing a collector for custom script cells.
|
|
33
|
-
* @class
|
|
34
33
|
*/
|
|
35
34
|
return class CustomCellCollector {
|
|
36
35
|
/**
|
|
37
36
|
* Creates an instance of CustomCollector.
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
37
|
+
* @param fromInfo - The information about the address to collect cells from.
|
|
38
|
+
* @param cellProvider - The provider to collect cells from.
|
|
39
|
+
* @param options - The options for the collector.
|
|
40
|
+
* @param] - The query options for collecting cells.
|
|
41
|
+
* @param [options.config=getConfig()] - The Lumos configuration.
|
|
43
42
|
* @throws {Error} If cellProvider is not provided or fromInfo is not a string.
|
|
44
43
|
*/
|
|
45
44
|
constructor(fromInfo, cellProvider, { queryOptions = {}, config = (0, config_manager_1.getConfig)(), }) {
|
|
@@ -78,9 +77,11 @@ function generateCollectorClass(codeHash) {
|
|
|
78
77
|
}
|
|
79
78
|
/**
|
|
80
79
|
* Generates custom lock script information.
|
|
81
|
-
* @
|
|
82
|
-
*
|
|
83
|
-
* @
|
|
80
|
+
* @public
|
|
81
|
+
*
|
|
82
|
+
* @param codeHash - The code hash of the custom script.
|
|
83
|
+
* @param cellDeps - The cell dependencies for the custom script.
|
|
84
|
+
* @returns The lock script information.
|
|
84
85
|
*/
|
|
85
86
|
function generateScriptInfo(codeHash, cellDeps, dummyLockLength) {
|
|
86
87
|
return {
|
|
@@ -154,7 +155,7 @@ function generateScriptInfo(codeHash, cellDeps, dummyLockLength) {
|
|
|
154
155
|
exports.generateScriptInfo = generateScriptInfo;
|
|
155
156
|
/**
|
|
156
157
|
* Generates default script information for CCC.
|
|
157
|
-
* @returns
|
|
158
|
+
* @returns An array of lock script information.
|
|
158
159
|
*/
|
|
159
160
|
function generateDefaultScriptInfos() {
|
|
160
161
|
const mainnet = advanced_1.cccA.MAINNET_SCRIPTS;
|
package/dist.commonjs/utils.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Asserts that a condition is true, throwing an error if it is not.
|
|
3
|
-
* @
|
|
4
|
-
*
|
|
3
|
+
* @public
|
|
4
|
+
*
|
|
5
|
+
* @param condition - The condition to assert.
|
|
6
|
+
* @param [message="Assert failed"] - The error message to throw if the condition is false.
|
|
5
7
|
* @throws {Error} If the condition is false.
|
|
6
8
|
*/
|
|
7
9
|
export declare function asserts(condition: unknown, message?: string): asserts condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,SAAS,EAAE,OAAO,EAClB,OAAO,SAAkB,GACxB,OAAO,CAAC,SAAS,CAInB"}
|
package/dist.commonjs/utils.js
CHANGED
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.asserts = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Asserts that a condition is true, throwing an error if it is not.
|
|
6
|
-
* @
|
|
7
|
-
*
|
|
6
|
+
* @public
|
|
7
|
+
*
|
|
8
|
+
* @param condition - The condition to assert.
|
|
9
|
+
* @param [message="Assert failed"] - The error message to throw if the condition is false.
|
|
8
10
|
* @throws {Error} If the condition is false.
|
|
9
11
|
*/
|
|
10
12
|
function asserts(condition, message = "Assert failed") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/lumos-patches",
|
|
3
|
-
"version": "0.0.12
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Patches for using Lumos with CCC",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,11 +18,6 @@
|
|
|
18
18
|
"default": "./dist.commonjs/index.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .",
|
|
23
|
-
"lint": "eslint",
|
|
24
|
-
"format": "prettier --write . && eslint --fix"
|
|
25
|
-
},
|
|
26
21
|
"devDependencies": {
|
|
27
22
|
"@eslint/js": "^9.1.1",
|
|
28
23
|
"copyfiles": "^2.4.1",
|
|
@@ -39,13 +34,17 @@
|
|
|
39
34
|
"access": "public"
|
|
40
35
|
},
|
|
41
36
|
"dependencies": {
|
|
42
|
-
"@ckb-ccc/core": "0.0.12-alpha.1",
|
|
43
37
|
"@ckb-lumos/base": "^0.24.0-next.1",
|
|
44
38
|
"@ckb-lumos/codec": "^0.24.0-next.1",
|
|
45
39
|
"@ckb-lumos/common-scripts": "^0.24.0-next.1",
|
|
46
40
|
"@ckb-lumos/config-manager": "^0.24.0-next.1",
|
|
47
41
|
"@ckb-lumos/helpers": "^0.24.0-next.1",
|
|
48
|
-
"@joyid/ckb": "^1.0.1"
|
|
42
|
+
"@joyid/ckb": "^1.0.1",
|
|
43
|
+
"@ckb-ccc/core": "0.0.12"
|
|
49
44
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .",
|
|
47
|
+
"lint": "eslint",
|
|
48
|
+
"format": "prettier --write . && eslint --fix"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/default.ts
CHANGED
|
@@ -45,13 +45,12 @@ function addCellDep(
|
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Generates a class for collecting custom script cells.
|
|
48
|
-
* @param
|
|
49
|
-
* @returns
|
|
48
|
+
* @param codeHash - The code hash of the custom script.
|
|
49
|
+
* @returns The CustomCellCollector class.
|
|
50
50
|
*/
|
|
51
51
|
function generateCollectorClass(codeHash: string) {
|
|
52
52
|
/**
|
|
53
53
|
* Class representing a collector for custom script cells.
|
|
54
|
-
* @class
|
|
55
54
|
*/
|
|
56
55
|
return class CustomCellCollector {
|
|
57
56
|
readonly fromScript: Script;
|
|
@@ -59,11 +58,11 @@ function generateCollectorClass(codeHash: string) {
|
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* Creates an instance of CustomCollector.
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
61
|
+
* @param fromInfo - The information about the address to collect cells from.
|
|
62
|
+
* @param cellProvider - The provider to collect cells from.
|
|
63
|
+
* @param options - The options for the collector.
|
|
64
|
+
* @param] - The query options for collecting cells.
|
|
65
|
+
* @param [options.config=getConfig()] - The Lumos configuration.
|
|
67
66
|
* @throws {Error} If cellProvider is not provided or fromInfo is not a string.
|
|
68
67
|
*/
|
|
69
68
|
constructor(
|
|
@@ -116,9 +115,11 @@ function generateCollectorClass(codeHash: string) {
|
|
|
116
115
|
|
|
117
116
|
/**
|
|
118
117
|
* Generates custom lock script information.
|
|
119
|
-
* @
|
|
120
|
-
*
|
|
121
|
-
* @
|
|
118
|
+
* @public
|
|
119
|
+
*
|
|
120
|
+
* @param codeHash - The code hash of the custom script.
|
|
121
|
+
* @param cellDeps - The cell dependencies for the custom script.
|
|
122
|
+
* @returns The lock script information.
|
|
122
123
|
*/
|
|
123
124
|
export function generateScriptInfo(
|
|
124
125
|
codeHash: string,
|
|
@@ -227,7 +228,7 @@ export function generateScriptInfo(
|
|
|
227
228
|
|
|
228
229
|
/**
|
|
229
230
|
* Generates default script information for CCC.
|
|
230
|
-
* @returns
|
|
231
|
+
* @returns An array of lock script information.
|
|
231
232
|
*/
|
|
232
233
|
export function generateDefaultScriptInfos(): LockScriptInfo[] {
|
|
233
234
|
const mainnet = cccA.MAINNET_SCRIPTS;
|
package/src/utils.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Asserts that a condition is true, throwing an error if it is not.
|
|
3
|
-
* @
|
|
4
|
-
*
|
|
3
|
+
* @public
|
|
4
|
+
*
|
|
5
|
+
* @param condition - The condition to assert.
|
|
6
|
+
* @param [message="Assert failed"] - The error message to throw if the condition is false.
|
|
5
7
|
* @throws {Error} If the condition is false.
|
|
6
8
|
*/
|
|
7
9
|
export function asserts(
|