diff --git a/.github/workflows/changeset-check.yml b/.github/workflows/changeset-check.yml index 74e31d5..497059e 100644 --- a/.github/workflows/changeset-check.yml +++ b/.github/workflows/changeset-check.yml @@ -44,7 +44,7 @@ jobs: fi - name: Comment on PR (success) - if: steps.check.outputs.has_changeset == 'true' + if: steps.check.outputs.has_changeset == 'true' && !github.event.pull_request.head.repo.fork uses: actions/github-script@v7 with: script: | @@ -68,7 +68,7 @@ jobs: } - name: Comment on PR (failure) - if: failure() + if: failure() && !github.event.pull_request.head.repo.fork uses: actions/github-script@v7 with: script: | diff --git a/.gitignore b/.gitignore index 10e5f20..4a2881d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ package-lock.json # Test coverage coverage/ *.lcov + +# Sisyphus plans and sessions +.sisyphus/ diff --git a/.sisyphus/plans/ckb-tx-dumper.md b/.sisyphus/plans/ckb-tx-dumper.md new file mode 100644 index 0000000..ec6ac60 --- /dev/null +++ b/.sisyphus/plans/ckb-tx-dumper.md @@ -0,0 +1,175 @@ +# Replace ckb-transaction-dumper with ccc-based implementation + +## TL;DR + +> **Quick Summary**: Replace `ckb-transaction-dumper` npm package with a pure ccc-based implementation. +> +> **Deliverables**: +> +> - New `src/tools/ckb-tx-dumper.ts` (replaces old implementation) +> - Removed `ckb-transaction-dumper` from package.json +> +> **Estimated Effort**: Medium (2-3 hours) +> **Parallel Execution**: NO - sequential + +--- + +## Context + +### Request + +Replace `ckb-transaction-dumper` with ccc-based implementation (no external dependencies, use ccc throughout). + +### Current Implementation + +- `src/tools/ckb-tx-dumper.ts` spawns `ckb-transaction-dumper` binary +- Depends on npm package `ckb-transaction-dumper@0.4.2` + +### What TransactionDumper Does + +1. Load transaction (from file or fetch by hash) +2. Resolve cell deps (handle dep_group type) +3. Resolve inputs +4. Output mock transaction JSON for ckb-debugger + +### ccc Molecule Support + +ccc provides full molecule codec: + +- `ccc.molecule.struct()` - for OutPoint { tx_hash, index } +- `ccc.molecule.vector()` - for OutPointVec +- `ccc.Byte32`, `ccc.Uint32LE` - predefined codecs + +No manual bytes parsing needed! + +--- + +## Work Objectives + +### Core Objective + +Replace `ckb-transaction-dumper` with pure ccc implementation. + +### Must Have + +- Keep `DumpOption` interface +- Keep `dumpTransaction()` signature +- Same JSON output format + +### Must NOT Have + +- Breaking API changes +- New dependencies + +--- + +## TODOs + +- [ ] 1. Implement ccc-based transaction dumper + + **What to do**: + + - Rewrite `src/tools/ckb-tx-dumper.ts` + - Use ccc Client for RPC calls + - Use ccc molecule codecs for dep_group unpacking + + **Key implementation**: + + ```typescript + import { ccc } from '@ckb-ccc/core'; + + // OutPoint codec for dep_group unpacking + const OutPointCodec = ccc.molecule.struct({ + txHash: ccc.Byte32, + index: ccc.Uint32LE, + }); + + const OutPointVecCodec = ccc.molecule.vector(OutPointCodec); + + // Unpack dep_group data + function unpackDepGroup(data: string): ccc.OutPoint[] { + return OutPointVecCodec.decode(data).map((o) => + ccc.OutPoint.from({ txHash: o.txHash, index: '0x' + o.index.toString(16) }), + ); + } + ``` + + **Acceptance Criteria**: + + - [ ] Uses ccc Client for RPC + - [ ] Uses ccc molecule for dep_group + - [ ] Same output format + + **QA Scenarios**: + + ``` + Scenario: Compiles successfully + Tool: Bash + Steps: npm run typecheck + Expected: No errors + ``` + + **Commit**: `feat: implement transaction dumper with ccc` + +--- + +- [ ] 2. Remove ckb-transaction-dumper dependency + + **What to do**: + + - Remove from `package.json` + - Run `pnpm install` + + **Commit**: `chore: remove ckb-transaction-dumper` + +--- + +## Verification + +```bash +npm run typecheck +npm run lint +grep -c "ckb-transaction-dumper" package.json || echo "Clean" +``` + +## Key Implementation Notes + +### Dep Group Unpacking with ccc + +```typescript +const OutPointCodec = ccc.molecule.struct({ + txHash: ccc.Byte32, + index: ccc.Uint32LE, +}); +const OutPointVecCodec = ccc.molecule.vector(OutPointCodec); + +// Usage +const outpoints = OutPointVecCodec.decode(cellData); +``` + +### Mock Transaction Structure + +```typescript +interface MockTransaction { + mock_info: { + inputs: MockInput[]; + cell_deps: MockCellDep[]; + header_deps: any[]; + }; + tx: Transaction; +} +``` + +### Algorithm + +1. Load tx from file +2. For each cell_dep: + - Fetch cell + - If dep_type === 'dep_group': + - Decode cell.data as OutPointVec + - Fetch each referenced cell + - Add to mock_info.cell_deps +3. For each input: + - Fetch referenced cell + - Add to mock_info.inputs +4. Write JSON output diff --git a/CHANGELOG.md b/CHANGELOG.md index 4130afc..0a41f75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # @offckb/cli +## 0.4.7 + +### Patch Changes + +- 1c17600: Bump @ckb-ccc/core to 1.14.0 to fix the ws vulnerability (ws >= 8.21.0). +- a687c6f: Bump default CKB version to 0.207.0 +- 3da9777: Replace ckb-transaction-dumper with ccc-based implementation + + - Rewrite transaction dumper to use ccc Client and molecule codecs + - Implement dep_group unpacking using ccc.mol + - Remove ckb-transaction-dumper npm dependency + ## 0.4.6 ### Patch Changes diff --git a/package.json b/package.json index 6dd29ce..3e8603f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@offckb/cli", - "version": "0.4.6", + "version": "0.4.7", "description": "ckb development network for your first try", "author": "CKB EcoFund", "license": "MIT", @@ -78,7 +78,7 @@ "typescript": "^5.3.3" }, "dependencies": { - "@ckb-ccc/core": "1.5.3", + "@ckb-ccc/core": "1.14.0", "@iarna/toml": "^2.2.5", "@inquirer/prompts": "^7.8.6", "@types/http-proxy": "^1.17.15", @@ -86,7 +86,6 @@ "blessed": "0.1.81", "chalk": "4.1.2", "child_process": "^1.0.2", - "ckb-transaction-dumper": "^0.4.2", "commander": "^12.0.0", "http-proxy": "^1.18.1", "https-proxy-agent": "^7.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d68b9c..13a5070 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@ckb-ccc/core': - specifier: 1.5.3 - version: 1.5.3(typescript@5.8.2)(zod@3.25.76) + specifier: 1.14.0 + version: 1.14.0(typescript@5.8.2)(zod@3.25.76) '@iarna/toml': specifier: ^2.2.5 version: 2.2.5 @@ -32,9 +32,6 @@ importers: child_process: specifier: ^1.0.2 version: 1.0.2 - ckb-transaction-dumper: - specifier: ^0.4.2 - version: 0.4.2 commander: specifier: ^12.0.0 version: 12.1.0 @@ -56,6 +53,10 @@ importers: winston: specifier: ^3.17.0 version: 3.17.0 + optionalDependencies: + cpu-features: + specifier: ^0.0.10 + version: 0.0.10 devDependencies: '@changesets/cli': specifier: ^2.29.8 @@ -114,15 +115,11 @@ importers: typescript: specifier: ^5.3.3 version: 5.8.2 - optionalDependencies: - cpu-features: - specifier: ^0.0.10 - version: 0.0.10 packages: - '@adraffy/ens-normalize@1.10.1': - resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} + '@adraffy/ens-normalize@1.11.1': + resolution: {integrity: sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==} '@babel/code-frame@7.28.6': resolution: {integrity: sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q==} @@ -348,8 +345,8 @@ packages: '@changesets/write@0.4.0': resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} - '@ckb-ccc/core@1.5.3': - resolution: {integrity: sha512-/W7SYbygBateN6odqkMhQlkoQFs+45pJ7hYZYEaEpRdF6DjU7sIOvVSkw3qXiUOK37b2qAWJj3I8CJQbesKpng==} + '@ckb-ccc/core@1.14.0': + resolution: {integrity: sha512-X0zicFdnHm7JJZBQml1waNDkZ+9L9xn7XglWExKPuG8DI8ZEuWpvHqdhmcn7ey4CRi5JdiRzfzgZqhoWBgd9+A==} '@colors/colors@1.6.0': resolution: {integrity: sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==} @@ -666,11 +663,11 @@ packages: resolution: {integrity: sha512-H9xg1/sfVvyfU7o3zMfBEjQ1gcsdeTMgqHoYdN79tuLqfTtuu7WckRA1R5whDwOzxaZAeMKTYWqP+WCAi0CHsg==} engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} - '@joyid/ckb@1.1.2': - resolution: {integrity: sha512-+e+ISF566zaKNhKNSSS5kBw8or4Kb5Xqxe/2jVkUXKkqVHSS02Trrqe0g4IjSyeN9bszzolr1XgStv2hz62tqA==} + '@joyid/ckb@1.1.4': + resolution: {integrity: sha512-8WqcfFd/kfttuaIf2/XsRcmQkEwYLUnZc9UZRcGSVX6GkwzpOLVY5S6Hq+fDXY82lQo9upJGjjudrtcPKYPx3g==} - '@joyid/common@0.2.1': - resolution: {integrity: sha512-DjA+Cy0koTCmPzhkhHkPc0icRLE78ktZY46rXHXfkSqxwQIJ/ED/whPoeF5tkTrN+teIC/hfzVRVkEE4zh/ASQ==} + '@joyid/common@0.2.2': + resolution: {integrity: sha512-Sh9cBlbL+WgcKJ7jngELg5oY0qAO1trHm4iq1Ao0drWwi4biF8p3cb5mAEoO36UxXOy3CYSDbECWLGIP9lWNgg==} '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} @@ -716,15 +713,16 @@ packages: '@nervosnetwork/ckb-types@0.109.5': resolution: {integrity: sha512-5jQNjFw76YCd+Ppl+0RvBWzxwvWaKfWC5wjVFFdNAieX7xksCHfZFIeow8je7AF8uVypwe56WlLBlblxw9NBBQ==} - '@noble/ciphers@0.5.3': - resolution: {integrity: sha512-B0+6IIHiqEs3BPMT0hcRmHvEj2QHOLu+uwt+tqDDeVd0oyVzh7BPrDcPjRnV1PV/5LaknXJJQvOuRGR0zQJz+w==} + '@noble/ciphers@2.2.0': + resolution: {integrity: sha512-Z6pjIZ/8IJcCGzb2S/0Px5J81yij85xASuk1teLNeg75bfT07MV3a/O2Mtn1I2se43k3lkVEcFaR10N4cgQcZA==} + engines: {node: '>= 20.19.0'} '@noble/curves@1.2.0': resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} - '@noble/curves@1.8.1': - resolution: {integrity: sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==} - engines: {node: ^14.21.3 || >=16} + '@noble/curves@2.2.0': + resolution: {integrity: sha512-T/BoHgFXirb0ENSPBquzX0rcjXeM6Lo892a2jlYJkqk83LqZx0l1Of7DzlKJ6jkpvMrkHSnAcgb5JegL8SeIkQ==} + engines: {node: '>= 20.19.0'} '@noble/hashes@1.3.2': resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} @@ -734,6 +732,10 @@ packages: resolution: {integrity: sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==} engines: {node: ^14.21.3 || >=16} + '@noble/hashes@2.2.0': + resolution: {integrity: sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==} + engines: {node: '>= 20.19.0'} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -913,6 +915,7 @@ packages: '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + deprecated: Potential CWE-502 - Update to 1.3.1 or higher '@unrs/resolver-binding-android-arm-eabi@1.11.1': resolution: {integrity: sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==} @@ -1022,10 +1025,6 @@ packages: zod: optional: true - abort-controller@3.0.0: - resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} - engines: {node: '>=6.5'} - accepts@2.0.0: resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} engines: {node: '>= 0.6'} @@ -1129,10 +1128,6 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - available-typed-arrays@1.0.7: - resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} - engines: {node: '>= 0.4'} - babel-jest@30.2.0: resolution: {integrity: sha512-0YiBEOxWqKkSQWL9nNGGEgndoeL0ZpWrbLMNL5u/Kaxrli3Eaxlt3ZtIDktEvXt4L/R9r3ODr2zKwGM/2BjxVw==} engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} @@ -1165,9 +1160,6 @@ packages: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} - base-x@3.0.11: - resolution: {integrity: sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==} - base-x@5.0.1: resolution: {integrity: sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==} @@ -1178,9 +1170,6 @@ packages: resolution: {integrity: sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==} hasBin: true - bech32@1.1.4: - resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} - bech32@2.0.0: resolution: {integrity: sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==} @@ -1192,16 +1181,6 @@ packages: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bip66@1.1.5: - resolution: {integrity: sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==} - - bitcoinjs-message@2.2.0: - resolution: {integrity: sha512-103Wy3xg8Y9o+pdhGP4M3/mtQQuUWs6sPuOp1mYphSUoSMHjHTlkj32K4zxU8qMH0Ckv23emfkGlFWtoWZ7YFA==} - engines: {node: '>=0.10'} - blessed@0.1.81: resolution: {integrity: sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==} engines: {node: '>= 0.8.0'} @@ -1228,9 +1207,6 @@ packages: brorand@1.1.0: resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} - browserify-aes@1.2.0: - resolution: {integrity: sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==} - browserslist@4.28.1: resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -1240,31 +1216,18 @@ packages: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} engines: {node: '>= 6'} - bs58@4.0.1: - resolution: {integrity: sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==} - bs58@6.0.0: resolution: {integrity: sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==} - bs58check@2.1.2: - resolution: {integrity: sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==} - bs58check@4.0.0: resolution: {integrity: sha512-FsGDOnFg9aVI9erdriULkd/JjEWONV/lQE5aYziB5PoBsXRind56lh8doIZIc9X4HoxT5x4bLjMWN1/NB8Zp5g==} bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} - buffer-equals@1.0.4: - resolution: {integrity: sha512-99MsCq0j5+RhubVEtKQgKaD6EM+UP3xJgIvQqwJ3SOLDUekzxMX1ylXBng+Wa2sh7mGT0W6RUly8ojjr1Tt6nA==} - engines: {node: '>=0.10.0'} - buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - buffer-xor@1.0.3: - resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} - buffer@6.0.3: resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} @@ -1280,10 +1243,6 @@ packages: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} - call-bind@1.0.8: - resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} - engines: {node: '>= 0.4'} - call-bound@1.0.4: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} @@ -1337,17 +1296,9 @@ packages: resolution: {integrity: sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==} engines: {node: '>=8'} - cipher-base@1.0.6: - resolution: {integrity: sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==} - engines: {node: '>= 0.10'} - cjs-module-lexer@2.2.0: resolution: {integrity: sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==} - ckb-transaction-dumper@0.4.2: - resolution: {integrity: sha512-0frB1FYY3dlKLlef6ps8dfuwTXitdm4myYTc/+hAP3RCo/OrC1/MYXEedUCLXgqcXBnlOQ8VbK5PseNZovWPHQ==} - hasBin: true - cli-cursor@5.0.0: resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} engines: {node: '>=18'} @@ -1438,21 +1389,12 @@ packages: resolution: {integrity: sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA==} engines: {node: '>=10.0.0'} - create-hash@1.2.0: - resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} - - create-hmac@1.1.7: - resolution: {integrity: sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==} - create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} cross-fetch@4.0.0: resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==} - cross-fetch@4.1.0: - resolution: {integrity: sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==} - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -1481,10 +1423,6 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -1509,10 +1447,6 @@ packages: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} - drbg.js@1.0.1: - resolution: {integrity: sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==} - engines: {node: '>=0.10'} - dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -1645,14 +1579,10 @@ packages: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} - ethers@6.13.5: - resolution: {integrity: sha512-+knKNieu5EKRThQJWwqaJ10a6HE9sSehGeqWN65//wE7j47ZpFhKAnHB/JJFibwwg61I/koxaPsXbXpD/skNOQ==} + ethers@6.17.0: + resolution: {integrity: sha512-BpyrpIPJ3ydEVow8zGaz1DuPS7YU8DcWxuBnY9a0UA/lvAPwrMr+EPXsfrul628SRaekPNeIM4UFh/91GWZang==} engines: {node: '>=14.0.0'} - event-target-shim@5.0.1: - resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} - engines: {node: '>=6'} - eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} @@ -1667,9 +1597,6 @@ packages: resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==} engines: {node: '>=18.0.0'} - evp_bytestokey@1.0.3: - resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} - execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -1712,8 +1639,8 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fast-uri@3.1.0: - resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} + fast-uri@3.1.2: + resolution: {integrity: sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==} fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} @@ -1728,9 +1655,6 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -1757,8 +1681,8 @@ packages: fn.name@1.1.0: resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} - follow-redirects@1.15.9: - resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} + follow-redirects@1.16.0: + resolution: {integrity: sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -1766,10 +1690,6 @@ packages: debug: optional: true - for-each@0.3.5: - resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} - engines: {node: '>= 0.4'} - foreground-child@3.3.1: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} @@ -1881,9 +1801,6 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - has-symbols@1.1.0: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} @@ -1892,10 +1809,6 @@ packages: resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} engines: {node: '>= 0.4'} - hash-base@3.1.0: - resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} - engines: {node: '>=4'} - hash.js@1.1.7: resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} @@ -1906,8 +1819,8 @@ packages: hmac-drbg@1.0.1: resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} - hono@4.12.12: - resolution: {integrity: sha512-p1JfQMKaceuCbpJKAPKVqyqviZdS0eUxH9v82oWo1kb9xjQ5wA6iP3FNVAPDFlz5/p7d45lO+BpSk1tuSZMF4Q==} + hono@4.12.18: + resolution: {integrity: sha512-RWzP96k/yv0PQfyXnWjs6zot20TqfpfsNXhOnev8d1InAxubW93L11/oNUc3tQqn2G0bSdAOBpX+2uDFHV7kdQ==} engines: {node: '>=16.9.0'} html-escaper@2.0.2: @@ -1995,10 +1908,6 @@ packages: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} - is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - is-core-module@2.16.1: resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} engines: {node: '>= 0.4'} @@ -2046,17 +1955,10 @@ packages: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} - is-typed-array@1.1.15: - resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} - engines: {node: '>= 0.4'} - is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} - isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -2339,9 +2241,6 @@ packages: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} - md5.js@1.3.5: - resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} - media-typer@1.1.0: resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} engines: {node: '>= 0.8'} @@ -2623,10 +2522,6 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} - possible-typed-array-names@1.1.0: - resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} - engines: {node: '>= 0.4'} - prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -2733,9 +2628,6 @@ packages: deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true - ripemd160@2.0.2: - resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} - router@2.2.0: resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} engines: {node: '>= 18'} @@ -2753,10 +2645,6 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - secp256k1@3.8.1: - resolution: {integrity: sha512-tArjQw2P0RTdY7QmkNehgp6TVvQXq6ulIhxv8gaH6YubKG/wxxAoNKcbuXjDhybbc+b2Ihc7e0xxiGN744UIiQ==} - engines: {node: '>=4.0.0'} - semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -2774,18 +2662,9 @@ packages: resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} engines: {node: '>= 18'} - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} - sha.js@2.4.12: - resolution: {integrity: sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==} - engines: {node: '>= 0.10'} - hasBin: true - shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -2948,10 +2827,6 @@ packages: tmpl@1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} - to-buffer@1.2.2: - resolution: {integrity: sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==} - engines: {node: '>= 0.4'} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -3062,10 +2937,6 @@ packages: resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} engines: {node: '>= 0.6'} - typed-array-buffer@1.0.3: - resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} - engines: {node: '>= 0.4'} - typescript@5.8.2: resolution: {integrity: sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==} engines: {node: '>=14.17'} @@ -3112,9 +2983,6 @@ packages: resolution: {integrity: sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==} engines: {node: '>=10.12.0'} - varuint-bitcoin@1.1.2: - resolution: {integrity: sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==} - vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -3128,10 +2996,6 @@ packages: whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - which-typed-array@1.1.19: - resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==} - engines: {node: '>= 0.4'} - which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3175,20 +3039,8 @@ packages: resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - ws@8.17.1: - resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - - ws@8.18.1: - resolution: {integrity: sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==} + ws@8.21.0: + resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -3249,7 +3101,7 @@ packages: snapshots: - '@adraffy/ens-normalize@1.10.1': {} + '@adraffy/ens-normalize@1.11.1': {} '@babel/code-frame@7.28.6': dependencies: @@ -3586,21 +3438,18 @@ snapshots: human-id: 4.1.3 prettier: 2.8.8 - '@ckb-ccc/core@1.5.3(typescript@5.8.2)(zod@3.25.76)': + '@ckb-ccc/core@1.14.0(typescript@5.8.2)(zod@3.25.76)': dependencies: - '@joyid/ckb': 1.1.2(typescript@5.8.2)(zod@3.25.76) - '@noble/ciphers': 0.5.3 - '@noble/curves': 1.8.1 - '@noble/hashes': 1.7.1 - abort-controller: 3.0.0 + '@joyid/ckb': 1.1.4(typescript@5.8.2)(zod@3.25.76) + '@noble/ciphers': 2.2.0 + '@noble/curves': 2.2.0 + '@noble/hashes': 2.2.0 bech32: 2.0.0 - bitcoinjs-message: 2.2.0 bs58check: 4.0.0 buffer: 6.0.3 - cross-fetch: 4.1.0 - ethers: 6.13.5 - isomorphic-ws: 5.0.0(ws@8.18.1) - ws: 8.18.1 + ethers: 6.17.0 + isomorphic-ws: 5.0.0(ws@8.21.0) + ws: 8.21.0 transitivePeerDependencies: - bufferutil - encoding @@ -3680,9 +3529,9 @@ snapshots: '@eslint/core': 0.13.0 levn: 0.4.1 - '@hono/node-server@1.19.13(hono@4.12.12)': + '@hono/node-server@1.19.13(hono@4.12.18)': dependencies: - hono: 4.12.12 + hono: 4.12.18 '@humanfs/core@0.19.1': {} @@ -4024,9 +3873,9 @@ snapshots: '@types/yargs': 17.0.35 chalk: 4.1.2 - '@joyid/ckb@1.1.2(typescript@5.8.2)(zod@3.25.76)': + '@joyid/ckb@1.1.4(typescript@5.8.2)(zod@3.25.76)': dependencies: - '@joyid/common': 0.2.1(typescript@5.8.2)(zod@3.25.76) + '@joyid/common': 0.2.2(typescript@5.8.2)(zod@3.25.76) '@nervosnetwork/ckb-sdk-utils': 0.109.5 cross-fetch: 4.0.0 uncrypto: 0.1.3 @@ -4035,7 +3884,7 @@ snapshots: - typescript - zod - '@joyid/common@0.2.1(typescript@5.8.2)(zod@3.25.76)': + '@joyid/common@0.2.2(typescript@5.8.2)(zod@3.25.76)': dependencies: abitype: 0.8.7(typescript@5.8.2)(zod@3.25.76) type-fest: 4.6.0 @@ -4085,7 +3934,7 @@ snapshots: '@modelcontextprotocol/sdk@1.27.1(zod@3.25.76)': dependencies: - '@hono/node-server': 1.19.13(hono@4.12.12) + '@hono/node-server': 1.19.13(hono@4.12.18) ajv: 8.18.0 ajv-formats: 3.0.1(ajv@8.18.0) content-type: 1.0.5 @@ -4095,7 +3944,7 @@ snapshots: eventsource-parser: 3.0.6 express: 5.2.1 express-rate-limit: 8.3.1(express@5.2.1) - hono: 4.12.12 + hono: 4.12.18 jose: 6.1.3 json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 @@ -4122,20 +3971,22 @@ snapshots: '@nervosnetwork/ckb-types@0.109.5': {} - '@noble/ciphers@0.5.3': {} + '@noble/ciphers@2.2.0': {} '@noble/curves@1.2.0': dependencies: '@noble/hashes': 1.3.2 - '@noble/curves@1.8.1': + '@noble/curves@2.2.0': dependencies: - '@noble/hashes': 1.7.1 + '@noble/hashes': 2.2.0 '@noble/hashes@1.3.2': {} '@noble/hashes@1.7.1': {} + '@noble/hashes@2.2.0': {} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -4414,10 +4265,6 @@ snapshots: optionalDependencies: zod: 3.25.76 - abort-controller@3.0.0: - dependencies: - event-target-shim: 5.0.1 - accepts@2.0.0: dependencies: mime-types: 3.0.2 @@ -4455,7 +4302,7 @@ snapshots: ajv@8.18.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.0 + fast-uri: 3.1.2 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -4500,10 +4347,6 @@ snapshots: asynckit@0.4.0: {} - available-typed-arrays@1.0.7: - dependencies: - possible-typed-array-names: 1.1.0 - babel-jest@30.2.0(@babel/core@7.28.6): dependencies: '@babel/core': 7.28.6 @@ -4560,18 +4403,12 @@ snapshots: balanced-match@4.0.4: {} - base-x@3.0.11: - dependencies: - safe-buffer: 5.2.1 - base-x@5.0.1: {} base64-js@1.5.1: {} baseline-browser-mapping@2.9.14: {} - bech32@1.1.4: {} - bech32@2.0.0: {} better-path-resolve@1.0.0: @@ -4580,23 +4417,6 @@ snapshots: binary-extensions@2.3.0: {} - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bip66@1.1.5: - dependencies: - safe-buffer: 5.2.1 - - bitcoinjs-message@2.2.0: - dependencies: - bech32: 1.1.4 - bs58check: 2.1.2 - buffer-equals: 1.0.4 - create-hash: 1.2.0 - secp256k1: 3.8.1 - varuint-bitcoin: 1.1.2 - blessed@0.1.81: {} bn.js@4.12.3: {} @@ -4630,15 +4450,6 @@ snapshots: brorand@1.1.0: {} - browserify-aes@1.2.0: - dependencies: - buffer-xor: 1.0.3 - cipher-base: 1.0.6 - create-hash: 1.2.0 - evp_bytestokey: 1.0.3 - inherits: 2.0.4 - safe-buffer: 5.2.1 - browserslist@4.28.1: dependencies: baseline-browser-mapping: 2.9.14 @@ -4651,20 +4462,10 @@ snapshots: dependencies: fast-json-stable-stringify: 2.1.0 - bs58@4.0.1: - dependencies: - base-x: 3.0.11 - bs58@6.0.0: dependencies: base-x: 5.0.1 - bs58check@2.1.2: - dependencies: - bs58: 4.0.1 - create-hash: 1.2.0 - safe-buffer: 5.2.1 - bs58check@4.0.0: dependencies: '@noble/hashes': 1.7.1 @@ -4674,12 +4475,8 @@ snapshots: dependencies: node-int64: 0.4.0 - buffer-equals@1.0.4: {} - buffer-from@1.1.2: {} - buffer-xor@1.0.3: {} - buffer@6.0.3: dependencies: base64-js: 1.5.1 @@ -4695,13 +4492,6 @@ snapshots: es-errors: 1.3.0 function-bind: 1.1.2 - call-bind@1.0.8: - dependencies: - call-bind-apply-helpers: 1.0.2 - es-define-property: 1.0.1 - get-intrinsic: 1.3.0 - set-function-length: 1.2.2 - call-bound@1.0.4: dependencies: call-bind-apply-helpers: 1.0.2 @@ -4746,15 +4536,8 @@ snapshots: ci-info@4.3.1: {} - cipher-base@1.0.6: - dependencies: - inherits: 2.0.4 - safe-buffer: 5.2.1 - cjs-module-lexer@2.2.0: {} - ckb-transaction-dumper@0.4.2: {} - cli-cursor@5.0.0: dependencies: restore-cursor: 5.1.0 @@ -4836,23 +4619,6 @@ snapshots: nan: 2.22.2 optional: true - create-hash@1.2.0: - dependencies: - cipher-base: 1.0.6 - inherits: 2.0.4 - md5.js: 1.3.5 - ripemd160: 2.0.2 - sha.js: 2.4.12 - - create-hmac@1.1.7: - dependencies: - cipher-base: 1.0.6 - create-hash: 1.2.0 - inherits: 2.0.4 - ripemd160: 2.0.2 - safe-buffer: 5.2.1 - sha.js: 2.4.12 - create-require@1.1.1: {} cross-fetch@4.0.0: @@ -4861,12 +4627,6 @@ snapshots: transitivePeerDependencies: - encoding - cross-fetch@4.1.0: - dependencies: - node-fetch: 2.7.0 - transitivePeerDependencies: - - encoding - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -4883,12 +4643,6 @@ snapshots: deepmerge@4.3.1: {} - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.1 - es-errors: 1.3.0 - gopd: 1.2.0 - delayed-stream@1.0.0: {} depd@2.0.0: {} @@ -4903,12 +4657,6 @@ snapshots: dependencies: path-type: 4.0.0 - drbg.js@1.0.1: - dependencies: - browserify-aes: 1.2.0 - create-hash: 1.2.0 - create-hmac: 1.1.7 - dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 @@ -5055,21 +4803,19 @@ snapshots: etag@1.8.1: {} - ethers@6.13.5: + ethers@6.17.0: dependencies: - '@adraffy/ens-normalize': 1.10.1 + '@adraffy/ens-normalize': 1.11.1 '@noble/curves': 1.2.0 '@noble/hashes': 1.3.2 '@types/node': 22.7.5 aes-js: 4.0.0-beta.5 tslib: 2.7.0 - ws: 8.17.1 + ws: 8.21.0 transitivePeerDependencies: - bufferutil - utf-8-validate - event-target-shim@5.0.1: {} - eventemitter3@4.0.7: {} eventemitter3@5.0.1: {} @@ -5080,11 +4826,6 @@ snapshots: dependencies: eventsource-parser: 3.0.6 - evp_bytestokey@1.0.3: - dependencies: - md5.js: 1.3.5 - safe-buffer: 5.2.1 - execa@5.1.1: dependencies: cross-spawn: 7.0.6 @@ -5174,7 +4915,7 @@ snapshots: fast-levenshtein@2.0.6: {} - fast-uri@3.1.0: {} + fast-uri@3.1.2: {} fastq@1.19.1: dependencies: @@ -5190,8 +4931,6 @@ snapshots: dependencies: flat-cache: 4.0.1 - file-uri-to-path@1.0.0: {} - fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -5226,11 +4965,7 @@ snapshots: fn.name@1.1.0: {} - follow-redirects@1.15.9: {} - - for-each@0.3.5: - dependencies: - is-callable: 1.2.7 + follow-redirects@1.16.0: {} foreground-child@3.3.1: dependencies: @@ -5352,22 +5087,12 @@ snapshots: has-flag@4.0.0: {} - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.1 - has-symbols@1.1.0: {} has-tostringtag@1.0.2: dependencies: has-symbols: 1.1.0 - hash-base@3.1.0: - dependencies: - inherits: 2.0.4 - readable-stream: 3.6.2 - safe-buffer: 5.2.1 - hash.js@1.1.7: dependencies: inherits: 2.0.4 @@ -5383,7 +5108,7 @@ snapshots: minimalistic-assert: 1.0.1 minimalistic-crypto-utils: 1.0.1 - hono@4.12.12: {} + hono@4.12.18: {} html-escaper@2.0.2: {} @@ -5398,7 +5123,7 @@ snapshots: http-proxy@1.18.1: dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.15.9 + follow-redirects: 1.16.0 requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -5461,8 +5186,6 @@ snapshots: dependencies: binary-extensions: 2.3.0 - is-callable@1.2.7: {} - is-core-module@2.16.1: dependencies: hasown: 2.0.2 @@ -5495,19 +5218,13 @@ snapshots: dependencies: better-path-resolve: 1.0.0 - is-typed-array@1.1.15: - dependencies: - which-typed-array: 1.1.19 - is-windows@1.0.2: {} - isarray@2.0.5: {} - isexe@2.0.0: {} - isomorphic-ws@5.0.0(ws@8.18.1): + isomorphic-ws@5.0.0(ws@8.21.0): dependencies: - ws: 8.18.1 + ws: 8.21.0 istanbul-lib-coverage@3.2.2: {} @@ -5983,12 +5700,6 @@ snapshots: math-intrinsics@1.1.0: {} - md5.js@1.3.5: - dependencies: - hash-base: 3.1.0 - inherits: 2.0.4 - safe-buffer: 5.2.1 - media-typer@1.1.0: {} merge-descriptors@2.0.0: {} @@ -6050,7 +5761,8 @@ snapshots: mute-stream@2.0.0: {} - nan@2.22.2: {} + nan@2.22.2: + optional: true napi-postinstall@0.3.4: {} @@ -6197,8 +5909,6 @@ snapshots: dependencies: find-up: 4.1.0 - possible-typed-array-names@1.1.0: {} - prelude-ls@1.2.1: {} prettier@2.8.8: {} @@ -6289,11 +5999,6 @@ snapshots: dependencies: glob: 7.2.3 - ripemd160@2.0.2: - dependencies: - hash-base: 3.1.0 - inherits: 2.0.4 - router@2.2.0: dependencies: debug: 4.4.3 @@ -6314,17 +6019,6 @@ snapshots: safer-buffer@2.1.2: {} - secp256k1@3.8.1: - dependencies: - bindings: 1.5.0 - bip66: 1.1.5 - bn.js: 4.12.3 - create-hash: 1.2.0 - drbg.js: 1.0.1 - elliptic: 6.6.1 - nan: 2.22.2 - safe-buffer: 5.2.1 - semver@6.3.1: {} semver@7.7.3: {} @@ -6354,23 +6048,8 @@ snapshots: transitivePeerDependencies: - supports-color - set-function-length@1.2.2: - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.3.0 - gopd: 1.2.0 - has-property-descriptors: 1.0.2 - setprototypeof@1.2.0: {} - sha.js@2.4.12: - dependencies: - inherits: 2.0.4 - safe-buffer: 5.2.1 - to-buffer: 1.2.2 - shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 @@ -6535,12 +6214,6 @@ snapshots: tmpl@1.0.5: {} - to-buffer@1.2.2: - dependencies: - isarray: 2.0.5 - safe-buffer: 5.2.1 - typed-array-buffer: 1.0.3 - to-regex-range@5.0.1: dependencies: is-number: 7.0.0 @@ -6642,12 +6315,6 @@ snapshots: media-typer: 1.1.0 mime-types: 3.0.2 - typed-array-buffer@1.0.3: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - is-typed-array: 1.1.15 - typescript@5.8.2: {} uglify-js@3.19.3: @@ -6705,10 +6372,6 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 - varuint-bitcoin@1.1.2: - dependencies: - safe-buffer: 5.2.1 - vary@1.1.2: {} walker@1.0.8: @@ -6722,16 +6385,6 @@ snapshots: tr46: 0.0.3 webidl-conversions: 3.0.1 - which-typed-array@1.1.19: - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.8 - call-bound: 1.0.4 - for-each: 0.3.5 - get-proto: 1.0.1 - gopd: 1.2.0 - has-tostringtag: 1.0.2 - which@2.0.2: dependencies: isexe: 2.0.0 @@ -6791,9 +6444,7 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 4.1.0 - ws@8.17.1: {} - - ws@8.18.1: {} + ws@8.21.0: {} xtend@4.0.2: {} diff --git a/src/cfg/setting.ts b/src/cfg/setting.ts index 962ac1a..5c41d5d 100644 --- a/src/cfg/setting.ts +++ b/src/cfg/setting.ts @@ -62,7 +62,7 @@ export const defaultSettings: Settings = { proxy: undefined, bins: { rootFolder: path.resolve(dataPath, 'bins'), - defaultCKBVersion: '0.205.0', + defaultCKBVersion: '0.207.0', downloadPath: path.resolve(cachePath, 'download'), }, devnet: { diff --git a/src/cli.ts b/src/cli.ts index dc82791..c1ffa21 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -81,9 +81,9 @@ program const txHash = option.txHash; if (option.singleScript) { const { cellType, cellIndex, scriptType } = parseSingleScriptOption(option.singleScript); - return debugSingleScript(txHash, cellIndex, cellType, scriptType, option.network, option.bin); + return await debugSingleScript(txHash, cellIndex, cellType, scriptType, option.network, option.bin); } - return debugTransaction(txHash, option.network); + return await debugTransaction(txHash, option.network); }); program diff --git a/src/cmd/debug.ts b/src/cmd/debug.ts index 5acbcdc..5564f6c 100644 --- a/src/cmd/debug.ts +++ b/src/cmd/debug.ts @@ -8,8 +8,8 @@ import { Network } from '../type/base'; import { encodeBinPathForTerminal } from '../util/encoding'; import { logger } from '../util/logger'; -export function debugTransaction(txHash: string, network: Network) { - const txFile = buildTxFileOptionBy(txHash, network); +export async function debugTransaction(txHash: string, network: Network) { + const txFile = await buildTxFileOptionBy(txHash, network); const opts = buildTransactionDebugOptions(txHash, network); for (const opt of opts) { logger.section(opt.name, [], 'info'); @@ -48,7 +48,7 @@ export function buildTransactionDebugOptions(txHash: string, network: Network) { return result; } -export function debugSingleScript( +export async function debugSingleScript( txHash: string, cellIndex: number, cellType: 'input' | 'output', @@ -56,7 +56,7 @@ export function debugSingleScript( network: Network, bin?: string, ) { - const txFile = buildTxFileOptionBy(txHash, network); + const txFile = await buildTxFileOptionBy(txHash, network); let opt = `--cell-index ${cellIndex} --cell-type ${cellType} --script-group-type ${scriptType}`; if (bin) { opt = opt + ` --bin ${bin}`; @@ -81,7 +81,7 @@ export function parseSingleScriptOption(value: string) { }; } -export function buildTxFileOptionBy(txHash: string, network: Network) { +export async function buildTxFileOptionBy(txHash: string, network: Network) { const settings = readSettings(); const outputFilePath = buildDebugFullTransactionFilePath(network, txHash); if (!fs.existsSync(outputFilePath)) { @@ -90,7 +90,7 @@ export function buildTxFileOptionBy(txHash: string, network: Network) { if (!fs.existsSync(outputFilePath)) { fs.mkdirSync(path.dirname(outputFilePath), { recursive: true }); } - dumpTransaction({ rpc, txJsonFilePath, outputFilePath }); + await dumpTransaction({ rpc, txJsonFilePath, outputFilePath }); } const opt = `--tx-file ${encodeBinPathForTerminal(outputFilePath)}`; return opt; diff --git a/src/scripts/private.ts b/src/scripts/private.ts index 73b8c02..e9afc33 100644 --- a/src/scripts/private.ts +++ b/src/scripts/private.ts @@ -73,6 +73,10 @@ export function toCCCKnownScripts(scripts: SystemScriptsRecord) { hashType: 'type', cellDeps: [], }, + // ccc >= 1.14.0 calls getKnownScript(NervosDao) during completeFeeBy + // for all inputs. Devnet deploys the DAO system cell, so map it to the + // actual devnet script derived from list-hashes. + [KnownScript.NervosDao]: scripts.dao!.script, }; return DEVNET_SCRIPTS; } diff --git a/src/tools/ckb-tx-dumper.ts b/src/tools/ckb-tx-dumper.ts index 212aa33..c97ffaf 100644 --- a/src/tools/ckb-tx-dumper.ts +++ b/src/tools/ckb-tx-dumper.ts @@ -1,6 +1,7 @@ +import fs from 'fs'; import path from 'path'; -import { execSync } from 'child_process'; -import { packageRootPath } from '../cfg/setting'; +import { ccc } from '@ckb-ccc/core'; +import { cccA } from '@ckb-ccc/core/advanced'; import { logger } from '../util/logger'; export interface DumpOption { @@ -9,15 +10,260 @@ export interface DumpOption { outputFilePath: string; } -export function dumpTransaction({ rpc, txJsonFilePath, outputFilePath }: DumpOption) { - const ckbTransactionDumperPath = path.resolve(packageRootPath, 'node_modules/.bin/ckb-transaction-dumper'); +const OutPointCodec = ccc.mol.struct({ + txHash: ccc.mol.Byte32, + index: ccc.mol.Uint32LE, +}); - const command = `${ckbTransactionDumperPath} --rpc ${rpc} --tx "${txJsonFilePath}" --output "${outputFilePath}"`; +const OutPointVecCodec = ccc.mol.vector(OutPointCodec); +interface MockCellDep { + cell_dep: { + out_point: { + tx_hash: string; + index: string; + }; + dep_type: string; + }; + output: MockOutput; + data: string; +} + +interface MockInput { + input: { + previous_output: { + tx_hash: string; + index: string; + }; + since: string; + }; + output: MockOutput; + data: string; +} + +interface MockOutput { + capacity: string; + lock: MockScript; + type: MockScript | null; +} + +interface MockScript { + code_hash: string; + hash_type: string; + args: string; +} + +interface MockTransaction { + mock_info: { + inputs: MockInput[]; + cell_deps: MockCellDep[]; + header_deps: string[]; + }; + tx: { + version: string; + cell_deps: { + out_point: { + tx_hash: string; + index: string; + }; + dep_type: string; + }[]; + header_deps: string[]; + inputs: { + previous_output: { + tx_hash: string; + index: string; + }; + since: string; + }[]; + outputs: MockOutput[]; + outputs_data: string[]; + witnesses: string[]; + }; +} + +function toMockScript(script: ccc.Script | undefined): MockScript | null { + if (!script) return null; + return { + code_hash: script.codeHash, + hash_type: script.hashType, + args: script.args, + }; +} + +function toDepType(depType: string): string { + // Convert camelCase to snake_case for CKB JSON format + if (depType === 'depGroup') return 'dep_group'; + return depType; +} + +async function resolveCellDeps(client: ccc.Client, cellDeps: ccc.CellDep[]): Promise { + const resolved: MockCellDep[] = []; + + for (const cellDep of cellDeps) { + const cell = await client.getCell(cellDep.outPoint); + if (!cell) { + throw new Error(`Cell not found: ${JSON.stringify(cellDep.outPoint)}`); + } + + if (cellDep.depType === 'depGroup') { + resolved.push({ + cell_dep: { + out_point: { + tx_hash: cellDep.outPoint.txHash, + index: '0x' + cellDep.outPoint.index.toString(16), + }, + dep_type: toDepType(cellDep.depType), + }, + output: { + capacity: '0x' + cell.cellOutput.capacity.toString(16), + lock: toMockScript(cell.cellOutput.lock)!, + type: toMockScript(cell.cellOutput.type), + }, + data: cell.outputData, + }); + const data = cell.outputData; + if (data && data !== '0x') { + const outpoints = OutPointVecCodec.decode(data); + for (const op of outpoints) { + const outPoint = ccc.OutPoint.from({ + txHash: op.txHash, + index: '0x' + op.index.toString(16), + }); + const refCell = await client.getCell(outPoint); + if (!refCell) { + logger.error( + `Failed to resolve cell for depGroup out_point: tx_hash=${outPoint.txHash}, index=${outPoint.index.toString()}`, + ); + throw new Error('Failed to resolve all cells referenced by depGroup.'); + } + resolved.push({ + cell_dep: { + out_point: { + tx_hash: outPoint.txHash, + index: '0x' + outPoint.index.toString(16), + }, + dep_type: 'code', + }, + output: { + capacity: '0x' + refCell.cellOutput.capacity.toString(16), + lock: toMockScript(refCell.cellOutput.lock)!, + type: toMockScript(refCell.cellOutput.type), + }, + data: refCell.outputData, + }); + } + } + } else { + resolved.push({ + cell_dep: { + out_point: { + tx_hash: cellDep.outPoint.txHash, + index: '0x' + cellDep.outPoint.index.toString(16), + }, + dep_type: toDepType(cellDep.depType), + }, + output: { + capacity: '0x' + cell.cellOutput.capacity.toString(16), + lock: toMockScript(cell.cellOutput.lock)!, + type: toMockScript(cell.cellOutput.type), + }, + data: cell.outputData, + }); + } + } + + return resolved; +} + +async function resolveInputs(client: ccc.Client, inputs: ccc.CellInput[]): Promise { + const resolved: MockInput[] = []; + + for (const input of inputs) { + const cell = await client.getCell(input.previousOutput); + if (!cell) { + throw new Error(`Input cell not found: ${JSON.stringify(input.previousOutput)}`); + } + + resolved.push({ + input: { + previous_output: { + tx_hash: input.previousOutput.txHash, + index: '0x' + input.previousOutput.index.toString(16), + }, + since: '0x' + input.since.toString(16), + }, + output: { + capacity: '0x' + cell.cellOutput.capacity.toString(16), + lock: toMockScript(cell.cellOutput.lock)!, + type: toMockScript(cell.cellOutput.type), + }, + data: cell.outputData, + }); + } + + return resolved; +} + +export async function dumpTransaction({ rpc, txJsonFilePath, outputFilePath }: DumpOption) { try { - execSync(command, { stdio: 'inherit' }); + const isTestnet = /testnet/i.test(rpc); + const client = isTestnet + ? new ccc.ClientPublicTestnet({ + url: rpc, + fallbacks: [], + }) + : new ccc.ClientPublicMainnet({ + url: rpc, + fallbacks: [], + }); + + const txJson = JSON.parse(fs.readFileSync(txJsonFilePath, 'utf-8')); + const tx = cccA.JsonRpcTransformers.transactionTo(txJson); + + const [cell_deps, inputs] = await Promise.all([ + resolveCellDeps(client, tx.cellDeps), + resolveInputs(client, tx.inputs), + ]); + + const mockTx: MockTransaction = { + mock_info: { + inputs, + cell_deps, + header_deps: tx.headerDeps.map((h) => h.toString()), + }, + tx: { + version: '0x' + tx.version.toString(16), + cell_deps: tx.cellDeps.map((dep) => ({ + out_point: { + tx_hash: dep.outPoint.txHash, + index: '0x' + dep.outPoint.index.toString(16), + }, + dep_type: toDepType(dep.depType), + })), + header_deps: tx.headerDeps.map((h) => h.toString()), + inputs: tx.inputs.map((input) => ({ + previous_output: { + tx_hash: input.previousOutput.txHash, + index: '0x' + input.previousOutput.index.toString(16), + }, + since: '0x' + input.since.toString(16), + })), + outputs: tx.outputs.map((output) => ({ + capacity: '0x' + output.capacity.toString(16), + lock: toMockScript(output.lock)!, + type: toMockScript(output.type), + })), + outputs_data: tx.outputsData, + witnesses: tx.witnesses.map((w) => w.toString()), + }, + }; + + fs.mkdirSync(path.dirname(outputFilePath), { recursive: true }); + fs.writeFileSync(outputFilePath, JSON.stringify(mockTx, null, 2)); logger.debug('Dump transaction successfully'); } catch (error: unknown) { - logger.error('Command failed:', (error as Error).message); + logger.error('Failed to dump transaction:', error instanceof Error ? error.message : String(error)); + throw error; } }