Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use new cross chain transaction payload action #2167

Merged
merged 7 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
727 changes: 62 additions & 665 deletions webapp/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dcl-catalyst-commons": "^9.0.1",
"decentraland-connect": "^6.2.0",
"decentraland-crypto-fetch": "^1.0.3",
"decentraland-dapps": "^18.5.0",
"decentraland-dapps": "^19.0.0",
"decentraland-transactions": "^2.3.1",
"decentraland-ui": "^5.8.0",
"ethers": "^5.6.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ const Transaction = (props: Props) => {
/>
}
tx={tx}
isCrossChain={tx.actionType === BUY_ITEM_CROSS_CHAIN_SUCCESS}
/>
)}
</AssetProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import React, { useEffect, useState } from 'react'
import React from 'react'
import { Link } from 'react-router-dom'
import { Loader, Icon } from 'decentraland-ui'
import { Network } from '@dcl/schemas'
import { getChainConfiguration } from 'decentraland-dapps/dist/lib/chainConfiguration'
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
import {
isPending,
getTransactionHref
} from 'decentraland-dapps/dist/modules/transaction/utils'
import {
TransactionStatus,
Transaction
} from 'decentraland-dapps/dist/modules/transaction/types'
import { isPending } from 'decentraland-dapps/dist/modules/transaction/utils'
import { TransactionStatus } from 'decentraland-dapps/dist/modules/transaction/types'
import { formatDistanceToNow } from '../../../../lib/date'
import { getAssetUrl } from '../../../../modules/asset/utils'
import { AssetImage } from '../../../AssetImage'
Expand All @@ -21,26 +15,9 @@ import { Mana } from '../../../Mana'
import { Props } from './TransactionDetail.types'
import './TransactionDetail.css'

const getHref = (tx: Transaction) => {
if (tx.status === null) {
return
}
return getTransactionHref({ txHash: tx.replacedBy || tx.hash }, tx.chainId)
}

const TransactionDetail = (props: Props) => {
const { asset, text, tx, isCrossChain = false } = props
const [txLink, setTxLink] = useState(getHref(tx))
useEffect(() => {
;(async () => {
if (isCrossChain) {
const { AxelarProvider } = await import(
'decentraland-transactions/crossChain'
)
setTxLink(await AxelarProvider.getTxLink(tx.hash))
}
})()
})
const { asset, text, tx } = props

return (
<Row className="TransactionDetail">
<Column align="left" grow={true}>
Expand Down Expand Up @@ -69,7 +46,7 @@ const TransactionDetail = (props: Props) => {
</Column>
<Column align="right">
<a
href={txLink}
href={tx.url}
className={tx.status ? 'status ' + tx.status : 'status'}
target="_blank"
rel="noopener noreferrer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export type Props = {
asset?: Asset | null
text: React.ReactNode
tx: Transaction
isCrossChain?: boolean
}

export type MapStateProps = {}
Expand Down
Loading
Loading