mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Token allowance improvements feature flag (#15646)
This commit is contained in:
parent
9a359b87d1
commit
47d61c6832
@ -7,6 +7,7 @@ SWAPS_USE_DEV_APIS=
|
|||||||
COLLECTIBLES_V1=
|
COLLECTIBLES_V1=
|
||||||
PUBNUB_PUB_KEY=
|
PUBNUB_PUB_KEY=
|
||||||
PUBNUB_SUB_KEY=
|
PUBNUB_SUB_KEY=
|
||||||
|
TOKEN_ALLOWANCE_IMPROVEMENTS=
|
||||||
|
|
||||||
; Set this to '1' to enable support for Sign-In with Ethereum [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361)
|
; Set this to '1' to enable support for Sign-In with Ethereum [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361)
|
||||||
SIWE_V1=
|
SIWE_V1=
|
||||||
|
@ -1038,6 +1038,7 @@ async function getEnvironmentVariables({ buildTarget, buildType, version }) {
|
|||||||
SENTRY_DSN_DEV: config.SENTRY_DSN_DEV,
|
SENTRY_DSN_DEV: config.SENTRY_DSN_DEV,
|
||||||
SIWE_V1: config.SIWE_V1 === '1',
|
SIWE_V1: config.SIWE_V1 === '1',
|
||||||
SWAPS_USE_DEV_APIS: config.SWAPS_USE_DEV_APIS === '1',
|
SWAPS_USE_DEV_APIS: config.SWAPS_USE_DEV_APIS === '1',
|
||||||
|
TOKEN_ALLOWANCE_IMPROVEMENTS: config.TOKEN_ALLOWANCE_IMPROVEMENTS === '1',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,123 +162,125 @@ export default function ConfirmApprove({
|
|||||||
return tokenSymbol === undefined && assetName === undefined ? (
|
return tokenSymbol === undefined && assetName === undefined ? (
|
||||||
<Loading />
|
<Loading />
|
||||||
) : (
|
) : (
|
||||||
<GasFeeContextProvider transaction={transaction}>
|
!process.env.TOKEN_ALLOWANCE_IMPROVEMENTS && (
|
||||||
<ConfirmTransactionBase
|
<GasFeeContextProvider transaction={transaction}>
|
||||||
toAddress={toAddress}
|
<ConfirmTransactionBase
|
||||||
identiconAddress={toAddress}
|
toAddress={toAddress}
|
||||||
showAccountInHeader
|
identiconAddress={toAddress}
|
||||||
title={tokensText}
|
showAccountInHeader
|
||||||
customTokenAmount={String(customPermissionAmount)}
|
title={tokensText}
|
||||||
dappProposedTokenAmount={tokenAmount}
|
customTokenAmount={String(customPermissionAmount)}
|
||||||
currentTokenBalance={tokenBalance}
|
dappProposedTokenAmount={tokenAmount}
|
||||||
contentComponent={
|
currentTokenBalance={tokenBalance}
|
||||||
<TransactionModalContextProvider>
|
contentComponent={
|
||||||
<ConfirmApproveContent
|
<TransactionModalContextProvider>
|
||||||
userAddress={userAddress}
|
<ConfirmApproveContent
|
||||||
isSetApproveForAll={isSetApproveForAll}
|
userAddress={userAddress}
|
||||||
setApproveForAllArg={setApproveForAllArg}
|
isSetApproveForAll={isSetApproveForAll}
|
||||||
decimals={decimals}
|
setApproveForAllArg={setApproveForAllArg}
|
||||||
siteImage={siteImage}
|
decimals={decimals}
|
||||||
setCustomAmount={setCustomPermissionAmount}
|
siteImage={siteImage}
|
||||||
customTokenAmount={String(customPermissionAmount)}
|
setCustomAmount={setCustomPermissionAmount}
|
||||||
tokenAmount={tokenAmount}
|
customTokenAmount={String(customPermissionAmount)}
|
||||||
origin={formattedOrigin}
|
tokenAmount={tokenAmount}
|
||||||
tokenSymbol={tokenSymbol}
|
origin={formattedOrigin}
|
||||||
tokenImage={tokenImage}
|
tokenSymbol={tokenSymbol}
|
||||||
tokenBalance={tokenBalance}
|
tokenImage={tokenImage}
|
||||||
tokenId={tokenId}
|
tokenBalance={tokenBalance}
|
||||||
assetName={assetName}
|
tokenId={tokenId}
|
||||||
assetStandard={assetStandard}
|
assetName={assetName}
|
||||||
tokenAddress={tokenAddress}
|
assetStandard={assetStandard}
|
||||||
showCustomizeGasModal={approveTransaction}
|
tokenAddress={tokenAddress}
|
||||||
showEditApprovalPermissionModal={({
|
showCustomizeGasModal={approveTransaction}
|
||||||
/* eslint-disable no-shadow */
|
showEditApprovalPermissionModal={({
|
||||||
customTokenAmount,
|
/* eslint-disable no-shadow */
|
||||||
decimals,
|
customTokenAmount,
|
||||||
origin,
|
decimals,
|
||||||
setCustomAmount,
|
origin,
|
||||||
tokenAmount,
|
setCustomAmount,
|
||||||
tokenBalance,
|
tokenAmount,
|
||||||
tokenSymbol,
|
tokenBalance,
|
||||||
/* eslint-enable no-shadow */
|
tokenSymbol,
|
||||||
}) =>
|
/* eslint-enable no-shadow */
|
||||||
dispatch(
|
}) =>
|
||||||
showModal({
|
dispatch(
|
||||||
name: 'EDIT_APPROVAL_PERMISSION',
|
showModal({
|
||||||
customTokenAmount,
|
name: 'EDIT_APPROVAL_PERMISSION',
|
||||||
decimals,
|
customTokenAmount,
|
||||||
origin,
|
decimals,
|
||||||
setCustomAmount,
|
origin,
|
||||||
tokenAmount,
|
setCustomAmount,
|
||||||
tokenBalance,
|
tokenAmount,
|
||||||
tokenSymbol,
|
tokenBalance,
|
||||||
tokenId,
|
tokenSymbol,
|
||||||
assetStandard,
|
tokenId,
|
||||||
}),
|
assetStandard,
|
||||||
)
|
}),
|
||||||
}
|
)
|
||||||
data={customData || transactionData}
|
}
|
||||||
toAddress={toAddress}
|
data={customData || transactionData}
|
||||||
currentCurrency={currentCurrency}
|
toAddress={toAddress}
|
||||||
nativeCurrency={nativeCurrency}
|
currentCurrency={currentCurrency}
|
||||||
ethTransactionTotal={ethTransactionTotal}
|
nativeCurrency={nativeCurrency}
|
||||||
fiatTransactionTotal={fiatTransactionTotal}
|
ethTransactionTotal={ethTransactionTotal}
|
||||||
hexTransactionTotal={hexTransactionTotal}
|
fiatTransactionTotal={fiatTransactionTotal}
|
||||||
useNonceField={useNonceField}
|
hexTransactionTotal={hexTransactionTotal}
|
||||||
nextNonce={nextNonce}
|
useNonceField={useNonceField}
|
||||||
customNonceValue={customNonceValue}
|
nextNonce={nextNonce}
|
||||||
updateCustomNonce={(value) => {
|
customNonceValue={customNonceValue}
|
||||||
dispatch(updateCustomNonce(value));
|
updateCustomNonce={(value) => {
|
||||||
}}
|
dispatch(updateCustomNonce(value));
|
||||||
getNextNonce={() => dispatch(getNextNonce())}
|
}}
|
||||||
showCustomizeNonceModal={({
|
getNextNonce={() => dispatch(getNextNonce())}
|
||||||
/* eslint-disable no-shadow */
|
showCustomizeNonceModal={({
|
||||||
useNonceField,
|
/* eslint-disable no-shadow */
|
||||||
nextNonce,
|
useNonceField,
|
||||||
customNonceValue,
|
nextNonce,
|
||||||
updateCustomNonce,
|
customNonceValue,
|
||||||
getNextNonce,
|
updateCustomNonce,
|
||||||
/* eslint-disable no-shadow */
|
getNextNonce,
|
||||||
}) =>
|
/* eslint-disable no-shadow */
|
||||||
dispatch(
|
}) =>
|
||||||
showModal({
|
dispatch(
|
||||||
name: 'CUSTOMIZE_NONCE',
|
showModal({
|
||||||
useNonceField,
|
name: 'CUSTOMIZE_NONCE',
|
||||||
nextNonce,
|
useNonceField,
|
||||||
customNonceValue,
|
nextNonce,
|
||||||
updateCustomNonce,
|
customNonceValue,
|
||||||
getNextNonce,
|
updateCustomNonce,
|
||||||
}),
|
getNextNonce,
|
||||||
)
|
}),
|
||||||
}
|
)
|
||||||
warning={submitWarning}
|
}
|
||||||
txData={transaction}
|
warning={submitWarning}
|
||||||
fromAddressIsLedger={fromAddressIsLedger}
|
txData={transaction}
|
||||||
chainId={chainId}
|
fromAddressIsLedger={fromAddressIsLedger}
|
||||||
rpcPrefs={rpcPrefs}
|
chainId={chainId}
|
||||||
isContract={isContract}
|
rpcPrefs={rpcPrefs}
|
||||||
isMultiLayerFeeNetwork={isMultiLayerFeeNetwork}
|
isContract={isContract}
|
||||||
supportsEIP1559V2={supportsEIP1559V2}
|
isMultiLayerFeeNetwork={isMultiLayerFeeNetwork}
|
||||||
/>
|
supportsEIP1559V2={supportsEIP1559V2}
|
||||||
{showCustomizeGasPopover && !supportsEIP1559V2 && (
|
|
||||||
<EditGasPopover
|
|
||||||
onClose={closeCustomizeGasPopover}
|
|
||||||
mode={EDIT_GAS_MODES.MODIFY_IN_PLACE}
|
|
||||||
transaction={transaction}
|
|
||||||
/>
|
/>
|
||||||
)}
|
{showCustomizeGasPopover && !supportsEIP1559V2 && (
|
||||||
{supportsEIP1559V2 && (
|
<EditGasPopover
|
||||||
<>
|
onClose={closeCustomizeGasPopover}
|
||||||
<EditGasFeePopover />
|
mode={EDIT_GAS_MODES.MODIFY_IN_PLACE}
|
||||||
<AdvancedGasFeePopover />
|
transaction={transaction}
|
||||||
</>
|
/>
|
||||||
)}
|
)}
|
||||||
</TransactionModalContextProvider>
|
{supportsEIP1559V2 && (
|
||||||
}
|
<>
|
||||||
hideSenderToRecipient
|
<EditGasFeePopover />
|
||||||
customTxParamsData={customData}
|
<AdvancedGasFeePopover />
|
||||||
/>
|
</>
|
||||||
</GasFeeContextProvider>
|
)}
|
||||||
|
</TransactionModalContextProvider>
|
||||||
|
}
|
||||||
|
hideSenderToRecipient
|
||||||
|
customTxParamsData={customData}
|
||||||
|
/>
|
||||||
|
</GasFeeContextProvider>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user