Skip to content

Commit

Permalink
Merge branch 'develop' into nico/changelly
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas committed Feb 21, 2021
2 parents 55c2a6d + cfd8ee6 commit c85b282
Show file tree
Hide file tree
Showing 31 changed files with 4,862 additions and 3,248 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
v12.16.1
v14.15.5
3 changes: 2 additions & 1 deletion app/api/ada/transactions/shelley/transactions.js
Expand Up @@ -117,7 +117,7 @@ function addUtxoInput(
const txInput = utxoToTxInput(input);
const wasmAmount = cardanoValueFromRemoteFormat(input);

const skipInput = () => {
const skipInput: void => boolean = () => {
if (remaining == null) return false;

const defaultEntry = {
Expand Down Expand Up @@ -160,6 +160,7 @@ function addUtxoInput(
return true;
}
}
return false;
}
if (skipInput()) { return false; }

Expand Down
2 changes: 1 addition & 1 deletion app/components/topbar/BuySellAdaButton.js
Expand Up @@ -28,7 +28,7 @@ export default class BuySellAdaButton extends Component<Props> {
return (
<Button
label={intl.formatMessage(globalMessages.buySellAda)}
className={classnames([styles.button, 'primary'])}
className={classnames([styles.button, 'secondary'])}
onClick={() => this.props.onBuySellClick()}
skin={ButtonSkin}
/>
Expand Down
3 changes: 1 addition & 2 deletions app/components/topbar/NavBarAddButton.js
Expand Up @@ -6,7 +6,6 @@ import { intlShape, } from 'react-intl';
import styles from './NavBarAddButton.scss';
import globalMessages from '../../i18n/global-messages';
import type { $npm$ReactIntl$IntlFormat } from 'react-intl';
import classnames from 'classnames';
import { Button } from 'react-polymorph/lib/components/Button';
import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin';

Expand All @@ -30,7 +29,7 @@ export default class NavBarAddButton extends Component<Props> {

return (
<Button
className={classnames([styles.button, 'secondary'])}
className={styles.button}
onClick={() => onClick()}
label={intl.formatMessage(globalMessages.addWalletLabel)}
skin={ButtonSkin}
Expand Down
8 changes: 6 additions & 2 deletions app/components/wallet/voting/GeneratePinDialog.js
Expand Up @@ -23,6 +23,10 @@ const messages = defineMessages({
id: 'wallet.voting.dialog.step.pin.line1',
defaultMessage: '!!!Please write down this PIN as you will need it <strong>every time</strong> you want to access the Catalyst Voting app.',
},
actionButton: {
id: 'wallet.voting.dialog.step.pin.actionButton',
defaultMessage: '!!!Confirm that I wrote down the PIN',
},
});

type Props = {|
Expand All @@ -46,7 +50,7 @@ export default class GeneratePinDialog extends Component<Props> {

const dialogActions = [
{
label: intl.formatMessage(globalMessages.nextButtonLabel),
label: intl.formatMessage(messages.actionButton),
primary: true,
onClick: next,
},
Expand All @@ -73,7 +77,7 @@ export default class GeneratePinDialog extends Component<Props> {
>
<ProgressStepBlock progressInfo={progressInfo} classicTheme={classicTheme} />

<div className={classnames([styles.lineText, styles.firstItem])}>
<div className={classnames([styles.lineText, styles.firstItem, styles.importantText])}>
<FormattedHTMLMessage {...messages.line1} />
</div>
{pinCards}
Expand Down
12 changes: 8 additions & 4 deletions app/components/wallet/voting/QrCodeDialog.js
Expand Up @@ -27,6 +27,10 @@ const messages = defineMessages({
id: 'wallet.voting.dialog.step.qr.line3',
defaultMessage: '!!!Also we suggest to take a screenshot of it as a backup — you won’t be able to access this QR code after clicking Complete.',
},
actionButton: {
id: 'wallet.voting.dialog.step.qr.actionButton',
defaultMessage: '!!!Confirm that I saved the QR code'
}
});

type Props = {|
Expand All @@ -48,9 +52,9 @@ export default class QrCodeDialog extends Component<Props> {
const { intl } = this.context;
const { progressInfo, submit, cancel, classicTheme, votingKey } = this.props;

const dailogActions = [
const dialogActions = [
{
label: intl.formatMessage(globalMessages.completeLabel),
label: intl.formatMessage(messages.actionButton),
primary: true,
onClick: submit,
},
Expand All @@ -60,7 +64,7 @@ export default class QrCodeDialog extends Component<Props> {
<Dialog
className={classnames([styles.dialog])}
title={intl.formatMessage(globalMessages.votingRegistrationTitle)}
actions={dailogActions}
actions={dialogActions}
closeOnOverlayClick={false}
closeButton={<DialogCloseButton />}
onClose={cancel}
Expand All @@ -75,7 +79,7 @@ export default class QrCodeDialog extends Component<Props> {
{intl.formatMessage(messages.line2)}
</div>

<div className={styles.lineBold}>
<div className={classnames([styles.lineBold, styles.importantText])}>
{intl.formatMessage(messages.line3)}
</div>

Expand Down
4 changes: 4 additions & 0 deletions app/components/wallet/voting/common.scss
Expand Up @@ -15,6 +15,10 @@ $opacityCommon: 0.7;
font-size: 14px;
}

.importantText {
color: #ff1351 !important;
}

.lastItem {
margin-top: 32px;
margin-bottom: 34px !important;
Expand Down
1 change: 0 additions & 1 deletion app/containers/wallet/staking/StakingDashboardPage.js
Expand Up @@ -31,7 +31,6 @@ import type { PoolTuples, ReputationObject } from '../../../api/jormungandr/lib/
import type { PoolMeta, DelegationRequests } from '../../../stores/toplevel/DelegationStore';
import type { AdaDelegationRequests } from '../../../stores/ada/AdaDelegationStore';
import EpochProgressContainer from './EpochProgressContainer';
import type { GeneratedData as EpochProgressContainerData } from './EpochProgressContainer';
import { PublicDeriver } from '../../../api/ada/lib/storage/models/PublicDeriver/index';
import { calculateAndFormatValue } from '../../../utils/unit-of-account';
import type { $npm$ReactIntl$IntlFormat } from 'react-intl';
Expand Down
4 changes: 3 additions & 1 deletion app/i18n/locales/en-US.json
Expand Up @@ -47,7 +47,7 @@
"app.errors.unableToLoad": "Unable to load!",
"app.errors.unexpectedError": "Something unexpected happened. Please retry.",
"app.errors.unknowError": "Unknown error.",
"button.buySellAda": "Buy/Sell ADA",
"button.buySellAda": "Buy / Sell ADA",
"buysell.dialog.instructions": "Please select your preferences. On the next screen, confirm your selection by pressing the green arrow on the top right",
"buysell.dialog.manual": "I will add my address manually",
"buysell.dialog.selectAddress": "Please select the receiving address. This will be shared with the third party provider called Changelly for the buy / sell of ADA. ",
Expand Down Expand Up @@ -745,7 +745,9 @@
"wallet.voting.dialog.confirmPin": "Confirm PIN",
"wallet.voting.dialog.registerLabel": "Register",
"wallet.voting.dialog.step.confirm.line1": "Please enter the PIN as you will need it <strong>every time</strong> you want to access the Catalyst Voting app.",
"wallet.voting.dialog.step.pin.actionButton": "!!!Confirm that I wrote down the PIN",
"wallet.voting.dialog.step.pin.line1": "Please write down this PIN as you will need it <strong>every time</strong> you want to access the Catalyst Voting app.",
"wallet.voting.dialog.step.qr.actionButton": "!!!Confirm that I saved the QR code",
"wallet.voting.dialog.step.qr.line2": "The following QR code is the generated certificate required by the Catalyst App to be able to participate in the voting process of Cardano.",
"wallet.voting.dialog.step.qr.line3": "Also we suggest to take a screenshot of it as a backup — you won’t be able to access this QR code after clicking Complete.",
"wallet.voting.dialog.step.qr.lineTitle": "Use the Catalyst Voting App to scan the QR code",
Expand Down
1 change: 0 additions & 1 deletion app/stores/stateless/topbarCategories.js
Expand Up @@ -97,7 +97,6 @@ export const VOTING: TopbarCategory = registerCategory({
label: messages.voting,
isVisible: request => (
asGetStakingKey(request.selected) != null
&& (!environment.isProduction() || environment.isTest())
),
});
export const SEIZA_STAKE_SIMULATOR: TopbarCategory = registerCategory({
Expand Down
6 changes: 3 additions & 3 deletions app/stores/toplevel/ProfileStore.js
Expand Up @@ -658,12 +658,12 @@ export const getVarsForTheme: ({|

export function getPaperWalletIntro(currentLocale: string, defaultLocale: string): string {
try {
return require(`../../i18n/locales/paper-wallets/intro/${currentLocale}.md`);
return require(`../../i18n/locales/paper-wallets/intro/${currentLocale}.md`).default;
} catch {
return require(`../../i18n/locales/paper-wallets/intro/${defaultLocale}.md`);
return require(`../../i18n/locales/paper-wallets/intro/${defaultLocale}.md`).default;
}
}

export function getTermsOfUse(api: 'ada', currentLocale: string): string {
return require(`../../i18n/locales/terms-of-use/${api}/${currentLocale}.md`);
return require(`../../i18n/locales/terms-of-use/${api}/${currentLocale}.md`).default;
}
1 change: 0 additions & 1 deletion babel.config.js
Expand Up @@ -39,7 +39,6 @@ module.exports = function (api /*: ApiType */) /*: * */ {
plugins: [
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-numeric-separator',
'nameof-js',
[
'@babel/plugin-proposal-decorators',
Expand Down
3 changes: 2 additions & 1 deletion chrome/manifest.development.js
Expand Up @@ -10,6 +10,7 @@ import {
} from '../scripts/connections';
import { version } from '../package.json';
import { CHANGELLY_URL, POOLS_UI_URL_FOR_YOROI } from './manifestEnvs'
import pkg from '../package.json';

export default (isDebug: boolean): * => buildManifest({
description: '[dev] Cardano ADA wallet',
Expand All @@ -26,7 +27,7 @@ export default (isDebug: boolean): * => buildManifest({
],
},
}),
version,
version: pkg.version,
extensionKey: 'pojejnpjgcacmnpkdiklhlnlbkjechfh',
geckoKey: '{530f7c6c-6077-4703-8f71-cb368c663e35}',
enableProtocolHandlers: true,
Expand Down
4 changes: 2 additions & 2 deletions chrome/manifest.mainnet.js
Expand Up @@ -8,7 +8,7 @@ import {
Servers,
serverToPermission,
} from '../scripts/connections';
import { version } from '../package.json';
import pkg from '../package.json';

import { POOLS_UI_URL_FOR_YOROI, CHANGELLY_URL } from './manifestEnvs';

Expand All @@ -28,7 +28,7 @@ export default (isDebug: boolean): * => buildManifest({
],
},
}),
version,
version: pkg.version,
geckoKey: '{530f7c6c-6077-4703-8f71-cb368c663e35}',
enableProtocolHandlers: true,
});
4 changes: 2 additions & 2 deletions chrome/manifest.shelley-testnet.js
Expand Up @@ -8,7 +8,7 @@ import {
Servers,
serverToPermission,
} from '../scripts/connections';
import { version } from '../package.json';
import pkg from '../package.json';
import { SEIZA_URL, POOLS_UI_URL_FOR_YOROI } from './manifestEnvs';

export default (isDebug: boolean): * => buildManifest({
Expand All @@ -34,7 +34,7 @@ export default (isDebug: boolean): * => buildManifest({
'128': 'img/shelley-128.png',
/* eslint-enable quote-props */
},
version,
version: pkg.version,
geckoKey: '{842ae5af-a7ff-4e99-afb6-bd6c4043bcfa}',
enableProtocolHandlers: false,
});
4 changes: 2 additions & 2 deletions chrome/manifest.storybook.js
Expand Up @@ -4,7 +4,7 @@ import buildManifest from './manifest.template';
import {
genCSP,
} from './constants';
import { version } from '../package.json';
import pkg from '../package.json';

export default (): * => buildManifest({
description: 'A simple, secure and fast Cardano ADA wallet.',
Expand All @@ -22,7 +22,7 @@ export default (): * => buildManifest({
'128': 'img/shelley-128.png',
/* eslint-enable quote-props */
},
version,
version: pkg.version,
geckoKey: '{842ae5af-a7ff-4e99-afb6-bd6c4043bcfa}',
enableProtocolHandlers: false,
});
4 changes: 2 additions & 2 deletions chrome/manifest.test.js
Expand Up @@ -9,7 +9,7 @@ import {
import {
genCSP,
} from './constants';
import { version } from '../package.json';
import pkg from '../package.json';

export default (isDebug: boolean): * => buildManifest({
description: '[localhost] Cardano ADA wallet',
Expand All @@ -25,7 +25,7 @@ export default (isDebug: boolean): * => buildManifest({
],
},
}),
version,
version: pkg.version,
geckoKey: '{530f7c6c-6077-4703-8f71-cb368c663e35}',
enableProtocolHandlers: false,
});
2 changes: 1 addition & 1 deletion features/mock-ledger-connect/index.js
Expand Up @@ -246,7 +246,7 @@ class MockLedgerConnect {
RustModule.WalletV4.BigNum.from_str(output.amountStr)
);
const multiasset = RustModule.WalletV4.MultiAsset.new();
for (const assetGroup of output.tokenBundle) {
for (const assetGroup of (output.tokenBundle ?? [])) {
const scriptHash = RustModule.WalletV4.ScriptHash.from_bytes(Buffer.from(assetGroup.policyIdHex, 'hex'));

const assets = RustModule.WalletV4.Assets.new();
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/voting-steps.js
@@ -1,6 +1,6 @@
// @flow

import { Given, When, Then } from 'cucumber';
import { When, Then } from 'cucumber';
import { By, Key } from 'selenium-webdriver';
import i18n from '../support/helpers/i18n-helpers';

Expand Down
2 changes: 1 addition & 1 deletion flow-typed/crypto-random-string.js
Expand Up @@ -50,7 +50,7 @@ interface CharactersOption {

type Options = BaseOptions & (TypeOption | CharactersOption);

declare function cryptoRandomString(options?: Options): string;
declare function cryptoRandomString(options: Options): string;

declare module 'crypto-random-string' {
declare module.exports: typeof cryptoRandomString;
Expand Down
@@ -1,6 +1,3 @@
// flow-typed signature: fe7f00984c44d69833f19bc39895832f
// flow-typed version: a4cc3d5e98/axios_v0.19.x/flow_>=v0.104.x

declare module 'axios' {
import type { Agent as HttpAgent } from 'http';
import type { Agent as HttpsAgent } from 'https';
Expand Down Expand Up @@ -208,7 +205,7 @@ declare module 'axios' {
Cancel: typeof Cancel;
CancelToken: typeof CancelToken;
isCancel(value: mixed): boolean;
create(config?: AxiosXHRConfigBase<T, R>): Axios;
create<T, R>(config?: AxiosXHRConfigBase<T, R>): Axios;
all: typeof Promise.all;
spread<T, R>(callback: (...args: T) => R): (array: T) => R;
}
Expand All @@ -222,4 +219,4 @@ declare module 'axios' {
declare type $AxiosError<T, R = T> = AxiosError<T, R>;

declare module.exports: AxiosExport;
}
}
6 changes: 6 additions & 0 deletions flow-typed/npm/bech32_v1.1.x.js
@@ -1,3 +1,9 @@

type ArrayLike<T> = {
[indexer: number]: T,
length: number,
...
}
declare module "bech32" {
/**
* Takes a bech32 encoded string and returns the human readable part ("prefix") and
Expand Down
2 changes: 1 addition & 1 deletion flow-typed/npm/dropbox_vx.x.x.js
Expand Up @@ -29160,7 +29160,7 @@ declare module 'dropbox' {


declare class Dropbox {
constructor(options: DropboxOptions): void;
constructor(options: DropboxTypes$DropboxOptions): void;

authTokenRevoke(arg: void): Promise<void>;

Expand Down

0 comments on commit c85b282

Please sign in to comment.