Skip to content

Commit

Permalink
feat: use noves tx type on existing code
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeanribeiro committed Nov 12, 2024
1 parent ab0bb0e commit f5d4bf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { NovesTxType } from '../types/noves-tx-type.type'
import { NovesToken } from './noves-token.interface'

export interface NovesTxResponse {
Expand Down Expand Up @@ -30,7 +31,7 @@ interface Protocol {
}

interface ClassificationData {
type: string
type: NovesTxType
source: ClassificationSource
description: string
protocol: Protocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit f5d4bf9

Please sign in to comment.