Skip to content

Commit

Permalink
feat(core): add evm feature (#4052)
Browse files Browse the repository at this point in the history
* feature(ui-ux): added dvm evm designs for onboarding (#3983)

* added new image slide on the welcome screen

* added condition to create wallet page

* shortened import

* update snapshot

* added onboarding translations

* added DE and FR translations

* Update mobile-app/app/components/icons/WalletIcon.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* Update mobile-app/app/components/icons/WalletIcon.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* fixed logo cut off

* updated snapshot

* included contentFit contain

* updated for consistency

* Update shared/translations/languages/zh-Hant.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/zh-Hant.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/zh-Hant.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/zh-Hans.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/zh-Hans.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/zh-Hans.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/it.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/fr.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/it.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/fr.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/de.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/es.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/es.json

Co-authored-by: Harsh R <[email protected]>

* Update shared/translations/languages/de.json

Co-authored-by: Harsh R <[email protected]>

* updated ZHS and ZHT translations

* Update mobile-app/app/screens/WalletNavigator/screens/CreateWallet/CreateWalletGuidelines.tsx

Co-authored-by: Harsh R <[email protected]>

* removed unnecessary return

---------

Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: Harsh R <[email protected]>

* feature(ui-ux): dvm <> evm portfolio (#3979)

* moved toggle_balance below

* added mb for android

* added DFI and EVM button

* design changed; moved toggle balance back

* added domain toggle skeleton

* added domainProvider

* added domain context to switch

* added switch to portfolio navigator

* added gradient border

* conditionally display elements

* some styling for EVM page

* empty portfolio

* empty evm portfolio

* used common icon

* updated the stylings

* removed get DFI tag for EVM

* changed to enum

* updated to use ENUM instead

* Update mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioScreen.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* Update mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioScreen.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* Update mobile-app/app/components/DomainSwitch.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* Update mobile-app/app/screens/AppNavigator/screens/Portfolio/components/ActionButtons.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* Update mobile-app/app/screens/AppNavigator/screens/Portfolio/components/DFIBalanceCard.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* reduced isEvmDomain conditions and css show/hide

* moved condition outside of component

* removed isEvmDomain for test.tsx

* removed unnecessary isEvmDomain

* Update mobile-app/app/screens/AppNavigator/screens/Portfolio/components/TotalPortfolio.tsx

Co-authored-by: Lyka Labrada <[email protected]>

* fix(core): portfolio (evm-dvm) tests fix (#4006)

* fix(core): portfolio tests fix

* fix action button tests

* rename to domain context

* rename on mock

* rename mock file

---------

Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>

* feat(ui-ux): hide bottom nagivation when EMV network is selected (#4011)

* feat(ui-ux): hide bottom nagivation when EMV network is selected

* future proof condition

* chore(ops): bump to add changi network

* chore(ops): bump packages to display changi

* feat(ui-ux): add evm faq screen (#4013)

* feat(ui-ux): add evm faq screen

* feat(ui-ux): update test snapshot

* add metachain faq translations

* add evm faq english translation for es and it

---------

Co-authored-by: Pierre Gee <[email protected]>

* feat(core): Transfer Domain feature branch (WIP) (#4007)

* feat(core): allow evm conversion

* update value and text based on domain

* feature(ui-ux): evm support for address book  (#4008)

* initial commit for address book

* added backward compatibility

* create and edit address update

* added style for portfolio bottom sheet

* fix linting

* lint fix

* added address type selector

* making close icon size to 22 px consistant

* added address type selector in AddressRow component

* seperating instance of addressbook and walletaddresses

* test fix

* chore

* backward compatibility for already saved address

* bug fix

* add search support for evm address

* lint issue fix

* added selectAllLabeledWalletAddress selector to show address label for evm address

* removed unused filters and attributes

* chore

* added evm tag

* chore fix

* chore key error fix

* added e2e tests

* added translation

* chore: fixed pr comments

* translation

* fix(ui-ux): fixed domain switch toggle (#4012)

* fix(ui-ux): fixed domain switch toggle

* added testcse

* updated DFI to DVM

* updated DFI to DVM in enum

* updated dfi to dvm in useWalletAddress

* toggle btn style fix

* test case fix

* feat(core): support transfer domain in convert screen (#4014)

* feat(core): support transfer domain in convert screen

* ensure utxo reserved fee when converting from utxo to dfi

* consistent function init

* explicit function return type

* set state by following data change instead of triggering via event

* consistent naming convention across convert screen and hooks

* fix displayed text for token symbol

* declare hooks before any function

* handle disabled toggle button

* fix displayed text on convert screen

* update toast in text

* fix transfer domain signer

* fix lints

* fix token detail screen navigation to convert

* update unit texts

* update drawer and prompts for dfi converter

* Update more explicit token convert symbols

* suffix with -evm for evm tokens

* fix lint

* fix hardcoded domain

* fix(ui-ux): translations for convert screen (#4028)

* fix(ui-ux): update copy text in convert screen

* fix(ui-ux): update translations

* add translations

* translations

* update de translations

* add missing it translation object

* fix conflict

* chore(ops): bump packages to display changi (#4030)

* chore(ops): bump to add changi network

* chore(ops): bump packages to display changi

* feat(ui-ux): add svg icons for sui and xchf tokens (#4031)

* feat(ui-ux): add svg icons for sui and xchf tokens

* fix invlalid svg props

* update sui svg to a flatter one

* fix rect prop

---------

Co-authored-by: JJ Adonis <[email protected]>

* fix(ui-ux): updated walletkit package to filter out burn token pool pair (#4033)

* fix(ui-ux): updated walletkit package to filter out burn token pool pair

* fix(e2e): network details

* chore(ops): bump walletkit (#4036)

* fix(ui-ux): svg border for evm tokens (#4029)

* fix(ui-ux): svg border for evm tokens

* fix(ui-ux): conditional icon sizing with svg border on evm tokens

* feature(ui-ux): enable transfer domain (#4032)

* fix(ui-ux): filter out LP tokens in EVM domain

* fix(ui-ux): UI labels for address types

* fix(ui-ux): sendconfirmationscreen evm bg for addresses

* fix(ui-ux): hide any address labels if there are error messages

* remove unused comment

* fix lint

* fix(ui-ux): to display address label even with err msg

* fix(ui-ux): labelled address

* fix(ui-ux): cater for selected whitelisted evm addr

* feat(e2e): add tests

* fix: lint for AddressRow

* feat: enable transfer domain

* fix(ui-ux): update UI for convert confirmation screen

* fix(e2e): network details

* Revert "fix(e2e): network details"

This reverts commit c29aef8.

* fix(ui-ux): update isEVMDomain flag

* fix(ui-ux): remove LP filter

* fix(lint): add empty data for evmtx

---------

Co-authored-by: Lyka Labrada <[email protected]>

* fix(ui-ux): fix selection of whitelisted address that redirects to edit address (#4040)

* fix(ui-ux): fix selection of whitelisted address that redirects to edit address

* chore(test): update snapshot

* chore(ui-ux): resolved ui bug for address book screen (#4041)

* fix(ui-ux): copy evm address when evm domain is toggled on (#4043)

* feat(core): add evmtx signer on convert (#4038)

* feat(core): add evmtx signer on convert

* feat(core): fix evmxt 'to' address for dvm to evm transferdomain

* feat(core): update transferdomain implementation for dst20 tokens

* feat(core): update handle transferdomain tokenId for EVM tokens

* update docker

* update evmtx signature

* update check for dfi token

* add function to get dst20 token contract address

* revert unnecessary changes on feautureflagcontext

* update blockchain node to beta14

* feat(core): implement transfer domain with signed evmtx on Send

* add README.md for the contractA abi

* extraxt evmtx signer into a separate function

* add todo

* remove commented line

* set nonce to 0

* feature(ui-ux): address book ui for transfer domain (#4042)

* feature(ui-ux): address book UI for transfer domain

* feature(ui-ux): address book bottom sheet in portfolio page

* update comment

* remove eslint-disable-next-line react-hooks/exhaustive-deps

* feat(ui-ux): standardize evm tag UI across screens

* feat(ui-ux): display address label

* fix(ui-ux): remove caret if not from send screen

* chore: update package

* fix: lint for address row

* fix(ui-ux): fix send nonce and vm address (#4045)

---------

Co-authored-by: Harsh R <[email protected]>
Co-authored-by: Chloe <[email protected]>
Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>

* fix(ui-ux): address book bottom sheet in portfolio page (#4046)

* fix(ui-ux): address book bottom sheet in portfolio page

* add check if editing current address label

* feat(ui-ux): fetch evm balance for convert screen (#4009)

* feat(core): allow evm conversion

* update value and text based on domain

* feat(ui-ux): fetch evm balance for convert screen

* feat(ui-ux): rename ethTokenBalances to evmTokenBalances

* remove 0x address

* update eth rpc for testnet

* feature(ui-ux): evm support for address book  (#4008)

* initial commit for address book

* added backward compatibility

* create and edit address update

* added style for portfolio bottom sheet

* fix linting

* lint fix

* added address type selector

* making close icon size to 22 px consistant

* added address type selector in AddressRow component

* seperating instance of addressbook and walletaddresses

* test fix

* chore

* backward compatibility for already saved address

* bug fix

* add search support for evm address

* lint issue fix

* added selectAllLabeledWalletAddress selector to show address label for evm address

* removed unused filters and attributes

* chore

* added evm tag

* chore fix

* chore key error fix

* added e2e tests

* added translation

* chore: fixed pr comments

* translation

* fix(ui-ux): fixed domain switch toggle (#4012)

* fix(ui-ux): fixed domain switch toggle

* added testcse

* updated DFI to DVM

* updated DFI to DVM in enum

* updated dfi to dvm in useWalletAddress

* toggle btn style fix

* test case fix

* replace token0 with CAS

* feat(core): fetch eth coin balance

* rename ethRpc to evmApi

* add evm address details type

* feat(core): add evmAddress inside WalletContext

* feat(ui-ux): display evm address on portfolio when EVM domain is toggled

* revert getEvmAddress

* remove promise return type in walletcontext

* feat(core): support transfer domain in convert screen (#4014)

* feat(core): support transfer domain in convert screen

* ensure utxo reserved fee when converting from utxo to dfi

* consistent function init

* explicit function return type

* set state by following data change instead of triggering via event

* consistent naming convention across convert screen and hooks

* fix displayed text for token symbol

* declare hooks before any function

* handle disabled toggle button

* fix displayed text on convert screen

* update toast in text

* fix transfer domain signer

* fix lints

* fix token detail screen navigation to convert

* update unit texts

* update drawer and prompts for dfi converter

* Update more explicit token convert symbols

* suffix with -evm for evm tokens

* fix lint

* fix hardcoded domain

* update evm tokens on convert screen

* fix(ui-ux): translations for convert screen (#4028)

* fix(ui-ux): update copy text in convert screen

* fix(ui-ux): update translations

* add translations

* translations

* update de translations

* add missing it translation object

* fix conflict

* chore(ops): bump packages to display changi (#4030)

* chore(ops): bump to add changi network

* chore(ops): bump packages to display changi

* feat(ui-ux): add svg icons for sui and xchf tokens (#4031)

* feat(ui-ux): add svg icons for sui and xchf tokens

* fix invlalid svg props

* update sui svg to a flatter one

* fix rect prop

---------

Co-authored-by: JJ Adonis <[email protected]>

* fix(ui-ux): updated walletkit package to filter out burn token pool pair (#4033)

* fix(ui-ux): updated walletkit package to filter out burn token pool pair

* fix(e2e): network details

* chore(ops): bump walletkit (#4036)

* fix(ui-ux): svg border for evm tokens (#4029)

* fix(ui-ux): svg border for evm tokens

* fix(ui-ux): conditional icon sizing with svg border on evm tokens

* feature(ui-ux): enable transfer domain (#4032)

* fix(ui-ux): filter out LP tokens in EVM domain

* fix(ui-ux): UI labels for address types

* fix(ui-ux): sendconfirmationscreen evm bg for addresses

* fix(ui-ux): hide any address labels if there are error messages

* remove unused comment

* fix lint

* fix(ui-ux): to display address label even with err msg

* fix(ui-ux): labelled address

* fix(ui-ux): cater for selected whitelisted evm addr

* feat(e2e): add tests

* fix: lint for AddressRow

* feat: enable transfer domain

* fix(ui-ux): update UI for convert confirmation screen

* fix(e2e): network details

* Revert "fix(e2e): network details"

This reverts commit c29aef8.

* fix(ui-ux): update isEVMDomain flag

* fix(ui-ux): remove LP filter

* fix(lint): add empty data for evmtx

---------

Co-authored-by: Lyka Labrada <[email protected]>

* fix(ui-ux): fix selection of whitelisted address that redirects to edit address (#4040)

* fix(ui-ux): fix selection of whitelisted address that redirects to edit address

* chore(test): update snapshot

* chore(ui-ux): resolved ui bug for address book screen (#4041)

* update temporary blockscout api

* feature(ui-ux): updated receive token screen to support evm address (#4025)

Co-authored-by: Lyka Labrada <[email protected]>

* fix(ui-ux): copy evm address when evm domain is toggled on (#4043)

* feat(core): add evmtx signer on convert (#4038)

* feat(core): add evmtx signer on convert

* feat(core): fix evmxt 'to' address for dvm to evm transferdomain

* feat(core): update transferdomain implementation for dst20 tokens

* feat(core): update handle transferdomain tokenId for EVM tokens

* update docker

* update evmtx signature

* update check for dfi token

* add function to get dst20 token contract address

* revert unnecessary changes on feautureflagcontext

* update blockchain node to beta14

* feat(core): implement transfer domain with signed evmtx on Send

* add README.md for the contractA abi

* extraxt evmtx signer into a separate function

* add todo

* remove commented line

* set nonce to 0

* add default target evm token

* feature(ui-ux): address book ui for transfer domain (#4042)

* feature(ui-ux): address book UI for transfer domain

* feature(ui-ux): address book bottom sheet in portfolio page

* update comment

* remove eslint-disable-next-line react-hooks/exhaustive-deps

* feat(ui-ux): standardize evm tag UI across screens

* feat(ui-ux): display address label

* fix(ui-ux): remove caret if not from send screen

* chore: update package

* fix: lint for address row

* feature(ui-ux): updated portfolio screen to support evm address (#4044)

* chore

* added logic for total portfolio value

* updated defichain version

* Update evmApi.ts

* add default target evm token

* chore

---------

Co-authored-by: Lyka Labrada <[email protected]>

* fix missing evm target token for non-dfi tokens

* transferdomain - get dynamic eth rpc url per network

* fix(core): updated token selection screen (#4047)

fix(core): updated tokenselectionscreen

* fix(ui-ux): fix convert selection (#4048)

Co-authored-by: Lyka Labrada <[email protected]>

* feat(ui-ux): move evm data inside redux store (#4049)

* feat(ui-ux): move evm data inside redux store

* perform batch dispatch

* update deps array when fetching evm details

---------

Co-authored-by: pierregee <[email protected]>
Co-authored-by: Harsh R <[email protected]>
Co-authored-by: Chloe <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Harsh <[email protected]>

* feature(core): added rpc calls for playground to calculate evm balance (#4053)

* feature(core): added rpc calls for playground to calculate evm balance

* chore

* fix(ui-ux): utxo-evm bug (#4051)

* fix(ui-ux): utxo-evm bug

* throw error on sending lp to evm address

* feat(ui-ux): add hasFetchedEvmTokens flag in store for loader (#4054)

* feat(ui-ux): add hasFetchedEvmTokens flag in store

* add evm domain condition

---------

Co-authored-by: Pierre Gee <[email protected]>

* fix(core): fix feature branch conflict to 'main' (#4055)

* chore(ops): bump packages to display changi (#4030)

* chore(ops): bump to add changi network

* chore(ops): bump packages to display changi

* feat(ui-ux): add svg icons for sui and xchf tokens (#4031)

* feat(ui-ux): add svg icons for sui and xchf tokens

* fix invlalid svg props

* update sui svg to a flatter one

* fix rect prop

---------

Co-authored-by: JJ Adonis <[email protected]>

* fix(ui-ux): updated walletkit package to filter out burn token pool pair (#4033)

* fix(ui-ux): updated walletkit package to filter out burn token pool pair

* fix(e2e): network details

* chore(ops): bump walletkit (#4036)

---------

Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Chloe <[email protected]>

* chore(core): refactored transfer domain provider (#4058)

* refactore transferdomain provider

* fix(ui-ux): fixed icon for evm DFI on swap token listing

* fix convert screen provider issue

* added chainId in evm provider

* added nonce in td request

* Update mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/SwapTokenSelectionScreen.tsx

Co-authored-by: Pierre Gee <[email protected]>

---------

Co-authored-by: Pierre Gee <[email protected]>

* fix(chore): updated evm tokenId and fixed DFI evm icon and balance  (#4059)

* refactore transferdomain provider

* fix(ui-ux): fixed icon for evm DFI on swap token listing

* fix convert screen provider issue

* added chainId in evm provider

* added nonce in td request

* fix(chore): updated evm tokenId and fixed DFI evm icon and balance inconsistancy

* updated dfi name

* updated EVM suffix names

* chore

* removed (EVM) for DFI token

* feat(e2e): address book transfer domain (#4057)

* feat(e2e): address book transfer domain

* fix(ui-ux): display updated wallet label on portfolio screen

* feat(e2e): setup to send dfi to evm domain

---------

Co-authored-by: Pierre Gee <[email protected]>

* feat(ui-ux): update transferdomain to pass only one vin (#4060)

* feat(ui-ux): update transferdomain to pass only one vin

* chore(deps): bump walletkit package

* fix(chore): bug fix for transferdomain (#4063)

* refactore transferdomain provider

* fix(ui-ux): fixed icon for evm DFI on swap token listing

* fix convert screen provider issue

* added chainId in evm provider

* added nonce in td request

* fix(chore): updated evm tokenId and fixed DFI evm icon and balance inconsistancy

* updated dfi name

* updated EVM suffix names

* chore

* removed (EVM) for DFI token

* Balance details screen for EVM token

* fixed evm dif related bugs

* feat(core): feature flag evm (#4056)

* chore(ops): bump packages to display changi (#4030)

* chore(ops): bump to add changi network

* chore(ops): bump packages to display changi

* feat(ui-ux): add svg icons for sui and xchf tokens (#4031)

* feat(ui-ux): add svg icons for sui and xchf tokens

* fix invlalid svg props

* update sui svg to a flatter one

* fix rect prop

---------

Co-authored-by: JJ Adonis <[email protected]>

* fix(ui-ux): updated walletkit package to filter out burn token pool pair (#4033)

* fix(ui-ux): updated walletkit package to filter out burn token pool pair

* fix(e2e): network details

* chore(ops): bump walletkit (#4036)

* feat(core): feature flag evm

* add feature flag

* feat(core): hide evm in address book

* fix maximum depth

* disable sending to evm address

* rm comment

---------

Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Chloe <[email protected]>

* fix(ui-ux): choose address by domain (#4065)

fix(uiux): choose address by domain

* chore(ui-ux): hide address type selection if evm disabled (#4064)

Co-authored-by: Harsh R <[email protected]>

* chore(deps): bump expo-image (#4039)

* chore(deps): bump expo-image

* chore(deps): bump [email protected] and related packages

* fix conflict

---------

Co-authored-by: pierregee <[email protected]>

* fix(chore): fixed ios/android loading issue (#4066)

* fixed TextEncoder error

* fixed loading issue

* removed text-encoding

* fixed wrong balance issue

* fix 9 decimal points on transfer domain

* fix package and mobile expo

---------

Co-authored-by: pierregee <[email protected]>

* fix(ui-ux): display chevron if entrypoint is settings (#4067)

* fix(ui-ux): fixed address title in address input screen (#4070)

* fix(ui-ux): fixed address title in address input screen

* fixed label issue

* fixed minor issue related to evm icons

* fix issue with evm tx

---------

Co-authored-by: pierregee <[email protected]>

* feat(core): service provider - allow custom evm and eth rpc urls (#4068)

* feat(ui-ux): update service provider description on settings

* feat(core): update service provider storage api and add custom

* feat(uii-ux): add custom url input for multiple providers

* feat(ui-ux): disable evm urls when evmfeature is disabled

* fix(core): fix custom provider context overriding value

* feat(ui-ux): change custom provider type to enum

* feat(core): keep 'SERVICE_PROVIDER_URL' key for dvm for backward compatibility

* feat(core): update dvm key provider for backward compatibility

* add ethRpcUrl to EVMProvider deps

* fix provider storage not setting properly

* update provider button from 'continue' to 'save changes'

* hide evm and eth rpc urls when evmfeature flag is disabled

* address pr comments

---------

Co-authored-by: Pierre Gee <[email protected]>

* feat(ui-ux): update blockscout url (#4071)

* fix(core): fixed hang issue on click of denomination currency (#4072)

* feat(core): update testnet eth rpc url (#4073)

* fix(ui-ux): fixed search unsaved address in addressbook screen (#4078)

* fix(chore):  fixed network icon issue on network change (#4076)

fix(chore): fixed network icon issue on network change

* fix(core): fix send dvm to dvm txn (#4075)

* fix(core): fix send dvm to dvm txn

* fix(core): update evm provider

* fix lint issue

* change lint error fix

* fix(core): fix null data for evm wallet details (#4077)

Co-authored-by: Harsh R <[email protected]>

* feat(core): return default evm providers url when evm flag is disabled (#4074)

* feat(core): reset custom evm and ethrpc urls when evm feature is disabled

* chore(translations): add translations for updated service provider screen

* add missing it and es translations

* return default evm providers url when evm flag is disabled

* remove unnecessary condition

* remove unnecessary deps

---------

Co-authored-by: Harsh R <[email protected]>

* fix(ui-ux): fixed address book label overlap issue for evm address (#4079)

* fix(core): fix unit test case (#4081)

* fix(ui-ux): hide Get DFI btn on empty portfolio screen (#4080)

* fix(core): fixed app crashing issue (#4083)

* fix(core): handle auto-conversion of utxo to dfi token (#4082)

* fix(core): handle auto-conversion of utxo to dfi token

* update getinputtokentype if-condition

* updated getInputTokenType condition for send token

---------

Co-authored-by: Harsh <[email protected]>

* fix(core): fix invalid nonce error (#4087)

* fix(ui-ux): fixed Send screen displays no assets displayed issue (#4088)

* fix(ui-ux): fixed Send screen displays no assets displayed issue

* updated token listing condition

* fix(ui-ux): fixed token detail screen to hide loan data in evm domain (#4089)

* fix(ui-ux): fixed Send screen displays no assets displayed issue

* updated token listing condition

* fixed token detail screen to hide load data in evm domain

---------

Co-authored-by: Lyka Labrada <[email protected]>

* fix(ui-ux): hide swap btn for evm domain on token details screen (#4090)

* chore(core): disallow http from custom service provider url (#4091)

* fix(ui-ux): fix evm faq description (#4092)

* fix(ui-ux): hide loan related data on portfolio card (#4093)

* fix(core): fix decimal value turning into exponential notation string (#4094)

fix(core): fix decimal turning into notation

* fix(core): skip eth provider for transfer domain (#4095)

* fix(core): skip eth provider for transfer domain

* fix lint error

* feat(ui-ux): remove duplicate `for EVM` text on token name (#4096)

* Revert "fix(core): skip eth provider for transfer domain (#4095)"

This reverts commit df92ccc.

* fix(ui-ux): remove duplicate 'for EVM'

* fix(core): set testnet eth rpc as default

* feat(ui-ux): log error in evm provider (#4097)

* feat(ui-ux): redirect token summary link to metascan for evm (#4098)

* fix(ui-ux): display evm address as from on convert (#4099)

* chore(logs): add info logs in evm provider (#4100)

* chore(tests): fix e2e runner (#4069)

* test

* test

* fix sendconfirmation and addresses tests

* fix address e2e for TD

* updated getInputTokenType condition for send token

* fixed service provider e2e

* fix service provider e2e

* change delay back to 3000

* update test invalid url

* chore

* address spec fix

* e2e fix

* fix e2e

* use changi rpc for remote pg

* choer(tests): update snapshot

---------

Co-authored-by: Lyka Labrada <[email protected]>
Co-authored-by: Harsh <[email protected]>
Co-authored-by: Harsh R <[email protected]>

* feat(ui-ux): remove usememo in evm provider (#4101)

* feat(core): update testnet eth rpc url (#4102)

* feat(ui-ux): put back usememo in evm provider

* feat(core): update testnet eth rpc url

* chore(e2e): update td addresses test

* chore(tests): test e2e runner (#4104)

* chore(tests): add delay to service prrovider

* chore(tests): update transferdomain addresses test

* chore(tests): remove delay to service provider

* chore(ops): update packages

* chore(ops): temporarily hide addresss selection

* fix(e2e): fixed address specs e2e (#4106)

* fix(e2e): fixed address specs e2e

* minor fix

* fix(ui-ux): handle empty wallet address (#4107)

Co-authored-by: Harsh R <[email protected]>

* fix(ui-ux): fixed Both error / valid messages are displayed when scan… (#4109)

* fix(ui-ux): fixed Both error / valid messages are displayed when scanning address during send EVM to EVM

* fix verified message for dvm address

* minor fix

---------

Co-authored-by: elocin <[email protected]>
Co-authored-by: Harsh R <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: Pierre Gee <[email protected]>
Co-authored-by: chloe <[email protected]>
Co-authored-by: JJ Adonis <[email protected]>
Co-authored-by: Harsh <[email protected]>
  • Loading branch information
8 people authored Oct 25, 2023
1 parent fb8a96d commit 7771827
Show file tree
Hide file tree
Showing 134 changed files with 10,289 additions and 4,945 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- run: .github/workflows/ci/wait-for http://localhost:3001/_actuator/probes/liveness -t 240
- run: .github/workflows/ci/wait-for http://localhost:3002/_actuator/probes/liveness -t 240
- run: .github/workflows/ci/wait-for http://localhost:19551/ping -t 240
- run: .github/workflows/ci/wait-for http://localhost:19550/ping -t 240

- uses: cypress-io/github-action@d79d2d530a66e641eb4a5f227e13bc985c60b964 # v4.2.2
with:
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = function (api) {
"@shared-api": "./shared/api",
"@shared-contexts": "./shared/contexts",
"@shared-types": "./shared/types",
"@shared-contracts": "./shared/contracts",
"@screens": "./mobile-app/app/screens",
"@store": "./shared/store",
"@translations": "./shared/translations",
Expand Down
16 changes: 11 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@ services:
ports:
- "19553:80"
- "19552:8080"
- "19551:8082"
- "19550:8082"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"

defi-blockchain:
image: defi/defichain:master-91a01aea0
image: defi/defichain:HEAD-420563c450
ports:
- "19554:19554"
- "19551:19551"
command: >
defid
-printtoconsole
-rpcallowip=0.0.0.0/0
-rpcbind=0.0.0.0
-ethrpcbind=0.0.0.0
-rpcallowcors=http://localhost:8081
-rpcuser=playground
-rpcpassword=playground
-rpcworkqueue=512
Expand Down Expand Up @@ -55,10 +60,11 @@ services:
-grandcentralheight=16
-grandcentralepilogueheight=17
-nextnetworkupgradeheight=18
-changiintermediateheight=19
environment:
- RUST_LOG=debug

defi-playground:
image: ghcr.io/birthdayresearch/playground-api:3.34.0
image: ghcr.io/birthdayresearch/playground-api:4.0.0-rc.1.2
depends_on:
- defi-blockchain
ports:
Expand All @@ -71,7 +77,7 @@ services:
- "traefik.http.routers.playground.entrypoints=web"

defi-whale:
image: ghcr.io/birthdayresearch/whale-api:3.34.0
image: ghcr.io/birthdayresearch/whale-api:4.0.0-rc.1.2
depends_on:
- defi-blockchain
ports:
Expand Down
41 changes: 28 additions & 13 deletions mobile-app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
SecuredStoreAPI,
LanguagePersistence,
ThemePersistence,
DomainPersistence,
Logging,
} from "@api";
import { AppStateContextProvider } from "@contexts/AppStateContext";
Expand All @@ -28,6 +29,7 @@ import {
LanguageProvider,
useLanguage,
} from "@shared-contexts/LanguageProvider";
import { DomainProvider } from "@contexts/DomainContext";
import * as Localization from "expo-localization";
import { useColorScheme } from "react-native";
import { WalletPersistence } from "@api/wallet";
Expand All @@ -45,6 +47,8 @@ import { WalletToast } from "@components/WalletToast";
import { ServiceProviderPersistence } from "@api/wallet/service_provider";
import { FavouritePoolpairProvider } from "@contexts/FavouritePoolpairContext";
import BigNumber from "bignumber.js";
import { EVMProvider } from "@contexts/EVMProvider";
import { CustomServiceProvider } from "@contexts/CustomServiceProvider";

/**
* Loads
Expand Down Expand Up @@ -110,19 +114,30 @@ export default function App(): JSX.Element | null {
api={LanguagePersistence}
locale={Localization.locale}
>
<DisplayBalancesProvider>
<ConnectionBoundary>
<GestureHandlerRootView
style={tailwind("flex-1")}
>
<ToastProvider renderType={customToast}>
<FavouritePoolpairProvider>
<Main />
</FavouritePoolpairProvider>
</ToastProvider>
</GestureHandlerRootView>
</ConnectionBoundary>
</DisplayBalancesProvider>
<DomainProvider api={DomainPersistence}>
<CustomServiceProvider
api={ServiceProviderPersistence}
logger={Logging}
>
<DisplayBalancesProvider>
<ConnectionBoundary>
<GestureHandlerRootView
style={tailwind("flex-1")}
>
<ToastProvider
renderType={customToast}
>
<FavouritePoolpairProvider>
<EVMProvider logger={Logging}>
<Main />
</EVMProvider>
</FavouritePoolpairProvider>
</ToastProvider>
</GestureHandlerRootView>
</ConnectionBoundary>
</DisplayBalancesProvider>
</CustomServiceProvider>
</DomainProvider>
</LanguageProvider>
</ThemeProvider>
</FeatureFlagProvider>
Expand Down
1 change: 1 addition & 0 deletions mobile-app/app/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export { FeatureFlagPersistence } from "./persistence/feature_flag_storage";
export { SlippageTolerancePersistence } from "./persistence/slippage-tolerance_storage";
export { PortfolioCurrencyPersistence } from "./persistence/portfolio_currency_storage";
export { FavouritePoolpairsPersistence } from "./persistence/favourite_poolpairs_storage";
export { DomainPersistence } from "./persistence/domain_storage";
16 changes: 16 additions & 0 deletions mobile-app/app/api/persistence/domain_storage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import AsyncStorage from "@react-native-async-storage/async-storage";

const KEY = "WALLET.EVMDOMAIN";

async function set(domain: NonNullable<string>): Promise<void> {
await AsyncStorage.setItem(KEY, domain);
}

async function get(): Promise<string | null> {
return await AsyncStorage.getItem(KEY);
}

export const DomainPersistence = {
set,
get,
};
51 changes: 29 additions & 22 deletions mobile-app/app/api/transaction/dfi_converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import {
CTransactionSegWit,
TransactionSegWit,
} from "@defichain/jellyfish-transaction";

export type ConversionMode = "utxosToAccount" | "accountToUtxos";
import { ConvertDirection } from "@screens/enum";

export async function dfiConversionSigner(
account: WhaleWalletAccount,
amount: BigNumber,
mode: ConversionMode
mode: ConvertDirection,
): Promise<CTransactionSegWit> {
const script = await account.getScript();
const builder = account.withTransactionBuilder();
Expand All @@ -32,7 +31,7 @@ export async function dfiConversionSigner(
},
],
},
script
script,
);
} else {
signed = await builder.account.accountToUtxos(
Expand All @@ -46,55 +45,63 @@ export async function dfiConversionSigner(
],
mintingOutputsStart: 2, // 0: DfTx, 1: change, 2: minted utxos (mandated by jellyfish-tx)
},
script
script,
);
}
return new CTransactionSegWit(signed);
}

export function dfiConversionCrafter(
amount: BigNumber,
mode: ConversionMode,
convertDirection: ConvertDirection,
onBroadcast: () => any,
onConfirmation: () => void,
submitButtonLabel?: string
submitButtonLabel?: string,
): DfTxSigner {
if (
![
ConvertDirection.accountToUtxos,
ConvertDirection.utxosToAccount,
].includes(convertDirection)
) {
throw new Error("Unexpected DFI conversion");
}

const [symbolA, symbolB] =
mode === "utxosToAccount"
? ["UTXO", translate("screens/OceanInterface", "tokens")]
: [translate("screens/OceanInterface", "tokens"), "UTXO"];
convertDirection === ConvertDirection.utxosToAccount
? ["UTXO", translate("screens/OceanInterface", "DFI")]
: [translate("screens/OceanInterface", "DFI"), "UTXO"];
return {
sign: async (account: WhaleWalletAccount) =>
await dfiConversionSigner(account, amount, mode),
await dfiConversionSigner(account, amount, convertDirection),
title: translate(
"screens/ConvertConfirmScreen",
"Convert {{amount}} DFI to {{target}}",
"Convert {{amount}} {{symbolA}} to {{symbolB}} tokens",
{
amount: amount.toFixed(8),
target:
mode === "utxosToAccount"
? translate("screens/ConvertScreen", "tokens")
: "UTXO",
}
symbolA,
symbolB,
},
),
drawerMessages: {
preparing: translate("screens/OceanInterface", "Preparing to convert…"),
waiting: translate(
"screens/OceanInterface",
"Converting {{amount}} DFI {{symbolA}} to {{symbolB}}",
"Converting {{amount}} {{symbolA}} to {{symbolB}} tokens",
{
symbolA: symbolA,
symbolB: symbolB,
amount: amount.toFixed(8),
}
},
),
complete: translate(
"screens/OceanInterface",
"{{amount}} DFI converted to {{symbolB}}",
"{{amount}} {{symbolA}} converted to {{symbolB}} tokens",
{
symbolB: symbolB,
symbolA,
symbolB,
amount: amount.toFixed(8),
}
},
),
},
onBroadcast,
Expand Down
Loading

0 comments on commit 7771827

Please sign in to comment.