Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanchonet Integration Branch #727

Merged
merged 90 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
d35778d
chore/Bump cardano-js-sdk (#559)
lgobbi-atix Oct 11, 2023
7914ecf
[LW-7983] [LW-7984] dRep confirmation screens (#554)
Oct 24, 2023
5b5d96b
feat(extension): [LW-7984] voting procedures (#655)
renanvalentin Oct 24, 2023
e5f30b6
[LW-8491] Voting delegation confirmation (#648)
Oct 24, 2023
fc0ba66
chore: modify sanchonet urls (#667)
mchappell Oct 25, 2023
a8918c8
feat: drep update certificate signing (#664)
Nov 1, 2023
e4641e1
fix(extension): updated padding and missing bech32 addressing
mchappell Nov 7, 2023
481b966
fix: no explorer for sanchonet
mchappell Nov 14, 2023
dbf9ded
chore(extension): add unit tests for dapp/confirm-tx (#743)
vetalcore Nov 23, 2023
56cdc4f
fix: update drep id casing
mchappell Nov 24, 2023
cab3760
fix: update title translations for cip95 popups
mchappell Nov 24, 2023
9b192a8
fix(extension): [LW-9163] nullish check on existence of stakeKeyDepos…
mchappell Nov 24, 2023
41bdb55
Merge branch 'main' into feat/sanchonet
mchappell Nov 24, 2023
93e6cbb
fix: e2e no unresolved imports
mchappell Nov 24, 2023
3c3aae7
chore(extension): resolve pr comments (#748)
vetalcore Nov 27, 2023
6de1ebe
fix(extension): translation keys casing and unit tests (#756)
przemyslaw-wlodek Nov 28, 2023
fcc660f
chore(all): exclude stories and tests from the rollup builds (#752)
przemyslaw-wlodek Nov 28, 2023
5b81b19
Chore/update for sdk conway era (#734)
mirceahasegan Nov 29, 2023
049fd31
Revert "Chore/update for sdk conway era (#734)" (#767)
przemyslaw-wlodek Nov 30, 2023
595aafe
test(extension): add test ids for governance actions (#765)
wklos-iohk Nov 30, 2023
1bc62f0
Merge main into feat/sanchonet (#763)
przemyslaw-wlodek Dec 1, 2023
f95077f
Merge remote-tracking branch 'origin/main' into feat/sanchonet
przemyslaw-wlodek Dec 1, 2023
c2ad8b4
feat(extension): add drep retirement id mismatch modal (#758)
przemyslaw-wlodek Dec 7, 2023
e42bf90
Merge branch 'main' into feat/sanchonet
mchappell Dec 9, 2023
bc0cf3b
chore: update cardano-sdk packages
mchappell Nov 29, 2023
658ebe8
refactor: update lace based on cardano-sdk breaking changes
mchappell Nov 29, 2023
0e385a4
fix: typos in translation
mchappell Dec 9, 2023
394dcf8
feat: stake and vote confirmation screens (#683)
Dec 11, 2023
a7e84ad
[LW-8490] Governance Actions (#670)
renanvalentin Dec 14, 2023
8b26339
Merge branch 'main' into feat/sanchonet
mchappell Jan 3, 2024
ac642a1
Merge branch 'main' into feat/sanchonet
mchappell Jan 16, 2024
8bbdbfc
fix(extension): resolve pr comments
vetalcore Jan 22, 2024
b110052
fix(extension): remove code duplications for metadata and metadata li…
vetalcore Jan 24, 2024
8f8b6e3
feat(extension): lw-8600 (#819)
vetalcore Jan 24, 2024
7d00230
Merge branch 'main' into feat/sanchonet
mchappell Jan 29, 2024
6c44737
Merge branch 'main' into feat/sanchonet
mchappell Jan 30, 2024
73bd8a2
refactor: remove need to target dev endpoints in CI
mchappell Jan 30, 2024
b2e8fa2
refactor: remove sanchonet as default network option
mchappell Jan 31, 2024
40a1625
refactor: remove sanchonet explorer check
mchappell Jan 31, 2024
eecbe1d
feat(extension): update drep mapper check
mchappell Jan 31, 2024
c9b69a1
fix(extension): conway-era tx activities line items (#860)
vetalcore Jan 31, 2024
610107e
feat(extension): update drep mapper check
mchappell Jan 31, 2024
8bae01f
Merge branch 'feat/sanchonet' of https://github.com/input-output-hk/l…
mchappell Jan 31, 2024
8032c9a
fix(extension): convert drepid and stakekeyhash to bech32, fix transl…
vetalcore Jan 31, 2024
169b125
fix(extension): lw-9688: unable to see transaction details for conway…
vetalcore Jan 31, 2024
46171d9
fix(extension): resolve lw-9621 pe comments
vetalcore Feb 1, 2024
eb63035
fix(extension): resolve lw-9621 pr comments
vetalcore Feb 1, 2024
26e7199
fix(extension): lw-9621 add storybook showing all conway era governan…
vetalcore Feb 2, 2024
f624a9d
chore(core): fix storybook build
przemyslaw-wlodek Feb 5, 2024
1564869
fix: use correct stake address bech32
mchappell Feb 6, 2024
df46845
fix(core): sanchonet-related storybook errors [LW-9721] (#880)
przemyslaw-wlodek Feb 7, 2024
04966cc
refactor: rename useCexplorerBaseUrl typo
mchappell Feb 8, 2024
6767c85
Merge branch 'feat/sanchonet' of https://github.com/input-output-hk/l…
mchappell Feb 8, 2024
5716562
fix: add storybook back for core package
mchappell Feb 8, 2024
8ae22a2
feat: update stories for conway-era tx activity history
mchappell Feb 8, 2024
a086b77
fix: add retry fallback for matching last active tab based on non-sta…
mchappell Feb 8, 2024
b7cc3eb
Merge branch 'main' into feat/sanchonet
mchappell Feb 12, 2024
e728967
chore: update dev preview env file
mchappell Feb 12, 2024
954fc2b
Merge branch 'main' into feat/sanchonet
mchappell Feb 20, 2024
de50216
feat(extension): update conway era tx details to the latest figma (#868)
vetalcore Feb 26, 2024
9a3622b
Merge branch 'main' into feat/sanchonet
mchappell Feb 27, 2024
5a2d1f7
chore(core): mock @lace/cardano for storybook
przemyslaw-wlodek Feb 27, 2024
3769e20
fix(extension): fix tests
vetalcore Feb 27, 2024
bf8c53d
Merge branch 'main' into feat/sanchonet
mchappell Feb 27, 2024
e35d6d2
chore: downgrade uuid package to same used by pouchdb
mchappell Feb 27, 2024
7177189
refactor: remove unintended config changes
mchappell Feb 28, 2024
d709213
Merge branch 'main' into feat/sanchonet
mchappell Feb 28, 2024
5a4dd1a
fix: no wallet dapp test
mchappell Feb 28, 2024
c3617f4
fix(extension): resolve lw-9622 sdet comments
vetalcore Feb 29, 2024
5a9b0d3
Merge branch 'main' into feat/sanchonet
mchappell Feb 29, 2024
f50c169
Merge branch 'main' into feat/sanchonet
mchappell Feb 29, 2024
d5a3e4f
feat(extension): update conway era history line items
mchappell Mar 1, 2024
09c2bd5
Merge branch 'main' into feat/sanchonet
mchappell Mar 1, 2024
2a340fb
fix(extension): make anchor url clickable
vetalcore Mar 1, 2024
5746ee3
fix(extension): resolve pr comments
vetalcore Mar 1, 2024
14d7f74
fix: lw-8940 casing in reward account
mchappell Mar 4, 2024
ebb79b2
Merge branch 'feat/sanchonet' of https://github.com/input-output-hk/l…
mchappell Mar 4, 2024
554baf6
feat(extension): update sign with hw
mchappell Mar 4, 2024
b725680
chore: reword stakeVoteDelegation title
mchappell Mar 4, 2024
3cfda85
feat(extension): handle requests from non registered users (#935)
vetalcore Mar 4, 2024
83af2e5
fix(extension): fix labels
wklos-iohk Mar 4, 2024
2353b30
refactor: rename proprosal procedure call
mchappell Mar 5, 2024
4474dd6
Merge branch 'feat/sanchonet' of https://github.com/input-output-hk/l…
mchappell Mar 5, 2024
70b3e95
Merge branch 'main' into feat/sanchonet
mchappell Mar 5, 2024
895e221
fix: broken hook test
mchappell Mar 5, 2024
e9d9270
feat: revert useTxSummary hook
mchappell Mar 5, 2024
f12c4cb
Merge branch 'main' into feat/sanchonet
mchappell Mar 5, 2024
3605010
feat(extension): fix test
vetalcore Mar 5, 2024
c21f964
refactor: revert story change
mchappell Mar 6, 2024
7100e40
Merge branch 'main' into feat/sanchonet
mchappell Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 (
vetalcore marked this conversation as resolved.
Show resolved Hide resolved
<ConfirmDRepRegistration
dappInfo={dappInfo}
metadata={{
depositPaid: depositPaidWithCardanoSymbol,
drepId: drepIDasBech32FromHash(certificate.dRepCredential.hash),
vetalcore marked this conversation as resolved.
Show resolved Hide resolved
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
Loading