Skip to content

Commit

Permalink
Merge branch 'feat/has-interaction' into tmp/20241018
Browse files Browse the repository at this point in the history
  • Loading branch information
vvvvvv1vvvvvv committed Oct 17, 2024
2 parents e20c9d7 + 62ed7ba commit 1865cc2
Show file tree
Hide file tree
Showing 23 changed files with 130 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@rabby-wallet/eth-watch-keyring": "1.0.0",
"@rabby-wallet/gnosis-sdk": "1.3.8",
"@rabby-wallet/page-provider": "0.4.2",
"@rabby-wallet/rabby-action": "0.1.3",
"@rabby-wallet/rabby-action": "0.1.4",
"@rabby-wallet/rabby-api": "0.8.2",
"@rabby-wallet/rabby-security-engine": "2.0.7",
"@rabby-wallet/rabby-swap": "0.0.40",
Expand Down
6 changes: 6 additions & 0 deletions src/ui/views/Approval/components/Actions/ApproveNFT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ const ApproveNFT = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.interacted')}</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1043"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const ApproveNFTCollection = ({
engineResults: Result[];
}) => {
const actionData = data!;
const dispatch = useRabbyDispatch();
const { t } = useTranslation();

const engineResultMap = useMemo(() => {
Expand Down Expand Up @@ -122,6 +121,12 @@ const ApproveNFTCollection = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.interacted')}</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1053"
Expand Down
7 changes: 7 additions & 0 deletions src/ui/views/Approval/components/Actions/ContractCall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const ContractCall = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}
>
Expand All @@ -124,6 +125,12 @@ const ContractCall = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.interacted')}</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
7 changes: 7 additions & 0 deletions src/ui/views/Approval/components/Actions/CrossSwapToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ const CrossSwapToken = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}
>
Expand All @@ -266,6 +267,12 @@ const CrossSwapToken = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.interacted')}</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
1 change: 1 addition & 0 deletions src/ui/views/Approval/components/Actions/CrossToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const Swap = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}
>
Expand Down
6 changes: 6 additions & 0 deletions src/ui/views/Approval/components/Actions/MultiSwap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ const MultiSwap = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.interacted')}</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
Expand Down
7 changes: 7 additions & 0 deletions src/ui/views/Approval/components/Actions/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const Swap = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}
>
Expand All @@ -326,6 +327,12 @@ const Swap = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
6 changes: 6 additions & 0 deletions src/ui/views/Approval/components/Actions/SwapLimitPay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ const SwapLimitPay = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
Expand Down
6 changes: 6 additions & 0 deletions src/ui/views/Approval/components/Actions/TokenApprove.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ const TokenApprove = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1022"
Expand Down
7 changes: 7 additions & 0 deletions src/ui/views/Approval/components/Actions/UnWrapToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ const UnWrapToken = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}
>
Expand All @@ -206,6 +207,12 @@ const UnWrapToken = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
7 changes: 7 additions & 0 deletions src/ui/views/Approval/components/Actions/WrapToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ const WrapToken = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}
>
Expand All @@ -206,6 +207,12 @@ const WrapToken = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface ContractData {
bornAt: number | null;
rank: number | null;
title?: string;
hasInteraction: boolean;
}

export interface Props {
Expand Down Expand Up @@ -63,6 +64,12 @@ export const ContractPopup: React.FC<Props> = ({ data }) => {
<Values.Protocol value={data.protocol} />
</Row>
</Col>
<Col>
<Row>{t('page.signTx.interacted')}</Row>
<Row>
<Values.Boolean value={data.hasInteraction} />
</Row>
</Col>
<Col>
<Row>{t('page.signTx.deployTimeTitle')}</Row>
<Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface NFTSpenderData {
isEOA: boolean;
isDanger: boolean | null;
isRevoke?: boolean;
hasInteraction: boolean;
}

export interface Props {
Expand Down Expand Up @@ -106,6 +107,12 @@ export const NFTSpenderPopup: React.FC<Props> = ({ data }) => {
: '-'}
</Row>
</Col>
<Col>
<Row>{t('page.signTx.interacted')}</Row>
<Row>
<Values.Boolean value={data.hasInteraction} />
</Row>
</Col>
<Col>
<Row>{t('page.signTx.addressNote')}</Row>
<Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface SpenderData {
isEOA: boolean;
isDanger: boolean | null;
isRevoke?: boolean;
hasInteraction: boolean;
}

export interface Props {
Expand Down Expand Up @@ -106,6 +107,12 @@ export const SpenderPopup: React.FC<Props> = ({ data }) => {
: '-'}
</Row>
</Col>
<Col>
<Row>{t('page.signTx.interacted')}</Row>
<Row>
<Values.Boolean value={data.hasInteraction} />
</Row>
</Col>
<Col>
<Row>{t('page.signTx.addressNote')}</Row>
<Row>
Expand Down
1 change: 1 addition & 0 deletions src/ui/views/Approval/components/CommonAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const CommonAction = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}
>
Expand Down
6 changes: 5 additions & 1 deletion src/ui/views/Approval/components/SignTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ const SignTx = ({ params, origin }: SignTxProps) => {
Modal.error({
title: 'Error',
content: e.message || JSON.stringify(e),
className: 'modal-support-darkmode',
});
}
};
Expand Down Expand Up @@ -1005,7 +1006,10 @@ const SignTx = ({ params, origin }: SignTxProps) => {
}
resolveApproval();
} catch (e) {
message.error(e.message);
message.error({
content: e.message,
className: 'modal-support-darkmode',
});
}
}
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ const Permit2 = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1109"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const ContractCall = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}
>
Expand All @@ -127,6 +128,12 @@ const ContractCall = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>{t('page.signTx.myMark')}</SubRow>
Expand Down
6 changes: 6 additions & 0 deletions src/ui/views/Approval/components/TypedDataActions/Permit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ const Permit = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1077"
Expand Down
6 changes: 6 additions & 0 deletions src/ui/views/Approval/components/TypedDataActions/Permit2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ const Permit2 = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1071"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ const Permit = ({
rank: requireData.rank,
address: requireData.id,
chain,
hasInteraction: requireData.hasInteraction,
title: t('page.signTypedData.buyNFT.listOn'),
}}
>
Expand All @@ -260,6 +261,12 @@ const Permit = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.signTx.hasInteraction')}</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4710,10 +4710,10 @@
sinon-chrome "^3.0.1"
webextension-polyfill "0.7.0"

"@rabby-wallet/[email protected].3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@rabby-wallet/rabby-action/-/rabby-action-0.1.3.tgz#729f495903afe212612b3e6616ca3684c10698e3"
integrity sha512-Y6S+c300rjdeSJf4+gz+9VVmDh91LWh9hIRTmWFLUEJO7dZakQJNiiGQ31DwiMzwTvHOMY4EL++Hs+IAQmXOyQ==
"@rabby-wallet/[email protected].4":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@rabby-wallet/rabby-action/-/rabby-action-0.1.4.tgz#c82e7c8b538b7dfd94506c4f89f78aca7ca880ef"
integrity sha512-6ttnlpGHcO2v/qyYo8epBbSutfS9OZXfXr9mfapuveoBvzqUwvE6ej3bsmdtc+qFhFeH7HeiwASpY6xaTM4E1w==

"@rabby-wallet/[email protected]":
version "0.8.2"
Expand Down

0 comments on commit 1865cc2

Please sign in to comment.