@kynesyslabs/demosdk 1.9.1 → 1.9.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/build/types/blockchain/Transaction.d.ts +2 -2
- package/build/types/index.d.ts +1 -1
- package/build/types/index.js.map +1 -1
- package/build/types/web2/index.d.ts +8 -0
- package/build/types/web2/index.js.map +1 -1
- package/build/websdk/Web2Transactions.js +21 -13
- package/build/websdk/Web2Transactions.js.map +1 -1
- package/package.json +2 -1
|
@@ -2,12 +2,12 @@ import * as forge from "node-forge";
|
|
|
2
2
|
import { ISignature } from "./ISignature";
|
|
3
3
|
import { TxFee } from "./TxFee";
|
|
4
4
|
import { DemoScript } from "../demoswork";
|
|
5
|
-
import {
|
|
5
|
+
import { IWeb2Payload } from "../web2";
|
|
6
6
|
import { XMScript } from "../xm";
|
|
7
7
|
import { GCREdit } from "./GCREdit";
|
|
8
8
|
import { INativePayload } from "../native";
|
|
9
9
|
import { SubnetPayload } from "../../l2ps";
|
|
10
|
-
export type TransactionContentData = ["web2Request",
|
|
10
|
+
export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["subnet", SubnetPayload];
|
|
11
11
|
export interface TransactionContent {
|
|
12
12
|
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis";
|
|
13
13
|
from: forge.pki.ed25519.BinaryBuffer | forge.pki.PublicKey | ISignature;
|
package/build/types/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { StateChange } from "./gls/StateChange";
|
|
|
17
17
|
export { ExecutionResult } from "./network/ExecutionResult";
|
|
18
18
|
export { ISecurityReport, SIComlink, SIResponseRegistry, } from "./network/SecurityTypes";
|
|
19
19
|
export { IPeerConfig, IPeer } from "./peers/Peer";
|
|
20
|
-
export { IParam, IRawWeb2Request, IWeb2Attestation, IWeb2Request, IWeb2Result, ISendHTTPRequestParams, IAuthorizationException, IAuthorizationConfig, IWeb2RequestOptions, IStartProxyParams, IAttestationWithResponse, IDAHRStartProxyParams, IHandleWeb2ProxyRequestParams, EnumWeb2Methods, EnumWeb2Actions, } from "./web2";
|
|
20
|
+
export { IParam, IRawWeb2Request, IWeb2Attestation, IWeb2Request, IWeb2Payload, IWeb2Result, ISendHTTPRequestParams, IAuthorizationException, IAuthorizationConfig, IWeb2RequestOptions, IStartProxyParams, IAttestationWithResponse, IDAHRStartProxyParams, IHandleWeb2ProxyRequestParams, EnumWeb2Methods, EnumWeb2Actions, } from "./web2";
|
|
21
21
|
export { IOperation, ITask, XMScript } from "./xm";
|
|
22
22
|
export { DemoScript } from "./demoswork";
|
|
23
23
|
export { DataTypes, operators } from "./demoswork/datatypes";
|
package/build/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAuBA,0DAAuE;AAA9D,6GAAA,aAAa,OAAA;AA+BtB,OAAO;AACP,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAuBA,0DAAuE;AAA9D,6GAAA,aAAa,OAAA;AA+BtB,OAAO;AACP,+BAiBe;AAFX,uGAAA,eAAe,OAAA;AACf,uGAAA,eAAe,OAAA;AAOnB,mDAA4D;AAAnD,sGAAA,SAAS,OAAA;AAOlB,2CAQ0B;AAHtB,qGAAA,YAAY,OAAA;AAEZ,qGAAA,YAAY,OAAA;AAGhB,2CAU4B;AADxB,0GAAA,aAAa,OAAuB"}
|
|
@@ -17,6 +17,14 @@ export interface IWeb2Request {
|
|
|
17
17
|
hash: string;
|
|
18
18
|
signature?: forge.pki.ed25519.BinaryBuffer;
|
|
19
19
|
}
|
|
20
|
+
export interface IWeb2Payload {
|
|
21
|
+
message: {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
payload: any;
|
|
24
|
+
authorization: any;
|
|
25
|
+
web2Request: IWeb2Request;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
20
28
|
export declare enum EnumWeb2Methods {
|
|
21
29
|
GET = "GET",
|
|
22
30
|
POST = "POST",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/web2/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/web2/index.ts"],"names":[],"mappings":";;;AAkCA,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,8BAAW,CAAA;IACX,gCAAa,CAAA;IACb,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,kCAAe,CAAA;AACnB,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,6CAA0B,CAAA;IAC1B,2CAAwB,CAAA;AAC5B,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B"}
|
|
@@ -58,21 +58,29 @@ async function prepareWeb2Payload(params, keypair) {
|
|
|
58
58
|
(0, required_1._required)(params.action, "Action not specified");
|
|
59
59
|
(0, required_1._required)(keypair, "Keypair is required");
|
|
60
60
|
// Generating an empty one and filling it
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
const web2_request = structuredClone(skeletons.web2_request);
|
|
62
|
+
web2_request.raw.action = params.action;
|
|
63
|
+
web2_request.raw.url = params.url;
|
|
64
|
+
web2_request.raw.parameters = params.parameters || [];
|
|
65
|
+
web2_request.raw.headers = params.headers || null;
|
|
66
|
+
web2_request.raw.minAttestations = params.minAttestations || 2;
|
|
67
67
|
// Ensuring content is a known property
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
console.log("[Web2Transactions]
|
|
73
|
-
console.log(
|
|
68
|
+
web2_request.attestations = new Map();
|
|
69
|
+
web2_request.hash = "";
|
|
70
|
+
web2_request.signature = "";
|
|
71
|
+
web2_request.result = "";
|
|
72
|
+
console.log("[Web2Transactions] Request:");
|
|
73
|
+
console.log(web2_request);
|
|
74
74
|
// REVIEW Finish upgrading to the new transaction system
|
|
75
|
-
// Creating a web2 payload
|
|
75
|
+
// Creating a web2 payload
|
|
76
|
+
const web2_payload = {
|
|
77
|
+
message: {
|
|
78
|
+
sessionId: "",
|
|
79
|
+
payload: "",
|
|
80
|
+
authorization: "",
|
|
81
|
+
web2Request: web2_request,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
76
84
|
let web2_tx = DemosTransactions_1.DemosTransactions.empty();
|
|
77
85
|
// From and To are the same in Web2 transactions
|
|
78
86
|
web2_tx.content.from = keypair.publicKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Web2Transactions.js","sourceRoot":"","sources":["../../../src/websdk/Web2Transactions.ts"],"names":[],"mappings":";AAAA,gFAAgF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiChF,
|
|
1
|
+
{"version":3,"file":"Web2Transactions.js","sourceRoot":"","sources":["../../../src/websdk/Web2Transactions.ts"],"names":[],"mappings":";AAAA,gFAAgF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiChF,gDAkDC;AAjFD,6DAA8C;AAC9C,+BAA+B;AAC/B,2DAAuD;AAIvD,+CAAwD;AAYxD,sBAAsB;AACtB;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,kBAAkB,CACpC,MAAiC,EACjC,OAAiB;IAEjB,IAAA,oBAAQ,EAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IAClC,IAAA,oBAAQ,EAAC,MAAM,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;IACvC,IAAA,oBAAQ,EAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;IAC/C,IAAA,oBAAQ,EAAC,OAAO,EAAE,qBAAqB,CAAC,CAA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AO,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;IACpD,wBAAwB;IACxB,OAAO,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IACtC,0BAA0B;IAC1B,OAAO,GAAG,MAAM,qCAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACxD,4BAA4B;IAC5B,OAAO,OAAO,CAAA;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kynesyslabs/demosdk",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"author": "Kynesys Labs",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"buffer": "^6.0.3",
|
|
57
57
|
"ethers": "^6.11.1",
|
|
58
58
|
"libsodium-wrappers-sumo": "^0.7.15",
|
|
59
|
+
"lodash": "^4.17.21",
|
|
59
60
|
"mceliece-nist": "^4.0.1",
|
|
60
61
|
"near-api-js": "^4.0.4",
|
|
61
62
|
"node-forge": "^1.3.1",
|