Skip to content

Commit

Permalink
Fix logsd (#2220)
Browse files Browse the repository at this point in the history
Fix type
  • Loading branch information
harsh-mn-yral authored Jun 4, 2024
1 parent 728a231 commit 5c94a9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function getEventName() {
$: deducted =
item.type === 'Burn' || item.type === 'Stake' || item.type === 'Transfer'
$: eventName = getEventName()
$: eventName = item.type === 'Transfer' ? 'Transfer' : getEventName()
$: timeDiff = getTimeDifference(Number(item.timestamp.secs_since_epoch) * 1000)
const labels: Record<any, string> = {
Expand Down
15 changes: 7 additions & 8 deletions packages/web-client/src/lib/helpers/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,21 +503,20 @@ function transformHistoryRecords(
const history: TransactionHistory[] = []

res.forEach((o) => {
console.log({ o })
const event = o[1]
console.log({ event })

const type = Object.keys(event)[0] as UnionKeyOf<TokenEvent>
console.log({ type })
const subType = Object.keys(event[type].details)[0] as WalletEventType
console.log({ subType })
const details = (event[type] as WalletEvent)?.[subType] as

const subType =
(Object.keys(event?.[type]?.details || {})?.[0] as WalletEventType) || ''
const details = ((event[type] as WalletEvent) || {})?.[subType] as
| WalletEventSubDetails
| undefined
console.log({ details })

const eventOutcome = Object.keys(details?.['event_outcome'] || {})[0] as
| EventOutcome
| undefined
console.log({ eventOutcome })

history.push({
id: o[0],
type,
Expand Down

0 comments on commit 5c94a9a

Please sign in to comment.