@kynesyslabs/demosdk 1.3.0 → 1.4.0
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/build/demoswork/executor/index.d.ts +2 -0
- package/build/demoswork/executor/index.js +21 -0
- package/build/demoswork/executor/index.js.map +1 -0
- package/build/demoswork/executor/stepexecutor.d.ts +18 -0
- package/build/demoswork/executor/stepexecutor.js +53 -0
- package/build/demoswork/executor/stepexecutor.js.map +1 -0
- package/build/demoswork/index.d.ts +8 -0
- package/build/demoswork/index.js +27 -0
- package/build/demoswork/index.js.map +1 -0
- package/build/demoswork/operations/baseoperation.d.ts +9 -0
- package/build/demoswork/operations/baseoperation.js +24 -0
- package/build/demoswork/operations/baseoperation.js.map +1 -0
- package/build/demoswork/operations/conditional/condition.d.ts +27 -0
- package/build/demoswork/operations/conditional/condition.js +54 -0
- package/build/demoswork/operations/conditional/condition.js.map +1 -0
- package/build/demoswork/operations/conditional/index.d.ts +31 -0
- package/build/demoswork/operations/conditional/index.js +108 -0
- package/build/demoswork/operations/conditional/index.js.map +1 -0
- package/build/demoswork/operations/index.d.ts +21 -0
- package/build/demoswork/operations/index.js +52 -0
- package/build/demoswork/operations/index.js.map +1 -0
- package/build/demoswork/utils/createTestWorkScript.d.ts +2 -0
- package/build/demoswork/utils/createTestWorkScript.js +55 -0
- package/build/demoswork/utils/createTestWorkScript.js.map +1 -0
- package/build/demoswork/utils/index.d.ts +21 -0
- package/build/demoswork/utils/index.js +61 -0
- package/build/demoswork/utils/index.js.map +1 -0
- package/build/demoswork/validator/index.d.ts +7 -0
- package/build/demoswork/validator/index.js +16 -0
- package/build/demoswork/validator/index.js.map +1 -0
- package/build/demoswork/validator/steps.validator.d.ts +8 -0
- package/build/demoswork/validator/steps.validator.js +77 -0
- package/build/demoswork/validator/steps.validator.js.map +1 -0
- package/build/demoswork/work.d.ts +14 -0
- package/build/demoswork/work.js +81 -0
- package/build/demoswork/work.js.map +1 -0
- package/build/demoswork/workstep.d.ts +82 -0
- package/build/demoswork/workstep.js +133 -0
- package/build/demoswork/workstep.js.map +1 -0
- package/build/index.d.ts +7 -6
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/multichain/core/ibc.js +2 -0
- package/build/multichain/core/ibc.js.map +1 -1
- package/build/types/blockchain/Transaction.d.ts +9 -22
- package/build/types/blockchain/ValidityData.js +2 -6
- package/build/types/blockchain/ValidityData.js.map +1 -1
- package/build/types/communication/demosWork.d.ts +6 -6
- package/build/types/demoswork/datatypes.d.ts +6 -0
- package/build/types/demoswork/datatypes.js +10 -0
- package/build/types/demoswork/datatypes.js.map +1 -0
- package/build/types/demoswork/index.d.ts +16 -0
- package/build/types/demoswork/index.js +3 -0
- package/build/types/demoswork/index.js.map +1 -0
- package/build/types/demoswork/operations.d.ts +48 -0
- package/build/types/demoswork/operations.js +3 -0
- package/build/types/demoswork/operations.js.map +1 -0
- package/build/types/demoswork/steps.d.ts +71 -0
- package/build/types/demoswork/steps.js +21 -0
- package/build/types/demoswork/steps.js.map +1 -0
- package/build/types/index.d.ts +13 -11
- package/build/types/index.js +6 -1
- package/build/types/index.js.map +1 -1
- package/build/types/native/index.d.ts +9 -0
- package/build/types/native/index.js +3 -0
- package/build/types/native/index.js.map +1 -0
- package/build/utils/pprint.d.ts +5 -0
- package/build/utils/pprint.js +17 -0
- package/build/utils/pprint.js.map +1 -0
- package/build/websdk/XMTransactions.js +1 -3
- package/build/websdk/XMTransactions.js.map +1 -1
- package/build/websdk/utils/skeletons.js +2 -0
- package/build/websdk/utils/skeletons.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.CValidityData = void 0;
|
|
7
4
|
const Cryptography_1 = require("../../encryption/Cryptography");
|
|
8
5
|
const Hashing_1 = require("../../encryption/Hashing");
|
|
9
|
-
const terminal_kit_1 = __importDefault(require("terminal-kit"));
|
|
10
|
-
const term = terminal_kit_1.default.terminal;
|
|
11
6
|
// This class allows us to work with ValidityData with ease
|
|
12
7
|
class CValidityData {
|
|
13
8
|
// Instantiation
|
|
@@ -25,7 +20,8 @@ class CValidityData {
|
|
|
25
20
|
static compile(validityData, message, privateKey, valid) {
|
|
26
21
|
validityData.data.message = message;
|
|
27
22
|
if (!valid) {
|
|
28
|
-
term.bold.red(message)
|
|
23
|
+
// term.bold.red(message)
|
|
24
|
+
console.log(message);
|
|
29
25
|
validityData.data.valid = false;
|
|
30
26
|
}
|
|
31
27
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidityData.js","sourceRoot":"","sources":["../../../../src/types/blockchain/ValidityData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ValidityData.js","sourceRoot":"","sources":["../../../../src/types/blockchain/ValidityData.ts"],"names":[],"mappings":";;;AAGA,4DAAwD;AACxD,kDAA8C;AAgB9C,2DAA2D;AAC3D,MAAa,aAAa;IAYtB,gBAAgB;IAChB,YACI,WAAwB,EACxB,SAAmC,EACnC,eAAuB;QAEvB,IAAI,CAAC,IAAI,GAAG;YACR,KAAK,EAAE,KAAK;YACZ,eAAe,EAAE,eAAe;YAChC,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,IAAI;YACnB,WAAW,EAAE,WAAW;SAC3B,CACA;QAAA,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;IAC/D,CAAC;IAED,yBAAyB;IAClB,MAAM,CAAC,OAAO,CACjB,YAA0B,EAC1B,OAAe,EACf,UAAoC,EACpC,KAAc;QAEd,YAAY,CAAC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACnC,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,yBAAyB;YACzB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YACpB,YAAY,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACnC,CAAC;aAAM,CAAC;YACJ,YAAY,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QAClC,CAAC;QACD,IAAI,IAAI,GAAG,iBAAO,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA;QAC5D,YAAY,CAAC,SAAS,GAAG,2BAAY,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;QAC5D,OAAO,YAAY,CAAA;IACvB,CAAC;CACJ;AA/CD,sCA+CC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as forge from "node-forge";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { XMScript } from "../xm";
|
|
3
|
+
import { IWeb2Request } from "../web2";
|
|
4
|
+
import { INativePayload } from "../native";
|
|
5
5
|
export type XMStep = {
|
|
6
6
|
context: "xm";
|
|
7
|
-
payload:
|
|
7
|
+
payload: XMScript;
|
|
8
8
|
};
|
|
9
9
|
export type Web2Step = {
|
|
10
10
|
context: "web2";
|
|
11
|
-
payload:
|
|
11
|
+
payload: IWeb2Request;
|
|
12
12
|
};
|
|
13
13
|
export type NativeStep = {
|
|
14
14
|
context: "native";
|
|
15
|
-
payload:
|
|
15
|
+
payload: INativePayload;
|
|
16
16
|
};
|
|
17
17
|
export type demosStepType = XMStep | Web2Step | NativeStep;
|
|
18
18
|
export interface demosStepContent {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataTypes = void 0;
|
|
4
|
+
var DataTypes;
|
|
5
|
+
(function (DataTypes) {
|
|
6
|
+
DataTypes["work"] = "$work";
|
|
7
|
+
DataTypes["internal"] = "$internal";
|
|
8
|
+
DataTypes["static"] = "$static";
|
|
9
|
+
})(DataTypes || (exports.DataTypes = DataTypes = {}));
|
|
10
|
+
//# sourceMappingURL=datatypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datatypes.js","sourceRoot":"","sources":["../../../../src/types/demoswork/datatypes.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,2BAAc,CAAA;IACd,mCAAsB,CAAA;IACtB,+BAAkB,CAAA;AACtB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WorkStep } from "../../demoswork/workstep";
|
|
2
|
+
import { DemosWorkOperationScripts, OperationOutputKey } from "./operations";
|
|
3
|
+
import { StepOutputKey } from "./steps";
|
|
4
|
+
/**
|
|
5
|
+
* The final shape of the work script
|
|
6
|
+
*/
|
|
7
|
+
export interface DemoScript {
|
|
8
|
+
operationOrder: Set<string>;
|
|
9
|
+
operations: {
|
|
10
|
+
[key: string]: DemosWorkOperationScripts;
|
|
11
|
+
};
|
|
12
|
+
steps: {
|
|
13
|
+
[key: string]: WorkStep;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type DemosWorkOutputKey = OperationOutputKey | StepOutputKey;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/demoswork/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ConditionalOperation, DemosWorkOperation, WorkStep } from "../../demoswork";
|
|
2
|
+
import { Conditional } from "./steps";
|
|
3
|
+
import { DataTypes, operators } from "./datatypes";
|
|
4
|
+
import { DemosWorkOutputKey } from ".";
|
|
5
|
+
export type OperationType = "conditional" | "loop" | "operation" | "function" | "base";
|
|
6
|
+
export interface OperationScript {
|
|
7
|
+
id: string;
|
|
8
|
+
operationType: OperationType;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The shape of the parameters for a condition
|
|
12
|
+
* that has only one operand and an operator.
|
|
13
|
+
* ie. The logical NOT operator.
|
|
14
|
+
*/
|
|
15
|
+
export type UnaryConditionParams = {
|
|
16
|
+
action?: WorkStep | DemosWorkOperation | null;
|
|
17
|
+
value_a: DemosWorkOutputKey | any;
|
|
18
|
+
operator: "not";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The shape of the parameters for a condition
|
|
22
|
+
* that has two operands and an operator.
|
|
23
|
+
*/
|
|
24
|
+
export type BinaryConditionParams = {
|
|
25
|
+
action?: WorkStep | DemosWorkOperation | null;
|
|
26
|
+
value_a: DemosWorkOutputKey | any;
|
|
27
|
+
value_b: DemosWorkOutputKey | any;
|
|
28
|
+
operator: Exclude<operators, "not">;
|
|
29
|
+
};
|
|
30
|
+
export type ConditionParams = BinaryConditionParams | UnaryConditionParams;
|
|
31
|
+
export interface ConditionalOperationScript extends OperationScript {
|
|
32
|
+
operationType: "conditional";
|
|
33
|
+
conditions: Map<string, Conditional>;
|
|
34
|
+
order: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface BaseOperationScript extends OperationScript {
|
|
37
|
+
operationType: "base";
|
|
38
|
+
work: Array<string>;
|
|
39
|
+
}
|
|
40
|
+
export type DemosWorkOperations = DemosWorkOperation | ConditionalOperation | BaseOperationScript;
|
|
41
|
+
export type DemosWorkOperationScripts = ConditionalOperationScript | BaseOperationScript;
|
|
42
|
+
export interface OperationOutputKey {
|
|
43
|
+
type: DataTypes.work;
|
|
44
|
+
src: {
|
|
45
|
+
self: DemosWorkOperation;
|
|
46
|
+
key: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/types/demoswork/operations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { XMScript } from "../xm";
|
|
2
|
+
import { DataTypes, operators } from "./datatypes";
|
|
3
|
+
import { Condition, DemosWorkOperation } from "../../demoswork";
|
|
4
|
+
import { WorkStep } from "../../demoswork/workstep";
|
|
5
|
+
import { INativePayload } from "../native";
|
|
6
|
+
import { IWeb2Request } from "../web2";
|
|
7
|
+
/**
|
|
8
|
+
* The condition operand type
|
|
9
|
+
*
|
|
10
|
+
* This type is used to define the data type of the operands in a condition.
|
|
11
|
+
* This can be either a static value (number, string, object, etc.) or an internal value (a reference to a work output).
|
|
12
|
+
*/
|
|
13
|
+
export type Operand = {
|
|
14
|
+
type: DataTypes.static;
|
|
15
|
+
value: any;
|
|
16
|
+
} | {
|
|
17
|
+
type: DataTypes.internal;
|
|
18
|
+
workUID: string;
|
|
19
|
+
key: string;
|
|
20
|
+
};
|
|
21
|
+
interface BaseCondition {
|
|
22
|
+
operator: operators;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The shape of the condition
|
|
26
|
+
* that is used in `DemosWork.if` and friends
|
|
27
|
+
*/
|
|
28
|
+
export interface ICondition extends BaseCondition {
|
|
29
|
+
value_a: Condition | Operand;
|
|
30
|
+
value_b: Condition | Operand;
|
|
31
|
+
action: WorkStep | DemosWorkOperation;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The shape of the conditional operation
|
|
35
|
+
* on the conditional script.
|
|
36
|
+
*/
|
|
37
|
+
export interface Conditional extends BaseCondition {
|
|
38
|
+
id?: string;
|
|
39
|
+
value_b: Operand;
|
|
40
|
+
value_a: Operand;
|
|
41
|
+
work?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Keys that can be used to refer to the output of a step
|
|
45
|
+
*/
|
|
46
|
+
export declare enum stepKeysEnum {
|
|
47
|
+
"output.result" = "output.result",
|
|
48
|
+
"output.hash" = "output.hash"
|
|
49
|
+
}
|
|
50
|
+
export type stepKeys = keyof typeof stepKeysEnum;
|
|
51
|
+
export type WorkStepInput = XMScript | IWeb2Request | INativePayload;
|
|
52
|
+
/**
|
|
53
|
+
* The object you get when you refer to the output of a step
|
|
54
|
+
*
|
|
55
|
+
* @example sendEther.output.result
|
|
56
|
+
*/
|
|
57
|
+
export interface StepOutputKey {
|
|
58
|
+
type: DataTypes.work;
|
|
59
|
+
src: {
|
|
60
|
+
self: WorkStep;
|
|
61
|
+
key: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A xm step can either be a success or error
|
|
66
|
+
*/
|
|
67
|
+
export declare enum XmStepResult {
|
|
68
|
+
success = "success",
|
|
69
|
+
error = "error"
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.XmStepResult = exports.stepKeysEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Keys that can be used to refer to the output of a step
|
|
6
|
+
*/
|
|
7
|
+
var stepKeysEnum;
|
|
8
|
+
(function (stepKeysEnum) {
|
|
9
|
+
stepKeysEnum["output.result"] = "output.result";
|
|
10
|
+
stepKeysEnum["output.hash"] = "output.hash";
|
|
11
|
+
// others here
|
|
12
|
+
})(stepKeysEnum || (exports.stepKeysEnum = stepKeysEnum = {}));
|
|
13
|
+
/**
|
|
14
|
+
* A xm step can either be a success or error
|
|
15
|
+
*/
|
|
16
|
+
var XmStepResult;
|
|
17
|
+
(function (XmStepResult) {
|
|
18
|
+
XmStepResult["success"] = "success";
|
|
19
|
+
XmStepResult["error"] = "error";
|
|
20
|
+
})(XmStepResult || (exports.XmStepResult = XmStepResult = {}));
|
|
21
|
+
//# sourceMappingURL=steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../../../src/types/demoswork/steps.ts"],"names":[],"mappings":";;;AA0CA;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,+CAAiC,CAAA;IACjC,2CAA6B,CAAA;IAC7B,cAAc;AAClB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAkBD;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACnB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { GenesisArtifact, GenesisImmutableProperties, GenesisMutableProperties, StandardGenesis, forkGenesis } from "./blockchain/genesisTypes";
|
|
2
|
+
export { Block, BlockContent } from "./blockchain/blocks";
|
|
3
|
+
export { EncryptedTransaction } from "./blockchain/encryptedTransaction";
|
|
4
4
|
export { ISignature } from "./blockchain/ISignature";
|
|
5
|
+
export { RawTransaction } from "./blockchain/rawTransaction";
|
|
6
|
+
export { Transaction, TransactionContent, TransactionContentData } from "./blockchain/Transaction";
|
|
5
7
|
export { TxFee } from "./blockchain/TxFee";
|
|
6
8
|
export { CValidityData, ValidityData } from "./blockchain/ValidityData";
|
|
7
|
-
export { BlockContent, Block } from "./blockchain/blocks";
|
|
8
|
-
export { Transaction, TransactionContent, _TransactionContent, XMPayload, Web2Payload, NativePayload, StringifiedPayload, } from "./blockchain/Transaction";
|
|
9
|
-
export { EncryptedTransaction } from "./blockchain/encryptedTransaction";
|
|
10
|
-
export { RawTransaction } from "./blockchain/rawTransaction";
|
|
11
9
|
export { Bundle, BundleContent } from "./communication/transmit";
|
|
12
10
|
export { AddressInfo } from "./blockchain/addressInfo";
|
|
13
11
|
export { StatusNative } from "./blockchain/statusNative";
|
|
14
12
|
export { statusNative as StatusProperties } from "./blockchain/statusProperties";
|
|
15
|
-
export { Operation, OperationRegistrySlot, OperationResult
|
|
13
|
+
export { Operation, OperationRegistrySlot, OperationResult } from "./gls/Operation";
|
|
16
14
|
export { StateChange } from "./gls/StateChange";
|
|
17
15
|
export { ExecutionResult } from "./network/ExecutionResult";
|
|
18
|
-
export { ISecurityReport, SIComlink, SIResponseRegistry
|
|
16
|
+
export { ISecurityReport, SIComlink, SIResponseRegistry } from "./network/SecurityTypes";
|
|
19
17
|
export { IPeerConfig } from "./peers/Peer";
|
|
20
|
-
export { IParam, IRawWeb2Request, IWeb2Attestation, IWeb2Payload, IWeb2Request, IWeb2Result
|
|
21
|
-
export {
|
|
18
|
+
export { IParam, IRawWeb2Request, IWeb2Attestation, IWeb2Payload, IWeb2Request, IWeb2Result } from "./web2";
|
|
19
|
+
export { IOperation, ITask, XMScript } from "./xm";
|
|
20
|
+
export { DemoScript } from "./demoswork";
|
|
21
|
+
export { DataTypes, operators } from "./demoswork/datatypes";
|
|
22
|
+
export { ConditionalOperationScript, DemosWorkOperationScripts, OperationScript, OperationType } from "./demoswork/operations";
|
|
23
|
+
export { ICondition, Conditional, StepOutputKey, WorkStepInput, XmStepResult, stepKeys, stepKeysEnum } from "./demoswork/steps";
|
|
22
24
|
export { BrowserRequest, ConsensusRequest, RPCRequest, RPCResponse, HelloPeerRequest, NodeCall, VoteRequest, emptyResponse as RPCResponseSkeleton } from "./communication/rpc";
|
package/build/types/index.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RPCResponseSkeleton = exports.CValidityData = void 0;
|
|
3
|
+
exports.RPCResponseSkeleton = exports.stepKeysEnum = exports.XmStepResult = exports.DataTypes = exports.CValidityData = void 0;
|
|
4
4
|
var ValidityData_1 = require("./blockchain/ValidityData");
|
|
5
5
|
Object.defineProperty(exports, "CValidityData", { enumerable: true, get: function () { return ValidityData_1.CValidityData; } });
|
|
6
|
+
var datatypes_1 = require("./demoswork/datatypes");
|
|
7
|
+
Object.defineProperty(exports, "DataTypes", { enumerable: true, get: function () { return datatypes_1.DataTypes; } });
|
|
8
|
+
var steps_1 = require("./demoswork/steps");
|
|
9
|
+
Object.defineProperty(exports, "XmStepResult", { enumerable: true, get: function () { return steps_1.XmStepResult; } });
|
|
10
|
+
Object.defineProperty(exports, "stepKeysEnum", { enumerable: true, get: function () { return steps_1.stepKeysEnum; } });
|
|
6
11
|
var rpc_1 = require("./communication/rpc");
|
|
7
12
|
Object.defineProperty(exports, "RPCResponseSkeleton", { enumerable: true, get: function () { return rpc_1.emptyResponse; } });
|
|
8
13
|
//# sourceMappingURL=index.js.map
|
package/build/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAkBA,0DAAuE;AAA9D,6GAAA,aAAa,OAAA;AAwCtB,mDAA4D;AAAnD,sGAAA,SAAS,OAAA;AAOlB,2CAQ0B;AAHtB,qGAAA,YAAY,OAAA;AAEZ,qGAAA,YAAY,OAAA;AAGhB,2CAS4B;AADxB,0GAAA,aAAa,OAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/native/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = pprint;
|
|
7
|
+
const util_1 = __importDefault(require("util"));
|
|
8
|
+
/**
|
|
9
|
+
* Pretty prints a fully expanded object to the console.
|
|
10
|
+
* @param obj The object to print
|
|
11
|
+
*/
|
|
12
|
+
function pprint(...objects) {
|
|
13
|
+
objects.forEach(obj => {
|
|
14
|
+
console.log(util_1.default.inspect(obj, false, null, true));
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=pprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pprint.js","sourceRoot":"","sources":["../../../src/utils/pprint.ts"],"names":[],"mappings":";;;;;AAMA,yBAIC;AAVD,gDAAuB;AAEvB;;;GAGG;AACH,SAAwB,MAAM,CAAC,GAAG,OAAc;IAC5C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAClB,OAAO,CAAC,GAAG,CAAC,cAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;IACrD,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -123,8 +123,6 @@ async function prepareXMPayload(xm_payload, keypair) {
|
|
|
123
123
|
// Producing a timestamp
|
|
124
124
|
xm_transaction.content.timestamp = Date.now();
|
|
125
125
|
// Signing the transaction
|
|
126
|
-
|
|
127
|
-
// Returning the transaction
|
|
128
|
-
return xm_transaction;
|
|
126
|
+
return await DemosTransactions_1.DemosTransactions.sign(xm_transaction, keypair);
|
|
129
127
|
}
|
|
130
128
|
//# sourceMappingURL=XMTransactions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XMTransactions.js","sourceRoot":"","sources":["../../../src/websdk/XMTransactions.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,6DAA6D;;;
|
|
1
|
+
{"version":3,"file":"XMTransactions.js","sourceRoot":"","sources":["../../../src/websdk/XMTransactions.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,6DAA6D;;;AA+IpC,4CAAgB;AA5IzC,2DAAwD;AAGxD,mFAAmF;AACnF,MAAM,cAAc,GAAG;IACrB,OAAO,EAAE;QACP,cAAc,EAAE;YACd,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,KAAK;YACb,GAAG,EAA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gBAAgB,CAAC,UAAoB,EAAE,OAAiB;IACrE,IAAI,cAAc,GAAgB,qCAAiB,CAAC,KAAK,EAAE,CAAA;IAC3D,8CAA8C;IAC9C,cAAc,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,SAAuB,CAAA;IAC7D,cAAc,CAAC,OAAO,CAAC,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,IAAI,CAAA;IACvD,4BAA4B;IAC5B,cAAc,CAAC,OAAO,CAAC,IAAI,GAAG,qBAAqB,CAAA;IACnD,cAAc,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAA;IACjE,wBAAwB;IACxB,cAAc,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAC7C,0BAA0B;IAC1B,OAAO,MAAM,qCAAiB,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;AAC9D,CAAC"}
|
|
@@ -7,10 +7,12 @@ const web2_1 = require("../../types/web2");
|
|
|
7
7
|
// INFO An empty transaction
|
|
8
8
|
const transaction = {
|
|
9
9
|
content: {
|
|
10
|
+
// @ts-expect-error
|
|
10
11
|
type: '', // string
|
|
11
12
|
from: '', // forge.pki.ed25519.BinaryBuffer
|
|
12
13
|
to: '', // forge.pki.ed25519.BinaryBuffer
|
|
13
14
|
amount: 0, // number
|
|
15
|
+
// @ts-expect-error
|
|
14
16
|
data: ['', ''], // [string, string] // type as string and content in hex string
|
|
15
17
|
nonce: 0, // number // Increments every time a transaction is sent from the same account
|
|
16
18
|
timestamp: 0, // number // Is the registered unix timestamp when the transaction was sent the first time
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeletons.js","sourceRoot":"","sources":["../../../../src/websdk/utils/skeletons.ts"],"names":[],"mappings":";;;AACA,uCAA8C;AAC9C,yEAAyE;AACzE,UAAU;AAEV,4BAA4B;AAC5B,MAAM,WAAW,GAAgB;IAC7B,OAA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B7B,oCAAoC;AACpC,MAAM,YAAY,GAAG;IACjB,GAAG,EAAE;QACD,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,EAAE;QACd,mBAAmB,EAAE,IAAI,EAAE,YAAY;QACvC,MAAM,EAAE,sBAAe,CAAC,GAAG;QAC3B,GAAG,EAAE,EAAE;QACP,OAAO,EAAE,IAAI;QACb,eAAe,EAAE,CAAC;QAClB,iDAAiD;QACjD,KAAK,EAAE;YACH,4CAA4C;YAC5C,MAAM,EAAE;gBACJ,QAAQ,EAAE,EAAE;gBACZ,cAAc,EAAE,EAAE;aACrB;YACD,oDAAoD;YACpD,UAAU,EAAE,CAAC;SAChB;KACJ;IACD,MAAM,EAAE,IAAI;IACZ,YAAY,EAAE,IAAI,GAAG,EAAE;IACvB,IAAI,EAAE,EAAE;IACR,SAAS,EAAE,EAAE;CAChB,CAAA;AAE2C,oCAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kynesyslabs/demosdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"author": "Kynesys Labs",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
".": "./build/index.js",
|
|
14
14
|
"./types": "./build/types/index.js",
|
|
15
15
|
"./websdk": "./build/websdk/index.js",
|
|
16
|
+
"./demoswork": "./build/demoswork/index.js",
|
|
16
17
|
"./xm-websdk": "./build/multichain/websdk/index.js",
|
|
17
18
|
"./xm-localsdk": "./build/multichain/localsdk/index.js",
|
|
18
19
|
"./wallet": "./build/wallet/index.js"
|
|
@@ -20,8 +21,9 @@
|
|
|
20
21
|
"scripts": {
|
|
21
22
|
"build": "rm -rf build && tsc --skipLibCheck && resolve-tspaths && mv build/src/* build/ && rm -rf build/src",
|
|
22
23
|
"publish": "yarn npm publish",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
24
|
+
"typedoc": "typedoc --out docs src/index.ts --excludeExternals --excludePrivate --excludeProtected",
|
|
25
|
+
"test:multichain": "rm -rf build && jest --testMatch '**/tests/**/ibc*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
26
|
+
"test:demoswork": "rm -rf build && jest --testMatch '**/tests/**/demoswork*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose"
|
|
25
27
|
},
|
|
26
28
|
"dependencies": {
|
|
27
29
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
@@ -37,7 +39,6 @@
|
|
|
37
39
|
"@ton/crypto": "^3.2.0",
|
|
38
40
|
"@ton/ton": "^13.11.2",
|
|
39
41
|
"@types/rijndael-js": "^1.0.2",
|
|
40
|
-
"@types/terminal-kit": "^2.5.6",
|
|
41
42
|
"argon2": "^0.40.1",
|
|
42
43
|
"axios": "^1.7.4",
|
|
43
44
|
"big-integer": "^1.6.52",
|
|
@@ -52,7 +53,6 @@
|
|
|
52
53
|
"rijndael-js": "^2.0.0",
|
|
53
54
|
"socket.io-client": "^4.7.2",
|
|
54
55
|
"superdilithium": "^2.0.6",
|
|
55
|
-
"terminal-kit": "^3.1.1",
|
|
56
56
|
"web3": "^4.9.0",
|
|
57
57
|
"xrpl": "^3.0.0"
|
|
58
58
|
},
|