Skip to content

Commit

Permalink
Release/euphoria 20240724 (#3655)
Browse files Browse the repository at this point in the history
* [feat][Erc721] - implement token-tracker overview ,transfers tab, inventory tab (#3377)

- [576] implement NFT Transfer box of Transaction details

* [feat][Erc721] - implement token details page (#3378)

* [feat-fix][Erc721] - fix method name (#3381)

* [feat-fix][Erc721] - fix method name

* [feat-fix][Erc721] - fix filter token for token tranfer tab

* [feat-fix][Erc721] - fix text for write contract tab

* [feat-fix][Erc721] - fix read contract (#3383) (#3384)

* [feat-fix][Erc721] - fix read contract (#3383)

* [feat-fix][Erc721] - fix show error for read/write contract

* [feat][fix][575] fix nft Token Standard (#3385)

* [feat-fix][Erc721] - fix reset error

---------

Co-authored-by: Huynh Van Son <hvson96@gmail.com>

* [feat][Erc721] - implement non fungible tokens list view (#3387)

* [feat-fix][Erc721] - fix show icon contract for tranfers tab, fix contract tab (#3389)

* [feat][557] account detail ERC721 nfts (#3392)

* [feat-fix][Erc721] - fix text (#3393)

* [feat][578] erc721 nft transfers (#3396)

* [feat][580] erc721 token tracker - holder tab (#3397)

* [FeatFix][Erc721] fix contract icon (#3400)

* [featfix][erc721] fix nft filter order (#3402)

* [FeatFix][Erc721] fix holder tab (#3404)

* fix: smartContractList is undefined at first render

* fix: smartContractList is undefined at first render (holder tab)

* [FeatFix][Erc721] fix holders tab (#3409)

* [FeatFix][Erc721] fix search Non-fungible Tokens (#3411)

* [FeatFix][Erc721] fix search nft box (#3413)

* [FeatFix][Erc721] fix bug icon contract (#3415)

* fix: no action when to click metamask (if metamask is not installed)

* [FeatFix][Erc721] fix bug token detail nft tranfer tab (#3420)

* [FeatFix][Erc721] fix write contract (#3422)

* [FeatFix][Erc721] fix write contract

* [FeatFix][Erc721] fix bug link

* [FeatFix][Erc721] fix search by name tag (#3425)

* [FeatFix][Erc721] fix text (#3426)

* [FeatFix][Erc721] fix search private name tag (#3428)

* [FeatFix][Erc721] fix search (#3430)

* [FeatFix][575] fix nft modal (#3433)

* fix: crash app when reading undefined var

* fix: metamask redirect to home automatically although it's installed

* Fix topics for Event Logs - Transaction details page (#3438)

* [Feat][595] implement staking for evm (#3441)

* [FeatFix] fix link to token tracker (#3443)

* [FeatFix] fix show icon contract (#3445)

* [FeatFix] fix search non fungible tokens erc721 (#3448)

* [FeatFix][595]  fix staking for evm , fix icon contract transaction c… (#3451)

* [FeatFix][595]  fix staking for evm , fix icon contract transaction component

* [FeatFix][595]  remove text

* [FeatFix] fix auto refresh transaction for contract detail page (#3454)

* [HotFix] fix search by address erc721 (#3462)

* [HotFix] fix search by address erc721

* [HotFix] fix detect and switch evm chain

* [HotFix] fix detect and switch evm chain

* [HotFix] fix detect and switch evm chain

* fix: highlight function [#613]

* feat: show fee_payer in cosmos transaction detail page

* [Feat][533] Display EVM address both upper case & normal case (#3465)

* [Feat][533] Display EVM address both upper case & normal case

* [Feat][533] remove console log

---------

Co-authored-by: tambui <tam2391@gmail.com>

* [HotFix] fix bug switch evm chain (#3470)

* [FeatFix][615] fix missing icon contract (#3474)

* change inter font to space mono font for input methor, event log in transaction page

* fix: update fee_payer field

* update: fee_payer field

* [FeatFix][582] - validate bool type for read/write contract (#3484)

[FeatFix][611] - fix switch chain

* [Feat][619] Warning for incompatible between cosmos address and evm address (#3482)

* resolved conflict

* resolved conflict 2

* remove trash code

* format code

* update query and logic for warning address

* update nested if else

* resolved conflict

* [Feat][602] add arrow icon (#3485)

* [feat][620] highlight chain support (#3488)

* [Chore] fix check evm token burnt (#3491)

* [Chore] fix query transfer evm token list (#3496)

* [Chore] fix show toast switch chain (#3499)

* Sere/fix/fix method name burn for ntf detail (#3502)

* Revert "[Chore] fix query transfer evm token list (#3496)"

This reverts commit 570ae02.

* [FeatFix] fix method name burn for nft detail

* [featfix][547] fix Display and Search uppercase EVM address (#3505)

* [featfix][622] wallet text align (#3508)

* [FeatFix] - fix bug no data in nft tranfer tab (#3512)

- fix missing token name in Token Tracker column of evm contract list
  - fix column event in nft detail

* [FeatFix] fix orderby queryEvmTransactionList (#3515)

* [FeatFix][573] fix query search non-fungible-tokens list (#3518)

* [feat][610] export csv (#3523)

* [fix][533] fix search evm contract nfts (#3529)

* [Chore] feature flags (#3530)

* [chore] add feature flag for future function (#3509)

* [chore] add feature flag for future function

* remove config, auto gen

* [chore] fix github action (#3520)

* [Chore] fix typo docker file (#3522)

* [Chore] fix typo docker file

* remove space

* [chore] fix feature flags scripts (#3524)

* []featfix][620] fix wallet connect responsive (#3533)

* [fix][533] fix search by token id (#3537)

* [fix][bug-erc721] [11] fix change wallet (#3544)

* [chore][setting] - update editorconfig (#3548)

* [sere][fix][29] - not show arrow icon in account detail page (#3549)

* [fix][17] - Text Owner and address are not align with each other (#3551)

- CW721: Token tracker page_Inventory page

* [Feat][619] Update query cosmos and evm (#3542)

* resolved conflict

* resolved conflict 2

* remove trash code

* format code

* update query and logic for warning address

* update nested if else

* resolved conflict

* update: query cosmos and evm

* update: new query account info

* update: rename variable

* [fix][bug-erc721] [35] fix search address (#3553)

* [feat][598]: show token info (#3535)

* feat: show token info

* update: format-back style code

* update: remove utils func, move convert func to service layer

* remove call api, use current data

* [fix][9] - show disconnect link on write contract page (#3556)

* [fix][9] - show disconnect link on write contract page

* [fix][9] - responsive

* [fix][12] - missing word in holder tab (#3557)

* [fix][36] - show normal text for height block (#3559)

* [fix][28] - responsive value of method (#3561)

* [fix][654] - NFT transfer is missing transaction (#3564)

* [fix][26] - evm transactions responsive (#3565)

* [hotfix][662] add USDC token as default (#3567)

* [hotfix][662] add USDC as default

* move get usdc token to account service

* [hotfix][662] change usdc token type. (#3568)

* [hotfix][662] add USDC as default

* move get usdc token to account service

* fix: usdc token type

* [fix][622]: fix wrong usdc token url. (#3569)

* [hotfix][662] add USDC as default

* move get usdc token to account service

* fix: usdc token type

* fix: wrong usdc token url

* [Feat][655] Enhance event log (#3571)

* feat: Decode event log

* [Feat][655] enhance event log

* Apply decode ui

* update: data decoded

* [Feat][655]  enhance event log - fix index

* [Feat][655]  enhance event log - update

---------

Co-authored-by: tambui <tam2391@gmail.com>

* [fix][622] fix conflict between token-market api and evm-token-detail api (#3574)

* [hotfix][662] add USDC as default

* move get usdc token to account service

* fix: usdc token type

* fix: wrong usdc token url

* fix: conflict between token-market api and evm-token-detail api

* feat: update UI send method transaction (#3573)

* [feat][619] Update new design incompatible address (#3576)

* resolved conflict

* resolved conflict 2

* remove trash code

* format code

* update query and logic for warning address

* update nested if else

* resolved conflict

* update: query cosmos and evm

* update: new query account info

* update: rename variable

* update: new UI for warning address

* [feat] enhance event log (#3581)

* [fix][655] fix event log (#3584)

* feat: Decode event log

* [Feat][655] enhance event log

* Apply decode ui

* update: data decoded

* update: event log

* merged commit

* update: event log

* --amend

---------

Co-authored-by: tambui <tam2391@gmail.com>

* [fix][652] fix send method (#3587)

* feat: update UI send method transaction

* merged from sere

* remove unused code

* [feat][622] update wallet connect UI (#3592)

* [fix][652] check method name (#3588)

* feat: update UI send method transaction

* merged from sere

* remove unused code

* Update: check method name

* [fix][619] evm and cosmos warning, remove redundant character (#3590)

* resolved conflict

* resolved conflict 2

* remove trash code

* format code

* update query and logic for warning address

* update nested if else

* resolved conflict

* update: query cosmos and evm

* update: new query account info

* update: rename variable

* update: new UI for warning address

* fix: evm and cosmos warning

* fix: remove redundant character

* update: logic check address type

* [fix][610] fix export address file name (#3595)

* [fix][610] fix export address file name

* fix filter erc721_activities

* fix: disable decode when transaction is send with memo (#3597)

* feat: update UI send method transaction

* merged from sere

* remove unused code

* Update: check method name

* fix: disable decode when transaction is send with memo

* [Update] USDT information (#3600)

* [hotfix][662] add USDC as default

* move get usdc token to account service

* fix: usdc token type

* fix: wrong usdc token url

* fix: conflict between token-market api and evm-token-detail api

* update: usdt token infomation

* fix: compare big number fungible tokens table (#3602)

* [fix][619] logic check receive token firstly (#3605)

* resolved conflict

* resolved conflict 2

* remove trash code

* format code

* update query and logic for warning address

* update nested if else

* resolved conflict

* update: query cosmos and evm

* update: new query account info

* update: rename variable

* update: new UI for warning address

* fix: evm and cosmos warning

* fix: remove redundant character

* update: logic check address type

* update: logic check receive token firstly

* [update][619] hard code base account (#3608)

* resolved conflict

* resolved conflict 2

* remove trash code

* format code

* update query and logic for warning address

* update nested if else

* resolved conflict

* update: query cosmos and evm

* update: new query account info

* update: rename variable

* update: new UI for warning address

* fix: evm and cosmos warning

* fix: remove redundant character

* update: logic check address type

* update: logic check receive token firstly

* update: hard code base account

* [fix][655]fix event log (#3611)

* feat: Decode event log

* [Feat][655] enhance event log

* Apply decode ui

* update: data decoded

* update: event log

* merged commit

* update: event log

* --amend

* [fix][655] fix event log (#3609)

* [fix][598] fix set token info

* feat: Decode event log

* [Feat][655] enhance event log

* Apply decode ui

* update: data decoded

* remove config.json change

* fix: enhance event log

* merged commit

* update: event log

* --amend

* fix: event log

* fix: event log

---------

Co-authored-by: tambui <tam2391@gmail.com>

---------

Co-authored-by: tambui <tam2391@gmail.com>

* [Fix][589] Fix set token info (#3603) (#3610)

* [fix][598] fix set token info

* fix: token info (10 -> 29)

* fix: default native image

* [update][619] update logic check wallet type (#3614)

* resolved conflict

* resolved conflict 2

* remove trash code

* format code

* update query and logic for warning address

* update nested if else

* resolved conflict

* update: query cosmos and evm

* update: new query account info

* update: rename variable

* update: new UI for warning address

* fix: evm and cosmos warning

* fix: remove redundant character

* update: logic check address type

* update: logic check receive token firstly

* update: hard code base account

* update: undefined wallet type if type or sequence empty

* [update][619] update logic check wallet type (#3613)

* feat: warning for cosmos and evm address is incompatible

* feat: warning for compatible between cosmos address and evm address

* remove trash code

* format code

* update query and logic for warning address

* update nested if else

* update

* resolved conflict

* update: query cosmos and evm

* update: new query account info

* update: rename variable

* update: new UI for warning address

* fix: remove redundant character

* fix: evm and cosmos warning

* update: logic check address type

* update: logic check receive token firstly

* update: hard code base account

* update: undefined wallet type if type or sequence empty

* update logic warning

* [fix][652] convert hex to string memo (#3616)

* feat: update UI send method transaction

* merged from sere

* remove unused code

* Update: check method name

* fix: disable decode when transaction is send with memo

* update: convert hex to string

* [Update][619] convert call data account info from horo to lcd (#3620)

* Update: convert call data account info from horo to lcd

* update function recursion to get value

* update function recursion to get value

* fix: Total Value (#3622)

* fix event log (#3624)

* update: default balance value to prevent NaN (#3626)

* [update][655] responsive for mobile (#3628)

* fix event log

* update responsive for mobile

* [fix] account detail error when address is cosmos contract (#3629)

* [featfix] add feature flag for enhance event log and token info (#3631)

* [update][655] decode tuple in data (#3633)

* fix event log

* update responsive for mobile

* update: decode tuple in data

* [featfix] fix feature flag for enhance event log (#3634)

* [featfix] fix feature flag for enhance event log

* update feature flag

* [update][655] style event log after add ff (#3637)

* fix event log

* update responsive for mobile

* update: decode tuple in data

* fix: style event log

* [update][655] revert font-size, height event log (#3641)

* fix event log

* update responsive for mobile

* update: decode tuple in data

* fix: style event log

* update fontsize event log

* update: revert font-size event log

* [update][597] set token info after ff (#3640)

* [Fix][589] Fix set token info (#3603)

* [fix][598] fix set token info

* fix: token info (10 -> 29)

* fix: default native image

* [fix][598] fix set token info

* update: set token after ff

* [update][598] format space character in html (#3644)

* [fix][598] fix set token info

* [fix][598] fix 15 -> 24

* update format space character in html

* [update][665] change default log to decode mode (#3645)

* fix event log

* update responsive for mobile

* update: decode tuple in data

* fix: style event log

* update fontsize event log

* update: revert font-size event log

* update: change default log to decode mode

* fix: highlight function color (#3580)

* [update][655] style event log after add ff (#3637)

* fix event log

* update responsive for mobile

* update: decode tuple in data

* fix: style event log

* remove highlight function color by regex

* update highlight function

* --amend

* [fix][665] empty data decode (#3647)

* fix event log

* update responsive for mobile

* update: decode tuple in data

* fix: style event log

* update fontsize event log

* update: revert font-size event log

* update: change default log to decode mode

* fix: empty decode data

* [fix][598] token detail not updated (#3650)

* [fix][598] fix set token info

* [fix][598] fix 15 -> 24

* update format space character in html

* fix: set token info

* fix: token detail not updated

* [Feat][695] Update UI method evm page (#3651)

* [update][655] style event log after add ff (#3637)

* fix event log

* update responsive for mobile

* update: decode tuple in data

* fix: style event log

* feat: update method UI

* feat: update method logic check

* [fix][598]: native token image not changed (#3653)

* [fix][598] fix set token info

* [fix][598] fix 15 -> 24

* update format space character in html

* fix: set token info

* fix: token detail not updated

* fix: native token image not changed

---------

Co-authored-by: tamvb2391 <33695595+tamvb2391@users.noreply.github.com>
Co-authored-by: Huynh Van Son <hvson96@gmail.com>
Co-authored-by: tambui <tam2391@gmail.com>
Co-authored-by: Nguyen Duong <duongynguyen0501@gmail.com>
  • Loading branch information
5 people authored Jul 24, 2024
1 parent b376f8b commit 59859ca
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 102 deletions.
2 changes: 1 addition & 1 deletion scripts/feature-flags/euphoria/config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "devTest": false, "enhanceEventLog": true, "setTokenInfo": false }
{ "devTest": false, "enhanceEventLog": true, "setTokenInfo": true }
2 changes: 2 additions & 0 deletions src/app/core/pipes/newline.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export class NewlinePipe implements PipeTransform {
if (!value) return null;
let replacedValue = value;
replacedValue = replacedValue?.replace(/\n/gi, '<br/>');
replacedValue = replacedValue?.replace(/ /gi, '&nbsp;');

return this.sanitizer.bypassSecurityTrustHtml(replacedValue);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="d-flex flex-column px-lg-4 flex-shrink-0 flex-grow-1">
<div class="d-flex flex-column align-items-start flex-shrink-0 flex-grow-1">
<div class="d-flex align-items-center justify-content-center py-4 px-2 py-lg-6 px-xl-6">
<img [appImg]="chainLogo" alt="chain-logo" height="36" />
<img [appImg]="tokenInfo.image" alt="chain-logo" height="36" />
<div class="h1 h2-mob mb-0 ml-4 text--white fw-700 fw-semibold-mob">
{{ nativeName | uppercase }}
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/app/pages/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
NUMBER_6_DIGIT,
PAGE_EVENT,
TIMEOUT_ERROR,
TITLE_LOGO,
} from '../../core/constants/common.constant';
import { Globals, convertDataBlock, convertDataTransactionSimple } from '../../global/global';
import { CHART_CONFIG, DASHBOARD_AREA_SERIES_CHART_OPTIONS, DASHBOARD_CHART_OPTIONS } from './dashboard-chart-options';
Expand Down Expand Up @@ -64,7 +63,6 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy {
coinInfo = this.environmentService.chainInfo.currencies[0];
bannerList = this.environmentService.banner;
coingeckoCoinId = this.environmentService.coingecko.ids[0];
chainLogo = TITLE_LOGO;
nativeName = this.environmentService.environment.nativeName;

chart: IChartApi = null;
Expand Down Expand Up @@ -95,6 +93,7 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy {
priceChangePercentage24h: number;
totalVolume: number;
totalSupply: number;
image: string;
};

originalData = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,17 @@ export class EvmTokenDetailComponent implements OnInit {
address: this.contractAddress,
};

this.tokenService.getEvmTokenDetail(payload).subscribe({
next: (res) => {
const token = res.erc20_contract[0];
if (!token) {
this.loading = false;
this.errTxt = 'No Data';
return;
}

this.tokenService.tokensMarket$
.pipe(
filter((data) => _.isArray(data)),
take(1),
)
.subscribe((item) => {

let tokenMarket = null;
if(token?.address === USDC_ADDRESS) tokenMarket = item.find((element) => element.coinId === USDC_COIN_ID);
else tokenMarket = item.find((element) => element.denom === token?.address);

this.tokenService.getTokenDetail(this.contractAddress).subscribe({
next: (tokenMarket) => {
this.tokenService.getEvmTokenDetail(payload).subscribe({
next: (res) => {
const token = res.erc20_contract[0];
if (!token) {
this.loading = false;
this.errTxt = 'No Data';
return;
}

this.tokenDetail = {
...token,
supplyAmount: token.total_supply,
Expand All @@ -119,20 +110,21 @@ export class EvmTokenDetailComponent implements OnInit {
socialProfiles: this.tokenService?.mappingSocialProfiles(tokenMarket?.socialProfiles)
};
this.getAssetsDetail();
});
},
error: (e) => {
if (e.name === TIMEOUT_ERROR) {
this.errTxt = e.message;
} else {
this.errTxt = e.status + ' ' + e.statusText;
}
this.loading = false;
},
complete: () => {
this.loading = false;
},
});
},
error: (e) => {
if (e.name === TIMEOUT_ERROR) {
this.errTxt = e.message;
} else {
this.errTxt = e.status + ' ' + e.statusText;
}
this.loading = false;
},
complete: () => {
this.loading = false;
},
});
}
})
}

getTokenDetailNFT(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { EnvironmentService } from 'src/app/core/data-services/environment.servi
import { TableTemplate } from 'src/app/core/models/common.model';
import { CommonService } from 'src/app/core/services/common.service';
import { IBCService } from 'src/app/core/services/ibc.service';
import { TokenService } from 'src/app/core/services/token.service';
import { PaginatorComponent } from 'src/app/shared/components/paginator/paginator.component';

@Component({
Expand Down Expand Up @@ -66,6 +67,7 @@ export class TransferAssetsComponent {
private ibcService: IBCService,
private commonService: CommonService,
private route: ActivatedRoute,
private tokenService: TokenService,
) {}

ngOnInit(): void {
Expand All @@ -90,9 +92,9 @@ export class TransferAssetsComponent {
type: 'send_packet',
};
this.ibcService.getTransferAsset(payload).subscribe({
next: (res) => {
next: async (res) => {
if (res.view_ibc_channel_detail_statistic?.length > 0) {
const txs = this.convertTxAssets(res.view_ibc_channel_detail_statistic);
const txs = await this.convertTxAssets(res.view_ibc_channel_detail_statistic);
this.lstSendingRaw = txs;
this.dataIBCSending.data = [...txs];
}
Expand Down Expand Up @@ -148,9 +150,9 @@ export class TransferAssetsComponent {
type: 'recv_packet',
};
this.ibcService.getTransferAsset(payload).subscribe({
next: (res) => {
next: async (res) => {
if (res.view_ibc_channel_detail_statistic?.length > 0) {
const txs = this.convertTxAssets(res.view_ibc_channel_detail_statistic);
const txs = await this.convertTxAssets(res.view_ibc_channel_detail_statistic);
this.lstSendingReceive = txs;
this.dataIBCReceiving.data = [...txs];
}
Expand Down Expand Up @@ -179,23 +181,43 @@ export class TransferAssetsComponent {
}
}

convertTxAssets(data) {
const txs = data?.map((data) => {
let denom = _.get(data, 'denom');
let dataDenom;
if (denom?.includes('/')) {
denom = 'ibc/' + sha256(denom)?.toUpperCase();
dataDenom = this.commonService.mappingNameIBC(denom);
} else {
dataDenom = { decimals: this.coinInfo.coinDecimals, symbol: denom === this.denom ? this.assetName : denom };
}
return {
amount: _.get(data, 'amount'),
denom,
dataDenom,
total_messages: _.get(data, 'total_messages'),
};
getTokenImage(denom: string) {
return new Promise((resolve) => {
this.tokenService.getTokenDetail(denom).subscribe({
next: (res) => {
resolve(res?.image);
},
error: (e) => {
resolve(null);
}
});
});
}

async convertTxAssets(data) {
const txs = await Promise.all(
data?.map(async (data) => {
let denom = _.get(data, 'denom');
let dataDenom;
if (denom?.includes('/')) {
denom = 'ibc/' + sha256(denom)?.toUpperCase();
dataDenom = this.commonService.mappingNameIBC(denom);
} else {
const image = await this.getTokenImage(denom);
dataDenom = {
decimals: this.coinInfo.coinDecimals,
symbol: denom === this.denom ? this.assetName : denom,
image,
};
}
return {
amount: _.get(data, 'amount'),
denom,
dataDenom,
total_messages: _.get(data, 'total_messages'),
};
}),
);
return txs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class TokenContentComponent implements OnInit {
this.tabsBackup = this.TABS;
}
}
this.tabsBackup = this.TABS;
});

if (local.getItem(STORAGE_KEYS.IS_VERIFY_TAB) == 'true') {
Expand Down
85 changes: 43 additions & 42 deletions src/app/pages/token-cosmos/token-detail/token-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,48 +65,49 @@ export class TokenDetailComponent implements OnInit {
getCW20Detail(): void {
let now = new Date();
now.setDate(now.getDate() - 1);
this.tokenService.getTokenDetail(this.contractAddress).subscribe((tokenMarket) => {
this.tokenService
.getCW20Detail(this.contractAddress, this.datePipe.transform(now, DATEFORMAT.DATE_ONLY))
.subscribe({
next: (res) => {
const data = _.get(res, `smart_contract`);
if (data.length > 0) {
const token = data[0];
token.contract_address = token.address;
token.name = tokenMarket?.name || token.cw20_contract.name;
token.symbol = tokenMarket?.symbol || token.cw20_contract.symbol;
token.decimals = token.cw20_contract.decimal;
token.type = this.contractType.CW20;
token.max_total_supply = tokenMarket?.max_supply || 0;
token.price = tokenMarket?.currentPrice || 0;
token.verify_status = tokenMarket?.verifyStatus || '';
token.verify_text = tokenMarket?.verifyText || '';
token.modeToken = EModeToken.CWToken;
token.priceChangePercentage24h = tokenMarket?.priceChangePercentage24h || 0;
token.contract_verification = token.code?.code_id_verifications[0]?.verification_status;
token.supplyAmount = BigNumber(token.cw20_contract?.total_supply).dividedBy(
BigNumber(10).pow(token.decimals),
);
token.officialSite = tokenMarket?.officialSite;
token.overviewInfo = tokenMarket?.overviewInfo;
token.socialProfiles = this.tokenService?.mappingSocialProfiles(tokenMarket?.socialProfiles);

this.tokenDetail = token;
}
},
error: (e) => {
if (e.name === TIMEOUT_ERROR) {
this.errTxt = e.message;
} else {
this.errTxt = e.status + ' ' + e.statusText;
}
this.loading = false;
},
complete: () => {
this.loading = false;
},
});
this.tokenService.getTokenDetail(this.contractAddress).subscribe({
next: (tokenMarket) => {
this.tokenService
.getCW20Detail(this.contractAddress, this.datePipe.transform(now, DATEFORMAT.DATE_ONLY))
.subscribe({
next: (res) => {
const data = _.get(res, `smart_contract`);
if (data.length > 0) {
const token = data[0];
token.contract_address = token.address;
token.name = tokenMarket?.name || token.cw20_contract.name;
token.symbol = tokenMarket?.symbol || token.cw20_contract.symbol;
token.decimals = token.cw20_contract.decimal;
token.type = this.contractType.CW20;
token.max_total_supply = tokenMarket?.max_supply || 0;
token.price = tokenMarket?.currentPrice || 0;
token.verify_status = tokenMarket?.verifyStatus || '';
token.verify_text = tokenMarket?.verifyText || '';
token.modeToken = EModeToken.CWToken;
token.priceChangePercentage24h = tokenMarket?.priceChangePercentage24h || 0;
token.contract_verification = token.code?.code_id_verifications[0]?.verification_status;
token.supplyAmount = BigNumber(token.cw20_contract?.total_supply).dividedBy(
BigNumber(10).pow(token.decimals),
);
token.officialSite = tokenMarket?.officialSite;
token.overviewInfo = tokenMarket?.overviewInfo;
token.socialProfiles = this.tokenService?.mappingSocialProfiles(tokenMarket?.socialProfiles);
this.tokenDetail = token;
}
},
error: (e) => {
if (e.name === TIMEOUT_ERROR) {
this.errTxt = e.message;
} else {
this.errTxt = e.status + ' ' + e.statusText;
}
this.loading = false;
},
complete: () => {
this.loading = false;
},
});
}
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

#contentError.line-claim-v {
-webkit-line-clamp: 3;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class EvmTransactionComponent implements OnChanges {
memo: string;
type: string;
contractAddress?: string;
inputData: { [key: string]: string };
inputData: string;
eventLog: {
id: number;
contractName?: string;
Expand Down

0 comments on commit 59859ca

Please sign in to comment.