Skip to content

Commit

Permalink
fix: better typing name
Browse files Browse the repository at this point in the history
  • Loading branch information
ohager committed Dec 30, 2024
1 parent 51644b2 commit 00bc6a1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 18 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {TransactionLeasingSubtype} from './transactionLeasingSubtype';
import {TransactionMarketplaceSubtype} from './transactionMarketplaceSubtype';
import {TransactionPaymentSubtype} from './transactionPaymentSubtype';
import {TransactionMiningSubtype} from './transactionMiningSubtype';
import {TransactionEscrowSubtype} from './transactionEscrowSubtype';
import {TransactionAdvancedPaymentSubtype} from './transactionAdvancedPaymentSubtype';
import {TransactionSmartContractSubtype} from './transactionSmartContractSubtype';

/**
Expand Down Expand Up @@ -44,6 +44,6 @@ export {
TransactionAssetSubtype,
TransactionArbitrarySubtype,
TransactionMiningSubtype,
TransactionEscrowSubtype,
TransactionAdvancedPaymentSubtype,
TransactionSmartContractSubtype
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/**
* Original work Copyright (c) 2019 Burst Apps Team
* Modified 2024, Signum Network
*/

/**
* Constants for escrow subtypes
* Constants for advanced payment subtypes
*
* @category transaction-types
*/
export enum TransactionEscrowSubtype {
export enum TransactionAdvancedPaymentSubtype {
EscrowCreation = 0,
EscrowSigning,
EscrowResult,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/constants/transactionAssetSubtype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

/**
* Constants for asset subtypes
* Constants for asset/token subtypes
*
* @category transaction-types
*/
Expand Down
22 changes: 14 additions & 8 deletions packages/core/src/constants/transactionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,36 @@
*/
export enum TransactionType {
/**
* @see TransactionPaymentSubtype
* {@link TransactionPaymentSubtype}
*/
Payment = 0,
/**
* @see TransactionArbitrarySubtype
* {@link TransactionArbitrarySubtype}
*/
Arbitrary,
/**
* @see TransactionAssetSubtype
* {@link TransactionAssetSubtype}
*/
Asset,
/**
* @see TransactionMarketplaceSubtype
* {@link TransactionMarketplaceSubtype}
*/
Marketplace,
/**
* @see TransactionLeasingSubtype
* {@link TransactionLeasingSubtype}
*/
Leasing,
/**
* @see TransactionMiningSubtype
* {@link TransactionMiningSubtype}
*/
Mining = 20,
Escrow = 21,
AT = 22,
/**
* {@link TransactionEscrowSubtype}
*/
AdvancedPayment = 21,
/**
* {@link TransactionSmartContractSubtype}
*/
SmartContract = 22,
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
TransactionEscrowSubtype,
TransactionAdvancedPaymentSubtype,
TransactionPaymentSubtype,
TransactionType
} from '../../constants';
Expand Down Expand Up @@ -30,8 +30,8 @@ describe('getRecipientsAmount', () => {
const transaction = {
transaction: '1',
amountNQT: Amount.fromSigna(100).getPlanck(),
type: TransactionType.Escrow,
subtype: TransactionEscrowSubtype.EscrowCreation,
type: TransactionType.AdvancedPayment,
subtype: TransactionAdvancedPaymentSubtype.EscrowCreation,
};

// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('isMultiOutSameTransaction', () => {
it('returns false on wrong type', () => {

const transaction = {
type: TransactionType.Escrow,
type: TransactionType.AdvancedPayment,
subtype: TransactionPaymentSubtype.Ordinary
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('isMultiOutTransaction', () => {
it('returns false on wrong type', () => {

const transaction = {
type: TransactionType.Escrow,
type: TransactionType.AdvancedPayment,
subtype: TransactionPaymentSubtype.Ordinary
};

Expand Down

0 comments on commit 00bc6a1

Please sign in to comment.