From 295dacd364ee74b1489fbc863350da7ba4d52f2c Mon Sep 17 00:00:00 2001 From: RetricSu Date: Mon, 26 Feb 2024 19:45:53 +0800 Subject: [PATCH 1/5] wip: generate account info on keys --- account/account.json | 222 ++++++++++++++++++++++ package.json | 1 + src/cfg/const.ts | 2 + src/cli.ts | 7 +- src/cmd/build-lumos-config.ts | 4 +- src/cmd/genkey.ts | 74 +++++++- yarn.lock | 343 +++++++++++++++++++++++++++++++++- 7 files changed, 647 insertions(+), 6 deletions(-) create mode 100644 account/account.json diff --git a/account/account.json b/account/account.json new file mode 100644 index 0000000..729712b --- /dev/null +++ b/account/account.json @@ -0,0 +1,222 @@ +[ + { + "privkey": "0x6109170b275a09ad54877b82f7d9930f88cab5717d484fb4741ae9d1dd078cd6", + "pubkey": "0x02025fa7b61b2365aa459807b84df065f1949d58c0ae590ff22dd2595157bffefa", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x8e42b1999f265a0078503c4acec4d5e134534297" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqvwg2cen8extgq8s5puft8vf40px3f599cytcyd8", + "args": "0x8e42b1999f265a0078503c4acec4d5e134534297" + }, + { + "privkey": "0x9f315d5a9618a39fdc487c7a67a8581d40b045bd7a42d83648ca80ef3b2cb4a1", + "pubkey": "0x026efa0579f09cc7c1129b78544f70098c90b2ab155c10746316f945829c034a2d", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x758d311c8483e0602dfad7b69d9053e3f917457d" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqt435c3epyrupszm7khk6weq5lrlyt52lg48ucew", + "args": "0x758d311c8483e0602dfad7b69d9053e3f917457d" + }, + { + "privkey": "0x59ddda57ba06d6e9c5fa9040bdb98b4b098c2fce6520d39f51bc5e825364697a", + "pubkey": "0x02f1ec8d18e8ff13ecf7b3ab8f683d0c3a6d63478a7f7d14ca0fdfe8fea331e863", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x9d1edebedf8f026c0d597c4c5cd3f45dec1f7557" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqvarm0tahu0qfkq6ktuf3wd8azaas0h24c9myfz6", + "args": "0x9d1edebedf8f026c0d597c4c5cd3f45dec1f7557" + }, + { + "privkey": "0xf4a1fc19468b51ba9d1f0f5441fa3f4d91e625b2af105e1e37cc54bf9b19c0a1", + "pubkey": "0x02e72cbdff20422a3886ec667a138a59478d93da072173be4344c55582acdce67c", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0xe65f823bc5a48a38515690604e503dba4eb15d61" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq0xt7prh3dy3gu9z45svp89q0d6f6c46cg9dp9mn", + "args": "0xe65f823bc5a48a38515690604e503dba4eb15d61" + }, + { + "privkey": "0x0334ddff3b1e19af5c5fddda8dbcfb235416eaaba11cfca8acf63ad46e9f55b2", + "pubkey": "0x022c0ea6dae4ee9f6a6303ffe85e3223b273e7e1520343f35ad57a50566c306889", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x9665e6bc1966ec2bfcca4f11782d2b906f38438f" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqvkvhntcxtxas4lejj0z9uz62usduuy8rcwg4fr9", + "args": "0x9665e6bc1966ec2bfcca4f11782d2b906f38438f" + }, + { + "privkey": "0x6f358d92f408511707803d292efa148236a2e114d73a472be2a07e0ba49200c7", + "pubkey": "0x02ebb6ce7a68eeb34c66d394dab74d20f766e4c711d52cbea7643ae828d3478813", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x0df9552f53d51a378aba267bc858dada447e8400" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqgdl92j7574rgmc4w3x00y93kk6g3lggqq23mmmd", + "args": "0x0df9552f53d51a378aba267bc858dada447e8400" + }, + { + "privkey": "0xbde2f19c98dc5ab4cc98f73c573757a9f1782dc44398022a23f77ca752ad8fbe", + "pubkey": "0x02747a187de5f4b5a864d49fd20b8e2d62dfd3dfe3af3fa09155eebe76e3989cf3", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x683188bb29502ba6e702b7c650cc80707c3f8b4b" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqtgxxytk22s9wnwwq4hcegveqrs0slckjc2gkygd", + "args": "0x683188bb29502ba6e702b7c650cc80707c3f8b4b" + }, + { + "privkey": "0x7c1280118923ea96529909638dac9bd258251a222783f91dedbf82de15526fd2", + "pubkey": "0x027d0aaa651657c452ebcf02537fde64a3bf822ec00bd59e658aa3e854e02d3e6e", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x532bfb946e4b108d14758ca38e6e3b4af6801996" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq2n90aegmjtzzx3gavv5w8xuw6276qpn9s4x74d7", + "args": "0x532bfb946e4b108d14758ca38e6e3b4af6801996" + }, + { + "privkey": "0x1fe1356d47224f34788eb099c4f67ab28a477a5a85d6ff4e54c240c11a0c693c", + "pubkey": "0x036555a57d4866067f4886a63d34c3f7396aa770c8617b57ff7e0b664e4444ef6e", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x3982ac2f4893dfcac091ef795bb778cc2a25edd9" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqfes2kz7jynml9vpy0009dmw7xv9gj7mkgzxwxsx", + "args": "0x3982ac2f4893dfcac091ef795bb778cc2a25edd9" + }, + { + "privkey": "0xc3255dd2bbc3accc69c82bdb2c927ab4a681146331d5e01990890fb3cd732b47", + "pubkey": "0x03c0a782747b630e101468cac29137a709e14806586d1110d901eeb8a81d2ada47", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x5aab386e8a9f4f869776674c7181ea76fef75b55" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq264vuxaz5lf7rfwan8f3ccr6nklmm4k4gwtzp2q", + "args": "0x5aab386e8a9f4f869776674c7181ea76fef75b55" + }, + { + "privkey": "0x8c3f8a6a6847a31af93000a31629f0c674e0cbb1b7cb71bdfbf4fb9dd828a518", + "pubkey": "0x02de6586e04a9776123fdc2f79e01bd613ab86c0447337392e27376aad8850e854", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0xf6ca1c08a40ab3d00e2299930cf0f8c298a1a90d" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq0kegwq3fq2k0gqug5ejvx0p7xznzs6jrg890q3w", + "args": "0xf6ca1c08a40ab3d00e2299930cf0f8c298a1a90d" + }, + { + "privkey": "0x11e34fc1bad213b1ce3071501a18c39e5dbf1ea2e66ac05059c36a5d1e7a56cf", + "pubkey": "0x032f632ea8c48329f701d067e77e8e66aacd61522ca7d8409523df746a0b216248", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x5cb8098824329c3a2e731641ae4e90ba0a3ec396" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq2uhqycsfpjnsazuuckgxhyay96pglv89svgrrcn", + "args": "0x5cb8098824329c3a2e731641ae4e90ba0a3ec396" + }, + { + "privkey": "0x0a0ecce6f15c444e6d0013d6eb79c87babff2c76447f3a2f6b28023490170c1f", + "pubkey": "0x02081831dc9ae364ef25f327d2c112b39b28ae76de9898a4a9001e6d2d10d64b4e", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x516932280d5ff3108119fe2361d0868f1998dcc4" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq23dyezsr2l7vggzx07ydsapp50rxvde3qslv5ac", + "args": "0x516932280d5ff3108119fe2361d0868f1998dcc4" + }, + { + "privkey": "0x006250e940dbce94ad9329ac16c109acf7de98c7e4738013bdd3105d4f004d8a", + "pubkey": "0x023e57800b040fdd6ae02197033e4cb7b323db11f9b3eb5eb139277eec68767c76", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x7a83042ddabeb27294fe62588df7acc627d4181f" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqt6svzzmk47kfefflnztzxl0txxyl2ps8cyvd734", + "args": "0x7a83042ddabeb27294fe62588df7acc627d4181f" + }, + { + "privkey": "0xfc8142dc0a6c1dc9102696e7ca730b8c05e233549ea924fafa477f5086d94ac3", + "pubkey": "0x02a7c2ea6f66885dde24ac353bc9f62e619e928078bdbc6b6ad50558b81db73b78", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x1416fe8e3e1d659a235f5f35b30f7cfbdf9fd77c" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqg5zmlgu0savkdzxh6lxkes7l8mm70awlq3lw7yk", + "args": "0x1416fe8e3e1d659a235f5f35b30f7cfbdf9fd77c" + }, + { + "privkey": "0x711aa98da3e9643170de94d6b16d3a30edf4bb231aa793aaac0fc7373c0f6322", + "pubkey": "0x039077f3e3f89fb0303faa6ebefe890c5ea89bc5563ade41f9dc33165d27b78e12", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0xf246d3f9d94aab2688babb4802879056d9bf5810" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq0jgmflnk224vng3w4mfqpg0yzkmxl4syqtwnm8g", + "args": "0xf246d3f9d94aab2688babb4802879056d9bf5810" + }, + { + "privkey": "0x76f51bf03e38b7f4a3c2cd8b088103e746f0e425fb0c5e0f8b22061f41c790cc", + "pubkey": "0x037ebf8c904461cc9fe3c5510f52874d1baf557613cceb4300f82acfdddb7de927", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x4ec295923dde1b522835007f9260e8ba398dc7cb" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq2wc22ey0w7rdfzsdgq07fxp6968xxu0jcuc7xwl", + "args": "0x4ec295923dde1b522835007f9260e8ba398dc7cb" + }, + { + "privkey": "0x1ef1c9cbf031d7bc181c039cebb4f2914dbad689ab268e192fe22ea314d9b4a4", + "pubkey": "0x0389a0a718b1eedaedb12fdf61834ada0ee78af6dc7fb2e90c8fc96fd14bf5da73", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0xd7ab64e757d1177a955a5c997a6ba7feab49161b" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqwh4djww473zaaf2kjun9axhfl74dy3vxctp93d8", + "args": "0xd7ab64e757d1177a955a5c997a6ba7feab49161b" + }, + { + "privkey": "0xa5808e79c243d8e026a034273ad7a5ccdcb2f982392fd0230442b1734c98a4c2", + "pubkey": "0x034417bf068a1166a1443cfbbf974e61a65bf402dcce7b157a67260c18c6dd76f7", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x9ba28269270223ba366a29dc96401910540894a4" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqvm52pxjfczywarv63fmjtyqxgs2syfffq2348ad", + "args": "0x9ba28269270223ba366a29dc96401910540894a4" + }, + { + "privkey": "0xace08599f3174f4376ae51fdc30950d4f2d731440382bb0aa1b6b0bd3a9728cd", + "pubkey": "0x0216bc7b5b0a30fb910c372062a7f8cfa89f3a231f5d4a975e60a787ea828aa49e", + "lockScript": { + "codeHash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", + "hashType": "type", + "args": "0x4118c8c16749bf126b22468d030bf9de7da3717b" + }, + "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq2prryvze6fhufxkgjx35psh7w70k3hz7c3mtl4d", + "args": "0x4118c8c16749bf126b22468d030bf9de7da3717b" + } +] \ No newline at end of file diff --git a/package.json b/package.json index 10e7770..5fcd1dd 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "typescript": "^5.3.3" }, "dependencies": { + "@ckb-lumos/lumos": "0.21.1", "adm-zip": "^0.5.10", "axios": "^1.6.7", "child_process": "^1.0.2", diff --git a/src/cfg/const.ts b/src/cfg/const.ts index 5bcb237..257f4e2 100644 --- a/src/cfg/const.ts +++ b/src/cfg/const.ts @@ -14,6 +14,8 @@ export const devnetPath = path.resolve(targetEnvironmentPath, `devnet`); export const ckbFolderPath = path.resolve(targetEnvironmentPath, 'ckb'); export const ckbBinPath = path.resolve(ckbFolderPath, 'ckb'); +export const accountTargetDir = path.join(packageRootPath, `account`); + // Version export const minimalRequiredCKBVersion = "0.113.1"; diff --git a/src/cli.ts b/src/cli.ts index 8c758af..c1ac6d8 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,7 +1,7 @@ #!/usr/bin/env node import { Command } from "commander"; import { installDependency } from "./cmd/install"; -import { genkey } from "./cmd/genkey"; +import { buildAccounts, genkey } from "./cmd/genkey"; import { listHashes } from "./cmd/list-hashes"; import { node } from "./cmd/node"; import { initChainIfNeeded } from "./cmd/init-chain"; @@ -42,6 +42,11 @@ program .description("Use the CKB to generate lumos config.json") .action(buildLumosConfig); +program + .command("build-accounts") + .description("generate accounts with prefunded CKB tokens") + .action(buildAccounts); + program .command("init") .description("init dapp project with lumos") diff --git a/src/cmd/build-lumos-config.ts b/src/cmd/build-lumos-config.ts index 0599707..6acfa41 100644 --- a/src/cmd/build-lumos-config.ts +++ b/src/cmd/build-lumos-config.ts @@ -6,7 +6,7 @@ const genesisTxHash = "0xa45cab14fe656d942e1aeee4caee29980547dd38252dad715162115e1f1faa19"; const depGroupTxHash = "0xa7a43104a51ec1e9ec3e03b4fcda771f4fdcde56ee3e635e18cf757333b38c4c"; -const config = { +export const devnetConfig = { PREFIX: "ckt", SCRIPTS: { SECP256K1_BLAKE160: { @@ -80,7 +80,7 @@ const config = { export function buildLumosConfig() { const filePath = path.resolve(dappTemplatePath, "config.json"); - fs.writeFile(filePath, JSON.stringify(config, null, 2), "utf8", (err) => { + fs.writeFile(filePath, JSON.stringify(devnetConfig, null, 2), "utf8", (err) => { if (err) { return console.error("Error writing file:", err); } diff --git a/src/cmd/genkey.ts b/src/cmd/genkey.ts index 8f820e0..fbaa8c5 100644 --- a/src/cmd/genkey.ts +++ b/src/cmd/genkey.ts @@ -1,6 +1,25 @@ import * as fs from "fs"; import * as path from "path"; -import { packageRootPath } from "../cfg/const"; +import { accountTargetDir } from "../cfg/const"; +import { + Address, + HashType, + HexString, + Script, + config, + hd, + helpers, +} from "@ckb-lumos/lumos"; +import * as readline from "readline"; +import { devnetConfig } from "./build-lumos-config"; + +interface Account { + privkey: HexString; + pubkey: HexString; + args: HexString; + lockScript: Script; + address: Address; +} export function genkey() { const numKeys = 20; // Number of keys to generate @@ -19,7 +38,7 @@ function generateHex(length: number) { } function generateKeysFile(numKeys: number, keyLength: number) { - const targetDir = path.join(packageRootPath, `account/keys`); + const targetDir = path.join(accountTargetDir, `keys`); const stream = fs.createWriteStream(targetDir); for (let i = 0; i < numKeys; i++) { @@ -28,3 +47,54 @@ function generateKeysFile(numKeys: number, keyLength: number) { } stream.end(); } + +export async function buildAccounts() { + const keysDir = path.join(accountTargetDir, `keys`); + + // Create a Readable stream from the file + const fileStream = fs.createReadStream(keysDir); + + // Create an interface for reading data from the stream line by line + const rl = readline.createInterface({ + input: fileStream, + crlfDelay: Infinity, // Specify Infinity to read all lines without removing newlines + }); + + const accounts: Account[] = []; + + // Read each line from the file + for await (const line of rl) { + const privkey = `0x${line}`; + const account = genAccount(privkey); + accounts.push(account); + } + + const accountDir = path.join(accountTargetDir, `account.json`); + + fs.writeFile(accountDir, JSON.stringify(accounts, null, 2), "utf8", (err) => { + if (err) { + return console.error("Error writing file:", err); + } + }); +} + +export function genAccount(privkey: HexString): Account { + const pubkey = hd.key.privateToPublic(privkey); + const args = hd.key.publicKeyToBlake160(pubkey); + const template = devnetConfig.SCRIPTS["SECP256K1_BLAKE160"]!; + const lockScript: Script = { + codeHash: template.CODE_HASH, + hashType: template.HASH_TYPE as HashType, + args: args, + }; + const address = helpers.encodeToAddress(lockScript, { + config: devnetConfig as config.Config, + }); + return { + privkey, + pubkey, + lockScript, + address, + args, + }; +} diff --git a/yarn.lock b/yarn.lock index 34e87f2..d1284ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,130 @@ # yarn lockfile v1 +"@ckb-lumos/base@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/base/-/base-0.21.1.tgz#1faf7909b5a68a124256d937cfb0fa03bb6b5457" + integrity sha512-7O+jBl7pqMsRbYTMNnbpamgaQzvaLZq+ftMtnKZ3A+Zbs6hZcGbz/6nfbRZnyJitPXQHRPT5KAQz6g+TiYqJGg== + dependencies: + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" + "@types/blake2b" "^2.1.0" + "@types/lodash.isequal" "^4.5.5" + blake2b "^2.1.3" + js-xxhash "^1.0.4" + lodash.isequal "^4.5.0" + +"@ckb-lumos/bi@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/bi/-/bi-0.21.1.tgz#dfaa0968a9ffd990c1c4fcfc0711f20f09eb0485" + integrity sha512-6q8uesvu3DAM7GReei9H5seino4tnakTeg8uXtZBPDC6rboMohLCPQvEwhl1iHmsybXvBYVQt4Te1BPPZtuaRw== + dependencies: + jsbi "^4.1.0" + +"@ckb-lumos/ckb-indexer@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/ckb-indexer/-/ckb-indexer-0.21.1.tgz#a0e0ac3261c98181dc8c72e9e726030bb210779d" + integrity sha512-592pMVP3lwTXF7TmlOcayvGYKOhkYpjbLHUDo7By4yWbm7ZpdexaN5hn0X1sjJgMuee5prxGr9/fY684VTpJQw== + dependencies: + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@ckb-lumos/rpc" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" + cross-fetch "^3.1.5" + events "^3.3.0" + +"@ckb-lumos/codec@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/codec/-/codec-0.21.1.tgz#160f21efa0cded6ea461eb6476f9af6010b682e0" + integrity sha512-z6IUUxVZrx663iC7VM9CmaQZL8jsdM3ybgz0UCS24JgBXTNec+Uz0/Zrl7yeH6fBpVls44C2wObcHKigKaNVAA== + dependencies: + "@ckb-lumos/bi" "0.21.1" + +"@ckb-lumos/common-scripts@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/common-scripts/-/common-scripts-0.21.1.tgz#64776b5ce55d8c66898a3ab592c7f77fe13d865e" + integrity sha512-EfZQ9wdxPmEsxVVwtBjhpZVKbYCm1FJkMt59ABsIO1Ub7yi0qap7AQl0MMbuLwWIGKwS2w0U3wx/oJPm7z1RXg== + dependencies: + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@ckb-lumos/config-manager" "0.21.1" + "@ckb-lumos/helpers" "0.21.1" + "@ckb-lumos/rpc" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" + immutable "^4.3.0" + +"@ckb-lumos/config-manager@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/config-manager/-/config-manager-0.21.1.tgz#857050ebf2ca38096d8fae26b6a8927164798ca3" + integrity sha512-BmrNqYyaksdCKHWagyC8+R8GUxhIO+sOM5S925jlkpjju2sUbH0Id2/zmdb7I9KxdKnbx3WsR+hqy7/bYqw1lA== + dependencies: + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@types/deep-freeze-strict" "^1.1.0" + deep-freeze-strict "^1.1.1" + +"@ckb-lumos/hd@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/hd/-/hd-0.21.1.tgz#406026ac2b570f72b4407149cb941d09bb8a0ab6" + integrity sha512-BnfpJf/sx/dJzL5BrOxPeKbKgv2x74KWd0xwjw1/gBQ2IMhu0S1mLwFsOT3Zu2nuhpQYvZGvr0cd3vD/SoMDow== + dependencies: + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + bn.js "^5.1.3" + elliptic "^6.5.4" + scrypt-js "^3.0.1" + sha3 "^2.1.3" + uuid "^8.3.0" + +"@ckb-lumos/helpers@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/helpers/-/helpers-0.21.1.tgz#fffd455071f51556b2cd2539a255b3759893da08" + integrity sha512-jFN6DtWzwVNEY4kmnzczRaQqtyRJQwzAEuHRUQ0LqTiIGM+SlfgjH/l/InAG4cIhDOurMudnUJ4ex68wmbkhVw== + dependencies: + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@ckb-lumos/config-manager" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" + bech32 "^2.0.0" + immutable "^4.3.0" + +"@ckb-lumos/lumos@^0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/lumos/-/lumos-0.21.1.tgz#ff5a9a10859b305530026668bd14cdc12e5e7532" + integrity sha512-a5n8xaIUvmaPsw2fBki8Jamy6/6uQnLWDZM9SQX29cZ1YVoAk/slnBmEbCIGXmxDhcuAlLkTeJaiLDKEGrZ6pg== + dependencies: + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/ckb-indexer" "0.21.1" + "@ckb-lumos/common-scripts" "0.21.1" + "@ckb-lumos/config-manager" "0.21.1" + "@ckb-lumos/hd" "0.21.1" + "@ckb-lumos/helpers" "0.21.1" + "@ckb-lumos/rpc" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" + +"@ckb-lumos/rpc@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/rpc/-/rpc-0.21.1.tgz#f6a6b3ed6d76adfb84c148e4b4acadb7fbaa7d7a" + integrity sha512-gZWXYCyQ98s84Pb+buOiYL3HOIxQPLHQdCyo96GFerNw9lB1XsbaGWzfHPYpZvOQqYtnJ1GUfTkQkADrQ7hmew== + dependencies: + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + abort-controller "^3.0.0" + cross-fetch "^3.1.5" + +"@ckb-lumos/toolkit@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/toolkit/-/toolkit-0.21.1.tgz#bcf4bf05615375087e3dd02fb087b797a8c67f37" + integrity sha512-awrFos7uQXEVGbqKSv/8Fc8B8XAfxdYoyYak4zFyAAmxxA0NiTTvk9V8TsOA7zVXpxct4Jal22+qUe+4Jg8T/g== + dependencies: + "@ckb-lumos/bi" "0.21.1" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -54,6 +178,28 @@ dependencies: "@types/node" "*" +"@types/blake2b@^2.1.0": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@types/blake2b/-/blake2b-2.1.3.tgz#bd6bf2fbabd888b5580d7e932de5960d087db094" + integrity sha512-MFCdX0MNxFBP/xEILO5Td0kv6nI7+Q2iRWZbTL/yzH2/eDVZS5Wd1LHdsmXClvsCyzqaZfHFzZaN6BUeUCfSDA== + +"@types/deep-freeze-strict@^1.1.0": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@types/deep-freeze-strict/-/deep-freeze-strict-1.1.2.tgz#707d1f9721aea9251ca6188111c272c61fc5490f" + integrity sha512-VvMETBojHvhX4f+ocYTySQlXMZfxKV3Jyb7iCWlWaC+exbedkv6Iv2bZZqI736qXjVguH6IH7bzwMBMfTT+zuQ== + +"@types/lodash.isequal@^4.5.5": + version "4.5.8" + resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.8.tgz#b30bb6ff6a5f6c19b3daf389d649ac7f7a250499" + integrity sha512-uput6pg4E/tj2LGxCZo9+y27JNyB2OZuuI/T5F+ylVDYuqICLG2/ktjxx0v6GvVntAf8TvEzeQLcV0ffRirXuA== + dependencies: + "@types/lodash" "*" + +"@types/lodash@*": + version "4.14.202" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8" + integrity sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ== + "@types/node@*", "@types/node@^20.11.19": version "20.11.19" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.19.tgz#b466de054e9cb5b3831bee38938de64ac7f81195" @@ -76,6 +222,13 @@ resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" integrity sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ== +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + acorn-walk@^8.1.1: version "8.3.2" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" @@ -118,16 +271,57 @@ axios@^1.6.7: form-data "^4.0.0" proxy-from-env "^1.1.0" +b4a@^1.0.1: + version "1.6.6" + resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.6.tgz#a4cc349a3851987c3c4ac2d7785c18744f6da9ba" + integrity sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg== + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bech32@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-2.0.0.tgz#078d3686535075c8c79709f054b1b226a133b355" + integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +blake2b-wasm@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/blake2b-wasm/-/blake2b-wasm-2.4.0.tgz#9115649111edbbd87eb24ce7c04b427e4e2be5be" + integrity sha512-S1kwmW2ZhZFFFOghcx73+ZajEfKBqhP82JMssxtLVMxlaPea1p9uoLiUZ5WYyHn0KddwbLc+0vh4wR0KBNoT5w== + dependencies: + b4a "^1.0.1" + nanoassert "^2.0.0" + +blake2b@^2.1.3: + version "2.1.4" + resolved "https://registry.yarnpkg.com/blake2b/-/blake2b-2.1.4.tgz#817d278526ddb4cd673bfb1af16d1ad61e393ba3" + integrity sha512-AyBuuJNI64gIvwx13qiICz6H6hpmjvYS5DGkG6jbXMOT8Z3WUJ3V1X0FlhIoT1b/5JtHE3ki+xjtMvu1nn+t9A== + dependencies: + blake2b-wasm "^2.4.0" + nanoassert "^2.0.0" + +bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.1.3: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -143,11 +337,24 @@ braces@~3.0.2: dependencies: fill-range "^7.0.1" +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +buffer@6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + child_process@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/child_process/-/child_process-1.0.2.tgz#b1f7e7fc73d25e7fd1d455adc94e143830182b5a" @@ -190,6 +397,18 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-fetch@^3.1.5: + version "3.1.8" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" + integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== + dependencies: + node-fetch "^2.6.12" + +deep-freeze-strict@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/deep-freeze-strict/-/deep-freeze-strict-1.1.1.tgz#77d0583ca24a69be4bbd9ac2fae415d55523e5b0" + integrity sha512-QemROZMM2IvhAcCFvahdX2Vbm4S/txeq5rFYU9fh4mQP79WTMW5c/HkQ2ICl1zuzcDZdPZ6zarDxQeQMsVYoNA== + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -207,6 +426,29 @@ dynamic-dedupe@^0.3.0: dependencies: xtend "^4.0.0" +elliptic@^6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + +events@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -262,6 +504,14 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + hasown@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.1.tgz#26f48f039de2c0f8d3356c223fb8d50253519faa" @@ -269,6 +519,25 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +immutable@^4.3.0: + version "4.3.5" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.5.tgz#f8b436e66d59f99760dc577f5c99a4fd2a5cc5a0" + integrity sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw== + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -277,7 +546,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2: +inherits@2, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -313,6 +582,21 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +js-xxhash@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/js-xxhash/-/js-xxhash-1.0.4.tgz#ce465d8a5c038167a07aa35a855c0bd792fe8e06" + integrity sha512-S/6Oo7ruxx5k8m4qlMnbpwQdJjRsvvfcIhIk1dA9c5y5GNhYHKYKu9krEK3QgBax6CxJuf4gRL2opgLkdzWIKg== + +jsbi@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-4.3.0.tgz#b54ee074fb6fcbc00619559305c8f7e912b04741" + integrity sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g== + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -337,6 +621,16 @@ mime-types@^2.1.12: dependencies: mime-db "1.52.0" +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -354,6 +648,18 @@ mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +nanoassert@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-2.0.0.tgz#a05f86de6c7a51618038a620f88878ed1e490c09" + integrity sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA== + +node-fetch@^2.6.12: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -409,6 +715,11 @@ rimraf@^2.6.1: dependencies: glob "^7.1.3" +scrypt-js@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + semver@^7.6.0: version "7.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" @@ -416,6 +727,13 @@ semver@^7.6.0: dependencies: lru-cache "^6.0.0" +sha3@^2.1.3: + version "2.1.4" + resolved "https://registry.yarnpkg.com/sha3/-/sha3-2.1.4.tgz#000fac0fe7c2feac1f48a25e7a31b52a6492cc8f" + integrity sha512-S8cNxbyb0UGUM2VhRD4Poe5N58gJnJsLJ5vC7FYWGUmGhcsj4++WaIOBFVDxlG0W3To6xBuiRh+i0Qp2oNCOtg== + dependencies: + buffer "6.0.3" + source-map-support@^0.5.12: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -451,6 +769,11 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + tree-kill@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" @@ -511,11 +834,29 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +uuid@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" From 95b8d8ea2c0441d23e31b02d2dd86e1233c51eaa Mon Sep 17 00:00:00 2001 From: RetricSu Date: Mon, 26 Feb 2024 19:59:47 +0800 Subject: [PATCH 2/5] wip: generate account issuing config toml sections --- src/cli.ts | 7 ++++++- src/cmd/genkey.ts | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/cli.ts b/src/cli.ts index c1ac6d8..1133176 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,7 +1,7 @@ #!/usr/bin/env node import { Command } from "commander"; import { installDependency } from "./cmd/install"; -import { buildAccounts, genkey } from "./cmd/genkey"; +import { buildAccounts, generateIssueTomlSections, genkey } from "./cmd/genkey"; import { listHashes } from "./cmd/list-hashes"; import { node } from "./cmd/node"; import { initChainIfNeeded } from "./cmd/init-chain"; @@ -47,6 +47,11 @@ program .description("generate accounts with prefunded CKB tokens") .action(buildAccounts); + program + .command("gen-accounts-toml") + .description("generate account issue config toml sections") + .action(generateIssueTomlSections); + program .command("init") .description("init dapp project with lumos") diff --git a/src/cmd/genkey.ts b/src/cmd/genkey.ts index fbaa8c5..6a5390f 100644 --- a/src/cmd/genkey.ts +++ b/src/cmd/genkey.ts @@ -98,3 +98,19 @@ export function genAccount(privkey: HexString): Account { args, }; } + +export function generateIssueTomlSections() { + const config: Account[] = require("../../account/account.json"); + + for (const account of config) { + const section = `# issue for account private key: ${account.privkey} +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "${account.lockScript.codeHash}" +lock.args = "${account.lockScript.args}" +lock.hash_type = "${account.lockScript.hashType}" + `; + + console.log(section); + } +} From 1f4763c46abf66d8a6cb47e4237b1648b5134ded Mon Sep 17 00:00:00 2001 From: RetricSu Date: Mon, 26 Feb 2024 20:13:54 +0800 Subject: [PATCH 3/5] wip: add issued_cells for account-list --- docker/devnet/specs/dev.toml | 143 ++++++++++++++++++++++++++++++++-- src/cli.ts | 8 +- src/cmd/accounts.ts | 0 src/cmd/build-lumos-config.ts | 4 +- src/cmd/genkey.ts | 2 +- template/config.json | 16 ++-- 6 files changed, 151 insertions(+), 22 deletions(-) create mode 100644 src/cmd/accounts.ts diff --git a/docker/devnet/specs/dev.toml b/docker/devnet/specs/dev.toml index 098a7d1..a18060b 100644 --- a/docker/devnet/specs/dev.toml +++ b/docker/devnet/specs/dev.toml @@ -83,19 +83,148 @@ lock.code_hash = "0x000000000000000000000000000000000000000000000000000000000000 lock.args = "0x62e907b15cbf27d5425399ebf6f0fb50ebb88f18" lock.hash_type = "data" -# issue for random generated private key: d00c06bfd800d27397002dca6fb0993d5ba6399b4238b2f29ee9deb97593d2bc +#### account-list #### +# issue for account private key: 0x6109170b275a09ad54877b82f7d9930f88cab5717d484fb4741ae9d1dd078cd6 [[genesis.issued_cells]] -capacity = 20_000_000_000_00000000 +capacity = 42_000_000_00000000 lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" -lock.args = "0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d7" +lock.args = "0x8e42b1999f265a0078503c4acec4d5e134534297" lock.hash_type = "type" - -# issue for random generated private key: 63d86723e08f0f813a36ce6aa123bb2289d90680ae1e99d4de8cdb334553f24d + +# issue for account private key: 0x9f315d5a9618a39fdc487c7a67a8581d40b045bd7a42d83648ca80ef3b2cb4a1 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x758d311c8483e0602dfad7b69d9053e3f917457d" +lock.hash_type = "type" + +# issue for account private key: 0x59ddda57ba06d6e9c5fa9040bdb98b4b098c2fce6520d39f51bc5e825364697a +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x9d1edebedf8f026c0d597c4c5cd3f45dec1f7557" +lock.hash_type = "type" + +# issue for account private key: 0xf4a1fc19468b51ba9d1f0f5441fa3f4d91e625b2af105e1e37cc54bf9b19c0a1 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0xe65f823bc5a48a38515690604e503dba4eb15d61" +lock.hash_type = "type" + +# issue for account private key: 0x0334ddff3b1e19af5c5fddda8dbcfb235416eaaba11cfca8acf63ad46e9f55b2 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x9665e6bc1966ec2bfcca4f11782d2b906f38438f" +lock.hash_type = "type" + +# issue for account private key: 0x6f358d92f408511707803d292efa148236a2e114d73a472be2a07e0ba49200c7 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x0df9552f53d51a378aba267bc858dada447e8400" +lock.hash_type = "type" + +# issue for account private key: 0xbde2f19c98dc5ab4cc98f73c573757a9f1782dc44398022a23f77ca752ad8fbe +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x683188bb29502ba6e702b7c650cc80707c3f8b4b" +lock.hash_type = "type" + +# issue for account private key: 0x7c1280118923ea96529909638dac9bd258251a222783f91dedbf82de15526fd2 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x532bfb946e4b108d14758ca38e6e3b4af6801996" +lock.hash_type = "type" + +# issue for account private key: 0x1fe1356d47224f34788eb099c4f67ab28a477a5a85d6ff4e54c240c11a0c693c +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x3982ac2f4893dfcac091ef795bb778cc2a25edd9" +lock.hash_type = "type" + +# issue for account private key: 0xc3255dd2bbc3accc69c82bdb2c927ab4a681146331d5e01990890fb3cd732b47 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x5aab386e8a9f4f869776674c7181ea76fef75b55" +lock.hash_type = "type" + +# issue for account private key: 0x8c3f8a6a6847a31af93000a31629f0c674e0cbb1b7cb71bdfbf4fb9dd828a518 [[genesis.issued_cells]] -capacity = 5_198_735_037_00000000 +capacity = 42_000_000_00000000 lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" -lock.args = "0x470dcdc5e44064909650113a274b3b36aecb6dc7" +lock.args = "0xf6ca1c08a40ab3d00e2299930cf0f8c298a1a90d" lock.hash_type = "type" + +# issue for account private key: 0x11e34fc1bad213b1ce3071501a18c39e5dbf1ea2e66ac05059c36a5d1e7a56cf +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x5cb8098824329c3a2e731641ae4e90ba0a3ec396" +lock.hash_type = "type" + +# issue for account private key: 0x0a0ecce6f15c444e6d0013d6eb79c87babff2c76447f3a2f6b28023490170c1f +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x516932280d5ff3108119fe2361d0868f1998dcc4" +lock.hash_type = "type" + +# issue for account private key: 0x006250e940dbce94ad9329ac16c109acf7de98c7e4738013bdd3105d4f004d8a +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x7a83042ddabeb27294fe62588df7acc627d4181f" +lock.hash_type = "type" + +# issue for account private key: 0xfc8142dc0a6c1dc9102696e7ca730b8c05e233549ea924fafa477f5086d94ac3 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x1416fe8e3e1d659a235f5f35b30f7cfbdf9fd77c" +lock.hash_type = "type" + +# issue for account private key: 0x711aa98da3e9643170de94d6b16d3a30edf4bb231aa793aaac0fc7373c0f6322 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0xf246d3f9d94aab2688babb4802879056d9bf5810" +lock.hash_type = "type" + +# issue for account private key: 0x76f51bf03e38b7f4a3c2cd8b088103e746f0e425fb0c5e0f8b22061f41c790cc +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x4ec295923dde1b522835007f9260e8ba398dc7cb" +lock.hash_type = "type" + +# issue for account private key: 0x1ef1c9cbf031d7bc181c039cebb4f2914dbad689ab268e192fe22ea314d9b4a4 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0xd7ab64e757d1177a955a5c997a6ba7feab49161b" +lock.hash_type = "type" + +# issue for account private key: 0xa5808e79c243d8e026a034273ad7a5ccdcb2f982392fd0230442b1734c98a4c2 +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x9ba28269270223ba366a29dc96401910540894a4" +lock.hash_type = "type" + +# issue for account private key: 0xace08599f3174f4376ae51fdc30950d4f2d731440382bb0aa1b6b0bd3a9728cd +[[genesis.issued_cells]] +capacity = 42_000_000_00000000 +lock.code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" +lock.args = "0x4118c8c16749bf126b22468d030bf9de7da3717b" +lock.hash_type = "type" +#### account-list #### + [params] initial_primary_epoch_reward = 1_917_808_21917808 diff --git a/src/cli.ts b/src/cli.ts index 1133176..4b1e200 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,7 +1,7 @@ #!/usr/bin/env node import { Command } from "commander"; import { installDependency } from "./cmd/install"; -import { buildAccounts, generateIssueTomlSections, genkey } from "./cmd/genkey"; +import { buildAccounts, printIssueSectionForToml, genkey } from "./cmd/genkey"; import { listHashes } from "./cmd/list-hashes"; import { node } from "./cmd/node"; import { initChainIfNeeded } from "./cmd/init-chain"; @@ -48,9 +48,9 @@ program .action(buildAccounts); program - .command("gen-accounts-toml") - .description("generate account issue config toml sections") - .action(generateIssueTomlSections); + .command("print-account-issue-info") + .description("print account issue cells config toml sections") + .action(printIssueSectionForToml); program .command("init") diff --git a/src/cmd/accounts.ts b/src/cmd/accounts.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/cmd/build-lumos-config.ts b/src/cmd/build-lumos-config.ts index 6acfa41..0da2bf4 100644 --- a/src/cmd/build-lumos-config.ts +++ b/src/cmd/build-lumos-config.ts @@ -3,8 +3,8 @@ import path from "path"; import { dappTemplatePath } from "../cfg/const"; const genesisTxHash = - "0xa45cab14fe656d942e1aeee4caee29980547dd38252dad715162115e1f1faa19"; -const depGroupTxHash = "0xa7a43104a51ec1e9ec3e03b4fcda771f4fdcde56ee3e635e18cf757333b38c4c"; + "0x920bb4250dc6216c08ee0713f86b3fcb01bf444027b08b7d92db0ed1c0fb9214"; +const depGroupTxHash = "0x37f2b7799b199491f4732c572c086afdace0bf92992faf0b90bae44cdd119f9e"; export const devnetConfig = { PREFIX: "ckt", diff --git a/src/cmd/genkey.ts b/src/cmd/genkey.ts index 6a5390f..d702d0f 100644 --- a/src/cmd/genkey.ts +++ b/src/cmd/genkey.ts @@ -99,7 +99,7 @@ export function genAccount(privkey: HexString): Account { }; } -export function generateIssueTomlSections() { +export function printIssueSectionForToml() { const config: Account[] = require("../../account/account.json"); for (const account of config) { diff --git a/template/config.json b/template/config.json index d606fde..e9fa3ae 100644 --- a/template/config.json +++ b/template/config.json @@ -4,7 +4,7 @@ "SECP256K1_BLAKE160": { "CODE_HASH": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", "HASH_TYPE": "type", - "TX_HASH": "0xa7a43104a51ec1e9ec3e03b4fcda771f4fdcde56ee3e635e18cf757333b38c4c", + "TX_HASH": "0x37f2b7799b199491f4732c572c086afdace0bf92992faf0b90bae44cdd119f9e", "INDEX": "0x0", "DEP_TYPE": "depGroup", "SHORT_ID": 1 @@ -12,14 +12,14 @@ "SECP256K1_BLAKE160_MULTISIG": { "CODE_HASH": "0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8", "HASH_TYPE": "type", - "TX_HASH": "0xa7a43104a51ec1e9ec3e03b4fcda771f4fdcde56ee3e635e18cf757333b38c4c", + "TX_HASH": "0x37f2b7799b199491f4732c572c086afdace0bf92992faf0b90bae44cdd119f9e", "INDEX": "0x1", "DEP_TYPE": "depGroup" }, "DAO": { "CODE_HASH": "0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e", "HASH_TYPE": "type", - "TX_HASH": "0xa45cab14fe656d942e1aeee4caee29980547dd38252dad715162115e1f1faa19", + "TX_HASH": "0x920bb4250dc6216c08ee0713f86b3fcb01bf444027b08b7d92db0ed1c0fb9214", "INDEX": "0x2", "DEP_TYPE": "code", "SHORT_ID": 2 @@ -27,35 +27,35 @@ "SUDT": { "CODE_HASH": "0x6283a479a3cf5d4276cd93594de9f1827ab9b55c7b05b3d28e4c2e0a696cfefd", "HASH_TYPE": "type", - "TX_HASH": "0xa45cab14fe656d942e1aeee4caee29980547dd38252dad715162115e1f1faa19", + "TX_HASH": "0x920bb4250dc6216c08ee0713f86b3fcb01bf444027b08b7d92db0ed1c0fb9214", "INDEX": "0x5", "DEP_TYPE": "code" }, "XUDT": { "CODE_HASH": "0x1a1e4fef34f5982906f745b048fe7b1089647e82346074e0f32c2ece26cf6b1e", "HASH_TYPE": "type", - "TX_HASH": "0xa45cab14fe656d942e1aeee4caee29980547dd38252dad715162115e1f1faa19", + "TX_HASH": "0x920bb4250dc6216c08ee0713f86b3fcb01bf444027b08b7d92db0ed1c0fb9214", "INDEX": "0x6", "DEP_TYPE": "code" }, "OMNILOCK": { "CODE_HASH": "0x9c6933d977360f115a3e9cd5a2e0e475853681b80d775d93ad0f8969da343e56", "HASH_TYPE": "type", - "TX_HASH": "0xa45cab14fe656d942e1aeee4caee29980547dd38252dad715162115e1f1faa19", + "TX_HASH": "0x920bb4250dc6216c08ee0713f86b3fcb01bf444027b08b7d92db0ed1c0fb9214", "INDEX": "0x7", "DEP_TYPE": "code" }, "ANYONE_CAN_PAY": { "CODE_HASH": "0xe09352af0066f3162287763ce4ddba9af6bfaeab198dc7ab37f8c71c9e68bb5b", "HASH_TYPE": "type", - "TX_HASH": "0xa45cab14fe656d942e1aeee4caee29980547dd38252dad715162115e1f1faa19", + "TX_HASH": "0x920bb4250dc6216c08ee0713f86b3fcb01bf444027b08b7d92db0ed1c0fb9214", "INDEX": "0x8", "DEP_TYPE": "code" }, "ALWAYS_SUCCESS": { "CODE_HASH": "0xbb4469004225b39e983929db71fe2253cba1d49a76223e9e1d212cdca1f79f28", "HASH_TYPE": "type", - "TX_HASH": "0xa45cab14fe656d942e1aeee4caee29980547dd38252dad715162115e1f1faa19", + "TX_HASH": "0x920bb4250dc6216c08ee0713f86b3fcb01bf444027b08b7d92db0ed1c0fb9214", "INDEX": "0x9", "DEP_TYPE": "code" } From f351738621c3231829a194e1ff25473ba9788d8f Mon Sep 17 00:00:00 2001 From: RetricSu Date: Mon, 26 Feb 2024 20:20:41 +0800 Subject: [PATCH 4/5] add accounts cmd --- src/cli.ts | 8 +++++++- src/cmd/accounts.ts | 8 ++++++++ tsconfig.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 4b1e200..4398e53 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -7,6 +7,7 @@ import { node } from "./cmd/node"; import { initChainIfNeeded } from "./cmd/init-chain"; import { buildLumosConfig } from "./cmd/build-lumos-config"; import { init } from "./cmd/init"; +import { accounts } from "./cmd/accounts"; const program = new Command(); @@ -47,11 +48,16 @@ program .description("generate accounts with prefunded CKB tokens") .action(buildAccounts); - program +program .command("print-account-issue-info") .description("print account issue cells config toml sections") .action(printIssueSectionForToml); +program + .command("accounts") + .description("print account list info") + .action(accounts); + program .command("init") .description("init dapp project with lumos") diff --git a/src/cmd/accounts.ts b/src/cmd/accounts.ts index e69de29..21c3505 100644 --- a/src/cmd/accounts.ts +++ b/src/cmd/accounts.ts @@ -0,0 +1,8 @@ +import accountConfig from "../../account/account.json"; + +export function accounts() { + console.log( + `Print account list, each account is funded with 42_000_000_00000000 capacity in the genesis block.` + ); + console.log(accountConfig); +} diff --git a/tsconfig.json b/tsconfig.json index e075f97..afa29e7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -39,7 +39,7 @@ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ + "resolveJsonModule": true, /* Enable importing .json files. */ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ From 926bb9cd4f315a714780924d162dc59341f97e33 Mon Sep 17 00:00:00 2001 From: RetricSu Date: Mon, 26 Feb 2024 20:24:46 +0800 Subject: [PATCH 5/5] update readme --- README.md | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 6497b29..ec964bd 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ npm install -g offckb // not yet, todo offckb node // start the devnet of CKB offckb init // init a typescript boilerplate with lumos to get started with to build CKB DAPP,think 'hardhat init' offckb list-hashes // list scripts hashes, equals `ckb list-hashes` -offckb list-accounts // todo, list accounts with prefund CKB tokens +offckb accounts // list 20 accounts info with prefund CKB tokens ``` ### Built-in scripts @@ -32,28 +32,11 @@ offckb list-accounts // todo, list accounts with prefund CKB tokens - [ ] Spore https://github.com/sporeprotocol/spore-contract ### Accounts -``` -6109170b275a09ad54877b82f7d9930f88cab5717d484fb4741ae9d1dd078cd6 -9f315d5a9618a39fdc487c7a67a8581d40b045bd7a42d83648ca80ef3b2cb4a1 -59ddda57ba06d6e9c5fa9040bdb98b4b098c2fce6520d39f51bc5e825364697a -f4a1fc19468b51ba9d1f0f5441fa3f4d91e625b2af105e1e37cc54bf9b19c0a1 -0334ddff3b1e19af5c5fddda8dbcfb235416eaaba11cfca8acf63ad46e9f55b2 -6f358d92f408511707803d292efa148236a2e114d73a472be2a07e0ba49200c7 -bde2f19c98dc5ab4cc98f73c573757a9f1782dc44398022a23f77ca752ad8fbe -7c1280118923ea96529909638dac9bd258251a222783f91dedbf82de15526fd2 -1fe1356d47224f34788eb099c4f67ab28a477a5a85d6ff4e54c240c11a0c693c -c3255dd2bbc3accc69c82bdb2c927ab4a681146331d5e01990890fb3cd732b47 -8c3f8a6a6847a31af93000a31629f0c674e0cbb1b7cb71bdfbf4fb9dd828a518 -11e34fc1bad213b1ce3071501a18c39e5dbf1ea2e66ac05059c36a5d1e7a56cf -0a0ecce6f15c444e6d0013d6eb79c87babff2c76447f3a2f6b28023490170c1f -006250e940dbce94ad9329ac16c109acf7de98c7e4738013bdd3105d4f004d8a -fc8142dc0a6c1dc9102696e7ca730b8c05e233549ea924fafa477f5086d94ac3 -711aa98da3e9643170de94d6b16d3a30edf4bb231aa793aaac0fc7373c0f6322 -76f51bf03e38b7f4a3c2cd8b088103e746f0e425fb0c5e0f8b22061f41c790cc -1ef1c9cbf031d7bc181c039cebb4f2914dbad689ab268e192fe22ea314d9b4a4 -a5808e79c243d8e026a034273ad7a5ccdcb2f982392fd0230442b1734c98a4c2 -ace08599f3174f4376ae51fdc30950d4f2d731440382bb0aa1b6b0bd3a9728cd -``` + +`offckb` comes with 20 accounts, each account is funded with 42_000_000_00000000 capacity in the genesis block. + +all the private keys are recorded in the `account/keys` file. +detail informations about each account are recorded in the `account/account.json` file. ## Development