@offckb/cli 0.2.7 → 0.3.0-canary-cfe9b48.0
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/README.md +46 -19
- package/ckb/devnet/specs/dev.toml +7 -7
- package/dist/cfg/setting.d.ts +38 -0
- package/dist/cfg/setting.js +67 -7
- package/dist/cli.js +51 -32
- package/dist/cmd/clean.js +7 -5
- package/dist/cmd/config.d.ts +5 -3
- package/dist/cmd/config.js +39 -12
- package/dist/cmd/create.d.ts +1 -1
- package/dist/cmd/create.js +19 -8
- package/dist/cmd/debug.d.ts +13 -0
- package/dist/cmd/debug.js +100 -0
- package/dist/cmd/deploy.js +45 -25
- package/dist/cmd/deposit.js +9 -2
- package/dist/cmd/inject-config.d.ts +0 -3
- package/dist/cmd/inject-config.js +20 -80
- package/dist/cmd/list-hashes.d.ts +25 -1
- package/dist/cmd/list-hashes.js +24 -16
- package/dist/cmd/{deployed-scripts.d.ts → my-scripts.d.ts} +1 -1
- package/dist/cmd/my-scripts.js +25 -0
- package/dist/cmd/node.d.ts +5 -1
- package/dist/cmd/node.js +22 -8
- package/dist/cmd/proxy-rpc.d.ts +7 -0
- package/dist/cmd/proxy-rpc.js +23 -0
- package/dist/cmd/sync-config.js +16 -11
- package/dist/cmd/system-scripts.d.ts +42 -0
- package/dist/cmd/system-scripts.js +265 -0
- package/dist/deploy/migration.d.ts +45 -0
- package/dist/deploy/migration.js +131 -0
- package/dist/deploy/toml.d.ts +38 -0
- package/dist/deploy/toml.js +60 -0
- package/dist/deploy/util.d.ts +2 -0
- package/dist/deploy/util.js +19 -0
- package/dist/node/init-chain.js +41 -0
- package/dist/{cmd/develop → node}/install.d.ts +4 -5
- package/dist/{cmd/develop → node}/install.js +31 -31
- package/dist/scripts/gen.d.ts +5 -0
- package/dist/scripts/gen.js +69 -0
- package/dist/scripts/public.d.ts +8 -0
- package/dist/scripts/public.js +396 -0
- package/dist/scripts/type.d.ts +46 -0
- package/dist/scripts/type.js +19 -0
- package/dist/scripts/util.d.ts +3 -0
- package/dist/scripts/util.js +84 -0
- package/dist/template/config.d.ts +4 -0
- package/dist/template/config.js +60 -0
- package/dist/template/offckb.config.d.ts +69 -0
- package/dist/template/offckb.config.js +81 -0
- package/dist/{util/template.js → template/option.js} +2 -2
- package/dist/template/option.json +16 -0
- package/dist/tools/ckb-debugger.d.ts +12 -0
- package/dist/tools/ckb-debugger.js +31 -0
- package/dist/tools/ckb-tx-dumper.d.ts +6 -0
- package/dist/tools/ckb-tx-dumper.js +21 -0
- package/dist/tools/rpc-proxy.d.ts +9 -0
- package/dist/tools/rpc-proxy.js +84 -0
- package/dist/util/ckb.d.ts +3 -2
- package/dist/util/ckb.js +16 -3
- package/dist/util/encoding.d.ts +1 -0
- package/dist/util/encoding.js +7 -1
- package/dist/util/fs.d.ts +1 -2
- package/dist/util/fs.js +8 -32
- package/dist/util/git.js +19 -7
- package/dist/util/request.js +0 -1
- package/dist/util/type.d.ts +1 -0
- package/dist/util/validator.d.ts +1 -0
- package/dist/util/validator.js +13 -4
- package/package.json +6 -2
- package/dist/cfg/const.d.ts +0 -20
- package/dist/cfg/const.js +0 -51
- package/dist/cmd/deployed-scripts.js +0 -14
- package/dist/cmd/develop/build-account.d.ts +0 -1
- package/dist/cmd/develop/build-account.js +0 -9
- package/dist/cmd/develop/genkey.d.ts +0 -14
- package/dist/cmd/develop/genkey.js +0 -143
- package/dist/cmd/develop/init-chain.js +0 -76
- package/dist/cmd/develop/lumos-config.d.ts +0 -4
- package/dist/cmd/develop/lumos-config.js +0 -153
- package/dist/util/config.d.ts +0 -9
- package/dist/util/config.js +0 -136
- package/templates/config.json +0 -98
- /package/ckb/devnet/specs/{omni_lock → omnilock} +0 -0
- /package/ckb/devnet/specs/{spore-scripts → spore}/spore +0 -0
- /package/ckb/devnet/specs/{spore-scripts/cluster → spore/spore_cluster} +0 -0
- /package/ckb/devnet/specs/{spore-scripts/cluster_agent → spore/spore_cluster_agent} +0 -0
- /package/ckb/devnet/specs/{spore-scripts/cluster_proxy → spore/spore_cluster_proxy} +0 -0
- /package/ckb/devnet/specs/{spore-scripts → spore}/spore_extension_lua +0 -0
- /package/ckb/devnet/specs/{xudt_rce → xudt} +0 -0
- /package/dist/{cmd/develop → node}/init-chain.d.ts +0 -0
- /package/dist/{util/template.d.ts → template/option.d.ts} +0 -0
|
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.buildDownloadUrl = exports.getExtension = exports.getArch = exports.getOS = exports.
|
|
38
|
+
exports.buildDownloadUrl = exports.getExtension = exports.getArch = exports.getOS = exports.getVersionFromBinary = exports.decompressTarGzAsync = exports.unZipFile = exports.downloadAndSaveCKBBinary = exports.downloadCKBBinaryAndUnzip = exports.installCKBBinary = void 0;
|
|
39
39
|
const child_process_1 = require("child_process");
|
|
40
40
|
const fs = __importStar(require("fs"));
|
|
41
41
|
const path = __importStar(require("path"));
|
|
@@ -43,56 +43,60 @@ const semver_1 = __importDefault(require("semver"));
|
|
|
43
43
|
const os_1 = __importDefault(require("os"));
|
|
44
44
|
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
45
45
|
const tar = __importStar(require("tar"));
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
// Function to download and install the dependency binary
|
|
51
|
-
function installDependency() {
|
|
46
|
+
const request_1 = require("../util/request");
|
|
47
|
+
const setting_1 = require("../cfg/setting");
|
|
48
|
+
const encoding_1 = require("../util/encoding");
|
|
49
|
+
function installCKBBinary(version) {
|
|
52
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
const ckbBinPath = (0, setting_1.getCKBBinaryPath)(version);
|
|
52
|
+
const outputVersion = getVersionFromBinary(ckbBinPath);
|
|
53
|
+
if (outputVersion) {
|
|
54
|
+
if (!semver_1.default.eq(version, outputVersion)) {
|
|
55
|
+
console.log(`CKB version ${outputVersion} is not equal to the ${version}, download and install the new version ${version}..`);
|
|
57
56
|
}
|
|
58
57
|
else {
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
else {
|
|
63
|
-
console.log(
|
|
62
|
+
console.log(`CKB Binary not found, download and install the new version ${version}..`);
|
|
64
63
|
}
|
|
65
|
-
yield
|
|
64
|
+
yield downloadCKBBinaryAndUnzip(version);
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
|
-
exports.
|
|
69
|
-
function
|
|
67
|
+
exports.installCKBBinary = installCKBBinary;
|
|
68
|
+
function downloadCKBBinaryAndUnzip(version) {
|
|
70
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
70
|
const arch = getArch();
|
|
72
71
|
const osname = getOS();
|
|
73
72
|
const ext = getExtension();
|
|
74
|
-
const ckbVersionOSName = `ckb_v${
|
|
73
|
+
const ckbVersionOSName = `ckb_v${version}_${arch}-${osname}`;
|
|
75
74
|
try {
|
|
76
75
|
const tempFilePath = path.join(os_1.default.tmpdir(), `${ckbVersionOSName}.${ext}`);
|
|
77
|
-
yield downloadAndSaveCKBBinary(tempFilePath);
|
|
76
|
+
yield downloadAndSaveCKBBinary(version, tempFilePath);
|
|
78
77
|
// Unzip the file
|
|
79
|
-
const extractDir = path.join(
|
|
78
|
+
const extractDir = path.join((0, setting_1.readSettings)().bins.downloadPath, `ckb_v${version}`);
|
|
80
79
|
yield unZipFile(tempFilePath, extractDir, ext === 'tar.gz');
|
|
81
80
|
// Install the extracted files
|
|
82
81
|
const sourcePath = path.join(extractDir, ckbVersionOSName);
|
|
83
|
-
|
|
84
|
-
fs.
|
|
85
|
-
|
|
82
|
+
const targetPath = (0, setting_1.getCKBBinaryInstallPath)(version);
|
|
83
|
+
if (fs.existsSync(targetPath)) {
|
|
84
|
+
fs.rmdirSync(targetPath, { recursive: true });
|
|
85
|
+
}
|
|
86
|
+
fs.mkdirSync(targetPath, { recursive: true });
|
|
87
|
+
fs.renameSync(sourcePath, targetPath); // Move binary to desired location
|
|
88
|
+
fs.chmodSync((0, setting_1.getCKBBinaryPath)(version), '755'); // Make the binary executable
|
|
89
|
+
console.log(`CKB ${version} installed successfully.`);
|
|
86
90
|
}
|
|
87
91
|
catch (error) {
|
|
88
92
|
console.error('Error installing dependency binary:', error);
|
|
89
93
|
}
|
|
90
94
|
});
|
|
91
95
|
}
|
|
92
|
-
exports.
|
|
93
|
-
function downloadAndSaveCKBBinary(tempFilePath) {
|
|
96
|
+
exports.downloadCKBBinaryAndUnzip = downloadCKBBinaryAndUnzip;
|
|
97
|
+
function downloadAndSaveCKBBinary(version, tempFilePath) {
|
|
94
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
const downloadURL = buildDownloadUrl(
|
|
99
|
+
const downloadURL = buildDownloadUrl(version);
|
|
96
100
|
const response = yield request_1.Request.get(downloadURL, {
|
|
97
101
|
responseType: 'arraybuffer',
|
|
98
102
|
});
|
|
@@ -136,9 +140,9 @@ function decompressTarGzAsync(tarballPath, destinationDir) {
|
|
|
136
140
|
});
|
|
137
141
|
}
|
|
138
142
|
exports.decompressTarGzAsync = decompressTarGzAsync;
|
|
139
|
-
function
|
|
143
|
+
function getVersionFromBinary(binPath) {
|
|
140
144
|
try {
|
|
141
|
-
const versionOutput = (0, child_process_1.execSync)(`${
|
|
145
|
+
const versionOutput = (0, child_process_1.execSync)(`${(0, encoding_1.encodeBinPathForTerminal)(binPath)} --version`, {
|
|
142
146
|
encoding: 'utf-8',
|
|
143
147
|
});
|
|
144
148
|
const versionMatch = versionOutput.match(/(\d+\.\d+\.\d+)/);
|
|
@@ -151,11 +155,7 @@ function getInstalledVersion() {
|
|
|
151
155
|
return null;
|
|
152
156
|
}
|
|
153
157
|
}
|
|
154
|
-
exports.
|
|
155
|
-
function isVersionOutdated(installedVersion) {
|
|
156
|
-
return semver_1.default.lt(installedVersion, MINIMAL_VERSION);
|
|
157
|
-
}
|
|
158
|
-
exports.isVersionOutdated = isVersionOutdated;
|
|
158
|
+
exports.getVersionFromBinary = getVersionFromBinary;
|
|
159
159
|
function getOS() {
|
|
160
160
|
const platform = os_1.default.platform();
|
|
161
161
|
if (platform === 'darwin') {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NetworkMyScripts, NetworkSystemScripts } from './type';
|
|
2
|
+
export declare function genSystemScripts(): NetworkSystemScripts | null;
|
|
3
|
+
export declare function genSystemScriptsJsonFile(filePath: string): void;
|
|
4
|
+
export declare function genMyScripts(): NetworkMyScripts;
|
|
5
|
+
export declare function genMyScriptsJsonFile(filePath: string): void;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.genMyScriptsJsonFile = exports.genMyScripts = exports.genSystemScriptsJsonFile = exports.genSystemScripts = void 0;
|
|
30
|
+
const fs = __importStar(require("fs"));
|
|
31
|
+
const public_1 = __importDefault(require("./public"));
|
|
32
|
+
const system_scripts_1 = require("../cmd/system-scripts");
|
|
33
|
+
const path_1 = __importDefault(require("path"));
|
|
34
|
+
const type_1 = require("../util/type");
|
|
35
|
+
const util_1 = require("./util");
|
|
36
|
+
function genSystemScripts() {
|
|
37
|
+
const devnetScripts = (0, system_scripts_1.getSystemScriptsFromListHashes)();
|
|
38
|
+
if (devnetScripts != null) {
|
|
39
|
+
const networkScripts = {
|
|
40
|
+
devnet: devnetScripts,
|
|
41
|
+
testnet: public_1.default.testnet,
|
|
42
|
+
mainnet: public_1.default.mainnet,
|
|
43
|
+
};
|
|
44
|
+
return networkScripts;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
exports.genSystemScripts = genSystemScripts;
|
|
49
|
+
function genSystemScriptsJsonFile(filePath) {
|
|
50
|
+
const scripts = genSystemScripts();
|
|
51
|
+
fs.mkdirSync(path_1.default.dirname(filePath), { recursive: true });
|
|
52
|
+
fs.writeFileSync(filePath, JSON.stringify(scripts, null, 2));
|
|
53
|
+
}
|
|
54
|
+
exports.genSystemScriptsJsonFile = genSystemScriptsJsonFile;
|
|
55
|
+
function genMyScripts() {
|
|
56
|
+
const networkMyScripts = {
|
|
57
|
+
devnet: (0, util_1.readUserDeployedScriptsInfo)(type_1.Network.devnet),
|
|
58
|
+
testnet: (0, util_1.readUserDeployedScriptsInfo)(type_1.Network.testnet),
|
|
59
|
+
mainnet: (0, util_1.readUserDeployedScriptsInfo)(type_1.Network.mainnet),
|
|
60
|
+
};
|
|
61
|
+
return networkMyScripts;
|
|
62
|
+
}
|
|
63
|
+
exports.genMyScripts = genMyScripts;
|
|
64
|
+
function genMyScriptsJsonFile(filePath) {
|
|
65
|
+
const scripts = genMyScripts();
|
|
66
|
+
fs.mkdirSync(path_1.default.dirname(filePath), { recursive: true });
|
|
67
|
+
fs.writeFileSync(filePath, JSON.stringify(scripts, null, 2));
|
|
68
|
+
}
|
|
69
|
+
exports.genMyScriptsJsonFile = genMyScriptsJsonFile;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SystemScriptsRecord } from './type';
|
|
2
|
+
export declare const TESTNET_SYSTEM_SCRIPTS: SystemScriptsRecord;
|
|
3
|
+
export declare const MAINNET_SYSTEM_SCRIPTS: SystemScriptsRecord;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
testnet: SystemScriptsRecord;
|
|
6
|
+
mainnet: SystemScriptsRecord;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAINNET_SYSTEM_SCRIPTS = exports.TESTNET_SYSTEM_SCRIPTS = void 0;
|
|
4
|
+
// spore: https://github.com/sporeprotocol/spore-contract/blob/master/docs/VERSIONS.md
|
|
5
|
+
exports.TESTNET_SYSTEM_SCRIPTS = {
|
|
6
|
+
secp256k1_blake160_sighash_all: {
|
|
7
|
+
name: 'secp256k1_blake160_sighash_all',
|
|
8
|
+
script: {
|
|
9
|
+
codeHash: '0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8',
|
|
10
|
+
hashType: 'type',
|
|
11
|
+
cellDeps: [
|
|
12
|
+
{
|
|
13
|
+
cellDep: {
|
|
14
|
+
outPoint: {
|
|
15
|
+
txHash: '0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37',
|
|
16
|
+
index: 0,
|
|
17
|
+
},
|
|
18
|
+
depType: 'depGroup',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
dao: {
|
|
25
|
+
name: 'dao',
|
|
26
|
+
script: {
|
|
27
|
+
codeHash: '0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e',
|
|
28
|
+
hashType: 'type',
|
|
29
|
+
cellDeps: [
|
|
30
|
+
{
|
|
31
|
+
cellDep: {
|
|
32
|
+
outPoint: {
|
|
33
|
+
txHash: '0x8f8c79eb6671709633fe6a46de93c0fedc9c1b8a6527a18d3983879542635c9f',
|
|
34
|
+
index: 2,
|
|
35
|
+
},
|
|
36
|
+
depType: 'code',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
secp256k1_blake160_multisig_all: {
|
|
43
|
+
name: 'secp256k1_blake160_multisig_all',
|
|
44
|
+
file: 'Bundled(specs/cells/secp256k1_blake160_multisig_all)',
|
|
45
|
+
script: {
|
|
46
|
+
codeHash: '0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8',
|
|
47
|
+
hashType: 'type',
|
|
48
|
+
cellDeps: [
|
|
49
|
+
{
|
|
50
|
+
cellDep: {
|
|
51
|
+
outPoint: {
|
|
52
|
+
txHash: '0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37',
|
|
53
|
+
index: 1,
|
|
54
|
+
},
|
|
55
|
+
depType: 'depGroup',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
sudt: {
|
|
62
|
+
name: 'sudt',
|
|
63
|
+
script: {
|
|
64
|
+
codeHash: '0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4',
|
|
65
|
+
hashType: 'type',
|
|
66
|
+
cellDeps: [
|
|
67
|
+
{
|
|
68
|
+
cellDep: {
|
|
69
|
+
outPoint: {
|
|
70
|
+
txHash: '0xe12877ebd2c3c364dc46c5c992bcfaf4fee33fa13eebdf82c591fc9825aab769',
|
|
71
|
+
index: 0,
|
|
72
|
+
},
|
|
73
|
+
depType: 'code',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
xudt: {
|
|
80
|
+
name: 'xudt',
|
|
81
|
+
script: {
|
|
82
|
+
codeHash: '0x25c29dc317811a6f6f3985a7a9ebc4838bd388d19d0feeecf0bcd60f6c0975bb',
|
|
83
|
+
hashType: 'type',
|
|
84
|
+
cellDeps: [
|
|
85
|
+
{
|
|
86
|
+
cellDep: {
|
|
87
|
+
outPoint: {
|
|
88
|
+
txHash: '0xbf6fb538763efec2a70a6a3dcb7242787087e1030c4e7d86585bc63a9d337f5f',
|
|
89
|
+
index: 0,
|
|
90
|
+
},
|
|
91
|
+
depType: 'code',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
omnilock: {
|
|
98
|
+
name: 'omnilock',
|
|
99
|
+
script: {
|
|
100
|
+
codeHash: '0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb',
|
|
101
|
+
hashType: 'type',
|
|
102
|
+
cellDeps: [
|
|
103
|
+
{
|
|
104
|
+
cellDep: {
|
|
105
|
+
outPoint: {
|
|
106
|
+
txHash: '0xec18bf0d857c981c3d1f4e17999b9b90c484b303378e94de1a57b0872f5d4602',
|
|
107
|
+
index: 0,
|
|
108
|
+
},
|
|
109
|
+
depType: 'code',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
anyone_can_pay: {
|
|
116
|
+
name: 'anyone_can_pay',
|
|
117
|
+
script: {
|
|
118
|
+
codeHash: '0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356',
|
|
119
|
+
hashType: 'type',
|
|
120
|
+
cellDeps: [
|
|
121
|
+
{
|
|
122
|
+
cellDep: {
|
|
123
|
+
outPoint: {
|
|
124
|
+
txHash: '0xec26b0f85ed839ece5f11c4c4e837ec359f5adc4420410f6453b1f6b60fb96a6',
|
|
125
|
+
index: 0,
|
|
126
|
+
},
|
|
127
|
+
depType: 'depGroup',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
always_success: undefined,
|
|
134
|
+
spore: {
|
|
135
|
+
name: 'spore',
|
|
136
|
+
script: {
|
|
137
|
+
codeHash: '0x685a60219309029d01310311dba953d67029170ca4848a4ff638e57002130a0d',
|
|
138
|
+
hashType: 'data',
|
|
139
|
+
cellDeps: [
|
|
140
|
+
{
|
|
141
|
+
cellDep: {
|
|
142
|
+
outPoint: {
|
|
143
|
+
txHash: '0x5e8d2a517d50fd4bb4d01737a7952a1f1d35c8afc77240695bb569cd7d9d5a1f',
|
|
144
|
+
index: 0,
|
|
145
|
+
},
|
|
146
|
+
depType: 'code',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
spore_cluster: {
|
|
153
|
+
name: 'spore_cluster',
|
|
154
|
+
script: {
|
|
155
|
+
codeHash: '0x0bbe768b519d8ea7b96d58f1182eb7e6ef96c541fbd9526975077ee09f049058',
|
|
156
|
+
hashType: 'data',
|
|
157
|
+
cellDeps: [
|
|
158
|
+
{
|
|
159
|
+
cellDep: {
|
|
160
|
+
outPoint: {
|
|
161
|
+
txHash: '0xcebb174d6e300e26074aea2f5dbd7f694bb4fe3de52b6dfe205e54f90164510a',
|
|
162
|
+
index: 0,
|
|
163
|
+
},
|
|
164
|
+
depType: 'code',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
spore_cluster_agent: {
|
|
171
|
+
name: 'spore_cluster_agent',
|
|
172
|
+
script: {
|
|
173
|
+
codeHash: '0x923e997654b2697ee3f77052cb884e98f28799a4270fd412c3edb8f3987ca622',
|
|
174
|
+
hashType: 'data',
|
|
175
|
+
cellDeps: [
|
|
176
|
+
{
|
|
177
|
+
cellDep: {
|
|
178
|
+
outPoint: {
|
|
179
|
+
txHash: '0x52210232292d10c51b48e72a2cea60d8f0a08c2680a97a8ee7ca0a39379f0036',
|
|
180
|
+
index: 0,
|
|
181
|
+
},
|
|
182
|
+
depType: 'code',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
spore_cluster_proxy: {
|
|
189
|
+
name: 'spore_cluster_proxy',
|
|
190
|
+
script: {
|
|
191
|
+
codeHash: '0x4349889bda064adab8f49f7dd8810d217917f7df28e9b2a1df0b74442399670a',
|
|
192
|
+
hashType: 'data',
|
|
193
|
+
cellDeps: [
|
|
194
|
+
{
|
|
195
|
+
cellDep: {
|
|
196
|
+
outPoint: {
|
|
197
|
+
txHash: '0xc5a41d58155b11ecd87a5a49fdcb6e83bd6684d3b72b2f3686f081945461c156',
|
|
198
|
+
index: 0,
|
|
199
|
+
},
|
|
200
|
+
depType: 'code',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
spore_extension_lua: {
|
|
207
|
+
name: 'spore_extension_lua',
|
|
208
|
+
script: {
|
|
209
|
+
codeHash: '0x5ff1a403458b436ea4b2ceb72f1fa70a6507968493315b646f5302661cb68e57',
|
|
210
|
+
hashType: 'data',
|
|
211
|
+
cellDeps: [
|
|
212
|
+
{
|
|
213
|
+
cellDep: {
|
|
214
|
+
outPoint: {
|
|
215
|
+
txHash: '0x9b2098e5b6f575b2fd34ffd0212bc1c96e1f9e86fcdb146511849c174dfe0d02',
|
|
216
|
+
index: 0,
|
|
217
|
+
},
|
|
218
|
+
depType: 'code',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
exports.MAINNET_SYSTEM_SCRIPTS = {
|
|
226
|
+
secp256k1_blake160_sighash_all: {
|
|
227
|
+
name: 'secp256k1_blake160_sighash_all',
|
|
228
|
+
script: {
|
|
229
|
+
codeHash: '0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8',
|
|
230
|
+
hashType: 'type',
|
|
231
|
+
cellDeps: [
|
|
232
|
+
{
|
|
233
|
+
cellDep: {
|
|
234
|
+
outPoint: {
|
|
235
|
+
txHash: '0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c',
|
|
236
|
+
index: 0,
|
|
237
|
+
},
|
|
238
|
+
depType: 'depGroup',
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
dao: {
|
|
245
|
+
name: 'dao',
|
|
246
|
+
script: {
|
|
247
|
+
codeHash: '0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e',
|
|
248
|
+
hashType: 'type',
|
|
249
|
+
cellDeps: [
|
|
250
|
+
{
|
|
251
|
+
cellDep: {
|
|
252
|
+
outPoint: {
|
|
253
|
+
txHash: '0xe2fb199810d49a4d8beec56718ba2593b665db9d52299a0f9e6e75416d73ff5c',
|
|
254
|
+
index: 2,
|
|
255
|
+
},
|
|
256
|
+
depType: 'code',
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
secp256k1_blake160_multisig_all: {
|
|
263
|
+
name: 'secp256k1_blake160_multisig_all',
|
|
264
|
+
script: {
|
|
265
|
+
codeHash: '0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8',
|
|
266
|
+
hashType: 'type',
|
|
267
|
+
cellDeps: [
|
|
268
|
+
{
|
|
269
|
+
cellDep: {
|
|
270
|
+
outPoint: {
|
|
271
|
+
txHash: '0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c',
|
|
272
|
+
index: 1,
|
|
273
|
+
},
|
|
274
|
+
depType: 'depGroup',
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
sudt: {
|
|
281
|
+
name: 'sudt',
|
|
282
|
+
script: {
|
|
283
|
+
codeHash: '0x5e7a36a77e68eecc013dfa2fe6a23f3b6c344b04005808694ae6dd45eea4cfd5',
|
|
284
|
+
hashType: 'type',
|
|
285
|
+
cellDeps: [
|
|
286
|
+
{
|
|
287
|
+
cellDep: {
|
|
288
|
+
outPoint: {
|
|
289
|
+
txHash: '0xc7813f6a415144643970c2e88e0bb6ca6a8edc5dd7c1022746f628284a9936d5',
|
|
290
|
+
index: 0,
|
|
291
|
+
},
|
|
292
|
+
depType: 'code',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
xudt: {
|
|
299
|
+
name: 'xudt',
|
|
300
|
+
script: {
|
|
301
|
+
codeHash: '0x50bd8d6680b8b9cf98b73f3c08faf8b2a21914311954118ad6609be6e78a1b95',
|
|
302
|
+
hashType: 'data1',
|
|
303
|
+
cellDeps: [
|
|
304
|
+
{
|
|
305
|
+
cellDep: {
|
|
306
|
+
outPoint: {
|
|
307
|
+
txHash: '0xc07844ce21b38e4b071dd0e1ee3b0e27afd8d7532491327f39b786343f558ab7',
|
|
308
|
+
index: 0,
|
|
309
|
+
},
|
|
310
|
+
depType: 'code',
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
],
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
omnilock: {
|
|
317
|
+
name: 'omnilock',
|
|
318
|
+
script: {
|
|
319
|
+
codeHash: '0x9b819793a64463aed77c615d6cb226eea5487ccfc0783043a587254cda2b6f26',
|
|
320
|
+
hashType: 'type',
|
|
321
|
+
cellDeps: [
|
|
322
|
+
{
|
|
323
|
+
cellDep: {
|
|
324
|
+
outPoint: {
|
|
325
|
+
txHash: '0xc76edf469816aa22f416503c38d0b533d2a018e253e379f134c3985b3472c842',
|
|
326
|
+
index: 0,
|
|
327
|
+
},
|
|
328
|
+
depType: 'code',
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
anyone_can_pay: {
|
|
335
|
+
name: 'anyone_can_pay',
|
|
336
|
+
script: {
|
|
337
|
+
codeHash: '0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354',
|
|
338
|
+
hashType: 'type',
|
|
339
|
+
cellDeps: [
|
|
340
|
+
{
|
|
341
|
+
cellDep: {
|
|
342
|
+
outPoint: {
|
|
343
|
+
txHash: '0x4153a2014952d7cac45f285ce9a7c5c0c0e1b21f2d378b82ac1433cb11c25c4d',
|
|
344
|
+
index: 0,
|
|
345
|
+
},
|
|
346
|
+
depType: 'depGroup',
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
],
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
always_success: undefined,
|
|
353
|
+
spore: {
|
|
354
|
+
name: 'spore',
|
|
355
|
+
script: {
|
|
356
|
+
codeHash: '0x4a4dce1df3dffff7f8b2cd7dff7303df3b6150c9788cb75dcf6747247132b9f5',
|
|
357
|
+
hashType: 'data',
|
|
358
|
+
cellDeps: [
|
|
359
|
+
{
|
|
360
|
+
cellDep: {
|
|
361
|
+
outPoint: {
|
|
362
|
+
txHash: '0x96b198fb5ddbd1eed57ed667068f1f1e55d07907b4c0dbd38675a69ea1b69824',
|
|
363
|
+
index: 0,
|
|
364
|
+
},
|
|
365
|
+
depType: 'code',
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
spore_cluster: {
|
|
372
|
+
name: 'spore_cluster',
|
|
373
|
+
script: {
|
|
374
|
+
codeHash: '0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075',
|
|
375
|
+
hashType: 'data',
|
|
376
|
+
cellDeps: [
|
|
377
|
+
{
|
|
378
|
+
cellDep: {
|
|
379
|
+
outPoint: {
|
|
380
|
+
txHash: '0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938',
|
|
381
|
+
index: 0,
|
|
382
|
+
},
|
|
383
|
+
depType: 'code',
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
],
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
spore_cluster_agent: undefined,
|
|
390
|
+
spore_cluster_proxy: undefined,
|
|
391
|
+
spore_extension_lua: undefined,
|
|
392
|
+
};
|
|
393
|
+
exports.default = {
|
|
394
|
+
testnet: exports.TESTNET_SYSTEM_SCRIPTS,
|
|
395
|
+
mainnet: exports.MAINNET_SYSTEM_SCRIPTS,
|
|
396
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DepType, HashType } from '@ckb-ccc/core';
|
|
2
|
+
export declare enum SystemScriptName {
|
|
3
|
+
secp256k1_blake160_sighash_all = "secp256k1_blake160_sighash_all",
|
|
4
|
+
secp256k1_blake160_multisig_all = "secp256k1_blake160_multisig_all",
|
|
5
|
+
dao = "dao",
|
|
6
|
+
sudt = "sudt",
|
|
7
|
+
xudt = "xudt",
|
|
8
|
+
omnilock = "omnilock",
|
|
9
|
+
anyone_can_pay = "anyone_can_pay",
|
|
10
|
+
always_success = "always_success",
|
|
11
|
+
spore = "spore",
|
|
12
|
+
spore_cluster = "spore_cluster",
|
|
13
|
+
spore_cluster_agent = "spore_cluster_agent",
|
|
14
|
+
spore_cluster_proxy = "spore_cluster_proxy",
|
|
15
|
+
spore_extension_lua = "spore_extension_lua"
|
|
16
|
+
}
|
|
17
|
+
export interface ScriptInfo {
|
|
18
|
+
codeHash: `0x${string}`;
|
|
19
|
+
hashType: HashType;
|
|
20
|
+
cellDeps: {
|
|
21
|
+
cellDep: {
|
|
22
|
+
outPoint: {
|
|
23
|
+
txHash: `0x${string}`;
|
|
24
|
+
index: number;
|
|
25
|
+
};
|
|
26
|
+
depType: DepType;
|
|
27
|
+
};
|
|
28
|
+
}[];
|
|
29
|
+
}
|
|
30
|
+
export interface SystemScript {
|
|
31
|
+
name: string;
|
|
32
|
+
file?: string;
|
|
33
|
+
script: ScriptInfo;
|
|
34
|
+
}
|
|
35
|
+
export type SystemScriptsRecord = Record<SystemScriptName, SystemScript | undefined>;
|
|
36
|
+
export interface NetworkSystemScripts {
|
|
37
|
+
devnet: SystemScriptsRecord;
|
|
38
|
+
testnet: SystemScriptsRecord;
|
|
39
|
+
mainnet: SystemScriptsRecord;
|
|
40
|
+
}
|
|
41
|
+
export type MyScriptsRecord = Record<string, ScriptInfo | undefined>;
|
|
42
|
+
export interface NetworkMyScripts {
|
|
43
|
+
devnet: MyScriptsRecord;
|
|
44
|
+
testnet: MyScriptsRecord;
|
|
45
|
+
mainnet: MyScriptsRecord;
|
|
46
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SystemScriptName = void 0;
|
|
4
|
+
var SystemScriptName;
|
|
5
|
+
(function (SystemScriptName) {
|
|
6
|
+
SystemScriptName["secp256k1_blake160_sighash_all"] = "secp256k1_blake160_sighash_all";
|
|
7
|
+
SystemScriptName["secp256k1_blake160_multisig_all"] = "secp256k1_blake160_multisig_all";
|
|
8
|
+
SystemScriptName["dao"] = "dao";
|
|
9
|
+
SystemScriptName["sudt"] = "sudt";
|
|
10
|
+
SystemScriptName["xudt"] = "xudt";
|
|
11
|
+
SystemScriptName["omnilock"] = "omnilock";
|
|
12
|
+
SystemScriptName["anyone_can_pay"] = "anyone_can_pay";
|
|
13
|
+
SystemScriptName["always_success"] = "always_success";
|
|
14
|
+
SystemScriptName["spore"] = "spore";
|
|
15
|
+
SystemScriptName["spore_cluster"] = "spore_cluster";
|
|
16
|
+
SystemScriptName["spore_cluster_agent"] = "spore_cluster_agent";
|
|
17
|
+
SystemScriptName["spore_cluster_proxy"] = "spore_cluster_proxy";
|
|
18
|
+
SystemScriptName["spore_extension_lua"] = "spore_extension_lua";
|
|
19
|
+
})(SystemScriptName || (exports.SystemScriptName = SystemScriptName = {}));
|