Skip to content

Commit

Permalink
get correct subject
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNerdi committed Aug 28, 2023
1 parent a5ec1b7 commit eddf4e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PersistedEvmTransaction, TransactionActivity } from '../types'
import { ActivityAction, ActivityDirection, ActivityType, InclusionState } from '../enums'
import { getCoinType } from '@core/profile/actions'
import { SubjectType } from '@core/wallet'
import { getSubjectFromAddress } from '@core/wallet'
import { WEI_PER_GLOW } from '@core/layer-2'
import Web3 from 'web3'
import { NetworkId } from '@core/network/types'
Expand All @@ -13,6 +13,7 @@ export async function generateActivityFromEvmTransaction(
): Promise<TransactionActivity> {
const direction = ActivityDirection.Outgoing // Currently only sent transactions are supported

const subject = getSubjectFromAddress(transaction.to, networkId)
const timestamp = (await provider.eth.getBlock(transaction.blockNumber)).timestamp
return {
type: ActivityType.Basic,
Expand All @@ -26,7 +27,7 @@ export async function generateActivityFromEvmTransaction(
isInternal: false,
storageDeposit: 0,
gasUsed: transaction.gasUsed,
subject: { type: SubjectType.Address, address: transaction.to },
subject,
rawBaseCoinAmount: Number(transaction.value) / Number(WEI_PER_GLOW),
rawAmount: Number(transaction.value) / Number(WEI_PER_GLOW),
tokenId: getCoinType(),
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,7 @@
"transactionTime": "Transaction time",
"surplus": "Surplus",
"storageDeposit": "Storage deposit",
"gasUsed": "Gas used",
"giftedStorageDeposit": "Gifted storage deposit",
"storageDepositPerNft": "Storage deposit per NFT",
"totalStorageDeposit": "Total storage deposit",
Expand Down

0 comments on commit eddf4e2

Please sign in to comment.