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

added transferTo field in send details #5384

Merged
merged 15 commits into from
Feb 20, 2024
3 changes: 3 additions & 0 deletions src/graphql/queries/metadata.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ query simulateTransactions(
quantityAtRisk
}
meta {
transferTo {
...target
}
to {
...target
}
Expand Down
10 changes: 5 additions & 5 deletions src/screens/SignTransactionSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1849,12 +1849,11 @@ const DetailsCard = ({
meta?.to?.function || (methodName && methodName.substring(0, 2) !== '0x');
const isContract =
showFunctionRow || meta?.to?.created || meta?.to?.sourceCodeStatus;

const showTransferToRow = meta?.transferTo;
dereknelson marked this conversation as resolved.
Show resolved Hide resolved
// Hide DetailsCard if balance is insufficient once loaded
if (!isLoading && isBalanceEnough === false) {
return <></>;
}

return (
<FadedScrollCard
cardHeight={cardHeight}
Expand Down Expand Up @@ -1899,20 +1898,21 @@ const DetailsCard = ({
value={getNetworkObj(currentNetwork).name}
/>
}
{!!(meta?.to?.address || toAddress) && (
{!!(meta?.to?.address || toAddress || showTransferToRow) && (
<DetailRow
detailType={isContract ? 'contract' : 'to'}
onPress={() =>
ethereumUtils.openAddressInBlockExplorer(
meta?.to?.address! || toAddress,
meta?.to?.address! || toAddress || meta?.transferTo,
currentNetwork
)
}
value={
meta?.to?.name ||
abbreviations.address(meta?.to?.address || toAddress, 4, 6) ||
meta?.to?.address ||
toAddress
toAddress ||
meta?.transferTo
}
/>
)}
Expand Down