Skip to content

Commit

Permalink
feat(extension): introduce conway-era dapp transaction screens and ac…
Browse files Browse the repository at this point in the history
…tivity history (#727)

* chore/Bump cardano-js-sdk (#559)

* chore!: bump cardano-js-sdk packages to latest versions

* ci: add cardano services urls parameters to build step

* Feat/sanchonet network switch support (#612)

* feat: update env to support switching to sanchonet

* chore: remove old testnet

* chore: bump cardano-sdk packages to latest version

---------

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

* [LW-7983] [LW-7984] dRep confirmation screens (#554)

* refactor: move logic out of component

* fix: file path

* feat(core): setup storybook

* refactor(ui): extract insufficient funds warning component

* feat(core): add lace/ui package

* feat(core): create ConfirmDRepRegistration component

* feat(extension): install @lace/ui

* refactor: move functions to utils

* fix: type

* refactor: types file

* feat: check for DRep transaction

* feat: integrate confirm drep registration component

* refactor(core): use Metadata component

* refactor(core): use flexbox

* refactor(core): remove insufficient funds message

* refactor(core): create ConfirmDRepRetirement

* refactor: remove insufficient funds warning; break down main component

* feat: add certificate data

* feat: add drep retirement container

* fix: condition

* fix: type

* fix: style

* fix: check for anchor

* fix: check for undefined certificates

* fix: merge conflict

* fix: type error

* feat: temp env changes

* feat(extension): use consistent naming of DRep ID

* feat(extension): show anchor metadata if exists

* feat(extension): convert user facing DRepID to bech32

* fix: add cardano symbol to deposit amount

* chore(core): downgrade storybook to v6

* fix: update lock file

* fix: styles and text

* fix: storybook build

* fix: storybook build

* feat: check retired drep key

* fix: check retired drep key

---------

Co-authored-by: Renan Ferreira <[email protected]>
Co-authored-by: Michael Chappell <[email protected]>

* feat(extension): [LW-7984] voting procedures (#655)

* feat(ui): create metadata component

* wip

* feat(ui): text link component

* chore(ui): fix rebase

* feat(ui): create metadata link component

* feat(core): create voting procedures component

* chore(extension): fix rebase

* fix(ui): add work break

* feat(extension): voting procedures

* refactor(core): make actions optional

* refactor(core): use action as key prop

* refactor(extension): add custom title for voting procedures

* [LW-8491] Voting delegation confirmation (#648)

* feat(core): setup storybook

* feat(core): add lace/ui package

* feat: check for DRep transaction

* feat: integrate confirm drep registration component

* refactor: remove insufficient funds warning; break down main component

* feat: add certificate data

* feat: add drep retirement container

* feat(extension): use consistent naming of DRep ID

* fix: add cardano symbol to deposit amount

* refactor: certificate inspector factory

* feat: voting delegation

* fix: type errors

* fix: merge conflicts

---------

Co-authored-by: Michael Chappell <[email protected]>

* chore: modify sanchonet urls (#667)

* feat: drep update certificate signing (#664)

* fix(extension): updated padding and missing bech32 addressing

* fix: no explorer for sanchonet

* chore(extension): add unit tests for dapp/confirm-tx (#743)

* fix: update drep id casing

* fix: update title translations for cip95 popups

* fix(extension): [LW-9163] nullish check on existence of stakeKeyDeposit property not value (#751)

* fix: e2e no unresolved imports

* chore(extension): resolve pr comments (#748)

* fix(extension): translation keys casing and unit tests (#756)

* chore(all): exclude stories and tests from the rollup builds (#752)

* chore(core): fix extension of stories .ts -> .tsx (impacts: rollup)

* chore(all): exclude test files from rollup builds

* Chore/update for sdk conway era (#734)

* chore: stake pools sort by ros

* chore: metrics require lastRos and ros

* Revert "Chore/update for sdk conway era (#734)" (#767)

This reverts commit 5b81b19.

* test(extension): add test ids for governance actions (#765)

* Merge main into feat/sanchonet (#763)

* feat(staking): maintenance 24 Nov 2023 (#754)

* feat(staking): maintenance 24 Nov 2023

* [LW-9151] Edit account name component (#746)

* feat(ui): input component

* feat(extension): edit account drawer

* feat(extension): add unit test

* feat: rename input component

* feat(ui): use pseudo parameters

* feat(ui): input width

* feat(ui): input disabled style

* feat(extension): add ui package

* feat: update lock file

* feat(ui): remove redundant styles

* feat(extension): [LW-5806] update Minting transaction display from dapps (#608)

* feat: identify minting txs from dapps and display proper UI to confirm

refs: LW-5806

* feat(extension): update dapp transaction styling

* refactor(extension,core): fix sonarcloud quality checks

* ci(core): add @lace/ui to dependencies

* test(extension): add mocks in ConfirmTransaction.test.tsx

* test(extension): remove leftover from local testing

* refactor(core): add missing newline at end of file

---------

Co-authored-by: przemyslaw.wlodek <[email protected]>

* test(extension): maintenance 27 nov (#757)

* test(extension): maintenance nov 27

* test(extension): clear failed request test logs

* test(extension): add real time console test logging, remove unnecessary logs

* test(extension): update wdio version

* test(extension): add node option env variable for e2e github runs

* test(extension): move node options to e2e test sections

* test(extension): increase max-old-space-size

* test(extension): downgrade wdio to stable version, remove node env variable

* feat(staking): [LW-6437, LW-8877] past epochs rewards chart (#718)

---------

Co-authored-by: refi93 <[email protected]>
Co-authored-by: przemyslaw.wlodek <[email protected]>
Co-authored-by: januszjanus <[email protected]>

* feat(extension): track manual re-sync and hd wallet discovery (#712)

* feat(staking): [LW-8929, LW-8777] apply pool search also to selected pools (#706)

---------

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

* feat(staking,common): enable manageDelegation CTA from pool details (#720)

Co-authored-by: przemyslaw.wlodek <[email protected]>

* feat(staking): load multi-delegation for HW wallets (#686)

---------

Signed-off-by: Kamil Džurman <[email protected]>
Co-authored-by: Rafael Korbaš <[email protected]>
Co-authored-by: januszjanus <[email protected]>
Co-authored-by: przemyslaw.wlodek <[email protected]>

* test(extension): test maintenance 29 Nov - fix Dapp e2e (#760)

* feat(extension): [LW-9028] Add wallet concepts to menu (#742)

* feat(extension): update dropdown menu with new wallet component

* feat(extension): add add new wallet option to profile dropdown

* refactor(ui): add test id

* refactor(extension): add test id for multi wallet

* refactor(extension): increase button width to match figma

* refactor(extension): remove copy address tooltip from multi-wallet menu it em

* refactor(extension): align top navigation buttons with side panel

* refactor(extension): update the expand button styling

* refactor(extension): update network pill and expand button styling

* refactor(extension): update network pill border radius

* refactor(extension): limit network pill change to popup only

* fix(extension): fix moving left side bar

* refactor(extension,core,cardano): post-merge fixes

* chore(extension): fix unit tests + rename

* chore(extension): fix unit tests and mocks

* chore(extension): remove TODO comments

* chore(core): review comments

---------

Signed-off-by: Kamil Džurman <[email protected]>
Co-authored-by: Janusz Janus <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Leonel Gobbi <[email protected]>
Co-authored-by: bslabiak <[email protected]>
Co-authored-by: Tomek Marciniak <[email protected]>
Co-authored-by: refi93 <[email protected]>
Co-authored-by: Kamil Džurman <[email protected]>
Co-authored-by: Lukasz Jagiela <[email protected]>
Co-authored-by: Renan Valentin <[email protected]>

* feat(extension): add drep retirement id mismatch modal (#758)

* chore: update cardano-sdk packages

* refactor: update lace based on cardano-sdk breaking changes

refactor: use internal wallet address discovery

* fix: typos in translation

* feat: stake and vote confirmation screens (#683)

* chore/Bump cardano-js-sdk (#559)

* chore!: bump cardano-js-sdk packages to latest versions

* ci: add cardano services urls parameters to build step

* Feat/sanchonet network switch support (#612)

* feat: update env to support switching to sanchonet

* chore: remove old testnet

* chore: bump cardano-sdk packages to latest version

---------

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

* [LW-7983] [LW-7984] dRep confirmation screens (#554)

* refactor: move logic out of component

* fix: file path

* feat(core): setup storybook

* refactor(ui): extract insufficient funds warning component

* feat(core): add lace/ui package

* feat(core): create ConfirmDRepRegistration component

* feat(extension): install @lace/ui

* refactor: move functions to utils

* fix: type

* refactor: types file

* feat: check for DRep transaction

* feat: integrate confirm drep registration component

* refactor(core): use Metadata component

* refactor(core): use flexbox

* refactor(core): remove insufficient funds message

* refactor(core): create ConfirmDRepRetirement

* refactor: remove insufficient funds warning; break down main component

* feat: add certificate data

* feat: add drep retirement container

* fix: condition

* fix: type

* fix: style

* fix: check for anchor

* fix: check for undefined certificates

* fix: merge conflict

* fix: type error

* feat: temp env changes

* feat(extension): use consistent naming of DRep ID

* feat(extension): show anchor metadata if exists

* feat(extension): convert user facing DRepID to bech32

* fix: add cardano symbol to deposit amount

* chore(core): downgrade storybook to v6

* fix: update lock file

* fix: styles and text

* fix: storybook build

* fix: storybook build

* feat: check retired drep key

* fix: check retired drep key

---------

Co-authored-by: Renan Ferreira <[email protected]>
Co-authored-by: Michael Chappell <[email protected]>

* feat(extension): [LW-7984] voting procedures (#655)

* feat(ui): create metadata component

* wip

* feat(ui): text link component

* chore(ui): fix rebase

* feat(ui): create metadata link component

* feat(core): create voting procedures component

* chore(extension): fix rebase

* fix(ui): add work break

* feat(extension): voting procedures

* refactor(core): make actions optional

* refactor(core): use action as key prop

* refactor(extension): add custom title for voting procedures

* [LW-8491] Voting delegation confirmation (#648)

* feat(core): setup storybook

* feat(core): add lace/ui package

* feat: check for DRep transaction

* feat: integrate confirm drep registration component

* refactor: remove insufficient funds warning; break down main component

* feat: add certificate data

* feat: add drep retirement container

* feat(extension): use consistent naming of DRep ID

* fix: add cardano symbol to deposit amount

* refactor: certificate inspector factory

* feat: voting delegation

* fix: type errors

* fix: merge conflicts

---------

Co-authored-by: Michael Chappell <[email protected]>

* chore: modify sanchonet urls (#667)

* feat: drep update certificate signing (#664)

* feat: stake and vote confirmation screens

* fix: correct capitalisation of DRep ID

* fix: voting translation titles

* feat(extension): update staking credential path

---------

Co-authored-by: Leonel Gobbi <[email protected]>
Co-authored-by: mirceahasegan <[email protected]>
Co-authored-by: Renan Ferreira <[email protected]>
Co-authored-by: Michael Chappell <[email protected]>

* [LW-8490] Governance Actions (#670)

* chore/Bump cardano-js-sdk (#559)

* chore!: bump cardano-js-sdk packages to latest versions

* ci: add cardano services urls parameters to build step

* Feat/sanchonet network switch support (#612)

* feat: update env to support switching to sanchonet

* chore: remove old testnet

* chore: bump cardano-sdk packages to latest version

---------

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

* [LW-7983] [LW-7984] dRep confirmation screens (#554)

* refactor: move logic out of component

* fix: file path

* feat(core): setup storybook

* refactor(ui): extract insufficient funds warning component

* feat(core): add lace/ui package

* feat(core): create ConfirmDRepRegistration component

* feat(extension): install @lace/ui

* refactor: move functions to utils

* fix: type

* refactor: types file

* feat: check for DRep transaction

* feat: integrate confirm drep registration component

* refactor(core): use Metadata component

* refactor(core): use flexbox

* refactor(core): remove insufficient funds message

* refactor(core): create ConfirmDRepRetirement

* refactor: remove insufficient funds warning; break down main component

* feat: add certificate data

* feat: add drep retirement container

* fix: condition

* fix: type

* fix: style

* fix: check for anchor

* fix: check for undefined certificates

* fix: merge conflict

* fix: type error

* feat: temp env changes

* feat(extension): use consistent naming of DRep ID

* feat(extension): show anchor metadata if exists

* feat(extension): convert user facing DRepID to bech32

* fix: add cardano symbol to deposit amount

* chore(core): downgrade storybook to v6

* fix: update lock file

* fix: styles and text

* fix: storybook build

* fix: storybook build

* feat: check retired drep key

* fix: check retired drep key

---------

Co-authored-by: Renan Ferreira <[email protected]>
Co-authored-by: Michael Chappell <[email protected]>

* feat(extension): [LW-7984] voting procedures (#655)

* feat(ui): create metadata component

* wip

* feat(ui): text link component

* chore(ui): fix rebase

* feat(ui): create metadata link component

* feat(core): create voting procedures component

* chore(extension): fix rebase

* fix(ui): add work break

* feat(extension): voting procedures

* refactor(core): make actions optional

* refactor(core): use action as key prop

* refactor(extension): add custom title for voting procedures

* feat(core): create parameter change action

* feat(core): create hard fork initiation action

* feat(core): create new constitution action

* feat(core): create no confidence action

* feat(core): create treasury withdrawals action

* feat(core): create info action

* feat(core): create update comittee action

* refactor(core): check if anchor is provided

* refactor(core): update storybook path

* feat(extension): add translations

* refactor(core): remove ununsed prop

* feat(staking): [LW-8684] add tooltip to piechart (#616)

* feat: lw-8684-add tooltip to delegation piechart

* fix: add custom tooltip dot style

* feat(ui): add tooltip to metadata component

* chore(core): fix pipeline

* chore(core): update proposal procedures components to the latest ui

* fix(extension): resolve pr comments

---------

Co-authored-by: Leonel Gobbi <[email protected]>
Co-authored-by: mirceahasegan <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Michael Chappell <[email protected]>
Co-authored-by: John Oshalusi <[email protected]>
Co-authored-by: Vitalii Vozniak <[email protected]>

* fix(extension): resolve pr comments

* fix(extension): remove code duplications for metadata and metadata link components

* feat(extension): lw-8600 (#819)

* feat(extension): lw-8600

* feat(extension): fix translations

* feat(extension): fix tx details mappers

* fix(extension): lw-8600 move helpers to common util

* fix(extension): resolve pr comment

* fix(extension): unify tx details lists

* fix(extension): resolve sdet comments

* fix(extension): resolve sdet comments

* refactor: remove need to target dev endpoints in CI

* refactor: remove sanchonet as default network option

* refactor: remove sanchonet explorer check

* feat(extension): update drep mapper check

* fix(extension): conway-era tx activities line items (#860)

* fix(extension): conway-era tx activiries line items

* fix(extension): adjust tests

* fix(extension): resolve pr comments

* feat(extension): update drep mapper check

* fix(extension): convert drepid and stakekeyhash to bech32, fix translations

* fix(extension): lw-9688: unable to see transaction details for conway-era transactions

* fix(extension): resolve lw-9621 pe comments

* fix(extension): resolve lw-9621 pr comments

* fix(extension): lw-9621 add storybook showing all conway era governance activity items

* chore(core): fix storybook build

* fix: use correct stake address bech32

* fix(core): sanchonet-related storybook errors [LW-9721] (#880)

* fix(core): add custom viewports and proper structure to storybook

* fix(core): react key prop errors

* refactor: rename useCexplorerBaseUrl typo

* fix: add storybook back for core package

* feat: update stories for conway-era tx activity history

* fix: add retry fallback for matching last active tab based on non-standard URL

* chore: update dev preview env file

* feat(extension): update conway era tx details to the latest figma (#868)

* feat(extension): update conway era tx details to the latest figma

* feat(extension): handle multiline row items with subitems

* feat(extension): handle parameter_change_action

* fix(extension): resolve pr comments

* fix(extension): update to the latest figma/AC

* fix(extension): resolve pr comments

* fix(extension): resolve sanchonet pr comments

* fix(extension): after merge with sanchonet fixes

* fix(extension): after merge with sanchonet fixes

* fix(extension): resolve sanchonet pr comments

* chore(core): mock @lace/cardano for storybook

* fix(extension): fix tests

* chore: downgrade uuid package to same used by pouchdb

* refactor: remove unintended config changes

* fix: no wallet dapp test

* fix(extension): resolve lw-9622 sdet comments

* feat(extension): update conway era history line items

* fix(extension): make anchor url clickable

* fix(extension): resolve pr comments

* fix: lw-8940 casing in reward account

* feat(extension): update sign with hw

* chore: reword stakeVoteDelegation title

* feat(extension): handle requests from non registered users (#935)

* feat(extension): handle requests from non registered users

* feat(extension): fix modal visibility condition

* feat(extension): fix test

* fix(extension): resolve pr comments

* fix(extension): fix labels

* refactor: rename proprosal procedure call

* fix: broken hook test

* feat: revert useTxSummary hook

* feat(extension): fix test

* refactor: revert story change

---------

Signed-off-by: Kamil Džurman <[email protected]>
Co-authored-by: Leonel Gobbi <[email protected]>
Co-authored-by: mirceahasegan <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Renan Ferreira <[email protected]>
Co-authored-by: vetalcore <[email protected]>
Co-authored-by: Przemysław Włodek <[email protected]>
Co-authored-by: Wojtek Kłos <[email protected]>
Co-authored-by: Janusz Janus <[email protected]>
Co-authored-by: bslabiak <[email protected]>
Co-authored-by: Tomek Marciniak <[email protected]>
Co-authored-by: refi93 <[email protected]>
Co-authored-by: Kamil Džurman <[email protected]>
Co-authored-by: Lukasz Jagiela <[email protected]>
Co-authored-by: John Oshalusi <[email protected]>
Co-authored-by: wklos-iohk <[email protected]>
  • Loading branch information
16 people authored Mar 6, 2024
1 parent 26e6e11 commit fc659cb
Show file tree
Hide file tree
Showing 253 changed files with 15,605 additions and 634 deletions.
5 changes: 4 additions & 1 deletion apps/browser-extension-wallet/.env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,25 @@ PRODUCTION_MODE_TRACKING=false
POSTHOG_DEV_TOKEN_MAINNET=phc_gH96Lx5lEVXTTWEyytSdTFPDk3Xsxwi4BqG88mKObd1
POSTHOG_DEV_TOKEN_PREPROD=phc_Xlmldm6EYSfQVgB9Uxm3b2xC1noDlgFFXpF9AJ6SMfJ
POSTHOG_DEV_TOKEN_PREVIEW=phc_e8SaOOWpXpNE59TnpLumeUjWm4iv024AWjhQqU406jr
POSTHOG_DEV_TOKEN_SANCHONET=phc_OUu6sPucDu5S6skRmYbWN5Jn8TpggWTQu1Y1ETkm3xt

# Cardano Services
CARDANO_SERVICES_URL_MAINNET=https://dev-mainnet.lw.iog.io
CARDANO_SERVICES_URL_PREPROD=https://dev-preprod.lw.iog.io
CARDANO_SERVICES_URL_PREVIEW=https://dev-preview.lw.iog.io
CARDANO_SERVICES_URL_SANCHONET=https://backend.dev-sanchonet.eks.lw.iog.io

# Explorer URLs
CEXPLORER_URL_MAINNET=https://cexplorer.io
CEXPLORER_URL_PREVIEW=https://preview.cexplorer.io
CEXPLORER_URL_PREPROD=https://preprod.cexplorer.io
CEXPLORER_URL_SANCHONET=https://sanchonet.cexplorer.io
CEXPLORER_URL_SANCHONET=https://sancho.cexplorer.io

# ADA Handle URLs
ADA_HANDLE_URL_MAINNET=https://api.handle.me
ADA_HANDLE_URL_PREVIEW=https://preview.api.handle.me
ADA_HANDLE_URL_PREPROD=https://preprod.api.handle.me
ADA_HANDLE_URL_SANCHONET=

# Manifest.json
LACE_EXTENSION_KEY=gafhhkghbfjjkeiendhlofajokpaflmk
Expand Down
3 changes: 2 additions & 1 deletion apps/browser-extension-wallet/.env.developerpreview
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ POSTHOG_DEV_TOKEN_PREVIEW=phc_e8SaOOWpXpNE59TnpLumeUjWm4iv024AWjhQqU406jr
CARDANO_SERVICES_URL_MAINNET=https://dev-mainnet.lw.iog.io
CARDANO_SERVICES_URL_PREPROD=https://dev-preprod.lw.iog.io
CARDANO_SERVICES_URL_PREVIEW=https://dev-preview.lw.iog.io
CARDANO_SERVICES_URL_SANCHONET=https://backend.dev-sanchonet.eks.lw.iog.io

# Explorer URLs
CEXPLORER_URL_MAINNET=https://cexplorer.io
CEXPLORER_URL_PREVIEW=https://preview.cexplorer.io
CEXPLORER_URL_PREPROD=https://preprod.cexplorer.io
CEXPLORER_URL_SANCHONET=https://sanchonet.cexplorer.io
CEXPLORER_URL_SANCHONET=https://sancho.cexplorer.io

# ADA Handle URLs
ADA_HANDLE_URL_MAINNET=https://api.handle.me
Expand Down
5 changes: 4 additions & 1 deletion apps/browser-extension-wallet/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,25 @@ POSTHOG_PRODUCTION_TOKEN_PREVIEW=production-preview-token
POSTHOG_DEV_TOKEN_MAINNET=dev-mainnet-token
POSTHOG_DEV_TOKEN_PREPROD=dev-preprod-token
POSTHOG_DEV_TOKEN_PREVIEW=dev-preview-token
POSTHOG_DEV_TOKEN_SANCHONET=dev-sanchonet-token

# Cardano Services
CARDANO_SERVICES_URL_MAINNET=https://backend.live-mainnet.eks.lw.iog.io
CARDANO_SERVICES_URL_PREPROD=https://backend.live-preprod.eks.lw.iog.io
CARDANO_SERVICES_URL_PREVIEW=https://backend.live-preview.eks.lw.iog.io
CARDANO_SERVICES_URL_SANCHONET=https://backend.dev-sanchonet.eks.lw.iog.io

# Explorer URLs
CEXPLORER_URL_MAINNET=https://cexplorer.io
CEXPLORER_URL_PREVIEW=https://preview.cexplorer.io
CEXPLORER_URL_PREPROD=https://preprod.cexplorer.io
CEXPLORER_URL_TESTNET=https://testnet.cexplorer.io
CEXPLORER_URL_SANCHONET=https://sancho.cexplorer.io

# ADA Handle URLs
ADA_HANDLE_URL_MAINNET=https://api.handle.me
ADA_HANDLE_URL_PREVIEW=https://preview.api.handle.me
ADA_HANDLE_URL_PREPROD=https://preprod.api.handle.me
ADA_HANDLE_URL_SANCHONET=

# Manifest.json
LACE_EXTENSION_KEY=gafhhkghbfjjkeiendhlofajokpaflmk
8 changes: 5 additions & 3 deletions apps/browser-extension-wallet/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const envChecks = (chosenChain: Wallet.ChainName): void => {
throw new Error('no available chains to connect to');
}

if (!process.env.AVAILABLE_CHAINS.includes('Mainnet')) {
if (!process.env.AVAILABLE_CHAINS.includes('Mainnet') && process.env.DEFAULT_CHAIN !== 'Sanchonet') {
throw new Error('mainnet chain not available in env');
}

Expand Down Expand Up @@ -78,12 +78,14 @@ export const config = (): Config => {
CARDANO_SERVICES_URLS: {
Mainnet: process.env.CARDANO_SERVICES_URL_MAINNET,
Preprod: process.env.CARDANO_SERVICES_URL_PREPROD,
Preview: process.env.CARDANO_SERVICES_URL_PREVIEW
Preview: process.env.CARDANO_SERVICES_URL_PREVIEW,
Sanchonet: process.env.CARDANO_SERVICES_URL_SANCHONET
},
CEXPLORER_BASE_URL: {
Mainnet: `${process.env.CEXPLORER_URL_MAINNET}`,
Preprod: `${process.env.CEXPLORER_URL_PREPROD}`,
Preview: `${process.env.CEXPLORER_URL_PREVIEW}`
Preview: `${process.env.CEXPLORER_URL_PREVIEW}`,
Sanchonet: `${process.env.CEXPLORER_URL_SANCHONET}`
},
CEXPLORER_URL_PATHS: {
Tx: 'tx',
Expand Down
5 changes: 4 additions & 1 deletion apps/browser-extension-wallet/src/dapp-connector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { CurrencyStoreProvider } from '@providers/currency';
import { DatabaseProvider, AxiosClientProvider, AppSettingsProvider, AnalyticsProvider } from '@providers';
import { HashRouter } from 'react-router-dom';
import { ThemeProvider } from '@providers/ThemeProvider';
import { UIThemeProvider } from '@providers/UIThemeProvider';
import { BackgroundServiceAPIProvider } from '@providers/BackgroundServiceAPI';
import { APP_MODE_POPUP } from './utils/constants';
import { PostHogClientProvider } from '@providers/PostHogClientProvider';
Expand All @@ -27,7 +28,9 @@ const App = (): React.ReactElement => (
<AnalyticsProvider>
<ThemeProvider>
<AddressesDiscoveryOverlay>
<DappConnectorView />
<UIThemeProvider>
<DappConnectorView />
</UIThemeProvider>
</AddressesDiscoveryOverlay>
</ThemeProvider>
</AnalyticsProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export type AddressRecordParams = Pick<AddressBookSchema, 'address' | 'name' | '
export const cardanoNetworkMap: { [key in Wallet.ChainName]: Wallet.Cardano.NetworkMagics } = {
Mainnet: Wallet.Cardano.NetworkMagics.Mainnet,
Preprod: Wallet.Cardano.NetworkMagics.Preprod,
Preview: Wallet.Cardano.NetworkMagics.Preview
Preview: Wallet.Cardano.NetworkMagics.Preview,
Sanchonet: Wallet.Cardano.NetworkMagics.Sanchonet
};

const handleRecordValidation = (list: AddressBookSchema[], record: AddressRecordParams) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React, { ReactNode, useCallback } from 'react';
import { Image } from 'antd';
import { useTranslation } from 'react-i18next';
import Empty from '../../../assets/icons/empty.svg';
import styles from './Layout.module.scss';
import { Button } from '@lace/common';

type DappErrorProps = {
title: string;
description: ReactNode;
closeButtonLabel?: string;
onCloseClick?: () => void;
containerTestId: string;
imageTestId: string;
titleTestId: string;
descriptionTestId: string;
closeButtonTestId: string;
};
export const DappError = ({
title,
description,
closeButtonLabel,
onCloseClick,
containerTestId,
imageTestId,
titleTestId,
descriptionTestId,
closeButtonTestId
}: DappErrorProps): React.ReactElement => {
const { t } = useTranslation();
const handleClose = useCallback(() => {
onCloseClick?.();
}, [onCloseClick]);

return (
<div data-testid={containerTestId} className={styles.dappErrorContainer}>
<div className={styles.dappErrorContent}>
<Image data-testid={imageTestId} preview={false} width={112} src={Empty} />
<div className={styles.heading} data-testid={titleTestId}>
{title}
</div>
<div className={styles.description} data-testid={descriptionTestId}>
{description}
</div>
</div>
<div className={styles.footer}>
<Button data-testid={closeButtonTestId} className={styles.footerBtn} onClick={handleClose}>
{closeButtonLabel || t('dapp.dappErrorPage.closeButton')}
</Button>
</div>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const DappTransactionFail = (): React.ReactElement => {
}, [analytics]);

return (
<div data-testid="dapp-sign-tx-fail" className={styles.noWalletContainer}>
<div className={styles.noWalletContent}>
<div data-testid="dapp-sign-tx-fail" className={styles.dappErrorContainer}>
<div className={styles.dappErrorContent}>
<Image data-testid="dapp-sign-tx-fail-image" preview={false} width={112} src={Fail} />
<div data-testid="dapp-sign-tx-fail-heading" className={styles.heading}>
{t('dapp.sign.failure.title')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export const DappTransactionSuccess = (): React.ReactElement => {
}, [analytics]);

return (
<div data-testid="dapp-sign-tx-success" className={styles.noWalletContainer}>
<div className={styles.noWalletContent}>
<div data-testid="dapp-sign-tx-success" className={styles.dappErrorContainer}>
<div className={styles.dappErrorContent}>
<Image data-testid="dapp-sign-tx-success-image" preview={false} width={112} src={Success} />
<div data-testid="dapp-sign-tx-success-heading" className={styles.heading}>
{t('browserView.transaction.success.youCanSafelyCloseThisPanel')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
padding-top: size_unit(4);
}

.noWalletContainer {
.dappErrorContainer {
align-items: center;
display: flex;
flex-direction: column;
height: 100%;
justify-content: space-between;
width: 100%;

.noWalletContent {
.dappErrorContent {
padding: 0 size_unit(3);
display: flex;
flex: 1;
Expand All @@ -45,7 +45,7 @@
.heading {
color: var(--text-color-secondary);
font-size: var(--bodyLarge);
font-weight: 800;
font-weight: 600;
letter-spacing: 0.02em;
line-height: size_unit(3);
margin-top: size_unit(2);
Expand All @@ -55,6 +55,7 @@
.description {
color: var(--text-color-secondary);
font-size: var(--bodySmall);
font-weight: 500;
letter-spacing: 0.02em;
line-height: size_unit(3);
margin-top: size_unit(2);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ export const CreateCollateral = ({
})}
<div>
{renderAmountInfo(
`${Wallet.util.lovelacesToAdaString(collateralTx.fee.toString())} ${cardanoCoin.symbol}`,
Wallet.util.getFormattedAmount({
amount: collateralTx.fee.toString(),
cardanoCoin
}),
`${Wallet.util.convertAdaToFiat({
ada: Wallet.util.lovelacesToAdaString(collateralTx.fee.toString()),
fiat: priceResult?.cardano?.price || 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ConfirmDRepRegistration } from '@lace/core';
import { certificateInspectorFactory, depositPaidWithSymbol, drepIDasBech32FromHash } from './utils';
import { Wallet } from '@lace/cardano';
import { useWalletStore } from '@src/stores';
import { useViewsFlowContext } from '@providers';
import { Skeleton } from 'antd';

const { CertificateType } = Wallet.Cardano;

export const ConfirmDRepRegistrationContainer = (): React.ReactElement => {
const { t } = useTranslation();
const {
walletUI: { cardanoCoin }
} = useWalletStore();
const {
signTxRequest: { request },
dappInfo
} = useViewsFlowContext();

const [certificate, setCertificate] = useState<Wallet.Cardano.RegisterDelegateRepresentativeCertificate>();

useEffect(() => {
const getCertificateData = async () => {
const txCertificate = await certificateInspectorFactory<Wallet.Cardano.RegisterDelegateRepresentativeCertificate>(
CertificateType.RegisterDelegateRepresentative
)(request?.transaction.toCore());
setCertificate(txCertificate);
};

getCertificateData();
}, [request]);

if (!certificate) {
return <Skeleton loading />;
}

const depositPaidWithCardanoSymbol = depositPaidWithSymbol(certificate.deposit, cardanoCoin);

// TODO: might be changed in scope of https://input-output.atlassian.net/browse/LW-9034
return (
<ConfirmDRepRegistration
dappInfo={dappInfo}
metadata={{
depositPaid: depositPaidWithCardanoSymbol,
drepId: drepIDasBech32FromHash(certificate.dRepCredential.hash),
hash: certificate.anchor?.dataHash,
url: certificate.anchor?.url
}}
translations={{
metadata: t('core.DRepRegistration.metadata'),
labels: {
depositPaid: t('core.DRepRegistration.depositPaid'),
drepId: t('core.DRepRegistration.drepId'),
hash: t('core.DRepRegistration.hash'),
url: t('core.DRepRegistration.url')
}
}}
/>
);
};
Loading

0 comments on commit fc659cb

Please sign in to comment.