diff --git a/packages/shared/src/lib/auxiliary/noves/interfaces/noves-tx-response.interface.ts b/packages/shared/src/lib/auxiliary/noves/interfaces/noves-tx-response.interface.ts index e7e73cd5d4..1116dead76 100644 --- a/packages/shared/src/lib/auxiliary/noves/interfaces/noves-tx-response.interface.ts +++ b/packages/shared/src/lib/auxiliary/noves/interfaces/noves-tx-response.interface.ts @@ -1,3 +1,4 @@ +import { NovesTxType } from '../types/noves-tx-type.type' import { NovesToken } from './noves-token.interface' export interface NovesTxResponse { @@ -30,7 +31,7 @@ interface Protocol { } interface ClassificationData { - type: string + type: NovesTxType source: ClassificationSource description: string protocol: Protocol diff --git a/packages/shared/src/lib/core/activity/utils/evm/generateEvmActivityFromNovesTransaction.ts b/packages/shared/src/lib/core/activity/utils/evm/generateEvmActivityFromNovesTransaction.ts index a6ad015f0e..168960ffd3 100644 --- a/packages/shared/src/lib/core/activity/utils/evm/generateEvmActivityFromNovesTransaction.ts +++ b/packages/shared/src/lib/core/activity/utils/evm/generateEvmActivityFromNovesTransaction.ts @@ -10,6 +10,7 @@ import { ActivityDirection } from '@core/activity/enums' import { generateBaseEvmActivity } from './generateBaseEvmActivity' import { LocalEvmTransaction } from '@core/transactions/types' import { generateEvmActivityFromLocalEvmTransaction } from './generateEvmActivityFromLocalEvmTransaction' +import { NovesTxTypeToken } from '@auxiliary/noves/enums' export async function generateEvmActivityFromNovesTransaction( novesTx: NovesTxResponse, @@ -24,12 +25,10 @@ export async function generateEvmActivityFromNovesTransaction( account ) - switch ( - novesTx.classificationData.type // What are all the types and interfaces for this? - ) { - case 'sendToken': // TODO: this string should be an enum + switch (novesTx.classificationData.type) { + case NovesTxTypeToken.SendToken: return generateEvmActivityFromSendTokenClassification(baseActivity, novesTx, account) - case 'receiveToken': + case NovesTxTypeToken.ReceiveToken: return generateEvmActivityFromReceiveTokenClassification(baseActivity, novesTx, account) default: return localTransaction