Skip to content

Commit

Permalink
Release 1.17.0 rc6 (#1087)
Browse files Browse the repository at this point in the history
* fix swap token switch (#835)

* [Swap chart] Fix X-axis labels css (#836)

* swap chart fix x axis labels css

* remove unused option

* update wallet & add translations (#837)

* [Demeter Farming] dont show APR& TVL if no prices from subquery (#839)

* dont show apr & tvl if no prices from subquery'

* fix roi

* revert env.json

* Optimize swap subscription (#842)

* freeze subscription payload

* update wallet to 1.10.36

* update swap subscriptions (#843)

* update swap subscriptions

* update wallet to 1.10.37

* Fix max btn visibility for remove liquidity & farming (#844)

* fix max btn visibility for remove liquidity & farming

* add MAX_PART

* Use consts in translations (#845)

* use translation consts

* update wallet to 1.10.38

* reimport from localise

* revert change in ReferalProgram

* PW-626: Refactor Languages (#756)

* Refactored Translation.

* Updated translation.

* remove unused vars

* fix sora in translations

* translation fixes

* fix whitespaces

* remove @:appName

* reimport from localise

* add AppName const

* remove unused import

Co-authored-by: alexnatalia <alekseenko@soramitsu.co.jp>
Co-authored-by: Nikita-Polyakov <polyakov@soramitsu.co.jp>

* fix balance check for adding liqudity & messages (#846)

* Update project dependencies (#847)

* add @types/jsdom

* replace file-loader for asset resource

* replace node-sass to sass

* update types packages

* upgrade babel & @typescript-eslint

* try to add logs to webpack

* update ethers

* update vue-template-compiler

* update sass loader

* update node-polyfill

* update dependency tree using yarn-deduplicate

* Fix bridge thischain & fiat when subquery is down (#848)

* Enable USDT for HASHI bridge

* Hide marketing section

* Update lib version with bridge fix

* Update lib

* Fix issues (#850)

* Fix block explorer links

* Fix local config

* Fix issue with infinite loader because of subquery

* Update BridgeTransactionsHistory.vue

* test image updater

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Fix release issues (#851)

* Fix moonpay behavior during log in

* Update translation strings

* Update wallet

* Hide balances fields for not connected accounts

* Update languages

* Fix low XOR value dialog behavior

* Fix type checking issue

* Fix connect account text

* Fix block number on swap with chart & tokens pages

* Update bridge contract

* Remove evm network type from local storage & fix network checks (#854)

* Remove it cuz assets were removed from the whitelist

* update wallet (#856)

* Create Jenkinsfile-DAST

* Update Jenkinsfile-DAST

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* fix available pools farming (#860)

* Fix crowdloan rewards amount (#862)

* fix crowdloan amount

* fix crowdloan total amount

* fix crowdloan amount precision (#863)

* Fix remove xstusd liquidity (#864)

* fix remove xstusd liquidity

* fix apr formatting

* update demeter subscriptions (#866)

* Sora Card (#841)

* draft

* add observer and logic

* prework #2

* prework #3

* up wallet

* refactoring

* remove console.logs

* clear sessionStorage

* Update env.json

* improve btn state & add comments & unload script

* move to separate module (#871)

* move to separate module

* add enabling flag

* Update getters.ts

* remove route

* Update types.ts

* Update Dockerfile

* Update Dockerfile

* Add reserves subscription to addLiquidity (#870)

* add reserves subscription to addLiquidity

* check pool properties subscription

* refactoring liquidities vies

* fix imports

* fix addLiquidity confirm

* fix remove liquidity

* fix liquidity provider message

* fix slider input

* removeLiquidity totalSupply updates

* fix addLiquidity input field reset

* addLiquidity update subscriptions after disconnect

* refactoring token balance subscriptions

* remove unnecessary code from swap

* refactoring liquidity stores

* fix slider

* return env

* update demeter farming

* computed property for optimization

* update staking page

* update wallet to 1.11.5

* return env

* fix getLockedAmount getter

* update prod env.json (#878)

* Fix page document title for the first load (#880)

* Fix page title for the first load

* Refactor router logic

* update wallet

* update wallet & override tokens table css

Co-authored-by: Nikita-Polyakov <polyakov@soramitsu.co.jp>

* Fix confirm buttons loading state (#881)

* fix confirm buttons loading state

* fix tabs

* Remove console logs

* Fix styles

* Fix styles

* Update subquery endpoint

Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* Update ReferralProgram.vue (#884)

* From master to develop (#885)

* fix calculator fields (#888)

* fix calculator fields

* remove rewards crowdloan hardfix

* fix token row css

* Fix bridge loader styles (#886)

* Reduce assets size (#887)

* Reduce png & svg size using minimizer

* Remove not used svg

* Replace svg with icon font for referrer error

* Reduce png size using minimizer

* Remove unused styles for About page

* Explore page (#857)

* add route for explore & tokens pages

* add routes for explore pages & tabs

* refactoring explore container, add search field

* change config to stage, use demeter mixin

* explore-table styles to mixin

* refactoring explore pages

* show user token balances

* table fixes

* add calculator

* add some columns to explore pools page

* refactoring tables

* update titles

* fix loader on demeter faming staking

* refactoring demeter page mixin

* fix ts issues

* update translations

* refactoring explore pages & fix issues

* revert pools & tokens subscriptions

* update default sort tokens page

* fix demeter explore

* add keys for rendering

* refactoring types

* change tabs order & fix en translations

* fixes after review

* Add desktop support (#891)

* Add desktop support

* Add delay to ConfirmInviteUser dialog

* Add desktop settings

* improve connection process (#892)

* Fix css for swap fiat values (#893)

* fix css on swap fiat value

* update wallet 1.12.6

* fix PW-811 node adress check

* pw-913 tokens page prices

* Refactoring pools rendering (#890)

* refactoring pool page

* refactoring mixins

* change v-if to v-show badges

* refactoring apr calc & assetsTable getter

* transfer some computed properties

* refactoring mixins

* prepare data in parent'

* fix staking page

* refactoring usages

* remove unused properties

* update demeter explore calculator

* return env.json

* remove unnecessary code

* chart refactoring & fix demeter farming page list

* fix multiple chart requests after switching tokens

* fix types

* Update for new subquery (#894)

* update charts & tokens

* refactoring normalize function

* update pool apy

* pool apy subscription

* update wallet

* dedup yarn.lock & fix env.json

* update yarn.lock

* fix getPoolApy arg types

* charts button on swap view (#895)

* Swap Chart: Invert tokens (#896)

* update switch token logic, optimize chart rendering

* fix chart algorithm

* improve types & fix chart data calc

* render filter count

* refactoring fetchData

* add chart reverse button & update technic

* update comments

* rename investment to balance (#899)

* use reactive  instead of router (#897)

* fix staking page title (#898)

* add restore history button (#900)

* Fix rewards screen flashing (#901)

* change default gradient & tokens on rewards screen

* refactoring rewards tabs

* update formattedAmount component & add prefix to explore balance (#902)

* Update referral system messages (#903)

* update messages for referral system locally

* update wallet

* Fix candlestick chart empty space (#907)

* fill empty space between last snapshot & current timestamp

* refactoring

* update wallet to 1.12.11

* revert env.json

* Fix referral system delay (#906)

Co-authored-by: Nikita Polyakov <53777036+Nikita-Polyakov@users.noreply.github.com>

* Fix custom token logic (#905)

Co-authored-by: Nikita Polyakov <53777036+Nikita-Polyakov@users.noreply.github.com>

* Add switch to explore (#908)

* add switch to explore

* sync switcher with storage

* Fix fee warning dialog behavior (#910)

* Fix fee warning dialog behavior

* Update deps

* Update yarn.lock

* Fix table overrides

* Fix Demeter explore active positions (#909)

* css fixes & demeter

* update wallet

* Update deps

Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* fix address css (#911)

* Fix asset-asset search in pools on explore page (#913)

* Add tooltips to TVL & ROI (#912)

* add tooltips

* add translations

* up version to 1.13.0

Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* XST tokenomics & remove market maker countdown (#917)

* update views

* update wallet & remove market maker countdown

* update wallet 1.13.1 (#918)

* deploy trigger removal

Signed-off-by: Nikita Zaporozhets <zaporozhets@soramitsu.co.jp>

* Liiquidity proxy 1.6 (#923)

* update wallet with liqudity proxy

* update swap view

* improve btn loading state (#924)

* up wallet version 1.13.4 (#925)

* up wallet version

* update wallet

* up wallet version to 1.13.5 (#926)

* up wallet version

* update wallet to 1.13.5

* fix ts issues

* Feature/x1-widget (#876)

* move to separate module

* add enabling flag

* Update getters.ts

* remove route

* Update types.ts

* x1 widget

* redesign

* refactor & add X1

* Update RoadMap.vue

* improvements in flow & KYC status

* remove logs

* fixes

* take into account different statuses matches

* settings & stub

* fixes & x1 enabling

* add prod settings

* wip

* organize credentials

* change css

* Update env.json

* css refactoring

* Update env.json

* fixes

* roll out prod widget X1

* remove console.log

* refactor & fixes

* handle no record response

* Update SoraCardIntroPage.vue

* Fix/chart precision (#928)

* fix precision while loop

* improve precision calc

* optional fee popup (#919)

* add checks

* up wallet

* use exact version

* Update wallet

* Update localise files

* Update translation files

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* [Remove Liquidity] Show ceres locked liquidity (#922)

* show ceres locked liquidity percent

* change translation of locked

* refactoring rendering

* Update translations

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>
Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* Use settingsStorage from wallet (#929)

* Use settingsStorage from wallet

* Update wallet version

* Hide switch on Explore page for !isLoggedIn

* Update lokalise

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix search focus behavior (#932)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Add fearless (#934)

* Update package.json

* Update yarn.lock

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix fearless integration (#936)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix Fearless wallet (#937)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix Fearless link for Mozilla (#938)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* update wallet to TBCD (#940)

* Update wallet (#943)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Upgrade PW SDK  (#930)

* add phone input

* Update Phone.vue

* implement logic

* Update ConfirmationInfo.vue

* add disclaimer for X1

* Update ToSDialog.vue

* fixes

* update wallet 1.15.0 (#945)

* fixes (#946)

* fixes

* typo

* Fix styles issues related to card (#948)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* [Explore Page] Hide tokens & pools with zero tvl (#941)

* change tokens page data handling

* update explore pools

* remove console

* tokens min liquidity 1

---------

Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* improve routing (#947)

* Add loading state for router

* Add setLoading mutation for router

* Add comment

* Modify goto logic of router

* Add links

* Add page loader

* Improve goTo with additional checks pages by default

* Update vue router

* Update generateLocaleJson.ts

* Fix page loading

* Use goTo for separate moonpay page

* Update comment

* Add Sonar

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>
Co-authored-by: Nikita Polyakov <53777036+Nikita-Polyakov@users.noreply.github.com>

* fix (#949)

* Fix lokalise and SORA Card issues (#950)

* Remove sora, evm, pageNotFound

* Add polkadot apps link to bridge txs

* Update lokalise keys

* Improve images

* Improve card routing

* Update ConfirmationInfo.vue

* Fix texts

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix phone and styles for card (#951)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix sora card phone and route (#952)

* Fix phone inputs (#953)

* Fix phone inputs

* Update Email.vue

* add const

* Update Phone.vue

* Update Phone.vue

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>
Co-authored-by: RustemYuzlibaev <rustem.yuzlibaev@yandex.ru>

* Fix email, first, last name length (#954)

* Fix email, first, last name length

* Add loader for euro calculations

* Update SoraCardIntroPage.vue

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* git (#955)

* test push

* refactor

* tmp disable sonar

* fix cred name

* update wallet to 1.15.2 (#957)

* update wallet to 1.15.2

* fix issues after wallet update

* update wallet to 1.15.3

* change value

* fix json error (#958)

* fix path

* fix path

* switch to tachi

* test

* revert lib

* test values check

* fix lib

* DAST pipeline update

* Update Jenkinsfile-dast

* revert lib

* fix (#961)

* Fix connection disconnected event (#960)

* fix disconnected event

* update wallet to 1.15.4

* update translations

---------

Co-authored-by: Rustem <rustem.yuzlibaev@yandex.ru>

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Update Jenkinsfile-dast

* Otp resend try fix (#964)

* add event

* fix OTP resend issue

* wipe email before start

* low limit

* SORA Card translation (#959)

* prework

* add lang keys

* update translations

* todo rejection translation

* update translations

* update translations

* Update Jenkinsfile-dast

* Free KYC attempts counter (#962)

* prework

* add lang keys

* prework

* update translations

* todo rejection translation

* add flow with new KYC attempt

* improve price request

* fix

* Revert "fix"

This reverts commit 18af1f3.

* show pending status when finished KYC

* remove price calculation stub

* update translations

* merge translation PR

* show reject reasons

* email fix resend (#967)

* Update Email.vue

* add missing words

* Hide LP fee (#968)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix liqudity proxy route and args (#969)

* update liquidity-proxy calls

* update wallet 1.15.7

* multiple otp send fix (#970)

* fix

* cancel changes

* fixes

* update wallet 1.15.9 (#973)

* update wallet to 1.15.10 (#974)

* Status bar & SORA Card fixes (#882)

* Draft

* Add subquery & node connection checks

* Add node location

* Fix imports for App component

* Add no internet dialog

* Fix location in node model

* Add footer popper

* Draft

* Fix margin

* Remove node selection from header

* Move all common logic to footer popper

* Add interaction with tab

* Fix outline

* Update SwapTransactionDetails.vue

* Use Notification mixin

* Fix colors

* Fix colors

* 2nd Draft

* Replace node selection dialog

* Remove unused deps

* Move SelectNodeDialog

* Fix styles for slippage tolerance

* Add new const

* Update SlippageTolerance.vue

* Refactor AppFooter & NoInternetDialog

* Update statistics dialog

* Finilize colors for Statistics statuses

* Update library

* Update yarn.lock

* Update StatisticsDialog.vue

* Add scss/css variables

* Update en.json

* Update translations

* Update en.json

* Update translations

* Fix displayRegions

* Fix styles in StatisticsDialog

* Keep selected node details up to date

* Add TODO

* Fix imports

* Fix SORA Card issues

* Translate blacklisted countries

* Fix SORA Card translations

* Handle case when `navigator.connection` isn't supported

* Update StatisticsDialog.vue

* Update App.vue

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Update Jenkinsfile

* Reduce bundle size (#942)

* Reduce bundle size

* Update vue.config.js

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Feature/network stats (#931)

* refactoring styles

* refactoring letter-spacing

* network-stats-row

* improve network stats adaptive

* refactoring columns data

* change group data logic

* tvl chart wip

* add ChartSkeleton component

* handle chart error & update tooltip

* add volume chart example

* refactoring specs

* refactoring components folder structure

* wip refactoring folders structure

* refactoring components folders

* wip fees chart

* fix charts fetching

* data fetching for supply chart

* add token-dropdown to supply chart

* skeleton fixes

* fixes

* fix error

* refactoring

* fix imports

* update network stats components

* refactoring charts data fetching

* update translations

* test

* revert lib

* refactoring imports

* refactoring MarketAlgorithm paths

* fix weekly stats, legend, x axis overlap

* SimpleNotification from wallet

* update according qa

* update translations

* network stats chart fixes

* supply bar chart

* update supply color, explore method

---------

Co-authored-by: Stefan Popov <stefanpopov@list.ru>
Co-authored-by: Pavel Varfolomeev <wpi86@yandex.ru>

* Update Jenkinsfile-dast

* Move disclaimer to front page (#965)

* Update SoraCardIntroPage.vue

* add to front page & fix translations

* add flow with not found number

* add missing translations

* remove debug actions

* remove unused css

* Fix/bridge select asset (#976)

* fix bridge select asset

* fix bridge history request

* fix transaction-details arrow

* upfate wallet 1.15.11 (#977)

* move disclaimer (#914)

* Update AppHeaderMenu.vue

* add popover

* store value

* remove old disclaimer

* add translation keys

* fix type

* use css variables

* add defined box-shadow

* update translation

* force user to make decision

* Update storage.ts

* show disclaimer if no approve

* set disclaimer

* fix

* wait until loading

* add translations

* fix margins

* fix width

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* fix (#980)

* Fix max limit speed for internet connection (#975)

* Fix max limit speed for internet connection

* Fix issues

* Fix tab issues

* Fix issue with negative left values

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Add Token Velocity column to Tokens Page (#979)

* add velocity columns

* add en translation

* update translations

* fix css

* remove symbol column from tokens page

---------

Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* remove keys (#981)

Co-authored-by: Stefan Popov <stefanpopov@list.ru>
Co-authored-by: Nikita Polyakov <53777036+Nikita-Polyakov@users.noreply.github.com>

* Demeter dialogs bottom padding adding (#982)

Co-authored-by: Rustem <rustem.yuzlibaev@yandex.ru>
Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* update wallet 1.15.12 (#983)

* Add routing for pairs (#971)

* Add routing for pairs

* Fix

* Update index.ts

* Finilise routing flow

* Update SelectedTokensRouteMixin.ts

* Update SubscriptionsMixin.ts

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix release issues (#984)

* Fix action button styles in status bar

* Fix z-index

* Fix outline styles

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Move disclaimer to App Header (#986)

* Move disclaimer to App Header

* Update AppHeaderMenu.vue

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Move disclaimer to App Header (#986)

* Move disclaimer to App Header

* Update AppHeaderMenu.vue

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* fix swap container and chart align (#987)

* fix supply chart axis label (#989)

* Fix release issues (#990)

* Fix SWAP route issue

* Fix outline styles

* Add online/offline consts

* Remove translation keys for online/offline

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Update Jenkinsfile to use PR-generator SecretStore bot secret

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* Fix flag (#992)

* Fix flag

* Update AppFooter.vue

* Update countryFlagEmoji.ts

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix styles (#994)

* Update card.ts (#997)

* add formula to velocity tooltip (#996)

Co-authored-by: Rustem <rustem.yuzlibaev@yandex.ru>

* apply suggestions

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* Reuse subscriptions in SubscriptionsMixin (#998)

* reuse subscriptions in SUbscriptionsMixin

* change variable name

* update router config (#999)

* Improve sora card styles (#1000)

* Improve sora card styles

* Remove logs

* Update Widget.vue

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix seo logo (#1001)

* fix camera translation (#1002)

* fix (#1003)

* fix subscription hooks (#1004)

* add DialogTitle component (#1005)

Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* Add nodes location for prod (#1006)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* change text from accounts to new accounts (#1010)

* try fix

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* try fix

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* try fix

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* try fix

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* try fix

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* update polkadot deps and fix account length (#1014)

* Update polkadot js deps

* Fix wallet

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Explore page improvements (#1012)

* change pagination of explore page

* simplify query & change velocity calc

* freeze components external data

* remove unused code

* refactoring demeter pages

* up version

* refactoring token approve (#1008)

Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* update wallet to 1.16.2 (#1017)

* Refactoring getters (#1018)

* move some getters to components

* refactoring select-token component

* remove getter

* Update crowdloans (#1022)

* update crowdloan rewards

* update wallet

* css fixes

* change request

* update private modifiers

* use rw bot

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

---------

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>
Co-authored-by: BAStos525 <jungle.vas@yandex.ru>

* up wallet (#1024)

* update wallet for crowdloans fixes (#1025)

* update crowdloans in actions

* ypdate yarn.lock

* fix type

* Update xst swaps (#1027)

* update swap view

* update wallet init

* update genesis hash check (#1028)

* Update env.json (#1029)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Update env.json (#1030)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Google wallet (#978)

* wip integration

* remove isDesktop flag

* add en translation keys

* update dialogs paddings

* update wallet 1.16.0-beta.2

* experiment with secretScannerExclusion

* secretScannerExclusion regex experiment

* add empty keys to prod env.json

* fix bridge tx signing

* update wallet 1.16.0-beta.4

* small css fixes

* update wallet to 1.16.0-beta.5

* update wallet

* update translations

* update wallet

* filter zero tvl snapshots (#1033)

* remove unused contracts (#1034)

* fix Jenkinsfile PR-generator part

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* add downstreamJob (#1042)

* Add fearless (#1038)

* Add fearless for SORA card

* Fix route params

* Update SoraCard.vue

* Add message

* Update KycView.vue
---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* price alerts (#1013)

* prework

* use wallet store

* add translations

* add translation & update wallet & fix

* Update en.json

* fix double dialog overlay

* add delta percent calculation

* adjust

* use rw bot for PR-generation

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* fix PR-generation var

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* add typings

* update PR-generation vars

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>

* write logic for display of low cost assets

* switch to false when not granted

* annotate params

* take into account abnormal setup

* up wallet

* add translations

* add translations from localise

* fix wiped translations

* fixes

* fixes

* format

---------

Signed-off-by: BAStos525 <jungle.vas@yandex.ru>
Co-authored-by: BAStos525 <jungle.vas@yandex.ru>

* Trustless EVM Bridge support (#792)

* refactoring utils bridge folder structure & exports

* update wallet integration

* import EthBridgeStates from wallet

* add eth hashi bridge translations

* transfer updateEthBridgeHistory function to settings

* wip web3 refactoring

* wip update registered assets

* change network in metamask

* wip network select & change

* select network dialog refactoring

* evmAddress evmNetwork in storage

* update bridge confirm dialog

* wip update bridge view

* prepare history item creation

* wip BridgeTransaction view

* wip Bridge class

* wip evm bridge transaction handler

* wip outgoing reducer

* subscribe on tx details

* update BridgeHistory view

* add evm hash container

* update TransferNotification

* update network selection

* update select network dialog for history usage

* add select network to bridge history

* show history from network

* update transfer flow

* update history sync logic

* refactoring sync

* wip bug fixes

* refactoring state

* improve removing local history

* update Moonpay integration

* mock incoming reducer

* change selected evm network on moonpay history

* fix async process

* refactoring BridgeContainer

* add some chains to list

* refactoring chain names

* fix hashi bridge history restoration

* update network changing for hashi bridge restoration

* resolve SelectToken conflicts

* remove merge conflicts

* fix merge conflicts

* add sepolia to config

* update with library imports

* remove merge conflicts

* fix messages file

* fix merge conflicts

* fix components names

* wip select network

* resolve ts issues

* return eth bridge settings

* update registered assets for network types

* update history params

* refactoring bridge classes

* refactoring bridge interfaces

* return eth bridge sign actions

* fix select asset mixin

* wip update bridge history

* update history actions

* start up bridge transaction

* update bridge getters

* fix network switch

* update history states

* refactoring bridge types

* refactoring eth reducers

* return approve from dev

* return blocks left message

* refactoring translations

* update external history

* update select network dialog & icons

* history refactoring

* networks disabled state

* improve bridge transaction view

* change eth bridge storage key

* update wallet, remove unused translations

* refactoring bridge types

* update translations from localise

* update translations

* remove some todo

* refactoring eth history class

* dont restore evm address

* reduce method complexity

* reduce complexity

* fetch balances right after account connec

* remove unnecessary code from bridge reducers

* fix bug when restored transaction overrides in process

* fix history restoration

* revert transactions fetching logic

* refactoring tx date

* update prod config

* refactoring getRegisteredAssets

* improve getRegisteredAssets update

* fix bug with lost balance

* remove console.log

* refactoring block production time usage

* update wallet

* refactoring network icon

* fixes after review

* remove unused method

* fix network change detection

* improve evm network switch

* refactoring smart contracts usage

* remove unused imports

* fix allowance check

* fix approve btn message

* refactoring getRegisteredAssets

* update external balances

* update translations (#1047)

* remove tilda sign  (#1045)

* Update AppDisclaimer.vue

* add translations

* add missing

* fix pw sdk & add countries (#1044)

* fix pw sdk & add countries

* extend interval

* remove camera access when applied

* add more countries

* add css var

* switch branche of jenkins library

* switch to master branch for jenkins library

* handle X1 unavailability

* Update X1Dialog.vue

* cancel remove camera access

* refactor

* remove unused package

---------

Co-authored-by: Aleksey Kazakov <kazakov@soramitsu.co.jp>
Co-authored-by: Stefan Popov <stefanpopov@list.ru>

* Create hideFromSearchEngine.sh (#1046)

* Create hideFromSearchEngine.sh

* Update hideFromSearchEngine.sh

* add noindex

* revert lib

* delete script

---------

Co-authored-by: Pavel Varfolomeev <wpi86@yandex.ru>

* Improve ext connection and linting (#1053)

* Improve extensions connection

* Improve linting

* Update deps

* Update yarn.lock

* Improve config

* Exec lint

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* fix trailing char (#1056)

* Fix synths (#1057)

* Substrate bridge outgoing (#1059)

* update imports

* add substrate networks to select

* fix available sub networks

* wip list assets

* update bridge view

* add sub reducer

* update bridge transaction view

* update external history

* fix history reset

* add bridge select account dialog

* refactoring bridge select account

* update SelectAccount ui

* wip select account directions

* update bridge change direction

* update env.json

* update sub reducer

* update sub history

* update translations & wallet

* use lint config from dev

* set outgoung direction for sub bridge

* Fix/disclaimer btn show (#1058)

* fix trailing char

* Update AppDisclaimer.vue

* Update AppDisclaimer.vue

* make button out of scroll area

* adjust timeouts

* add error case

* remove duplicates

* remove class

* Fix Sub bridge issues (#1060)

* reset form on network change

* fix network name in ui

* update KAR address

* update wallet

* add text for scroll (#1064)

* Fix bridge network update from metamask (#1065)

* fix bridge network change detection

* fix polkadot.js link

* Add fee multiplier support (#1066)

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* change welcome text (#1069)

* Fix/substrate outgoing network select (#1076)

* reset form on network change

* fix network name in ui

* update KAR address

* wip rococo adapter

* fix yarn.lock

* update assets on network change

* update balance method for sub

* fix adapter connection wait

* refactoring action name

* refactoring block number usage

* update external balance for selected asset

* network update fixes

* native balance update

* separate prod and stage

* fix var

* add pre branch

* fix var

* revert lib

* Update actions.ts (#1078)

* Substrate bridge incoming transaction tracking (#1081)

* reset form on network change

* fix network name in ui

* update KAR address

* wip rococo adapter

* fix yarn.lock

* update assets on network change

* update balance method for sub

* fix adapter connection wait

* refactoring action name

* refactoring block number usage

* update external balance for selected asset

* network update fixes

* native balance update

* update external data after sora block update

* update selectedNetwork data

* show sender & recepient balance

* fix balance update

* update env.json

* update adapters endpoints

* add messageHash from collator as externalHash temporary

* wait for rococo message

* add external links

* fix adapter endpoint reset issue

* refactoring sonar related issues

* incoming transaction signing

* incoming transaction tracking demo

* remove unused update balances

* fix history remove

* fix BridgeTransaction asset balance & refactoring

* sub history update

* disconnect after bridge leave

* refactoring disconnect

* update wallet

* revert env.json

* remove console.log9

* fix (#1082)

* fix

* Update AlertList.vue

* fix ru

* Fix sub assets fetching & hashi bridge issues (#1083)

* fix hashi bridge

* fetch sub bridgeassets

* update wallet

* fix external account check

* remove unnecessary codeline

* remove console.log

* Update KycView.vue (#1084)

* Fix bridge account link (#1085)

* fix bridge account link

* wait for external balances fetching

* refactoring bridge fees & balances fetching

* fix sonar issues

* fix sub tx trancking

* fix transaction link style

* Fix xst & sorting on explore page (#1075)

* Update Wallet.vue

* Fix regexp

* Refactor tokens page

* Add default sorting for tokens page

* Update Tokens.vue

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

* Fix issues 1.17 (#1086)

* Hide 'show only synths'

* Update CERES endpoint for status bar

---------

Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>

---------

Signed-off-by: Nikita Zaporozhets <zaporozhets@soramitsu.co.jp>
Signed-off-by: BAStos525 <jungle.vas@yandex.ru>
Co-authored-by: Nikita Polyakov <53777036+Nikita-Polyakov@users.noreply.github.com>
Co-authored-by: Alex Natalia <38787212+alexnatalia@users.noreply.github.com>
Co-authored-by: alexnatalia <alekseenko@soramitsu.co.jp>
Co-authored-by: Nikita-Polyakov <polyakov@soramitsu.co.jp>
Co-authored-by: Pavel Varfolomeev <wpi86@yandex.ru>
Co-authored-by: frodan <daniil.fronc@mail.ru>
Co-authored-by: wpi86 <86880521+wpi86@users.noreply.github.com>
Co-authored-by: Rustem <rustem.yuzlibaev@yandex.ru>
Co-authored-by: German Vechtomov <89127595+ox7a59@users.noreply.github.com>
Co-authored-by: Nikita Zaporozhets <zaporozhets@soramitsu.co.jp>
Co-authored-by: Nikita Zaporozhets <95526886+f33r0@users.noreply.github.com>
Co-authored-by: Stefan Popov <17688105+stefashkaa@users.noreply.github.com>
Co-authored-by: Daniil Fronts <Frodan@users.noreply.github.com>
Co-authored-by: Viacheslav <shlavik@gmail.com>
Co-authored-by: BAStos525 <jungle.vas@yandex.ru>
Co-authored-by: BAStos525 <66615487+BAStos525@users.noreply.github.com>
Co-authored-by: Aleksey Kazakov <kazakov@soramitsu.co.jp>
  • Loading branch information
18 people authored Jul 4, 2023
1 parent 4405a7f commit 2ef5d4a
Show file tree
Hide file tree
Showing 71 changed files with 1,308 additions and 969 deletions.
12 changes: 6 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ def pipeline = new org.js.AppPipeline(steps: this,
sonarProjectName: 'polkaswap-exchange-web',
sonarProjectKey: 'jp.co.soramitsu:polkaswap-exchange-web',
secretScannerExclusion: 'Jenkinsfile-UCAN|.*env.json',
copyStaticToBranch: true,
copyToBranches: ['fleek-pre', 'fleek'],
copyFile: 'env.json',
ipfsHashNotification: true,
fleekDefaultSiteName: 'long-firefly-8047',
ipfsHashChatID: '-1001375555544',
fleekDeployProd: true,
fleekBranchesProd: ['fleek', 'fleek-pre'],
copyFileProd: 'env.json',
fleekDefaultSiteNameProd: 'long-firefly-8047',
ipfsHashNotificationProd: true,
ipfsHashChatIDProd: '-1001375555544',
k8sPrDeploy: true,
vaultPrPath: "argocd-cc/src/charts/sora2/polkaswap-exchange-web/environments/tachi/",
vaultUser: "polkaswap-rw",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@soramitsu/soraneo-wallet-web": "1.17.15",
"@soramitsu/soraneo-wallet-web": "1.17.17",
"@walletconnect/web3-provider": "^1.8.0",
"base-64": "^1.0.0",
"core-js": "^3.26.0",
Expand Down
19 changes: 3 additions & 16 deletions public/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,9 @@
"CHAIN_GENESIS_HASH": "",
"EVM_NETWORKS_IDS": [97, 1001],
"SUB_NETWORKS": {
"Rococo": {
"addresses": [
"wss://ws.relaychain-node-1.r1.dev.sora2.soramitsu.co.jp",
"wss://ws.relaychain-node-2.r1.dev.sora2.soramitsu.co.jp"
]
},
"Karura": {
"addresses": [
"wss://ws.karura-node-1.c2.dev.sora2.soramitsu.co.jp",
"wss://ws.karura-node-2.c2.dev.sora2.soramitsu.co.jp"
]
}
},
"PARACHAIN_IDS": {
"Karura": 2000,
"Mainnet": 2011
"Rococo": "wss://ws.relaychain-node-1.r1.dev.sora2.soramitsu.co.jp",
"RococoKarura": "wss://ws.karura-node-1.c2.dev.sora2.soramitsu.co.jp",
"RococoSora": "wss://ws.parachain-collator-1.c1.dev.sora2.soramitsu.co.jp"
},
"ETH_BRIDGE": {
"evmNetwork": 11155111,
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin)
@mutation.settings.resetBlockNumberSubscription private resetBlockNumberSubscription!: FnWithoutArgs;
@mutation.referrals.unsubscribeFromInvitedUsers private unsubscribeFromInvitedUsers!: FnWithoutArgs;
@mutation.web3.setEvmNetworksApp private setEvmNetworksApp!: (data: EvmNetwork[]) => void;
@mutation.web3.setSubNetworkApps private setSubNetworkApps!: (data: SubNetworkApps) => void;
@mutation.web3.setEthBridgeSettings private setEthBridgeSettings!: (settings: EthBridgeSettings) => Promise<void>;
@mutation.referrals.resetStorageReferrer private resetStorageReferrer!: FnWithoutArgs;
@action.web3.setSubNetworkApps private setSubNetworkApps!: (data: SubNetworkApps) => void;
@action.wallet.settings.setApiKeys private setApiKeys!: (apiKeys: WALLET_TYPES.ApiKeysObject) => Promise<void>;
@action.wallet.subscriptions.resetNetworkSubscriptions private resetNetworkSubscriptions!: AsyncFnWithoutArgs;
@action.wallet.subscriptions.resetInternalSubscriptions private resetInternalSubscriptions!: AsyncFnWithoutArgs;
Expand Down
2 changes: 1 addition & 1 deletion src/components/App/Alerts/AlertList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div v-if="alerts.length" class="line" />
</div>
<div v-if="showCreateAlertBtn" class="settings-alert-section">
<s-button class="el-dialog__close" type="action" icon="plus-16" @click="handleCreateAlert" />
<s-button class="el-dialog__close" type="action" icon="plus-16" @click="handleCreateAlert" :disabled="loading" />
<span class="create">{{ t('alerts.createBtn') }}</span>
</div>
<div class="settings-alert-section">
Expand Down
2 changes: 1 addition & 1 deletion src/components/App/Footer/StatisticsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class StatisticsDialog extends Mixins(mixins.DialogMixin, Transla
{
key: 'fiatCeres',
name: 'Ceres',
endpoint: 'https://cerestoken.io/api/prices',
endpoint: 'https://data.cerestoken.io/api/prices',
online: true,
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/SoraCard/steps/KycView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class KycView extends Mixins(TranslationMixin, mixins.Notificatio
const referenceNumber = await this.getReferenceNumber(soraProxy.referenceNumberEndpoint);
await ScriptLoader.unload(kycService.sdkURL, false);
await ScriptLoader.unload(kycService.sdkURL, false).catch(() => {});
ScriptLoader.load(kycService.sdkURL)
.then(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/mixins/BridgeMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class BridgeMixin extends Mixins(mixins.LoadingMixin, WalletConne

@getter.web3.isValidNetwork isValidNetwork!: boolean;
@getter.bridge.sender sender!: string;
@getter.bridge.recepient recepient!: string;
@getter.bridge.recipient recipient!: string;
@getter.bridge.soraNetworkFee soraNetworkFee!: CodecString;
@getter.bridge.evmNetworkFee evmNetworkFee!: CodecString;
@getter.assets.xor xor!: RegisteredAccountAsset;
Expand Down
2 changes: 1 addition & 1 deletion src/components/mixins/ExplorePageMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class ExplorePageMixin extends Mixins(
this.changeSort();
}

updateExploreData(): void {
async updateExploreData(): Promise<void> {
console.warn('[ExplorePageMixin]: "updateExploreData" method is not implemented');
}

Expand Down
56 changes: 43 additions & 13 deletions src/components/mixins/NetworkFormatterMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Component, Mixins } from 'vue-property-decorator';
import { EvmLinkType, EVM_NETWORKS } from '@/consts/evm';
import { SUB_NETWORKS } from '@/consts/sub';
import { state, getter } from '@/store/decorators';
import type { AvailableNetwork } from '@/store/web3/types';
import type { NetworkData } from '@/types/bridge';

import TranslationMixin from './TranslationMixin';
Expand All @@ -17,6 +18,10 @@ import type { BridgeNetworkId } from '@sora-substrate/util/build/bridgeProxy/typ
export default class NetworkFormatterMixin extends Mixins(TranslationMixin) {
@state.wallet.settings.soraNetwork soraNetwork!: Nullable<WALLET_CONSTS.SoraNetwork>;
@getter.web3.selectedNetwork selectedNetwork!: Nullable<NetworkData>;
@getter.web3.availableNetworks availableNetworks!: Record<
BridgeNetworkType,
Partial<Record<BridgeNetworkId, AvailableNetwork>>
>;

readonly EvmLinkType = EvmLinkType;

Expand Down Expand Up @@ -72,33 +77,58 @@ export default class NetworkFormatterMixin extends Mixins(TranslationMixin) {
return 'kusama';
case SubNetwork.Rococo:
return 'rococo';
case SubNetwork.Karura:
case SubNetwork.RococoKarura:
return 'karura';
default:
return 'ethereum';
}
}

// TODO [EVM] check network explorers links
getEvmExplorerLink(hash: string, type: EvmLinkType, networkId: BridgeNetworkId): string {
if (!hash) return '';
getNetworkExplorerLinks(
networkType: BridgeNetworkType,
networkId: BridgeNetworkId,
value: string,
blockHash = '',
type = EvmLinkType.Transaction
) {
if (!value) return [];

const network = EVM_NETWORKS[networkId];
const networkData = this.availableNetworks[networkType][networkId]?.data;

if (!network) {
console.error(`Network id "${networkId}" is not defined in "EVM_NETWORKS"`);
return '';
if (!networkData) {
console.error(`Network data for "${networkId}" is not defined"`);
return [];
}

const explorerUrl = network.blockExplorerUrls[0];
const explorerUrl = networkData.blockExplorerUrls[0];

if (!explorerUrl) {
console.error(`"blockExplorerUrls" is not provided for EVM network id "${networkId}"`);
return '';
console.error(`"blockExplorerUrls" is not provided for network id "${networkId}"`);
return [];
}

const path = type === EvmLinkType.Transaction ? 'tx' : 'address';
if (networkType === BridgeNetworkType.Sub) {
if (type === EvmLinkType.Account) return [];

return `${explorerUrl}/${path}/${hash}`;
if (!blockHash) return [];

const baseLink = `https://polkadot.js.org/apps/?rpc=${explorerUrl}#/explorer/query`;

return [
{
type: WALLET_CONSTS.ExplorerType.Polkadot,
value: `${baseLink}/${blockHash}`,
},
];
} else {
const path = type === EvmLinkType.Transaction ? 'tx' : 'address';

return [
{
type: this.TranslationConsts.Etherscan as WALLET_CONSTS.ExplorerType,
value: `${explorerUrl}/${path}/${value}`,
},
];
}
}
}
3 changes: 0 additions & 3 deletions src/components/mixins/SelectedTokensRouteMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ export default class SelectedTokenRouteMixin extends Vue {
if (!(bothArePresented && api.dex.baseAssetsIds.includes(firstAddress))) {
return false;
}
if (firstAddress === XOR.address && secondAddress === XSTUSD.address) {
return false; // XOR-XSTUSD isn't allowed
}
if (firstAddress === XSTUSD.address && [XOR.address, XST.address].includes(secondAddress)) {
return false; // XSTUSD-XOR & XSTUSD-XST aren't allowed
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/mixins/WalletConnectMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ export default class WalletConnectMixin extends Mixins(TranslationMixin) {

// update selected evm network without metamask request
@mutation.web3.setSelectedNetwork setSelectedNetwork!: (networkId: BridgeNetworkId) => void;
@mutation.web3.resetProvidedEvmNetwork resetProvidedEvmNetwork!: FnWithoutArgs;
@mutation.web3.resetEvmAddress resetEvmAddress!: FnWithoutArgs;
@mutation.web3.setEvmAddress setEvmAddress!: (address: string) => void;
@mutation.web3.resetProvidedEvmNetwork resetProvidedEvmNetwork!: FnWithoutArgs;
@mutation.web3.setSelectAccountDialogVisibility private setSelectAccountDialogVisibility!: (flag: boolean) => void;

@action.web3.connectEvmAccount private connectEvmAccount!: (provider: Provider) => Promise<void>;
@action.web3.updateNetworkProvided updateNetworkProvided!: AsyncFnWithoutArgs;
@action.web3.connectExternalNetwork connectExternalNetwork!: (networkHex?: string) => Promise<void>;
@action.web3.disconnectExternalNetwork disconnectExternalNetwork!: AsyncFnWithoutArgs;
@action.web3.selectExternalNetwork selectExternalNetwork!: (networkId: BridgeNetworkId) => Promise<void>;

getWalletAddress = getWalletAddress;
Expand Down
75 changes: 75 additions & 0 deletions src/components/pages/Bridge/LinksDropdown.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<template>
<s-dropdown
class="s-dropdown--hash-menu"
borderRadius="mini"
type="ellipsis"
icon="basic-more-vertical-24"
placement="bottom-end"
>
<template slot="menu">
<a
v-for="link in links"
:key="link.type"
:href="link.value"
class="transaction-link"
target="_blank"
rel="nofollow noopener"
>
<s-dropdown-item class="s-dropdown-menu__item">
{{ t('transaction.viewIn', { explorer: link.type }) }}
</s-dropdown-item>
</a>
</template>
</s-dropdown>
</template>

<script lang="ts">
import { WALLET_CONSTS } from '@soramitsu/soraneo-wallet-web';
import { Component, Mixins, Prop } from 'vue-property-decorator';
import TranslationMixin from '@/components/mixins/TranslationMixin';
@Component
export default class BridgeLinksDropdown extends Mixins(TranslationMixin) {
@Prop({ default: () => [], type: Array }) readonly links!: Array<WALLET_CONSTS.ExplorerLink>;
}
</script>

<style lang="scss">
.s-dropdown--hash-menu {
position: absolute;
z-index: $app-content-layer;
top: 0;
bottom: 0;
margin-top: auto;
margin-bottom: auto;
padding: 0;
width: var(--s-size-mini);
height: var(--s-size-mini);
line-height: 1;
display: block;
text-align: center;
font-size: var(--s-size-mini);
right: $inner-spacing-medium;
&,
.el-tooltip {
&:focus {
outline: auto;
}
}
// TODO: fix UI library
.s-dropdown-menu__item {
border-radius: calc(var(--s-border-radius-mini) / 2);
}
}
</style>

<style lang="scss" scoped>
.transaction-link {
color: inherit;
text-decoration: none;
}
</style>
11 changes: 4 additions & 7 deletions src/components/pages/Bridge/SelectNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Component, Mixins } from 'vue-property-decorator';
import NetworkFormatterMixin from '@/components/mixins/NetworkFormatterMixin';
import { action, getter, mutation, state } from '@/store/decorators';
import type { NetworkData } from '@/types/bridge';
import type { AvailableNetwork } from '@/store/web3/types';
import type { BridgeNetworkId } from '@sora-substrate/util/build/bridgeProxy/types';
Expand All @@ -47,11 +47,6 @@ export default class BridgeSelectNetwork extends Mixins(NetworkFormatterMixin) {
@state.web3.networkSelected private networkSelected!: Nullable<BridgeNetworkId>;
@state.web3.selectNetworkDialogVisibility private selectNetworkDialogVisibility!: boolean;
@getter.web3.availableNetworks availableNetworks!: Record<
BridgeNetworkType,
{ disabled: boolean; data: NetworkData }[]
>;
@mutation.web3.setNetworkType private setNetworkType!: (networkType: BridgeNetworkType) => void;
@mutation.web3.setSelectNetworkDialogVisibility private setSelectNetworkDialogVisibility!: (flag: boolean) => void;
Expand All @@ -67,7 +62,9 @@ export default class BridgeSelectNetwork extends Mixins(NetworkFormatterMixin) {
get networks(): NetworkItem[] {
return Object.entries(this.availableNetworks)
.map(([type, networks]) => {
.map(([type, record]) => {
const networks = Object.values(record) as AvailableNetwork[];
return networks.map(({ disabled, data: { id, name } }) => {
const networkName = type === BridgeNetworkType.EvmLegacy ? `${name} (${this.t('hashiBridgeText')})` : name;
Expand Down
12 changes: 4 additions & 8 deletions src/components/pages/Moonpay/BridgeInitMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ export default class MoonpayBridgeInitMixin extends Mixins(BridgeHistoryMixin, W
hash: string
) => Promise<Nullable<MoonpayEVMTransferAssetData>>;

@action.assets.updateRegisteredAssets private updateRegisteredAssets!: AsyncFnWithoutArgs;
@action.assets.updateExternalBalances private updateExternalBalances!: AsyncFnWithoutArgs;

async prepareEvmNetwork(): Promise<void> {
this.selectExternalNetwork(this.ethBridgeEvmNetwork); // WalletConnectMixin
await this.selectExternalNetwork(this.ethBridgeEvmNetwork); // WalletConnectMixin
}

initMoonpayApi(): void {
Expand Down Expand Up @@ -126,9 +123,6 @@ export default class MoonpayBridgeInitMixin extends Mixins(BridgeHistoryMixin, W
);
}

await this.updateRegisteredAssets();
await this.updateExternalBalances();

const [soraAddress] =
Object.entries(this.registeredAssets).find(([soraAddress, registeredAsset]) =>
ethersUtil.addressesAreEqual(registeredAsset.address, ethTransferData.address)
Expand All @@ -143,6 +137,8 @@ export default class MoonpayBridgeInitMixin extends Mixins(BridgeHistoryMixin, W

const asset = this.assetsDataTable[soraAddress];

const externalBalance = (await ethersUtil.getAccountAssetBalance(ethTransferData.to, asset.externalAddress))
.value;
const evmNetworkFee: CodecString = await ethersUtil.getEvmNetworkFee(soraAddress, false);
const evmNativeBalance = await ethersUtil.getAccountBalance(ethTransferData.to);
const hasEthForFee = !hasInsufficientEvmNativeTokenForFee(evmNativeBalance, evmNetworkFee);
Expand All @@ -151,7 +147,7 @@ export default class MoonpayBridgeInitMixin extends Mixins(BridgeHistoryMixin, W
throw createError('Insufficient ETH for fee', MoonpayNotifications.FeeError);
}

const maxAmount = getMaxValue(asset, evmNetworkFee, true); // max balance (minus fee if eth asset)
const maxAmount = getMaxValue({ ...asset, externalBalance }, evmNetworkFee, true); // max balance (minus fee if eth asset)
const amount = Math.min(Number(maxAmount), Number(ethTransferData.amount));

if (amount <= 0) {
Expand Down
1 change: 0 additions & 1 deletion src/components/shared/SelectAsset/SelectToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export default class SelectToken extends Mixins(TranslationMixin, SelectAssetMix
(asset) => !(this.asset?.address === XST.address && asset.address === XSTUSD.address)
) // XSTUSD-XST isn't allowed
: this.whitelistAssets.filter((asset) => {
if (asset.address === XSTUSD.address) return false; // XOR-XSTUSD isn't allowed
if (this.asset?.address === XSTUSD.address && [XOR.address, XST.address].includes(asset.address)) {
return false; // XSTUSD-XOR & XSTUSD-XST aren't allowed
}
Expand Down
1 change: 1 addition & 0 deletions src/consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export enum Components {
BridgeSelectAsset = 'pages/Bridge/SelectAsset',
BridgeSelectNetwork = 'pages/Bridge/SelectNetwork',
BridgeSelectAccount = 'pages/Bridge/SelectAccount',
BridgeLinksDropdown = 'pages/Bridge/LinksDropdown',
// Moonpay Page
Moonpay = 'pages/Moonpay/Moonpay',
MoonpayNotification = 'pages/Moonpay/Notification',
Expand Down
Loading

0 comments on commit 2ef5d4a

Please sign in to comment.