@kynesyslabs/demosdk 2.3.25 → 2.3.27

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.
Files changed (2) hide show
  1. package/README.md +54 -21
  2. package/package.json +4 -1
package/README.md CHANGED
@@ -1,7 +1,12 @@
1
1
  # Demos SDK
2
2
 
3
+ ![npm version](https://img.shields.io/npm/v/@kynesyslabs/demosdk)
4
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg)
5
+
3
6
  A JavaScript/TypeScript SDK providing a unified interface for interacting with the Demos network and cross-chain operations.
4
7
 
8
+ ***IMPORTANT*** This SDK is built with bun and performs the best with bun
9
+
5
10
  ## Requirements
6
11
 
7
12
  - Node.js 18.0 or higher
@@ -9,9 +14,19 @@ A JavaScript/TypeScript SDK providing a unified interface for interacting with t
9
14
 
10
15
  ## Installation
11
16
 
17
+ ```sh
18
+ bun install @kynesyslabs/demosdk
19
+ ```
20
+
21
+ or
22
+
12
23
  ```sh
13
24
  npm install @kynesyslabs/demosdk
14
- # or
25
+ ```
26
+
27
+ or
28
+
29
+ ```sh
15
30
  yarn add @kynesyslabs/demosdk
16
31
  ```
17
32
 
@@ -139,7 +154,11 @@ const result = await demos.broadcast(validityData)
139
154
  ### Building from Source
140
155
 
141
156
  ```sh
142
- yarn build
157
+ # Install dependencies first
158
+ bun install # or npm install, or yarn install
159
+
160
+ # Then build
161
+ bun run build # or npm run build, or yarn build
143
162
  ```
144
163
 
145
164
  ### Local Development
@@ -148,36 +167,48 @@ To use the SDK from a local source:
148
167
 
149
168
  ```sh
150
169
  # Build the SDK
151
- yarn build
170
+ bun run build # or yarn build, or npm run build
152
171
 
153
172
  # In your project
154
- yarn add file:../path/to/sdks
173
+ bun add file:../path/to/sdks # or yarn/npm add file:../path/to/sdks
155
174
  ```
156
175
 
157
176
  ### Testing
158
177
 
159
- Run specific test suites:
178
+ Run specific test suites (works with both bun and yarn):
160
179
 
161
180
  ```sh
162
- yarn test:multichain # Cross-chain SDK payload generation
163
- yarn test:tx # Cross-chain transaction tests
164
- yarn test:demoswork # DemosWork operations
165
- yarn test:native # Native payment transactions
166
- yarn test:identities # Identity management
167
- yarn test:web2 # Web2 proxy functionality
168
- yarn test:bridge # Bridge service tests
169
- yarn test:btc # Bitcoin-specific tests
170
- yarn test:evm # EVM chain tests
171
- yarn test:pqc # Post-quantum cryptography
181
+ bun test:multichain # Cross-chain SDK payload generation
182
+ bun test:tx # Cross-chain transaction tests
183
+ bun test:demoswork # DemosWork operations
184
+ bun test:native # Native payment transactions
185
+ bun test:identities # Identity management
186
+ bun test:web2 # Web2 proxy functionality
187
+ bun test:bridge # Bridge service tests
188
+ bun test:btc # Bitcoin-specific tests
189
+ bun test:evm # EVM chain tests
190
+ bun test:pqc # Post-quantum cryptography
191
+
192
+ # Or with yarn/npm:
193
+ yarn test:multichain
194
+ npm run test:multichain
172
195
  ```
173
196
 
174
- ### Pre-push Hook Setup
197
+ ### Automatic Build Validation
175
198
 
176
- Ensure code quality before pushing:
199
+ The repository includes a pre-commit hook that automatically validates the build before allowing commits. This hook is installed automatically when you run `bun install` (or npm/yarn install).
177
200
 
178
- ```sh
179
- yarn setup:pre-push
180
- ```
201
+ #### Features
202
+ - Automatically runs `build` command before each commit
203
+ - Works with bun, npm, or yarn (auto-detects available package manager)
204
+ - Prevents commits if the build fails
205
+ - Installs automatically on `bun/npm/yarn install`
206
+
207
+ #### Bypassing the Check
208
+ For debugging or temporary commits, you can skip the build check:
209
+ 1. Start your commit message with 'DEBUG' or 'TEMP'
210
+ 2. Use `git commit --no-verify`
211
+ 3. Use `GIT_SKIP_BUILD=true git commit`
181
212
 
182
213
  ## Publishing
183
214
 
@@ -189,10 +220,12 @@ The SDK is automatically published to NPM when:
189
220
 
190
221
  Example:
191
222
  ```sh
192
- git commit -m "release v2.3.9"
223
+ git commit -m "release v2.3.25"
193
224
  git push
194
225
  ```
195
226
 
227
+ For simplicity, a `publish.sh` script is included. By default it will ask to forward the version, but you can re-publish the same version number with `./publish.sh -r`.
228
+
196
229
  ## Documentation
197
230
 
198
231
  - **API Reference**: [https://kynesyslabs.github.io/demosdk-api-ref/](https://kynesyslabs.github.io/demosdk-api-ref/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kynesyslabs/demosdk",
3
- "version": "2.3.25",
3
+ "version": "2.3.27",
4
4
  "description": "Demosdk is a JavaScript/TypeScript SDK that provides a unified interface for interacting with Demos network",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -26,10 +26,13 @@
26
26
  "./bridge": "./build/bridge/index.js"
27
27
  },
28
28
  "scripts": {
29
+ "postinstall": "cp .github/hooks/pre-commit .git/hooks/pre-commit 2>/dev/null && chmod +x .git/hooks/pre-commit 2>/dev/null || true",
29
30
  "build": "rm -rf build && tsc --skipLibCheck && resolve-tspaths && mv build/src/* build/ && rm -rf build/src",
30
31
  "typedoc": "typedoc",
31
32
  "test": "jest",
32
33
  "setup:pre-push": "cp .github/hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && echo \"Pre-push hook installed\"",
34
+ "setup:pre-commit": "cp .github/hooks/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit && echo \"Pre-commit hook installed\"",
35
+ "setup:hooks": "bun run setup:pre-push && bun run setup:pre-commit",
33
36
  "test:multichain": "rm -rf build && jest --testMatch '**/tests/**/{coin,evm}*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
34
37
  "test:tx": "rm -rf build && jest --testMatch '**/tests/multichain**/fulltx*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
35
38
  "test:demoswork": "rm -rf build && jest --testMatch '**/tests/**/demoswork*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",