@babylonlabs-io/ts-sdk 0.0.0-semantic-release.1 → 0.0.0-semantic-release.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/shared/__tests__/example.test.d.ts +6 -0
- package/dist/shared/__tests__/example.test.d.ts.map +1 -0
- package/dist/tbv/core/__tests__/example.test.d.ts +6 -0
- package/dist/tbv/core/__tests__/example.test.d.ts.map +1 -0
- package/dist/test/helpers.d.ts +24 -0
- package/dist/test/helpers.d.ts.map +1 -0
- package/dist/test/setup.d.ts +6 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/package.json +9 -2
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @babylonlabs-io/ts-sdk
|
|
2
|
+
|
|
3
|
+
[](https://github.com/babylonlabs-io/babylon-toolkit/actions/workflows/verify.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@babylonlabs-io/ts-sdk)
|
|
5
|
+
|
|
6
|
+
TypeScript SDK for Babylon protocol integrations
|
|
7
|
+
|
|
8
|
+
> **⚠️ Status**: Currently under active development.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The Babylon TypeScript SDK provides a production-ready, framework-agnostic toolkit for building applications on top of the Babylon protocol.
|
|
13
|
+
|
|
14
|
+
### Key Features
|
|
15
|
+
|
|
16
|
+
- **🔐 Trustless Bitcoin Vaults (TBV)** - Core vault protocol operations
|
|
17
|
+
- **🏦 DeFi Integrations** - Pre-built integrations (Morpho and more)
|
|
18
|
+
- **📦 Framework Agnostic** - Works with React, Vue, Angular, Node.js, or vanilla JavaScript
|
|
19
|
+
- **🎯 Type-Safe** - Comprehensive TypeScript types with full IDE support
|
|
20
|
+
- **🧩 Modular Design** - Use only what you need via subpath exports
|
|
21
|
+
- **🔧 Extensible** - Easy to build custom integrations
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @babylonlabs-io/ts-sdk
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Links
|
|
30
|
+
|
|
31
|
+
- [GitHub Repository](https://github.com/babylonlabs-io/babylon-toolkit)
|
|
32
|
+
- [Issues](https://github.com/babylonlabs-io/babylon-toolkit/issues)
|
|
33
|
+
- [NPM Package](https://www.npmjs.com/package/@babylonlabs-io/ts-sdk)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.test.d.ts","sourceRoot":"","sources":["../../../src/shared/__tests__/example.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.test.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/__tests__/example.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { vi } from 'vitest';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a mock function with type safety
|
|
4
|
+
*/
|
|
5
|
+
export declare function createMockFn<T extends (...args: any[]) => any>(): ReturnType<typeof vi.fn<T>>;
|
|
6
|
+
/**
|
|
7
|
+
* Waits for a specified number of milliseconds
|
|
8
|
+
* Useful for testing async operations
|
|
9
|
+
*/
|
|
10
|
+
export declare function wait(ms: number): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Creates a deferred promise that can be resolved/rejected externally
|
|
13
|
+
*/
|
|
14
|
+
export declare function createDeferred<T>(): {
|
|
15
|
+
promise: Promise<T>;
|
|
16
|
+
resolve: (value: T) => void;
|
|
17
|
+
reject: (error: unknown) => void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Type-safe mock creator for complex objects.
|
|
21
|
+
* Returns a Partial<T>; callers are responsible for providing required properties if needed.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createMock<T>(overrides?: Partial<T>): Partial<T>;
|
|
24
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/test/helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,KAAK,UAAU,CAC3E,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAChB,CAEA;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC;;qBACT,CAAC,KAAK,IAAI;oBACX,OAAO,KAAK,IAAI;EAYrC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,GAAE,OAAO,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAEpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/test/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonlabs-io/ts-sdk",
|
|
3
|
-
"version": "0.0.0-semantic-release.
|
|
3
|
+
"version": "0.0.0-semantic-release.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -52,11 +52,14 @@
|
|
|
52
52
|
"license": "ISC",
|
|
53
53
|
"description": "TypeScript SDK for Babylon protocol integrations",
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@vitest/coverage-v8": "^4.0.8",
|
|
56
|
+
"@vitest/ui": "^4.0.8",
|
|
55
57
|
"prettier": "^3.6.2",
|
|
56
58
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
57
59
|
"typescript": "^5.8.3",
|
|
58
60
|
"vite": "^6.4.1",
|
|
59
61
|
"vite-plugin-dts": "^4.3.0",
|
|
62
|
+
"vitest": "^4.0.8",
|
|
60
63
|
"@internal/eslint-config": "0.0.0"
|
|
61
64
|
},
|
|
62
65
|
"publishConfig": {
|
|
@@ -65,6 +68,10 @@
|
|
|
65
68
|
"scripts": {
|
|
66
69
|
"build": "tsc -b --noEmit tsconfig.lib.json && vite build",
|
|
67
70
|
"format": "prettier --check \"src/**/*.ts\"",
|
|
68
|
-
"format:fix": "prettier --write \"src/**/*.ts\""
|
|
71
|
+
"format:fix": "prettier --write \"src/**/*.ts\"",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"test:watch": "vitest",
|
|
74
|
+
"test:ui": "vitest --ui",
|
|
75
|
+
"test:coverage": "vitest run --coverage"
|
|
69
76
|
}
|
|
70
77
|
}
|