@kynesyslabs/demosdk 2.3.18 → 2.3.20
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 +4 -3
- package/build/types/blockchain/Transaction.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/ContractCallTransaction.d.ts +24 -0
- package/build/types/blockchain/TransactionSubtypes/{SmartContractTransaction.js → ContractCallTransaction.js} +1 -1
- package/build/types/blockchain/TransactionSubtypes/ContractCallTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/ContractDeployTransaction.d.ts +31 -0
- package/build/types/blockchain/TransactionSubtypes/ContractDeployTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/ContractDeployTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/index.d.ts +5 -1
- package/build/types/blockchain/TransactionSubtypes/index.js +2 -0
- package/build/types/blockchain/TransactionSubtypes/index.js.map +1 -1
- package/build/types/web2/index.d.ts +1 -0
- package/build/types/web2/index.js.map +1 -1
- package/build/websdk/Web2Calls.js +6 -1
- package/build/websdk/Web2Calls.js.map +1 -1
- package/package.json +1 -1
- package/build/types/blockchain/TransactionSubtypes/SmartContractTransaction.d.ts +0 -9
- package/build/types/blockchain/TransactionSubtypes/SmartContractTransaction.js.map +0 -1
|
@@ -11,10 +11,11 @@ import { BridgeOperationCompiled } from "../../bridge/nativeBridgeTypes";
|
|
|
11
11
|
import { L2PSEncryptedPayload } from "../../l2ps";
|
|
12
12
|
import { StoragePayload } from "./TransactionSubtypes/StorageTransaction";
|
|
13
13
|
import { L2PSHashPayload } from "./TransactionSubtypes/L2PSHashTransaction";
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import { ContractDeployPayload } from "./TransactionSubtypes/ContractDeployTransaction";
|
|
15
|
+
import { ContractCallPayload } from "./TransactionSubtypes/ContractCallTransaction";
|
|
16
|
+
export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["l2psEncryptedTx", L2PSEncryptedPayload] | ["identity", IdentityPayload] | ["instantMessaging", InstantMessagingPayload] | ["nativeBridge", BridgeOperationCompiled] | ["storage", StoragePayload] | ["l2ps_hash_update", L2PSHashPayload] | ["contractDeploy", ContractDeployPayload] | ["contractCall", ContractCallPayload];
|
|
16
17
|
export interface TransactionContent {
|
|
17
|
-
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging" | "nativeBridge" | "l2psEncryptedTx" | "storage" | "l2ps_hash_update" | "
|
|
18
|
+
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging" | "nativeBridge" | "l2psEncryptedTx" | "storage" | "l2ps_hash_update" | "contractDeploy" | "contractCall";
|
|
18
19
|
from: string;
|
|
19
20
|
from_ed25519_address: string;
|
|
20
21
|
to: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../src/types/blockchain/Transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../src/types/blockchain/Transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqFA,uCAAuC;AACvC,wDAAqC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
/**
|
|
3
|
+
* Payload for contract method call transactions
|
|
4
|
+
*/
|
|
5
|
+
export interface ContractCallPayload {
|
|
6
|
+
contractAddress: string;
|
|
7
|
+
method: string;
|
|
8
|
+
args: any[];
|
|
9
|
+
value?: bigint;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Transaction content type for contract call operations
|
|
13
|
+
*/
|
|
14
|
+
export type ContractCallTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
15
|
+
type: 'contractCall';
|
|
16
|
+
data: ['contractCall', ContractCallPayload];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Complete contract call transaction interface
|
|
20
|
+
*/
|
|
21
|
+
export interface ContractCallTransaction extends Omit<Transaction, 'content'> {
|
|
22
|
+
content: ContractCallTransactionContent;
|
|
23
|
+
}
|
|
24
|
+
export default ContractCallTransaction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractCallTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/ContractCallTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
/**
|
|
3
|
+
* Contract metadata for deployment
|
|
4
|
+
*/
|
|
5
|
+
export interface ContractMetadata {
|
|
6
|
+
name?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Payload for contract deployment transactions
|
|
12
|
+
*/
|
|
13
|
+
export interface ContractDeployPayload {
|
|
14
|
+
source: string;
|
|
15
|
+
constructorArgs: any[];
|
|
16
|
+
metadata?: ContractMetadata;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Transaction content type for contract deployment operations
|
|
20
|
+
*/
|
|
21
|
+
export type ContractDeployTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
22
|
+
type: 'contractDeploy';
|
|
23
|
+
data: ['contractDeploy', ContractDeployPayload];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Complete contract deployment transaction interface
|
|
27
|
+
*/
|
|
28
|
+
export interface ContractDeployTransaction extends Omit<Transaction, 'content'> {
|
|
29
|
+
content: ContractDeployTransactionContent;
|
|
30
|
+
}
|
|
31
|
+
export default ContractDeployTransaction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractDeployTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/ContractDeployTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -8,6 +8,8 @@ export * from './IdentityTransaction';
|
|
|
8
8
|
export * from './InstantMessagingTransaction';
|
|
9
9
|
export * from './NativeBridgeTransaction';
|
|
10
10
|
export * from './StorageTransaction';
|
|
11
|
+
export * from './ContractDeployTransaction';
|
|
12
|
+
export * from './ContractCallTransaction';
|
|
11
13
|
import { L2PSTransaction } from './L2PSTransaction';
|
|
12
14
|
import { L2PSHashTransaction } from './L2PSHashTransaction';
|
|
13
15
|
import { Web2Transaction } from './Web2Transaction';
|
|
@@ -18,4 +20,6 @@ import { IdentityTransaction } from './IdentityTransaction';
|
|
|
18
20
|
import { InstantMessagingTransaction } from './InstantMessagingTransaction';
|
|
19
21
|
import { NativeBridgeTransaction } from './NativeBridgeTransaction';
|
|
20
22
|
import { StorageTransaction } from './StorageTransaction';
|
|
21
|
-
|
|
23
|
+
import { ContractDeployTransaction } from './ContractDeployTransaction';
|
|
24
|
+
import { ContractCallTransaction } from './ContractCallTransaction';
|
|
25
|
+
export type SpecificTransaction = L2PSTransaction | L2PSHashTransaction | Web2Transaction | CrosschainTransaction | NativeTransaction | DemosworkTransaction | IdentityTransaction | InstantMessagingTransaction | NativeBridgeTransaction | StorageTransaction | ContractDeployTransaction | ContractCallTransaction;
|
|
@@ -24,4 +24,6 @@ __exportStar(require("./IdentityTransaction"), exports);
|
|
|
24
24
|
__exportStar(require("./InstantMessagingTransaction"), exports);
|
|
25
25
|
__exportStar(require("./NativeBridgeTransaction"), exports);
|
|
26
26
|
__exportStar(require("./StorageTransaction"), exports);
|
|
27
|
+
__exportStar(require("./ContractDeployTransaction"), exports);
|
|
28
|
+
__exportStar(require("./ContractCallTransaction"), exports);
|
|
27
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,wDAAqC;AACrC,oDAAiC;AACjC,0DAAuC;AACvC,sDAAmC;AACnC,yDAAsC;AACtC,wDAAqC;AACrC,gEAA6C;AAC7C,4DAAyC;AACzC,uDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,wDAAqC;AACrC,oDAAiC;AACjC,0DAAuC;AACvC,sDAAmC;AACnC,yDAAsC;AACtC,wDAAqC;AACrC,gEAA6C;AAC7C,4DAAyC;AACzC,uDAAoC;AACpC,8DAA2C;AAC3C,4DAAyC"}
|
|
@@ -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":";;;AAwCA,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,6CAA0B,CAAA;AAC9B,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B"}
|
|
@@ -69,8 +69,13 @@ class Web2Proxy {
|
|
|
69
69
|
web2Tx.content.timestamp = Date.now();
|
|
70
70
|
const signedWeb2Tx = await this._demos.sign(web2Tx);
|
|
71
71
|
const validityData = await this._demos.confirm(signedWeb2Tx);
|
|
72
|
+
const txHash = validityData.response.data.transaction.hash;
|
|
72
73
|
await this._demos.broadcast(validityData);
|
|
73
|
-
|
|
74
|
+
const result = {
|
|
75
|
+
...response.response,
|
|
76
|
+
txHash,
|
|
77
|
+
};
|
|
78
|
+
return result;
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
exports.Web2Proxy = Web2Proxy;
|
|
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AC,CAAA;QAClE,CAAC;QAED,kDAAkD;QAClD,MAAM,gBAAgB,GAAG,EAAE,GAAG,wBAAY,EAAE,CAAA;QAC5C,gBAAgB,CAAC,GAAG,GAAG;YACnB,GAAG,gBAAgB,CAAC,GAAG;YACvB,MAAM,EAAE,uBAAe,CAAC,MAAM;SACjC,CAAA;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAClD,WAAW,EAAE,gBAAgB;SAChC,CAAC,CAAA;QAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAA;QACpD,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACrD,CAAC;QAED,OAAO,IAAI,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;IAC1C,CAAC;CACJ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kynesyslabs/demosdk",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.20",
|
|
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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SmartContractTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/SmartContractTransaction.ts"],"names":[],"mappings":""}
|