-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: mf-4832 data converting in activities * fix: mf-4801 missing token * fix: mf-4800 add scam label * fix: mf-4804 add operation buttons to transaction detail * fix: mf-4802 pass original tx to new tx
- Loading branch information
Showing
9 changed files
with
274 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
266 changes: 154 additions & 112 deletions
266
packages/mask/src/extension/popups/pages/Wallet/TransactionDetail/index.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/mask/src/extension/popups/pages/Wallet/hooks/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export * from './useWalletContext.js' | ||
export * from './useAsset.js' | ||
export * from './useAssetExpand.js' | ||
export * from './useWalletAssets.js' | ||
export * from './useAsset.js' | ||
export * from './useWalletContext.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Web3 } from '@masknet/web3-providers' | ||
import type { RecentTransaction } from '@masknet/web3-shared-base' | ||
import { | ||
ProviderType, | ||
type ChainId, | ||
type Transaction as EvmTransaction, | ||
formatWeiToGwei, | ||
} from '@masknet/web3-shared-evm' | ||
import { GasSettingModal } from '../../modals/modals.js' | ||
import { ReplaceType } from './type.js' | ||
|
||
export async function modifyTransaction( | ||
transaction: RecentTransaction<ChainId, EvmTransaction>, | ||
replaceType: ReplaceType, | ||
) { | ||
const candidate = transaction.candidates[transaction.indexId] | ||
if (!candidate) return | ||
const oldGasSettings = { | ||
gas: candidate.gas!, | ||
gasPrice: candidate.gasPrice, | ||
maxFeePerGas: candidate.maxFeePerGas ? formatWeiToGwei(candidate.maxFeePerGas).toFixed() : undefined, | ||
maxPriorityFeePerGas: candidate.maxPriorityFeePerGas | ||
? formatWeiToGwei(candidate.maxPriorityFeePerGas).toFixed() | ||
: undefined, | ||
} | ||
const gasSettings = await GasSettingModal.openAndWaitForClose({ | ||
chainId: transaction.chainId, | ||
config: oldGasSettings, | ||
nonce: candidate.nonce!, | ||
replaceType, | ||
}) | ||
if (!gasSettings) return | ||
const newConfig = { | ||
...candidate, | ||
...oldGasSettings, | ||
...gasSettings, | ||
} | ||
if (replaceType === ReplaceType.CANCEL) { | ||
await Web3.cancelTransaction(transaction.id, newConfig, { | ||
providerType: ProviderType.MaskWallet, | ||
}) | ||
} else { | ||
await Web3.replaceTransaction(transaction.id, newConfig, { | ||
providerType: ProviderType.MaskWallet, | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters