@kynesyslabs/demosdk 2.2.60 → 2.2.61
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/l2ps/l2ps.d.ts +3 -3
- package/build/l2ps/l2ps.js.map +1 -1
- package/build/types/blockchain/Transaction.d.ts +1 -6
- package/build/types/blockchain/Transaction.js +16 -0
- package/build/types/blockchain/Transaction.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/CrosschainTransaction.d.ts +9 -0
- package/build/types/blockchain/TransactionSubtypes/CrosschainTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/CrosschainTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/DemosworkTransaction.d.ts +9 -0
- package/build/types/blockchain/TransactionSubtypes/DemosworkTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/DemosworkTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/IdentityTransaction.d.ts +9 -0
- package/build/types/blockchain/TransactionSubtypes/IdentityTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/IdentityTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/InstantMessagingTransaction.d.ts +9 -0
- package/build/types/blockchain/TransactionSubtypes/InstantMessagingTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/InstantMessagingTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/L2PSTransaction.d.ts +9 -0
- package/build/types/blockchain/TransactionSubtypes/L2PSTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/L2PSTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/NativeBridgeTransaction.d.ts +9 -0
- package/build/types/blockchain/TransactionSubtypes/NativeBridgeTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/NativeBridgeTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/NativeTransaction.d.ts +9 -0
- package/build/types/blockchain/TransactionSubtypes/NativeTransaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/NativeTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/Web2Transaction.d.ts +9 -0
- package/build/types/blockchain/TransactionSubtypes/Web2Transaction.js +3 -0
- package/build/types/blockchain/TransactionSubtypes/Web2Transaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/index.d.ts +17 -0
- package/build/types/blockchain/TransactionSubtypes/index.js +25 -0
- package/build/types/blockchain/TransactionSubtypes/index.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/utils.d.ts +39 -0
- package/build/types/blockchain/TransactionSubtypes/utils.js +42 -0
- package/build/types/blockchain/TransactionSubtypes/utils.js.map +1 -0
- package/build/types/index.d.ts +2 -1
- package/build/types/index.js +5 -1
- package/build/types/index.js.map +1 -1
- package/package.json +1 -1
package/build/l2ps/l2ps.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @author Kynesys Labs
|
|
9
9
|
* @version 1.0.0
|
|
10
10
|
*/
|
|
11
|
-
import { Transaction } from "../types";
|
|
11
|
+
import { L2PSTransaction, Transaction } from "../types";
|
|
12
12
|
/**
|
|
13
13
|
* Configuration interface for L2PS instances.
|
|
14
14
|
* Defines the structure for L2PS network configuration and metadata.
|
|
@@ -149,7 +149,7 @@ export default class L2PS {
|
|
|
149
149
|
* // encryptedTx can now be inserted into mempool like any other transaction
|
|
150
150
|
* ```
|
|
151
151
|
*/
|
|
152
|
-
encryptTx(tx: Transaction, senderIdentity?: any): Promise<
|
|
152
|
+
encryptTx(tx: Transaction, senderIdentity?: any): Promise<L2PSTransaction>;
|
|
153
153
|
/**
|
|
154
154
|
* Decrypts an L2PS encrypted transaction and returns the original transaction.
|
|
155
155
|
*
|
|
@@ -170,7 +170,7 @@ export default class L2PS {
|
|
|
170
170
|
* // originalTx is now the original transaction before encryption
|
|
171
171
|
* ```
|
|
172
172
|
*/
|
|
173
|
-
decryptTx(encryptedTx:
|
|
173
|
+
decryptTx(encryptedTx: L2PSTransaction): Promise<Transaction>;
|
|
174
174
|
/**
|
|
175
175
|
* Returns the unique identifier for this L2PS instance.
|
|
176
176
|
* The ID is a SHA-256 hash of the private key.
|
package/build/l2ps/l2ps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2ps.js","sourceRoot":"","sources":["../../../src/l2ps/l2ps.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,kDAAoC;AACpC,kDAA+C;
|
|
1
|
+
{"version":3,"file":"l2ps.js","sourceRoot":"","sources":["../../../src/l2ps/l2ps.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,kDAAoC;AACpC,kDAA+C;AAmC/C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAqB,IAAI;IAgBrB;;;;;;;;OAQG;IACH,YAAoB,UAAuB,EAAE,EAAe;QACxD,IAAI,CAAC,UAAU,IAAI,CAAC,EAAE,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,iBAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAmB,EAAE,EAAW;QAChD,MAAM,GAAG,GAAG,UAAU,IAAI,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACxD,MAAM,UAAU,GAAG,EAAE,IAAI,KAA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AC9C,cAAS,GAAsB,IAAI,GAAG,EAAE,CAAC;kBAFvC,IAAI"}
|
|
@@ -9,12 +9,6 @@ import { IdentityPayload } from "../abstraction";
|
|
|
9
9
|
import { InstantMessagingPayload } from "../instantMessaging";
|
|
10
10
|
import { BridgeOperationCompiled } from "../../bridge/nativeBridgeTypes";
|
|
11
11
|
import { L2PSEncryptedPayload } from "../../l2ps";
|
|
12
|
-
export interface L2PSTransaction extends Transaction {
|
|
13
|
-
content: TransactionContent & {
|
|
14
|
-
type: "l2psEncryptedTx";
|
|
15
|
-
data: L2PSEncryptedPayload;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
12
|
export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["l2psEncryptedTx", L2PSEncryptedPayload] | ["identity", IdentityPayload] | ["instantMessaging", InstantMessagingPayload] | ["nativeBridge", BridgeOperationCompiled];
|
|
19
13
|
export interface TransactionContent {
|
|
20
14
|
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging" | "nativeBridge" | "l2psEncryptedTx";
|
|
@@ -36,3 +30,4 @@ export interface Transaction {
|
|
|
36
30
|
status: string;
|
|
37
31
|
blockNumber: number | null;
|
|
38
32
|
}
|
|
33
|
+
export * from './TransactionSubtypes';
|
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Re-export specific transaction types
|
|
18
|
+
__exportStar(require("./TransactionSubtypes"), exports);
|
|
3
19
|
//# sourceMappingURL=Transaction.js.map
|
|
@@ -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":";;;;;;;;;;;;;;;;AAyEA,uCAAuC;AACvC,wDAAqC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import { XMScript } from "../../xm";
|
|
3
|
+
export type CrosschainTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
4
|
+
type: 'crosschainOperation';
|
|
5
|
+
data: ['crosschainOperation', XMScript];
|
|
6
|
+
};
|
|
7
|
+
export interface CrosschainTransaction extends Omit<Transaction, 'content'> {
|
|
8
|
+
content: CrosschainTransactionContent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrosschainTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/CrosschainTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import { DemoScript } from "../../demoswork";
|
|
3
|
+
export type DemosworkTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
4
|
+
type: 'demoswork';
|
|
5
|
+
data: ['demoswork', DemoScript];
|
|
6
|
+
};
|
|
7
|
+
export interface DemosworkTransaction extends Omit<Transaction, 'content'> {
|
|
8
|
+
content: DemosworkTransactionContent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DemosworkTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/DemosworkTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import { IdentityPayload } from "../../abstraction";
|
|
3
|
+
export type IdentityTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
4
|
+
type: 'identity';
|
|
5
|
+
data: ['identity', IdentityPayload];
|
|
6
|
+
};
|
|
7
|
+
export interface IdentityTransaction extends Omit<Transaction, 'content'> {
|
|
8
|
+
content: IdentityTransactionContent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/IdentityTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import { InstantMessagingPayload } from "../../instantMessaging";
|
|
3
|
+
export type InstantMessagingTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
4
|
+
type: 'instantMessaging';
|
|
5
|
+
data: ['instantMessaging', InstantMessagingPayload];
|
|
6
|
+
};
|
|
7
|
+
export interface InstantMessagingTransaction extends Omit<Transaction, 'content'> {
|
|
8
|
+
content: InstantMessagingTransactionContent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstantMessagingTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/InstantMessagingTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import { L2PSEncryptedPayload } from "../../../l2ps";
|
|
3
|
+
export type L2PSTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
4
|
+
type: 'l2psEncryptedTx';
|
|
5
|
+
data: ['l2psEncryptedTx', L2PSEncryptedPayload];
|
|
6
|
+
};
|
|
7
|
+
export interface L2PSTransaction extends Omit<Transaction, 'content'> {
|
|
8
|
+
content: L2PSTransactionContent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"L2PSTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/L2PSTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import { BridgeOperationCompiled } from "../../../bridge/nativeBridgeTypes";
|
|
3
|
+
export type NativeBridgeTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
4
|
+
type: 'nativeBridge';
|
|
5
|
+
data: ['nativeBridge', BridgeOperationCompiled];
|
|
6
|
+
};
|
|
7
|
+
export interface NativeBridgeTransaction extends Omit<Transaction, 'content'> {
|
|
8
|
+
content: NativeBridgeTransactionContent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeBridgeTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/NativeBridgeTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import { INativePayload } from "../../native";
|
|
3
|
+
export type NativeTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
4
|
+
type: 'native';
|
|
5
|
+
data: ['native', INativePayload];
|
|
6
|
+
};
|
|
7
|
+
export interface NativeTransaction extends Omit<Transaction, 'content'> {
|
|
8
|
+
content: NativeTransactionContent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/NativeTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import { IWeb2Payload } from "../../web2";
|
|
3
|
+
export type Web2TransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
4
|
+
type: 'web2Request';
|
|
5
|
+
data: ['web2Request', IWeb2Payload];
|
|
6
|
+
};
|
|
7
|
+
export interface Web2Transaction extends Omit<Transaction, 'content'> {
|
|
8
|
+
content: Web2TransactionContent;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Web2Transaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/Web2Transaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './L2PSTransaction';
|
|
2
|
+
export * from './Web2Transaction';
|
|
3
|
+
export * from './CrosschainTransaction';
|
|
4
|
+
export * from './NativeTransaction';
|
|
5
|
+
export * from './DemosworkTransaction';
|
|
6
|
+
export * from './IdentityTransaction';
|
|
7
|
+
export * from './InstantMessagingTransaction';
|
|
8
|
+
export * from './NativeBridgeTransaction';
|
|
9
|
+
import { L2PSTransaction } from './L2PSTransaction';
|
|
10
|
+
import { Web2Transaction } from './Web2Transaction';
|
|
11
|
+
import { CrosschainTransaction } from './CrosschainTransaction';
|
|
12
|
+
import { NativeTransaction } from './NativeTransaction';
|
|
13
|
+
import { DemosworkTransaction } from './DemosworkTransaction';
|
|
14
|
+
import { IdentityTransaction } from './IdentityTransaction';
|
|
15
|
+
import { InstantMessagingTransaction } from './InstantMessagingTransaction';
|
|
16
|
+
import { NativeBridgeTransaction } from './NativeBridgeTransaction';
|
|
17
|
+
export type SpecificTransaction = L2PSTransaction | Web2Transaction | CrosschainTransaction | NativeTransaction | DemosworkTransaction | IdentityTransaction | InstantMessagingTransaction | NativeBridgeTransaction;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./L2PSTransaction"), exports);
|
|
18
|
+
__exportStar(require("./Web2Transaction"), exports);
|
|
19
|
+
__exportStar(require("./CrosschainTransaction"), exports);
|
|
20
|
+
__exportStar(require("./NativeTransaction"), exports);
|
|
21
|
+
__exportStar(require("./DemosworkTransaction"), exports);
|
|
22
|
+
__exportStar(require("./IdentityTransaction"), exports);
|
|
23
|
+
__exportStar(require("./InstantMessagingTransaction"), exports);
|
|
24
|
+
__exportStar(require("./NativeBridgeTransaction"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,oDAAiC;AACjC,0DAAuC;AACvC,sDAAmC;AACnC,yDAAsC;AACtC,wDAAqC;AACrC,gEAA6C;AAC7C,4DAAyC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Transaction } from "../Transaction";
|
|
2
|
+
import { SpecificTransaction } from "./index";
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to check if a transaction is of a specific type
|
|
5
|
+
* @param tx The transaction to check
|
|
6
|
+
* @param type The expected transaction type
|
|
7
|
+
* @returns True if the transaction is of the specified type
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const tx: Transaction = { ... }
|
|
12
|
+
* if (isTransactionType(tx, 'l2psEncryptedTx')) {
|
|
13
|
+
* // tx is now typed as L2PSTransaction
|
|
14
|
+
* const [_, payload] = tx.content.data
|
|
15
|
+
* // payload is typed as L2PSEncryptedPayload
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function isTransactionType<T extends SpecificTransaction>(tx: Transaction, type: T['content']['type']): tx is T;
|
|
20
|
+
/**
|
|
21
|
+
* Type guard to check if a transaction's data matches the expected type
|
|
22
|
+
* @param tx The transaction to check
|
|
23
|
+
* @param dataType The expected data type
|
|
24
|
+
* @returns True if the transaction's data is of the specified type
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const tx: Transaction = { ... }
|
|
29
|
+
* if (isTransactionDataType(tx, 'l2psEncryptedTx')) {
|
|
30
|
+
* // tx.content.data[0] is 'l2psEncryptedTx'
|
|
31
|
+
* // tx.content.data[1] is L2PSEncryptedPayload
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function isTransactionDataType<T extends SpecificTransaction['content']['data'][0]>(tx: Transaction, dataType: T): tx is Transaction & {
|
|
36
|
+
content: {
|
|
37
|
+
data: [T, any];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTransactionType = isTransactionType;
|
|
4
|
+
exports.isTransactionDataType = isTransactionDataType;
|
|
5
|
+
/**
|
|
6
|
+
* Type guard to check if a transaction is of a specific type
|
|
7
|
+
* @param tx The transaction to check
|
|
8
|
+
* @param type The expected transaction type
|
|
9
|
+
* @returns True if the transaction is of the specified type
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const tx: Transaction = { ... }
|
|
14
|
+
* if (isTransactionType(tx, 'l2psEncryptedTx')) {
|
|
15
|
+
* // tx is now typed as L2PSTransaction
|
|
16
|
+
* const [_, payload] = tx.content.data
|
|
17
|
+
* // payload is typed as L2PSEncryptedPayload
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
function isTransactionType(tx, type) {
|
|
22
|
+
return tx.content.type === type;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Type guard to check if a transaction's data matches the expected type
|
|
26
|
+
* @param tx The transaction to check
|
|
27
|
+
* @param dataType The expected data type
|
|
28
|
+
* @returns True if the transaction's data is of the specified type
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const tx: Transaction = { ... }
|
|
33
|
+
* if (isTransactionDataType(tx, 'l2psEncryptedTx')) {
|
|
34
|
+
* // tx.content.data[0] is 'l2psEncryptedTx'
|
|
35
|
+
* // tx.content.data[1] is L2PSEncryptedPayload
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function isTransactionDataType(tx, dataType) {
|
|
40
|
+
return tx.content.data[0] === dataType;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/utils.ts"],"names":[],"mappings":";;AAmBA,8CAKC;AAiBD,sDAKC;AA3CD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,iBAAiB,CAC7B,EAAe,EACf,IAA0B;IAE1B,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAA;AACnC,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,qBAAqB,CACjC,EAAe,EACf,QAAW;IAEX,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAA;AAC1C,CAAC"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { GenesisArtifact, GenesisImmutableProperties, GenesisMutableProperties, StandardGenesis, forkGenesis, } from "./blockchain/genesisTypes";
|
|
2
2
|
export { Block, BlockContent, NativeTablesHashes } from "./blockchain/blocks";
|
|
3
|
-
export { L2PSTransaction } from "./blockchain/Transaction";
|
|
4
3
|
export { ISignature } from "./blockchain/ISignature";
|
|
5
4
|
export { RawTransaction } from "./blockchain/rawTransaction";
|
|
6
5
|
export { Transaction, TransactionContent, TransactionContentData, } from "./blockchain/Transaction";
|
|
6
|
+
export { L2PSTransaction, Web2Transaction, CrosschainTransaction, NativeTransaction, DemosworkTransaction, IdentityTransaction, InstantMessagingTransaction, NativeBridgeTransaction, SpecificTransaction } from "./blockchain/TransactionSubtypes";
|
|
7
7
|
export { L2PSEncryptedPayload } from "../l2ps";
|
|
8
8
|
export { INativePayload } from "./native/INativePayload";
|
|
9
9
|
export { InstantMessagingPayload } from "./instantMessaging";
|
|
@@ -31,3 +31,4 @@ export { BridgeTradePayload } from "./bridge/bridgeTradePayload";
|
|
|
31
31
|
export { ChainProviders, SupportedChains, SupportedTokens, } from "./bridge/constants";
|
|
32
32
|
export { type SigningAlgorithm, type EncryptionAlgorithm } from "./cryptography";
|
|
33
33
|
export { Ed25519SignedObject, PqcSignedObject, encryptedObject, SerializedEncryptedObject, SerializedSignedObject, signedObject, } from "../encryption/unifiedCrypto";
|
|
34
|
+
export { isTransactionType, isTransactionDataType, } from "./blockchain/TransactionSubtypes/utils";
|
package/build/types/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SupportedTokens = exports.SupportedChains = exports.ChainProviders = exports.RPCResponseSkeleton = exports.stepKeysEnum = exports.XmStepResult = exports.DataTypes = exports.EnumWeb2Actions = exports.EnumWeb2Methods = exports.CValidityData = void 0;
|
|
3
|
+
exports.isTransactionDataType = exports.isTransactionType = exports.SupportedTokens = exports.SupportedChains = exports.ChainProviders = exports.RPCResponseSkeleton = exports.stepKeysEnum = exports.XmStepResult = exports.DataTypes = exports.EnumWeb2Actions = exports.EnumWeb2Methods = 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
6
|
// web2
|
|
@@ -18,4 +18,8 @@ var constants_1 = require("./bridge/constants");
|
|
|
18
18
|
Object.defineProperty(exports, "ChainProviders", { enumerable: true, get: function () { return constants_1.ChainProviders; } });
|
|
19
19
|
Object.defineProperty(exports, "SupportedChains", { enumerable: true, get: function () { return constants_1.SupportedChains; } });
|
|
20
20
|
Object.defineProperty(exports, "SupportedTokens", { enumerable: true, get: function () { return constants_1.SupportedTokens; } });
|
|
21
|
+
// Export transaction utilities
|
|
22
|
+
var utils_1 = require("./blockchain/TransactionSubtypes/utils");
|
|
23
|
+
Object.defineProperty(exports, "isTransactionType", { enumerable: true, get: function () { return utils_1.isTransactionType; } });
|
|
24
|
+
Object.defineProperty(exports, "isTransactionDataType", { enumerable: true, get: function () { return utils_1.isTransactionDataType; } });
|
|
21
25
|
//# 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":";;;AAsCA,0DAAuE;AAA9D,6GAAA,aAAa,OAAA;AA+BtB,OAAO;AACP,+BAgBe;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;AAgBxC,gDAI2B;AAHvB,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,4GAAA,eAAe,OAAA;AAanB,+BAA+B;AAC/B,gEAG+C;AAF3C,0GAAA,iBAAiB,OAAA;AACjB,8GAAA,qBAAqB,OAAA"}
|