{airdrop && airdrop.amount > 0 ? (
@@ -465,6 +476,20 @@ const Staking = (): JSX.Element => {
)}
+ {otherRewards.length > 0 && (
+
+
+
+
+
+ )}
{
className="logout-modal-cancel-btn me-sm-4 mb-4 mb-sm-0"
data-bs-dismiss="modal"
onClick={() => {
- setOnConfirmOperation(() => noop);
+ setOnConfirmOperation(noop);
}}
>
{t('common.cancel')}
diff --git a/src/screens/Staking/components/Cards/RewardsCard.tsx b/src/screens/Staking/components/Cards/RewardsCard.tsx
index e87243b8..16443cb4 100644
--- a/src/screens/Staking/components/Cards/RewardsCard.tsx
+++ b/src/screens/Staking/components/Cards/RewardsCard.tsx
@@ -1,7 +1,6 @@
import React from 'react';
import assets from 'assets';
-import { CLIENT_PRECISION } from 'constant';
import { Button, Card } from 'frontend-elements';
import { Rewards } from 'models';
import { useTranslation } from 'react-i18next';
@@ -27,7 +26,7 @@ const RewardsCard = ({ rewards, onClaim, isLoading }: Props): JSX.Element => {
0
- ? NumbersUtils.convertUnitNumber(rewards.total[0].amount) / CLIENT_PRECISION
+ ? NumbersUtils.convertUnitNumber(rewards.total[0].amount)
: 0,
)}
big
diff --git a/src/screens/Staking/components/Lists/OtherStakingRewards.tsx b/src/screens/Staking/components/Lists/OtherStakingRewards.tsx
new file mode 100644
index 00000000..f6c4be7b
--- /dev/null
+++ b/src/screens/Staking/components/Lists/OtherStakingRewards.tsx
@@ -0,0 +1,112 @@
+import React from 'react';
+import { useTranslation } from 'react-i18next';
+import { useSelector } from 'react-redux';
+import numeral from 'numeral';
+import { Validator } from '@lum-network/sdk-javascript/build/codec/cosmos/staking/v1beta1/staking';
+
+import { Collapsible, SmallerDecimal } from 'components';
+import { CLIENT_PRECISION, LUM_ASSETS_GITHUB } from 'constant';
+import { Card, ValidatorLogo } from 'frontend-elements';
+import { Reward, Rewards } from 'models';
+import { RootState } from 'redux/store';
+import { DenomsUtils, NumbersUtils, WalletClient, getExplorerLink, trunc, useWindowSize } from 'utils';
+
+const OtherStakingRewards = ({ validators, otherRewards }: { validators: Validator[]; otherRewards: Rewards[] }) => {
+ const prices = useSelector((state: RootState) => state.stats.prices);
+
+ const { t } = useTranslation();
+
+ const winSizes = useWindowSize();
+
+ const renderRow = (rewards: Reward, index: number) => {
+ const normalDenom = DenomsUtils.computeDenom(rewards.reward[0].denom);
+ const price = prices.find((p) => p.denom === normalDenom);
+ const amount = NumbersUtils.convertUnitNumber(parseFloat(rewards.reward[0].amount) / CLIENT_PRECISION);
+ const validator = validators.find((val) => val.operatorAddress === rewards.validatorAddress);
+
+ return (
+
+ );
+ };
+
+ const renderCollapsible = (rewards: Rewards, index: number) => {
+ const normalDenom = DenomsUtils.computeDenom(rewards.total[0].denom);
+ const price = prices.find((p) => p.denom === normalDenom);
+ const amount = NumbersUtils.convertUnitNumber(rewards.total[0].amount);
+
+ return (
+
+ 575.98}
+ header={
+
+ {winSizes.width > 575.98 && (
+
+ )}
+
+
+
+
+ {DenomsUtils.computeDenom(rewards.total[0].denom).toUpperCase()}
+
+
+
+ {price && numeral(amount * price.price).format('$0,0[.]00')}
+
+
+
+ }
+ content={<>{rewards.rewards.map(renderRow)}>}
+ />
+
+ );
+ };
+
+ return (
+ <>
+
+
{t('staking.otherStakingRewards.title')}
+
+ {otherRewards.map(renderCollapsible)}
+ >
+ );
+};
+
+export default OtherStakingRewards;
diff --git a/src/screens/Staking/components/Lists/styles/Lists.scss b/src/screens/Staking/components/Lists/styles/Lists.scss
index 28c44a71..035b7387 100644
--- a/src/screens/Staking/components/Lists/styles/Lists.scss
+++ b/src/screens/Staking/components/Lists/styles/Lists.scss
@@ -1,82 +1,128 @@
@import 'src/styles/main';
-.delegate-btn,
-.delegate-btn:hover {
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 5px 15px;
- position: relative;
- background: linear-gradient(white, white) padding-box,
- linear-gradient(to top, rgba(192, 113, 79, 1), rgba(253, 184, 134, 1)) border-box;
- border: 1px solid transparent;
- color: $color-primary;
-}
-
-tr:nth-child(odd) > td > .delegate-btn {
- background: linear-gradient($color-striped, $color-striped) padding-box,
- linear-gradient(to top, rgba(192, 113, 79, 1), rgba(253, 184, 134, 1)) border-box;
-}
-
-.validators-table {
- overflow-y: visible !important;
-}
+#staking {
+ .delegate-btn,
+ .delegate-btn:hover {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 5px 15px;
+ position: relative;
+ background: linear-gradient(white, white) padding-box,
+ linear-gradient(to top, rgba(192, 113, 79, 1), rgba(253, 184, 134, 1)) border-box;
+ border: 1px solid transparent;
+ color: $color-primary;
+ }
-.validators-search-input {
- width: 264px;
-}
+ tr:nth-child(odd) > td > .delegate-btn {
+ background: linear-gradient($color-striped, $color-striped) padding-box,
+ linear-gradient(to top, rgba(192, 113, 79, 1), rgba(253, 184, 134, 1)) border-box;
+ }
-.search-input {
- box-shadow: inset 0px 3.42928px 5.14392px rgba(0, 0, 0, 0.05);
-}
+ .validators-table {
+ overflow-y: visible !important;
+ }
-.search-input > input {
- font-size: 10px;
- margin-left: 0.5rem !important;
-}
+ .validators-search-input {
+ width: 264px;
+ }
-@include media-breakpoint-down(lg) {
- .validators-table-row > td {
- padding-top: 1.5rem !important;
- padding-bottom: 1.5rem !important;
+ .search-input {
+ box-shadow: inset 0px 3.42928px 5.14392px rgba(0, 0, 0, 0.05);
}
- .validators-table > table.table thead {
- display: none;
+
+ .search-input > input {
+ font-size: 10px;
+ margin-left: 0.5rem !important;
}
- .validators-table > table.table tr {
- display: block;
- margin: 12px 0;
+ .action-btn {
+ background-color: transparent;
+ border: 2px $color-primary solid;
+ color: $color-primary;
+ padding: 5px 15px;
+ &:disabled {
+ background-color: transparent;
+ color: $color-grey;
+ border: 2px $color-grey solid;
+ }
}
- .validators-table > table.table td {
- display: block;
- text-align: right;
- height: 40px;
- padding-left: 24px !important;
- padding-right: 24px !important;
+ .other-rewards-card {
+ box-shadow: none;
+ background-color: $color-striped;
+
+ .other-reward-collapse {
+ border-top: rgba(0, 0, 0, 0.2) 1px solid;
+ }
}
+}
+
+@include media-breakpoint-down(lg) {
+ #staking {
+ .validators-table-row > td {
+ padding-top: 1.5rem !important;
+ padding-bottom: 1.5rem !important;
+ }
+ .validators-table > table.table thead {
+ display: none;
+ }
- .validators-table > table.table td:before {
- content: attr(data-label);
- float: left;
- font-weight: $medium;
+ .validators-table > table.table tr {
+ display: block;
+ margin: 12px 0;
+ }
+
+ .validators-table > table.table td {
+ display: block;
+ text-align: right;
+ height: 40px;
+ padding-left: 24px !important;
+ padding-right: 24px !important;
+ }
+
+ .validators-table > table.table td:before {
+ content: attr(data-label);
+ float: left;
+ font-weight: $medium;
+ }
}
}
@media (prefers-color-scheme: dark) {
- .validator-logo {
- filter: brightness(0) invert(1);
- }
- .delegate-btn,
- .delegate-btn:hover {
- background: linear-gradient($color-primary, $color-primary) padding-box,
- linear-gradient(to top, rgba(192, 113, 79, 1), rgba(253, 184, 134, 1)) border-box;
- color: white;
- }
+ #staking {
+ .validator-logo {
+ filter: brightness(0) invert(1);
+ }
+ .delegate-btn,
+ .delegate-btn:hover {
+ background: linear-gradient($color-primary, $color-primary) padding-box,
+ linear-gradient(to top, rgba(192, 113, 79, 1), rgba(253, 184, 134, 1)) border-box;
+ color: white;
+ }
- tr:nth-child(odd) > td > .delegate-btn {
- background: linear-gradient($color-dark-striped, $color-dark-striped) padding-box,
- linear-gradient(to top, rgba(192, 113, 79, 1), rgba(253, 184, 134, 1)) border-box;
+ tr:nth-child(odd) > td > .delegate-btn {
+ background: linear-gradient($color-dark-striped, $color-dark-striped) padding-box,
+ linear-gradient(to top, rgba(192, 113, 79, 1), rgba(253, 184, 134, 1)) border-box;
+ }
+
+ .action-btn {
+ border: 2px white solid;
+ color: white;
+
+ &:disabled {
+ background-color: transparent;
+ color: $color-grey;
+ border: 2px $color-grey solid;
+ }
+ }
+
+ .other-rewards-card {
+ background-color: $color-dark-striped;
+
+ .other-reward-collapse {
+ border-top: rgba(255, 255, 255, 0.2) 1px solid;
+ }
+ }
}
}
diff --git a/src/tests/app.test.tsx b/src/tests/app.test.tsx
index 2ac24c49..1f48f3ce 100644
--- a/src/tests/app.test.tsx
+++ b/src/tests/app.test.tsx
@@ -1,3 +1,4 @@
+import 'reflect-metadata';
import React from 'react';
import { screen, within, render } from '@testing-library/react';
import i18n from 'locales';
diff --git a/src/utils/client.ts b/src/utils/client.ts
index 56a6bb37..f3793b6a 100644
--- a/src/utils/client.ts
+++ b/src/utils/client.ts
@@ -4,7 +4,7 @@ import { ProposalStatus, VoteOption } from '@lum-network/sdk-javascript/build/co
import { Window as KeplrWindow } from '@keplr-wallet/types';
import { PasswordStrengthType, PasswordStrength, Wallet, Proposal, LumInfo } from 'models';
-import { showErrorToast, showSuccessToast } from 'utils';
+import { DenomsUtils, NumbersUtils, showErrorToast, showSuccessToast } from 'utils';
import i18n from 'locales';
import { COINGECKO_API_URL, IPFS_GATEWAY, MessageTypes } from 'constant';
@@ -267,13 +267,24 @@ class WalletClient {
let lum = 0;
let fiat = 0;
+ const otherBalancesArr = [];
+
const balances = await this.lumClient.getAllBalances(address);
+
const ulumBalance = balances.find((balance) => balance.denom === LumConstants.MicroLumDenom);
+ const otherBalances = balances.filter((balance) => balance.denom !== LumConstants.MicroLumDenom);
if (ulumBalance) {
lum += Number(LumUtils.convertUnit(ulumBalance, LumConstants.LumDenom));
}
+ for (const oB of otherBalances) {
+ otherBalancesArr.push({
+ denom: DenomsUtils.computeDenom(oB.denom),
+ amount: NumbersUtils.convertUnitNumber(oB.amount),
+ });
+ }
+
if (this.lumInfos) {
fiat = lum * this.lumInfos.price;
}
@@ -283,6 +294,7 @@ class WalletClient {
lum,
fiat,
},
+ otherBalances: otherBalancesArr,
};
};
@@ -674,7 +686,7 @@ class WalletClient {
};
};
- getAllRewards = async (fromWallet: Wallet, validatorsAddresses: string[], memo: string) => {
+ getRewardsFromValidators = async (fromWallet: Wallet, validatorsAddresses: string[], memo: string) => {
if (this.lumClient === null) {
return null;
}
diff --git a/src/utils/denoms.ts b/src/utils/denoms.ts
index de24d9d2..64a022b3 100644
--- a/src/utils/denoms.ts
+++ b/src/utils/denoms.ts
@@ -1,12 +1,31 @@
+import assets from 'assets';
import { IBCDenoms } from 'constant';
export const computeDenom = (denom: string): string => {
switch (denom) {
case IBCDenoms.USDC:
return 'usdc';
+ case IBCDenoms.ATOM_TESTNET:
+ case IBCDenoms.ATOM:
+ return 'atom';
+ case IBCDenoms.OSMO:
+ return 'osmo';
case 'udfr':
return 'dfr';
default:
return 'lum';
}
};
+
+export const getIconFromDenom = (denom: string) => {
+ switch (denom) {
+ case 'atom':
+ return assets.images.tokens.atom;
+ case 'osmo':
+ return assets.images.tokens.osmo;
+ case 'dfr':
+ return assets.images.tokens.dfr;
+ case 'usdc':
+ return assets.images.tokens.usdc;
+ }
+};
diff --git a/src/utils/hooks.ts b/src/utils/hooks.ts
index c358535c..e4fc28dc 100644
--- a/src/utils/hooks.ts
+++ b/src/utils/hooks.ts
@@ -1,4 +1,4 @@
-import { useEffect, useRef } from 'react';
+import { useEffect, useRef, useState } from 'react';
export const usePrevious = (value: T): T | undefined => {
const ref = useRef();
@@ -7,3 +7,32 @@ export const usePrevious = (value: T): T | undefined => {
}, [value]);
return ref.current;
};
+
+interface WindowSize {
+ width: number;
+ height: number;
+}
+
+export const useWindowSize = (): WindowSize => {
+ const [windowSize, setWindowSize] = useState({
+ width: window.innerWidth,
+ height: window.innerHeight,
+ });
+ useEffect(() => {
+ // Handler to call on window resize
+ function handleResize() {
+ // Set window width/height to state
+ setWindowSize({
+ width: window.innerWidth,
+ height: window.innerHeight,
+ });
+ }
+ // Add event listener
+ window.addEventListener('resize', handleResize);
+ // Call handler right away so state gets updated with initial window size
+ handleResize();
+ // Remove event listener on cleanup
+ return () => window.removeEventListener('resize', handleResize);
+ }, []);
+ return windowSize;
+};
diff --git a/src/utils/http.ts b/src/utils/http.ts
new file mode 100644
index 00000000..c0c5426e
--- /dev/null
+++ b/src/utils/http.ts
@@ -0,0 +1,40 @@
+import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
+import { plainToInstance } from 'class-transformer';
+import { MetadataModel } from 'models';
+
+declare module 'axios' {
+ interface AxiosResponse extends Promise {
+ data: T;
+ }
+}
+
+abstract class HttpClient {
+ protected readonly instance: AxiosInstance;
+ private readonly subObject?: string;
+
+ protected constructor(baseURL: string, subObject?: string) {
+ this.instance = axios.create({ baseURL, timeout: 10000 });
+ this.subObject = subObject;
+
+ this.initializeResponseInterceptor();
+ }
+
+ private initializeResponseInterceptor = () => {
+ this.instance.interceptors.response.use((res) => this.handleResponse(res), this.handleError);
+ };
+
+ private handleResponse = ({ data }: AxiosResponse) => data;
+
+ private handleError = (error: any): Promise => Promise.reject(error);
+
+ protected request = async (config: AxiosRequestConfig, Model: any): Promise<[T, MetadataModel]> => {
+ const response = await this.instance.request(config);
+
+ return [
+ plainToInstance(Model, this.subObject ? response[this.subObject] : response) as unknown as T,
+ plainToInstance(MetadataModel, response.metadata),
+ ];
+ };
+}
+
+export default HttpClient;
diff --git a/src/utils/index.ts b/src/utils/index.ts
index e55588ab..6ccc99a5 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -1,3 +1,5 @@
+export { default as HttpClient } from './http';
+export { default as StatsApi } from './statsApi';
export { default as WalletClient } from './client';
export type { MnemonicLength } from './client';
export * as WalletUtils from './client';
diff --git a/src/utils/links.ts b/src/utils/links.ts
index 5b7c5c18..8b67a5b7 100644
--- a/src/utils/links.ts
+++ b/src/utils/links.ts
@@ -1,5 +1,12 @@
import WalletClient from './client';
-import { LUM_EXPLORER, LUM_EXPLORER_TESTNET, LUM_WALLET, LUM_WALLET_TESTNET } from 'constant';
+import {
+ LUM_EXPLORER,
+ LUM_EXPLORER_TESTNET,
+ LUM_MILLIONS,
+ LUM_MILLIONS_TESTNET,
+ LUM_WALLET,
+ LUM_WALLET_TESTNET,
+} from 'constant';
const CUSTOM_NODE_KEY = 'custom-nodes';
@@ -24,3 +31,4 @@ export const getRpcFromNode = (node: string): string => `https://${node}/rpc`;
export const getExplorerLink = (): string => (WalletClient.isTestnet() ? LUM_EXPLORER_TESTNET : LUM_EXPLORER);
export const getWalletLink = (): string => (WalletClient.isTestnet() ? LUM_WALLET_TESTNET : LUM_WALLET);
+export const getMillionsLink = (): string => (WalletClient.isTestnet() ? LUM_MILLIONS_TESTNET : LUM_MILLIONS);
diff --git a/src/utils/numbers.ts b/src/utils/numbers.ts
index 4dcef43b..ade634f3 100644
--- a/src/utils/numbers.ts
+++ b/src/utils/numbers.ts
@@ -1,23 +1,31 @@
import { LumConstants, LumTypes, LumUtils } from '@lum-network/sdk-javascript';
import numeral from 'numeral';
-export const convertUnitNumber = (nb: number | string): number => {
+export const convertUnitNumber = (
+ nb: number | string,
+ fromDenom = LumConstants.MicroLumDenom,
+ toDenom = LumConstants.LumDenom,
+): number => {
let amount: string;
+ if (!nb) {
+ return 0;
+ }
+
if (typeof nb === 'string') {
const split = nb.split('.');
amount = split[0];
} else {
- amount = nb.toFixed();
+ amount = nb.toFixed(fromDenom.startsWith('u') ? 0 : 6);
}
const coin = {
amount,
- denom: LumConstants.MicroLumDenom,
+ denom: fromDenom,
};
- return parseFloat(LumUtils.convertUnit(coin, LumConstants.LumDenom));
+ return parseFloat(LumUtils.convertUnit(coin, toDenom));
};
export const formatUnit = (coin: LumTypes.Coin, moreDecimal?: boolean): string => {
diff --git a/src/utils/staking.ts b/src/utils/staking.ts
index e22f907f..d9349f0d 100644
--- a/src/utils/staking.ts
+++ b/src/utils/staking.ts
@@ -53,21 +53,31 @@ export const getUserValidators = (
const validators = [];
for (const delegation of delegations) {
- for (const reward of rewards.rewards) {
- if (delegation.delegation && reward.validatorAddress === delegation.delegation.validatorAddress) {
- const validator = validatorsList.find(
- (bondedVal) =>
- delegation.delegation && bondedVal.operatorAddress === delegation.delegation.validatorAddress,
- );
-
- if (validator) {
- validators.push({
- ...validator,
- reward: parseFloat(reward.reward.length > 0 ? reward.reward[0].amount : '0') / CLIENT_PRECISION,
- stakedCoins: NumbersUtils.formatTo6digit(
- NumbersUtils.convertUnitNumber(delegation.balance?.amount || '0'),
- ),
- });
+ const validator = validatorsList.find(
+ (bondedVal) =>
+ delegation.delegation && bondedVal.operatorAddress === delegation.delegation.validatorAddress,
+ );
+ if (validator) {
+ if (rewards.rewards.length === 0) {
+ validators.push({
+ ...validator,
+ reward: 0,
+ stakedCoins: NumbersUtils.formatTo6digit(
+ NumbersUtils.convertUnitNumber(delegation.balance?.amount || '0'),
+ ),
+ });
+ } else {
+ for (const reward of rewards.rewards) {
+ if (delegation.delegation && reward.validatorAddress === delegation.delegation.validatorAddress) {
+ validators.push({
+ ...validator,
+ reward:
+ parseFloat(reward.reward.length > 0 ? reward.reward[0].amount : '0') / CLIENT_PRECISION,
+ stakedCoins: NumbersUtils.formatTo6digit(
+ NumbersUtils.convertUnitNumber(delegation.balance?.amount || '0'),
+ ),
+ });
+ }
}
}
}
diff --git a/src/utils/statsApi.ts b/src/utils/statsApi.ts
new file mode 100644
index 00000000..78e1d1f1
--- /dev/null
+++ b/src/utils/statsApi.ts
@@ -0,0 +1,30 @@
+import { HttpClient } from 'utils';
+import { COINGECKO_API_URL } from 'constant';
+import { TokenModel } from 'models';
+
+class StatsApi extends HttpClient {
+ private static instance?: StatsApi;
+
+ private constructor() {
+ super(COINGECKO_API_URL);
+ }
+
+ public static getInstance(): StatsApi {
+ if (!this.instance) {
+ this.instance = new StatsApi();
+ }
+
+ return this.instance;
+ }
+
+ getPrices = async () =>
+ this.request(
+ {
+ url: '/coins/markets?vs_currency=usd&ids=lum-network%2C%20cosmos%2C%20osmosis&order=id_asc',
+ method: 'GET',
+ },
+ TokenModel,
+ );
+}
+
+export default StatsApi.getInstance();
diff --git a/src/utils/transactions.ts b/src/utils/transactions.ts
index 5294e3d7..bc32b8bd 100644
--- a/src/utils/transactions.ts
+++ b/src/utils/transactions.ts
@@ -37,6 +37,21 @@ type DFractInfos = {
amount: LumTypes.Coin;
};
+type MillionsDepositInfos = {
+ depositorAddress: string;
+ poolId: Long;
+ amount: LumTypes.Coin;
+ isSponsor: boolean;
+ winnerAddress: string;
+};
+
+type MillionsLeavePoolInfo = {
+ depositId: Long;
+ poolId: Long;
+ toAddress: string;
+ depositorAddress: string;
+};
+
export const isSendTxInfo = (
info: {
fromAddress?: string;
@@ -91,6 +106,36 @@ export const isDfractInfo = (
return !!(info && info.depositorAddress && info.amount);
};
+export const isMillionsDepositInfo = (
+ info: {
+ depositorAddress?: string;
+ poolId?: Long;
+ amount?: LumTypes.Coin;
+ isSponsor?: boolean;
+ winnerAddress?: string;
+ } | null,
+): info is MillionsDepositInfos => {
+ return !!(
+ info &&
+ info.depositorAddress &&
+ info.amount &&
+ info.poolId &&
+ info.winnerAddress &&
+ info.isSponsor !== undefined
+ );
+};
+
+export const isMillionsLeavePoolInfo = (
+ info: {
+ depositId?: Long;
+ poolId?: Long;
+ toAddress?: string;
+ depositorAddress?: string;
+ } | null,
+): info is MillionsLeavePoolInfo => {
+ return !!(info && info.depositorAddress && info.depositId && info.poolId && info.toAddress);
+};
+
export const hashExists = (txs: Transaction[], hash: string): boolean => txs.findIndex((tx) => tx.hash === hash) > -1;
export const formatTxs = (rawTxs: readonly TxResponse[] | TxResponse[]): Transaction[] => {
@@ -125,10 +170,7 @@ export const formatTxs = (rawTxs: readonly TxResponse[] | TxResponse[]): Transac
if (typeof txInfos === 'object') {
tx.messages.push(msg.typeUrl);
- if (isDfractInfo(txInfos)) {
- tx.fromAddress = txInfos.depositorAddress;
- tx.amount.push(txInfos.amount);
- } else if (isSendTxInfo(txInfos)) {
+ if (isSendTxInfo(txInfos)) {
tx.fromAddress = txInfos.fromAddress;
tx.toAddress = txInfos.toAddress;
tx.amount = txInfos.amount;
@@ -148,6 +190,15 @@ export const formatTxs = (rawTxs: readonly TxResponse[] | TxResponse[]): Transac
tx.fromAddress = txInfos.sender;
tx.toAddress = txInfos.receiver;
tx.amount.push(txInfos.token);
+ } else if (isMillionsDepositInfo(txInfos)) {
+ tx.fromAddress = txInfos.depositorAddress;
+ tx.toAddress = i18n.t('transactions.pool') + txInfos.poolId.toString();
+ tx.amount.push(txInfos.amount);
+ } else if (isMillionsLeavePoolInfo(txInfos)) {
+ tx.fromAddress = i18n.t('transactions.pool') + txInfos.poolId.toString();
+ } else if (isDfractInfo(txInfos)) {
+ tx.fromAddress = txInfos.depositorAddress;
+ tx.amount.push(txInfos.amount);
}
}
} catch {}
@@ -198,6 +249,31 @@ export const getTxTypeInfos = (
return { name: i18n.t('transactions.types.vote'), icon: assets.images.messageTypes.vote };
case LumMessages.MsgDepositDfractUrl:
return { name: i18n.t('transactions.types.depositDfract'), icon: assets.images.messageTypes.depositDfract };
+ case LumMessages.MsgMillionsDepositUrl:
+ return {
+ name: i18n.t('transactions.types.depositMillions'),
+ icon: assets.images.messageTypes.depositMillions,
+ };
+ case LumMessages.MsgDepositRetryUrl:
+ return {
+ name: i18n.t('transactions.types.depositRetryMillions'),
+ icon: assets.images.messageTypes.depositMillions,
+ };
+ case LumMessages.MsgClaimPrizeUrl:
+ return {
+ name: i18n.t('transactions.types.claimMillions'),
+ icon: assets.images.messageTypes.claimMillions,
+ };
+ case LumMessages.MsgWithdrawDepositUrl:
+ return {
+ name: i18n.t('transactions.types.withdrawMillions'),
+ icon: assets.images.messageTypes.withdrawMillions,
+ };
+ case LumMessages.MsgWithdrawDepositRetryUrl:
+ return {
+ name: i18n.t('transactions.types.withdrawRetryMillions'),
+ icon: assets.images.messageTypes.withdrawMillions,
+ };
case MessageTypes.IBC_TRANSFER:
return { name: i18n.t('transactions.types.ibcTransfer'), icon: assets.images.messageTypes.beam };
case MessageTypes.IBC_TIMEOUT:
diff --git a/yarn.lock b/yarn.lock
index 8c5ec73c..39733ff4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4538,6 +4538,11 @@ cjs-module-lexer@^1.0.0:
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40"
integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==
+class-transformer@^0.5.1:
+ version "0.5.1"
+ resolved "https://registry.yarnpkg.com/class-transformer/-/class-transformer-0.5.1.tgz#24147d5dffd2a6cea930a3250a677addf96ab336"
+ integrity sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==
+
clean-css@^5.2.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.3.2.tgz#70ecc7d4d4114921f5d298349ff86a31a9975224"
@@ -9875,6 +9880,11 @@ redux@^4.0.5:
dependencies:
"@babel/runtime" "^7.9.2"
+reflect-metadata@^0.1.13:
+ version "0.1.13"
+ resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08"
+ integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==
+
regenerate-unicode-properties@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c"