Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 2539bd8

Browse files
authored
Merge pull request #285 from ckb-cell/release/0.6.0
Merge release/0.6.0 to main branch
2 parents a93f14c + db31727 commit 2539bd8

File tree

110 files changed

+18303
-5600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+18303
-5600
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"browser": true,
44
"es2021": true
55
},
6+
"ignorePatterns": ["dist/"],
67
"extends": [
78
"eslint:recommended",
89
"plugin:@typescript-eslint/recommended"

.github/workflows/integration-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
- name: Install Node.js
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version: 20.x
32+
node-version: 21
3333

3434
- uses: pnpm/action-setup@v3
3535
name: Install -g pnpm
3636
with:
37-
version: 8
37+
version: 9
3838
run_install: false
3939

4040
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
- name: Setup Node.js
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 20
26+
node-version: 21
2727

2828
- uses: pnpm/action-setup@v3
2929
name: Install pnpm
3030
with:
31-
version: 8
31+
version: 9
3232
run_install: false
3333

3434
- name: Get pnpm store directory

.github/workflows/snapshot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
- name: Setup Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 20
25+
node-version: 21
2626

2727
- uses: pnpm/action-setup@v3
2828
name: Install pnpm
2929
with:
30-
version: 8
30+
version: 9
3131
run_install: false
3232

3333
- name: Get pnpm store directory

.github/workflows/test.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
- name: Install Node.js
2020
uses: actions/setup-node@v4
2121
with:
22-
node-version: 20.x
22+
node-version: 21
2323

2424
- uses: pnpm/action-setup@v3
2525
name: Install -g pnpm
2626
with:
27-
version: 8
27+
version: 9
2828
run_install: false
2929

3030
- name: Get pnpm store directory
@@ -47,11 +47,16 @@ jobs:
4747
run: pnpm run build:packages
4848

4949
- name: Lint packages
50-
run: pnpm run lint:packages
50+
run: pnpm run lint
5151

52-
- name: Run tests for packages
52+
- name: Run unit tests for the packages
5353
run: pnpm run test:packages
5454
env:
55+
VITE_CKB_NODE_URL: https://testnet.ckb.dev/rpc
56+
VITE_CKB_INDEXER_URL: https://testnet.ckb.dev/indexer
5557
VITE_BTC_SERVICE_URL: https://btc-assets-api.testnet.mibao.pro
5658
VITE_BTC_SERVICE_TOKEN: ${{ secrets.TESTNET_SERVICE_TOKEN }}
5759
VITE_BTC_SERVICE_ORIGIN: https://btc-assets-api.testnet.mibao.pro
60+
61+
- name: Run unit tests for the rgbpp-sdk-service
62+
run: pnpm run test:service

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ This repository offers utilities for Bitcoin and RGB++ asset integration.
6363

6464
### Notes
6565

66-
- `Bitcoin/RGB++ Assets Service` is designed to streamline the transaction workflow. Developers have the option to implement its features by themselves without limitation.
66+
- [`Bitcoin/RGB++ Assets Service`](https://github.com/ckb-cell/btc-assets-api) is an open-source project designed to streamline the transaction workflow for Bitcoin and RGB++ Assets. Developers have the option to enhance it by implementing its features by themselves without limitations.
67+
- For those who prefer to deploy their own `Bitcoin/RGB++ Assets Service`, please follow the instructions at the [Deployment](https://github.com/ckb-cell/btc-assets-api#deployment) section in the btc-assets-api repository.
6768

6869

6970
## FAQ

apps/service/package.json

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
"name": "rgbpp-sdk-service",
33
"version": "0.0.1",
4-
"description": "",
5-
"author": "",
64
"private": true,
7-
"license": "UNLICENSED",
85
"scripts": {
96
"build": "nest build",
107
"format": "prettier --write \"src/**/*.ts\"",
@@ -14,54 +11,40 @@
1411
"start:debug": "nest start --debug --watch",
1512
"start:prod": "node dist/src/main",
1613
"lint": "eslint \"src/**/*.ts\" --fix",
17-
"test": "jest",
18-
"test:watch": "jest --watch",
19-
"test:cov": "jest --coverage",
20-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
21-
"test:e2e": "jest --config ./test/jest-e2e.json"
14+
"test": "vitest",
15+
"test:watch": "vitest --watch",
16+
"test:cov": "vitest run --coverage",
17+
"test:debug": "vitest --inspect-brk --inspect --logHeapUsage --threads=false"
2218
},
2319
"dependencies": {
2420
"@nestjs/common": "^10.0.0",
2521
"@nestjs/config": "^3.2.2",
2622
"@nestjs/core": "^10.3.9",
2723
"@nestjs/platform-fastify": "^10.3.9",
28-
"convert-keys": "^1.3.4",
24+
"camelcase-keys": "^7.0.2",
2925
"json-rpc-2.0": "^1.7.0",
26+
"lodash": "^4.17.21",
3027
"reflect-metadata": "^0.2.0",
3128
"rgbpp": "workspace:*",
3229
"rxjs": "^7.8.1",
30+
"snakecase-keys": "^8.0.1",
3331
"zod": "^3.23.8"
3432
},
3533
"devDependencies": {
3634
"@nestjs/cli": "^10.0.0",
3735
"@nestjs/schematics": "^10.0.0",
3836
"@nestjs/testing": "^10.0.0",
39-
"@types/jest": "^29.5.2",
37+
"@swc/core": "^1.7.11",
4038
"@types/node": "^20.3.1",
4139
"@types/supertest": "^6.0.0",
40+
"@vitest/coverage-v8": "^2.0.5",
4241
"source-map-support": "^0.5.21",
4342
"supertest": "^6.3.3",
44-
"ts-jest": "^29.1.0",
4543
"ts-loader": "^9.4.3",
4644
"ts-node": "^10.9.1",
4745
"tsconfig-paths": "^4.2.0",
48-
"typescript": "^5.1.3"
49-
},
50-
"jest": {
51-
"moduleFileExtensions": [
52-
"js",
53-
"json",
54-
"ts"
55-
],
56-
"rootDir": "src",
57-
"testRegex": ".*\\.spec\\.ts$",
58-
"transform": {
59-
"^.+\\.(t|j)s$": "ts-jest"
60-
},
61-
"collectCoverageFrom": [
62-
"**/*.(t|j)s"
63-
],
64-
"coverageDirectory": "../coverage",
65-
"testEnvironment": "node"
46+
"type-fest": "^4.24.0",
47+
"typescript": "^5.1.3",
48+
"unplugin-swc": "^1.5.1"
6649
}
6750
}

apps/service/src/app.module.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import { Global, Module } from '@nestjs/common';
22
import { ConfigModule, ConfigService } from '@nestjs/config';
3+
import { BtcAssetsApi } from 'rgbpp/service';
4+
import { BTCTestnetType, Collector } from 'rgbpp/ckb';
35
import JsonRpcModule from './json-rpc/json-rpc.module';
46
import { RgbppModule } from './rgbpp/rgbpp.module';
57
import { AppService } from './app.service';
68
import { envSchema } from './env';
7-
import { BTCTestnetType, Collector } from 'rgbpp/ckb';
8-
import { BtcAssetsApi } from 'rgbpp';
99

1010
@Global()
1111
@Module({
1212
imports: [
1313
ConfigModule.forRoot({
1414
validate: envSchema.parse,
15+
envFilePath: ['.env', '.env.local'],
1516
}),
1617
JsonRpcModule.forRoot({
1718
path: '/json-rpc',
@@ -31,7 +32,7 @@ import { BtcAssetsApi } from 'rgbpp';
3132
inject: [ConfigService],
3233
},
3334
{
34-
provide: 'COLLECTOR',
35+
provide: 'CKB_COLLECTOR',
3536
useFactory: (configService: ConfigService) => {
3637
const ckbRpcUrl = configService.get('CKB_RPC_URL');
3738
return new Collector({
@@ -52,6 +53,6 @@ import { BtcAssetsApi } from 'rgbpp';
5253
inject: [ConfigService],
5354
},
5455
],
55-
exports: ['IS_MAINNET', 'COLLECTOR', 'BTC_ASSETS_API', 'BTC_TESTNET_TYPE'],
56+
exports: ['IS_MAINNET', 'CKB_COLLECTOR', 'BTC_ASSETS_API', 'BTC_TESTNET_TYPE'],
5657
})
5758
export class AppModule {}

apps/service/src/app.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { RpcHandler, RpcMethodHandler } from 'src/json-rpc/json-rpc.decorators';
2-
import * as pkg from '../package.json';
1+
import { RpcHandler, RpcMethodHandler } from './json-rpc/json-rpc.decorators.js';
2+
import pkg from '../package.json';
33

44
@RpcHandler()
55
export class AppService {

apps/service/src/json-rpc/json-rpc.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class JsonRpcServer {
5050
}
5151
const name = metadata.name
5252
? `${metadata.name}.${methodMetadata.name ?? methodName}`
53-
: methodMetadata.name ?? methodName;
53+
: (methodMetadata.name ?? methodName);
5454
const handler = (params: unknown) => {
5555
const instanceRef = this.moduleRef.get(instance.constructor, { strict: false });
5656
return instanceRef[methodName](params);

0 commit comments

Comments
 (0)