Skip to content

Commit 933efb2

Browse files
committed
feat: adjusted crypto module for import in React Native, some refactorings
1 parent e26c997 commit 933efb2

Some content is hidden

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

49 files changed

+506
-136
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,13 @@ This monorepo uses [changeset](https://github.com/changesets/changesets) to mana
256256

257257
1. Create a changeset: `npx changeset`
258258
2. Bump version: `npx changeset version`
259-
3. Publish `npx changeset publish --tag <VERSION> --otp <NPM_OTP>`
259+
3. Create git tag: `git tag <VERSION>` (starting with `v`, e.g. `v2.0.2`)
260+
3. Publish `npx changeset publish --no-git-tag --otp=<NPM_OTP>`
260261

261262
The latter can be run as
262263

263264
```bash
264-
npm run publish v2.0.1 --otp 123456
265+
npm run publish v2.0.1 --otp=123456
265266
```
266267

267268
> Note: Only with a valid npm OTP token

package-lock.json

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"compile": "turbo run compile",
3939
"bundle": "turbo run bundle",
4040
"doc": "typedoc",
41-
"publish": "turbo run compile test bundle && changeset publish --tag",
41+
"publish": "./publish.sh",
4242
"test": "turbo run test",
4343
"test:ci": "turbo run test:ci",
4444
"posttest:ci": "./generate-coverage-report.sh",

packages/contracts/CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Change Log
22

3+
## 2.0.3
4+
5+
### Patch Changes
6+
7+
- Decoupled Crypto Provider. Breaking Change as this requires the developer to define the platform specific crypto provider before using the sdk
8+
9+
Breaking Change:
10+
11+
If you see the following error:
12+
13+
```ts
14+
"No Crypto Provider provided - Use [Crypto.init()] first";
15+
```
16+
17+
You need to initialize the crypto module with the platform specific CryptoProvider.
18+
19+
**NodeJS**
20+
21+
```ts
22+
import { Crypto, NodeJSCryptoProvider } from "@signumjs/crypto";
23+
Crypto.init(new NodeJSCryptoProvider());
24+
```
25+
26+
**Web/Browser**
27+
28+
```ts
29+
import { Crypto, WebCryptoProvider } from "@signumjs/crypto";
30+
Crypto.init(new WebCryptoProvider());
31+
```
32+
33+
> Further implementations will be provided as external modules/packages, i.e. React Native Expo
34+
35+
- Updated dependencies
36+
- @signumjs/util@2.0.3
37+
338
## 2.0.2
439

540
### Patch Changes

packages/contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@signumjs/contracts",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Smart Contracts package for Signum Network",
55
"keywords": [
66
"signum",

packages/core/CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# Change Log
22

3+
## 2.0.3
4+
5+
### Patch Changes
6+
7+
- Decoupled Crypto Provider. Breaking Change as this requires the developer to define the platform specific crypto provider before using the sdk
8+
9+
Breaking Change:
10+
11+
If you see the following error:
12+
13+
```ts
14+
"No Crypto Provider provided - Use [Crypto.init()] first";
15+
```
16+
17+
You need to initialize the crypto module with the platform specific CryptoProvider.
18+
19+
**NodeJS**
20+
21+
```ts
22+
import { Crypto, NodeJSCryptoProvider } from "@signumjs/crypto";
23+
Crypto.init(new NodeJSCryptoProvider());
24+
```
25+
26+
**Web/Browser**
27+
28+
```ts
29+
import { Crypto, WebCryptoProvider } from "@signumjs/crypto";
30+
Crypto.init(new WebCryptoProvider());
31+
```
32+
33+
> Further implementations will be provided as external modules/packages, i.e. React Native Expo
34+
35+
- Updated dependencies
36+
- @signumjs/crypto@2.0.3
37+
- @signumjs/contracts@2.0.3
38+
- @signumjs/http@2.0.3
39+
- @signumjs/util@2.0.3
40+
341
## 2.0.2
442

543
### Patch Changes

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@signumjs/core",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Principal package with functions and models for building Signum Network applications.",
55
"keywords": [
66
"signum",

packages/core/vitest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { defineConfig } from 'vitest/config'
44
export default defineConfig({
55
test: {
66
globals: true,
7+
setupFiles: ['./vitest.setup.ts'],
78
coverage: {
89
reporter: [['json', {file : "core-coverage.json"}]],
910
include: ["src/**"],
1011
}
1112
}
12-
})
13+
})

packages/core/vitest.setup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {Crypto} from '@signumjs/crypto';
2+
import {NodeJSCryptoAdapter} from "@signumjs/crypto/adapters"
3+
Crypto.init(new NodeJSCryptoAdapter())

packages/crypto/CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Change Log
22

3+
## 2.0.3
4+
5+
### Patch Changes
6+
7+
- Decoupled Crypto Provider. Breaking Change as this requires the developer to define the platform specific crypto provider before using the sdk
8+
9+
Breaking Change:
10+
11+
If you see the following error:
12+
13+
```ts
14+
"No Crypto Provider provided - Use [Crypto.init()] first";
15+
```
16+
17+
You need to initialize the crypto module with the platform specific CryptoProvider.
18+
19+
**NodeJS**
20+
21+
```ts
22+
import { Crypto, NodeJSCryptoProvider } from "@signumjs/crypto";
23+
Crypto.init(new NodeJSCryptoProvider());
24+
```
25+
26+
**Web/Browser**
27+
28+
```ts
29+
import { Crypto, WebCryptoProvider } from "@signumjs/crypto";
30+
Crypto.init(new WebCryptoProvider());
31+
```
32+
33+
> Further implementations will be provided as external modules/packages, i.e. React Native Expo
34+
335
## 2.0.2
436

537
### Patch Changes

0 commit comments

Comments
 (0)