@kynesyslabs/demosdk 1.0.5 → 1.0.6
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 +29 -28
- package/build/types/Operation.d.ts +1 -1
- package/build/types/addressInfo.d.ts +6 -0
- package/build/types/addressInfo.js +3 -0
- package/build/types/addressInfo.js.map +1 -0
- package/build/types/communication/transmit.d.ts +14 -0
- package/build/types/communication/transmit.js +13 -0
- package/build/types/communication/transmit.js.map +1 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/web2/index.d.ts +49 -0
- package/build/types/web2/index.js +3 -0
- package/build/types/web2/index.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kynesyslabs/demosdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Demos SDKs metapackage
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
### Core
|
|
8
|
-
|
|
9
|
-
TODO: Update once ported.
|
|
10
|
-
|
|
11
|
-
### Multichain SDKs
|
|
5
|
+
### Multichain SDKs Usage
|
|
12
6
|
|
|
13
7
|
Check out the [multichain documentation](./documentation/multichain/README.md).
|
|
14
8
|
|
|
15
|
-
## Organization
|
|
16
9
|
|
|
17
|
-
|
|
10
|
+
### Adding stuff
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
│ ├── core # default chain sdk implementation for all chains
|
|
27
|
-
│ ├── localsdk # local sdks for all chains
|
|
28
|
-
│ └── websdk # web sdks for all chains
|
|
12
|
+
Create a new folder in the `src` directory and add your stuff. Export items on the `index.ts` file in your new folder. Then add an export entry in `package.json` as shown:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
"exports": {
|
|
16
|
+
// ...
|
|
17
|
+
"./stuff": "./build/stuff/index.js"
|
|
18
|
+
}
|
|
29
19
|
```
|
|
30
20
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
This will allow users to use the new things as follows:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { Stuff, otherStuff } from '@kynesyslabs/demosdk/stuff'
|
|
34
25
|
```
|
|
35
26
|
|
|
36
|
-
|
|
27
|
+
### Running tests
|
|
37
28
|
|
|
38
29
|
```sh
|
|
39
30
|
# multichain
|
|
40
31
|
yarn test:multichain
|
|
41
32
|
```
|
|
42
33
|
|
|
43
|
-
|
|
34
|
+
### Publishing on NPM
|
|
35
|
+
|
|
36
|
+
Publishing to NPM is automated using a Github Workflow. To publish a new version:
|
|
37
|
+
|
|
38
|
+
1. Incrememt the `package.json` version field
|
|
39
|
+
2. Commit your changes with a message starting with the word `release`
|
|
40
|
+
3. Push to Github.
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
# Example:
|
|
44
|
+
git commit -m "release v1.0.5"
|
|
45
|
+
```
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
The commit will trigger a workflow run to build the files and publish a new version on NPM.
|
|
46
48
|
|
|
47
49
|
## What has Changed?
|
|
48
50
|
|
|
@@ -56,4 +58,3 @@ new: `rpc_url`, `chain_id`, `isEIP1559`
|
|
|
56
58
|
## TODOs
|
|
57
59
|
|
|
58
60
|
- Review `getBalance` return type. Should it be a string or an object?
|
|
59
|
-
-
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addressInfo.js","sourceRoot":"","sources":["../../../src/types/addressInfo.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* LICENSE
|
|
3
|
+
|
|
4
|
+
© 2023 by KyneSys Labs, licensed under CC BY-NC-ND 4.0
|
|
5
|
+
|
|
6
|
+
Full license text: https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode
|
|
7
|
+
Human readable license: https://creativecommons.org/licenses/by-nc-nd/4.0/
|
|
8
|
+
|
|
9
|
+
KyneSys Labs: https://www.kynesys.xyz/
|
|
10
|
+
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
//# sourceMappingURL=transmit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transmit.js","sourceRoot":"","sources":["../../../../src/types/communication/transmit.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { ISignature } from './ISignature';
|
|
|
5
5
|
export { StateChange } from './StateChange';
|
|
6
6
|
export { ValidityData } from './ValidityData';
|
|
7
7
|
export { RawTransaction } from './rawTransaction';
|
|
8
|
+
export { Bundle, BundleContent } from './communication/transmit';
|
|
8
9
|
export { Transaction, TransactionContent } from './Transaction';
|
|
9
10
|
export { StatusNative } from './statusNative';
|
|
10
11
|
export { statusNative as StatusProperties } from './statusProperties';
|
|
@@ -12,3 +13,4 @@ export { Operation, OperationRegistrySlot, OperationResult } from './Operation';
|
|
|
12
13
|
export { ISecurityReport, SIComlink, SIResponseRegistry, } from './network/SecurityTypes';
|
|
13
14
|
export { ExecutionResult } from './network/ExecutionResult';
|
|
14
15
|
export { IPeerConfig } from './peers/Peer';
|
|
16
|
+
export { IParam, IWeb2Payload, IWeb2Request, IWeb2Result, IRawWeb2Request, IWeb2Attestation, } from './web2';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import forge from "node-forge";
|
|
2
|
+
export interface IParam {
|
|
3
|
+
name: string;
|
|
4
|
+
value: any;
|
|
5
|
+
}
|
|
6
|
+
export interface IWeb2Payload {
|
|
7
|
+
type: "web2Request";
|
|
8
|
+
message: IWeb2Request;
|
|
9
|
+
sender: any;
|
|
10
|
+
receiver: any;
|
|
11
|
+
timestamp: any;
|
|
12
|
+
data: any;
|
|
13
|
+
extra: any;
|
|
14
|
+
}
|
|
15
|
+
export interface IWeb2Result {
|
|
16
|
+
status: number;
|
|
17
|
+
statusText: string;
|
|
18
|
+
data: any;
|
|
19
|
+
}
|
|
20
|
+
export interface IWeb2Request {
|
|
21
|
+
raw: IRawWeb2Request;
|
|
22
|
+
result: any;
|
|
23
|
+
attestations: {};
|
|
24
|
+
hash: string;
|
|
25
|
+
signature?: forge.pki.ed25519.BinaryBuffer;
|
|
26
|
+
}
|
|
27
|
+
export interface IRawWeb2Request {
|
|
28
|
+
action: string;
|
|
29
|
+
parameters: IParam[];
|
|
30
|
+
requestedParameters: [] | null;
|
|
31
|
+
method: "POST" | "GET" | "PUT" | "DELETE" | "PATCH";
|
|
32
|
+
url: string;
|
|
33
|
+
headers: any;
|
|
34
|
+
minAttestations: number;
|
|
35
|
+
stage: {
|
|
36
|
+
origin: {
|
|
37
|
+
identity: forge.pki.ed25519.BinaryBuffer;
|
|
38
|
+
connection_url: string;
|
|
39
|
+
};
|
|
40
|
+
hop_number: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface IWeb2Attestation {
|
|
44
|
+
hash: string;
|
|
45
|
+
timestamp: number;
|
|
46
|
+
identity: forge.pki.PublicKey;
|
|
47
|
+
signature: forge.pki.ed25519.BinaryBuffer;
|
|
48
|
+
valid: boolean;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/web2/index.ts"],"names":[],"mappings":""}
|