diff --git a/packages/unchained-client/src/cosmossdk/thorchain/parser/thorchain.ts b/packages/unchained-client/src/cosmossdk/thorchain/parser/thorchain.ts index d8040b59c17..92a9949fa84 100644 --- a/packages/unchained-client/src/cosmossdk/thorchain/parser/thorchain.ts +++ b/packages/unchained-client/src/cosmossdk/thorchain/parser/thorchain.ts @@ -19,7 +19,7 @@ export class Parser implements SubParser { const outboundMemoEvent = Object.values(tx.events).find(event => !!event['outbound']?.['memo']) const outboundMemo = outboundMemoEvent?.['outbound']?.['memo'] - const memo = messageMemo || outboundMemo + const memo = messageMemo || outboundMemo || tx.memo if (!memo) return diff --git a/packages/unchained-client/src/parser/thorchain.ts b/packages/unchained-client/src/parser/thorchain.ts index a1ea2ff1477..c2974063171 100644 --- a/packages/unchained-client/src/parser/thorchain.ts +++ b/packages/unchained-client/src/parser/thorchain.ts @@ -112,6 +112,8 @@ export interface ParserArgs { midgardUrl: string } +// TODO(gomes): obviously revert me and use actual memo from rewards +const RFOX_REWARDS_MEMO = "beep boop I'm a memo" const streamingSwapRegex = /:(\d+|(\d+(?:e[+-]?\d+)?))\/\d+\/\d+:/ const getLiquidityType = (pool: string): LiquidityType => (pool.includes('/') ? 'Savers' : 'LP') @@ -129,6 +131,9 @@ export class Parser { async parse(memo: string): Promise { const [type] = memo.split(':') + if (memo.includes(RFOX_REWARDS_MEMO)) + return { data: { parser: 'thorchain', memo, method: 'rfoxRewards' } } + switch (type.toLowerCase()) { case 'swap': case '=': diff --git a/src/assets/translations/en/main.json b/src/assets/translations/en/main.json index c18dddd1348..cf9a1b6f8f9 100644 --- a/src/assets/translations/en/main.json +++ b/src/assets/translations/en/main.json @@ -684,7 +684,8 @@ "swapRefund": "Swap Refund", "withdraw": "Withdraw Requested", "withdrawNative": "Withdraw", - "withdrawOut": "Withdraw Received" + "withdrawOut": "Withdraw Received", + "rfoxRewards": "Rewards Received" }, "foxy": { "stake": "Stake", diff --git a/src/components/TransactionHistoryRows/TransactionMethod.tsx b/src/components/TransactionHistoryRows/TransactionMethod.tsx index 1b1ad841f0d..1917ce77c50 100644 --- a/src/components/TransactionHistoryRows/TransactionMethod.tsx +++ b/src/components/TransactionHistoryRows/TransactionMethod.tsx @@ -94,6 +94,7 @@ export const TransactionMethod = ({ case Method.Unstake: case Method.WithdrawDelegatorReward: case Method.WithdrawOut: + case Method.RfoxRewards: return TransferType.Receive case Method.Approve: case Method.Revoke: diff --git a/src/components/TransactionHistoryRows/TransactionTag.tsx b/src/components/TransactionHistoryRows/TransactionTag.tsx index 3bd86a026b0..41e8db4197a 100644 --- a/src/components/TransactionHistoryRows/TransactionTag.tsx +++ b/src/components/TransactionHistoryRows/TransactionTag.tsx @@ -7,6 +7,10 @@ type TransactionTagProps = { txDetails: TxDetails transfersByType: Record } + +// TODO(gomes): obviously revert me and use actual memo from rewards +const RFOX_REWARDS_MEMO = "beep boop I'm a memo" + export const TransactionTag: React.FC = ({ txDetails, transfersByType }) => { const txData = useMemo(() => txDetails?.tx.data, [txDetails?.tx.data]) const isNft = useMemo(() => { @@ -29,6 +33,14 @@ export const TransactionTag: React.FC = ({ txDetails, trans ) } + + if (txData && txData.parser === 'thorchain' && txData.memo === RFOX_REWARDS_MEMO) { + return ( + + rFOX + + ) + } if (txData && txData.parser === 'thorchain' && txData.liquidity) { return ( diff --git a/src/hooks/useTxDetails/useTxDetails.ts b/src/hooks/useTxDetails/useTxDetails.ts index 6438f7a4154..5fd716f29f2 100644 --- a/src/hooks/useTxDetails/useTxDetails.ts +++ b/src/hooks/useTxDetails/useTxDetails.ts @@ -48,6 +48,7 @@ export enum Method { RecvPacket = 'recv_packet', Refund = 'refund', RemoveLiquidityEth = 'removeLiquidityETH', + RfoxRewards = 'rfoxRewards', Revoke = 'revoke', Stake = 'stake', SwapOut = 'swapOut',