Skip to content

Commit 2be597c

Browse files
committed
renamed methods
1 parent 49c9fee commit 2be597c

File tree

7 files changed

+69
-915
lines changed

7 files changed

+69
-915
lines changed

src/infrastructure/transaction/CreateTransactionFromPayload.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,26 @@ const CreateTransaction = (type: number, transactionData: string, networkType: N
171171
new MosaicId(UInt64.fromHex(reverse(mosaicAliasMosaicId)).toDTO()),
172172
networkType,
173173
);
174+
case TransactionType.REGISTER_NAMESPACE:
175+
// read bytes
176+
const namespaceType = parseInt(convert.uint8ToHex(convert.hexToUint8(transactionData.substring(0, 2)).reverse()), 16);
177+
const nameSpaceDurationParentId = transactionData.substring(2, 18);
178+
const nameSpaceId = transactionData.substring(18, 34);
179+
const nameSize = transactionData.substring(34, 36);
180+
const nameSpaceName = transactionData.substring(36);
181+
182+
return namespaceType === NamespaceType.RootNamespace ?
183+
RegisterNamespaceTransaction.createRootNamespace(
184+
Deadline.createFromDTO(deadline),
185+
decodeHex(nameSpaceName),
186+
UInt64.fromHex(reverse(nameSpaceDurationParentId)),
187+
networkType,
188+
) : RegisterNamespaceTransaction.createSubNamespace(
189+
Deadline.createFromDTO(deadline),
190+
decodeHex(nameSpaceName),
191+
new NamespaceId(UInt64.fromHex(reverse(nameSpaceDurationParentId)).toDTO()),
192+
networkType,
193+
);
174194
case TransactionType.MOSAIC_DEFINITION:
175195
const mosaicDefMosaicNonceLength = 8;
176196
const mosaicDefMosaicIdLength = 16;

src/util/CreateTransactionFromBinary.ts

Lines changed: 0 additions & 462 deletions
This file was deleted.

src/util/TransactionMapping.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/util/util.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/utility/TransactionMapping.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,20 @@ export class TransactionMapping {
3737
public static createFromPayload(dataBytes: string): Transaction {
3838
return CreateTransactionFromPayload(dataBytes);
3939
}
40+
41+
/**
42+
* Serialize a transaction.
43+
* @returns {string} Serialized transaction in binary.
44+
*/
45+
public static serialize(): string {
46+
throw new Error();
47+
}
48+
49+
/**
50+
* Create transaction class from Json.
51+
* @returns {object} Serialized transaction in json object.
52+
*/
53+
public static serializeJson(): object {
54+
throw new Error();
55+
}
4056
}

0 commit comments

Comments
 (0)