From b38b708c923fb98fe573ecbcd81500b3185a932c Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 15:51:40 +0200 Subject: [PATCH 001/204] Changes from previous branch --- CHANGELOG.md | 1 + .../addresses/components/AddressesTab.tsx | 21 +++- .../routes/addresses/components/Starnames.tsx | 31 ++++++ .../addresses/components/StarnamesExists.tsx | 8 ++ .../components/StarnamesNotExists.tsx | 100 ++++++++++++++++++ .../src/routes/addresses/index.stories.tsx | 6 ++ .../src/routes/addresses/index.tsx | 8 +- packages/bierzo-wallet/src/routes/index.tsx | 3 + packages/bierzo-wallet/src/routes/paths.ts | 1 + .../src/routes/registerStarName/index.tsx | 34 ++++++ 10 files changed, 209 insertions(+), 4 deletions(-) create mode 100644 packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx create mode 100644 packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx create mode 100644 packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx create mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index e09339a43..e6ceb0d74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Wallet: Correctly displays transaction of type Update Username Targets - Wallet: Adds number of fractional digits to the validation of a payment - Wallet: Makes editing addresses of a username more reliable +- Wallet: Adds wip starnames tab and updates stories - Wallet: Adds support for Terra Money, Cosmos Hub, IrisNet, kava, Bitcoin, and Litecoin addresses - Extension: Improve UI - Extension: Adds network status and correct url to Networks view diff --git a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx index e9faa79bb..6c04b59f0 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx @@ -5,8 +5,10 @@ import React from "react"; import { AddressesTableProps } from "../../../components/AddressesTable"; import Iovnames, { IovnamesProps } from "./Iovnames"; +import Starnames, { StarnamesProps } from "./Starnames"; import UserAddresses from "./UserAddresses"; +export const yourStarnames = "Your starnames"; export const yourIovnames = "Your iovnames"; export const yourAddresses = "Your blockchain addresses"; @@ -55,17 +57,23 @@ function TabItem({ children, selected, onChangeTab }: TabItemProps): JSX.Element function AddressesTab({ chainAddresses, usernames, + starnames, onRegisterUsername, + onRegisterStarname, rpcEndpointType, -}: AddressesTableProps & IovnamesProps): JSX.Element { - const [selectedTab, setSelectedTab] = React.useState<"iovnames" | "addresses">("iovnames"); +}: AddressesTableProps & IovnamesProps & StarnamesProps): JSX.Element { + const [selectedTab, setSelectedTab] = React.useState<"starnames" | "iovnames" | "addresses">("starnames"); - const changeTabToAddresses = (): void => setSelectedTab("addresses"); + const changeTabToStarnames = (): void => setSelectedTab("starnames"); const changeTabToIovnames = (): void => setSelectedTab("iovnames"); + const changeTabToAddresses = (): void => setSelectedTab("addresses"); return ( + + {yourStarnames} + {yourIovnames} @@ -73,6 +81,13 @@ function AddressesTab({ {yourAddresses} + {selectedTab === "starnames" && ( + + )} {selectedTab === "iovnames" && ( void; + readonly rpcEndpointType: RpcEndpointType; +} + +const Starnames = ({ starnames, rpcEndpointType, onRegisterStarname }: StarnamesProps): JSX.Element => { + const hasStarnames = starnames.length > 0; + + return ( + + + {!hasStarnames && ( + + )} + {hasStarnames && } + + ); +}; + +export default Starnames; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx new file mode 100644 index 000000000..ba9a0554e --- /dev/null +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -0,0 +1,8 @@ +import { Typography } from "medulas-react-components"; +import React from "react"; + +function StarnamesExists(): JSX.Element { + return There are some starnames. Work in progress view; +} + +export default StarnamesExists; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx new file mode 100644 index 000000000..e0cfa4cbe --- /dev/null +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx @@ -0,0 +1,100 @@ +import { Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, Typography } from "medulas-react-components"; +import React from "react"; + +import { RpcEndpointType } from "../../../communication/rpcEndpoint"; +import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; +import { NoStarnameHeader } from "../../registerStarName"; + +interface StarnamesNotExistsProps { + readonly onRegisterStarname: () => void; + readonly rpcEndpointType: RpcEndpointType; +} + +export function GetYourAddressWithExtension({ + onRegisterStarname, +}: Omit): JSX.Element { + return ( + + + + + Register your starname + + + A starname is your universal username for the blockchain world. It enables you to receive + crypto-currencies or to log in to blockchain applications in a seamless way. Transferring value + becomes fast an easy. + + + + Register Now + + + ); +} + +export function GetYourAddressWithLedger(): JSX.Element { + return ( + + + + + You can not register + + + starname + + + + using{" "} + + + Ledger Nano S + + + + ); +} + +export function GetYourAddress({ + rpcEndpointType, + onRegisterStarname, +}: StarnamesNotExistsProps): JSX.Element { + switch (rpcEndpointType) { + case "extension": + return ; + case "ledger": + return ; + } +} + +function StarnamesNotExists({ onRegisterStarname, rpcEndpointType }: StarnamesNotExistsProps): JSX.Element { + const theme = useTheme(); + + return ( + + + + ); +} + +export default StarnamesNotExists; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index fce1cfce4..469300def 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -54,7 +54,9 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} rpcEndpointType="extension" /> @@ -64,7 +66,9 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} rpcEndpointType="extension" /> @@ -74,7 +78,9 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} rpcEndpointType="ledger" /> diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index dbd0d9319..dba7a2738 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -9,7 +9,7 @@ import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { BwUsername } from "../../store/usernames"; import { getChainAddressPairWithNames } from "../../utils/tokens"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../paths"; +import { REGISTER_PERSONALIZED_ADDRESS_ROUTE, REGISTER_STARNAME } from "../paths"; import AddressesTab from "./components/AddressesTab"; export interface BwUsernameWithChainName extends BwUsername { @@ -20,6 +20,10 @@ function onRegisterUsername(): void { history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE); } +function onRegisterStarname(): void { + history.push(REGISTER_STARNAME); +} + const Addresses = (): JSX.Element => { const bwNames = ReactRedux.useSelector((state: RootState) => state.usernames); const [bwNamesWithChain, setBwNamesWithChain] = useState([]); @@ -74,7 +78,9 @@ const Addresses = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index d7755e767..bf78262b7 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -13,12 +13,14 @@ import { PAYMENT_ROUTE, POLICY_ROUTE, REGISTER_PERSONALIZED_ADDRESS_ROUTE, + REGISTER_STARNAME, TERMS_ROUTE, TRANSACTIONS_ROUTE, } from "./paths"; import Payment from "./payment"; import Policy from "./policy"; import RegisterUsername from "./registerName"; +import RegisterStarname from "./registerStarName"; import Terms from "./terms"; import Transactions from "./transactions"; @@ -35,6 +37,7 @@ const Routes = (): JSX.Element => ( + diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index af151a503..1fd438d1f 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -5,5 +5,6 @@ export const BALANCE_ROUTE = "/balance"; export const CONFIRM_TRANSACTION_ROUTE = "/confirm-transaction"; export const ADDRESSES_ROUTE = "/addresses"; export const REGISTER_PERSONALIZED_ADDRESS_ROUTE = "/register-personalized-address"; +export const REGISTER_STARNAME = "/register-starname"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx new file mode 100644 index 000000000..db8da3f36 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx @@ -0,0 +1,34 @@ +import { Block, makeStyles, Typography } from "medulas-react-components"; +import React from "react"; + +import PageMenu from "../../components/PageMenu"; + +const useStyles = makeStyles({ + usernameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +// TODO move to components when implemented, mirroring registerName +export function NoStarnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + *yourstarname + + + ); +} + +const RegisterStarname = (): JSX.Element => { + return ( + + + Register new starname. Work in progress view + + + ); +}; + +export default RegisterStarname; From db9c7308822361288bfec223416e84a2d8359c12 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 16:22:52 +0200 Subject: [PATCH 002/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 601 +++--------------- 1 file changed, 83 insertions(+), 518 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 99ddb8017..460995a52 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -2442,6 +2442,23 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with extension 1`] = `
+
+ Your starnames +
+
+
+
+
+
- yourname*iov + *yourstarname
- You have no starnames + Register your starname

- With Neuma you can choose your easy to read human readable address. No more complicated cryptography when sending to friends. + A starname is your universal username for the blockchain world. It enables you to receive crypto-currencies or to log in to blockchain applications in a seamless way. Transferring value becomes fast an easy.

- Choose Now + Register Now
@@ -2535,6 +2552,23 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with ledger 1`] = `
+
+ Your starnames +
+
+
+
+
+
- yourname*iov + *yourstarname
- personalized address + starname

+
+ Your starnames +
+
+
+
+
+
-

- + Create new iovname -

-
-

- test1*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - -
- Blockchain - - Address - -
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
+ *yourstarname +
-
-
-
-
+
-
-

- test2*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - - - - - - -
- Blockchain - - Address - -
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
- Lisk Devnet - - 1349293588603668134L - -
- Copy -
-
-
-
-
-
-
+ Register your starname +
+

+ A starname is your universal username for the blockchain world. It enables you to receive crypto-currencies or to log in to blockchain applications in a seamless way. Transferring value becomes fast an easy. +

+
-
-

- test3*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- Blockchain - - Address - -
- Ganache - - 0xD383382350F9f190Bd2608D6381B15b4e1cec0f3 - -
- Copy -
-
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
- Lisk Devnet - - 1349293588603668134L - -
- Copy -
-
-
+ Register Now +
From dfb284cd7b36d19ee5b722605c37d56ca17fa198 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 17:22:01 +0200 Subject: [PATCH 003/204] Restore after revert --- .../src/communication/requestgenerators.ts | 125 ++++++- packages/bierzo-wallet/src/logic/account.ts | 55 ++- .../addresses/components/IovnamesExists.tsx | 8 +- .../components/IovnamesNotExists.tsx | 12 +- .../components/StarnamesNotExists.tsx | 22 +- .../src/routes/addresses/index.stories.tsx | 2 +- .../src/routes/addresses/index.tsx | 6 +- .../addresses/test/travelToReceivePayment.ts | 4 +- .../src/routes/balance/index.stories.tsx | 2 +- .../src/routes/balance/index.tsx | 4 +- .../routes/balance/test/operateBalances.ts | 8 +- packages/bierzo-wallet/src/routes/index.tsx | 17 +- packages/bierzo-wallet/src/routes/paths.ts | 5 +- .../components/ReceiverAddress/index.tsx | 4 +- .../src/routes/payment/index.tsx | 4 +- .../assets/shield.svg | 0 .../components/ConfirmRegistration.tsx | 6 +- .../register/components/IovnameForm.tsx | 322 +++++++++++++++++ .../routes/register/components/NameForm.tsx | 325 ++++++++++++++++++ .../components/SelectAddressesTable.tsx | 0 .../register/components/StarnameForm.tsx | 237 +++++++++++++ .../index.stories.tsx | 69 +--- .../src/routes/register/index.tsx | 264 ++++++++++++++ .../background/model/persona/index.ts | 27 +- .../ShowTx/ReqRegisterAccountTx.tsx | 38 ++ .../ShowTx/ReqRegisterDomainTx.tsx | 31 ++ .../ShowTx/ReqReplaceAccountTargetsTx.tsx | 43 +++ .../SignAndPostTx/ShowTx/index.tsx | 19 +- .../dashboard/components/ProposalsList.tsx | 28 +- 29 files changed, 1560 insertions(+), 127 deletions(-) rename packages/bierzo-wallet/src/routes/{registerName => register}/assets/shield.svg (100%) rename packages/bierzo-wallet/src/routes/{registerName => register}/components/ConfirmRegistration.tsx (90%) create mode 100644 packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx create mode 100644 packages/bierzo-wallet/src/routes/register/components/NameForm.tsx rename packages/bierzo-wallet/src/routes/{registerName => register}/components/SelectAddressesTable.tsx (100%) create mode 100644 packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx rename packages/bierzo-wallet/src/routes/{registerName => register}/index.stories.tsx (50%) create mode 100644 packages/bierzo-wallet/src/routes/register/index.tsx create mode 100644 packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterAccountTx.tsx create mode 100644 packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterDomainTx.tsx create mode 100644 packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqReplaceAccountTargetsTx.tsx diff --git a/packages/bierzo-wallet/src/communication/requestgenerators.ts b/packages/bierzo-wallet/src/communication/requestgenerators.ts index fe642369d..c2ca5c334 100644 --- a/packages/bierzo-wallet/src/communication/requestgenerators.ts +++ b/packages/bierzo-wallet/src/communication/requestgenerators.ts @@ -1,5 +1,13 @@ import { Address, Amount, Identity, SendTransaction, UnsignedTransaction } from "@iov/bcp"; -import { bnsCodec, ChainAddressPair, RegisterUsernameTx, UpdateTargetsOfUsernameTx } from "@iov/bns"; +import { + bnsCodec, + ChainAddressPair, + RegisterAccountTx, + RegisterDomainTx, + RegisterUsernameTx, + ReplaceAccountTargetsTx, + UpdateTargetsOfUsernameTx, +} from "@iov/bns"; import { TransactionEncoder } from "@iov/encoding"; import { JsonRpcRequest, makeJsonRpcId } from "@iov/jsonrpc"; @@ -95,6 +103,62 @@ export const generateUpdateUsernameTxWithFee = async ( return await withChainFee(regUsernameTx, bnsCodec.identityToAddress(creator)); }; +export const generateRegisterDomainTxWithFee = async ( + creator: Identity, + domain: string, +): Promise => { + const creatorAddress = bnsCodec.identityToAddress(creator); + const TwoHoursInSeconds = 2 * 3600; + + const regDomainTx: RegisterDomainTx = { + kind: "bns/register_domain", + chainId: creator.chainId, + domain: domain, + admin: creatorAddress, + hasSuperuser: true, + msgFees: [], + accountRenew: TwoHoursInSeconds, + }; + + return await withChainFee(regDomainTx, creatorAddress); +}; + +export const generateRegisterAccountTxWithFee = async ( + creator: Identity, + domain: string, + name: string, + owner: Address, + targets: readonly ChainAddressPair[], +): Promise => { + const regAccountTx: RegisterAccountTx = { + kind: "bns/register_account", + chainId: creator.chainId, + domain: domain, + name: name, + owner: owner, + targets: targets, + }; + + return await withChainFee(regAccountTx, bnsCodec.identityToAddress(creator)); +}; + +export const generateReplaceAccountTargetsTxWithFee = async ( + creator: Identity, + domain: string, + name: string, + newTargets: readonly ChainAddressPair[], +): Promise => { + const regAccountTx: ReplaceAccountTargetsTx = { + kind: "bns/replace_account_targets", + chainId: creator.chainId, + domain: domain, + name: name, + newTargets: newTargets, + }; + + return await withChainFee(regAccountTx, bnsCodec.identityToAddress(creator)); +}; + export const generateRegisterUsernameTxRequest = async ( creator: Identity, username: string, @@ -132,3 +196,62 @@ export const generateUpdateUsernameTxRequest = async ( }, }; }; + +export const generateRegisterDomainTxRequest = async ( + creator: Identity, + domain: string, +): Promise => { + const transactionWithFee = await generateRegisterDomainTxWithFee(creator, domain); + + return { + jsonrpc: "2.0", + id: makeJsonRpcId(), + method: "signAndPost", + params: { + reason: TransactionEncoder.toJson("I would like you to sign this request"), + signer: TransactionEncoder.toJson(creator), + transaction: TransactionEncoder.toJson(transactionWithFee), + }, + }; +}; + +export const generateRegisterAccountTxRequest = async ( + creator: Identity, + domain: string, + name: string, + owner: Address, + targets: readonly ChainAddressPair[], +): Promise => { + const transactionWithFee = await generateRegisterAccountTxWithFee(creator, domain, name, owner, targets); + + return { + jsonrpc: "2.0", + id: makeJsonRpcId(), + method: "signAndPost", + params: { + reason: TransactionEncoder.toJson("I would like you to sign this request"), + signer: TransactionEncoder.toJson(creator), + transaction: TransactionEncoder.toJson(transactionWithFee), + }, + }; +}; + +export const generateReplaceAccountTargetsTxRequest = async ( + creator: Identity, + domain: string, + name: string, + newTargets: readonly ChainAddressPair[], +): Promise => { + const transactionWithFee = await generateReplaceAccountTargetsTxWithFee(creator, domain, name, newTargets); + + return { + jsonrpc: "2.0", + id: makeJsonRpcId(), + method: "signAndPost", + params: { + reason: TransactionEncoder.toJson("I would like you to sign this request"), + signer: TransactionEncoder.toJson(creator), + transaction: TransactionEncoder.toJson(transactionWithFee), + }, + }; +}; diff --git a/packages/bierzo-wallet/src/logic/account.ts b/packages/bierzo-wallet/src/logic/account.ts index d57a2679b..00790e20b 100644 --- a/packages/bierzo-wallet/src/logic/account.ts +++ b/packages/bierzo-wallet/src/logic/account.ts @@ -2,10 +2,14 @@ import { Address, ChainId } from "@iov/bcp"; import { getConnectionForBns } from "./connection"; -export function isIov(username: string): boolean { +export function isIovname(username: string): boolean { return username.endsWith("*iov"); } +export function isStarname(starname: string): boolean { + return starname.startsWith("*"); +} + /** * Returns the address associated with the name, or undefined if not registered. * The name must include a namespace ("*iov") @@ -14,7 +18,7 @@ export async function lookupRecipientAddressByName( username: string, chainId: ChainId, ): Promise
{ - if (!isIov(username)) { + if (!isIovname(username)) { throw new Error("IOV starname must include *iov"); } @@ -36,7 +40,7 @@ export async function lookupRecipientAddressByName( export function isValidIov( username: string, ): "valid" | "not_iov" | "wrong_number_of_asterisks" | "too_short" | "too_long" | "wrong_chars" { - if (!isIov(username)) return "not_iov"; + if (!isIovname(username)) return "not_iov"; const parts = username.split("*"); if (parts.length !== 2) return "wrong_number_of_asterisks"; @@ -49,8 +53,51 @@ export function isValidIov( // Username length must maximum 64 chars long if (name.length > 64) return "too_long"; - // Must contain only allowed chars + /* Must contain only allowed chars as per /scripts/bnsd/genesis_app_state.json: + conf: {username: {valid_username_name, valid_username_label}} */ if (/^[a-z0-9_\-.]{3,64}\*iov$/.test(username)) return "valid"; return "wrong_chars"; } + +export function isValidStarname( + starname: string, +): "valid" | "not_starname" | "wrong_number_of_asterisks" | "too_short" | "too_long" | "wrong_chars" { + if (!isStarname(starname)) return "not_starname"; + + const parts = starname.split("*"); + if (parts.length !== 2) return "wrong_number_of_asterisks"; + const domain = parts[1]; + + // Domain length must be at least 3 chars long + if (domain.length < 3) return "too_short"; + + // Domain length must maximum 16 chars long + if (domain.length > 16) return "too_long"; + + /* Must contain only allowed chars as per /scripts/bnsd/genesis_app_state.json: + conf: {account: {valid_domain}} plus initial asterisk */ + if (/^\*[a-z0-9\-_]{3,16}$/.test(starname)) return "valid"; + + return "wrong_chars"; +} + +export function isValidName( + starname: string, +): "valid" | "wrong_number_of_asterisks" | "too_short" | "too_long" | "wrong_chars" { + const parts = starname.split("*"); + if (parts.length !== 2) return "wrong_number_of_asterisks"; + const name = parts[0]; + + // Domain length must be at least 3 chars long + if (name.length < 3) return "too_short"; + + // Domain length must maximum 64 chars long + if (name.length > 64) return "too_long"; + + /* Must contain only allowed chars as per /scripts/bnsd/genesis_app_state.json: + conf: {account: {valid_name, valid_domain}} plus asterisk separator */ + if (/^[a-z0-9\-_.]{3,64}\*[a-z0-9\-_]{3,16}$/.test(starname)) return "valid"; + + return "wrong_chars"; +} diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 2ba437fec..7b9c80a4d 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -15,8 +15,8 @@ import { BwUsernameWithChainName } from ".."; import { history } from "../.."; import AddressesTable from "../../../components/AddressesTable"; import copy from "../../../components/AddressesTable/assets/copy.svg"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { AddressesTooltipHeader, TooltipContent } from "../../registerName/components"; +import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { AddressesTooltipHeader, TooltipContent } from "../../register"; interface Props { readonly usernames: readonly BwUsernameWithChainName[]; @@ -46,7 +46,7 @@ function IovnamesExists({ usernames, onRegisterUsername }: Props): JSX.Element { return ( { - history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE, username); + history.push(REGISTER_IOVNAME_ROUTE, username); }; return ( diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx index d3a85121a..3c968fa3e 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx @@ -4,8 +4,8 @@ import { Block, Typography } from "medulas-react-components"; import React from "react"; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { NoUsernameHeader } from "../../registerName/components"; +import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { NoIovnameHeader } from "../../register/components/IovnameForm"; interface StarnamesNotExistsProps { readonly onRegisterUsername: () => void; @@ -17,7 +17,7 @@ export function GetYourAddressWithExtension({ }: Omit): JSX.Element { return ( - + You have no starnames @@ -28,7 +28,7 @@ export function GetYourAddressWithExtension({ - + You can not register - + personalized address diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx index e0cfa4cbe..5922490aa 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx @@ -3,9 +3,10 @@ import { useTheme } from "@material-ui/styles"; import { Block, Typography } from "medulas-react-components"; import React from "react"; +import { history } from "../.."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { NoStarnameHeader } from "../../registerStarName"; +import { REGISTER_NAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../paths"; +import { NoStarnameHeader } from "../../register/components/StarnameForm"; interface StarnamesNotExistsProps { readonly onRegisterStarname: () => void; @@ -29,7 +30,7 @@ export function GetYourAddressWithExtension({ Register Now + {/* TODO remove this Typography when /register-name accessible from starname list */} + { + history.push(REGISTER_NAME_ROUTE); + }} + > + Register your name + ); } @@ -51,7 +65,7 @@ export function GetYourAddressWithLedger(): JSX.Element { You can not register - + starname diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index 469300def..b39711d83 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -8,7 +8,7 @@ import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { REGISTER_USERNAME_REGISTRATION_STORY_PATH, REGISTER_USERNAME_STORY_PATH, -} from "../registerName/index.stories"; +} from "../register/index.stories"; import { BwUsernameWithChainName } from "."; import AddressesTab from "./components/AddressesTab"; import Iovnames from "./components/Iovnames"; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index dba7a2738..82ba98587 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -9,7 +9,7 @@ import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { BwUsername } from "../../store/usernames"; import { getChainAddressPairWithNames } from "../../utils/tokens"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE, REGISTER_STARNAME } from "../paths"; +import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; import AddressesTab from "./components/AddressesTab"; export interface BwUsernameWithChainName extends BwUsername { @@ -17,11 +17,11 @@ export interface BwUsernameWithChainName extends BwUsername { } function onRegisterUsername(): void { - history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE); + history.push(REGISTER_IOVNAME_ROUTE); } function onRegisterStarname(): void { - history.push(REGISTER_STARNAME); + history.push(REGISTER_STARNAME_ROUTE); } const Addresses = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts index 4cd6a8496..345800556 100644 --- a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts +++ b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts @@ -3,7 +3,7 @@ import { Page } from "puppeteer"; import { ADDRESSES_TEXT } from "../../../components/Header/components/LinksMenu"; import { whenOnNavigatedToE2eRoute } from "../../../utils/test/navigation"; import { ADDRESSES_ROUTE } from "../../paths"; -import { REGISTER_USERNAME_VIEW_ID } from "../../registerName/components"; +import { REGISTER_IOVNAME_VIEW_ID } from "../../register/components/IovnameForm"; import { yourAddresses, yourIovnames } from "../components/AddressesTab"; import { iovnamesViewId } from "../components/Iovnames"; import { yourBlockchainAddressesId } from "../components/UserAddresses"; @@ -29,5 +29,5 @@ export async function travelToStarnamesTabE2E(page: Page): Promise { export async function openFirstStarnameForEditingE2E(page: Page, username: string): Promise { const [firstStarnameEditLink] = await page.$x(`//h6[contains(., 'Edit')]`); await firstStarnameEditLink.click(); - await page.waitForSelector(`#${REGISTER_USERNAME_VIEW_ID}`); + await page.waitForSelector(`#${REGISTER_IOVNAME_VIEW_ID}`); } diff --git a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx index 608c65c65..ab37450bd 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx @@ -9,7 +9,7 @@ import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { REGISTER_USERNAME_REGISTRATION_STORY_PATH, REGISTER_USERNAME_STORY_PATH, -} from "../registerName/index.stories"; +} from "../register/index.stories"; import Layout from "./components/index"; export const BALANCE_STORY_PATH = `${bierzoRoot}/Balance`; diff --git a/packages/bierzo-wallet/src/routes/balance/index.tsx b/packages/bierzo-wallet/src/routes/balance/index.tsx index e0a594f8e..a5ebb097b 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.tsx @@ -6,11 +6,11 @@ import PageMenu from "../../components/PageMenu"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { getFirstUsername } from "../../store/usernames/selectors"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../paths"; +import { REGISTER_IOVNAME_ROUTE } from "../paths"; import Layout from "./components"; function onRegisterUsername(): void { - history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE); + history.push(REGISTER_IOVNAME_ROUTE); } const Balance = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts index 67f41d679..b0187d763 100644 --- a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts +++ b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts @@ -2,8 +2,8 @@ import { Browser, ElementHandle, Page } from "puppeteer"; import { randomString, sleep, whenTrue } from "ui-logic"; import { acceptEnqueuedRequest } from "../../../utils/test/persona"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { REGISTER_USERNAME_FIELD } from "../../registerName/components"; +import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { REGISTER_IOVNAME_FIELD } from "../../register/components/IovnameForm"; const mainMenuH6Elements = 3; const numberOfTokensFromFaucet = 4; @@ -42,12 +42,12 @@ export const getAddressCreationPromptE2E = async (h6Elements: ElementHandle => { - await page.click(`#${REGISTER_PERSONALIZED_ADDRESS_ROUTE.replace("/", "\\/")}`); + await page.click(`#${REGISTER_IOVNAME_ROUTE.replace("/", "\\/")}`); // Fill the form await sleep(1000); const username = `${randomString(10)}*iov`; - await page.type(`input[name="${REGISTER_USERNAME_FIELD}"]`, username); + await page.type(`input[name="${REGISTER_IOVNAME_FIELD}"]`, username); await page.click('button[type="submit"]'); await acceptEnqueuedRequest(browser); diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index bf78262b7..ba893eb2c 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -12,15 +12,15 @@ import { LOGIN_ROUTE, PAYMENT_ROUTE, POLICY_ROUTE, - REGISTER_PERSONALIZED_ADDRESS_ROUTE, - REGISTER_STARNAME, + REGISTER_IOVNAME_ROUTE, + REGISTER_NAME_ROUTE, + REGISTER_STARNAME_ROUTE, TERMS_ROUTE, TRANSACTIONS_ROUTE, } from "./paths"; import Payment from "./payment"; import Policy from "./policy"; -import RegisterUsername from "./registerName"; -import RegisterStarname from "./registerStarName"; +import Register, { ToRegister } from "./register"; import Terms from "./terms"; import Transactions from "./transactions"; @@ -36,8 +36,13 @@ const Routes = (): JSX.Element => ( - - + } /> + } + /> + } /> diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index 1fd438d1f..11dcbda92 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -4,7 +4,8 @@ export const TRANSACTIONS_ROUTE = "/transactions"; export const BALANCE_ROUTE = "/balance"; export const CONFIRM_TRANSACTION_ROUTE = "/confirm-transaction"; export const ADDRESSES_ROUTE = "/addresses"; -export const REGISTER_PERSONALIZED_ADDRESS_ROUTE = "/register-personalized-address"; -export const REGISTER_STARNAME = "/register-starname"; +export const REGISTER_IOVNAME_ROUTE = "/register-iovname"; +export const REGISTER_STARNAME_ROUTE = "/register-starname"; +export const REGISTER_NAME_ROUTE = "/register-name"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; diff --git a/packages/bierzo-wallet/src/routes/payment/components/ReceiverAddress/index.tsx b/packages/bierzo-wallet/src/routes/payment/components/ReceiverAddress/index.tsx index 2951fd9b7..c17b04cec 100644 --- a/packages/bierzo-wallet/src/routes/payment/components/ReceiverAddress/index.tsx +++ b/packages/bierzo-wallet/src/routes/payment/components/ReceiverAddress/index.tsx @@ -12,7 +12,7 @@ import { import React, { useState } from "react"; import tickIcon from "../../../../assets/greenTick.svg"; -import { isIov } from "../../../../logic/account"; +import { isIovname } from "../../../../logic/account"; export const ADDRESS_FIELD = "addressField"; @@ -39,7 +39,7 @@ const ReceiverAddress = ({ const validator: FieldValidator = (value): string | undefined => { if (typeof value !== "string") throw new Error("Input must be a string"); - if (isIov(value) || (selectedChainCodec && selectedChainCodec.isValidAddress(value))) { + if (isIovname(value) || (selectedChainCodec && selectedChainCodec.isValidAddress(value))) { setAddressHasValidCert(isCertValid(value)); return undefined; diff --git a/packages/bierzo-wallet/src/routes/payment/index.tsx b/packages/bierzo-wallet/src/routes/payment/index.tsx index 72229a113..c559cd340 100644 --- a/packages/bierzo-wallet/src/routes/payment/index.tsx +++ b/packages/bierzo-wallet/src/routes/payment/index.tsx @@ -9,7 +9,7 @@ import { generateSendTxRequest } from "../../communication/requestgenerators"; import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; import PageMenu from "../../components/PageMenu"; -import { isIov, lookupRecipientAddressByName } from "../../logic/account"; +import { isIovname, lookupRecipientAddressByName } from "../../logic/account"; import { getCodecForChainId } from "../../logic/codec"; import { RootState } from "../../store/reducers"; import { BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; @@ -59,7 +59,7 @@ const Payment = (): JSX.Element => { const chainId = token.chainId; let recipient: Address; - if (isIov(formValues[ADDRESS_FIELD])) { + if (isIovname(formValues[ADDRESS_FIELD])) { const lookupResult = await lookupRecipientAddressByName(formValues[ADDRESS_FIELD], chainId); if (lookupResult === "name_not_found") { diff --git a/packages/bierzo-wallet/src/routes/registerName/assets/shield.svg b/packages/bierzo-wallet/src/routes/register/assets/shield.svg similarity index 100% rename from packages/bierzo-wallet/src/routes/registerName/assets/shield.svg rename to packages/bierzo-wallet/src/routes/register/assets/shield.svg diff --git a/packages/bierzo-wallet/src/routes/registerName/components/ConfirmRegistration.tsx b/packages/bierzo-wallet/src/routes/register/components/ConfirmRegistration.tsx similarity index 90% rename from packages/bierzo-wallet/src/routes/registerName/components/ConfirmRegistration.tsx rename to packages/bierzo-wallet/src/routes/register/components/ConfirmRegistration.tsx index dfebd38f1..980951013 100644 --- a/packages/bierzo-wallet/src/routes/registerName/components/ConfirmRegistration.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/ConfirmRegistration.tsx @@ -15,7 +15,7 @@ import copySvg from "../../../assets/copy.svg"; import tickSvg from "../../../assets/tick.svg"; import PageContent from "../../../components/PageContent"; -export const USERNAME_CONFIRMATION_VIEW_ID = "username-confirmation-view-id"; +export const REGISTER_CONFIRMATION_VIEW_ID = "register-confirmation-view-id"; const useClasses = makeStyles({ txId: { @@ -62,9 +62,9 @@ const ConfirmRegistration = ({ transactionId, onSeeTrasactions }: Props): JSX.El }; return ( - + - Your personalized address registration request was successfully signed and sent to the network. + Your registration request was successfully signed and sent to the network. diff --git a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx new file mode 100644 index 000000000..a383a5c93 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx @@ -0,0 +1,322 @@ +import { Fee, Identity, TransactionId } from "@iov/bcp"; +import { JsonRpcRequest } from "@iov/jsonrpc"; +import { FieldValidator } from "final-form"; +import { + Back, + BillboardContext, + Block, + Button, + FieldInputValue, + Form, + FormValues, + Hairline, + Image, + makeStyles, + TextField, + ToastContext, + ToastVariant, + Tooltip, + Typography, + useForm, +} from "medulas-react-components"; +import React from "react"; + +import { + AddressesTooltipHeader, + getAddressItems, + getChainAddressPairsFromValues, + getFormInitValues, + getSubmitButtonCaption, + TooltipContent, +} from ".."; +import { + generateRegisterUsernameTxRequest, + generateUpdateUsernameTxRequest, +} from "../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import { AddressesTableProps } from "../../../components/AddressesTable"; +import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../components/PageContent"; +import { isValidIov } from "../../../logic/account"; +import { BwUsernameWithChainName } from "../../addresses"; +import shield from "../assets/shield.svg"; +import SelectAddressesTable from "./SelectAddressesTable"; + +export const REGISTER_IOVNAME_VIEW_ID = "register-iovname-view-id"; +export const REGISTER_IOVNAME_FIELD = "register-iovname-field"; + +const registerIcon = shield; + +const useStyles = makeStyles({ + iovnameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +export function NoIovnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + yourname*iov + + + ); +} + +interface Props extends AddressesTableProps { + readonly onCancel: () => void; + readonly iovnameAddresses: BwUsernameWithChainName | undefined; + readonly bnsIdentity: Identity; + readonly rpcEndpoint: RpcEndpoint; + readonly transactionFee: Fee | undefined; + readonly setTransactionId: React.Dispatch>; +} + +const IovnameForm = ({ + chainAddresses, + iovnameAddresses, + bnsIdentity, + rpcEndpoint, + onCancel, + transactionFee, + setTransactionId, +}: Props): JSX.Element => { + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const chainAddressesItems = React.useMemo(() => { + if (iovnameAddresses) { + return getAddressItems(iovnameAddresses.addresses); + } + return getAddressItems(chainAddresses); + }, [chainAddresses, iovnameAddresses]); + + const onSubmit = async (values: object): Promise => { + const formValues = values as FormValues; + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + + try { + let request: JsonRpcRequest; + if (iovnameAddresses) { + request = await generateUpdateUsernameTxRequest( + bnsIdentity, + iovnameAddresses.username, + addressesToRegister, + ); + } else { + request = await generateRegisterUsernameTxRequest( + bnsIdentity, + formValues[REGISTER_IOVNAME_FIELD], + addressesToRegister, + ); + } + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + const iovnameValidator: FieldValidator = (value): string | undefined => { + if (!iovnameAddresses) { + if (!value) { + return "Required"; + } + + const checkResult = isValidIov(value); + + switch (checkResult) { + case "not_iov": + return "Iovname must end with *iov"; + case "wrong_number_of_asterisks": + return "Iovname must include only one namespace"; + case "too_short": + return "Iovname should be at least 3 characters"; + case "too_long": + return "Iovname should be maximum 64 characters"; + case "wrong_chars": + return "Iovname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; + case "valid": + break; + default: + throw new Error(`"Unknown iovname validation error: ${checkResult}`); + } + } + + return undefined; + }; + + /* const validateIovnameExistsAndAddresses = React.useCallback( + (values: object) => { + const validate = async (values: object): Promise => { + const formValues = values as FormValues; + const errors: ValidationError = {}; + + const connection = await getConnectionForBns(); + const username = formValues[REGISTER_IOVNAME_FIELD]; + const usernames = await connection.getUsernames({ username: username }); + if (usernames.length > 0) { + errors[REGISTER_IOVNAME_FIELD] = "Iovname already exists"; + return errors; + } + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + for (const address of addressesToRegister) { + const codec = await getCodecForChainId(address.chainId); + if (!codec.isValidAddress(address.address)) { + const addressField = Object.entries(formValues).find(([_id, value]) => { + if (value === address.address) return true; + return false; + }); + if (addressField) { + errors[addressField[0]] = "Not valid blockchain address"; + } + } + } + + return errors; + }; + + validate(values); + }, + [chainAddresses], + ); */ + + const initialValues = React.useMemo(() => getFormInitValues(chainAddressesItems), [chainAddressesItems]); + const { form, handleSubmit, invalid, submitting, validating } = useForm({ + onSubmit, + // validate: validateIovnameExistsAndAddresses, + initialValues, + }); + + const buttons = ( + + + + + + + Cancel + + + + ); + + return ( +
+ + + {iovnameAddresses && ( + + {iovnameAddresses.username} + + )} + {!iovnameAddresses && ( + + + + Create your iovname + + + + } title="Choose your address"> + With IOV you can choose your easy to read human readable address. No more complicated + cryptography when sending to friends. + + + + + How it works + + + + + + + + )} + + + + + + CHOOSE LINKED ADDRESSES + + + + + + } title="Your linked addresses"> + With Neuma you can have an universal blockchain address that is linked to all your + addresses. Just give your friends your iovname. + + + + + + + + Optional + + + + + + +
+ ); +}; + +export default IovnameForm; diff --git a/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx new file mode 100644 index 000000000..ded037979 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx @@ -0,0 +1,325 @@ +import { Fee, Identity, TransactionId } from "@iov/bcp"; +import { bnsCodec } from "@iov/bns"; +import { JsonRpcRequest } from "@iov/jsonrpc"; +import { FieldValidator } from "final-form"; +import { + Back, + BillboardContext, + Block, + Button, + FieldInputValue, + Form, + FormValues, + Hairline, + Image, + makeStyles, + TextField, + ToastContext, + ToastVariant, + Tooltip, + Typography, + useForm, +} from "medulas-react-components"; +import React from "react"; + +import { + AddressesTooltipHeader, + getAddressItems, + getChainAddressPairsFromValues, + getFormInitValues, + getSubmitButtonCaption, + TooltipContent, +} from ".."; +import { + generateRegisterAccountTxRequest, + generateReplaceAccountTargetsTxRequest, +} from "../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import { AddressesTableProps } from "../../../components/AddressesTable"; +import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../components/PageContent"; +import { isValidName } from "../../../logic/account"; +import { BwUsernameWithChainName } from "../../addresses"; +import shield from "../assets/shield.svg"; +import SelectAddressesTable from "./SelectAddressesTable"; + +export const REGISTER_NAME_VIEW_ID = "register-name-view-id"; +export const REGISTER_NAME_FIELD = "register-name-field"; + +const registerIcon = shield; + +const useStyles = makeStyles({ + iovnameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +function NoNameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + eg. anna*yourstarname + + + ); +} + +interface Props extends AddressesTableProps { + readonly onCancel: () => void; + readonly iovnameAddresses: BwUsernameWithChainName | undefined; + readonly bnsIdentity: Identity; + readonly rpcEndpoint: RpcEndpoint; + readonly transactionFee: Fee | undefined; + readonly setTransactionId: React.Dispatch>; +} + +const NameForm = ({ + chainAddresses, + iovnameAddresses, + bnsIdentity, + rpcEndpoint, + onCancel, + transactionFee, + setTransactionId, +}: Props): JSX.Element => { + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const chainAddressesItems = React.useMemo(() => { + if (iovnameAddresses) { + return getAddressItems(iovnameAddresses.addresses); + } + return getAddressItems(chainAddresses); + }, [chainAddresses, iovnameAddresses]); + + const onSubmit = async (values: object): Promise => { + const formValues = values as FormValues; + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + const [name, domain] = formValues[REGISTER_NAME_FIELD].split("*"); + + try { + let request: JsonRpcRequest; + if (iovnameAddresses) { + request = await generateReplaceAccountTargetsTxRequest( + bnsIdentity, + domain, + name, + addressesToRegister, + ); + } else { + request = await generateRegisterAccountTxRequest( + bnsIdentity, + domain, + name, + bnsCodec.identityToAddress(bnsIdentity), + addressesToRegister, + ); + } + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + const nameValidator: FieldValidator = (value): string | undefined => { + if (!iovnameAddresses) { + if (!value) { + return "Required"; + } + + const checkResult = isValidName(value); + + switch (checkResult) { + case "wrong_number_of_asterisks": + return "Name must include only one namespace"; + case "too_short": + return "Name should be at least 3 characters"; + case "too_long": + return "Name should be maximum 64 characters"; + case "wrong_chars": + return "Name should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; + case "valid": + break; + default: + throw new Error(`"Unknown name validation error: ${checkResult}`); + } + } + + return undefined; + }; + + /* const validateNameExistsAndAddresses = React.useCallback( + (values: object) => { + const validate = async (values: object): Promise => { + const formValues = values as FormValues; + const errors: ValidationError = {}; + + const connection = await getConnectionForBns(); + const [name, domain] = formValues[REGISTER_NAME_FIELD].split("*"); + const accounts = await connection.getAccounts({ domain: domain }); + if (accounts.find(account => account.name === name)) { + errors[REGISTER_NAME_FIELD] = "Name already exists"; + return errors; + } + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + for (const address of addressesToRegister) { + const codec = await getCodecForChainId(address.chainId); + if (!codec.isValidAddress(address.address)) { + const addressField = Object.entries(formValues).find(([_id, value]) => { + if (value === address.address) return true; + return false; + }); + if (addressField) { + errors[addressField[0]] = "Not valid blockchain address"; + } + } + } + + return errors; + }; + + validate(values); + }, + [chainAddresses], + ); */ + + const initialValues = React.useMemo(() => getFormInitValues(chainAddressesItems), [chainAddressesItems]); + const { form, handleSubmit, invalid, submitting, validating } = useForm({ + onSubmit, + // validate: validateNameExistsAndAddresses, + initialValues, + }); + + const buttons = ( + + + + + + + Cancel + + + + ); + + return ( +
+ + + {iovnameAddresses && ( + + {iovnameAddresses.username} + + )} + {!iovnameAddresses && ( + + + + Register your new name + + + + } title="Choose your address"> + With IOV you can choose your easy to read human readable address. No more complicated + cryptography when sending to friends. + + + + + How it works + + + + + + + + )} + + + + + + CHOOSE LINKED ADDRESSES + + + + + + } title="Your linked addresses"> + With Neuma you can have an universal blockchain address that is linked to all your + addresses. Just give your friends your starname. + + + + + + + + Optional + + + + + + +
+ ); +}; + +export default NameForm; diff --git a/packages/bierzo-wallet/src/routes/registerName/components/SelectAddressesTable.tsx b/packages/bierzo-wallet/src/routes/register/components/SelectAddressesTable.tsx similarity index 100% rename from packages/bierzo-wallet/src/routes/registerName/components/SelectAddressesTable.tsx rename to packages/bierzo-wallet/src/routes/register/components/SelectAddressesTable.tsx diff --git a/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx new file mode 100644 index 000000000..9247cd439 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx @@ -0,0 +1,237 @@ +import { Fee, Identity, TransactionId } from "@iov/bcp"; +import { FieldValidator } from "final-form"; +import { + Back, + BillboardContext, + Block, + Button, + FieldInputValue, + Form, + FormValues, + Image, + makeStyles, + TextField, + ToastContext, + ToastVariant, + Tooltip, + Typography, + useForm, +} from "medulas-react-components"; +import React from "react"; + +import { getSubmitButtonCaption, TooltipContent } from ".."; +import { generateRegisterDomainTxRequest } from "../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../components/PageContent"; +import { isValidStarname } from "../../../logic/account"; +import { BwUsernameWithChainName } from "../../addresses"; +import shield from "../assets/shield.svg"; + +export const REGISTER_STARNAME_VIEW_ID = "register-starname-view-id"; +export const REGISTER_STARNAME_FIELD = "register-starname-field"; + +const registerIcon = shield; + +const useStyles = makeStyles({ + starnameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +export function NoStarnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + *yourstarname + + + ); +} + +interface Props { + readonly onCancel: () => void; + readonly iovnameAddresses: BwUsernameWithChainName | undefined; + readonly bnsIdentity: Identity; + readonly rpcEndpoint: RpcEndpoint; + readonly transactionFee: Fee | undefined; + readonly setTransactionId: React.Dispatch>; +} + +const StarnameForm = ({ + iovnameAddresses, + bnsIdentity, + rpcEndpoint, + onCancel, + transactionFee, + setTransactionId, +}: Props): JSX.Element => { + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const onSubmit = async (values: object): Promise => { + const formValues = values as FormValues; + const domain = formValues[REGISTER_STARNAME_FIELD].split("*")[1]; + + try { + const request = await generateRegisterDomainTxRequest(bnsIdentity, domain); + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + const starnameValidator: FieldValidator = (value): string | undefined => { + if (!iovnameAddresses) { + if (!value) { + return "Required"; + } + + const checkResult = isValidStarname(value); + + switch (checkResult) { + case "not_starname": + return "Starname must include namespace after '*'"; + case "wrong_number_of_asterisks": + return "Starname must include only one namespace"; + case "too_short": + return "Starname should be at least 3 characters"; + case "too_long": + return "Starname should be maximum 16 characters"; + case "wrong_chars": + return "Starname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; + case "valid": + break; + default: + throw new Error(`"Unknown starname validation error: ${checkResult}`); + } + } + + return undefined; + }; + + /* const validateStarnameExists = React.useCallback((values: object) => { + const validate = async (values: object): Promise => { + const formValues = values as FormValues; + const errors: ValidationError = {}; + + const connection = await getConnectionForBns(); + const noAsteriskDomain = value.substring(1); + const domains = await connection.getDomains({ name: noAsteriskDomain }); + if (domains.length > 0) { + errors[REGISTER_STARNAME_FIELD] = "Starname already exists"; + return errors; + } + + return errors; + }; + + validate(values); + }, []); */ + + const { form, handleSubmit, invalid, submitting, validating } = useForm({ + onSubmit, + // validate: validateStarnameExists, + }); + + const buttons = ( + + + + + + + Cancel + + + + ); + + return ( +
+ + + {iovnameAddresses && ( + + {iovnameAddresses.username} + + )} + {!iovnameAddresses && ( + + + + Register your starname + + + + } title="Choose your address"> + With IOV you can choose your easy to read human readable address. No more complicated + cryptography when sending to friends. + + + + + How it works + + + + + + + + )} + + +
+ ); +}; + +export default StarnameForm; diff --git a/packages/bierzo-wallet/src/routes/registerName/index.stories.tsx b/packages/bierzo-wallet/src/routes/register/index.stories.tsx similarity index 50% rename from packages/bierzo-wallet/src/routes/registerName/index.stories.tsx rename to packages/bierzo-wallet/src/routes/register/index.stories.tsx index 8f0d0ec99..1c74c434a 100644 --- a/packages/bierzo-wallet/src/routes/registerName/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/register/index.stories.tsx @@ -1,25 +1,18 @@ -import { Address, ChainId, Fee, Token, TokenTicker, TransactionId } from "@iov/bcp"; -import { action } from "@storybook/addon-actions"; +import { TransactionId } from "@iov/bcp"; import { linkTo } from "@storybook/addon-links"; import { storiesOf } from "@storybook/react"; -import { FormValues, ValidationError } from "medulas-react-components"; import React from "react"; -import { stringToAmount } from "ui-logic"; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import { isValidIov } from "../../logic/account"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; -import { BALANCE_STORY_PATH, BALANCE_STORY_VIEW_PATH } from "../balance/index.stories"; import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../transactions/index.stories"; import ConfirmRegistration from "./components/ConfirmRegistration"; -import Layout, { REGISTER_USERNAME_FIELD } from "./components/index"; export const REGISTER_USERNAME_STORY_PATH = `${bierzoRoot}/Register Username`; export const REGISTER_USERNAME_REGISTRATION_STORY_PATH = "Register Username"; -const REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Username without fee"; +// const REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Username without fee"; const REGISTER_USERNAME_CONFIRMATION_STORY_PATH = "Registration confirmation"; -const addresses: ChainAddressPairWithName[] = [ +/* const addresses: ChainAddressPairWithName[] = [ { chainId: "local-iov-devnet" as ChainId, address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, @@ -37,47 +30,6 @@ const addresses: ChainAddressPairWithName[] = [ }, ]; -async function onSubmit(values: object): Promise { - const formValues = values as FormValues; - action("onSubmit")(formValues); -} - -async function validate(values: object): Promise { - const formValues = values as FormValues; - const errors: ValidationError = {}; - - const username = formValues[REGISTER_USERNAME_FIELD]; - if (!username) { - errors[REGISTER_USERNAME_FIELD] = "Required"; - return errors; - } - const checkResult = isValidIov(username); - - switch (checkResult) { - case "not_iov": - errors[REGISTER_USERNAME_FIELD] = "IOV starname must include *iov"; - break; - case "wrong_number_of_asterisks": - errors[REGISTER_USERNAME_FIELD] = "IOV starname must include only one namespace"; - break; - case "too_short": - errors[REGISTER_USERNAME_FIELD] = "IOV starname should be at least 3 characters"; - break; - case "too_long": - errors[REGISTER_USERNAME_FIELD] = "IOV starname should be maximum 64 characters"; - break; - case "wrong_chars": - errors[REGISTER_USERNAME_FIELD] = - "IOV starname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; - break; - case "valid": - break; - default: - throw new Error(`"Unknown IOV starname validation error: ${checkResult}`); - } - return errors; -} - const iov: Pick = { fractionalDigits: 9, tokenTicker: "IOV" as TokenTicker, @@ -85,17 +37,16 @@ const iov: Pick = { const fee: Fee = { tokens: stringToAmount("5", iov), -}; +}; */ storiesOf(REGISTER_USERNAME_STORY_PATH, module) .addParameters({ viewport: { defaultViewport: "responsive" } }) - .add(REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( + // TODO adapt this stories to new components + /* .add(REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( - @@ -103,16 +54,14 @@ storiesOf(REGISTER_USERNAME_STORY_PATH, module) )) .add(REGISTER_USERNAME_REGISTRATION_STORY_PATH, () => ( - - )) + )) */ .add(REGISTER_USERNAME_CONFIRMATION_STORY_PATH, () => ( ; + +const useStyles = makeStyles({ + addressesHeader: { + backgroundColor: "#31E6C9", + fontSize: "27.5px", + width: 56, + height: 56, + }, +}); + +export function AddressesTooltipHeader(): JSX.Element { + const classes = useStyles(); + const avatarClasses = { root: classes.addressesHeader }; + return {registerTooltipIcon}; +} + +interface TooltipContentProps { + readonly header: React.ReactNode; + readonly title: string; + readonly children: React.ReactNode; +} + +export function TooltipContent({ children, title, header }: TooltipContentProps): JSX.Element { + return ( + + {header} + + + {title} + + + {children} + + + ); +} + +export function getSubmitButtonCaption(fee: Fee | undefined): string { + if (fee && fee.tokens) { + return `Register for ${amountToString(fee.tokens)}`; + } + + return "Register"; +} + +export function getFormInitValues(addressItems: SelectAddressItem[]): FormValues { + const initialValues: FormValues = {}; + addressItems.forEach(item => { + initialValues[getAddressInputName(item.id)] = item.chain.address; + initialValues[getBlockchainInputName(item.id)] = item.chain.chainName; + }); + + return initialValues; +} + +export function getAddressItems(chainAddresses: readonly ChainAddressPairWithName[]): SelectAddressItem[] { + const addressItems: SelectAddressItem[] = []; + chainAddresses.forEach((chain, index) => { + addressItems.push({ + id: index.toString(), + chain, + }); + }); + + return addressItems; +} + +export function getBnsIdentity(identities: ReadonlyMap): Identity | undefined { + for (const identity of Array.from(identities.values()).map(ext => ext.identity)) { + if (getConnectionForChainId(identity.chainId) instanceof BnsConnection) { + return identity; + } + } + return undefined; +} + +async function getPersonalizedAddressRegistrationFee( + bnsIdentity: Identity, + addresses: readonly ChainAddressPairWithName[], +): Promise { + const transactionWithFee = await generateRegisterUsernameTxWithFee(bnsIdentity, "feetest*iov", addresses); + + return transactionWithFee.fee; +} + +export function getChainAddressPairsFromValues( + values: FormValues, + addresses: readonly ChainAddressPairWithName[], +): readonly ChainAddressPairWithName[] { + const chainAddressMap: Map> = new Map< + string, + Partial + >(); + Object.keys(values).forEach(key => { + const idxLenght = key.indexOf("-"); + if (idxLenght === -1) return; + + const index = key.substr(0, idxLenght); + let pair = chainAddressMap.get(index); + if (!pair) { + pair = {}; + } + + const type = key.substr(idxLenght + 1); + switch (type) { + case addressValueField: { + pair = { ...pair, address: values[key] as Address }; + break; + } + case blockchainValueField: { + const chain = addresses.find(address => address.chainName === values[key]); + if (chain) { + pair = { ...pair, chainId: chain.chainId, chainName: chain.chainName }; + } + break; + } + } + + chainAddressMap.set(index, pair); + }); + + const chainAddressPair: ChainAddressPairWithName[] = []; + chainAddressMap.forEach(value => { + if (value.address && value.chainId && value.chainName) { + chainAddressPair.push({ + address: value.address, + chainId: value.chainId, + chainName: value.chainName, + }); + } + }); + + return chainAddressPair; +} + +export enum ToRegister { + Iovname = "iovname", + Starname = "starname", + Name = "name", +} + +interface Props { + entity: ToRegister; +} + +const Register = ({ entity }: Props): JSX.Element => { + const [transactionId, setTransactionId] = React.useState(null); + const [transactionFee, setTransactionFee] = React.useState(undefined); + + const rpcEndpoint = ReactRedux.useSelector((state: RootState) => state.rpcEndpoint); + const identities = ReactRedux.useSelector((state: RootState) => state.identities); + const addressesSorted = React.useMemo(() => getChainAddressPairWithNamesSorted(identities), [identities]); + + const bnsIdentity = getBnsIdentity(identities); + const iovnameAddresses: BwUsernameWithChainName | undefined = history.location.state; + + if (!bnsIdentity) throw new Error("No BNS identity available."); + if (!rpcEndpoint) throw new Error("RPC endpoint not set in redux store. This is a bug."); + + React.useEffect(() => { + let isSubscribed = true; + async function getFee( + bnsIdentity: Identity, + addresses: readonly ChainAddressPairWithName[], + ): Promise { + const fee = await getPersonalizedAddressRegistrationFee(bnsIdentity, addresses); + + if (isSubscribed) { + setTransactionFee(fee); + } + } + getFee(bnsIdentity, addressesSorted); + + return () => { + isSubscribed = false; + }; + }, [addressesSorted, bnsIdentity]); + + return ( + + {transactionId ? ( + + ) : ( + + {entity === ToRegister.Iovname && ( + + )} + {entity === ToRegister.Starname && ( + + )} + {entity === ToRegister.Name && ( + + )} + + )} + + ); +}; + +export default Register; diff --git a/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts b/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts index f6828c8b2..a87096d73 100644 --- a/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts +++ b/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts @@ -5,10 +5,16 @@ import { BnsUsernameNft, CreateProposalTx, isCreateProposalTx, + isRegisterAccountTx, + isRegisterDomainTx, isRegisterUsernameTx, + isReplaceAccountTargetsTx, isUpdateTargetsOfUsernameTx, isVoteTx, + RegisterAccountTx, + RegisterDomainTx, RegisterUsernameTx, + ReplaceAccountTargetsTx, UpdateTargetsOfUsernameTx, VoteTx, } from "@iov/bns"; @@ -28,7 +34,13 @@ import { SoftwareAccountManagerChainConfig, } from "../accountManager/softwareAccountManager"; import { StringDb } from "../backgroundscript/db"; -import { algorithmForCodec, chainConnector, getChains, pathBuilderForCodec } from "./config"; +import { + algorithmForCodec, + chainConnector, + codecTypeFromString, + getChains, + pathBuilderForCodec, +} from "./config"; import { createTwoWalletProfile } from "./userprofilehelpers"; function isNonUndefined(t: T | undefined): t is T { @@ -42,6 +54,9 @@ export type SupportedTransaction = | SendTransaction | RegisterUsernameTx | UpdateTargetsOfUsernameTx + | RegisterDomainTx + | RegisterAccountTx + | ReplaceAccountTargetsTx | CreateProposalTx | VoteTx; @@ -50,6 +65,9 @@ export function isSupportedTransaction(tx: UnsignedTransaction): tx is Supported isSendTransaction(tx) || isRegisterUsernameTx(tx) || isUpdateTargetsOfUsernameTx(tx) || + isRegisterDomainTx(tx) || + isRegisterAccountTx(tx) || + isReplaceAccountTargetsTx(tx) || isCreateProposalTx(tx) || isVoteTx(tx) ); @@ -140,14 +158,15 @@ export class Persona { const managerChains: SoftwareAccountManagerChainConfig[] = []; for (const chainSpec of (await getChains()).map(chain => chain.chainSpec)) { - const connector = chainConnector(chainSpec); + const codecType = codecTypeFromString(chainSpec.codecType); + const connector = chainConnector(codecType, chainSpec); try { const { connection } = await signer.addChain(connector); managerChains.push({ chainId: connection.chainId, - algorithm: algorithmForCodec(chainSpec.codecType), - derivePath: pathBuilderForCodec(chainSpec.codecType), + algorithm: algorithmForCodec(codecType), + derivePath: pathBuilderForCodec(codecType), }); } catch (e) { console.error("Could not add chain. " + e); diff --git a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterAccountTx.tsx b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterAccountTx.tsx new file mode 100644 index 000000000..456ffa1cd --- /dev/null +++ b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterAccountTx.tsx @@ -0,0 +1,38 @@ +import { RegisterAccountTx } from "@iov/bns"; +import { Block, List, Typography } from "medulas-react-components"; +import * as React from "react"; + +import TransactionFee from "./TransactionFee"; + +export const REQ_REGISTER_ACCOUNT = "req-register-account-tx"; + +interface Props { + readonly tx: RegisterAccountTx; +} + +const ReqRegisterAccountTx = ({ tx }: Props): JSX.Element => { + return ( + + + {tx.name} + + + {" "} + name registration for{" "} + + + {tx.domain} + + + {" "} + domain. + + + + + + + ); +}; + +export default ReqRegisterAccountTx; diff --git a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterDomainTx.tsx b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterDomainTx.tsx new file mode 100644 index 000000000..ab718df6f --- /dev/null +++ b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterDomainTx.tsx @@ -0,0 +1,31 @@ +import { RegisterDomainTx } from "@iov/bns"; +import { Block, List, Typography } from "medulas-react-components"; +import * as React from "react"; + +import TransactionFee from "./TransactionFee"; + +export const REQ_REGISTER_DOMAIN = "req-register-domain-tx"; + +interface Props { + readonly tx: RegisterDomainTx; +} + +const ReqRegisterDomainTx = ({ tx }: Props): JSX.Element => { + return ( + + + {tx.domain} + + + {" "} + starname registration request. + + + + + + + ); +}; + +export default ReqRegisterDomainTx; diff --git a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqReplaceAccountTargetsTx.tsx b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqReplaceAccountTargetsTx.tsx new file mode 100644 index 000000000..2f4351f08 --- /dev/null +++ b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqReplaceAccountTargetsTx.tsx @@ -0,0 +1,43 @@ +import { ReplaceAccountTargetsTx } from "@iov/bns"; +import { Block, List, ListItem, ListItemText, Typography } from "medulas-react-components"; +import * as React from "react"; + +import TransactionFee, { txListItemSecondaryProps, useTxListItemStyles } from "./TransactionFee"; + +export const REQ_REPLACE_ACCOUNT_TARGETS = "req-replace-account-targets-tx"; + +interface Props { + readonly tx: ReplaceAccountTargetsTx; +} + +const ReqReplaceAccountTargetsTx = ({ tx }: Props): JSX.Element => { + const listItemClasses = useTxListItemStyles(); + + return ( + + + {tx.name}*{tx.domain} + + + Addresses: + + {tx.newTargets.map(target => ( + + + + ))} + + + + + + + ); +}; + +export default ReqReplaceAccountTargetsTx; diff --git a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/index.tsx b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/index.tsx index 5f0cff181..40e9b0b33 100644 --- a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/index.tsx +++ b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/index.tsx @@ -1,11 +1,22 @@ import { isSendTransaction } from "@iov/bcp"; -import { isCreateProposalTx, isRegisterUsernameTx, isUpdateTargetsOfUsernameTx, isVoteTx } from "@iov/bns"; +import { + isCreateProposalTx, + isRegisterAccountTx, + isRegisterDomainTx, + isRegisterUsernameTx, + isReplaceAccountTargetsTx, + isUpdateTargetsOfUsernameTx, + isVoteTx, +} from "@iov/bns"; import { Block, Button, Typography } from "medulas-react-components"; import * as React from "react"; import { SupportedTransaction } from "../../../../../../../../../../extension/background/model/persona"; import ReqCreateProposalTx from "./ReqCreateProposalTx"; +import ReqRegisterAccountTx from "./ReqRegisterAccountTx"; +import ReqRegisterDomainTx from "./ReqRegisterDomainTx"; import ReqRegisterUsernameTx from "./ReqRegisterUsernameTx"; +import ReqReplaceAccountTargetsTx from "./ReqReplaceAccountTargetsTx"; import ReqSendTransaction from "./ReqSendTransaction"; import ReqUpdateTargetsOfUsernameTx from "./ReqUpdateTargetsOfUsernameTx"; import ReqVoteTx from "./ReqVoteTx"; @@ -28,6 +39,12 @@ const ShowTx = ({ sender, tx, onAcceptRequest, showRejectView }: Props): JSX.Ele req = ; } else if (isUpdateTargetsOfUsernameTx(tx)) { req = ; + } else if (isRegisterDomainTx(tx)) { + req = ; + } else if (isRegisterAccountTx(tx)) { + req = ; + } else if (isReplaceAccountTargetsTx(tx)) { + req = ; } else if (isCreateProposalTx(tx)) { req = ; } else if (isVoteTx(tx)) { diff --git a/packages/sil-governance/src/routes/dashboard/components/ProposalsList.tsx b/packages/sil-governance/src/routes/dashboard/components/ProposalsList.tsx index 5b7ddcd56..d3c120b91 100644 --- a/packages/sil-governance/src/routes/dashboard/components/ProposalsList.tsx +++ b/packages/sil-governance/src/routes/dashboard/components/ProposalsList.tsx @@ -1,5 +1,4 @@ import { Address } from "@iov/bcp"; -import { VoteOption } from "@iov/bns"; import { Block, SelectField, SelectFieldItem, Typography, useForm } from "medulas-react-components"; import React, { useState } from "react"; import { useSelector } from "react-redux"; @@ -63,24 +62,23 @@ const compareByExpiryDate: ProposalsComparator = (proposal1, proposal2): number const compareByStartDate: ProposalsComparator = (proposal1, proposal2): number => { return proposal1.startDate.getTime() - proposal2.startDate.getTime(); }; -function voteValue(vote: VoteOption): number { - // The values of the original numeric VoteOption enum implementation. There is no specific reason to use those values. - switch (vote) { - case VoteOption.Yes: - return 0; - case VoteOption.No: - return 1; - case VoteOption.Abstain: - return 2; - default: - throw new Error("Unsupported vote option"); - } -} const compareByVote: ProposalsComparator = (proposal1, proposal2): number => { if (proposal1.vote === undefined && proposal2.vote === undefined) return 0; if (proposal1.vote === undefined) return 1; if (proposal2.vote === undefined) return -1; - return voteValue(proposal1.vote) - voteValue(proposal2.vote); + + if (proposal1.vote === "abstain" && proposal2.vote === "abstain") return 0; + if (proposal1.vote === "abstain") return 1; + + if (proposal1.vote === "no" && proposal2.vote === "abstain") return -1; + if (proposal1.vote === "no" && proposal2.vote === "no") return 0; + if (proposal1.vote === "no") return 1; + + if (proposal1.vote === "yes" && proposal2.vote === "abstain") return -1; + if (proposal1.vote === "yes" && proposal2.vote === "no") return -1; + if (proposal1.vote === "yes") return 0; + + return 0; }; interface Props { From b2ade1d4e0ed6ea3b06ecd84a5c52f0275c5c9cd Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 17:44:21 +0200 Subject: [PATCH 004/204] Fix after revert --- .../register/components/IovnameForm.tsx | 17 +- .../src/routes/register/index.tsx | 50 ++-- .../routes/registerName/components/index.tsx | 242 ------------------ .../src/routes/registerStarName/index.tsx | 34 --- 4 files changed, 40 insertions(+), 303 deletions(-) delete mode 100644 packages/bierzo-wallet/src/routes/registerName/components/index.tsx delete mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx index a383a5c93..c8f98f74a 100644 --- a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx @@ -189,15 +189,16 @@ const IovnameForm = ({ const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); for (const address of addressesToRegister) { - const codec = await getCodecForChainId(address.chainId); - if (!codec.isValidAddress(address.address)) { - const addressField = Object.entries(formValues).find(([_id, value]) => { - if (value === address.address) return true; - return false; - }); - if (addressField) { - errors[addressField[0]] = "Not valid blockchain address"; + try { + const codec = await getCodecForChainId(address.chainId); + if (!codec.isValidAddress(address.address)) { + const addressField = Object.entries(formValues).find(([_id, value]) => value === address.address); + if (addressField) { + errors[addressField[0]] = "Not valid blockchain address"; + } } + } catch (err) { + console.info(err); } } diff --git a/packages/bierzo-wallet/src/routes/register/index.tsx b/packages/bierzo-wallet/src/routes/register/index.tsx index 662901f2c..6ee91aec0 100644 --- a/packages/bierzo-wallet/src/routes/register/index.tsx +++ b/packages/bierzo-wallet/src/routes/register/index.tsx @@ -1,32 +1,38 @@ import { Address, ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; import { BnsConnection } from "@iov/bns"; -import { Avatar, Block, FormValues, Image, makeStyles, Typography } from "medulas-react-components"; +import { JsonRpcRequest } from "@iov/jsonrpc"; +import { + BillboardContext, + FormValues, + ToastContext, + ToastVariant, + ValidationError, +} from "medulas-react-components"; import React from "react"; import * as ReactRedux from "react-redux"; -import { amountToString } from "ui-logic"; import { history } from ".."; -import { generateRegisterUsernameTxWithFee } from "../../communication/requestgenerators"; +import { + generateRegisterUsernameTxRequest, + generateRegisterUsernameTxWithFee, + generateUpdateUsernameTxRequest, +} from "../../communication/requestgenerators"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; import PageMenu from "../../components/PageMenu"; -import { getConnectionForChainId } from "../../logic/connection"; +import { getConfig, SupportedChain } from "../../config"; +import { isValidIov } from "../../logic/account"; +import { getCodecForChainId } from "../../logic/codec"; +import { getConnectionForBns, getConnectionForChainId } from "../../logic/connection"; import { ExtendedIdentity } from "../../store/identities"; import { RootState } from "../../store/reducers"; import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; import { BwUsernameWithChainName } from "../addresses"; import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; -import shield from "./assets/shield.svg"; +import Layout, { REGISTER_USERNAME_FIELD } from "./components"; import ConfirmRegistration from "./components/ConfirmRegistration"; -import IovnameForm from "./components/IovnameForm"; -import NameForm from "./components/NameForm"; -import { - addressValueField, - blockchainValueField, - getAddressInputName, - getBlockchainInputName, - SelectAddressItem, -} from "./components/SelectAddressesTable"; -import StarnameForm from "./components/StarnameForm"; +import { addressValueField, blockchainValueField } from "./components/SelectAddressesTable"; function onSeeTrasactions(): void { history.push(TRANSACTIONS_ROUTE); @@ -187,10 +193,14 @@ interface Props { const Register = ({ entity }: Props): JSX.Element => { const [transactionId, setTransactionId] = React.useState(null); const [transactionFee, setTransactionFee] = React.useState(undefined); + const [supportedChains, setSupportedChains] = React.useState([]); const rpcEndpoint = ReactRedux.useSelector((state: RootState) => state.rpcEndpoint); const identities = ReactRedux.useSelector((state: RootState) => state.identities); - const addressesSorted = React.useMemo(() => getChainAddressPairWithNamesSorted(identities), [identities]); + const addressesSorted = React.useMemo( + () => getChainAddressPairWithNamesSorted(identities, supportedChains), + [identities, supportedChains], + ); const bnsIdentity = getBnsIdentity(identities); const iovnameAddresses: BwUsernameWithChainName | undefined = history.location.state; @@ -200,17 +210,19 @@ const Register = ({ entity }: Props): JSX.Element => { React.useEffect(() => { let isSubscribed = true; - async function getFee( + async function getFeeAndConfig( bnsIdentity: Identity, addresses: readonly ChainAddressPairWithName[], ): Promise { const fee = await getPersonalizedAddressRegistrationFee(bnsIdentity, addresses); + const config = await getConfig(); if (isSubscribed) { setTransactionFee(fee); + setSupportedChains(config.supportedChains); } } - getFee(bnsIdentity, addressesSorted); + getFeeAndConfig(bnsIdentity, addressesSorted); return () => { isSubscribed = false; @@ -261,4 +273,4 @@ const Register = ({ entity }: Props): JSX.Element => { ); }; -export default Register; +export default RegisterUsername; diff --git a/packages/bierzo-wallet/src/routes/registerName/components/index.tsx b/packages/bierzo-wallet/src/routes/registerName/components/index.tsx deleted file mode 100644 index aae64005d..000000000 --- a/packages/bierzo-wallet/src/routes/registerName/components/index.tsx +++ /dev/null @@ -1,242 +0,0 @@ -import { Fee } from "@iov/bcp"; -import { - Avatar, - Back, - Block, - Button, - Form, - FormValues, - Hairline, - Image, - makeStyles, - TextField, - Tooltip, - Typography, - useForm, -} from "medulas-react-components"; -import React from "react"; -import { amountToString } from "ui-logic"; - -import { AddressesTableProps, ChainAddressPairWithName } from "../../../components/AddressesTable"; -import PageContent from "../../../components/PageContent"; -import { BwUsernameWithChainName } from "../../addresses"; -import shield from "../assets/shield.svg"; -import SelectAddressesTable, { - getAddressInputName, - getBlockchainInputName, - SelectAddressItem, -} from "./SelectAddressesTable"; - -export const REGISTER_USERNAME_VIEW_ID = "register-username-view-id"; -export const REGISTER_USERNAME_FIELD = "register-username-field"; - -const registerIcon = shield; -const registerTooltipIcon = shield; - -const useStyles = makeStyles({ - usernameHeader: { - boxShadow: "0px 0px 14px #EDEFF4", - }, - addressesHeader: { - backgroundColor: "#31E6C9", - fontSize: "27.5px", - width: 56, - height: 56, - }, -}); - -export function NoUsernameHeader(): JSX.Element { - const classes = useStyles(); - return ( - - - yourname*iov - - - ); -} - -export function AddressesTooltipHeader(): JSX.Element { - const classes = useStyles(); - const avatarClasses = { root: classes.addressesHeader }; - return {registerTooltipIcon}; -} - -interface TooltipContentProps { - readonly header: React.ReactNode; - readonly title: string; - readonly children: React.ReactNode; -} - -export function TooltipContent({ children, title, header }: TooltipContentProps): JSX.Element { - return ( - - {header} - - - {title} - - - {children} - - - ); -} - -function getSubmitButtonCaption(fee: Fee | undefined): string { - if (fee && fee.tokens) { - return `Register for ${amountToString(fee.tokens)}`; - } - - return "Register"; -} - -function getFormInitValues(addressItems: SelectAddressItem[]): FormValues { - const initialValues: FormValues = {}; - addressItems.forEach(item => { - initialValues[getAddressInputName(item.id)] = item.chain.address; - initialValues[getBlockchainInputName(item.id)] = item.chain.chainName; - }); - - return initialValues; -} - -function getAddressItems(chainAddresses: readonly ChainAddressPairWithName[]): SelectAddressItem[] { - return chainAddresses - .filter(chain => !!chain.address) - .map((chain, index) => ({ id: index.toString(), chain })); -} - -interface Props extends AddressesTableProps { - readonly onSubmit: (values: object) => Promise; - readonly validate: (values: object) => Promise; - readonly onCancel: () => void; - readonly iovnameAddresses: BwUsernameWithChainName | undefined; - readonly transactionFee: Fee | undefined; -} - -const Layout = ({ - chainAddresses, - iovnameAddresses, - validate, - onSubmit, - onCancel, - transactionFee, -}: Props): JSX.Element => { - const chainAddressesItems = React.useMemo(() => { - if (iovnameAddresses) { - return getAddressItems(iovnameAddresses.addresses); - } - return getAddressItems(chainAddresses); - }, [chainAddresses, iovnameAddresses]); - - const initialValues = React.useMemo(() => getFormInitValues(chainAddressesItems), [chainAddressesItems]); - const { form, handleSubmit, invalid, submitting, validating } = useForm({ - onSubmit, - validate, - initialValues, - }); - - const buttons = ( - - - - - - - Cancel - - - - ); - - return ( -
- - - {iovnameAddresses && ( - - {iovnameAddresses.username} - - )} - {!iovnameAddresses && ( - - - - Create your iovname - - - - } title="Choose your address"> - With IOV you can choose your easy to read human readable address. No more complicated - cryptography when sending to friends. - - - - - How it works - - - - - - - - )} - - - - - - CHOOSE LINKED ADDRESSES - - - - - - } title="Your linked addresses"> - With Neuma you can have an universal blockchain address that is linked to all your - addresses. Just give your friends your iovname. - - - - - - - - Optional - - - - - - -
- ); -}; - -export default Layout; diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx deleted file mode 100644 index db8da3f36..000000000 --- a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Block, makeStyles, Typography } from "medulas-react-components"; -import React from "react"; - -import PageMenu from "../../components/PageMenu"; - -const useStyles = makeStyles({ - usernameHeader: { - boxShadow: "0px 0px 14px #EDEFF4", - }, -}); - -// TODO move to components when implemented, mirroring registerName -export function NoStarnameHeader(): JSX.Element { - const classes = useStyles(); - return ( - - - *yourstarname - - - ); -} - -const RegisterStarname = (): JSX.Element => { - return ( - - - Register new starname. Work in progress view - - - ); -}; - -export default RegisterStarname; From 041584a738e62d08754be5fe03b46ece3edcb323 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 18:14:27 +0200 Subject: [PATCH 005/204] Fixes --- .../src/routes/register/index.tsx | 37 ++++++++----------- .../background/model/persona/index.ts | 15 ++------ 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/register/index.tsx b/packages/bierzo-wallet/src/routes/register/index.tsx index 6ee91aec0..8e06ee5bb 100644 --- a/packages/bierzo-wallet/src/routes/register/index.tsx +++ b/packages/bierzo-wallet/src/routes/register/index.tsx @@ -1,38 +1,33 @@ import { Address, ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; import { BnsConnection } from "@iov/bns"; -import { JsonRpcRequest } from "@iov/jsonrpc"; -import { - BillboardContext, - FormValues, - ToastContext, - ToastVariant, - ValidationError, -} from "medulas-react-components"; +import { Avatar, Block, FormValues, Image, makeStyles, Typography } from "medulas-react-components"; import React from "react"; import * as ReactRedux from "react-redux"; +import { amountToString } from "ui-logic"; import { history } from ".."; -import { - generateRegisterUsernameTxRequest, - generateRegisterUsernameTxWithFee, - generateUpdateUsernameTxRequest, -} from "../../communication/requestgenerators"; +import { generateRegisterUsernameTxWithFee } from "../../communication/requestgenerators"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; -import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; import PageMenu from "../../components/PageMenu"; import { getConfig, SupportedChain } from "../../config"; -import { isValidIov } from "../../logic/account"; -import { getCodecForChainId } from "../../logic/codec"; -import { getConnectionForBns, getConnectionForChainId } from "../../logic/connection"; +import { getConnectionForChainId } from "../../logic/connection"; import { ExtendedIdentity } from "../../store/identities"; import { RootState } from "../../store/reducers"; import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; import { BwUsernameWithChainName } from "../addresses"; import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; -import Layout, { REGISTER_USERNAME_FIELD } from "./components"; +import shield from "./assets/shield.svg"; import ConfirmRegistration from "./components/ConfirmRegistration"; -import { addressValueField, blockchainValueField } from "./components/SelectAddressesTable"; +import IovnameForm from "./components/IovnameForm"; +import NameForm from "./components/NameForm"; +import { + addressValueField, + blockchainValueField, + getAddressInputName, + getBlockchainInputName, + SelectAddressItem, +} from "./components/SelectAddressesTable"; +import StarnameForm from "./components/StarnameForm"; function onSeeTrasactions(): void { history.push(TRANSACTIONS_ROUTE); @@ -273,4 +268,4 @@ const Register = ({ entity }: Props): JSX.Element => { ); }; -export default RegisterUsername; +export default Register; diff --git a/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts b/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts index a87096d73..754f59cc5 100644 --- a/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts +++ b/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts @@ -34,13 +34,7 @@ import { SoftwareAccountManagerChainConfig, } from "../accountManager/softwareAccountManager"; import { StringDb } from "../backgroundscript/db"; -import { - algorithmForCodec, - chainConnector, - codecTypeFromString, - getChains, - pathBuilderForCodec, -} from "./config"; +import { algorithmForCodec, chainConnector, getChains, pathBuilderForCodec } from "./config"; import { createTwoWalletProfile } from "./userprofilehelpers"; function isNonUndefined(t: T | undefined): t is T { @@ -158,15 +152,14 @@ export class Persona { const managerChains: SoftwareAccountManagerChainConfig[] = []; for (const chainSpec of (await getChains()).map(chain => chain.chainSpec)) { - const codecType = codecTypeFromString(chainSpec.codecType); - const connector = chainConnector(codecType, chainSpec); + const connector = chainConnector(chainSpec); try { const { connection } = await signer.addChain(connector); managerChains.push({ chainId: connection.chainId, - algorithm: algorithmForCodec(codecType), - derivePath: pathBuilderForCodec(codecType), + algorithm: algorithmForCodec(chainSpec.codecType), + derivePath: pathBuilderForCodec(chainSpec.codecType), }); } catch (e) { console.error("Could not add chain. " + e); From d6344c0519a342dce1236f90f6ee5d7ef5dcd490 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 18:35:55 +0200 Subject: [PATCH 006/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 588 +----------------- 1 file changed, 27 insertions(+), 561 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 460995a52..7be64729d 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1856,7 +1856,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames tab 1`] = ` className="MuiBox-root MuiBox-root" >
Choose Now @@ -1902,7 +1902,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames with name tab 1`] = ` />

+ Create new iovname @@ -2502,7 +2502,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with extension 1`] = ` className="MuiBox-root MuiBox-root" >

Register Now
+
+ Register your name +
@@ -2612,7 +2618,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with ledger 1`] = ` className="MuiBox-root MuiBox-root" >

starname

@@ -2728,7 +2734,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = ` className="MuiBox-root MuiBox-root" >
Register Now
+
+ Register your name +
@@ -3110,7 +3122,7 @@ exports[`Storyshots Bierzo Wallet/Balance View on ledger and without name 1`] = className="MuiBox-root MuiBox-root" >

personalized address

@@ -3344,7 +3356,7 @@ exports[`Storyshots Bierzo Wallet/Balance View without tokens and without name 1 className="MuiBox-root MuiBox-root" >
Choose Now @@ -5261,556 +5273,10 @@ exports[`Storyshots Bierzo Wallet/Payment Verified Recipient 1`] = `
`; -exports[`Storyshots Bierzo Wallet/Register Username Register Username 1`] = ` -
-
-
-
-
-
- shield -
-
-
-
- Create your iovname -
-
-
- Info -
-
-
- How it works -
-
-
-
-
-
- -
- - - -
-
-
-
-
-
-
-

- CHOOSE LINKED ADDRESSES -

-
-
-
-
- Info -
-
-
-
-
-
- Optional -
-
- - -
-

- + Add more -

-
-
-
-
-
-
- -
-
- -
-
-
-
- -`; - -exports[`Storyshots Bierzo Wallet/Register Username Register Username without fee 1`] = ` -
-
-
-
-
-
- shield -
-
-
-
- Create your iovname -
-
-
- Info -
-
-
- How it works -
-
-
-
-
-
- -
- - - -
-
-
-
-
-
-
-

- CHOOSE LINKED ADDRESSES -

-
-
-
-
- Info -
-
-
-
-
-
- Optional -
-
- - -
-

- + Add more -

-
-
-
-
-
-
- -
-
- -
-
-
-
- -`; - exports[`Storyshots Bierzo Wallet/Register Username Registration confirmation 1`] = `
- Your personalized address registration request was successfully signed and sent to the network. + Your registration request was successfully signed and sent to the network.
Date: Wed, 4 Mar 2020 18:49:43 +0200 Subject: [PATCH 007/204] Remove not used file --- .../src/routes/registerName/index.tsx | 291 ------------------ 1 file changed, 291 deletions(-) delete mode 100644 packages/bierzo-wallet/src/routes/registerName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/registerName/index.tsx b/packages/bierzo-wallet/src/routes/registerName/index.tsx deleted file mode 100644 index 5c600e8df..000000000 --- a/packages/bierzo-wallet/src/routes/registerName/index.tsx +++ /dev/null @@ -1,291 +0,0 @@ -import { Address, ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; -import { BnsConnection } from "@iov/bns"; -import { JsonRpcRequest } from "@iov/jsonrpc"; -import { - BillboardContext, - FormValues, - ToastContext, - ToastVariant, - ValidationError, -} from "medulas-react-components"; -import React from "react"; -import * as ReactRedux from "react-redux"; - -import { history } from ".."; -import { - generateRegisterUsernameTxRequest, - generateRegisterUsernameTxWithFee, - generateUpdateUsernameTxRequest, -} from "../../communication/requestgenerators"; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; -import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; -import PageMenu from "../../components/PageMenu"; -import { getConfig, SupportedChain } from "../../config"; -import { isValidIov } from "../../logic/account"; -import { getCodecForChainId } from "../../logic/codec"; -import { getConnectionForBns, getConnectionForChainId } from "../../logic/connection"; -import { ExtendedIdentity } from "../../store/identities"; -import { RootState } from "../../store/reducers"; -import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; -import { BwUsernameWithChainName } from "../addresses"; -import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; -import Layout, { REGISTER_USERNAME_FIELD } from "./components"; -import ConfirmRegistration from "./components/ConfirmRegistration"; -import { addressValueField, blockchainValueField } from "./components/SelectAddressesTable"; - -function onSeeTrasactions(): void { - history.push(TRANSACTIONS_ROUTE); -} -function onReturnToBalance(): void { - history.push(BALANCE_ROUTE); -} -function onReturnToAddresses(): void { - history.push(ADDRESSES_ROUTE); -} - -function getBnsIdentity(identities: ReadonlyMap): Identity | undefined { - for (const identity of Array.from(identities.values()).map(ext => ext.identity)) { - if (getConnectionForChainId(identity.chainId) instanceof BnsConnection) { - return identity; - } - } - return undefined; -} - -async function getPersonalizedAddressRegistrationFee( - bnsIdentity: Identity, - addresses: readonly ChainAddressPairWithName[], -): Promise { - const transactionWithFee = await generateRegisterUsernameTxWithFee(bnsIdentity, "feetest*iov", addresses); - - return transactionWithFee.fee; -} - -function getChainAddressPairsFromValues( - values: FormValues, - addresses: readonly ChainAddressPairWithName[], -): readonly ChainAddressPairWithName[] { - const chainAddressMap: Map> = new Map< - string, - Partial - >(); - Object.keys(values).forEach(key => { - const idxLenght = key.indexOf("-"); - if (idxLenght === -1) return; - - const index = key.substr(0, idxLenght); - let pair = chainAddressMap.get(index); - if (!pair) { - pair = {}; - } - - const type = key.substr(idxLenght + 1); - switch (type) { - case addressValueField: { - pair = { ...pair, address: values[key] as Address }; - break; - } - case blockchainValueField: { - const chain = addresses.find(address => address.chainName === values[key]); - if (chain) { - pair = { ...pair, chainId: chain.chainId, chainName: chain.chainName }; - } - break; - } - } - - chainAddressMap.set(index, pair); - }); - - const chainAddressPair: ChainAddressPairWithName[] = []; - chainAddressMap.forEach(value => { - if (value.address && value.chainId && value.chainName) { - chainAddressPair.push({ - address: value.address, - chainId: value.chainId, - chainName: value.chainName, - }); - } - }); - - return chainAddressPair; -} - -const RegisterUsername = (): JSX.Element => { - const [transactionId, setTransactionId] = React.useState(null); - const [transactionFee, setTransactionFee] = React.useState(undefined); - const [supportedChains, setSupportedChains] = React.useState([]); - - const billboard = React.useContext(BillboardContext); - const toast = React.useContext(ToastContext); - - const rpcEndpoint = ReactRedux.useSelector((state: RootState) => state.rpcEndpoint); - const identities = ReactRedux.useSelector((state: RootState) => state.identities); - const addressesSorted = React.useMemo( - () => getChainAddressPairWithNamesSorted(identities, supportedChains), - [identities, supportedChains], - ); - - const bnsIdentity = getBnsIdentity(identities); - const iovnameAddresses: BwUsernameWithChainName | undefined = history.location.state; - - if (!bnsIdentity) throw new Error("No BNS identity available."); - if (!rpcEndpoint) throw new Error("RPC endpoint not set in redux store. This is a bug."); - - React.useEffect(() => { - let isSubscribed = true; - async function getFeeAndConfig( - bnsIdentity: Identity, - addresses: readonly ChainAddressPairWithName[], - ): Promise { - const fee = await getPersonalizedAddressRegistrationFee(bnsIdentity, addresses); - const config = await getConfig(); - - if (isSubscribed) { - setTransactionFee(fee); - setSupportedChains(config.supportedChains); - } - } - getFeeAndConfig(bnsIdentity, addressesSorted); - - return () => { - isSubscribed = false; - }; - }, [addressesSorted, bnsIdentity]); - - const validate = async (values: object): Promise => { - const formValues = values as FormValues; - const errors: ValidationError = {}; - if (!iovnameAddresses) { - const username = formValues[REGISTER_USERNAME_FIELD]; - if (!username) { - errors[REGISTER_USERNAME_FIELD] = "Required"; - return errors; - } - - const checkResult = isValidIov(username); - - switch (checkResult) { - case "not_iov": - errors[REGISTER_USERNAME_FIELD] = "IOV starname must include *iov"; - break; - case "wrong_number_of_asterisks": - errors[REGISTER_USERNAME_FIELD] = "IOV starname must include only one namespace"; - break; - case "too_short": - errors[REGISTER_USERNAME_FIELD] = "IOV starname should be at least 3 characters"; - break; - case "too_long": - errors[REGISTER_USERNAME_FIELD] = "IOV starname should be maximum 64 characters"; - break; - case "wrong_chars": - errors[REGISTER_USERNAME_FIELD] = - "IOV starname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; - break; - case "valid": - break; - default: - throw new Error(`"Unknown IOV starname validation error: ${checkResult}`); - } - - if (checkResult !== "valid") { - return errors; - } - - const connection = await getConnectionForBns(); - const usernames = await connection.getUsernames({ username }); - if (usernames.length > 0) { - errors[REGISTER_USERNAME_FIELD] = "Personalized address already exists"; - return errors; - } - } - - const addressesToRegister = getChainAddressPairsFromValues(formValues, addressesSorted); - for (const address of addressesToRegister) { - try { - const codec = await getCodecForChainId(address.chainId); - if (!codec.isValidAddress(address.address)) { - const addressField = Object.entries(formValues).find(([_id, value]) => value === address.address); - if (addressField) { - errors[addressField[0]] = "Not valid blockchain address"; - } - } - } catch (err) { - console.info(err); - } - } - - return errors; - }; - - const onSubmit = async (values: object): Promise => { - const formValues = values as FormValues; - - const addressesToRegister = getChainAddressPairsFromValues(formValues, addressesSorted); - - try { - let request: JsonRpcRequest; - if (iovnameAddresses) { - request = await generateUpdateUsernameTxRequest( - bnsIdentity, - iovnameAddresses.username, - addressesToRegister, - ); - } else { - request = await generateRegisterUsernameTxRequest( - bnsIdentity, - formValues[REGISTER_USERNAME_FIELD], - addressesToRegister, - ); - } - if (rpcEndpoint.type === "extension") { - billboard.show( - , - "start", - "flex-end", - 0, - ); - } else { - billboard.show( - , - "center", - "center", - 0, - ); - } - const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); - if (transactionId === undefined) { - toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); - } else if (transactionId === null) { - toast.show("Request rejected", ToastVariant.ERROR); - } else { - setTransactionId(transactionId); - } - } catch (error) { - console.error(error); - toast.show("An error occurred", ToastVariant.ERROR); - } finally { - billboard.close(); - } - }; - - return ( - - {transactionId ? ( - - ) : ( - - )} - - ); -}; - -export default RegisterUsername; From c97235deee8452f1b72f7137e12c008ba1dcc9d7 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:03:02 +0100 Subject: [PATCH 008/204] Use new "iovnames" naming --- .../addresses/components/AddressesTab.tsx | 4 ++-- .../routes/addresses/components/Iovnames.tsx | 8 +++---- .../addresses/components/IovnamesExists.tsx | 12 +++-------- .../components/IovnamesNotExists.tsx | 21 ++++++++----------- .../src/routes/addresses/index.stories.tsx | 14 ++++++------- .../src/routes/addresses/index.tsx | 4 ++-- .../src/routes/balance/components/index.tsx | 6 +++--- .../src/routes/balance/index.dom.spec.ts | 2 +- .../src/routes/balance/index.stories.tsx | 10 ++++----- .../src/routes/balance/index.tsx | 4 ++-- .../src/routes/register/index.stories.tsx | 10 ++++----- 11 files changed, 43 insertions(+), 52 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx index 6c04b59f0..a394006b1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx @@ -58,7 +58,7 @@ function AddressesTab({ chainAddresses, usernames, starnames, - onRegisterUsername, + onRegisterIovname, onRegisterStarname, rpcEndpointType, }: AddressesTableProps & IovnamesProps & StarnamesProps): JSX.Element { @@ -91,7 +91,7 @@ function AddressesTab({ {selectedTab === "iovnames" && ( )} diff --git a/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx b/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx index e964d943a..65381763c 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx @@ -10,20 +10,20 @@ export const iovnamesViewId = "iovnames-view-id"; export interface IovnamesProps { readonly usernames: readonly BwUsernameWithChainName[]; - readonly onRegisterUsername: () => void; + readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; } -const Iovnames = ({ usernames, rpcEndpointType, onRegisterUsername }: IovnamesProps): JSX.Element => { +const Iovnames = ({ usernames, rpcEndpointType, onRegisterIovname }: IovnamesProps): JSX.Element => { const hasIovnames = usernames.length > 0; return ( {!hasIovnames && ( - + )} - {hasIovnames && } + {hasIovnames && } ); }; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 7b9c80a4d..cc81400d1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -20,7 +20,7 @@ import { AddressesTooltipHeader, TooltipContent } from "../../register"; interface Props { readonly usernames: readonly BwUsernameWithChainName[]; - readonly onRegisterUsername: () => void; + readonly onRegisterIovname: () => void; } const usePaper = makeStyles({ @@ -38,20 +38,14 @@ const useStyles = makeStyles({ }, }); -function IovnamesExists({ usernames, onRegisterUsername }: Props): JSX.Element { +function IovnamesExists({ usernames, onRegisterIovname }: Props): JSX.Element { const paperClasses = usePaper(); const classes = useStyles(); const toast = React.useContext(ToastContext); return ( - + + Create new iovname {usernames.map(username => { diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx index 3c968fa3e..8cbc90c0f 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx @@ -8,19 +8,19 @@ import { REGISTER_IOVNAME_ROUTE } from "../../paths"; import { NoIovnameHeader } from "../../register/components/IovnameForm"; interface StarnamesNotExistsProps { - readonly onRegisterUsername: () => void; + readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; } export function GetYourAddressWithExtension({ - onRegisterUsername, + onRegisterIovname, }: Omit): JSX.Element { return ( - You have no starnames + You have no iovnames With Neuma you can choose your easy to read human readable address. No more complicated cryptography @@ -34,7 +34,7 @@ export function GetYourAddressWithExtension({ weight="semibold" inline link - onClick={onRegisterUsername} + onClick={onRegisterIovname} > Choose Now @@ -51,7 +51,7 @@ export function GetYourAddressWithLedger(): JSX.Element { You can not register - personalized address + iovnames @@ -65,19 +65,16 @@ export function GetYourAddressWithLedger(): JSX.Element { ); } -export function GetYourAddress({ - rpcEndpointType, - onRegisterUsername, -}: StarnamesNotExistsProps): JSX.Element { +export function GetYourAddress({ rpcEndpointType, onRegisterIovname }: StarnamesNotExistsProps): JSX.Element { switch (rpcEndpointType) { case "extension": - return ; + return ; case "ledger": return ; } } -function StarnamesNotExists({ onRegisterUsername, rpcEndpointType }: StarnamesNotExistsProps): JSX.Element { +function StarnamesNotExists({ onRegisterIovname, rpcEndpointType }: StarnamesNotExistsProps): JSX.Element { const theme = useTheme(); return ( @@ -91,7 +88,7 @@ function StarnamesNotExists({ onRegisterUsername, rpcEndpointType }: StarnamesNo textAlign="center" border="1px solid #F3F3F3" > - + ); } diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index b39711d83..f7230f8da 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -6,8 +6,8 @@ import React from "react"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { - REGISTER_USERNAME_REGISTRATION_STORY_PATH, - REGISTER_USERNAME_STORY_PATH, + REGISTER_IOVNAME_REGISTRATION_STORY_PATH, + REGISTER_IOVNAME_STORY_PATH, } from "../register/index.stories"; import { BwUsernameWithChainName } from "."; import AddressesTab from "./components/AddressesTab"; @@ -55,7 +55,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) chainAddresses={chainAddresses} usernames={[]} starnames={[]} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} onRegisterStarname={() => {}} rpcEndpointType="extension" /> @@ -67,7 +67,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) chainAddresses={chainAddresses} usernames={usernames} starnames={[]} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} onRegisterStarname={() => {}} rpcEndpointType="extension" /> @@ -79,7 +79,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) chainAddresses={chainAddresses} usernames={[]} starnames={[]} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} onRegisterStarname={() => {}} rpcEndpointType="ledger" /> @@ -94,7 +94,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) @@ -103,7 +103,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index 82ba98587..7901cf59a 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -16,7 +16,7 @@ export interface BwUsernameWithChainName extends BwUsername { readonly addresses: readonly ChainAddressPairWithName[]; } -function onRegisterUsername(): void { +function onRegisterIovname(): void { history.push(REGISTER_IOVNAME_ROUTE); } @@ -79,7 +79,7 @@ const Addresses = (): JSX.Element => { chainAddresses={chainAddresses} usernames={bwNamesWithChain} starnames={[]} - onRegisterUsername={onRegisterUsername} + onRegisterIovname={onRegisterIovname} onRegisterStarname={onRegisterStarname} rpcEndpointType={rpcEndpointType} /> diff --git a/packages/bierzo-wallet/src/routes/balance/components/index.tsx b/packages/bierzo-wallet/src/routes/balance/components/index.tsx index 519191d79..8fe1b8aef 100644 --- a/packages/bierzo-wallet/src/routes/balance/components/index.tsx +++ b/packages/bierzo-wallet/src/routes/balance/components/index.tsx @@ -15,11 +15,11 @@ const walletIcon = wallet ico; interface Props { readonly iovAddress?: string; readonly balances: { [token: string]: Amount }; - readonly onRegisterUsername: () => void; + readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; } -const BalanceLayout = ({ iovAddress, balances, onRegisterUsername, rpcEndpointType }: Props): JSX.Element => { +const BalanceLayout = ({ iovAddress, balances, onRegisterIovname, rpcEndpointType }: Props): JSX.Element => { const tickersList = Object.keys(balances).sort(); const hasTokens = tickersList.length > 0; const theme = useTheme(); @@ -38,7 +38,7 @@ const BalanceLayout = ({ iovAddress, balances, onRegisterUsername, rpcEndpointTy textAlign="center" border="1px solid #F3F3F3" > - + )} diff --git a/packages/bierzo-wallet/src/routes/balance/index.dom.spec.ts b/packages/bierzo-wallet/src/routes/balance/index.dom.spec.ts index 0749fa257..aa3431bfa 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.dom.spec.ts +++ b/packages/bierzo-wallet/src/routes/balance/index.dom.spec.ts @@ -114,7 +114,7 @@ describe("The /balance route", () => { it("should show that there is no bns username available", async () => { const noUsernameMessage = getIovUsername(TestUtils.scryRenderedDOMComponentsWithTag(balanceDom, "h6")); - expect(noUsernameMessage).toBe("You have no starnames"); + expect(noUsernameMessage).toBe("You have no iovnames"); }); }); diff --git a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx index ab37450bd..c148c2b92 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx @@ -7,8 +7,8 @@ import PageMenu from "../../components/PageMenu"; import { BalanceState } from "../../store/balances"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { - REGISTER_USERNAME_REGISTRATION_STORY_PATH, - REGISTER_USERNAME_STORY_PATH, + REGISTER_IOVNAME_REGISTRATION_STORY_PATH, + REGISTER_IOVNAME_STORY_PATH, } from "../register/index.stories"; import Layout from "./components/index"; @@ -41,7 +41,7 @@ storiesOf(BALANCE_STORY_PATH, module) iovAddress={ACCOUNT_NAME} rpcEndpointType="extension" balances={BALANCE} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} /> @@ -53,7 +53,7 @@ storiesOf(BALANCE_STORY_PATH, module) iovAddress={undefined} rpcEndpointType="extension" balances={NO_BALANCE} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} /> @@ -65,7 +65,7 @@ storiesOf(BALANCE_STORY_PATH, module) iovAddress={undefined} rpcEndpointType="ledger" balances={NO_BALANCE} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} /> diff --git a/packages/bierzo-wallet/src/routes/balance/index.tsx b/packages/bierzo-wallet/src/routes/balance/index.tsx index a5ebb097b..21df48dfe 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.tsx @@ -9,7 +9,7 @@ import { getFirstUsername } from "../../store/usernames/selectors"; import { REGISTER_IOVNAME_ROUTE } from "../paths"; import Layout from "./components"; -function onRegisterUsername(): void { +function onRegisterIovname(): void { history.push(REGISTER_IOVNAME_ROUTE); } @@ -22,7 +22,7 @@ const Balance = (): JSX.Element => { return ( ( @@ -62,7 +62,7 @@ storiesOf(REGISTER_USERNAME_STORY_PATH, module) /> )) */ - .add(REGISTER_USERNAME_CONFIRMATION_STORY_PATH, () => ( + .add(REGISTER_IOVNAME_CONFIRMATION_STORY_PATH, () => ( Date: Fri, 21 Feb 2020 21:03:30 +0100 Subject: [PATCH 009/204] Fixes typo in test --- packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts b/packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts index f758f5560..2a7658ceb 100644 --- a/packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts +++ b/packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts @@ -25,7 +25,7 @@ withChainsDescribe("Usernames reducer", () => { expect(usernames).toEqual([]); }); - it("returns empty when no bns identity key is s passed to getUsernames function", async () => { + it("returns empty when no bns identity key is passed to getUsernames function", async () => { const identities: Identity[] = [ { chainId: "ethereum-eip155-5777" as ChainId, From 534447d61a512e8f83ca347f4b3c8c0af014c1b2 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:03:55 +0100 Subject: [PATCH 010/204] Adds accounts reducer --- .../src/store/accounts/reducer.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 packages/bierzo-wallet/src/store/accounts/reducer.ts diff --git a/packages/bierzo-wallet/src/store/accounts/reducer.ts b/packages/bierzo-wallet/src/store/accounts/reducer.ts new file mode 100644 index 000000000..39917091d --- /dev/null +++ b/packages/bierzo-wallet/src/store/accounts/reducer.ts @@ -0,0 +1,38 @@ +import { ChainAddressPair } from "@iov/bns"; +import { Action } from "redux"; +import { ActionType } from "typesafe-actions"; + +import * as actions from "./actions"; + +export interface BwAccount { + readonly name: string; + readonly domain: string; + readonly expiryDate: Date; + readonly addresses: readonly ChainAddressPair[]; +} + +export interface AddAccountsActionType extends Action { + readonly type: "@@accounts/ADD"; + readonly payload: readonly BwAccount[]; +} + +export type AccountsActions = ActionType; + +export type AccountsState = readonly BwAccount[]; +const initState: AccountsState = []; + +export function accountsReducer(state: AccountsState = initState, action: AccountsActions): AccountsState { + switch (action.type) { + case "@@accounts/ADD": { + const updatedAccounts = action.payload.map( + updatedAccount => `${updatedAccount.name}*${updatedAccount.domain}`, + ); + const oldAccountsToCopy = state.filter( + oldAccount => !updatedAccounts.includes(`${oldAccount.name}*${oldAccount.domain}`), + ); + return [...oldAccountsToCopy, ...action.payload]; + } + default: + return state; + } +} From f3126f92a38ebb5dc98f1bf6f5390cd0b2803395 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:04:20 +0100 Subject: [PATCH 011/204] Add accounts actions --- .../src/store/accounts/actions.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/bierzo-wallet/src/store/accounts/actions.ts diff --git a/packages/bierzo-wallet/src/store/accounts/actions.ts b/packages/bierzo-wallet/src/store/accounts/actions.ts new file mode 100644 index 000000000..472a3ec68 --- /dev/null +++ b/packages/bierzo-wallet/src/store/accounts/actions.ts @@ -0,0 +1,28 @@ +import { Identity } from "@iov/bcp"; +import { bnsCodec } from "@iov/bns"; + +import { getConnectionForBns } from "../../logic/connection"; +import { AddAccountsActionType, BwAccount } from "./reducer"; + +export async function getAccounts(identities: readonly Identity[]): Promise { + const bnsConnection = await getConnectionForBns(); + + const bnsIdentity = identities.find(ident => ident.chainId === bnsConnection.chainId); + if (!bnsIdentity) return []; + + const bnsAddress = bnsCodec.identityToAddress(bnsIdentity); + + const accounts = await bnsConnection.getAccounts({ owner: bnsAddress }); + + return accounts.map(account => ({ + name: account.name ? account.name : "", + domain: account.domain, + expiryDate: new Date(account.validUntil * 1000), + addresses: account.targets, + })); +} + +export const addAccountsAction = (accounts: readonly BwAccount[]): AddAccountsActionType => ({ + type: "@@accounts/ADD", + payload: accounts, +}); From 7d66a2f49f93975f88ef44bf3689fbedd8c45bd9 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:04:41 +0100 Subject: [PATCH 012/204] Exports accounts reducer and adds it to RootState --- packages/bierzo-wallet/src/store/accounts/index.ts | 2 ++ packages/bierzo-wallet/src/store/reducers.ts | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 packages/bierzo-wallet/src/store/accounts/index.ts diff --git a/packages/bierzo-wallet/src/store/accounts/index.ts b/packages/bierzo-wallet/src/store/accounts/index.ts new file mode 100644 index 000000000..fb205c47d --- /dev/null +++ b/packages/bierzo-wallet/src/store/accounts/index.ts @@ -0,0 +1,2 @@ +export * from "./actions"; +export * from "./reducer"; diff --git a/packages/bierzo-wallet/src/store/reducers.ts b/packages/bierzo-wallet/src/store/reducers.ts index 1930c2963..a11bdb090 100644 --- a/packages/bierzo-wallet/src/store/reducers.ts +++ b/packages/bierzo-wallet/src/store/reducers.ts @@ -1,6 +1,7 @@ import { Action, combineReducers, Reducer } from "redux"; import { ActionType } from "typesafe-actions"; +import { accountsReducer, AccountsState } from "./accounts"; import * as actions from "./actions"; import { balancesReducer, BalanceState } from "./balances"; import { identitiesReducer, IdentitiesState } from "./identities"; @@ -20,6 +21,7 @@ export interface RootState { tokens: TokenState; balances: BalanceState; usernames: UsernamesState; + accounts: AccountsState; } const allReducers = combineReducers({ @@ -29,6 +31,7 @@ const allReducers = combineReducers({ tokens: tokensReducer, balances: balancesReducer, usernames: usernamesReducer, + accounts: accountsReducer, }); const createRootReducer = (): Reducer => ( From 9a542acc5f15b8b47ca25ae5563221374f6249c0 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:04:55 +0100 Subject: [PATCH 013/204] Adds unit tests for accounts reducer --- .../src/store/accounts/index.unit.spec.ts | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 packages/bierzo-wallet/src/store/accounts/index.unit.spec.ts diff --git a/packages/bierzo-wallet/src/store/accounts/index.unit.spec.ts b/packages/bierzo-wallet/src/store/accounts/index.unit.spec.ts new file mode 100644 index 000000000..f66037e70 --- /dev/null +++ b/packages/bierzo-wallet/src/store/accounts/index.unit.spec.ts @@ -0,0 +1,117 @@ +import { Address, Algorithm, ChainId, Identity, PubkeyBytes } from "@iov/bcp"; +import { Encoding } from "@iov/encoding"; + +import { aNewStore } from ".."; +import { disconnect } from "../../logic/connection"; +import { establishAllConnections } from "../../utils/test/connections"; +import { withChainsDescribe } from "../../utils/test/testExecutor"; +import { addAccountsAction, getAccounts } from "./actions"; +import { BwAccount } from "./reducer"; + +const defaultDate = new Date(1000000000000); + +withChainsDescribe("Accounts reducer", () => { + beforeAll(async () => { + await establishAllConnections(); + }); + afterAll(() => disconnect()); + + it("has correct initial state", async () => { + const store = aNewStore(); + const accounts = store.getState().accounts; + expect(accounts).toEqual([]); + }); + + it("returns empty when no identities passed to getAccounts function", async () => { + const accounts = await getAccounts([]); + expect(accounts).toEqual([]); + }); + + it("returns empty when no bns identity key is passed to getAccounts function", async () => { + const identities: Identity[] = [ + { + chainId: "ethereum-eip155-5777" as ChainId, + pubkey: { + algo: Algorithm.Secp256k1, + data: Encoding.fromHex( + "04965fb72aad79318cd8c8c975cf18fa8bcac0c091605d10e89cd5a9f7cff564b0cb0459a7c22903119f7a42947c32c1cc6a434a86f0e26aad00ca2b2aff6ba381", + ) as PubkeyBytes, + }, + }, + ]; + + const accounts = await getAccounts(identities); + expect(accounts).toEqual([]); + }); + + describe("accountsReducer", () => { + it("can add accounts", () => { + const accountsToAdd: BwAccount[] = [ + { + name: "foobar", + domain: "fizzbuzz", + expiryDate: defaultDate, + addresses: [], + }, + ]; + + const store = aNewStore(); + expect(store.getState().accounts).toEqual([]); + store.dispatch(addAccountsAction(accountsToAdd)); + expect(store.getState().accounts).toEqual(accountsToAdd); + }); + + it("overrides existing entries", () => { + const accountsToAdd1: BwAccount[] = [ + { + name: "foobar", + domain: "fizzbuzz", + expiryDate: defaultDate, + addresses: [], + }, + ]; + const accounts: BwAccount[] = [ + { + name: "foobar", + domain: "fizzbuzz", + expiryDate: defaultDate, + addresses: [ + { + address: "aabbccdd" as Address, + chainId: "some-chain" as ChainId, + }, + ], + }, + ]; + + const store = aNewStore(); + store.dispatch(addAccountsAction(accountsToAdd1)); + store.dispatch(addAccountsAction(accounts)); + expect(store.getState().accounts).toEqual(accounts); + }); + + it("overrides keeps existing entries alive", () => { + const accountsToAdd1: BwAccount[] = [ + { + name: "foobar1", + domain: "fizzbuzz1", + expiryDate: defaultDate, + addresses: [], + }, + ]; + const accountsToAdd2: BwAccount[] = [ + { + name: "foobar2", + domain: "fizzbuzz2", + expiryDate: defaultDate, + addresses: [], + }, + ]; + + const store = aNewStore(); + store.dispatch(addAccountsAction(accountsToAdd1)); + store.dispatch(addAccountsAction(accountsToAdd2)); + expect(store.getState().accounts).toEqual([...accountsToAdd1, ...accountsToAdd2]); + }); + }); +}); From 47fe595bdff16b5c064e81c8626cdb066048cfdf Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:05:12 +0100 Subject: [PATCH 014/204] Adds accounts loading to loginBootSequence --- packages/bierzo-wallet/src/routes/login/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/bierzo-wallet/src/routes/login/index.tsx b/packages/bierzo-wallet/src/routes/login/index.tsx index eca34e218..8f6c6de87 100644 --- a/packages/bierzo-wallet/src/routes/login/index.tsx +++ b/packages/bierzo-wallet/src/routes/login/index.tsx @@ -16,6 +16,7 @@ import { subscribeBalance } from "../../logic/balances"; import { establishConnection } from "../../logic/connection"; import { drinkFaucetIfNeeded } from "../../logic/faucet"; import { subscribeTransaction } from "../../logic/transactions"; +import { addAccountsAction, getAccounts } from "../../store/accounts"; import { getBalances, setBalancesAction } from "../../store/balances"; import { setIdentities } from "../../store/identities"; import { setRpcEndpoint } from "../../store/rpcendpoint"; @@ -53,6 +54,9 @@ export const loginBootSequence = async ( const usernames = await getUsernames(identities); dispatch(addUsernamesAction(usernames)); + + const accounts = await getAccounts(identities); + dispatch(addAccountsAction(accounts)); }; /** From c2b772a4931d753d0806d7da35dadd3508e52abb Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:15:57 +0100 Subject: [PATCH 015/204] Adapt to new names --- .../src/routes/addresses/components/AddressesTab.tsx | 4 ++-- .../src/routes/addresses/components/Iovnames.tsx | 10 +++++----- .../src/routes/addresses/components/Starnames.tsx | 6 +++--- .../src/routes/addresses/index.stories.tsx | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx index a394006b1..9224c0be1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx @@ -56,7 +56,7 @@ function TabItem({ children, selected, onChangeTab }: TabItemProps): JSX.Element function AddressesTab({ chainAddresses, - usernames, + iovnames, starnames, onRegisterIovname, onRegisterStarname, @@ -90,7 +90,7 @@ function AddressesTab({ )} {selectedTab === "iovnames" && ( diff --git a/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx b/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx index 65381763c..3e3ded39e 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx @@ -1,21 +1,21 @@ import { Block } from "medulas-react-components"; import React from "react"; -import { BwUsernameWithChainName } from ".."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; +import { BwUsername } from "../../../store/usernames"; import IovnamesExists from "./IovnamesExists"; import IovnamesNotExists from "./IovnamesNotExists"; export const iovnamesViewId = "iovnames-view-id"; export interface IovnamesProps { - readonly usernames: readonly BwUsernameWithChainName[]; + readonly iovnames: readonly BwUsername[]; readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; } -const Iovnames = ({ usernames, rpcEndpointType, onRegisterIovname }: IovnamesProps): JSX.Element => { - const hasIovnames = usernames.length > 0; +const Iovnames = ({ iovnames, rpcEndpointType, onRegisterIovname }: IovnamesProps): JSX.Element => { + const hasIovnames = iovnames.length > 0; return ( @@ -23,7 +23,7 @@ const Iovnames = ({ usernames, rpcEndpointType, onRegisterIovname }: IovnamesPro {!hasIovnames && ( )} - {hasIovnames && } + {hasIovnames && } ); }; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx b/packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx index c8d770280..ec1e13fbf 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx @@ -1,15 +1,15 @@ import { Block } from "medulas-react-components"; import React from "react"; -import { BwUsernameWithChainName } from ".."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; +import { BwAccount } from "../../../store/accounts"; import StarnamesExists from "./StarnamesExists"; import StarnamesNotExists from "./StarnamesNotExists"; export const starnamesViewId = "starnames-view-id"; export interface StarnamesProps { - readonly starnames: readonly BwUsernameWithChainName[]; + readonly starnames: readonly BwAccount[]; readonly onRegisterStarname: () => void; readonly rpcEndpointType: RpcEndpointType; } @@ -23,7 +23,7 @@ const Starnames = ({ starnames, rpcEndpointType, onRegisterStarname }: Starnames {!hasStarnames && ( )} - {hasStarnames && } + {hasStarnames && } ); }; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index f7230f8da..40f2519f1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -53,7 +53,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} @@ -65,7 +65,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} @@ -77,7 +77,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} @@ -93,7 +93,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) .add("Iovnames tab", () => ( @@ -102,7 +102,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) .add("Iovnames with name tab", () => ( From 340abcff89e1c49721b7f0f91cea6bc73d2033c0 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:17:08 +0100 Subject: [PATCH 016/204] Adds query to Redux for starnames. Removes unneeded data. --- .../src/routes/addresses/index.tsx | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index 7901cf59a..e2d952985 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -1,10 +1,9 @@ -import React, { useEffect, useState } from "react"; +import React from "react"; import * as ReactRedux from "react-redux"; import { history } from ".."; import { ChainAddressPairWithName } from "../../components/AddressesTable"; import PageMenu from "../../components/PageMenu"; -import { getChainName } from "../../config"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { BwUsername } from "../../store/usernames"; @@ -25,41 +24,6 @@ function onRegisterStarname(): void { } const Addresses = (): JSX.Element => { - const bwNames = ReactRedux.useSelector((state: RootState) => state.usernames); - const [bwNamesWithChain, setBwNamesWithChain] = useState([]); - - useEffect(() => { - let isSubscribed = true; - async function insertChainNames(): Promise { - if (isSubscribed) { - const bwNamesWithChain: BwUsernameWithChainName[] = await Promise.all( - bwNames.map(async name => { - return { - username: name.username, - addresses: await Promise.all( - name.addresses.map(async address => { - return { - chainId: address.chainId, - address: address.address, - chainName: await getChainName(address.chainId), - }; - }), - ), - }; - }), - ); - - setBwNamesWithChain(bwNamesWithChain); - } - } - insertChainNames(); - - return () => { - isSubscribed = false; - }; - }, [bwNames]); - - const rpcEndpointType = ReactRedux.useSelector(getRpcEndpointType); const identities = ReactRedux.useSelector((state: RootState) => state.identities); const supportedChains = React.useMemo( @@ -72,13 +36,16 @@ const Addresses = (): JSX.Element => { ); const chainAddresses = getChainAddressPairWithNames(identities, supportedChains); + const iovnames = ReactRedux.useSelector((state: RootState) => state.usernames); + const starnames = ReactRedux.useSelector((state: RootState) => state.accounts); + const rpcEndpointType = ReactRedux.useSelector(getRpcEndpointType); return ( Date: Fri, 21 Feb 2020 23:17:24 +0100 Subject: [PATCH 017/204] Add logos for iovnames and starnames --- packages/bierzo-wallet/src/assets/iovname-logo.svg | 7 +++++++ packages/bierzo-wallet/src/assets/starname-logo.svg | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 packages/bierzo-wallet/src/assets/iovname-logo.svg create mode 100644 packages/bierzo-wallet/src/assets/starname-logo.svg diff --git a/packages/bierzo-wallet/src/assets/iovname-logo.svg b/packages/bierzo-wallet/src/assets/iovname-logo.svg new file mode 100644 index 000000000..2da2dcdee --- /dev/null +++ b/packages/bierzo-wallet/src/assets/iovname-logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/bierzo-wallet/src/assets/starname-logo.svg b/packages/bierzo-wallet/src/assets/starname-logo.svg new file mode 100644 index 000000000..783bc8d48 --- /dev/null +++ b/packages/bierzo-wallet/src/assets/starname-logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + From b6e973c530aac6a31cfc5344d952697b358e904b Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:17:50 +0100 Subject: [PATCH 018/204] Adds new design to iovname list --- .../addresses/components/IovnamesExists.tsx | 129 +++++++----------- 1 file changed, 51 insertions(+), 78 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index cc81400d1..9fb74f716 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -1,113 +1,86 @@ import Paper from "@material-ui/core/Paper"; -import clipboardCopy from "clipboard-copy"; -import { - Block, - Image, - makeStyles, - ToastContext, - ToastVariant, - Tooltip, - Typography, -} from "medulas-react-components"; +import { Block, Image, makeStyles, Typography } from "medulas-react-components"; import React from "react"; -import { BwUsernameWithChainName } from ".."; import { history } from "../.."; -import AddressesTable from "../../../components/AddressesTable"; -import copy from "../../../components/AddressesTable/assets/copy.svg"; +import iovnameLogo from "../../../assets/iovname-logo.svg"; +import { BwUsername } from "../../../store/usernames"; import { REGISTER_IOVNAME_ROUTE } from "../../paths"; -import { AddressesTooltipHeader, TooltipContent } from "../../register"; interface Props { - readonly usernames: readonly BwUsernameWithChainName[]; + readonly iovnames: readonly BwUsername[]; readonly onRegisterIovname: () => void; } const usePaper = makeStyles({ rounded: { borderRadius: "5px", + height: "100%", }, elevation1: { boxShadow: "none", }, }); -const useStyles = makeStyles({ - link: { - cursor: "pointer", - }, -}); - -function IovnamesExists({ usernames, onRegisterIovname }: Props): JSX.Element { +function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { const paperClasses = usePaper(); - const classes = useStyles(); - const toast = React.useContext(ToastContext); return ( - - + Create new iovname - - {usernames.map(username => { - const onIovnameCopy = (): void => { - clipboardCopy(username.username); - toast.show("Iovname has been copied to clipboard.", ToastVariant.INFO); - }; - - const onEdit = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, username); + + + + Iovname Logo + + + Register a new iovname + + + + Register now + + + + {iovnames.map(iovname => { + const onManage = (): void => { + history.push(REGISTER_IOVNAME_ROUTE, iovname); }; return ( - - + + + - - - {username.username} - - - - Copy - - - - - {username.addresses.length > 0 ? "LINKED ADDRESSES" : "NO LINKED ADDRESSES"} - - - - } title="Your linked addresses"> - With IOV you can have an universal blockchain address that is linked to all your - addresses. Just give your friends your personalized address. - - - - - {username.addresses.length > 0 ? "Edit" : "Link Now"} - - - - - {username.addresses.length > 0 && } + + {iovname.username} + + + Manage + - + ); })} From cd0fd354e05511e7e7a8e52f9a64398a412e49c7 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:18:00 +0100 Subject: [PATCH 019/204] Adds new design to starnames list --- .../addresses/components/StarnamesExists.tsx | 93 ++++++++++++++++++- 1 file changed, 90 insertions(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index ba9a0554e..8a9dadc53 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -1,8 +1,95 @@ -import { Typography } from "medulas-react-components"; +import Paper from "@material-ui/core/Paper"; +import { Block, Image, makeStyles, Typography } from "medulas-react-components"; import React from "react"; -function StarnamesExists(): JSX.Element { - return There are some starnames. Work in progress view; +import { history } from "../.."; +import starnameLogo from "../../../assets/starname-logo.svg"; +import { BwAccount } from "../../../store/accounts"; +import { REGISTER_STARNAME_ROUTE } from "../../paths"; + +interface Props { + readonly starnames: readonly BwAccount[]; + readonly onRegisterStarname: () => void; +} + +const usePaper = makeStyles({ + rounded: { + borderRadius: "5px", + }, + elevation1: { + boxShadow: "none", + }, +}); + +function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element { + const paperClasses = usePaper(); + + return ( + + + + + Iovname Logo + + + Register a new starname + + + + Register now + + + + {starnames.map(starname => { + const onManage = (): void => { + history.push(REGISTER_STARNAME_ROUTE, starname); + }; + + return ( + + + + + + + {`${starname.name}*${starname.domain}`} + + + + Expires on {starname.expiryDate.toLocaleDateString()} + + + + Manage + + + + + ); + })} + + ); } export default StarnamesExists; From 3e079f0329e5314d12b6ad5c884aea8186ee328b Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:45:53 +0100 Subject: [PATCH 020/204] Fixes key prop --- .../src/routes/addresses/components/IovnamesExists.tsx | 4 ++-- .../src/routes/addresses/components/StarnamesExists.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 9fb74f716..05de69544 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -54,9 +54,9 @@ function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { }; return ( - + - + + - + Date: Fri, 21 Feb 2020 23:47:41 +0100 Subject: [PATCH 021/204] Updates storybook snapshots --- .../src/__snapshots__/Storyshots.test.js.snap | 572 +++--------------- 1 file changed, 72 insertions(+), 500 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 7be64729d..bd3c30ad1 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1870,7 +1870,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames tab 1`] = `
- You have no starnames + You have no iovnames

-

- + Create new iovname -

-
-

- test1*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
+ Iovname Logo
- - - - - - - - - - - - - - -
- Blockchain - - Address - -
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
+ Register a new iovname +
+

+ Register now +

+
-
-
-

- test2*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - - - - - - -
- Blockchain - - Address - -
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
- Lisk Devnet - - 1349293588603668134L - -
- Copy -
-
-
+ test1*iov + +
+ Manage +
+
-
-
-

- test3*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- Blockchain - - Address - -
- Ganache - - 0xD383382350F9f190Bd2608D6381B15b4e1cec0f3 - -
- Copy -
-
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
- Lisk Devnet - - 1349293588603668134L - -
- Copy -
-
-
+ test2*iov + +
+ Manage +
+
+
+
+
+
+
+ test3*iov +
+
+ Manage +
@@ -3142,7 +2714,7 @@ exports[`Storyshots Bierzo Wallet/Balance View on ledger and without name 1`] = className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-body1 MuiTypography-colorPrimary" id="/register-iovname" > - personalized address + iovnames

- You have no starnames + You have no iovnames

`; -exports[`Storyshots Bierzo Wallet/Register Username Registration confirmation 1`] = ` +exports[`Storyshots Bierzo Wallet/Register Iovname Registration confirmation 1`] = `

Date: Mon, 24 Feb 2020 23:51:55 +0100 Subject: [PATCH 022/204] Fixes e2e test to expect "iovnames" --- packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts b/packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts index 5af490a1e..4b0eb3541 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts +++ b/packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts @@ -59,7 +59,7 @@ withChainsDescribe("E2E > Balance route", () => { it("should contain message to get address", async () => { const username = await getAddressCreationPromptE2E(await page.$$("h6")); - expect(username).toBe("You have no starnames"); + expect(username).toBe("You have no iovnames"); }, 45000); it("should create personalized address", async () => { From 2cca2b83198f2f1b0d59fcf24e7e0be889a8ccfd Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 24 Feb 2020 23:52:22 +0100 Subject: [PATCH 023/204] Fixes e2e test to remove copy functionality --- .../bierzo-wallet/src/routes/addresses/index.e2e.spec.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts b/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts index 8d68cf3f5..dfb5fd0b7 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts +++ b/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts @@ -11,7 +11,6 @@ import { registerPersonalizedAddress, waitForAllBalances } from "../balance/test import { travelToBalanceE2E } from "../balance/test/travelToBalance"; import { copyAddress, - copyStarname, getAddressRow, getLinkedAddresses, getRemoveActions, @@ -118,13 +117,6 @@ withChainsDescribe("E2E > Receive Payment route", () => { }, 35000); it("should check username open it and remove last address", async () => { - await copyStarname(page); - - expect(clipboardy.readSync()).toBe(username); - - const toastMessage = await getToastMessage(page); - expect(toastMessage).toBe("Iovname has been copied to clipboard."); - await closeToast(page); const addresses = await getLinkedAddresses(page); await openFirstStarnameForEditingE2E(page, username); From 7959eab4073fd681fc7801fc5e133a7053258774 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 24 Feb 2020 23:52:54 +0100 Subject: [PATCH 024/204] Fixes test util to search for "Manage" --- .../src/routes/addresses/test/travelToReceivePayment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts index 345800556..70786557e 100644 --- a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts +++ b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts @@ -27,7 +27,7 @@ export async function travelToStarnamesTabE2E(page: Page): Promise { } export async function openFirstStarnameForEditingE2E(page: Page, username: string): Promise { - const [firstStarnameEditLink] = await page.$x(`//h6[contains(., 'Edit')]`); + const [firstStarnameEditLink] = await page.$x(`//h6[contains(., 'Manage')]`); await firstStarnameEditLink.click(); await page.waitForSelector(`#${REGISTER_IOVNAME_VIEW_ID}`); } From fae5f4bf4710ff3c37966675bbeb62becf19e248 Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 26 Feb 2020 22:40:42 +0100 Subject: [PATCH 025/204] Sorts iovnames --- .../addresses/components/IovnamesExists.tsx | 73 ++++++++++--------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 05de69544..7dc1ce253 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -48,41 +48,48 @@ function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { - {iovnames.map(iovname => { - const onManage = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, iovname); - }; + {iovnames + .slice() + .sort((a, b) => { + if (a.username < b.username) return -1; + if (a.username > b.username) return 1; + return 0; + }) + .map(iovname => { + const onManage = (): void => { + history.push(REGISTER_IOVNAME_ROUTE, iovname); + }; - return ( - - - - - - {iovname.username} - - + + + - Manage - - - - - ); - })} + + {iovname.username} + + + Manage + + + + + ); + })} ); } From 8e29cfb4d3dfd0a6ec72e01bc0697e20e6a46b07 Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 26 Feb 2020 22:41:10 +0100 Subject: [PATCH 026/204] Sorts starnames --- .../addresses/components/StarnamesExists.tsx | 83 ++++++++++--------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 7bc5b5c53..2ac74bf6c 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -47,47 +47,54 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element - {starnames.map(starname => { - const onManage = (): void => { - history.push(REGISTER_STARNAME_ROUTE, starname); - }; + {starnames + .slice() + .sort((a, b) => { + if (`${a.name}*${a.domain}` < `${b.name}*${b.domain}`) return -1; + if (`${a.name}*${a.domain}` > `${b.name}*${b.domain}`) return 1; + return 0; + }) + .map(starname => { + const onManage = (): void => { + history.push(REGISTER_STARNAME_ROUTE, starname); + }; - return ( - - - - - - - {`${starname.name}*${starname.domain}`} - - - - Expires on {starname.expiryDate.toLocaleDateString()} + return ( + + + + + + + {`${starname.name}*${starname.domain}`} + + + + Expires on {starname.expiryDate.toLocaleDateString()} + + + + Manage - - Manage - - - - - ); - })} + + + ); + })} ); } From 19c4a7c4f5d6d0542854264bf13caf5abcecb46c Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 26 Feb 2020 22:41:57 +0100 Subject: [PATCH 027/204] Adds temporary Register Name link --- .../addresses/components/StarnamesExists.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 2ac74bf6c..20b7ba5d2 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -5,7 +5,7 @@ import React from "react"; import { history } from "../.."; import starnameLogo from "../../../assets/starname-logo.svg"; import { BwAccount } from "../../../store/accounts"; -import { REGISTER_STARNAME_ROUTE } from "../../paths"; +import { REGISTER_NAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../paths"; interface Props { readonly starnames: readonly BwAccount[]; @@ -45,6 +45,19 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element Register now + {/* TODO remove this Typography when /register-name accessible from starname list */} + { + history.push(REGISTER_NAME_ROUTE); + }} + > + Register your name + {starnames From 10c70c444344cfb6ab09329efb5ac37f6f537533 Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 26 Feb 2020 22:42:22 +0100 Subject: [PATCH 028/204] Adds account dispatch to Tx subscription --- .../src/logic/transactions/index.ts | 92 ++++++++++++++++--- 1 file changed, 77 insertions(+), 15 deletions(-) diff --git a/packages/bierzo-wallet/src/logic/transactions/index.ts b/packages/bierzo-wallet/src/logic/transactions/index.ts index 7bcc498f9..9a2715746 100644 --- a/packages/bierzo-wallet/src/logic/transactions/index.ts +++ b/packages/bierzo-wallet/src/logic/transactions/index.ts @@ -1,15 +1,86 @@ -import { ChainId, Identity, isFailedTransaction } from "@iov/bcp"; -import { isRegisterUsernameTx, isUpdateTargetsOfUsernameTx } from "@iov/bns"; +import { ChainId, Identity, isFailedTransaction, UnsignedTransaction } from "@iov/bcp"; +import { + isRegisterAccountTx, + isRegisterDomainTx, + isRegisterUsernameTx, + isReplaceAccountTargetsTx, + isUpdateTargetsOfUsernameTx, +} from "@iov/bns"; import { Dispatch } from "redux"; import { Subscription } from "xstream"; import { getConfig } from "../../config"; +import { addAccountsAction, BwAccount } from "../../store/accounts"; import { addTransaction } from "../../store/notifications"; import { addUsernamesAction, BwUsername } from "../../store/usernames"; import { getCodec } from "../codec"; -import { getConnectionForChainId } from "../connection"; +import { getConnectionForBns, getConnectionForChainId } from "../connection"; import { BwParserFactory } from "./types/BwParserFactory"; +function mayDispatchUsername(dispatch: Dispatch, usernameTx: UnsignedTransaction): void { + if (isRegisterUsernameTx(usernameTx) || isUpdateTargetsOfUsernameTx(usernameTx)) { + const username: BwUsername = { + username: usernameTx.username, + addresses: usernameTx.targets, + }; + + dispatch(addUsernamesAction([username])); + } +} + +async function mayDispatchAccount(dispatch: Dispatch, accountTx: UnsignedTransaction): Promise { + if (isRegisterDomainTx(accountTx)) { + const nowInMs = new Date().getTime(); + const accountRenewInMs = accountTx.accountRenew * 1000; + // TODO not sure if precise, since getting from current time + const expiryDate = new Date(nowInMs + accountRenewInMs); + + const account: BwAccount = { + name: "", + domain: accountTx.domain, + expiryDate: expiryDate, + addresses: [], + }; + + dispatch(addAccountsAction([account])); + } + + if (isRegisterAccountTx(accountTx)) { + const connection = await getConnectionForBns(); + const domains = await connection.getDomains({ name: accountTx.domain }); + if (domains.length !== 1) throw Error("Did not find unique domain"); + + const nowInMs = new Date().getTime(); + const accountRenewInMs = domains[0].accountRenew * 1000; + // TODO not sure if precise, since getting from current time + const expiryDate = new Date(nowInMs + accountRenewInMs); + + const account: BwAccount = { + name: accountTx.name, + domain: accountTx.domain, + expiryDate: expiryDate, + addresses: accountTx.targets, + }; + + dispatch(addAccountsAction([account])); + } + + if (isReplaceAccountTargetsTx(accountTx)) { + const connection = await getConnectionForBns(); + const accounts = await connection.getAccounts({ name: accountTx.name, domain: accountTx.domain }); + if (accounts.length !== 1) throw Error("Did not find unique account"); + + const account: BwAccount = { + name: accounts[0].name || "", + domain: accounts[0].domain, + expiryDate: new Date(accounts[0].validUntil * 1000), + addresses: accounts[0].targets, + }; + + dispatch(addAccountsAction([account])); + } +} + let txsSubscriptions: Subscription[] = []; export async function subscribeTransaction( @@ -38,18 +109,9 @@ export async function subscribeTransaction( const bwTransaction = BwParserFactory.getBwTransactionFrom(tx); const parsedTx = await bwTransaction.parse(connection, tx, address); - if ( - !isFailedTransaction(tx) && - (isRegisterUsernameTx(parsedTx.original) || isUpdateTargetsOfUsernameTx(parsedTx.original)) - ) { - const usernameTx = parsedTx.original; - const usernames: BwUsername[] = [ - { - username: usernameTx.username, - addresses: usernameTx.targets, - }, - ]; - dispatch(addUsernamesAction(usernames)); + if (!isFailedTransaction(tx)) { + mayDispatchUsername(dispatch, parsedTx.original); + await mayDispatchAccount(dispatch, parsedTx.original); } dispatch(addTransaction(parsedTx)); }, From 3fb6c31084564e42949b5a32baf17a97cfdd8227 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 15:51:40 +0200 Subject: [PATCH 029/204] Changes from previous branch --- .../src/routes/registerStarName/index.tsx | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx new file mode 100644 index 000000000..db8da3f36 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx @@ -0,0 +1,34 @@ +import { Block, makeStyles, Typography } from "medulas-react-components"; +import React from "react"; + +import PageMenu from "../../components/PageMenu"; + +const useStyles = makeStyles({ + usernameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +// TODO move to components when implemented, mirroring registerName +export function NoStarnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + *yourstarname + + + ); +} + +const RegisterStarname = (): JSX.Element => { + return ( + + + Register new starname. Work in progress view + + + ); +}; + +export default RegisterStarname; From 49e1c089af4d7bc335947475e97e3532d4c6319b Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 18:54:30 +0200 Subject: [PATCH 030/204] Refactor transaction assets --- .../BwRegisterUsernameTx/ui => }/assets/dropdownArrow.svg | 0 .../ui => }/assets/dropdownArrowClose.svg | 0 .../BwRegisterUsernameTx/ui => }/assets/transactionSend.svg | 0 .../{types/BwRegisterUsernameTx/ui => }/assets/user.svg | 0 .../BwRegisterUsernameTx/ui/TransactionHeader/index.tsx | 2 +- .../types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx | 6 +++--- .../types/BwSendTransaction/ui/SendTxHeader/index.tsx | 2 +- .../types/BwSendTransaction/ui/SendTxRow/index.tsx | 6 +++--- .../types/BwSendTransaction/ui/assets/dropdownArrow.svg | 3 --- .../BwSendTransaction/ui/assets/dropdownArrowClose.svg | 3 --- .../types/BwSendTransaction/ui/assets/transactionSend.svg | 4 ---- .../transactions/types/BwSendTransaction/ui/assets/user.svg | 1 - .../ui/TransactionHeader/index.tsx | 2 +- .../BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx | 6 +++--- .../BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg | 3 --- .../ui/assets/dropdownArrowClose.svg | 3 --- .../BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg | 4 ---- .../types/BwUpdateUsernameTargetsTx/ui/assets/user.svg | 1 - 18 files changed, 12 insertions(+), 34 deletions(-) rename packages/bierzo-wallet/src/logic/transactions/{types/BwRegisterUsernameTx/ui => }/assets/dropdownArrow.svg (100%) rename packages/bierzo-wallet/src/logic/transactions/{types/BwRegisterUsernameTx/ui => }/assets/dropdownArrowClose.svg (100%) rename packages/bierzo-wallet/src/logic/transactions/{types/BwRegisterUsernameTx/ui => }/assets/transactionSend.svg (100%) rename packages/bierzo-wallet/src/logic/transactions/{types/BwRegisterUsernameTx/ui => }/assets/user.svg (100%) delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrow.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrowClose.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/transactionSend.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/user.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrowClose.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/user.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/dropdownArrow.svg b/packages/bierzo-wallet/src/logic/transactions/assets/dropdownArrow.svg similarity index 100% rename from packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/dropdownArrow.svg rename to packages/bierzo-wallet/src/logic/transactions/assets/dropdownArrow.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/dropdownArrowClose.svg b/packages/bierzo-wallet/src/logic/transactions/assets/dropdownArrowClose.svg similarity index 100% rename from packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/dropdownArrowClose.svg rename to packages/bierzo-wallet/src/logic/transactions/assets/dropdownArrowClose.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/transactionSend.svg b/packages/bierzo-wallet/src/logic/transactions/assets/transactionSend.svg similarity index 100% rename from packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/transactionSend.svg rename to packages/bierzo-wallet/src/logic/transactions/assets/transactionSend.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/user.svg b/packages/bierzo-wallet/src/logic/transactions/assets/user.svg similarity index 100% rename from packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/user.svg rename to packages/bierzo-wallet/src/logic/transactions/assets/user.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionHeader/index.tsx index b7600a76f..f70b79a7e 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionHeader/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionHeader/index.tsx @@ -6,8 +6,8 @@ import { Block, Hairline, Image } from "medulas-react-components"; import * as React from "react"; import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; import { ProcessedTx } from "../../../../types/BwParser"; -import sendTx from "../assets/transactionSend.svg"; import Msg from "./MsgSuccess"; interface ItemProps { diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx index cf2fdb281..3eae3f51a 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx @@ -7,10 +7,10 @@ import { amountToString } from "ui-logic"; import { getBorderColor } from "../../../../../../theme/css"; import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; import { ProcessedTx } from "../../../../types/BwParser"; -import dropdownArrow from "../assets/dropdownArrow.svg"; -import dropdownArrowClose from "../assets/dropdownArrowClose.svg"; -import txIcon from "../assets/user.svg"; import TxDetails from "./Details"; const useStyles = makeStyles({ diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxHeader/index.tsx index c1990f43f..10ea612c2 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxHeader/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxHeader/index.tsx @@ -9,8 +9,8 @@ import { history } from "../../../../../../routes"; import { PAYMENT_ROUTE } from "../../../../../../routes/paths"; import { ProcessedSendTransaction } from "../../../../../../store/notifications"; import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; import receiveTx from "../assets/transactionReceive.svg"; -import sendTx from "../assets/transactionSend.svg"; import Msg from "./MsgSuccess"; interface ItemProps { diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxRow/index.tsx index dce5c471c..9f23d3e31 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxRow/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxRow/index.tsx @@ -9,9 +9,9 @@ import { getAddressPrefix } from "../../../../../../routes/transactions/componen import { ProcessedSendTransaction } from "../../../../../../store/notifications"; import { getBorderColor } from "../../../../../../theme/css"; import { formatDate } from "../../../../../../utils/date"; -import dropdownArrow from "../assets/dropdownArrow.svg"; -import dropdownArrowClose from "../assets/dropdownArrowClose.svg"; -import txIcon from "../assets/user.svg"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; import SendTxDetails from "./Details"; const useStyles = makeStyles((theme: Theme) => ({ diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrow.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrow.svg deleted file mode 100644 index 05df80ca2..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrowClose.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrowClose.svg deleted file mode 100644 index 882aca9a4..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrowClose.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/transactionSend.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/transactionSend.svg deleted file mode 100644 index 59dae02f8..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/transactionSend.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/user.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/user.svg deleted file mode 100644 index b9df657f4..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/user.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionHeader/index.tsx index 3a4c206e9..43da70a0c 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionHeader/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionHeader/index.tsx @@ -6,8 +6,8 @@ import { Block, Hairline, Image } from "medulas-react-components"; import * as React from "react"; import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; import { ProcessedTx } from "../../../BwParser"; -import sendTx from "../assets/transactionSend.svg"; import Msg from "./MsgSuccess"; interface ItemProps { diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx index ac7350316..99e529e23 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx @@ -7,10 +7,10 @@ import { amountToString } from "ui-logic"; import { getBorderColor } from "../../../../../../theme/css"; import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; import { ProcessedTx } from "../../../BwParser"; -import dropdownArrow from "../assets/dropdownArrow.svg"; -import dropdownArrowClose from "../assets/dropdownArrowClose.svg"; -import txIcon from "../assets/user.svg"; import TxDetails from "./Details"; const useStyles = makeStyles({ diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg deleted file mode 100644 index 05df80ca2..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrowClose.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrowClose.svg deleted file mode 100644 index 882aca9a4..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrowClose.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg deleted file mode 100644 index 59dae02f8..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/user.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/user.svg deleted file mode 100644 index b9df657f4..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/user.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file From 978be1a8d6a29b1294810d77a69f97428f8cbe8e Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 18:56:42 +0200 Subject: [PATCH 031/204] Refactor parse method --- .../src/logic/transactions/types/BwParser.ts | 20 ++++++++++++++++--- .../types/BwRegisterUsernameTx/index.tsx | 16 --------------- .../types/BwUnkownTransaction/index.tsx | 17 +--------------- .../types/BwUpdateUsernameTargetsTx/index.tsx | 16 --------------- 4 files changed, 18 insertions(+), 51 deletions(-) diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwParser.ts b/packages/bierzo-wallet/src/logic/transactions/types/BwParser.ts index 44c13f1fa..7e6bfef54 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwParser.ts +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwParser.ts @@ -3,6 +3,7 @@ import { BlockchainConnection, ConfirmedTransaction, FailedTransaction, + isFailedTransaction, TransactionId, UnsignedTransaction, } from "@iov/bcp"; @@ -15,11 +16,24 @@ export interface ProcessedTx { - abstract async parse( + public async parse( conn: BlockchainConnection, transaction: ConfirmedTransaction | FailedTransaction, - currentUserAddress: Address, - ): Promise>; + _: Address, + ): Promise> { + if (isFailedTransaction(transaction)) { + throw new Error("Not supported error txs for now"); + } + + const header = await conn.getBlockHeader(transaction.height); + const time = header.time; + + return { + id: transaction.transactionId, + time, + original: transaction.transaction, + }; + } abstract graphicalRepresentation(tx: ProcessedTx, addresses: Address[]): JSX.Element; abstract headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element; } diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/index.tsx index 4c4f1a407..cf605c96f 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/index.tsx @@ -1,4 +1,3 @@ -import { Address, BlockchainConnection, ConfirmedTransaction } from "@iov/bcp"; import { RegisterUsernameTx } from "@iov/bns"; import * as React from "react"; @@ -7,21 +6,6 @@ import TransactionHeader from "./ui/TransactionHeader"; import TransactionRow from "./ui/TransactionRow"; export class BwRegisterUsernameParser extends BwParser { - public async parse( - conn: BlockchainConnection, - trans: ConfirmedTransaction, - _: Address, - ): Promise> { - const header = await conn.getBlockHeader(trans.height); - const time = header.time; - - return { - id: trans.transactionId, - time, - original: trans.transaction, - }; - } - public graphicalRepresentation(tx: ProcessedTx): JSX.Element { return ; } diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUnkownTransaction/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUnkownTransaction/index.tsx index 9f0a56aa2..57ffd0a99 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUnkownTransaction/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUnkownTransaction/index.tsx @@ -1,4 +1,4 @@ -import { Address, BlockchainConnection, ConfirmedTransaction, UnsignedTransaction } from "@iov/bcp"; +import { UnsignedTransaction } from "@iov/bcp"; import * as React from "react"; import { BwParser, ProcessedTx } from "../../types/BwParser"; @@ -6,21 +6,6 @@ import UnkownTransactionHeader from "./ui/UnknownTxHeader"; import UnkownTransactionRow from "./ui/UnknownTxRow"; export class BwUnkownParser extends BwParser { - public async parse( - conn: BlockchainConnection, - trans: ConfirmedTransaction, - _currentAddress: Address, - ): Promise> { - const header = await conn.getBlockHeader(trans.height); - const time = header.time; - - return { - time, - id: trans.transactionId, - original: trans.transaction, - }; - } - public graphicalRepresentation(tx: ProcessedTx): JSX.Element { return ; } diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/index.tsx index 7b27a1983..82f2cf149 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/index.tsx @@ -1,4 +1,3 @@ -import { Address, BlockchainConnection, ConfirmedTransaction } from "@iov/bcp"; import { UpdateTargetsOfUsernameTx } from "@iov/bns"; import * as React from "react"; @@ -7,21 +6,6 @@ import TransactionHeader from "./ui/TransactionHeader"; import TransactionRow from "./ui/TransactionRow"; export class BwUpdateUsernameTargetParser extends BwParser { - public async parse( - conn: BlockchainConnection, - trans: ConfirmedTransaction, - _: Address, - ): Promise> { - const header = await conn.getBlockHeader(trans.height); - const time = header.time; - - return { - id: trans.transactionId, - time, - original: trans.transaction, - }; - } - public graphicalRepresentation(tx: ProcessedTx): JSX.Element { return ; } From 3d8942fb3d5afb1876eab767ef0e58cf26e1b44e Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 18:57:08 +0200 Subject: [PATCH 032/204] Add RegisterDomainTx to storybook --- .../src/routes/transactions/index.stories.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index 87cb255db..9897a0eae 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -1,5 +1,5 @@ import { Address, ChainId, Token, TokenTicker, TransactionId } from "@iov/bcp"; -import { RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; +import { RegisterDomainTx, RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; import { Sha256 } from "@iov/crypto"; import { Encoding, Uint64 } from "@iov/encoding"; import { action } from "@storybook/addon-actions"; @@ -65,6 +65,23 @@ function makeExampleLiskTransactionId(): TransactionId { return Uint64.fromNumber(2347199254740991 + txCount++).toString() as TransactionId; } +const incomingNewDomainTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/register_domain", + chainId: chainIdIov, + domain: "test", + admin: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + hasSuperuser: true, + msgFees: [], + accountRenew: 2 * 3600, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + const incomingSendTransaction: ProcessedSendTransaction = { time: new ReadonlyDate("2018-01-01T03:02:01.763Z"), id: makeExampleEthTransactionId(), @@ -114,7 +131,9 @@ const parsedTxs: readonly ( | ProcessedSendTransaction | ProcessedTx | ProcessedTx + | ProcessedTx )[] = [ + incomingNewDomainTransaction, incomingSendTransaction, voteTx, { From fb5332dc3240ee2f9609466ea950d857418a4995 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 18:57:28 +0200 Subject: [PATCH 033/204] Add RegisterDomainTx parser and components --- .../transactions/types/BwParserFactory.ts | 9 ++ .../types/BwRegisterDomainTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 6 files changed, 265 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts index 584430bf8..ce1caf28e 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts @@ -8,14 +8,17 @@ import { UnsignedTransaction, } from "@iov/bcp"; import { + isRegisterDomainTx, isRegisterUsernameTx, isUpdateTargetsOfUsernameTx, + RegisterDomainTx, RegisterUsernameTx, UpdateTargetsOfUsernameTx, } from "@iov/bns"; import { ProcessedSendTransaction } from "../../../store/notifications"; import { BwParser, ProcessedTx } from "../types/BwParser"; +import { BwRegisterDomainParser } from "./BwRegisterDomainTx"; import { BwRegisterUsernameParser } from "./BwRegisterUsernameTx"; import { BwSendParser } from "./BwSendTransaction"; import { BwUnkownParser } from "./BwUnkownTransaction"; @@ -33,6 +36,10 @@ function isProcessedUpdateUsernameTargetsTx(tx: ProcessedTx): tx is ProcessedTx< return isUpdateTargetsOfUsernameTx(tx.original); } +function isProcessedRegisterDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isRegisterDomainTx(tx.original); +} + export class BwParserFactory { public static getReactComponent(tx: ProcessedTx, userAddresses: readonly Address[]): JSX.Element { if (isProcessedSendTransaction(tx)) { @@ -41,6 +48,8 @@ export class BwParserFactory { return new BwRegisterUsernameParser().graphicalRepresentation(tx); } else if (isProcessedUpdateUsernameTargetsTx(tx)) { return new BwUpdateUsernameTargetParser().graphicalRepresentation(tx); + } else if (isProcessedRegisterDomainTx(tx)) { + return new BwRegisterDomainParser().graphicalRepresentation(tx); } return new BwUnkownParser().graphicalRepresentation(tx); diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/index.tsx new file mode 100644 index 000000000..8238172b7 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/index.tsx @@ -0,0 +1,16 @@ +import { RegisterDomainTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../../types/BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwRegisterDomainParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..e3e0ae58f --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + starname has been registered + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..fd2a9254d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { RegisterDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../../types/BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..f2fecbe90 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { RegisterDomainTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../../types/BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Registered starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..95cf6603e --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { RegisterDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../../types/BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Starname registration + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 49ea5762fdb36918be49a9f49712c61a8fac8c18 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 25 Feb 2020 10:34:44 +0200 Subject: [PATCH 034/204] Add date duration formatter --- packages/bierzo-wallet/src/utils/date.ts | 16 +++++++++++++++ .../bierzo-wallet/src/utils/date.unit.spec.ts | 20 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 packages/bierzo-wallet/src/utils/date.unit.spec.ts diff --git a/packages/bierzo-wallet/src/utils/date.ts b/packages/bierzo-wallet/src/utils/date.ts index afeeaf095..025adaf21 100644 --- a/packages/bierzo-wallet/src/utils/date.ts +++ b/packages/bierzo-wallet/src/utils/date.ts @@ -11,6 +11,22 @@ export function formatTime(date: ReadonlyDate): string { return `${hours}:${minutes > 9 ? minutes : `0${minutes}`} ${ampm}`; } +export function formatDuration(duration: number): string { + const seconds = duration % 60; + const totalMinutes = (duration - seconds) / 60; + const minutes = totalMinutes % 60; + const totalHours = (totalMinutes - minutes) / 60; + const hours = totalHours % 24; + const days = (totalHours - hours) / 24; + + const daysPart = `${days ? `${days}:` : ""}`; + const hoursPart = `${hours ? `${hours > 9 ? hours : `0${hours}`}:` : ""}`; + const minutesPart = `${minutes ? `${minutes > 9 ? minutes : `0${minutes}`}:` : ""}`; + const secondsPart = `${seconds > 9 ? seconds : `0${seconds}`}`; + + return `${daysPart}${hoursPart}${minutesPart}${secondsPart}`; +} + export function formatDate(date: ReadonlyDate): string { const monthNames: readonly string[] = [ "Jan", diff --git a/packages/bierzo-wallet/src/utils/date.unit.spec.ts b/packages/bierzo-wallet/src/utils/date.unit.spec.ts new file mode 100644 index 000000000..1f5cbf244 --- /dev/null +++ b/packages/bierzo-wallet/src/utils/date.unit.spec.ts @@ -0,0 +1,20 @@ +import { formatDuration } from "./date"; + +describe("Date utils", () => { + describe("formatDuration", () => { + it("should return correct value if less than day", async () => { + const duration = formatDuration(30917); + expect(duration).toEqual("08:35:17"); + }); + + it("should return correct value if less than hour", async () => { + const duration = formatDuration(2117); + expect(duration).toEqual("35:17"); + }); + + it("should return correct value if more than day", async () => { + const duration = formatDuration(462917); + expect(duration).toEqual("5:08:35:17"); + }); + }); +}); From 85fb8d933a6719bfaf510fc086efeb3b214559cd Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 25 Feb 2020 10:35:06 +0200 Subject: [PATCH 035/204] Add TX additional fields --- .../ui/TransactionRow/Details.tsx | 44 ++++++++++++++++++- .../src/routes/transactions/index.stories.tsx | 5 ++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx index f2fecbe90..762ed48f9 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx @@ -4,7 +4,7 @@ import { Block, Typography } from "medulas-react-components"; import * as React from "react"; import { amountToString } from "ui-logic"; -import { formatTime } from "../../../../../../utils/date"; +import { formatDuration, formatTime } from "../../../../../../utils/date"; import { ProcessedTx } from "../../../../types/BwParser"; const useStyles = makeStyles({ @@ -63,7 +63,47 @@ const TxDetails = ({ tx }: Props): JSX.Element => {   - + + + Has Superuser: + + + {tx.original.hasSuperuser ? "Yes" : "No"} + + + + + Broker: + + + {tx.original.broker ? tx.original.broker : "-"} + + + + + Account Renew: + + + {formatDuration(tx.original.accountRenew)} + + + +   + + + + Fee: + + {tx.original.msgFees.map(fee => ( + + {`${fee.msgPath} (${amountToString(fee.fee)})`} + + ))} + + +   + + Transaction id: diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index 9897a0eae..4ea369df5 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -74,7 +74,10 @@ const incomingNewDomainTransaction: ProcessedTx = { domain: "test", admin: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, hasSuperuser: true, - msgFees: [], + msgFees: [ + { msgPath: "path-1", fee: stringToAmount("2", iov) }, + { msgPath: "path-2", fee: stringToAmount("3", iov) }, + ], accountRenew: 2 * 3600, fee: { tokens: stringToAmount("100", iov), From 79b2a7842fe12febf67517d86acccf052bb05068 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 25 Feb 2020 10:38:04 +0200 Subject: [PATCH 036/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index bd3c30ad1..a3ce8ecca 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -5077,6 +5077,79 @@ Array [
+
+
+
+
+
+ Transaction type +
+
+
+ Starname registration +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
@@ -5703,7 +5776,7 @@ Array [ className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-subtitle2 MuiTypography-colorSecondary" > The transaction ID is: - CD04A4754498E06DB5A13C5F371F1F04FF6D2470F24AA9BD886540E5DCE77F70 + D5688A52D55A02EC4AEA5EC1EADFFFE1C9E0EE6A4DDBE2377F98326D42DFC975
From 9755ac10a44479e1368eb7958fadd85c6bd0b562 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 26 Feb 2020 11:56:58 +0200 Subject: [PATCH 037/204] Add CreateAccount TX support --- .../transactions/types/BwParserFactory.ts | 13 ++ .../types/BwRegisterAccountTx/index.tsx | 16 +++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 ++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++ .../ui/TransactionRow/Details.tsx | 111 ++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 ++++++++++++++ .../src/routes/transactions/index.stories.tsx | 34 +++++- 7 files changed, 335 insertions(+), 1 deletion(-) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts index ce1caf28e..3ba698992 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts @@ -8,9 +8,11 @@ import { UnsignedTransaction, } from "@iov/bcp"; import { + isRegisterAccountTx, isRegisterDomainTx, isRegisterUsernameTx, isUpdateTargetsOfUsernameTx, + RegisterAccountTx, RegisterDomainTx, RegisterUsernameTx, UpdateTargetsOfUsernameTx, @@ -18,6 +20,7 @@ import { import { ProcessedSendTransaction } from "../../../store/notifications"; import { BwParser, ProcessedTx } from "../types/BwParser"; +import { BwRegisterAccountParser } from "./BwRegisterAccountTx"; import { BwRegisterDomainParser } from "./BwRegisterDomainTx"; import { BwRegisterUsernameParser } from "./BwRegisterUsernameTx"; import { BwSendParser } from "./BwSendTransaction"; @@ -40,6 +43,10 @@ function isProcessedRegisterDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isRegisterAccountTx(tx.original); +} + export class BwParserFactory { public static getReactComponent(tx: ProcessedTx, userAddresses: readonly Address[]): JSX.Element { if (isProcessedSendTransaction(tx)) { @@ -50,6 +57,8 @@ export class BwParserFactory { return new BwUpdateUsernameTargetParser().graphicalRepresentation(tx); } else if (isProcessedRegisterDomainTx(tx)) { return new BwRegisterDomainParser().graphicalRepresentation(tx); + } else if (isProcessedRegisterAccountTx(tx)) { + return new BwRegisterAccountParser().graphicalRepresentation(tx); } return new BwUnkownParser().graphicalRepresentation(tx); @@ -62,6 +71,10 @@ export class BwParserFactory { return new BwRegisterUsernameParser().headerRepresentation(tx, lastOne); } else if (isProcessedUpdateUsernameTargetsTx(tx)) { return new BwUpdateUsernameTargetParser().headerRepresentation(tx, lastOne); + } else if (isProcessedRegisterDomainTx(tx)) { + return new BwRegisterDomainParser().headerRepresentation(tx, lastOne); + } else if (isProcessedRegisterAccountTx(tx)) { + return new BwRegisterAccountParser().headerRepresentation(tx, lastOne); } return new BwUnkownParser().headerRepresentation(tx, lastOne); diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/index.tsx new file mode 100644 index 000000000..923ec48ac --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/index.tsx @@ -0,0 +1,16 @@ +import { RegisterAccountTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../../types/BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwRegisterAccountParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..3a1105071 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account has been registered + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..610e473a2 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { RegisterAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../../types/BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..4e0f07c5b --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,111 @@ +import { ChainAddressPair, RegisterAccountTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString, ellipsifyMiddle } from "ui-logic"; + +import { ChainAddressPairWithName } from "../../../../../../components/AddressesTable"; +import { formatTime } from "../../../../../../utils/date"; +import { chainAddressPairSortedMapping } from "../../../../../../utils/tokens"; +import { ProcessedTx } from "../../../../types/BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + const [addresses, setAddresses] = React.useState([]); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + React.useEffect(() => { + async function processAddresses(addresses: readonly ChainAddressPair[]): Promise { + const chainAddresses = await chainAddressPairSortedMapping(addresses); + setAddresses(chainAddresses); + } + processAddresses(tx.original.targets); + }, [tx.original.targets]); + + return ( + + + + + Registered account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Blockchain: + + {addresses.map(chain => ( + + {`${chain.chainName} (${ellipsifyMiddle(chain.address, 20)})`} + + ))} + + + + Broker: + + + {tx.original.broker ? tx.original.broker : "-"} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..26d7ac80a --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { RegisterAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../../types/BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account registration + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index 4ea369df5..ed3de2778 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -1,5 +1,5 @@ import { Address, ChainId, Token, TokenTicker, TransactionId } from "@iov/bcp"; -import { RegisterDomainTx, RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; +import { RegisterAccountTx, RegisterDomainTx, RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; import { Sha256 } from "@iov/crypto"; import { Encoding, Uint64 } from "@iov/encoding"; import { action } from "@storybook/addon-actions"; @@ -85,6 +85,36 @@ const incomingNewDomainTransaction: ProcessedTx = { }, }; +const incomingRegisterAccountTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/register_account", + chainId: chainIdIov, + domain: "test", + name: "account", + owner: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + targets: [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "13751834438426525516L" as Address, + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0x695874053fcB8D9cF038ee4E53b7b24fB0baFa4c" as Address, + }, + ], + broker: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + const incomingSendTransaction: ProcessedSendTransaction = { time: new ReadonlyDate("2018-01-01T03:02:01.763Z"), id: makeExampleEthTransactionId(), @@ -135,7 +165,9 @@ const parsedTxs: readonly ( | ProcessedTx | ProcessedTx | ProcessedTx + | ProcessedTx )[] = [ + incomingRegisterAccountTransaction, incomingNewDomainTransaction, incomingSendTransaction, voteTx, From 3c98aaca029ef5098b45572d8facc4570f881d6b Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 26 Feb 2020 12:59:30 +0200 Subject: [PATCH 038/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index a3ce8ecca..52a2324f4 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -5077,6 +5077,79 @@ Array [
+
+
+
+
+
+ Transaction type +
+
+
+ Account registration +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
@@ -5776,7 +5849,7 @@ Array [ className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-subtitle2 MuiTypography-colorSecondary" > The transaction ID is: - D5688A52D55A02EC4AEA5EC1EADFFFE1C9E0EE6A4DDBE2377F98326D42DFC975 + 8005F02D43FA06E7D0585FB64C961D57E318B27A145C857BCD3A6BDB413FF7FC
From bce7bb6357d45e12c9326400ca7937113fb4df51 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:29:17 +0100 Subject: [PATCH 039/204] Support for UpdateAccountConfigurationTx --- .../BwUpdateAccountConfigurationTx/index.tsx | 16 +++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 ++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++ .../ui/TransactionRow/Details.tsx | 119 ++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++ 5 files changed, 297 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/index.tsx new file mode 100644 index 000000000..69af935ed --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/index.tsx @@ -0,0 +1,16 @@ +import { UpdateAccountConfigurationTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwUpdateAccountConfigurationParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..9534f6942 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account configuration has been updated + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..aad01e183 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { UpdateAccountConfigurationTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..3d0e8d8e1 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,119 @@ +import { UpdateAccountConfigurationTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + const renewDate = new Date(tx.original.configuration.domainRenew * 1000).toLocaleDateString(); + + return ( + + + + + Updated account configuration: + + + {tx.original.configuration.validName}*{tx.original.configuration.validDomain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Blockchain ID: + + + {tx.original.configuration.validBlockchainId} + + + + + Blockchain Address: + + + {tx.original.configuration.validBlockchainAddress} + + + +   + + + + Owner: + + + {tx.original.configuration.owner} + + + + + Renew: + + + {renewDate} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..e5f849e63 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { UpdateAccountConfigurationTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account configuration update + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 21bd5a9d9c5fb822c6f4f15db52468189cd74cfb Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:30:24 +0100 Subject: [PATCH 040/204] Support for TransferDomainTx --- .../types/BwTransferDomainTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 90 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 ++++++++++++++++++ 5 files changed, 267 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/index.tsx new file mode 100644 index 000000000..1f784039e --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/index.tsx @@ -0,0 +1,16 @@ +import { TransferDomainTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwTransferDomainParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..f6bcf357a --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + starname has been transferred + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..52210fbc3 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { TransferDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..9b4cc7abe --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,90 @@ +import { TransferDomainTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Transferred starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + New owner: + + + {tx.original.newAdmin} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..c25ef25cb --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { TransferDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Starname transfer + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From d9a538e0e31c55b4d6a1359a3dff07a821a49c8a Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:30:56 +0100 Subject: [PATCH 041/204] Support for RenewDomainTx --- .../types/BwRenewDomainTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 256 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/index.tsx new file mode 100644 index 000000000..349a7bd9d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/index.tsx @@ -0,0 +1,16 @@ +import { RenewDomainTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwRenewDomainParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..30da22802 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + starname has been renewed + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..f163b74e9 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { RenewDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..ab9992479 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { RenewDomainTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Renewed starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..ab46e923f --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { RenewDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Starname renewal + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 8c5e678a985aeda4700ba1858cccc194ff7ff704 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:31:10 +0100 Subject: [PATCH 042/204] Support for DeleteDomainTx --- .../types/BwDeleteDomainTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 256 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/index.tsx new file mode 100644 index 000000000..700147bc1 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/index.tsx @@ -0,0 +1,16 @@ +import { DeleteDomainTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwDeleteDomainParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..d9b74f3c3 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + starname has been deleted + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..d784a8248 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { DeleteDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..a5a728598 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { DeleteDomainTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Deleted starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..eb899c59a --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { DeleteDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Starname deletion + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 67ab5e22df1d771ce0aa2fc0c4367a579a8742d2 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:31:34 +0100 Subject: [PATCH 043/204] Support for TransferAccountTx --- .../types/BwTransferAccountTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 90 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 ++++++++++++++++++ 5 files changed, 268 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/index.tsx new file mode 100644 index 000000000..76e638409 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/index.tsx @@ -0,0 +1,16 @@ +import { TransferAccountTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwTransferAccountParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..50c91dacc --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account has been transferred + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..429e06c8d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { TransferAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..94b7dd81d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,90 @@ +import { TransferAccountTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Transferred account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + New owner: + + + {tx.original.newOwner} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..f3e1c85eb --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { TransferAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account transfer + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From a1d74214b73fe406daccd438950dd7676f5cdb12 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:31:58 +0100 Subject: [PATCH 044/204] Support for ReplaceAccountTargetsTx --- .../types/BwReplaceAccountTargetsTx/index.tsx | 16 +++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 ++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++ .../ui/TransactionRow/Details.tsx | 103 ++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++ 5 files changed, 281 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/index.tsx new file mode 100644 index 000000000..79a916ac2 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/index.tsx @@ -0,0 +1,16 @@ +import { ReplaceAccountTargetsTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwReplaceAccountTargetsParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..0e2f8ecd7 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account targets have been updated + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..dd25c40d0 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { ReplaceAccountTargetsTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..e0eee4b78 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,103 @@ +import { ChainAddressPair, ReplaceAccountTargetsTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString, ellipsifyMiddle } from "ui-logic"; + +import { ChainAddressPairWithName } from "../../../../../../components/AddressesTable"; +import { formatTime } from "../../../../../../utils/date"; +import { chainAddressPairSortedMapping } from "../../../../../../utils/tokens"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + const [addresses, setAddresses] = React.useState([]); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + React.useEffect(() => { + async function processAddresses(addresses: readonly ChainAddressPair[]): Promise { + const chainAddresses = await chainAddressPairSortedMapping(addresses); + setAddresses(chainAddresses); + } + processAddresses(tx.original.newTargets); + }, [tx.original.newTargets]); + + return ( + + + + + Registered account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Blockchain: + + {addresses.map(chain => ( + + {`${chain.chainName} (${ellipsifyMiddle(chain.address, 20)})`} + + ))} + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..0c66cff85 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { ReplaceAccountTargetsTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account targets update + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From ef0b49aced341dd733f955fd8638173331648f9d Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:32:15 +0100 Subject: [PATCH 045/204] Support for DeleteAccountTx --- .../types/BwDeleteAccountTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 257 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/index.tsx new file mode 100644 index 000000000..c4c383475 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/index.tsx @@ -0,0 +1,16 @@ +import { DeleteAccountTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwDeleteAccountParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..ca7291a62 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account has been deleted + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..ece5b86dd --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { DeleteAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..5a2d3677a --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { DeleteAccountTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Deleted account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..892631667 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { DeleteAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account deletion + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 994c1caa858dced16ce963f068f56b5a591d4006 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:32:26 +0100 Subject: [PATCH 046/204] Support for DeleteAllAccountsTx --- .../types/BwDeleteAllAccountsTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 256 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/index.tsx new file mode 100644 index 000000000..9a98a8517 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/index.tsx @@ -0,0 +1,16 @@ +import { DeleteAllAccountsTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwDeleteAllAccountsParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..41a7c5921 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + all accounts have been deleted + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..2633fce0e --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { DeleteAllAccountsTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..8050667a9 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { DeleteAllAccountsTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + All accounts deleted for starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..59e30ba76 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { DeleteAllAccountsTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + All accounts deletion + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From d6154a1bcccd1059501226e32fb4806726107840 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:32:50 +0100 Subject: [PATCH 047/204] Support for RenewAccountTx --- .../types/BwRenewAccountTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 257 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/index.tsx new file mode 100644 index 000000000..eb83f1ef9 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/index.tsx @@ -0,0 +1,16 @@ +import { RenewAccountTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwRenewAccountParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..580b992bc --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account has been renewed + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..d0d2f35a0 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { RenewAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..310933254 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { RenewAccountTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Renewed account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..56a89797c --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { RenewAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account renewal + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From f20d08990e602492e796d674daf10208af2bb3b0 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:33:05 +0100 Subject: [PATCH 048/204] Support for AddAccountCertificateTx --- .../types/BwAddAccountCertificateTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 94 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++ 5 files changed, 272 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/index.tsx new file mode 100644 index 000000000..c89953438 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/index.tsx @@ -0,0 +1,16 @@ +import { AddAccountCertificateTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwAddAccountCertificateParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..3e1728efa --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account certificate has been added + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..868422ca2 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { AddAccountCertificateTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..9849e6c0f --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,94 @@ +import { AddAccountCertificateTx } from "@iov/bns"; +import { Encoding } from "@iov/encoding"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, + certificateBlock: { + wordBreak: "break-all", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Updated certificate from account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Certificate: + + + {Encoding.toBase64(tx.original.certificate)} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..addbf6a82 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { AddAccountCertificateTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Add certificate to account + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From a703271182c27781989c7f713a14aa9524f8d248 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:33:18 +0100 Subject: [PATCH 049/204] Support for ReplaceAccountMsgFeesTx --- .../types/BwReplaceAccountMsgFeesTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 92 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++ 5 files changed, 269 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/index.tsx new file mode 100644 index 000000000..eb98743fe --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/index.tsx @@ -0,0 +1,16 @@ +import { ReplaceAccountMsgFeesTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwReplaceAccountMsgFeesParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..664a49c21 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + fees have been updated + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..0d51cf414 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { ReplaceAccountMsgFeesTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..2f1973bf4 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,92 @@ +import { ReplaceAccountMsgFeesTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Updated fees for accounts in: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Fees: + + {tx.original.newMsgFees.map(msgFee => ( + + {`${msgFee.msgPath}: ${amountToString(msgFee.fee)}`} + + ))} + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..bae6fb8d5 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { ReplaceAccountMsgFeesTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Fees update for accounts + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 0cbb336606d80aff5ee51119d4103e66f89f013a Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:33:30 +0100 Subject: [PATCH 050/204] Support for DeleteAccountCertificateTx --- .../BwDeleteAccountCertificateTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 94 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++ 5 files changed, 272 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/index.tsx new file mode 100644 index 000000000..d5ac7d9b7 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/index.tsx @@ -0,0 +1,16 @@ +import { DeleteAccountCertificateTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwDeleteAccountCertificateParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..88bc86988 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account certificate has been deleted + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..8f99aab3c --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { DeleteAccountCertificateTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..999a4c73d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,94 @@ +import { DeleteAccountCertificateTx } from "@iov/bns"; +import { Encoding } from "@iov/encoding"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, + certificateBlock: { + wordBreak: "break-all", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Deleted certificate from account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Certificate hash: + + + {Encoding.toBase64(tx.original.certificateHash)} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..7485d30d4 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { DeleteAccountCertificateTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Delete certificate from account + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 66e65167edaabae7884fc3ee6b9ace179a08faab Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:34:25 +0100 Subject: [PATCH 051/204] Adds parsing support for new Tx types --- .../transactions/types/BwParserFactory.ts | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts index 3ba698992..ab67e1797 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts @@ -8,23 +8,59 @@ import { UnsignedTransaction, } from "@iov/bcp"; import { + AddAccountCertificateTx, + DeleteAccountCertificateTx, + DeleteAccountTx, + DeleteAllAccountsTx, + DeleteDomainTx, + isAddAccountCertificateTx, + isDeleteAccountCertificateTx, + isDeleteAccountTx, + isDeleteAllAccountsTx, + isDeleteDomainTx, isRegisterAccountTx, isRegisterDomainTx, isRegisterUsernameTx, + isRenewAccountTx, + isRenewDomainTx, + isReplaceAccountMsgFeesTx, + isReplaceAccountTargetsTx, + isTransferAccountTx, + isTransferDomainTx, + isUpdateAccountConfigurationTx, isUpdateTargetsOfUsernameTx, RegisterAccountTx, RegisterDomainTx, RegisterUsernameTx, + RenewAccountTx, + RenewDomainTx, + ReplaceAccountMsgFeesTx, + ReplaceAccountTargetsTx, + TransferAccountTx, + TransferDomainTx, + UpdateAccountConfigurationTx, UpdateTargetsOfUsernameTx, } from "@iov/bns"; import { ProcessedSendTransaction } from "../../../store/notifications"; import { BwParser, ProcessedTx } from "../types/BwParser"; +import { BwAddAccountCertificateParser } from "./BwAddAccountCertificateTx"; +import { BwDeleteAccountCertificateParser } from "./BwDeleteAccountCertificateTx"; +import { BwDeleteAccountParser } from "./BwDeleteAccountTx"; +import { BwDeleteAllAccountsParser } from "./BwDeleteAllAccountsTx"; +import { BwDeleteDomainParser } from "./BwDeleteDomainTx"; import { BwRegisterAccountParser } from "./BwRegisterAccountTx"; import { BwRegisterDomainParser } from "./BwRegisterDomainTx"; import { BwRegisterUsernameParser } from "./BwRegisterUsernameTx"; +import { BwRenewAccountParser } from "./BwRenewAccountTx"; +import { BwRenewDomainParser } from "./BwRenewDomainTx"; +import { BwReplaceAccountMsgFeesParser } from "./BwReplaceAccountMsgFeesTx"; +import { BwReplaceAccountTargetsParser } from "./BwReplaceAccountTargetsTx"; import { BwSendParser } from "./BwSendTransaction"; +import { BwTransferAccountParser } from "./BwTransferAccountTx"; +import { BwTransferDomainParser } from "./BwTransferDomainTx"; import { BwUnkownParser } from "./BwUnkownTransaction"; +import { BwUpdateAccountConfigurationParser } from "./BwUpdateAccountConfigurationTx"; import { BwUpdateUsernameTargetParser } from "./BwUpdateUsernameTargetsTx"; function isProcessedSendTransaction(tx: ProcessedTx): tx is ProcessedSendTransaction { @@ -43,10 +79,62 @@ function isProcessedRegisterDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isTransferDomainTx(tx.original); +} + +function isProcessedRenewDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isRenewDomainTx(tx.original); +} + +function isProcessedDeleteDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isDeleteDomainTx(tx.original); +} + function isProcessedRegisterAccountTx(tx: ProcessedTx): tx is ProcessedTx { return isRegisterAccountTx(tx.original); } +function isProcessedTransferAccountTx(tx: ProcessedTx): tx is ProcessedTx { + return isTransferAccountTx(tx.original); +} + +function isProcessedReplaceAccountTargetsTx(tx: ProcessedTx): tx is ProcessedTx { + return isReplaceAccountTargetsTx(tx.original); +} + +function isProcessedDeleteAccountTx(tx: ProcessedTx): tx is ProcessedTx { + return isDeleteAccountTx(tx.original); +} + +function isProcessedDeleteAllAccountsTx(tx: ProcessedTx): tx is ProcessedTx { + return isDeleteAllAccountsTx(tx.original); +} + +function isProcessedRenewAccountTx(tx: ProcessedTx): tx is ProcessedTx { + return isRenewAccountTx(tx.original); +} + +function isProcessedAddAccountCertificateTx(tx: ProcessedTx): tx is ProcessedTx { + return isAddAccountCertificateTx(tx.original); +} + +function isProcessedReplaceAccountMsgFeesTx(tx: ProcessedTx): tx is ProcessedTx { + return isReplaceAccountMsgFeesTx(tx.original); +} + +function isProcessedDeleteAccountCertificateTx( + tx: ProcessedTx, +): tx is ProcessedTx { + return isDeleteAccountCertificateTx(tx.original); +} + +function isProcessedUpdateAccountConfigurationTx( + tx: ProcessedTx, +): tx is ProcessedTx { + return isUpdateAccountConfigurationTx(tx.original); +} + export class BwParserFactory { public static getReactComponent(tx: ProcessedTx, userAddresses: readonly Address[]): JSX.Element { if (isProcessedSendTransaction(tx)) { @@ -57,8 +145,32 @@ export class BwParserFactory { return new BwUpdateUsernameTargetParser().graphicalRepresentation(tx); } else if (isProcessedRegisterDomainTx(tx)) { return new BwRegisterDomainParser().graphicalRepresentation(tx); + } else if (isProcessedTransferDomainTx(tx)) { + return new BwTransferDomainParser().graphicalRepresentation(tx); + } else if (isProcessedRenewDomainTx(tx)) { + return new BwRenewDomainParser().graphicalRepresentation(tx); + } else if (isProcessedDeleteDomainTx(tx)) { + return new BwDeleteDomainParser().graphicalRepresentation(tx); } else if (isProcessedRegisterAccountTx(tx)) { return new BwRegisterAccountParser().graphicalRepresentation(tx); + } else if (isProcessedTransferAccountTx(tx)) { + return new BwTransferAccountParser().graphicalRepresentation(tx); + } else if (isProcessedReplaceAccountTargetsTx(tx)) { + return new BwReplaceAccountTargetsParser().graphicalRepresentation(tx); + } else if (isProcessedDeleteAccountTx(tx)) { + return new BwDeleteAccountParser().graphicalRepresentation(tx); + } else if (isProcessedDeleteAllAccountsTx(tx)) { + return new BwDeleteAllAccountsParser().graphicalRepresentation(tx); + } else if (isProcessedRenewAccountTx(tx)) { + return new BwRenewAccountParser().graphicalRepresentation(tx); + } else if (isProcessedAddAccountCertificateTx(tx)) { + return new BwAddAccountCertificateParser().graphicalRepresentation(tx); + } else if (isProcessedReplaceAccountMsgFeesTx(tx)) { + return new BwReplaceAccountMsgFeesParser().graphicalRepresentation(tx); + } else if (isProcessedDeleteAccountCertificateTx(tx)) { + return new BwDeleteAccountCertificateParser().graphicalRepresentation(tx); + } else if (isProcessedUpdateAccountConfigurationTx(tx)) { + return new BwUpdateAccountConfigurationParser().graphicalRepresentation(tx); } return new BwUnkownParser().graphicalRepresentation(tx); @@ -73,8 +185,32 @@ export class BwParserFactory { return new BwUpdateUsernameTargetParser().headerRepresentation(tx, lastOne); } else if (isProcessedRegisterDomainTx(tx)) { return new BwRegisterDomainParser().headerRepresentation(tx, lastOne); + } else if (isProcessedTransferDomainTx(tx)) { + return new BwTransferDomainParser().headerRepresentation(tx, lastOne); + } else if (isProcessedRenewDomainTx(tx)) { + return new BwRenewDomainParser().headerRepresentation(tx, lastOne); + } else if (isProcessedDeleteDomainTx(tx)) { + return new BwDeleteDomainParser().headerRepresentation(tx, lastOne); } else if (isProcessedRegisterAccountTx(tx)) { return new BwRegisterAccountParser().headerRepresentation(tx, lastOne); + } else if (isProcessedTransferAccountTx(tx)) { + return new BwTransferAccountParser().headerRepresentation(tx, lastOne); + } else if (isProcessedReplaceAccountTargetsTx(tx)) { + return new BwReplaceAccountTargetsParser().headerRepresentation(tx, lastOne); + } else if (isProcessedDeleteAccountTx(tx)) { + return new BwDeleteAccountParser().headerRepresentation(tx, lastOne); + } else if (isProcessedDeleteAllAccountsTx(tx)) { + return new BwDeleteAllAccountsParser().headerRepresentation(tx, lastOne); + } else if (isProcessedRenewAccountTx(tx)) { + return new BwRenewAccountParser().headerRepresentation(tx, lastOne); + } else if (isProcessedAddAccountCertificateTx(tx)) { + return new BwAddAccountCertificateParser().headerRepresentation(tx, lastOne); + } else if (isProcessedReplaceAccountMsgFeesTx(tx)) { + return new BwReplaceAccountMsgFeesParser().headerRepresentation(tx, lastOne); + } else if (isProcessedDeleteAccountCertificateTx(tx)) { + return new BwDeleteAccountCertificateParser().headerRepresentation(tx, lastOne); + } else if (isProcessedUpdateAccountConfigurationTx(tx)) { + return new BwUpdateAccountConfigurationParser().headerRepresentation(tx, lastOne); } return new BwUnkownParser().headerRepresentation(tx, lastOne); From d704caeef129aab9daf027619708c94225f3dcf5 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:34:50 +0100 Subject: [PATCH 052/204] Adds new Tx types to storybook --- .../src/routes/transactions/index.stories.tsx | 265 +++++++++++++++++- 1 file changed, 263 insertions(+), 2 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index ed3de2778..84cb02bee 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -1,5 +1,23 @@ import { Address, ChainId, Token, TokenTicker, TransactionId } from "@iov/bcp"; -import { RegisterAccountTx, RegisterDomainTx, RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; +import { + AddAccountCertificateTx, + DeleteAccountCertificateTx, + DeleteAccountTx, + DeleteAllAccountsTx, + DeleteDomainTx, + RegisterAccountTx, + RegisterDomainTx, + RegisterUsernameTx, + RenewAccountTx, + RenewDomainTx, + ReplaceAccountMsgFeesTx, + ReplaceAccountTargetsTx, + TransferAccountTx, + TransferDomainTx, + UpdateAccountConfigurationTx, + VoteOption, + VoteTx, +} from "@iov/bns"; import { Sha256 } from "@iov/crypto"; import { Encoding, Uint64 } from "@iov/encoding"; import { action } from "@storybook/addon-actions"; @@ -48,6 +66,12 @@ const currentUsersAddresses = [ let txCount = 0; +const defaultCertificate = Encoding.fromHex( + "517fdb504c6f68fa715a10569a294060beaefae0906feb333600cc1fce04737f0f0590c8999d8694ca90c9d042395b50a02d1de2c88832610cf2d5c51df8e6e131765771b3944e19919fc250572e06a8c86bc334023cb570ffd502145cbd2f51b8b0559dc6f2af3fd7f6e846d43f20f1ed4db537ff6fa9966ced5dc40f0a36f7d32a42ad81f03bdc15f1d27afc095cd5112a41e613b2e9f4f2fda0befc0231df", +); + +const defaultCertificateHash = Encoding.fromHex("569a294060beaefae090"); + function makeExampleEthTransactionId(): TransactionId { // The generated hash is deterministic but arbitrary and has the correct format (see https://etherscan.io/txs) const data = Uint64.fromNumber(txCount++).toBytesBigEndian(); @@ -85,6 +109,46 @@ const incomingNewDomainTransaction: ProcessedTx = { }, }; +const incomingTransferDomainTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/transfer_domain", + chainId: chainIdIov, + domain: "test", + newAdmin: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingRenewDomainTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/renew_domain", + chainId: chainIdIov, + domain: "test", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingDeleteDomainTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/delete_domain", + chainId: chainIdIov, + domain: "test", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + const incomingRegisterAccountTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), @@ -115,6 +179,179 @@ const incomingRegisterAccountTransaction: ProcessedTx = { }, }; +const incomingTransferAccountTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/transfer_account", + chainId: chainIdIov, + domain: "test", + name: "account", + newOwner: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingReplaceAccountTargetsTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/replace_account_targets", + chainId: chainIdIov, + domain: "test", + name: "account", + newTargets: [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "13751834438426525516L" as Address, + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0x695874053fcB8D9cF038ee4E53b7b24fB0baFa4c" as Address, + }, + ], + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingDeleteAccountTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/delete_account", + chainId: chainIdIov, + domain: "test", + name: "account", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingDeleteAllAccountsTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/delete_all_accounts", + chainId: chainIdIov, + domain: "test", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingRenewAccountTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/renew_account", + chainId: chainIdIov, + domain: "test", + name: "account", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingAddAccountCertificateTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/add_account_certificate", + chainId: chainIdIov, + domain: "test", + name: "account", + certificate: defaultCertificate, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingReplaceAccountMsgFeesTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/replace_account_msg_fees", + chainId: chainIdIov, + domain: "test", + newMsgFees: [ + { + msgPath: "fee-path-1", + fee: { + fractionalDigits: 9, + quantity: "10", + tokenTicker: "ETH" as TokenTicker, + }, + }, + { + msgPath: "fee-path-2", + fee: { + fractionalDigits: 9, + quantity: "20", + tokenTicker: "IOV" as TokenTicker, + }, + }, + { + msgPath: "fee-path-3", + fee: { + fractionalDigits: 9, + quantity: "30", + tokenTicker: "LSK" as TokenTicker, + }, + }, + ], + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingDeleteAccountCertificateTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/delete_account_certificate", + chainId: chainIdIov, + domain: "test", + name: "account", + certificateHash: defaultCertificateHash, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingUpdateAccountConfigurationTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/update_account_configuration", + chainId: chainIdIov, + configuration: { + owner: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + domainRenew: 1000000000, + validDomain: "testDomain", + validName: "testName", + validBlockchainId: "test-blockchain-id", + validBlockchainAddress: "test-blockchain-address", + }, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + const incomingSendTransaction: ProcessedSendTransaction = { time: new ReadonlyDate("2018-01-01T03:02:01.763Z"), id: makeExampleEthTransactionId(), @@ -165,10 +402,34 @@ const parsedTxs: readonly ( | ProcessedTx | ProcessedTx | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx )[] = [ - incomingRegisterAccountTransaction, incomingNewDomainTransaction, + incomingTransferDomainTransaction, + incomingRenewDomainTransaction, + incomingDeleteDomainTransaction, + incomingRegisterAccountTransaction, + incomingTransferAccountTransaction, + incomingReplaceAccountTargetsTransaction, + incomingDeleteAccountTransaction, + incomingDeleteAllAccountsTransaction, + incomingRenewAccountTransaction, + incomingAddAccountCertificateTransaction, + incomingReplaceAccountMsgFeesTransaction, + incomingDeleteAccountCertificateTransaction, + incomingUpdateAccountConfigurationTransaction, incomingSendTransaction, voteTx, { From 72410d5a2f9b9367944c162fe3a2a2cbaa82f2e0 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:35:41 +0100 Subject: [PATCH 053/204] Adds layout fix for Certificate character overflow --- .../transactions/components/TxTable/index.tsx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/transactions/components/TxTable/index.tsx b/packages/bierzo-wallet/src/routes/transactions/components/TxTable/index.tsx index 5bdb739d1..9d312ae0e 100644 --- a/packages/bierzo-wallet/src/routes/transactions/components/TxTable/index.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/components/TxTable/index.tsx @@ -1,5 +1,4 @@ -import { makeStyles, Theme } from "@material-ui/core"; -import { useTheme } from "@material-ui/styles"; +import { makeStyles } from "@material-ui/core"; import { Block } from "medulas-react-components"; import * as React from "react"; @@ -8,12 +7,7 @@ import { TxTableProps } from "./rowTxBuilder"; import TxTableFooter from "./TxTableFooter"; import TxTableHeader from "./TxTableHeader"; -const txTablePadding = 20; - const useStyles = makeStyles({ - inner: { - flexBasis: "auto", - }, panel: { boxShadow: `0 0 20px 0 ${getShadowColor()}`, }, @@ -29,13 +23,19 @@ function TxTable({ onPrevPage, }: TxTableProps): JSX.Element { const classes = useStyles(); - const theme = useTheme(); return ( - - - + - - ); } From 9e623ae44e0fb1de4cd976e9ab14d7fdcd0906c3 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:35:53 +0100 Subject: [PATCH 054/204] Update storybook snapshots --- .../src/__snapshots__/Storyshots.test.js.snap | 777 +++++++++++++++--- 1 file changed, 650 insertions(+), 127 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 52a2324f4..3d7090d24 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -5000,13 +5000,7 @@ Array [ >
-
-
@@ -5027,56 +5021,567 @@ Array [
-
+
+
+ Descending sort +
+ Ascending sort +
+
+ Date +
+
+
+
+
+ Amount +
+
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Starname registration +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Starname transfer +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Starname renewal +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Starname deletion +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Account registration +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Account transfer +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
- Descending sort +
+
+ Transaction type +
+
+
+ Account targets update +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
- Ascending sort
-
- Date -
-
-
-
-
- Amount -
-
-
-
-
@@ -5107,7 +5612,7 @@ Array [
- Account registration + Account deletion
- Starname registration + All accounts deletion
- To - - tiov18c8a...4cl27 + Account renewal
- 20 Nov 2019 + 1 Dec 2019
- -26.7 IOV + - + 100 IOV
- To - - tiov18c8a...4cl27 + Add certificate to account
- 18 Oct 2019 + 1 Dec 2019
- -101.7 IOV + - + 100 IOV
- To - - tiov18c8a...4cl27 + Fees update for accounts
- 16 Sep 2019 + 1 Dec 2019
- -26.7 IOV + - + 100 IOV
- From - - 465277250...8600L + Delete certificate from account
- 14 Aug 2019 + 1 Dec 2019
- +10.5 LSK + - + 100 IOV
- To - - tiov18c8a...4cl27 + Account configuration update
- 12 Jul 2019 + 1 Dec 2019
- -101.7 IOV + - + 100 IOV
- 10 Jun 2018 + 20 Nov 2019
- Personalized address registration + To + + tiov18c8a...4cl27
- 9 May 2018 + 18 Oct 2019
- - - 100 IOV + -101.7 IOV
- Personalized address registration + To + + tiov18c8a...4cl27
- 7 Apr 2018 + 16 Sep 2019
- - - 100 IOV + -26.7 IOV
-
+
- -
-
-
+
- This is an unknown transaction -
+
+ From + + 465277250...8600L +
+
+
- The transaction ID is: - 8005F02D43FA06E7D0585FB64C961D57E318B27A145C857BCD3A6BDB413FF7FC + 14 Aug 2019
+
+
+
+ +10.5 LSK +
+
+
+ Sorting
+
+
-
-
To - tiov16cmj...7r2tc + tiov18c8a...4cl27
- 3 Feb 2018 + 12 Jul 2019
- -8.6 IOV + -101.7 IOV
- From + To - 0x979a731...31bdA + tiov18c8a...4cl27
- 1 Jan 2018 + 10 Jun 2018
- +10.5 ETH + -26.7 IOV
-
-
, ] `; From a24fcd37aa76d1e817b0bca72c411945e1c63c80 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:36:28 +0100 Subject: [PATCH 055/204] Updates Travis config for milestone branches support --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4d42c461d..aed56a29d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: node_js dist: xenial node_js: -# Use Node.js >= 12.x since we got problems with exceeding the default 1400MB -# memory limit in Node.js 10 during webpack builds. -# See also https://developer.ibm.com/articles/nodejs-memory-management-in-container-environments/ + # Use Node.js >= 12.x since we got problems with exceeding the default 1400MB + # memory limit in Node.js 10 during webpack builds. + # See also https://developer.ibm.com/articles/nodejs-memory-management-in-container-environments/ - "12.15.0" sudo: required @@ -41,6 +41,7 @@ script: branches: only: - master + - /^milestone\/.+$/ # Minor version branches: 0.9, 0.10, 1.2 etc. - /^[0-9]+\.[0-9]+$/ # Tag builds: v0.9.1, v1.2.3-alpha456+build789 etc. From a54979d64bdd4393d51eabd06d818561b91bd6ab Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 10:35:30 +0100 Subject: [PATCH 056/204] Skip tests that will be reimplemented in #1039 --- packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts b/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts index dfb5fd0b7..b8c64ecb3 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts +++ b/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts @@ -84,7 +84,7 @@ withChainsDescribe("E2E > Receive Payment route", () => { }, 35000); }); - describe("Starnames tab", () => { + describe.skip("Starnames tab", () => { let username: string; beforeEach(async () => { await travelToStarnamesTabE2E(page); From a38cc5066c390f2fd3b06eda8aadef470f4faa34 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 16:41:51 +0100 Subject: [PATCH 057/204] Improve url naming --- packages/bierzo-wallet/src/routes/paths.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index 11dcbda92..35824174e 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -4,8 +4,8 @@ export const TRANSACTIONS_ROUTE = "/transactions"; export const BALANCE_ROUTE = "/balance"; export const CONFIRM_TRANSACTION_ROUTE = "/confirm-transaction"; export const ADDRESSES_ROUTE = "/addresses"; -export const REGISTER_IOVNAME_ROUTE = "/register-iovname"; -export const REGISTER_STARNAME_ROUTE = "/register-starname"; -export const REGISTER_NAME_ROUTE = "/register-name"; +export const REGISTER_IOVNAME_ROUTE = "/iovname/register"; +export const REGISTER_STARNAME_ROUTE = "/starname/register"; +export const REGISTER_NAME_ROUTE = "/name/register"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; From 2938ceaf76090f87e9c950cb33436010d4374167 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 16:42:07 +0100 Subject: [PATCH 058/204] Compare names with localeCompare --- .../src/routes/addresses/components/IovnamesExists.tsx | 6 +----- .../src/routes/addresses/components/StarnamesExists.tsx | 8 +++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 7dc1ce253..54bac677d 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -50,11 +50,7 @@ function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { {iovnames .slice() - .sort((a, b) => { - if (a.username < b.username) return -1; - if (a.username > b.username) return 1; - return 0; - }) + .sort((a, b) => a.username.localeCompare(b.username, undefined, { sensitivity: "base" })) .map(iovname => { const onManage = (): void => { history.push(REGISTER_IOVNAME_ROUTE, iovname); diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 20b7ba5d2..432f33997 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -62,11 +62,9 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element {starnames .slice() - .sort((a, b) => { - if (`${a.name}*${a.domain}` < `${b.name}*${b.domain}`) return -1; - if (`${a.name}*${a.domain}` > `${b.name}*${b.domain}`) return 1; - return 0; - }) + .sort((a, b) => + `${a.name}*${a.domain}`.localeCompare(`${b.name}*${b.domain}`, undefined, { sensitivity: "base" }), + ) .map(starname => { const onManage = (): void => { history.push(REGISTER_STARNAME_ROUTE, starname); From caa21cf786b435102c167c21dc235097da4196e5 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 17:09:56 +0100 Subject: [PATCH 059/204] Removes faulty route introduced when rebasing --- .../src/routes/registerStarName/index.tsx | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx deleted file mode 100644 index db8da3f36..000000000 --- a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Block, makeStyles, Typography } from "medulas-react-components"; -import React from "react"; - -import PageMenu from "../../components/PageMenu"; - -const useStyles = makeStyles({ - usernameHeader: { - boxShadow: "0px 0px 14px #EDEFF4", - }, -}); - -// TODO move to components when implemented, mirroring registerName -export function NoStarnameHeader(): JSX.Element { - const classes = useStyles(); - return ( - - - *yourstarname - - - ); -} - -const RegisterStarname = (): JSX.Element => { - return ( - - - Register new starname. Work in progress view - - - ); -}; - -export default RegisterStarname; From d481d5c484d4797179b6200802bdb53583e2bdf8 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 17:46:14 +0100 Subject: [PATCH 060/204] Updates storybook snapshot --- .../src/__snapshots__/Storyshots.test.js.snap | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 3d7090d24..672b442b2 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1882,7 +1882,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames tab 1`] = ` />
Choose Now @@ -1925,7 +1925,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames with name tab 1`] = `

Register now @@ -2100,7 +2100,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with extension 1`] = ` />

Register Now @@ -2208,7 +2208,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with ledger 1`] = `

starname

@@ -2332,7 +2332,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = ` />
Register Now @@ -2712,7 +2712,7 @@ exports[`Storyshots Bierzo Wallet/Balance View on ledger and without name 1`] =

iovnames

@@ -2954,7 +2954,7 @@ exports[`Storyshots Bierzo Wallet/Balance View without tokens and without name 1 />
Choose Now From 7e2bca2123ddc7e12d6023f973cd9d5a29505bda Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 11 Mar 2020 12:36:41 +0100 Subject: [PATCH 061/204] Fix invalid selector in e2e test --- .../src/routes/addresses/components/IovnamesNotExists.tsx | 6 ++++-- .../src/routes/balance/test/operateBalances.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx index 8cbc90c0f..c1c4307a2 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx @@ -7,6 +7,8 @@ import { RpcEndpointType } from "../../../communication/rpcEndpoint"; import { REGISTER_IOVNAME_ROUTE } from "../../paths"; import { NoIovnameHeader } from "../../register/components/IovnameForm"; +export const registerIovnameId = REGISTER_IOVNAME_ROUTE.replace(/\//g, "-"); + interface StarnamesNotExistsProps { readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; @@ -28,7 +30,7 @@ export function GetYourAddressWithExtension({ You can not register - + iovnames diff --git a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts index b0187d763..b2427768e 100644 --- a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts +++ b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts @@ -2,7 +2,7 @@ import { Browser, ElementHandle, Page } from "puppeteer"; import { randomString, sleep, whenTrue } from "ui-logic"; import { acceptEnqueuedRequest } from "../../../utils/test/persona"; -import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { registerIovnameId } from "../../addresses/components/IovnamesNotExists"; import { REGISTER_IOVNAME_FIELD } from "../../register/components/IovnameForm"; const mainMenuH6Elements = 3; @@ -42,7 +42,7 @@ export const getAddressCreationPromptE2E = async (h6Elements: ElementHandle => { - await page.click(`#${REGISTER_IOVNAME_ROUTE.replace("/", "\\/")}`); + await page.click(`#${registerIovnameId}`); // Fill the form await sleep(1000); From c1317fded2d8067a201856431136bb4151c0018a Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 11 Mar 2020 12:48:03 +0100 Subject: [PATCH 062/204] Updates storybook snapshots --- .../src/__snapshots__/Storyshots.test.js.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 672b442b2..04eb75993 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1882,7 +1882,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames tab 1`] = ` />
Choose Now @@ -2712,7 +2712,7 @@ exports[`Storyshots Bierzo Wallet/Balance View on ledger and without name 1`] =

iovnames

@@ -2954,7 +2954,7 @@ exports[`Storyshots Bierzo Wallet/Balance View without tokens and without name 1 />
Choose Now From 4e7b62dbcd407f0135be3492157b51f8308f93b9 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 15:51:40 +0200 Subject: [PATCH 063/204] Changes from previous branch --- CHANGELOG.md | 1 + .../addresses/components/AddressesTab.tsx | 21 +++- .../routes/addresses/components/Starnames.tsx | 31 ++++++ .../addresses/components/StarnamesExists.tsx | 8 ++ .../components/StarnamesNotExists.tsx | 100 ++++++++++++++++++ .../src/routes/addresses/index.stories.tsx | 6 ++ .../src/routes/addresses/index.tsx | 8 +- packages/bierzo-wallet/src/routes/index.tsx | 3 + packages/bierzo-wallet/src/routes/paths.ts | 1 + .../src/routes/registerStarName/index.tsx | 34 ++++++ 10 files changed, 209 insertions(+), 4 deletions(-) create mode 100644 packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx create mode 100644 packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx create mode 100644 packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx create mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index e09339a43..e6ceb0d74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Wallet: Correctly displays transaction of type Update Username Targets - Wallet: Adds number of fractional digits to the validation of a payment - Wallet: Makes editing addresses of a username more reliable +- Wallet: Adds wip starnames tab and updates stories - Wallet: Adds support for Terra Money, Cosmos Hub, IrisNet, kava, Bitcoin, and Litecoin addresses - Extension: Improve UI - Extension: Adds network status and correct url to Networks view diff --git a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx index e9faa79bb..6c04b59f0 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx @@ -5,8 +5,10 @@ import React from "react"; import { AddressesTableProps } from "../../../components/AddressesTable"; import Iovnames, { IovnamesProps } from "./Iovnames"; +import Starnames, { StarnamesProps } from "./Starnames"; import UserAddresses from "./UserAddresses"; +export const yourStarnames = "Your starnames"; export const yourIovnames = "Your iovnames"; export const yourAddresses = "Your blockchain addresses"; @@ -55,17 +57,23 @@ function TabItem({ children, selected, onChangeTab }: TabItemProps): JSX.Element function AddressesTab({ chainAddresses, usernames, + starnames, onRegisterUsername, + onRegisterStarname, rpcEndpointType, -}: AddressesTableProps & IovnamesProps): JSX.Element { - const [selectedTab, setSelectedTab] = React.useState<"iovnames" | "addresses">("iovnames"); +}: AddressesTableProps & IovnamesProps & StarnamesProps): JSX.Element { + const [selectedTab, setSelectedTab] = React.useState<"starnames" | "iovnames" | "addresses">("starnames"); - const changeTabToAddresses = (): void => setSelectedTab("addresses"); + const changeTabToStarnames = (): void => setSelectedTab("starnames"); const changeTabToIovnames = (): void => setSelectedTab("iovnames"); + const changeTabToAddresses = (): void => setSelectedTab("addresses"); return ( + + {yourStarnames} + {yourIovnames} @@ -73,6 +81,13 @@ function AddressesTab({ {yourAddresses} + {selectedTab === "starnames" && ( + + )} {selectedTab === "iovnames" && ( void; + readonly rpcEndpointType: RpcEndpointType; +} + +const Starnames = ({ starnames, rpcEndpointType, onRegisterStarname }: StarnamesProps): JSX.Element => { + const hasStarnames = starnames.length > 0; + + return ( + + + {!hasStarnames && ( + + )} + {hasStarnames && } + + ); +}; + +export default Starnames; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx new file mode 100644 index 000000000..ba9a0554e --- /dev/null +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -0,0 +1,8 @@ +import { Typography } from "medulas-react-components"; +import React from "react"; + +function StarnamesExists(): JSX.Element { + return There are some starnames. Work in progress view; +} + +export default StarnamesExists; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx new file mode 100644 index 000000000..e0cfa4cbe --- /dev/null +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx @@ -0,0 +1,100 @@ +import { Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, Typography } from "medulas-react-components"; +import React from "react"; + +import { RpcEndpointType } from "../../../communication/rpcEndpoint"; +import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; +import { NoStarnameHeader } from "../../registerStarName"; + +interface StarnamesNotExistsProps { + readonly onRegisterStarname: () => void; + readonly rpcEndpointType: RpcEndpointType; +} + +export function GetYourAddressWithExtension({ + onRegisterStarname, +}: Omit): JSX.Element { + return ( + + + + + Register your starname + + + A starname is your universal username for the blockchain world. It enables you to receive + crypto-currencies or to log in to blockchain applications in a seamless way. Transferring value + becomes fast an easy. + + + + Register Now + + + ); +} + +export function GetYourAddressWithLedger(): JSX.Element { + return ( + + + + + You can not register + + + starname + + + + using{" "} + + + Ledger Nano S + + + + ); +} + +export function GetYourAddress({ + rpcEndpointType, + onRegisterStarname, +}: StarnamesNotExistsProps): JSX.Element { + switch (rpcEndpointType) { + case "extension": + return ; + case "ledger": + return ; + } +} + +function StarnamesNotExists({ onRegisterStarname, rpcEndpointType }: StarnamesNotExistsProps): JSX.Element { + const theme = useTheme(); + + return ( + + + + ); +} + +export default StarnamesNotExists; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index fce1cfce4..469300def 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -54,7 +54,9 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} rpcEndpointType="extension" /> @@ -64,7 +66,9 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} rpcEndpointType="extension" /> @@ -74,7 +78,9 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} rpcEndpointType="ledger" /> diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index dbd0d9319..dba7a2738 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -9,7 +9,7 @@ import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { BwUsername } from "../../store/usernames"; import { getChainAddressPairWithNames } from "../../utils/tokens"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../paths"; +import { REGISTER_PERSONALIZED_ADDRESS_ROUTE, REGISTER_STARNAME } from "../paths"; import AddressesTab from "./components/AddressesTab"; export interface BwUsernameWithChainName extends BwUsername { @@ -20,6 +20,10 @@ function onRegisterUsername(): void { history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE); } +function onRegisterStarname(): void { + history.push(REGISTER_STARNAME); +} + const Addresses = (): JSX.Element => { const bwNames = ReactRedux.useSelector((state: RootState) => state.usernames); const [bwNamesWithChain, setBwNamesWithChain] = useState([]); @@ -74,7 +78,9 @@ const Addresses = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index d7755e767..bf78262b7 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -13,12 +13,14 @@ import { PAYMENT_ROUTE, POLICY_ROUTE, REGISTER_PERSONALIZED_ADDRESS_ROUTE, + REGISTER_STARNAME, TERMS_ROUTE, TRANSACTIONS_ROUTE, } from "./paths"; import Payment from "./payment"; import Policy from "./policy"; import RegisterUsername from "./registerName"; +import RegisterStarname from "./registerStarName"; import Terms from "./terms"; import Transactions from "./transactions"; @@ -35,6 +37,7 @@ const Routes = (): JSX.Element => ( + diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index af151a503..1fd438d1f 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -5,5 +5,6 @@ export const BALANCE_ROUTE = "/balance"; export const CONFIRM_TRANSACTION_ROUTE = "/confirm-transaction"; export const ADDRESSES_ROUTE = "/addresses"; export const REGISTER_PERSONALIZED_ADDRESS_ROUTE = "/register-personalized-address"; +export const REGISTER_STARNAME = "/register-starname"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx new file mode 100644 index 000000000..db8da3f36 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx @@ -0,0 +1,34 @@ +import { Block, makeStyles, Typography } from "medulas-react-components"; +import React from "react"; + +import PageMenu from "../../components/PageMenu"; + +const useStyles = makeStyles({ + usernameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +// TODO move to components when implemented, mirroring registerName +export function NoStarnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + *yourstarname + + + ); +} + +const RegisterStarname = (): JSX.Element => { + return ( + + + Register new starname. Work in progress view + + + ); +}; + +export default RegisterStarname; From deef62828479916eacf36883bc367ec3616843a8 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 16:22:52 +0200 Subject: [PATCH 064/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 601 +++--------------- 1 file changed, 83 insertions(+), 518 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 99ddb8017..460995a52 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -2442,6 +2442,23 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with extension 1`] = `
+
+ Your starnames +
+
+
+
+
+
- yourname*iov + *yourstarname
- You have no starnames + Register your starname

- With Neuma you can choose your easy to read human readable address. No more complicated cryptography when sending to friends. + A starname is your universal username for the blockchain world. It enables you to receive crypto-currencies or to log in to blockchain applications in a seamless way. Transferring value becomes fast an easy.

- Choose Now + Register Now
@@ -2535,6 +2552,23 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with ledger 1`] = `
+
+ Your starnames +
+
+
+
+
+
- yourname*iov + *yourstarname
- personalized address + starname

+
+ Your starnames +
+
+
+
+
+
-

- + Create new iovname -

-
-

- test1*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - -
- Blockchain - - Address - -
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
+ *yourstarname +
-
-
-
-
+
-
-

- test2*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - - - - - - -
- Blockchain - - Address - -
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
- Lisk Devnet - - 1349293588603668134L - -
- Copy -
-
-
-
-
-
-
+ Register your starname +
+

+ A starname is your universal username for the blockchain world. It enables you to receive crypto-currencies or to log in to blockchain applications in a seamless way. Transferring value becomes fast an easy. +

+
-
-

- test3*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- Blockchain - - Address - -
- Ganache - - 0xD383382350F9f190Bd2608D6381B15b4e1cec0f3 - -
- Copy -
-
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
- Lisk Devnet - - 1349293588603668134L - -
- Copy -
-
-
+ Register Now +
From a278dcaca5584d8613ebdaa4fcc47937f7c7dab8 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 17:22:01 +0200 Subject: [PATCH 065/204] Restore after revert --- .../src/communication/requestgenerators.ts | 125 ++++++- packages/bierzo-wallet/src/logic/account.ts | 55 ++- .../addresses/components/IovnamesExists.tsx | 8 +- .../components/IovnamesNotExists.tsx | 12 +- .../components/StarnamesNotExists.tsx | 22 +- .../src/routes/addresses/index.stories.tsx | 2 +- .../src/routes/addresses/index.tsx | 6 +- .../addresses/test/travelToReceivePayment.ts | 4 +- .../src/routes/balance/index.stories.tsx | 2 +- .../src/routes/balance/index.tsx | 4 +- .../routes/balance/test/operateBalances.ts | 8 +- packages/bierzo-wallet/src/routes/index.tsx | 17 +- packages/bierzo-wallet/src/routes/paths.ts | 5 +- .../components/ReceiverAddress/index.tsx | 4 +- .../src/routes/payment/index.tsx | 4 +- .../assets/shield.svg | 0 .../components/ConfirmRegistration.tsx | 6 +- .../register/components/IovnameForm.tsx | 322 +++++++++++++++++ .../routes/register/components/NameForm.tsx | 325 ++++++++++++++++++ .../components/SelectAddressesTable.tsx | 0 .../register/components/StarnameForm.tsx | 237 +++++++++++++ .../index.stories.tsx | 69 +--- .../src/routes/register/index.tsx | 264 ++++++++++++++ .../background/model/persona/index.ts | 27 +- .../ShowTx/ReqRegisterAccountTx.tsx | 38 ++ .../ShowTx/ReqRegisterDomainTx.tsx | 31 ++ .../ShowTx/ReqReplaceAccountTargetsTx.tsx | 43 +++ .../SignAndPostTx/ShowTx/index.tsx | 19 +- .../dashboard/components/ProposalsList.tsx | 28 +- 29 files changed, 1560 insertions(+), 127 deletions(-) rename packages/bierzo-wallet/src/routes/{registerName => register}/assets/shield.svg (100%) rename packages/bierzo-wallet/src/routes/{registerName => register}/components/ConfirmRegistration.tsx (90%) create mode 100644 packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx create mode 100644 packages/bierzo-wallet/src/routes/register/components/NameForm.tsx rename packages/bierzo-wallet/src/routes/{registerName => register}/components/SelectAddressesTable.tsx (100%) create mode 100644 packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx rename packages/bierzo-wallet/src/routes/{registerName => register}/index.stories.tsx (50%) create mode 100644 packages/bierzo-wallet/src/routes/register/index.tsx create mode 100644 packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterAccountTx.tsx create mode 100644 packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterDomainTx.tsx create mode 100644 packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqReplaceAccountTargetsTx.tsx diff --git a/packages/bierzo-wallet/src/communication/requestgenerators.ts b/packages/bierzo-wallet/src/communication/requestgenerators.ts index fe642369d..c2ca5c334 100644 --- a/packages/bierzo-wallet/src/communication/requestgenerators.ts +++ b/packages/bierzo-wallet/src/communication/requestgenerators.ts @@ -1,5 +1,13 @@ import { Address, Amount, Identity, SendTransaction, UnsignedTransaction } from "@iov/bcp"; -import { bnsCodec, ChainAddressPair, RegisterUsernameTx, UpdateTargetsOfUsernameTx } from "@iov/bns"; +import { + bnsCodec, + ChainAddressPair, + RegisterAccountTx, + RegisterDomainTx, + RegisterUsernameTx, + ReplaceAccountTargetsTx, + UpdateTargetsOfUsernameTx, +} from "@iov/bns"; import { TransactionEncoder } from "@iov/encoding"; import { JsonRpcRequest, makeJsonRpcId } from "@iov/jsonrpc"; @@ -95,6 +103,62 @@ export const generateUpdateUsernameTxWithFee = async ( return await withChainFee(regUsernameTx, bnsCodec.identityToAddress(creator)); }; +export const generateRegisterDomainTxWithFee = async ( + creator: Identity, + domain: string, +): Promise => { + const creatorAddress = bnsCodec.identityToAddress(creator); + const TwoHoursInSeconds = 2 * 3600; + + const regDomainTx: RegisterDomainTx = { + kind: "bns/register_domain", + chainId: creator.chainId, + domain: domain, + admin: creatorAddress, + hasSuperuser: true, + msgFees: [], + accountRenew: TwoHoursInSeconds, + }; + + return await withChainFee(regDomainTx, creatorAddress); +}; + +export const generateRegisterAccountTxWithFee = async ( + creator: Identity, + domain: string, + name: string, + owner: Address, + targets: readonly ChainAddressPair[], +): Promise => { + const regAccountTx: RegisterAccountTx = { + kind: "bns/register_account", + chainId: creator.chainId, + domain: domain, + name: name, + owner: owner, + targets: targets, + }; + + return await withChainFee(regAccountTx, bnsCodec.identityToAddress(creator)); +}; + +export const generateReplaceAccountTargetsTxWithFee = async ( + creator: Identity, + domain: string, + name: string, + newTargets: readonly ChainAddressPair[], +): Promise => { + const regAccountTx: ReplaceAccountTargetsTx = { + kind: "bns/replace_account_targets", + chainId: creator.chainId, + domain: domain, + name: name, + newTargets: newTargets, + }; + + return await withChainFee(regAccountTx, bnsCodec.identityToAddress(creator)); +}; + export const generateRegisterUsernameTxRequest = async ( creator: Identity, username: string, @@ -132,3 +196,62 @@ export const generateUpdateUsernameTxRequest = async ( }, }; }; + +export const generateRegisterDomainTxRequest = async ( + creator: Identity, + domain: string, +): Promise => { + const transactionWithFee = await generateRegisterDomainTxWithFee(creator, domain); + + return { + jsonrpc: "2.0", + id: makeJsonRpcId(), + method: "signAndPost", + params: { + reason: TransactionEncoder.toJson("I would like you to sign this request"), + signer: TransactionEncoder.toJson(creator), + transaction: TransactionEncoder.toJson(transactionWithFee), + }, + }; +}; + +export const generateRegisterAccountTxRequest = async ( + creator: Identity, + domain: string, + name: string, + owner: Address, + targets: readonly ChainAddressPair[], +): Promise => { + const transactionWithFee = await generateRegisterAccountTxWithFee(creator, domain, name, owner, targets); + + return { + jsonrpc: "2.0", + id: makeJsonRpcId(), + method: "signAndPost", + params: { + reason: TransactionEncoder.toJson("I would like you to sign this request"), + signer: TransactionEncoder.toJson(creator), + transaction: TransactionEncoder.toJson(transactionWithFee), + }, + }; +}; + +export const generateReplaceAccountTargetsTxRequest = async ( + creator: Identity, + domain: string, + name: string, + newTargets: readonly ChainAddressPair[], +): Promise => { + const transactionWithFee = await generateReplaceAccountTargetsTxWithFee(creator, domain, name, newTargets); + + return { + jsonrpc: "2.0", + id: makeJsonRpcId(), + method: "signAndPost", + params: { + reason: TransactionEncoder.toJson("I would like you to sign this request"), + signer: TransactionEncoder.toJson(creator), + transaction: TransactionEncoder.toJson(transactionWithFee), + }, + }; +}; diff --git a/packages/bierzo-wallet/src/logic/account.ts b/packages/bierzo-wallet/src/logic/account.ts index d57a2679b..00790e20b 100644 --- a/packages/bierzo-wallet/src/logic/account.ts +++ b/packages/bierzo-wallet/src/logic/account.ts @@ -2,10 +2,14 @@ import { Address, ChainId } from "@iov/bcp"; import { getConnectionForBns } from "./connection"; -export function isIov(username: string): boolean { +export function isIovname(username: string): boolean { return username.endsWith("*iov"); } +export function isStarname(starname: string): boolean { + return starname.startsWith("*"); +} + /** * Returns the address associated with the name, or undefined if not registered. * The name must include a namespace ("*iov") @@ -14,7 +18,7 @@ export async function lookupRecipientAddressByName( username: string, chainId: ChainId, ): Promise
{ - if (!isIov(username)) { + if (!isIovname(username)) { throw new Error("IOV starname must include *iov"); } @@ -36,7 +40,7 @@ export async function lookupRecipientAddressByName( export function isValidIov( username: string, ): "valid" | "not_iov" | "wrong_number_of_asterisks" | "too_short" | "too_long" | "wrong_chars" { - if (!isIov(username)) return "not_iov"; + if (!isIovname(username)) return "not_iov"; const parts = username.split("*"); if (parts.length !== 2) return "wrong_number_of_asterisks"; @@ -49,8 +53,51 @@ export function isValidIov( // Username length must maximum 64 chars long if (name.length > 64) return "too_long"; - // Must contain only allowed chars + /* Must contain only allowed chars as per /scripts/bnsd/genesis_app_state.json: + conf: {username: {valid_username_name, valid_username_label}} */ if (/^[a-z0-9_\-.]{3,64}\*iov$/.test(username)) return "valid"; return "wrong_chars"; } + +export function isValidStarname( + starname: string, +): "valid" | "not_starname" | "wrong_number_of_asterisks" | "too_short" | "too_long" | "wrong_chars" { + if (!isStarname(starname)) return "not_starname"; + + const parts = starname.split("*"); + if (parts.length !== 2) return "wrong_number_of_asterisks"; + const domain = parts[1]; + + // Domain length must be at least 3 chars long + if (domain.length < 3) return "too_short"; + + // Domain length must maximum 16 chars long + if (domain.length > 16) return "too_long"; + + /* Must contain only allowed chars as per /scripts/bnsd/genesis_app_state.json: + conf: {account: {valid_domain}} plus initial asterisk */ + if (/^\*[a-z0-9\-_]{3,16}$/.test(starname)) return "valid"; + + return "wrong_chars"; +} + +export function isValidName( + starname: string, +): "valid" | "wrong_number_of_asterisks" | "too_short" | "too_long" | "wrong_chars" { + const parts = starname.split("*"); + if (parts.length !== 2) return "wrong_number_of_asterisks"; + const name = parts[0]; + + // Domain length must be at least 3 chars long + if (name.length < 3) return "too_short"; + + // Domain length must maximum 64 chars long + if (name.length > 64) return "too_long"; + + /* Must contain only allowed chars as per /scripts/bnsd/genesis_app_state.json: + conf: {account: {valid_name, valid_domain}} plus asterisk separator */ + if (/^[a-z0-9\-_.]{3,64}\*[a-z0-9\-_]{3,16}$/.test(starname)) return "valid"; + + return "wrong_chars"; +} diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 2ba437fec..7b9c80a4d 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -15,8 +15,8 @@ import { BwUsernameWithChainName } from ".."; import { history } from "../.."; import AddressesTable from "../../../components/AddressesTable"; import copy from "../../../components/AddressesTable/assets/copy.svg"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { AddressesTooltipHeader, TooltipContent } from "../../registerName/components"; +import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { AddressesTooltipHeader, TooltipContent } from "../../register"; interface Props { readonly usernames: readonly BwUsernameWithChainName[]; @@ -46,7 +46,7 @@ function IovnamesExists({ usernames, onRegisterUsername }: Props): JSX.Element { return ( { - history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE, username); + history.push(REGISTER_IOVNAME_ROUTE, username); }; return ( diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx index d3a85121a..3c968fa3e 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx @@ -4,8 +4,8 @@ import { Block, Typography } from "medulas-react-components"; import React from "react"; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { NoUsernameHeader } from "../../registerName/components"; +import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { NoIovnameHeader } from "../../register/components/IovnameForm"; interface StarnamesNotExistsProps { readonly onRegisterUsername: () => void; @@ -17,7 +17,7 @@ export function GetYourAddressWithExtension({ }: Omit): JSX.Element { return ( - + You have no starnames @@ -28,7 +28,7 @@ export function GetYourAddressWithExtension({ - + You can not register - + personalized address diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx index e0cfa4cbe..5922490aa 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx @@ -3,9 +3,10 @@ import { useTheme } from "@material-ui/styles"; import { Block, Typography } from "medulas-react-components"; import React from "react"; +import { history } from "../.."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { NoStarnameHeader } from "../../registerStarName"; +import { REGISTER_NAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../paths"; +import { NoStarnameHeader } from "../../register/components/StarnameForm"; interface StarnamesNotExistsProps { readonly onRegisterStarname: () => void; @@ -29,7 +30,7 @@ export function GetYourAddressWithExtension({ Register Now + {/* TODO remove this Typography when /register-name accessible from starname list */} + { + history.push(REGISTER_NAME_ROUTE); + }} + > + Register your name + ); } @@ -51,7 +65,7 @@ export function GetYourAddressWithLedger(): JSX.Element { You can not register - + starname diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index 469300def..b39711d83 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -8,7 +8,7 @@ import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { REGISTER_USERNAME_REGISTRATION_STORY_PATH, REGISTER_USERNAME_STORY_PATH, -} from "../registerName/index.stories"; +} from "../register/index.stories"; import { BwUsernameWithChainName } from "."; import AddressesTab from "./components/AddressesTab"; import Iovnames from "./components/Iovnames"; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index dba7a2738..82ba98587 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -9,7 +9,7 @@ import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { BwUsername } from "../../store/usernames"; import { getChainAddressPairWithNames } from "../../utils/tokens"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE, REGISTER_STARNAME } from "../paths"; +import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; import AddressesTab from "./components/AddressesTab"; export interface BwUsernameWithChainName extends BwUsername { @@ -17,11 +17,11 @@ export interface BwUsernameWithChainName extends BwUsername { } function onRegisterUsername(): void { - history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE); + history.push(REGISTER_IOVNAME_ROUTE); } function onRegisterStarname(): void { - history.push(REGISTER_STARNAME); + history.push(REGISTER_STARNAME_ROUTE); } const Addresses = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts index 4cd6a8496..345800556 100644 --- a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts +++ b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts @@ -3,7 +3,7 @@ import { Page } from "puppeteer"; import { ADDRESSES_TEXT } from "../../../components/Header/components/LinksMenu"; import { whenOnNavigatedToE2eRoute } from "../../../utils/test/navigation"; import { ADDRESSES_ROUTE } from "../../paths"; -import { REGISTER_USERNAME_VIEW_ID } from "../../registerName/components"; +import { REGISTER_IOVNAME_VIEW_ID } from "../../register/components/IovnameForm"; import { yourAddresses, yourIovnames } from "../components/AddressesTab"; import { iovnamesViewId } from "../components/Iovnames"; import { yourBlockchainAddressesId } from "../components/UserAddresses"; @@ -29,5 +29,5 @@ export async function travelToStarnamesTabE2E(page: Page): Promise { export async function openFirstStarnameForEditingE2E(page: Page, username: string): Promise { const [firstStarnameEditLink] = await page.$x(`//h6[contains(., 'Edit')]`); await firstStarnameEditLink.click(); - await page.waitForSelector(`#${REGISTER_USERNAME_VIEW_ID}`); + await page.waitForSelector(`#${REGISTER_IOVNAME_VIEW_ID}`); } diff --git a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx index 608c65c65..ab37450bd 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx @@ -9,7 +9,7 @@ import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { REGISTER_USERNAME_REGISTRATION_STORY_PATH, REGISTER_USERNAME_STORY_PATH, -} from "../registerName/index.stories"; +} from "../register/index.stories"; import Layout from "./components/index"; export const BALANCE_STORY_PATH = `${bierzoRoot}/Balance`; diff --git a/packages/bierzo-wallet/src/routes/balance/index.tsx b/packages/bierzo-wallet/src/routes/balance/index.tsx index e0a594f8e..a5ebb097b 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.tsx @@ -6,11 +6,11 @@ import PageMenu from "../../components/PageMenu"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { getFirstUsername } from "../../store/usernames/selectors"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../paths"; +import { REGISTER_IOVNAME_ROUTE } from "../paths"; import Layout from "./components"; function onRegisterUsername(): void { - history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE); + history.push(REGISTER_IOVNAME_ROUTE); } const Balance = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts index 67f41d679..b0187d763 100644 --- a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts +++ b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts @@ -2,8 +2,8 @@ import { Browser, ElementHandle, Page } from "puppeteer"; import { randomString, sleep, whenTrue } from "ui-logic"; import { acceptEnqueuedRequest } from "../../../utils/test/persona"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { REGISTER_USERNAME_FIELD } from "../../registerName/components"; +import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { REGISTER_IOVNAME_FIELD } from "../../register/components/IovnameForm"; const mainMenuH6Elements = 3; const numberOfTokensFromFaucet = 4; @@ -42,12 +42,12 @@ export const getAddressCreationPromptE2E = async (h6Elements: ElementHandle => { - await page.click(`#${REGISTER_PERSONALIZED_ADDRESS_ROUTE.replace("/", "\\/")}`); + await page.click(`#${REGISTER_IOVNAME_ROUTE.replace("/", "\\/")}`); // Fill the form await sleep(1000); const username = `${randomString(10)}*iov`; - await page.type(`input[name="${REGISTER_USERNAME_FIELD}"]`, username); + await page.type(`input[name="${REGISTER_IOVNAME_FIELD}"]`, username); await page.click('button[type="submit"]'); await acceptEnqueuedRequest(browser); diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index bf78262b7..ba893eb2c 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -12,15 +12,15 @@ import { LOGIN_ROUTE, PAYMENT_ROUTE, POLICY_ROUTE, - REGISTER_PERSONALIZED_ADDRESS_ROUTE, - REGISTER_STARNAME, + REGISTER_IOVNAME_ROUTE, + REGISTER_NAME_ROUTE, + REGISTER_STARNAME_ROUTE, TERMS_ROUTE, TRANSACTIONS_ROUTE, } from "./paths"; import Payment from "./payment"; import Policy from "./policy"; -import RegisterUsername from "./registerName"; -import RegisterStarname from "./registerStarName"; +import Register, { ToRegister } from "./register"; import Terms from "./terms"; import Transactions from "./transactions"; @@ -36,8 +36,13 @@ const Routes = (): JSX.Element => ( - - + } /> + } + /> + } /> diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index 1fd438d1f..11dcbda92 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -4,7 +4,8 @@ export const TRANSACTIONS_ROUTE = "/transactions"; export const BALANCE_ROUTE = "/balance"; export const CONFIRM_TRANSACTION_ROUTE = "/confirm-transaction"; export const ADDRESSES_ROUTE = "/addresses"; -export const REGISTER_PERSONALIZED_ADDRESS_ROUTE = "/register-personalized-address"; -export const REGISTER_STARNAME = "/register-starname"; +export const REGISTER_IOVNAME_ROUTE = "/register-iovname"; +export const REGISTER_STARNAME_ROUTE = "/register-starname"; +export const REGISTER_NAME_ROUTE = "/register-name"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; diff --git a/packages/bierzo-wallet/src/routes/payment/components/ReceiverAddress/index.tsx b/packages/bierzo-wallet/src/routes/payment/components/ReceiverAddress/index.tsx index 2951fd9b7..c17b04cec 100644 --- a/packages/bierzo-wallet/src/routes/payment/components/ReceiverAddress/index.tsx +++ b/packages/bierzo-wallet/src/routes/payment/components/ReceiverAddress/index.tsx @@ -12,7 +12,7 @@ import { import React, { useState } from "react"; import tickIcon from "../../../../assets/greenTick.svg"; -import { isIov } from "../../../../logic/account"; +import { isIovname } from "../../../../logic/account"; export const ADDRESS_FIELD = "addressField"; @@ -39,7 +39,7 @@ const ReceiverAddress = ({ const validator: FieldValidator = (value): string | undefined => { if (typeof value !== "string") throw new Error("Input must be a string"); - if (isIov(value) || (selectedChainCodec && selectedChainCodec.isValidAddress(value))) { + if (isIovname(value) || (selectedChainCodec && selectedChainCodec.isValidAddress(value))) { setAddressHasValidCert(isCertValid(value)); return undefined; diff --git a/packages/bierzo-wallet/src/routes/payment/index.tsx b/packages/bierzo-wallet/src/routes/payment/index.tsx index 72229a113..c559cd340 100644 --- a/packages/bierzo-wallet/src/routes/payment/index.tsx +++ b/packages/bierzo-wallet/src/routes/payment/index.tsx @@ -9,7 +9,7 @@ import { generateSendTxRequest } from "../../communication/requestgenerators"; import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; import PageMenu from "../../components/PageMenu"; -import { isIov, lookupRecipientAddressByName } from "../../logic/account"; +import { isIovname, lookupRecipientAddressByName } from "../../logic/account"; import { getCodecForChainId } from "../../logic/codec"; import { RootState } from "../../store/reducers"; import { BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; @@ -59,7 +59,7 @@ const Payment = (): JSX.Element => { const chainId = token.chainId; let recipient: Address; - if (isIov(formValues[ADDRESS_FIELD])) { + if (isIovname(formValues[ADDRESS_FIELD])) { const lookupResult = await lookupRecipientAddressByName(formValues[ADDRESS_FIELD], chainId); if (lookupResult === "name_not_found") { diff --git a/packages/bierzo-wallet/src/routes/registerName/assets/shield.svg b/packages/bierzo-wallet/src/routes/register/assets/shield.svg similarity index 100% rename from packages/bierzo-wallet/src/routes/registerName/assets/shield.svg rename to packages/bierzo-wallet/src/routes/register/assets/shield.svg diff --git a/packages/bierzo-wallet/src/routes/registerName/components/ConfirmRegistration.tsx b/packages/bierzo-wallet/src/routes/register/components/ConfirmRegistration.tsx similarity index 90% rename from packages/bierzo-wallet/src/routes/registerName/components/ConfirmRegistration.tsx rename to packages/bierzo-wallet/src/routes/register/components/ConfirmRegistration.tsx index dfebd38f1..980951013 100644 --- a/packages/bierzo-wallet/src/routes/registerName/components/ConfirmRegistration.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/ConfirmRegistration.tsx @@ -15,7 +15,7 @@ import copySvg from "../../../assets/copy.svg"; import tickSvg from "../../../assets/tick.svg"; import PageContent from "../../../components/PageContent"; -export const USERNAME_CONFIRMATION_VIEW_ID = "username-confirmation-view-id"; +export const REGISTER_CONFIRMATION_VIEW_ID = "register-confirmation-view-id"; const useClasses = makeStyles({ txId: { @@ -62,9 +62,9 @@ const ConfirmRegistration = ({ transactionId, onSeeTrasactions }: Props): JSX.El }; return ( - + - Your personalized address registration request was successfully signed and sent to the network. + Your registration request was successfully signed and sent to the network. diff --git a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx new file mode 100644 index 000000000..a383a5c93 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx @@ -0,0 +1,322 @@ +import { Fee, Identity, TransactionId } from "@iov/bcp"; +import { JsonRpcRequest } from "@iov/jsonrpc"; +import { FieldValidator } from "final-form"; +import { + Back, + BillboardContext, + Block, + Button, + FieldInputValue, + Form, + FormValues, + Hairline, + Image, + makeStyles, + TextField, + ToastContext, + ToastVariant, + Tooltip, + Typography, + useForm, +} from "medulas-react-components"; +import React from "react"; + +import { + AddressesTooltipHeader, + getAddressItems, + getChainAddressPairsFromValues, + getFormInitValues, + getSubmitButtonCaption, + TooltipContent, +} from ".."; +import { + generateRegisterUsernameTxRequest, + generateUpdateUsernameTxRequest, +} from "../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import { AddressesTableProps } from "../../../components/AddressesTable"; +import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../components/PageContent"; +import { isValidIov } from "../../../logic/account"; +import { BwUsernameWithChainName } from "../../addresses"; +import shield from "../assets/shield.svg"; +import SelectAddressesTable from "./SelectAddressesTable"; + +export const REGISTER_IOVNAME_VIEW_ID = "register-iovname-view-id"; +export const REGISTER_IOVNAME_FIELD = "register-iovname-field"; + +const registerIcon = shield; + +const useStyles = makeStyles({ + iovnameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +export function NoIovnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + yourname*iov + + + ); +} + +interface Props extends AddressesTableProps { + readonly onCancel: () => void; + readonly iovnameAddresses: BwUsernameWithChainName | undefined; + readonly bnsIdentity: Identity; + readonly rpcEndpoint: RpcEndpoint; + readonly transactionFee: Fee | undefined; + readonly setTransactionId: React.Dispatch>; +} + +const IovnameForm = ({ + chainAddresses, + iovnameAddresses, + bnsIdentity, + rpcEndpoint, + onCancel, + transactionFee, + setTransactionId, +}: Props): JSX.Element => { + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const chainAddressesItems = React.useMemo(() => { + if (iovnameAddresses) { + return getAddressItems(iovnameAddresses.addresses); + } + return getAddressItems(chainAddresses); + }, [chainAddresses, iovnameAddresses]); + + const onSubmit = async (values: object): Promise => { + const formValues = values as FormValues; + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + + try { + let request: JsonRpcRequest; + if (iovnameAddresses) { + request = await generateUpdateUsernameTxRequest( + bnsIdentity, + iovnameAddresses.username, + addressesToRegister, + ); + } else { + request = await generateRegisterUsernameTxRequest( + bnsIdentity, + formValues[REGISTER_IOVNAME_FIELD], + addressesToRegister, + ); + } + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + const iovnameValidator: FieldValidator = (value): string | undefined => { + if (!iovnameAddresses) { + if (!value) { + return "Required"; + } + + const checkResult = isValidIov(value); + + switch (checkResult) { + case "not_iov": + return "Iovname must end with *iov"; + case "wrong_number_of_asterisks": + return "Iovname must include only one namespace"; + case "too_short": + return "Iovname should be at least 3 characters"; + case "too_long": + return "Iovname should be maximum 64 characters"; + case "wrong_chars": + return "Iovname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; + case "valid": + break; + default: + throw new Error(`"Unknown iovname validation error: ${checkResult}`); + } + } + + return undefined; + }; + + /* const validateIovnameExistsAndAddresses = React.useCallback( + (values: object) => { + const validate = async (values: object): Promise => { + const formValues = values as FormValues; + const errors: ValidationError = {}; + + const connection = await getConnectionForBns(); + const username = formValues[REGISTER_IOVNAME_FIELD]; + const usernames = await connection.getUsernames({ username: username }); + if (usernames.length > 0) { + errors[REGISTER_IOVNAME_FIELD] = "Iovname already exists"; + return errors; + } + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + for (const address of addressesToRegister) { + const codec = await getCodecForChainId(address.chainId); + if (!codec.isValidAddress(address.address)) { + const addressField = Object.entries(formValues).find(([_id, value]) => { + if (value === address.address) return true; + return false; + }); + if (addressField) { + errors[addressField[0]] = "Not valid blockchain address"; + } + } + } + + return errors; + }; + + validate(values); + }, + [chainAddresses], + ); */ + + const initialValues = React.useMemo(() => getFormInitValues(chainAddressesItems), [chainAddressesItems]); + const { form, handleSubmit, invalid, submitting, validating } = useForm({ + onSubmit, + // validate: validateIovnameExistsAndAddresses, + initialValues, + }); + + const buttons = ( + + + + + + + Cancel + + + + ); + + return ( +
+ + + {iovnameAddresses && ( + + {iovnameAddresses.username} + + )} + {!iovnameAddresses && ( + + + + Create your iovname + + + + } title="Choose your address"> + With IOV you can choose your easy to read human readable address. No more complicated + cryptography when sending to friends. + + + + + How it works + + + + + + + + )} + + + + + + CHOOSE LINKED ADDRESSES + + + + + + } title="Your linked addresses"> + With Neuma you can have an universal blockchain address that is linked to all your + addresses. Just give your friends your iovname. + + + + + + + + Optional + + + + + + +
+ ); +}; + +export default IovnameForm; diff --git a/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx new file mode 100644 index 000000000..ded037979 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx @@ -0,0 +1,325 @@ +import { Fee, Identity, TransactionId } from "@iov/bcp"; +import { bnsCodec } from "@iov/bns"; +import { JsonRpcRequest } from "@iov/jsonrpc"; +import { FieldValidator } from "final-form"; +import { + Back, + BillboardContext, + Block, + Button, + FieldInputValue, + Form, + FormValues, + Hairline, + Image, + makeStyles, + TextField, + ToastContext, + ToastVariant, + Tooltip, + Typography, + useForm, +} from "medulas-react-components"; +import React from "react"; + +import { + AddressesTooltipHeader, + getAddressItems, + getChainAddressPairsFromValues, + getFormInitValues, + getSubmitButtonCaption, + TooltipContent, +} from ".."; +import { + generateRegisterAccountTxRequest, + generateReplaceAccountTargetsTxRequest, +} from "../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import { AddressesTableProps } from "../../../components/AddressesTable"; +import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../components/PageContent"; +import { isValidName } from "../../../logic/account"; +import { BwUsernameWithChainName } from "../../addresses"; +import shield from "../assets/shield.svg"; +import SelectAddressesTable from "./SelectAddressesTable"; + +export const REGISTER_NAME_VIEW_ID = "register-name-view-id"; +export const REGISTER_NAME_FIELD = "register-name-field"; + +const registerIcon = shield; + +const useStyles = makeStyles({ + iovnameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +function NoNameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + eg. anna*yourstarname + + + ); +} + +interface Props extends AddressesTableProps { + readonly onCancel: () => void; + readonly iovnameAddresses: BwUsernameWithChainName | undefined; + readonly bnsIdentity: Identity; + readonly rpcEndpoint: RpcEndpoint; + readonly transactionFee: Fee | undefined; + readonly setTransactionId: React.Dispatch>; +} + +const NameForm = ({ + chainAddresses, + iovnameAddresses, + bnsIdentity, + rpcEndpoint, + onCancel, + transactionFee, + setTransactionId, +}: Props): JSX.Element => { + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const chainAddressesItems = React.useMemo(() => { + if (iovnameAddresses) { + return getAddressItems(iovnameAddresses.addresses); + } + return getAddressItems(chainAddresses); + }, [chainAddresses, iovnameAddresses]); + + const onSubmit = async (values: object): Promise => { + const formValues = values as FormValues; + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + const [name, domain] = formValues[REGISTER_NAME_FIELD].split("*"); + + try { + let request: JsonRpcRequest; + if (iovnameAddresses) { + request = await generateReplaceAccountTargetsTxRequest( + bnsIdentity, + domain, + name, + addressesToRegister, + ); + } else { + request = await generateRegisterAccountTxRequest( + bnsIdentity, + domain, + name, + bnsCodec.identityToAddress(bnsIdentity), + addressesToRegister, + ); + } + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + const nameValidator: FieldValidator = (value): string | undefined => { + if (!iovnameAddresses) { + if (!value) { + return "Required"; + } + + const checkResult = isValidName(value); + + switch (checkResult) { + case "wrong_number_of_asterisks": + return "Name must include only one namespace"; + case "too_short": + return "Name should be at least 3 characters"; + case "too_long": + return "Name should be maximum 64 characters"; + case "wrong_chars": + return "Name should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; + case "valid": + break; + default: + throw new Error(`"Unknown name validation error: ${checkResult}`); + } + } + + return undefined; + }; + + /* const validateNameExistsAndAddresses = React.useCallback( + (values: object) => { + const validate = async (values: object): Promise => { + const formValues = values as FormValues; + const errors: ValidationError = {}; + + const connection = await getConnectionForBns(); + const [name, domain] = formValues[REGISTER_NAME_FIELD].split("*"); + const accounts = await connection.getAccounts({ domain: domain }); + if (accounts.find(account => account.name === name)) { + errors[REGISTER_NAME_FIELD] = "Name already exists"; + return errors; + } + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + for (const address of addressesToRegister) { + const codec = await getCodecForChainId(address.chainId); + if (!codec.isValidAddress(address.address)) { + const addressField = Object.entries(formValues).find(([_id, value]) => { + if (value === address.address) return true; + return false; + }); + if (addressField) { + errors[addressField[0]] = "Not valid blockchain address"; + } + } + } + + return errors; + }; + + validate(values); + }, + [chainAddresses], + ); */ + + const initialValues = React.useMemo(() => getFormInitValues(chainAddressesItems), [chainAddressesItems]); + const { form, handleSubmit, invalid, submitting, validating } = useForm({ + onSubmit, + // validate: validateNameExistsAndAddresses, + initialValues, + }); + + const buttons = ( + + + + + + + Cancel + + + + ); + + return ( +
+ + + {iovnameAddresses && ( + + {iovnameAddresses.username} + + )} + {!iovnameAddresses && ( + + + + Register your new name + + + + } title="Choose your address"> + With IOV you can choose your easy to read human readable address. No more complicated + cryptography when sending to friends. + + + + + How it works + + + + + + + + )} + + + + + + CHOOSE LINKED ADDRESSES + + + + + + } title="Your linked addresses"> + With Neuma you can have an universal blockchain address that is linked to all your + addresses. Just give your friends your starname. + + + + + + + + Optional + + + + + + +
+ ); +}; + +export default NameForm; diff --git a/packages/bierzo-wallet/src/routes/registerName/components/SelectAddressesTable.tsx b/packages/bierzo-wallet/src/routes/register/components/SelectAddressesTable.tsx similarity index 100% rename from packages/bierzo-wallet/src/routes/registerName/components/SelectAddressesTable.tsx rename to packages/bierzo-wallet/src/routes/register/components/SelectAddressesTable.tsx diff --git a/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx new file mode 100644 index 000000000..9247cd439 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx @@ -0,0 +1,237 @@ +import { Fee, Identity, TransactionId } from "@iov/bcp"; +import { FieldValidator } from "final-form"; +import { + Back, + BillboardContext, + Block, + Button, + FieldInputValue, + Form, + FormValues, + Image, + makeStyles, + TextField, + ToastContext, + ToastVariant, + Tooltip, + Typography, + useForm, +} from "medulas-react-components"; +import React from "react"; + +import { getSubmitButtonCaption, TooltipContent } from ".."; +import { generateRegisterDomainTxRequest } from "../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../components/PageContent"; +import { isValidStarname } from "../../../logic/account"; +import { BwUsernameWithChainName } from "../../addresses"; +import shield from "../assets/shield.svg"; + +export const REGISTER_STARNAME_VIEW_ID = "register-starname-view-id"; +export const REGISTER_STARNAME_FIELD = "register-starname-field"; + +const registerIcon = shield; + +const useStyles = makeStyles({ + starnameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +export function NoStarnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + *yourstarname + + + ); +} + +interface Props { + readonly onCancel: () => void; + readonly iovnameAddresses: BwUsernameWithChainName | undefined; + readonly bnsIdentity: Identity; + readonly rpcEndpoint: RpcEndpoint; + readonly transactionFee: Fee | undefined; + readonly setTransactionId: React.Dispatch>; +} + +const StarnameForm = ({ + iovnameAddresses, + bnsIdentity, + rpcEndpoint, + onCancel, + transactionFee, + setTransactionId, +}: Props): JSX.Element => { + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const onSubmit = async (values: object): Promise => { + const formValues = values as FormValues; + const domain = formValues[REGISTER_STARNAME_FIELD].split("*")[1]; + + try { + const request = await generateRegisterDomainTxRequest(bnsIdentity, domain); + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + const starnameValidator: FieldValidator = (value): string | undefined => { + if (!iovnameAddresses) { + if (!value) { + return "Required"; + } + + const checkResult = isValidStarname(value); + + switch (checkResult) { + case "not_starname": + return "Starname must include namespace after '*'"; + case "wrong_number_of_asterisks": + return "Starname must include only one namespace"; + case "too_short": + return "Starname should be at least 3 characters"; + case "too_long": + return "Starname should be maximum 16 characters"; + case "wrong_chars": + return "Starname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; + case "valid": + break; + default: + throw new Error(`"Unknown starname validation error: ${checkResult}`); + } + } + + return undefined; + }; + + /* const validateStarnameExists = React.useCallback((values: object) => { + const validate = async (values: object): Promise => { + const formValues = values as FormValues; + const errors: ValidationError = {}; + + const connection = await getConnectionForBns(); + const noAsteriskDomain = value.substring(1); + const domains = await connection.getDomains({ name: noAsteriskDomain }); + if (domains.length > 0) { + errors[REGISTER_STARNAME_FIELD] = "Starname already exists"; + return errors; + } + + return errors; + }; + + validate(values); + }, []); */ + + const { form, handleSubmit, invalid, submitting, validating } = useForm({ + onSubmit, + // validate: validateStarnameExists, + }); + + const buttons = ( + + + + + + + Cancel + + + + ); + + return ( +
+ + + {iovnameAddresses && ( + + {iovnameAddresses.username} + + )} + {!iovnameAddresses && ( + + + + Register your starname + + + + } title="Choose your address"> + With IOV you can choose your easy to read human readable address. No more complicated + cryptography when sending to friends. + + + + + How it works + + + + + + + + )} + + +
+ ); +}; + +export default StarnameForm; diff --git a/packages/bierzo-wallet/src/routes/registerName/index.stories.tsx b/packages/bierzo-wallet/src/routes/register/index.stories.tsx similarity index 50% rename from packages/bierzo-wallet/src/routes/registerName/index.stories.tsx rename to packages/bierzo-wallet/src/routes/register/index.stories.tsx index 8f0d0ec99..1c74c434a 100644 --- a/packages/bierzo-wallet/src/routes/registerName/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/register/index.stories.tsx @@ -1,25 +1,18 @@ -import { Address, ChainId, Fee, Token, TokenTicker, TransactionId } from "@iov/bcp"; -import { action } from "@storybook/addon-actions"; +import { TransactionId } from "@iov/bcp"; import { linkTo } from "@storybook/addon-links"; import { storiesOf } from "@storybook/react"; -import { FormValues, ValidationError } from "medulas-react-components"; import React from "react"; -import { stringToAmount } from "ui-logic"; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import { isValidIov } from "../../logic/account"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; -import { BALANCE_STORY_PATH, BALANCE_STORY_VIEW_PATH } from "../balance/index.stories"; import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../transactions/index.stories"; import ConfirmRegistration from "./components/ConfirmRegistration"; -import Layout, { REGISTER_USERNAME_FIELD } from "./components/index"; export const REGISTER_USERNAME_STORY_PATH = `${bierzoRoot}/Register Username`; export const REGISTER_USERNAME_REGISTRATION_STORY_PATH = "Register Username"; -const REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Username without fee"; +// const REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Username without fee"; const REGISTER_USERNAME_CONFIRMATION_STORY_PATH = "Registration confirmation"; -const addresses: ChainAddressPairWithName[] = [ +/* const addresses: ChainAddressPairWithName[] = [ { chainId: "local-iov-devnet" as ChainId, address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, @@ -37,47 +30,6 @@ const addresses: ChainAddressPairWithName[] = [ }, ]; -async function onSubmit(values: object): Promise { - const formValues = values as FormValues; - action("onSubmit")(formValues); -} - -async function validate(values: object): Promise { - const formValues = values as FormValues; - const errors: ValidationError = {}; - - const username = formValues[REGISTER_USERNAME_FIELD]; - if (!username) { - errors[REGISTER_USERNAME_FIELD] = "Required"; - return errors; - } - const checkResult = isValidIov(username); - - switch (checkResult) { - case "not_iov": - errors[REGISTER_USERNAME_FIELD] = "IOV starname must include *iov"; - break; - case "wrong_number_of_asterisks": - errors[REGISTER_USERNAME_FIELD] = "IOV starname must include only one namespace"; - break; - case "too_short": - errors[REGISTER_USERNAME_FIELD] = "IOV starname should be at least 3 characters"; - break; - case "too_long": - errors[REGISTER_USERNAME_FIELD] = "IOV starname should be maximum 64 characters"; - break; - case "wrong_chars": - errors[REGISTER_USERNAME_FIELD] = - "IOV starname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; - break; - case "valid": - break; - default: - throw new Error(`"Unknown IOV starname validation error: ${checkResult}`); - } - return errors; -} - const iov: Pick = { fractionalDigits: 9, tokenTicker: "IOV" as TokenTicker, @@ -85,17 +37,16 @@ const iov: Pick = { const fee: Fee = { tokens: stringToAmount("5", iov), -}; +}; */ storiesOf(REGISTER_USERNAME_STORY_PATH, module) .addParameters({ viewport: { defaultViewport: "responsive" } }) - .add(REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( + // TODO adapt this stories to new components + /* .add(REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( - @@ -103,16 +54,14 @@ storiesOf(REGISTER_USERNAME_STORY_PATH, module) )) .add(REGISTER_USERNAME_REGISTRATION_STORY_PATH, () => ( - - )) + )) */ .add(REGISTER_USERNAME_CONFIRMATION_STORY_PATH, () => ( ; + +const useStyles = makeStyles({ + addressesHeader: { + backgroundColor: "#31E6C9", + fontSize: "27.5px", + width: 56, + height: 56, + }, +}); + +export function AddressesTooltipHeader(): JSX.Element { + const classes = useStyles(); + const avatarClasses = { root: classes.addressesHeader }; + return {registerTooltipIcon}; +} + +interface TooltipContentProps { + readonly header: React.ReactNode; + readonly title: string; + readonly children: React.ReactNode; +} + +export function TooltipContent({ children, title, header }: TooltipContentProps): JSX.Element { + return ( + + {header} + + + {title} + + + {children} + + + ); +} + +export function getSubmitButtonCaption(fee: Fee | undefined): string { + if (fee && fee.tokens) { + return `Register for ${amountToString(fee.tokens)}`; + } + + return "Register"; +} + +export function getFormInitValues(addressItems: SelectAddressItem[]): FormValues { + const initialValues: FormValues = {}; + addressItems.forEach(item => { + initialValues[getAddressInputName(item.id)] = item.chain.address; + initialValues[getBlockchainInputName(item.id)] = item.chain.chainName; + }); + + return initialValues; +} + +export function getAddressItems(chainAddresses: readonly ChainAddressPairWithName[]): SelectAddressItem[] { + const addressItems: SelectAddressItem[] = []; + chainAddresses.forEach((chain, index) => { + addressItems.push({ + id: index.toString(), + chain, + }); + }); + + return addressItems; +} + +export function getBnsIdentity(identities: ReadonlyMap): Identity | undefined { + for (const identity of Array.from(identities.values()).map(ext => ext.identity)) { + if (getConnectionForChainId(identity.chainId) instanceof BnsConnection) { + return identity; + } + } + return undefined; +} + +async function getPersonalizedAddressRegistrationFee( + bnsIdentity: Identity, + addresses: readonly ChainAddressPairWithName[], +): Promise { + const transactionWithFee = await generateRegisterUsernameTxWithFee(bnsIdentity, "feetest*iov", addresses); + + return transactionWithFee.fee; +} + +export function getChainAddressPairsFromValues( + values: FormValues, + addresses: readonly ChainAddressPairWithName[], +): readonly ChainAddressPairWithName[] { + const chainAddressMap: Map> = new Map< + string, + Partial + >(); + Object.keys(values).forEach(key => { + const idxLenght = key.indexOf("-"); + if (idxLenght === -1) return; + + const index = key.substr(0, idxLenght); + let pair = chainAddressMap.get(index); + if (!pair) { + pair = {}; + } + + const type = key.substr(idxLenght + 1); + switch (type) { + case addressValueField: { + pair = { ...pair, address: values[key] as Address }; + break; + } + case blockchainValueField: { + const chain = addresses.find(address => address.chainName === values[key]); + if (chain) { + pair = { ...pair, chainId: chain.chainId, chainName: chain.chainName }; + } + break; + } + } + + chainAddressMap.set(index, pair); + }); + + const chainAddressPair: ChainAddressPairWithName[] = []; + chainAddressMap.forEach(value => { + if (value.address && value.chainId && value.chainName) { + chainAddressPair.push({ + address: value.address, + chainId: value.chainId, + chainName: value.chainName, + }); + } + }); + + return chainAddressPair; +} + +export enum ToRegister { + Iovname = "iovname", + Starname = "starname", + Name = "name", +} + +interface Props { + entity: ToRegister; +} + +const Register = ({ entity }: Props): JSX.Element => { + const [transactionId, setTransactionId] = React.useState(null); + const [transactionFee, setTransactionFee] = React.useState(undefined); + + const rpcEndpoint = ReactRedux.useSelector((state: RootState) => state.rpcEndpoint); + const identities = ReactRedux.useSelector((state: RootState) => state.identities); + const addressesSorted = React.useMemo(() => getChainAddressPairWithNamesSorted(identities), [identities]); + + const bnsIdentity = getBnsIdentity(identities); + const iovnameAddresses: BwUsernameWithChainName | undefined = history.location.state; + + if (!bnsIdentity) throw new Error("No BNS identity available."); + if (!rpcEndpoint) throw new Error("RPC endpoint not set in redux store. This is a bug."); + + React.useEffect(() => { + let isSubscribed = true; + async function getFee( + bnsIdentity: Identity, + addresses: readonly ChainAddressPairWithName[], + ): Promise { + const fee = await getPersonalizedAddressRegistrationFee(bnsIdentity, addresses); + + if (isSubscribed) { + setTransactionFee(fee); + } + } + getFee(bnsIdentity, addressesSorted); + + return () => { + isSubscribed = false; + }; + }, [addressesSorted, bnsIdentity]); + + return ( + + {transactionId ? ( + + ) : ( + + {entity === ToRegister.Iovname && ( + + )} + {entity === ToRegister.Starname && ( + + )} + {entity === ToRegister.Name && ( + + )} + + )} + + ); +}; + +export default Register; diff --git a/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts b/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts index f6828c8b2..a87096d73 100644 --- a/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts +++ b/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts @@ -5,10 +5,16 @@ import { BnsUsernameNft, CreateProposalTx, isCreateProposalTx, + isRegisterAccountTx, + isRegisterDomainTx, isRegisterUsernameTx, + isReplaceAccountTargetsTx, isUpdateTargetsOfUsernameTx, isVoteTx, + RegisterAccountTx, + RegisterDomainTx, RegisterUsernameTx, + ReplaceAccountTargetsTx, UpdateTargetsOfUsernameTx, VoteTx, } from "@iov/bns"; @@ -28,7 +34,13 @@ import { SoftwareAccountManagerChainConfig, } from "../accountManager/softwareAccountManager"; import { StringDb } from "../backgroundscript/db"; -import { algorithmForCodec, chainConnector, getChains, pathBuilderForCodec } from "./config"; +import { + algorithmForCodec, + chainConnector, + codecTypeFromString, + getChains, + pathBuilderForCodec, +} from "./config"; import { createTwoWalletProfile } from "./userprofilehelpers"; function isNonUndefined(t: T | undefined): t is T { @@ -42,6 +54,9 @@ export type SupportedTransaction = | SendTransaction | RegisterUsernameTx | UpdateTargetsOfUsernameTx + | RegisterDomainTx + | RegisterAccountTx + | ReplaceAccountTargetsTx | CreateProposalTx | VoteTx; @@ -50,6 +65,9 @@ export function isSupportedTransaction(tx: UnsignedTransaction): tx is Supported isSendTransaction(tx) || isRegisterUsernameTx(tx) || isUpdateTargetsOfUsernameTx(tx) || + isRegisterDomainTx(tx) || + isRegisterAccountTx(tx) || + isReplaceAccountTargetsTx(tx) || isCreateProposalTx(tx) || isVoteTx(tx) ); @@ -140,14 +158,15 @@ export class Persona { const managerChains: SoftwareAccountManagerChainConfig[] = []; for (const chainSpec of (await getChains()).map(chain => chain.chainSpec)) { - const connector = chainConnector(chainSpec); + const codecType = codecTypeFromString(chainSpec.codecType); + const connector = chainConnector(codecType, chainSpec); try { const { connection } = await signer.addChain(connector); managerChains.push({ chainId: connection.chainId, - algorithm: algorithmForCodec(chainSpec.codecType), - derivePath: pathBuilderForCodec(chainSpec.codecType), + algorithm: algorithmForCodec(codecType), + derivePath: pathBuilderForCodec(codecType), }); } catch (e) { console.error("Could not add chain. " + e); diff --git a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterAccountTx.tsx b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterAccountTx.tsx new file mode 100644 index 000000000..456ffa1cd --- /dev/null +++ b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterAccountTx.tsx @@ -0,0 +1,38 @@ +import { RegisterAccountTx } from "@iov/bns"; +import { Block, List, Typography } from "medulas-react-components"; +import * as React from "react"; + +import TransactionFee from "./TransactionFee"; + +export const REQ_REGISTER_ACCOUNT = "req-register-account-tx"; + +interface Props { + readonly tx: RegisterAccountTx; +} + +const ReqRegisterAccountTx = ({ tx }: Props): JSX.Element => { + return ( + + + {tx.name} + + + {" "} + name registration for{" "} + + + {tx.domain} + + + {" "} + domain. + + + + + + + ); +}; + +export default ReqRegisterAccountTx; diff --git a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterDomainTx.tsx b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterDomainTx.tsx new file mode 100644 index 000000000..ab718df6f --- /dev/null +++ b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqRegisterDomainTx.tsx @@ -0,0 +1,31 @@ +import { RegisterDomainTx } from "@iov/bns"; +import { Block, List, Typography } from "medulas-react-components"; +import * as React from "react"; + +import TransactionFee from "./TransactionFee"; + +export const REQ_REGISTER_DOMAIN = "req-register-domain-tx"; + +interface Props { + readonly tx: RegisterDomainTx; +} + +const ReqRegisterDomainTx = ({ tx }: Props): JSX.Element => { + return ( + + + {tx.domain} + + + {" "} + starname registration request. + + + + + + + ); +}; + +export default ReqRegisterDomainTx; diff --git a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqReplaceAccountTargetsTx.tsx b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqReplaceAccountTargetsTx.tsx new file mode 100644 index 000000000..2f4351f08 --- /dev/null +++ b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/ReqReplaceAccountTargetsTx.tsx @@ -0,0 +1,43 @@ +import { ReplaceAccountTargetsTx } from "@iov/bns"; +import { Block, List, ListItem, ListItemText, Typography } from "medulas-react-components"; +import * as React from "react"; + +import TransactionFee, { txListItemSecondaryProps, useTxListItemStyles } from "./TransactionFee"; + +export const REQ_REPLACE_ACCOUNT_TARGETS = "req-replace-account-targets-tx"; + +interface Props { + readonly tx: ReplaceAccountTargetsTx; +} + +const ReqReplaceAccountTargetsTx = ({ tx }: Props): JSX.Element => { + const listItemClasses = useTxListItemStyles(); + + return ( + + + {tx.name}*{tx.domain} + + + Addresses: + + {tx.newTargets.map(target => ( + + + + ))} + + + + + + + ); +}; + +export default ReqReplaceAccountTargetsTx; diff --git a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/index.tsx b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/index.tsx index 5f0cff181..40e9b0b33 100644 --- a/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/index.tsx +++ b/packages/sanes-browser-extension/src/routes/wallet/components/SidePanel/PanelDrawer/components/Requests/ShowRequest/SignAndPostTx/ShowTx/index.tsx @@ -1,11 +1,22 @@ import { isSendTransaction } from "@iov/bcp"; -import { isCreateProposalTx, isRegisterUsernameTx, isUpdateTargetsOfUsernameTx, isVoteTx } from "@iov/bns"; +import { + isCreateProposalTx, + isRegisterAccountTx, + isRegisterDomainTx, + isRegisterUsernameTx, + isReplaceAccountTargetsTx, + isUpdateTargetsOfUsernameTx, + isVoteTx, +} from "@iov/bns"; import { Block, Button, Typography } from "medulas-react-components"; import * as React from "react"; import { SupportedTransaction } from "../../../../../../../../../../extension/background/model/persona"; import ReqCreateProposalTx from "./ReqCreateProposalTx"; +import ReqRegisterAccountTx from "./ReqRegisterAccountTx"; +import ReqRegisterDomainTx from "./ReqRegisterDomainTx"; import ReqRegisterUsernameTx from "./ReqRegisterUsernameTx"; +import ReqReplaceAccountTargetsTx from "./ReqReplaceAccountTargetsTx"; import ReqSendTransaction from "./ReqSendTransaction"; import ReqUpdateTargetsOfUsernameTx from "./ReqUpdateTargetsOfUsernameTx"; import ReqVoteTx from "./ReqVoteTx"; @@ -28,6 +39,12 @@ const ShowTx = ({ sender, tx, onAcceptRequest, showRejectView }: Props): JSX.Ele req = ; } else if (isUpdateTargetsOfUsernameTx(tx)) { req = ; + } else if (isRegisterDomainTx(tx)) { + req = ; + } else if (isRegisterAccountTx(tx)) { + req = ; + } else if (isReplaceAccountTargetsTx(tx)) { + req = ; } else if (isCreateProposalTx(tx)) { req = ; } else if (isVoteTx(tx)) { diff --git a/packages/sil-governance/src/routes/dashboard/components/ProposalsList.tsx b/packages/sil-governance/src/routes/dashboard/components/ProposalsList.tsx index 5b7ddcd56..d3c120b91 100644 --- a/packages/sil-governance/src/routes/dashboard/components/ProposalsList.tsx +++ b/packages/sil-governance/src/routes/dashboard/components/ProposalsList.tsx @@ -1,5 +1,4 @@ import { Address } from "@iov/bcp"; -import { VoteOption } from "@iov/bns"; import { Block, SelectField, SelectFieldItem, Typography, useForm } from "medulas-react-components"; import React, { useState } from "react"; import { useSelector } from "react-redux"; @@ -63,24 +62,23 @@ const compareByExpiryDate: ProposalsComparator = (proposal1, proposal2): number const compareByStartDate: ProposalsComparator = (proposal1, proposal2): number => { return proposal1.startDate.getTime() - proposal2.startDate.getTime(); }; -function voteValue(vote: VoteOption): number { - // The values of the original numeric VoteOption enum implementation. There is no specific reason to use those values. - switch (vote) { - case VoteOption.Yes: - return 0; - case VoteOption.No: - return 1; - case VoteOption.Abstain: - return 2; - default: - throw new Error("Unsupported vote option"); - } -} const compareByVote: ProposalsComparator = (proposal1, proposal2): number => { if (proposal1.vote === undefined && proposal2.vote === undefined) return 0; if (proposal1.vote === undefined) return 1; if (proposal2.vote === undefined) return -1; - return voteValue(proposal1.vote) - voteValue(proposal2.vote); + + if (proposal1.vote === "abstain" && proposal2.vote === "abstain") return 0; + if (proposal1.vote === "abstain") return 1; + + if (proposal1.vote === "no" && proposal2.vote === "abstain") return -1; + if (proposal1.vote === "no" && proposal2.vote === "no") return 0; + if (proposal1.vote === "no") return 1; + + if (proposal1.vote === "yes" && proposal2.vote === "abstain") return -1; + if (proposal1.vote === "yes" && proposal2.vote === "no") return -1; + if (proposal1.vote === "yes") return 0; + + return 0; }; interface Props { From a3480cc701dcc5e7ca07f7a5c7d2a24f0233b7e5 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 17:44:21 +0200 Subject: [PATCH 066/204] Fix after revert --- .../register/components/IovnameForm.tsx | 17 +- .../src/routes/register/index.tsx | 50 ++-- .../routes/registerName/components/index.tsx | 242 ------------------ .../src/routes/registerStarName/index.tsx | 34 --- 4 files changed, 40 insertions(+), 303 deletions(-) delete mode 100644 packages/bierzo-wallet/src/routes/registerName/components/index.tsx delete mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx index a383a5c93..c8f98f74a 100644 --- a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx @@ -189,15 +189,16 @@ const IovnameForm = ({ const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); for (const address of addressesToRegister) { - const codec = await getCodecForChainId(address.chainId); - if (!codec.isValidAddress(address.address)) { - const addressField = Object.entries(formValues).find(([_id, value]) => { - if (value === address.address) return true; - return false; - }); - if (addressField) { - errors[addressField[0]] = "Not valid blockchain address"; + try { + const codec = await getCodecForChainId(address.chainId); + if (!codec.isValidAddress(address.address)) { + const addressField = Object.entries(formValues).find(([_id, value]) => value === address.address); + if (addressField) { + errors[addressField[0]] = "Not valid blockchain address"; + } } + } catch (err) { + console.info(err); } } diff --git a/packages/bierzo-wallet/src/routes/register/index.tsx b/packages/bierzo-wallet/src/routes/register/index.tsx index 662901f2c..6ee91aec0 100644 --- a/packages/bierzo-wallet/src/routes/register/index.tsx +++ b/packages/bierzo-wallet/src/routes/register/index.tsx @@ -1,32 +1,38 @@ import { Address, ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; import { BnsConnection } from "@iov/bns"; -import { Avatar, Block, FormValues, Image, makeStyles, Typography } from "medulas-react-components"; +import { JsonRpcRequest } from "@iov/jsonrpc"; +import { + BillboardContext, + FormValues, + ToastContext, + ToastVariant, + ValidationError, +} from "medulas-react-components"; import React from "react"; import * as ReactRedux from "react-redux"; -import { amountToString } from "ui-logic"; import { history } from ".."; -import { generateRegisterUsernameTxWithFee } from "../../communication/requestgenerators"; +import { + generateRegisterUsernameTxRequest, + generateRegisterUsernameTxWithFee, + generateUpdateUsernameTxRequest, +} from "../../communication/requestgenerators"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; import PageMenu from "../../components/PageMenu"; -import { getConnectionForChainId } from "../../logic/connection"; +import { getConfig, SupportedChain } from "../../config"; +import { isValidIov } from "../../logic/account"; +import { getCodecForChainId } from "../../logic/codec"; +import { getConnectionForBns, getConnectionForChainId } from "../../logic/connection"; import { ExtendedIdentity } from "../../store/identities"; import { RootState } from "../../store/reducers"; import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; import { BwUsernameWithChainName } from "../addresses"; import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; -import shield from "./assets/shield.svg"; +import Layout, { REGISTER_USERNAME_FIELD } from "./components"; import ConfirmRegistration from "./components/ConfirmRegistration"; -import IovnameForm from "./components/IovnameForm"; -import NameForm from "./components/NameForm"; -import { - addressValueField, - blockchainValueField, - getAddressInputName, - getBlockchainInputName, - SelectAddressItem, -} from "./components/SelectAddressesTable"; -import StarnameForm from "./components/StarnameForm"; +import { addressValueField, blockchainValueField } from "./components/SelectAddressesTable"; function onSeeTrasactions(): void { history.push(TRANSACTIONS_ROUTE); @@ -187,10 +193,14 @@ interface Props { const Register = ({ entity }: Props): JSX.Element => { const [transactionId, setTransactionId] = React.useState(null); const [transactionFee, setTransactionFee] = React.useState(undefined); + const [supportedChains, setSupportedChains] = React.useState([]); const rpcEndpoint = ReactRedux.useSelector((state: RootState) => state.rpcEndpoint); const identities = ReactRedux.useSelector((state: RootState) => state.identities); - const addressesSorted = React.useMemo(() => getChainAddressPairWithNamesSorted(identities), [identities]); + const addressesSorted = React.useMemo( + () => getChainAddressPairWithNamesSorted(identities, supportedChains), + [identities, supportedChains], + ); const bnsIdentity = getBnsIdentity(identities); const iovnameAddresses: BwUsernameWithChainName | undefined = history.location.state; @@ -200,17 +210,19 @@ const Register = ({ entity }: Props): JSX.Element => { React.useEffect(() => { let isSubscribed = true; - async function getFee( + async function getFeeAndConfig( bnsIdentity: Identity, addresses: readonly ChainAddressPairWithName[], ): Promise { const fee = await getPersonalizedAddressRegistrationFee(bnsIdentity, addresses); + const config = await getConfig(); if (isSubscribed) { setTransactionFee(fee); + setSupportedChains(config.supportedChains); } } - getFee(bnsIdentity, addressesSorted); + getFeeAndConfig(bnsIdentity, addressesSorted); return () => { isSubscribed = false; @@ -261,4 +273,4 @@ const Register = ({ entity }: Props): JSX.Element => { ); }; -export default Register; +export default RegisterUsername; diff --git a/packages/bierzo-wallet/src/routes/registerName/components/index.tsx b/packages/bierzo-wallet/src/routes/registerName/components/index.tsx deleted file mode 100644 index aae64005d..000000000 --- a/packages/bierzo-wallet/src/routes/registerName/components/index.tsx +++ /dev/null @@ -1,242 +0,0 @@ -import { Fee } from "@iov/bcp"; -import { - Avatar, - Back, - Block, - Button, - Form, - FormValues, - Hairline, - Image, - makeStyles, - TextField, - Tooltip, - Typography, - useForm, -} from "medulas-react-components"; -import React from "react"; -import { amountToString } from "ui-logic"; - -import { AddressesTableProps, ChainAddressPairWithName } from "../../../components/AddressesTable"; -import PageContent from "../../../components/PageContent"; -import { BwUsernameWithChainName } from "../../addresses"; -import shield from "../assets/shield.svg"; -import SelectAddressesTable, { - getAddressInputName, - getBlockchainInputName, - SelectAddressItem, -} from "./SelectAddressesTable"; - -export const REGISTER_USERNAME_VIEW_ID = "register-username-view-id"; -export const REGISTER_USERNAME_FIELD = "register-username-field"; - -const registerIcon = shield; -const registerTooltipIcon = shield; - -const useStyles = makeStyles({ - usernameHeader: { - boxShadow: "0px 0px 14px #EDEFF4", - }, - addressesHeader: { - backgroundColor: "#31E6C9", - fontSize: "27.5px", - width: 56, - height: 56, - }, -}); - -export function NoUsernameHeader(): JSX.Element { - const classes = useStyles(); - return ( - - - yourname*iov - - - ); -} - -export function AddressesTooltipHeader(): JSX.Element { - const classes = useStyles(); - const avatarClasses = { root: classes.addressesHeader }; - return {registerTooltipIcon}; -} - -interface TooltipContentProps { - readonly header: React.ReactNode; - readonly title: string; - readonly children: React.ReactNode; -} - -export function TooltipContent({ children, title, header }: TooltipContentProps): JSX.Element { - return ( - - {header} - - - {title} - - - {children} - - - ); -} - -function getSubmitButtonCaption(fee: Fee | undefined): string { - if (fee && fee.tokens) { - return `Register for ${amountToString(fee.tokens)}`; - } - - return "Register"; -} - -function getFormInitValues(addressItems: SelectAddressItem[]): FormValues { - const initialValues: FormValues = {}; - addressItems.forEach(item => { - initialValues[getAddressInputName(item.id)] = item.chain.address; - initialValues[getBlockchainInputName(item.id)] = item.chain.chainName; - }); - - return initialValues; -} - -function getAddressItems(chainAddresses: readonly ChainAddressPairWithName[]): SelectAddressItem[] { - return chainAddresses - .filter(chain => !!chain.address) - .map((chain, index) => ({ id: index.toString(), chain })); -} - -interface Props extends AddressesTableProps { - readonly onSubmit: (values: object) => Promise; - readonly validate: (values: object) => Promise; - readonly onCancel: () => void; - readonly iovnameAddresses: BwUsernameWithChainName | undefined; - readonly transactionFee: Fee | undefined; -} - -const Layout = ({ - chainAddresses, - iovnameAddresses, - validate, - onSubmit, - onCancel, - transactionFee, -}: Props): JSX.Element => { - const chainAddressesItems = React.useMemo(() => { - if (iovnameAddresses) { - return getAddressItems(iovnameAddresses.addresses); - } - return getAddressItems(chainAddresses); - }, [chainAddresses, iovnameAddresses]); - - const initialValues = React.useMemo(() => getFormInitValues(chainAddressesItems), [chainAddressesItems]); - const { form, handleSubmit, invalid, submitting, validating } = useForm({ - onSubmit, - validate, - initialValues, - }); - - const buttons = ( - - - - - - - Cancel - - - - ); - - return ( -
- - - {iovnameAddresses && ( - - {iovnameAddresses.username} - - )} - {!iovnameAddresses && ( - - - - Create your iovname - - - - } title="Choose your address"> - With IOV you can choose your easy to read human readable address. No more complicated - cryptography when sending to friends. - - - - - How it works - - - - - - - - )} - - - - - - CHOOSE LINKED ADDRESSES - - - - - - } title="Your linked addresses"> - With Neuma you can have an universal blockchain address that is linked to all your - addresses. Just give your friends your iovname. - - - - - - - - Optional - - - - - - -
- ); -}; - -export default Layout; diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx deleted file mode 100644 index db8da3f36..000000000 --- a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Block, makeStyles, Typography } from "medulas-react-components"; -import React from "react"; - -import PageMenu from "../../components/PageMenu"; - -const useStyles = makeStyles({ - usernameHeader: { - boxShadow: "0px 0px 14px #EDEFF4", - }, -}); - -// TODO move to components when implemented, mirroring registerName -export function NoStarnameHeader(): JSX.Element { - const classes = useStyles(); - return ( - - - *yourstarname - - - ); -} - -const RegisterStarname = (): JSX.Element => { - return ( - - - Register new starname. Work in progress view - - - ); -}; - -export default RegisterStarname; From 36e6c5bcb5e79d03ab5ff5938b79e59d8ca258bd Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 18:14:27 +0200 Subject: [PATCH 067/204] Fixes --- .../src/routes/register/index.tsx | 37 ++++++++----------- .../background/model/persona/index.ts | 15 ++------ 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/register/index.tsx b/packages/bierzo-wallet/src/routes/register/index.tsx index 6ee91aec0..8e06ee5bb 100644 --- a/packages/bierzo-wallet/src/routes/register/index.tsx +++ b/packages/bierzo-wallet/src/routes/register/index.tsx @@ -1,38 +1,33 @@ import { Address, ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; import { BnsConnection } from "@iov/bns"; -import { JsonRpcRequest } from "@iov/jsonrpc"; -import { - BillboardContext, - FormValues, - ToastContext, - ToastVariant, - ValidationError, -} from "medulas-react-components"; +import { Avatar, Block, FormValues, Image, makeStyles, Typography } from "medulas-react-components"; import React from "react"; import * as ReactRedux from "react-redux"; +import { amountToString } from "ui-logic"; import { history } from ".."; -import { - generateRegisterUsernameTxRequest, - generateRegisterUsernameTxWithFee, - generateUpdateUsernameTxRequest, -} from "../../communication/requestgenerators"; +import { generateRegisterUsernameTxWithFee } from "../../communication/requestgenerators"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; -import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; import PageMenu from "../../components/PageMenu"; import { getConfig, SupportedChain } from "../../config"; -import { isValidIov } from "../../logic/account"; -import { getCodecForChainId } from "../../logic/codec"; -import { getConnectionForBns, getConnectionForChainId } from "../../logic/connection"; +import { getConnectionForChainId } from "../../logic/connection"; import { ExtendedIdentity } from "../../store/identities"; import { RootState } from "../../store/reducers"; import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; import { BwUsernameWithChainName } from "../addresses"; import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; -import Layout, { REGISTER_USERNAME_FIELD } from "./components"; +import shield from "./assets/shield.svg"; import ConfirmRegistration from "./components/ConfirmRegistration"; -import { addressValueField, blockchainValueField } from "./components/SelectAddressesTable"; +import IovnameForm from "./components/IovnameForm"; +import NameForm from "./components/NameForm"; +import { + addressValueField, + blockchainValueField, + getAddressInputName, + getBlockchainInputName, + SelectAddressItem, +} from "./components/SelectAddressesTable"; +import StarnameForm from "./components/StarnameForm"; function onSeeTrasactions(): void { history.push(TRANSACTIONS_ROUTE); @@ -273,4 +268,4 @@ const Register = ({ entity }: Props): JSX.Element => { ); }; -export default RegisterUsername; +export default Register; diff --git a/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts b/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts index a87096d73..754f59cc5 100644 --- a/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts +++ b/packages/sanes-browser-extension/src/extension/background/model/persona/index.ts @@ -34,13 +34,7 @@ import { SoftwareAccountManagerChainConfig, } from "../accountManager/softwareAccountManager"; import { StringDb } from "../backgroundscript/db"; -import { - algorithmForCodec, - chainConnector, - codecTypeFromString, - getChains, - pathBuilderForCodec, -} from "./config"; +import { algorithmForCodec, chainConnector, getChains, pathBuilderForCodec } from "./config"; import { createTwoWalletProfile } from "./userprofilehelpers"; function isNonUndefined(t: T | undefined): t is T { @@ -158,15 +152,14 @@ export class Persona { const managerChains: SoftwareAccountManagerChainConfig[] = []; for (const chainSpec of (await getChains()).map(chain => chain.chainSpec)) { - const codecType = codecTypeFromString(chainSpec.codecType); - const connector = chainConnector(codecType, chainSpec); + const connector = chainConnector(chainSpec); try { const { connection } = await signer.addChain(connector); managerChains.push({ chainId: connection.chainId, - algorithm: algorithmForCodec(codecType), - derivePath: pathBuilderForCodec(codecType), + algorithm: algorithmForCodec(chainSpec.codecType), + derivePath: pathBuilderForCodec(chainSpec.codecType), }); } catch (e) { console.error("Could not add chain. " + e); From 86e0bef6a5ce4e36b46e78cafbcfe964fad46629 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 18:35:55 +0200 Subject: [PATCH 068/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 588 +----------------- 1 file changed, 27 insertions(+), 561 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 460995a52..7be64729d 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1856,7 +1856,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames tab 1`] = ` className="MuiBox-root MuiBox-root" >
Choose Now @@ -1902,7 +1902,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames with name tab 1`] = ` />

+ Create new iovname @@ -2502,7 +2502,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with extension 1`] = ` className="MuiBox-root MuiBox-root" >

Register Now
+
+ Register your name +
@@ -2612,7 +2618,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with ledger 1`] = ` className="MuiBox-root MuiBox-root" >

starname

@@ -2728,7 +2734,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = ` className="MuiBox-root MuiBox-root" >
Register Now
+
+ Register your name +
@@ -3110,7 +3122,7 @@ exports[`Storyshots Bierzo Wallet/Balance View on ledger and without name 1`] = className="MuiBox-root MuiBox-root" >

personalized address

@@ -3344,7 +3356,7 @@ exports[`Storyshots Bierzo Wallet/Balance View without tokens and without name 1 className="MuiBox-root MuiBox-root" >
Choose Now @@ -5261,556 +5273,10 @@ exports[`Storyshots Bierzo Wallet/Payment Verified Recipient 1`] = `
`; -exports[`Storyshots Bierzo Wallet/Register Username Register Username 1`] = ` -
-
-
-
-
-
- shield -
-
-
-
- Create your iovname -
-
-
- Info -
-
-
- How it works -
-
-
-
-
-
- -
- - - -
-
-
-
-
-
-
-

- CHOOSE LINKED ADDRESSES -

-
-
-
-
- Info -
-
-
-
-
-
- Optional -
-
- - -
-

- + Add more -

-
-
-
-
-
-
- -
-
- -
-
-
-
- -`; - -exports[`Storyshots Bierzo Wallet/Register Username Register Username without fee 1`] = ` -
-
-
-
-
-
- shield -
-
-
-
- Create your iovname -
-
-
- Info -
-
-
- How it works -
-
-
-
-
-
- -
- - - -
-
-
-
-
-
-
-

- CHOOSE LINKED ADDRESSES -

-
-
-
-
- Info -
-
-
-
-
-
- Optional -
-
- - -
-

- + Add more -

-
-
-
-
-
-
- -
-
- -
-
-
-
- -`; - exports[`Storyshots Bierzo Wallet/Register Username Registration confirmation 1`] = `
- Your personalized address registration request was successfully signed and sent to the network. + Your registration request was successfully signed and sent to the network.
Date: Wed, 4 Mar 2020 18:49:43 +0200 Subject: [PATCH 069/204] Remove not used file --- .../src/routes/registerName/index.tsx | 291 ------------------ 1 file changed, 291 deletions(-) delete mode 100644 packages/bierzo-wallet/src/routes/registerName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/registerName/index.tsx b/packages/bierzo-wallet/src/routes/registerName/index.tsx deleted file mode 100644 index 5c600e8df..000000000 --- a/packages/bierzo-wallet/src/routes/registerName/index.tsx +++ /dev/null @@ -1,291 +0,0 @@ -import { Address, ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; -import { BnsConnection } from "@iov/bns"; -import { JsonRpcRequest } from "@iov/jsonrpc"; -import { - BillboardContext, - FormValues, - ToastContext, - ToastVariant, - ValidationError, -} from "medulas-react-components"; -import React from "react"; -import * as ReactRedux from "react-redux"; - -import { history } from ".."; -import { - generateRegisterUsernameTxRequest, - generateRegisterUsernameTxWithFee, - generateUpdateUsernameTxRequest, -} from "../../communication/requestgenerators"; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; -import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; -import PageMenu from "../../components/PageMenu"; -import { getConfig, SupportedChain } from "../../config"; -import { isValidIov } from "../../logic/account"; -import { getCodecForChainId } from "../../logic/codec"; -import { getConnectionForBns, getConnectionForChainId } from "../../logic/connection"; -import { ExtendedIdentity } from "../../store/identities"; -import { RootState } from "../../store/reducers"; -import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; -import { BwUsernameWithChainName } from "../addresses"; -import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; -import Layout, { REGISTER_USERNAME_FIELD } from "./components"; -import ConfirmRegistration from "./components/ConfirmRegistration"; -import { addressValueField, blockchainValueField } from "./components/SelectAddressesTable"; - -function onSeeTrasactions(): void { - history.push(TRANSACTIONS_ROUTE); -} -function onReturnToBalance(): void { - history.push(BALANCE_ROUTE); -} -function onReturnToAddresses(): void { - history.push(ADDRESSES_ROUTE); -} - -function getBnsIdentity(identities: ReadonlyMap): Identity | undefined { - for (const identity of Array.from(identities.values()).map(ext => ext.identity)) { - if (getConnectionForChainId(identity.chainId) instanceof BnsConnection) { - return identity; - } - } - return undefined; -} - -async function getPersonalizedAddressRegistrationFee( - bnsIdentity: Identity, - addresses: readonly ChainAddressPairWithName[], -): Promise { - const transactionWithFee = await generateRegisterUsernameTxWithFee(bnsIdentity, "feetest*iov", addresses); - - return transactionWithFee.fee; -} - -function getChainAddressPairsFromValues( - values: FormValues, - addresses: readonly ChainAddressPairWithName[], -): readonly ChainAddressPairWithName[] { - const chainAddressMap: Map> = new Map< - string, - Partial - >(); - Object.keys(values).forEach(key => { - const idxLenght = key.indexOf("-"); - if (idxLenght === -1) return; - - const index = key.substr(0, idxLenght); - let pair = chainAddressMap.get(index); - if (!pair) { - pair = {}; - } - - const type = key.substr(idxLenght + 1); - switch (type) { - case addressValueField: { - pair = { ...pair, address: values[key] as Address }; - break; - } - case blockchainValueField: { - const chain = addresses.find(address => address.chainName === values[key]); - if (chain) { - pair = { ...pair, chainId: chain.chainId, chainName: chain.chainName }; - } - break; - } - } - - chainAddressMap.set(index, pair); - }); - - const chainAddressPair: ChainAddressPairWithName[] = []; - chainAddressMap.forEach(value => { - if (value.address && value.chainId && value.chainName) { - chainAddressPair.push({ - address: value.address, - chainId: value.chainId, - chainName: value.chainName, - }); - } - }); - - return chainAddressPair; -} - -const RegisterUsername = (): JSX.Element => { - const [transactionId, setTransactionId] = React.useState(null); - const [transactionFee, setTransactionFee] = React.useState(undefined); - const [supportedChains, setSupportedChains] = React.useState([]); - - const billboard = React.useContext(BillboardContext); - const toast = React.useContext(ToastContext); - - const rpcEndpoint = ReactRedux.useSelector((state: RootState) => state.rpcEndpoint); - const identities = ReactRedux.useSelector((state: RootState) => state.identities); - const addressesSorted = React.useMemo( - () => getChainAddressPairWithNamesSorted(identities, supportedChains), - [identities, supportedChains], - ); - - const bnsIdentity = getBnsIdentity(identities); - const iovnameAddresses: BwUsernameWithChainName | undefined = history.location.state; - - if (!bnsIdentity) throw new Error("No BNS identity available."); - if (!rpcEndpoint) throw new Error("RPC endpoint not set in redux store. This is a bug."); - - React.useEffect(() => { - let isSubscribed = true; - async function getFeeAndConfig( - bnsIdentity: Identity, - addresses: readonly ChainAddressPairWithName[], - ): Promise { - const fee = await getPersonalizedAddressRegistrationFee(bnsIdentity, addresses); - const config = await getConfig(); - - if (isSubscribed) { - setTransactionFee(fee); - setSupportedChains(config.supportedChains); - } - } - getFeeAndConfig(bnsIdentity, addressesSorted); - - return () => { - isSubscribed = false; - }; - }, [addressesSorted, bnsIdentity]); - - const validate = async (values: object): Promise => { - const formValues = values as FormValues; - const errors: ValidationError = {}; - if (!iovnameAddresses) { - const username = formValues[REGISTER_USERNAME_FIELD]; - if (!username) { - errors[REGISTER_USERNAME_FIELD] = "Required"; - return errors; - } - - const checkResult = isValidIov(username); - - switch (checkResult) { - case "not_iov": - errors[REGISTER_USERNAME_FIELD] = "IOV starname must include *iov"; - break; - case "wrong_number_of_asterisks": - errors[REGISTER_USERNAME_FIELD] = "IOV starname must include only one namespace"; - break; - case "too_short": - errors[REGISTER_USERNAME_FIELD] = "IOV starname should be at least 3 characters"; - break; - case "too_long": - errors[REGISTER_USERNAME_FIELD] = "IOV starname should be maximum 64 characters"; - break; - case "wrong_chars": - errors[REGISTER_USERNAME_FIELD] = - "IOV starname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; - break; - case "valid": - break; - default: - throw new Error(`"Unknown IOV starname validation error: ${checkResult}`); - } - - if (checkResult !== "valid") { - return errors; - } - - const connection = await getConnectionForBns(); - const usernames = await connection.getUsernames({ username }); - if (usernames.length > 0) { - errors[REGISTER_USERNAME_FIELD] = "Personalized address already exists"; - return errors; - } - } - - const addressesToRegister = getChainAddressPairsFromValues(formValues, addressesSorted); - for (const address of addressesToRegister) { - try { - const codec = await getCodecForChainId(address.chainId); - if (!codec.isValidAddress(address.address)) { - const addressField = Object.entries(formValues).find(([_id, value]) => value === address.address); - if (addressField) { - errors[addressField[0]] = "Not valid blockchain address"; - } - } - } catch (err) { - console.info(err); - } - } - - return errors; - }; - - const onSubmit = async (values: object): Promise => { - const formValues = values as FormValues; - - const addressesToRegister = getChainAddressPairsFromValues(formValues, addressesSorted); - - try { - let request: JsonRpcRequest; - if (iovnameAddresses) { - request = await generateUpdateUsernameTxRequest( - bnsIdentity, - iovnameAddresses.username, - addressesToRegister, - ); - } else { - request = await generateRegisterUsernameTxRequest( - bnsIdentity, - formValues[REGISTER_USERNAME_FIELD], - addressesToRegister, - ); - } - if (rpcEndpoint.type === "extension") { - billboard.show( - , - "start", - "flex-end", - 0, - ); - } else { - billboard.show( - , - "center", - "center", - 0, - ); - } - const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); - if (transactionId === undefined) { - toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); - } else if (transactionId === null) { - toast.show("Request rejected", ToastVariant.ERROR); - } else { - setTransactionId(transactionId); - } - } catch (error) { - console.error(error); - toast.show("An error occurred", ToastVariant.ERROR); - } finally { - billboard.close(); - } - }; - - return ( - - {transactionId ? ( - - ) : ( - - )} - - ); -}; - -export default RegisterUsername; From e126cd7d6c71c549fa090b371edde0979e5b2588 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:03:02 +0100 Subject: [PATCH 070/204] Use new "iovnames" naming --- .../addresses/components/AddressesTab.tsx | 4 ++-- .../routes/addresses/components/Iovnames.tsx | 8 +++---- .../addresses/components/IovnamesExists.tsx | 12 +++-------- .../components/IovnamesNotExists.tsx | 21 ++++++++----------- .../src/routes/addresses/index.stories.tsx | 14 ++++++------- .../src/routes/addresses/index.tsx | 4 ++-- .../src/routes/balance/components/index.tsx | 6 +++--- .../src/routes/balance/index.dom.spec.ts | 2 +- .../src/routes/balance/index.stories.tsx | 10 ++++----- .../src/routes/balance/index.tsx | 4 ++-- .../src/routes/register/index.stories.tsx | 10 ++++----- 11 files changed, 43 insertions(+), 52 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx index 6c04b59f0..a394006b1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx @@ -58,7 +58,7 @@ function AddressesTab({ chainAddresses, usernames, starnames, - onRegisterUsername, + onRegisterIovname, onRegisterStarname, rpcEndpointType, }: AddressesTableProps & IovnamesProps & StarnamesProps): JSX.Element { @@ -91,7 +91,7 @@ function AddressesTab({ {selectedTab === "iovnames" && ( )} diff --git a/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx b/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx index e964d943a..65381763c 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx @@ -10,20 +10,20 @@ export const iovnamesViewId = "iovnames-view-id"; export interface IovnamesProps { readonly usernames: readonly BwUsernameWithChainName[]; - readonly onRegisterUsername: () => void; + readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; } -const Iovnames = ({ usernames, rpcEndpointType, onRegisterUsername }: IovnamesProps): JSX.Element => { +const Iovnames = ({ usernames, rpcEndpointType, onRegisterIovname }: IovnamesProps): JSX.Element => { const hasIovnames = usernames.length > 0; return ( {!hasIovnames && ( - + )} - {hasIovnames && } + {hasIovnames && } ); }; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 7b9c80a4d..cc81400d1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -20,7 +20,7 @@ import { AddressesTooltipHeader, TooltipContent } from "../../register"; interface Props { readonly usernames: readonly BwUsernameWithChainName[]; - readonly onRegisterUsername: () => void; + readonly onRegisterIovname: () => void; } const usePaper = makeStyles({ @@ -38,20 +38,14 @@ const useStyles = makeStyles({ }, }); -function IovnamesExists({ usernames, onRegisterUsername }: Props): JSX.Element { +function IovnamesExists({ usernames, onRegisterIovname }: Props): JSX.Element { const paperClasses = usePaper(); const classes = useStyles(); const toast = React.useContext(ToastContext); return ( - + + Create new iovname {usernames.map(username => { diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx index 3c968fa3e..8cbc90c0f 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx @@ -8,19 +8,19 @@ import { REGISTER_IOVNAME_ROUTE } from "../../paths"; import { NoIovnameHeader } from "../../register/components/IovnameForm"; interface StarnamesNotExistsProps { - readonly onRegisterUsername: () => void; + readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; } export function GetYourAddressWithExtension({ - onRegisterUsername, + onRegisterIovname, }: Omit): JSX.Element { return ( - You have no starnames + You have no iovnames With Neuma you can choose your easy to read human readable address. No more complicated cryptography @@ -34,7 +34,7 @@ export function GetYourAddressWithExtension({ weight="semibold" inline link - onClick={onRegisterUsername} + onClick={onRegisterIovname} > Choose Now @@ -51,7 +51,7 @@ export function GetYourAddressWithLedger(): JSX.Element { You can not register - personalized address + iovnames @@ -65,19 +65,16 @@ export function GetYourAddressWithLedger(): JSX.Element { ); } -export function GetYourAddress({ - rpcEndpointType, - onRegisterUsername, -}: StarnamesNotExistsProps): JSX.Element { +export function GetYourAddress({ rpcEndpointType, onRegisterIovname }: StarnamesNotExistsProps): JSX.Element { switch (rpcEndpointType) { case "extension": - return ; + return ; case "ledger": return ; } } -function StarnamesNotExists({ onRegisterUsername, rpcEndpointType }: StarnamesNotExistsProps): JSX.Element { +function StarnamesNotExists({ onRegisterIovname, rpcEndpointType }: StarnamesNotExistsProps): JSX.Element { const theme = useTheme(); return ( @@ -91,7 +88,7 @@ function StarnamesNotExists({ onRegisterUsername, rpcEndpointType }: StarnamesNo textAlign="center" border="1px solid #F3F3F3" > - + ); } diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index b39711d83..f7230f8da 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -6,8 +6,8 @@ import React from "react"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { - REGISTER_USERNAME_REGISTRATION_STORY_PATH, - REGISTER_USERNAME_STORY_PATH, + REGISTER_IOVNAME_REGISTRATION_STORY_PATH, + REGISTER_IOVNAME_STORY_PATH, } from "../register/index.stories"; import { BwUsernameWithChainName } from "."; import AddressesTab from "./components/AddressesTab"; @@ -55,7 +55,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) chainAddresses={chainAddresses} usernames={[]} starnames={[]} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} onRegisterStarname={() => {}} rpcEndpointType="extension" /> @@ -67,7 +67,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) chainAddresses={chainAddresses} usernames={usernames} starnames={[]} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} onRegisterStarname={() => {}} rpcEndpointType="extension" /> @@ -79,7 +79,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) chainAddresses={chainAddresses} usernames={[]} starnames={[]} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} onRegisterStarname={() => {}} rpcEndpointType="ledger" /> @@ -94,7 +94,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) @@ -103,7 +103,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index 82ba98587..7901cf59a 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -16,7 +16,7 @@ export interface BwUsernameWithChainName extends BwUsername { readonly addresses: readonly ChainAddressPairWithName[]; } -function onRegisterUsername(): void { +function onRegisterIovname(): void { history.push(REGISTER_IOVNAME_ROUTE); } @@ -79,7 +79,7 @@ const Addresses = (): JSX.Element => { chainAddresses={chainAddresses} usernames={bwNamesWithChain} starnames={[]} - onRegisterUsername={onRegisterUsername} + onRegisterIovname={onRegisterIovname} onRegisterStarname={onRegisterStarname} rpcEndpointType={rpcEndpointType} /> diff --git a/packages/bierzo-wallet/src/routes/balance/components/index.tsx b/packages/bierzo-wallet/src/routes/balance/components/index.tsx index 519191d79..8fe1b8aef 100644 --- a/packages/bierzo-wallet/src/routes/balance/components/index.tsx +++ b/packages/bierzo-wallet/src/routes/balance/components/index.tsx @@ -15,11 +15,11 @@ const walletIcon = wallet ico; interface Props { readonly iovAddress?: string; readonly balances: { [token: string]: Amount }; - readonly onRegisterUsername: () => void; + readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; } -const BalanceLayout = ({ iovAddress, balances, onRegisterUsername, rpcEndpointType }: Props): JSX.Element => { +const BalanceLayout = ({ iovAddress, balances, onRegisterIovname, rpcEndpointType }: Props): JSX.Element => { const tickersList = Object.keys(balances).sort(); const hasTokens = tickersList.length > 0; const theme = useTheme(); @@ -38,7 +38,7 @@ const BalanceLayout = ({ iovAddress, balances, onRegisterUsername, rpcEndpointTy textAlign="center" border="1px solid #F3F3F3" > - + )} diff --git a/packages/bierzo-wallet/src/routes/balance/index.dom.spec.ts b/packages/bierzo-wallet/src/routes/balance/index.dom.spec.ts index 0749fa257..aa3431bfa 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.dom.spec.ts +++ b/packages/bierzo-wallet/src/routes/balance/index.dom.spec.ts @@ -114,7 +114,7 @@ describe("The /balance route", () => { it("should show that there is no bns username available", async () => { const noUsernameMessage = getIovUsername(TestUtils.scryRenderedDOMComponentsWithTag(balanceDom, "h6")); - expect(noUsernameMessage).toBe("You have no starnames"); + expect(noUsernameMessage).toBe("You have no iovnames"); }); }); diff --git a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx index ab37450bd..c148c2b92 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx @@ -7,8 +7,8 @@ import PageMenu from "../../components/PageMenu"; import { BalanceState } from "../../store/balances"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { - REGISTER_USERNAME_REGISTRATION_STORY_PATH, - REGISTER_USERNAME_STORY_PATH, + REGISTER_IOVNAME_REGISTRATION_STORY_PATH, + REGISTER_IOVNAME_STORY_PATH, } from "../register/index.stories"; import Layout from "./components/index"; @@ -41,7 +41,7 @@ storiesOf(BALANCE_STORY_PATH, module) iovAddress={ACCOUNT_NAME} rpcEndpointType="extension" balances={BALANCE} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} /> @@ -53,7 +53,7 @@ storiesOf(BALANCE_STORY_PATH, module) iovAddress={undefined} rpcEndpointType="extension" balances={NO_BALANCE} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} /> @@ -65,7 +65,7 @@ storiesOf(BALANCE_STORY_PATH, module) iovAddress={undefined} rpcEndpointType="ledger" balances={NO_BALANCE} - onRegisterUsername={linkTo(REGISTER_USERNAME_STORY_PATH, REGISTER_USERNAME_REGISTRATION_STORY_PATH)} + onRegisterIovname={linkTo(REGISTER_IOVNAME_STORY_PATH, REGISTER_IOVNAME_REGISTRATION_STORY_PATH)} /> diff --git a/packages/bierzo-wallet/src/routes/balance/index.tsx b/packages/bierzo-wallet/src/routes/balance/index.tsx index a5ebb097b..21df48dfe 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.tsx @@ -9,7 +9,7 @@ import { getFirstUsername } from "../../store/usernames/selectors"; import { REGISTER_IOVNAME_ROUTE } from "../paths"; import Layout from "./components"; -function onRegisterUsername(): void { +function onRegisterIovname(): void { history.push(REGISTER_IOVNAME_ROUTE); } @@ -22,7 +22,7 @@ const Balance = (): JSX.Element => { return ( ( @@ -62,7 +62,7 @@ storiesOf(REGISTER_USERNAME_STORY_PATH, module) /> )) */ - .add(REGISTER_USERNAME_CONFIRMATION_STORY_PATH, () => ( + .add(REGISTER_IOVNAME_CONFIRMATION_STORY_PATH, () => ( Date: Fri, 21 Feb 2020 21:03:30 +0100 Subject: [PATCH 071/204] Fixes typo in test --- packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts b/packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts index f758f5560..2a7658ceb 100644 --- a/packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts +++ b/packages/bierzo-wallet/src/store/usernames/index.unit.spec.ts @@ -25,7 +25,7 @@ withChainsDescribe("Usernames reducer", () => { expect(usernames).toEqual([]); }); - it("returns empty when no bns identity key is s passed to getUsernames function", async () => { + it("returns empty when no bns identity key is passed to getUsernames function", async () => { const identities: Identity[] = [ { chainId: "ethereum-eip155-5777" as ChainId, From 8895b8a9430a337603fd7b18ef5829edb84aa4ff Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:03:55 +0100 Subject: [PATCH 072/204] Adds accounts reducer --- .../src/store/accounts/reducer.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 packages/bierzo-wallet/src/store/accounts/reducer.ts diff --git a/packages/bierzo-wallet/src/store/accounts/reducer.ts b/packages/bierzo-wallet/src/store/accounts/reducer.ts new file mode 100644 index 000000000..39917091d --- /dev/null +++ b/packages/bierzo-wallet/src/store/accounts/reducer.ts @@ -0,0 +1,38 @@ +import { ChainAddressPair } from "@iov/bns"; +import { Action } from "redux"; +import { ActionType } from "typesafe-actions"; + +import * as actions from "./actions"; + +export interface BwAccount { + readonly name: string; + readonly domain: string; + readonly expiryDate: Date; + readonly addresses: readonly ChainAddressPair[]; +} + +export interface AddAccountsActionType extends Action { + readonly type: "@@accounts/ADD"; + readonly payload: readonly BwAccount[]; +} + +export type AccountsActions = ActionType; + +export type AccountsState = readonly BwAccount[]; +const initState: AccountsState = []; + +export function accountsReducer(state: AccountsState = initState, action: AccountsActions): AccountsState { + switch (action.type) { + case "@@accounts/ADD": { + const updatedAccounts = action.payload.map( + updatedAccount => `${updatedAccount.name}*${updatedAccount.domain}`, + ); + const oldAccountsToCopy = state.filter( + oldAccount => !updatedAccounts.includes(`${oldAccount.name}*${oldAccount.domain}`), + ); + return [...oldAccountsToCopy, ...action.payload]; + } + default: + return state; + } +} From 2c42329f60963e14a06f643326c8dbd9f49e4283 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:04:20 +0100 Subject: [PATCH 073/204] Add accounts actions --- .../src/store/accounts/actions.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/bierzo-wallet/src/store/accounts/actions.ts diff --git a/packages/bierzo-wallet/src/store/accounts/actions.ts b/packages/bierzo-wallet/src/store/accounts/actions.ts new file mode 100644 index 000000000..472a3ec68 --- /dev/null +++ b/packages/bierzo-wallet/src/store/accounts/actions.ts @@ -0,0 +1,28 @@ +import { Identity } from "@iov/bcp"; +import { bnsCodec } from "@iov/bns"; + +import { getConnectionForBns } from "../../logic/connection"; +import { AddAccountsActionType, BwAccount } from "./reducer"; + +export async function getAccounts(identities: readonly Identity[]): Promise { + const bnsConnection = await getConnectionForBns(); + + const bnsIdentity = identities.find(ident => ident.chainId === bnsConnection.chainId); + if (!bnsIdentity) return []; + + const bnsAddress = bnsCodec.identityToAddress(bnsIdentity); + + const accounts = await bnsConnection.getAccounts({ owner: bnsAddress }); + + return accounts.map(account => ({ + name: account.name ? account.name : "", + domain: account.domain, + expiryDate: new Date(account.validUntil * 1000), + addresses: account.targets, + })); +} + +export const addAccountsAction = (accounts: readonly BwAccount[]): AddAccountsActionType => ({ + type: "@@accounts/ADD", + payload: accounts, +}); From 8da35d90bed2cba1edba09cb6597d14424bc131d Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:04:41 +0100 Subject: [PATCH 074/204] Exports accounts reducer and adds it to RootState --- packages/bierzo-wallet/src/store/accounts/index.ts | 2 ++ packages/bierzo-wallet/src/store/reducers.ts | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 packages/bierzo-wallet/src/store/accounts/index.ts diff --git a/packages/bierzo-wallet/src/store/accounts/index.ts b/packages/bierzo-wallet/src/store/accounts/index.ts new file mode 100644 index 000000000..fb205c47d --- /dev/null +++ b/packages/bierzo-wallet/src/store/accounts/index.ts @@ -0,0 +1,2 @@ +export * from "./actions"; +export * from "./reducer"; diff --git a/packages/bierzo-wallet/src/store/reducers.ts b/packages/bierzo-wallet/src/store/reducers.ts index 1930c2963..a11bdb090 100644 --- a/packages/bierzo-wallet/src/store/reducers.ts +++ b/packages/bierzo-wallet/src/store/reducers.ts @@ -1,6 +1,7 @@ import { Action, combineReducers, Reducer } from "redux"; import { ActionType } from "typesafe-actions"; +import { accountsReducer, AccountsState } from "./accounts"; import * as actions from "./actions"; import { balancesReducer, BalanceState } from "./balances"; import { identitiesReducer, IdentitiesState } from "./identities"; @@ -20,6 +21,7 @@ export interface RootState { tokens: TokenState; balances: BalanceState; usernames: UsernamesState; + accounts: AccountsState; } const allReducers = combineReducers({ @@ -29,6 +31,7 @@ const allReducers = combineReducers({ tokens: tokensReducer, balances: balancesReducer, usernames: usernamesReducer, + accounts: accountsReducer, }); const createRootReducer = (): Reducer => ( From 479bbdfc74b9756096d1a157ade525fdeb72b834 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:04:55 +0100 Subject: [PATCH 075/204] Adds unit tests for accounts reducer --- .../src/store/accounts/index.unit.spec.ts | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 packages/bierzo-wallet/src/store/accounts/index.unit.spec.ts diff --git a/packages/bierzo-wallet/src/store/accounts/index.unit.spec.ts b/packages/bierzo-wallet/src/store/accounts/index.unit.spec.ts new file mode 100644 index 000000000..f66037e70 --- /dev/null +++ b/packages/bierzo-wallet/src/store/accounts/index.unit.spec.ts @@ -0,0 +1,117 @@ +import { Address, Algorithm, ChainId, Identity, PubkeyBytes } from "@iov/bcp"; +import { Encoding } from "@iov/encoding"; + +import { aNewStore } from ".."; +import { disconnect } from "../../logic/connection"; +import { establishAllConnections } from "../../utils/test/connections"; +import { withChainsDescribe } from "../../utils/test/testExecutor"; +import { addAccountsAction, getAccounts } from "./actions"; +import { BwAccount } from "./reducer"; + +const defaultDate = new Date(1000000000000); + +withChainsDescribe("Accounts reducer", () => { + beforeAll(async () => { + await establishAllConnections(); + }); + afterAll(() => disconnect()); + + it("has correct initial state", async () => { + const store = aNewStore(); + const accounts = store.getState().accounts; + expect(accounts).toEqual([]); + }); + + it("returns empty when no identities passed to getAccounts function", async () => { + const accounts = await getAccounts([]); + expect(accounts).toEqual([]); + }); + + it("returns empty when no bns identity key is passed to getAccounts function", async () => { + const identities: Identity[] = [ + { + chainId: "ethereum-eip155-5777" as ChainId, + pubkey: { + algo: Algorithm.Secp256k1, + data: Encoding.fromHex( + "04965fb72aad79318cd8c8c975cf18fa8bcac0c091605d10e89cd5a9f7cff564b0cb0459a7c22903119f7a42947c32c1cc6a434a86f0e26aad00ca2b2aff6ba381", + ) as PubkeyBytes, + }, + }, + ]; + + const accounts = await getAccounts(identities); + expect(accounts).toEqual([]); + }); + + describe("accountsReducer", () => { + it("can add accounts", () => { + const accountsToAdd: BwAccount[] = [ + { + name: "foobar", + domain: "fizzbuzz", + expiryDate: defaultDate, + addresses: [], + }, + ]; + + const store = aNewStore(); + expect(store.getState().accounts).toEqual([]); + store.dispatch(addAccountsAction(accountsToAdd)); + expect(store.getState().accounts).toEqual(accountsToAdd); + }); + + it("overrides existing entries", () => { + const accountsToAdd1: BwAccount[] = [ + { + name: "foobar", + domain: "fizzbuzz", + expiryDate: defaultDate, + addresses: [], + }, + ]; + const accounts: BwAccount[] = [ + { + name: "foobar", + domain: "fizzbuzz", + expiryDate: defaultDate, + addresses: [ + { + address: "aabbccdd" as Address, + chainId: "some-chain" as ChainId, + }, + ], + }, + ]; + + const store = aNewStore(); + store.dispatch(addAccountsAction(accountsToAdd1)); + store.dispatch(addAccountsAction(accounts)); + expect(store.getState().accounts).toEqual(accounts); + }); + + it("overrides keeps existing entries alive", () => { + const accountsToAdd1: BwAccount[] = [ + { + name: "foobar1", + domain: "fizzbuzz1", + expiryDate: defaultDate, + addresses: [], + }, + ]; + const accountsToAdd2: BwAccount[] = [ + { + name: "foobar2", + domain: "fizzbuzz2", + expiryDate: defaultDate, + addresses: [], + }, + ]; + + const store = aNewStore(); + store.dispatch(addAccountsAction(accountsToAdd1)); + store.dispatch(addAccountsAction(accountsToAdd2)); + expect(store.getState().accounts).toEqual([...accountsToAdd1, ...accountsToAdd2]); + }); + }); +}); From 2eee2cdad7156bbe38dedc79922533cf7ee9a5a4 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 21:05:12 +0100 Subject: [PATCH 076/204] Adds accounts loading to loginBootSequence --- packages/bierzo-wallet/src/routes/login/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/bierzo-wallet/src/routes/login/index.tsx b/packages/bierzo-wallet/src/routes/login/index.tsx index eca34e218..8f6c6de87 100644 --- a/packages/bierzo-wallet/src/routes/login/index.tsx +++ b/packages/bierzo-wallet/src/routes/login/index.tsx @@ -16,6 +16,7 @@ import { subscribeBalance } from "../../logic/balances"; import { establishConnection } from "../../logic/connection"; import { drinkFaucetIfNeeded } from "../../logic/faucet"; import { subscribeTransaction } from "../../logic/transactions"; +import { addAccountsAction, getAccounts } from "../../store/accounts"; import { getBalances, setBalancesAction } from "../../store/balances"; import { setIdentities } from "../../store/identities"; import { setRpcEndpoint } from "../../store/rpcendpoint"; @@ -53,6 +54,9 @@ export const loginBootSequence = async ( const usernames = await getUsernames(identities); dispatch(addUsernamesAction(usernames)); + + const accounts = await getAccounts(identities); + dispatch(addAccountsAction(accounts)); }; /** From a44e59891a1a4d27713414156a76da6d753e9897 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:15:57 +0100 Subject: [PATCH 077/204] Adapt to new names --- .../src/routes/addresses/components/AddressesTab.tsx | 4 ++-- .../src/routes/addresses/components/Iovnames.tsx | 10 +++++----- .../src/routes/addresses/components/Starnames.tsx | 6 +++--- .../src/routes/addresses/index.stories.tsx | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx index a394006b1..9224c0be1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/AddressesTab.tsx @@ -56,7 +56,7 @@ function TabItem({ children, selected, onChangeTab }: TabItemProps): JSX.Element function AddressesTab({ chainAddresses, - usernames, + iovnames, starnames, onRegisterIovname, onRegisterStarname, @@ -90,7 +90,7 @@ function AddressesTab({ )} {selectedTab === "iovnames" && ( diff --git a/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx b/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx index 65381763c..3e3ded39e 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/Iovnames.tsx @@ -1,21 +1,21 @@ import { Block } from "medulas-react-components"; import React from "react"; -import { BwUsernameWithChainName } from ".."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; +import { BwUsername } from "../../../store/usernames"; import IovnamesExists from "./IovnamesExists"; import IovnamesNotExists from "./IovnamesNotExists"; export const iovnamesViewId = "iovnames-view-id"; export interface IovnamesProps { - readonly usernames: readonly BwUsernameWithChainName[]; + readonly iovnames: readonly BwUsername[]; readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; } -const Iovnames = ({ usernames, rpcEndpointType, onRegisterIovname }: IovnamesProps): JSX.Element => { - const hasIovnames = usernames.length > 0; +const Iovnames = ({ iovnames, rpcEndpointType, onRegisterIovname }: IovnamesProps): JSX.Element => { + const hasIovnames = iovnames.length > 0; return ( @@ -23,7 +23,7 @@ const Iovnames = ({ usernames, rpcEndpointType, onRegisterIovname }: IovnamesPro {!hasIovnames && ( )} - {hasIovnames && } + {hasIovnames && } ); }; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx b/packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx index c8d770280..ec1e13fbf 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/Starnames.tsx @@ -1,15 +1,15 @@ import { Block } from "medulas-react-components"; import React from "react"; -import { BwUsernameWithChainName } from ".."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; +import { BwAccount } from "../../../store/accounts"; import StarnamesExists from "./StarnamesExists"; import StarnamesNotExists from "./StarnamesNotExists"; export const starnamesViewId = "starnames-view-id"; export interface StarnamesProps { - readonly starnames: readonly BwUsernameWithChainName[]; + readonly starnames: readonly BwAccount[]; readonly onRegisterStarname: () => void; readonly rpcEndpointType: RpcEndpointType; } @@ -23,7 +23,7 @@ const Starnames = ({ starnames, rpcEndpointType, onRegisterStarname }: Starnames {!hasStarnames && ( )} - {hasStarnames && } + {hasStarnames && } ); }; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index f7230f8da..40f2519f1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -53,7 +53,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} @@ -65,7 +65,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} @@ -77,7 +77,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} @@ -93,7 +93,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) .add("Iovnames tab", () => ( @@ -102,7 +102,7 @@ storiesOf(`${bierzoRoot}/Addresses`, module) .add("Iovnames with name tab", () => ( From 68db4da5ba23ea94a077fb6da4e458e2c8c33fb8 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:17:08 +0100 Subject: [PATCH 078/204] Adds query to Redux for starnames. Removes unneeded data. --- .../src/routes/addresses/index.tsx | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index 7901cf59a..e2d952985 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -1,10 +1,9 @@ -import React, { useEffect, useState } from "react"; +import React from "react"; import * as ReactRedux from "react-redux"; import { history } from ".."; import { ChainAddressPairWithName } from "../../components/AddressesTable"; import PageMenu from "../../components/PageMenu"; -import { getChainName } from "../../config"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { BwUsername } from "../../store/usernames"; @@ -25,41 +24,6 @@ function onRegisterStarname(): void { } const Addresses = (): JSX.Element => { - const bwNames = ReactRedux.useSelector((state: RootState) => state.usernames); - const [bwNamesWithChain, setBwNamesWithChain] = useState([]); - - useEffect(() => { - let isSubscribed = true; - async function insertChainNames(): Promise { - if (isSubscribed) { - const bwNamesWithChain: BwUsernameWithChainName[] = await Promise.all( - bwNames.map(async name => { - return { - username: name.username, - addresses: await Promise.all( - name.addresses.map(async address => { - return { - chainId: address.chainId, - address: address.address, - chainName: await getChainName(address.chainId), - }; - }), - ), - }; - }), - ); - - setBwNamesWithChain(bwNamesWithChain); - } - } - insertChainNames(); - - return () => { - isSubscribed = false; - }; - }, [bwNames]); - - const rpcEndpointType = ReactRedux.useSelector(getRpcEndpointType); const identities = ReactRedux.useSelector((state: RootState) => state.identities); const supportedChains = React.useMemo( @@ -72,13 +36,16 @@ const Addresses = (): JSX.Element => { ); const chainAddresses = getChainAddressPairWithNames(identities, supportedChains); + const iovnames = ReactRedux.useSelector((state: RootState) => state.usernames); + const starnames = ReactRedux.useSelector((state: RootState) => state.accounts); + const rpcEndpointType = ReactRedux.useSelector(getRpcEndpointType); return ( Date: Fri, 21 Feb 2020 23:17:24 +0100 Subject: [PATCH 079/204] Add logos for iovnames and starnames --- packages/bierzo-wallet/src/assets/iovname-logo.svg | 7 +++++++ packages/bierzo-wallet/src/assets/starname-logo.svg | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 packages/bierzo-wallet/src/assets/iovname-logo.svg create mode 100644 packages/bierzo-wallet/src/assets/starname-logo.svg diff --git a/packages/bierzo-wallet/src/assets/iovname-logo.svg b/packages/bierzo-wallet/src/assets/iovname-logo.svg new file mode 100644 index 000000000..2da2dcdee --- /dev/null +++ b/packages/bierzo-wallet/src/assets/iovname-logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/bierzo-wallet/src/assets/starname-logo.svg b/packages/bierzo-wallet/src/assets/starname-logo.svg new file mode 100644 index 000000000..783bc8d48 --- /dev/null +++ b/packages/bierzo-wallet/src/assets/starname-logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + From f28540a8a29522bf589d452d839d6611ed710f1c Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:17:50 +0100 Subject: [PATCH 080/204] Adds new design to iovname list --- .../addresses/components/IovnamesExists.tsx | 129 +++++++----------- 1 file changed, 51 insertions(+), 78 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index cc81400d1..9fb74f716 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -1,113 +1,86 @@ import Paper from "@material-ui/core/Paper"; -import clipboardCopy from "clipboard-copy"; -import { - Block, - Image, - makeStyles, - ToastContext, - ToastVariant, - Tooltip, - Typography, -} from "medulas-react-components"; +import { Block, Image, makeStyles, Typography } from "medulas-react-components"; import React from "react"; -import { BwUsernameWithChainName } from ".."; import { history } from "../.."; -import AddressesTable from "../../../components/AddressesTable"; -import copy from "../../../components/AddressesTable/assets/copy.svg"; +import iovnameLogo from "../../../assets/iovname-logo.svg"; +import { BwUsername } from "../../../store/usernames"; import { REGISTER_IOVNAME_ROUTE } from "../../paths"; -import { AddressesTooltipHeader, TooltipContent } from "../../register"; interface Props { - readonly usernames: readonly BwUsernameWithChainName[]; + readonly iovnames: readonly BwUsername[]; readonly onRegisterIovname: () => void; } const usePaper = makeStyles({ rounded: { borderRadius: "5px", + height: "100%", }, elevation1: { boxShadow: "none", }, }); -const useStyles = makeStyles({ - link: { - cursor: "pointer", - }, -}); - -function IovnamesExists({ usernames, onRegisterIovname }: Props): JSX.Element { +function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { const paperClasses = usePaper(); - const classes = useStyles(); - const toast = React.useContext(ToastContext); return ( - - + Create new iovname - - {usernames.map(username => { - const onIovnameCopy = (): void => { - clipboardCopy(username.username); - toast.show("Iovname has been copied to clipboard.", ToastVariant.INFO); - }; - - const onEdit = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, username); + + + + Iovname Logo + + + Register a new iovname + + + + Register now + + + + {iovnames.map(iovname => { + const onManage = (): void => { + history.push(REGISTER_IOVNAME_ROUTE, iovname); }; return ( - - + + + - - - {username.username} - - - - Copy - - - - - {username.addresses.length > 0 ? "LINKED ADDRESSES" : "NO LINKED ADDRESSES"} - - - - } title="Your linked addresses"> - With IOV you can have an universal blockchain address that is linked to all your - addresses. Just give your friends your personalized address. - - - - - {username.addresses.length > 0 ? "Edit" : "Link Now"} - - - - - {username.addresses.length > 0 && } + + {iovname.username} + + + Manage + - + ); })} From 3fc736e8f004ca93b37b5b9a3db7e2172d60c0e4 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:18:00 +0100 Subject: [PATCH 081/204] Adds new design to starnames list --- .../addresses/components/StarnamesExists.tsx | 93 ++++++++++++++++++- 1 file changed, 90 insertions(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index ba9a0554e..8a9dadc53 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -1,8 +1,95 @@ -import { Typography } from "medulas-react-components"; +import Paper from "@material-ui/core/Paper"; +import { Block, Image, makeStyles, Typography } from "medulas-react-components"; import React from "react"; -function StarnamesExists(): JSX.Element { - return There are some starnames. Work in progress view; +import { history } from "../.."; +import starnameLogo from "../../../assets/starname-logo.svg"; +import { BwAccount } from "../../../store/accounts"; +import { REGISTER_STARNAME_ROUTE } from "../../paths"; + +interface Props { + readonly starnames: readonly BwAccount[]; + readonly onRegisterStarname: () => void; +} + +const usePaper = makeStyles({ + rounded: { + borderRadius: "5px", + }, + elevation1: { + boxShadow: "none", + }, +}); + +function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element { + const paperClasses = usePaper(); + + return ( + + + + + Iovname Logo + + + Register a new starname + + + + Register now + + + + {starnames.map(starname => { + const onManage = (): void => { + history.push(REGISTER_STARNAME_ROUTE, starname); + }; + + return ( + + + + + + + {`${starname.name}*${starname.domain}`} + + + + Expires on {starname.expiryDate.toLocaleDateString()} + + + + Manage + + + + + ); + })} + + ); } export default StarnamesExists; From dcf912f7597786543bf9993e21366d267b8f863c Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 21 Feb 2020 23:45:53 +0100 Subject: [PATCH 082/204] Fixes key prop --- .../src/routes/addresses/components/IovnamesExists.tsx | 4 ++-- .../src/routes/addresses/components/StarnamesExists.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 9fb74f716..05de69544 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -54,9 +54,9 @@ function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { }; return ( - + - + + - + Date: Fri, 21 Feb 2020 23:47:41 +0100 Subject: [PATCH 083/204] Updates storybook snapshots --- .../src/__snapshots__/Storyshots.test.js.snap | 572 +++--------------- 1 file changed, 72 insertions(+), 500 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 7be64729d..bd3c30ad1 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1870,7 +1870,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames tab 1`] = `
- You have no starnames + You have no iovnames

-

- + Create new iovname -

-
-

- test1*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
+ Iovname Logo
- - - - - - - - - - - - - - -
- Blockchain - - Address - -
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
+ Register a new iovname +
+

+ Register now +

+
-
-
-

- test2*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - - - - - - -
- Blockchain - - Address - -
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
- Lisk Devnet - - 1349293588603668134L - -
- Copy -
-
-
+ test1*iov + +
+ Manage +
+
-
-
-

- test3*iov -

-
-
- Copy -
-
-
-
- LINKED ADDRESSES -
-
-
- Info -
-
-
- Edit -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- Blockchain - - Address - -
- Ganache - - 0xD383382350F9f190Bd2608D6381B15b4e1cec0f3 - -
- Copy -
-
- IOV Devnet - - tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 - -
- Copy -
-
- Lisk Devnet - - 1349293588603668134L - -
- Copy -
-
-
+ test2*iov + +
+ Manage +
+
+
+
+
+
+
+ test3*iov +
+
+ Manage +
@@ -3142,7 +2714,7 @@ exports[`Storyshots Bierzo Wallet/Balance View on ledger and without name 1`] = className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-body1 MuiTypography-colorPrimary" id="/register-iovname" > - personalized address + iovnames

- You have no starnames + You have no iovnames

`; -exports[`Storyshots Bierzo Wallet/Register Username Registration confirmation 1`] = ` +exports[`Storyshots Bierzo Wallet/Register Iovname Registration confirmation 1`] = `

Date: Mon, 24 Feb 2020 23:51:55 +0100 Subject: [PATCH 084/204] Fixes e2e test to expect "iovnames" --- packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts b/packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts index 5af490a1e..4b0eb3541 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts +++ b/packages/bierzo-wallet/src/routes/balance/index.e2e.spec.ts @@ -59,7 +59,7 @@ withChainsDescribe("E2E > Balance route", () => { it("should contain message to get address", async () => { const username = await getAddressCreationPromptE2E(await page.$$("h6")); - expect(username).toBe("You have no starnames"); + expect(username).toBe("You have no iovnames"); }, 45000); it("should create personalized address", async () => { From 76ee136fdd696a9dbd30a43f94ad9f5d59eaee2e Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 24 Feb 2020 23:52:22 +0100 Subject: [PATCH 085/204] Fixes e2e test to remove copy functionality --- .../bierzo-wallet/src/routes/addresses/index.e2e.spec.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts b/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts index 8d68cf3f5..dfb5fd0b7 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts +++ b/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts @@ -11,7 +11,6 @@ import { registerPersonalizedAddress, waitForAllBalances } from "../balance/test import { travelToBalanceE2E } from "../balance/test/travelToBalance"; import { copyAddress, - copyStarname, getAddressRow, getLinkedAddresses, getRemoveActions, @@ -118,13 +117,6 @@ withChainsDescribe("E2E > Receive Payment route", () => { }, 35000); it("should check username open it and remove last address", async () => { - await copyStarname(page); - - expect(clipboardy.readSync()).toBe(username); - - const toastMessage = await getToastMessage(page); - expect(toastMessage).toBe("Iovname has been copied to clipboard."); - await closeToast(page); const addresses = await getLinkedAddresses(page); await openFirstStarnameForEditingE2E(page, username); From f9b940b988ab252afeb3d413de2dd3f8e40513fa Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 24 Feb 2020 23:52:54 +0100 Subject: [PATCH 086/204] Fixes test util to search for "Manage" --- .../src/routes/addresses/test/travelToReceivePayment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts index 345800556..70786557e 100644 --- a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts +++ b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts @@ -27,7 +27,7 @@ export async function travelToStarnamesTabE2E(page: Page): Promise { } export async function openFirstStarnameForEditingE2E(page: Page, username: string): Promise { - const [firstStarnameEditLink] = await page.$x(`//h6[contains(., 'Edit')]`); + const [firstStarnameEditLink] = await page.$x(`//h6[contains(., 'Manage')]`); await firstStarnameEditLink.click(); await page.waitForSelector(`#${REGISTER_IOVNAME_VIEW_ID}`); } From 701f7f62772eda45aedeaaa96abfff33c9ab3db2 Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 26 Feb 2020 22:40:42 +0100 Subject: [PATCH 087/204] Sorts iovnames --- .../addresses/components/IovnamesExists.tsx | 73 ++++++++++--------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 05de69544..7dc1ce253 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -48,41 +48,48 @@ function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { - {iovnames.map(iovname => { - const onManage = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, iovname); - }; + {iovnames + .slice() + .sort((a, b) => { + if (a.username < b.username) return -1; + if (a.username > b.username) return 1; + return 0; + }) + .map(iovname => { + const onManage = (): void => { + history.push(REGISTER_IOVNAME_ROUTE, iovname); + }; - return ( - - - - - - {iovname.username} - - + + + - Manage - - - - - ); - })} + + {iovname.username} + + + Manage + + + + + ); + })} ); } From 6c7e621e3edf54c25fbf81f3121c4125ddf7dc11 Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 26 Feb 2020 22:41:10 +0100 Subject: [PATCH 088/204] Sorts starnames --- .../addresses/components/StarnamesExists.tsx | 83 ++++++++++--------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 7bc5b5c53..2ac74bf6c 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -47,47 +47,54 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element - {starnames.map(starname => { - const onManage = (): void => { - history.push(REGISTER_STARNAME_ROUTE, starname); - }; + {starnames + .slice() + .sort((a, b) => { + if (`${a.name}*${a.domain}` < `${b.name}*${b.domain}`) return -1; + if (`${a.name}*${a.domain}` > `${b.name}*${b.domain}`) return 1; + return 0; + }) + .map(starname => { + const onManage = (): void => { + history.push(REGISTER_STARNAME_ROUTE, starname); + }; - return ( - - - - - - - {`${starname.name}*${starname.domain}`} - - - - Expires on {starname.expiryDate.toLocaleDateString()} + return ( + + + + + + + {`${starname.name}*${starname.domain}`} + + + + Expires on {starname.expiryDate.toLocaleDateString()} + + + + Manage - - Manage - - - - - ); - })} + + + ); + })} ); } From f73db4bc39df074b6e38ccdce086f6e89c0c36ae Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 26 Feb 2020 22:41:57 +0100 Subject: [PATCH 089/204] Adds temporary Register Name link --- .../addresses/components/StarnamesExists.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 2ac74bf6c..20b7ba5d2 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -5,7 +5,7 @@ import React from "react"; import { history } from "../.."; import starnameLogo from "../../../assets/starname-logo.svg"; import { BwAccount } from "../../../store/accounts"; -import { REGISTER_STARNAME_ROUTE } from "../../paths"; +import { REGISTER_NAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../paths"; interface Props { readonly starnames: readonly BwAccount[]; @@ -45,6 +45,19 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element Register now + {/* TODO remove this Typography when /register-name accessible from starname list */} + { + history.push(REGISTER_NAME_ROUTE); + }} + > + Register your name + {starnames From 7bdb6b29b6bb1ddc681f979f1eb35e7b6bd18023 Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 26 Feb 2020 22:42:22 +0100 Subject: [PATCH 090/204] Adds account dispatch to Tx subscription --- .../src/logic/transactions/index.ts | 92 ++++++++++++++++--- 1 file changed, 77 insertions(+), 15 deletions(-) diff --git a/packages/bierzo-wallet/src/logic/transactions/index.ts b/packages/bierzo-wallet/src/logic/transactions/index.ts index 7bcc498f9..9a2715746 100644 --- a/packages/bierzo-wallet/src/logic/transactions/index.ts +++ b/packages/bierzo-wallet/src/logic/transactions/index.ts @@ -1,15 +1,86 @@ -import { ChainId, Identity, isFailedTransaction } from "@iov/bcp"; -import { isRegisterUsernameTx, isUpdateTargetsOfUsernameTx } from "@iov/bns"; +import { ChainId, Identity, isFailedTransaction, UnsignedTransaction } from "@iov/bcp"; +import { + isRegisterAccountTx, + isRegisterDomainTx, + isRegisterUsernameTx, + isReplaceAccountTargetsTx, + isUpdateTargetsOfUsernameTx, +} from "@iov/bns"; import { Dispatch } from "redux"; import { Subscription } from "xstream"; import { getConfig } from "../../config"; +import { addAccountsAction, BwAccount } from "../../store/accounts"; import { addTransaction } from "../../store/notifications"; import { addUsernamesAction, BwUsername } from "../../store/usernames"; import { getCodec } from "../codec"; -import { getConnectionForChainId } from "../connection"; +import { getConnectionForBns, getConnectionForChainId } from "../connection"; import { BwParserFactory } from "./types/BwParserFactory"; +function mayDispatchUsername(dispatch: Dispatch, usernameTx: UnsignedTransaction): void { + if (isRegisterUsernameTx(usernameTx) || isUpdateTargetsOfUsernameTx(usernameTx)) { + const username: BwUsername = { + username: usernameTx.username, + addresses: usernameTx.targets, + }; + + dispatch(addUsernamesAction([username])); + } +} + +async function mayDispatchAccount(dispatch: Dispatch, accountTx: UnsignedTransaction): Promise { + if (isRegisterDomainTx(accountTx)) { + const nowInMs = new Date().getTime(); + const accountRenewInMs = accountTx.accountRenew * 1000; + // TODO not sure if precise, since getting from current time + const expiryDate = new Date(nowInMs + accountRenewInMs); + + const account: BwAccount = { + name: "", + domain: accountTx.domain, + expiryDate: expiryDate, + addresses: [], + }; + + dispatch(addAccountsAction([account])); + } + + if (isRegisterAccountTx(accountTx)) { + const connection = await getConnectionForBns(); + const domains = await connection.getDomains({ name: accountTx.domain }); + if (domains.length !== 1) throw Error("Did not find unique domain"); + + const nowInMs = new Date().getTime(); + const accountRenewInMs = domains[0].accountRenew * 1000; + // TODO not sure if precise, since getting from current time + const expiryDate = new Date(nowInMs + accountRenewInMs); + + const account: BwAccount = { + name: accountTx.name, + domain: accountTx.domain, + expiryDate: expiryDate, + addresses: accountTx.targets, + }; + + dispatch(addAccountsAction([account])); + } + + if (isReplaceAccountTargetsTx(accountTx)) { + const connection = await getConnectionForBns(); + const accounts = await connection.getAccounts({ name: accountTx.name, domain: accountTx.domain }); + if (accounts.length !== 1) throw Error("Did not find unique account"); + + const account: BwAccount = { + name: accounts[0].name || "", + domain: accounts[0].domain, + expiryDate: new Date(accounts[0].validUntil * 1000), + addresses: accounts[0].targets, + }; + + dispatch(addAccountsAction([account])); + } +} + let txsSubscriptions: Subscription[] = []; export async function subscribeTransaction( @@ -38,18 +109,9 @@ export async function subscribeTransaction( const bwTransaction = BwParserFactory.getBwTransactionFrom(tx); const parsedTx = await bwTransaction.parse(connection, tx, address); - if ( - !isFailedTransaction(tx) && - (isRegisterUsernameTx(parsedTx.original) || isUpdateTargetsOfUsernameTx(parsedTx.original)) - ) { - const usernameTx = parsedTx.original; - const usernames: BwUsername[] = [ - { - username: usernameTx.username, - addresses: usernameTx.targets, - }, - ]; - dispatch(addUsernamesAction(usernames)); + if (!isFailedTransaction(tx)) { + mayDispatchUsername(dispatch, parsedTx.original); + await mayDispatchAccount(dispatch, parsedTx.original); } dispatch(addTransaction(parsedTx)); }, From 14e60c34e3183c9a5c65374721b075147d475ee3 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 15:51:40 +0200 Subject: [PATCH 091/204] Changes from previous branch --- .../src/routes/registerStarName/index.tsx | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx new file mode 100644 index 000000000..db8da3f36 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx @@ -0,0 +1,34 @@ +import { Block, makeStyles, Typography } from "medulas-react-components"; +import React from "react"; + +import PageMenu from "../../components/PageMenu"; + +const useStyles = makeStyles({ + usernameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +// TODO move to components when implemented, mirroring registerName +export function NoStarnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + *yourstarname + + + ); +} + +const RegisterStarname = (): JSX.Element => { + return ( + + + Register new starname. Work in progress view + + + ); +}; + +export default RegisterStarname; From b90200fedd46f9da059c17d06b4fd7658859731c Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 18:54:30 +0200 Subject: [PATCH 092/204] Refactor transaction assets --- .../BwRegisterUsernameTx/ui => }/assets/dropdownArrow.svg | 0 .../ui => }/assets/dropdownArrowClose.svg | 0 .../BwRegisterUsernameTx/ui => }/assets/transactionSend.svg | 0 .../{types/BwRegisterUsernameTx/ui => }/assets/user.svg | 0 .../BwRegisterUsernameTx/ui/TransactionHeader/index.tsx | 2 +- .../types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx | 6 +++--- .../types/BwSendTransaction/ui/SendTxHeader/index.tsx | 2 +- .../types/BwSendTransaction/ui/SendTxRow/index.tsx | 6 +++--- .../types/BwSendTransaction/ui/assets/dropdownArrow.svg | 3 --- .../BwSendTransaction/ui/assets/dropdownArrowClose.svg | 3 --- .../types/BwSendTransaction/ui/assets/transactionSend.svg | 4 ---- .../transactions/types/BwSendTransaction/ui/assets/user.svg | 1 - .../ui/TransactionHeader/index.tsx | 2 +- .../BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx | 6 +++--- .../BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg | 3 --- .../ui/assets/dropdownArrowClose.svg | 3 --- .../BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg | 4 ---- .../types/BwUpdateUsernameTargetsTx/ui/assets/user.svg | 1 - 18 files changed, 12 insertions(+), 34 deletions(-) rename packages/bierzo-wallet/src/logic/transactions/{types/BwRegisterUsernameTx/ui => }/assets/dropdownArrow.svg (100%) rename packages/bierzo-wallet/src/logic/transactions/{types/BwRegisterUsernameTx/ui => }/assets/dropdownArrowClose.svg (100%) rename packages/bierzo-wallet/src/logic/transactions/{types/BwRegisterUsernameTx/ui => }/assets/transactionSend.svg (100%) rename packages/bierzo-wallet/src/logic/transactions/{types/BwRegisterUsernameTx/ui => }/assets/user.svg (100%) delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrow.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrowClose.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/transactionSend.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/user.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrowClose.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg delete mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/user.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/dropdownArrow.svg b/packages/bierzo-wallet/src/logic/transactions/assets/dropdownArrow.svg similarity index 100% rename from packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/dropdownArrow.svg rename to packages/bierzo-wallet/src/logic/transactions/assets/dropdownArrow.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/dropdownArrowClose.svg b/packages/bierzo-wallet/src/logic/transactions/assets/dropdownArrowClose.svg similarity index 100% rename from packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/dropdownArrowClose.svg rename to packages/bierzo-wallet/src/logic/transactions/assets/dropdownArrowClose.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/transactionSend.svg b/packages/bierzo-wallet/src/logic/transactions/assets/transactionSend.svg similarity index 100% rename from packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/transactionSend.svg rename to packages/bierzo-wallet/src/logic/transactions/assets/transactionSend.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/user.svg b/packages/bierzo-wallet/src/logic/transactions/assets/user.svg similarity index 100% rename from packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/assets/user.svg rename to packages/bierzo-wallet/src/logic/transactions/assets/user.svg diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionHeader/index.tsx index b7600a76f..f70b79a7e 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionHeader/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionHeader/index.tsx @@ -6,8 +6,8 @@ import { Block, Hairline, Image } from "medulas-react-components"; import * as React from "react"; import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; import { ProcessedTx } from "../../../../types/BwParser"; -import sendTx from "../assets/transactionSend.svg"; import Msg from "./MsgSuccess"; interface ItemProps { diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx index cf2fdb281..3eae3f51a 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/ui/TransactionRow/index.tsx @@ -7,10 +7,10 @@ import { amountToString } from "ui-logic"; import { getBorderColor } from "../../../../../../theme/css"; import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; import { ProcessedTx } from "../../../../types/BwParser"; -import dropdownArrow from "../assets/dropdownArrow.svg"; -import dropdownArrowClose from "../assets/dropdownArrowClose.svg"; -import txIcon from "../assets/user.svg"; import TxDetails from "./Details"; const useStyles = makeStyles({ diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxHeader/index.tsx index c1990f43f..10ea612c2 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxHeader/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxHeader/index.tsx @@ -9,8 +9,8 @@ import { history } from "../../../../../../routes"; import { PAYMENT_ROUTE } from "../../../../../../routes/paths"; import { ProcessedSendTransaction } from "../../../../../../store/notifications"; import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; import receiveTx from "../assets/transactionReceive.svg"; -import sendTx from "../assets/transactionSend.svg"; import Msg from "./MsgSuccess"; interface ItemProps { diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxRow/index.tsx index dce5c471c..9f23d3e31 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxRow/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/SendTxRow/index.tsx @@ -9,9 +9,9 @@ import { getAddressPrefix } from "../../../../../../routes/transactions/componen import { ProcessedSendTransaction } from "../../../../../../store/notifications"; import { getBorderColor } from "../../../../../../theme/css"; import { formatDate } from "../../../../../../utils/date"; -import dropdownArrow from "../assets/dropdownArrow.svg"; -import dropdownArrowClose from "../assets/dropdownArrowClose.svg"; -import txIcon from "../assets/user.svg"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; import SendTxDetails from "./Details"; const useStyles = makeStyles((theme: Theme) => ({ diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrow.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrow.svg deleted file mode 100644 index 05df80ca2..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrowClose.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrowClose.svg deleted file mode 100644 index 882aca9a4..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/dropdownArrowClose.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/transactionSend.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/transactionSend.svg deleted file mode 100644 index 59dae02f8..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/transactionSend.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/user.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/user.svg deleted file mode 100644 index b9df657f4..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwSendTransaction/ui/assets/user.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionHeader/index.tsx index 3a4c206e9..43da70a0c 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionHeader/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionHeader/index.tsx @@ -6,8 +6,8 @@ import { Block, Hairline, Image } from "medulas-react-components"; import * as React from "react"; import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; import { ProcessedTx } from "../../../BwParser"; -import sendTx from "../assets/transactionSend.svg"; import Msg from "./MsgSuccess"; interface ItemProps { diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx index ac7350316..99e529e23 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/TransactionRow/index.tsx @@ -7,10 +7,10 @@ import { amountToString } from "ui-logic"; import { getBorderColor } from "../../../../../../theme/css"; import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; import { ProcessedTx } from "../../../BwParser"; -import dropdownArrow from "../assets/dropdownArrow.svg"; -import dropdownArrowClose from "../assets/dropdownArrowClose.svg"; -import txIcon from "../assets/user.svg"; import TxDetails from "./Details"; const useStyles = makeStyles({ diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg deleted file mode 100644 index 05df80ca2..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrowClose.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrowClose.svg deleted file mode 100644 index 882aca9a4..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/dropdownArrowClose.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg deleted file mode 100644 index 59dae02f8..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/transactionSend.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/user.svg b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/user.svg deleted file mode 100644 index b9df657f4..000000000 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/ui/assets/user.svg +++ /dev/null @@ -1 +0,0 @@ -Layer 1 \ No newline at end of file From 98b51967eb1cee6308ad0b769c16abb488864f15 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 18:56:42 +0200 Subject: [PATCH 093/204] Refactor parse method --- .../src/logic/transactions/types/BwParser.ts | 20 ++++++++++++++++--- .../types/BwRegisterUsernameTx/index.tsx | 16 --------------- .../types/BwUnkownTransaction/index.tsx | 17 +--------------- .../types/BwUpdateUsernameTargetsTx/index.tsx | 16 --------------- 4 files changed, 18 insertions(+), 51 deletions(-) diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwParser.ts b/packages/bierzo-wallet/src/logic/transactions/types/BwParser.ts index 44c13f1fa..7e6bfef54 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwParser.ts +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwParser.ts @@ -3,6 +3,7 @@ import { BlockchainConnection, ConfirmedTransaction, FailedTransaction, + isFailedTransaction, TransactionId, UnsignedTransaction, } from "@iov/bcp"; @@ -15,11 +16,24 @@ export interface ProcessedTx { - abstract async parse( + public async parse( conn: BlockchainConnection, transaction: ConfirmedTransaction | FailedTransaction, - currentUserAddress: Address, - ): Promise>; + _: Address, + ): Promise> { + if (isFailedTransaction(transaction)) { + throw new Error("Not supported error txs for now"); + } + + const header = await conn.getBlockHeader(transaction.height); + const time = header.time; + + return { + id: transaction.transactionId, + time, + original: transaction.transaction, + }; + } abstract graphicalRepresentation(tx: ProcessedTx, addresses: Address[]): JSX.Element; abstract headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element; } diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/index.tsx index 4c4f1a407..cf605c96f 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterUsernameTx/index.tsx @@ -1,4 +1,3 @@ -import { Address, BlockchainConnection, ConfirmedTransaction } from "@iov/bcp"; import { RegisterUsernameTx } from "@iov/bns"; import * as React from "react"; @@ -7,21 +6,6 @@ import TransactionHeader from "./ui/TransactionHeader"; import TransactionRow from "./ui/TransactionRow"; export class BwRegisterUsernameParser extends BwParser { - public async parse( - conn: BlockchainConnection, - trans: ConfirmedTransaction, - _: Address, - ): Promise> { - const header = await conn.getBlockHeader(trans.height); - const time = header.time; - - return { - id: trans.transactionId, - time, - original: trans.transaction, - }; - } - public graphicalRepresentation(tx: ProcessedTx): JSX.Element { return ; } diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUnkownTransaction/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUnkownTransaction/index.tsx index 9f0a56aa2..57ffd0a99 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUnkownTransaction/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUnkownTransaction/index.tsx @@ -1,4 +1,4 @@ -import { Address, BlockchainConnection, ConfirmedTransaction, UnsignedTransaction } from "@iov/bcp"; +import { UnsignedTransaction } from "@iov/bcp"; import * as React from "react"; import { BwParser, ProcessedTx } from "../../types/BwParser"; @@ -6,21 +6,6 @@ import UnkownTransactionHeader from "./ui/UnknownTxHeader"; import UnkownTransactionRow from "./ui/UnknownTxRow"; export class BwUnkownParser extends BwParser { - public async parse( - conn: BlockchainConnection, - trans: ConfirmedTransaction, - _currentAddress: Address, - ): Promise> { - const header = await conn.getBlockHeader(trans.height); - const time = header.time; - - return { - time, - id: trans.transactionId, - original: trans.transaction, - }; - } - public graphicalRepresentation(tx: ProcessedTx): JSX.Element { return ; } diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/index.tsx index 7b27a1983..82f2cf149 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/index.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateUsernameTargetsTx/index.tsx @@ -1,4 +1,3 @@ -import { Address, BlockchainConnection, ConfirmedTransaction } from "@iov/bcp"; import { UpdateTargetsOfUsernameTx } from "@iov/bns"; import * as React from "react"; @@ -7,21 +6,6 @@ import TransactionHeader from "./ui/TransactionHeader"; import TransactionRow from "./ui/TransactionRow"; export class BwUpdateUsernameTargetParser extends BwParser { - public async parse( - conn: BlockchainConnection, - trans: ConfirmedTransaction, - _: Address, - ): Promise> { - const header = await conn.getBlockHeader(trans.height); - const time = header.time; - - return { - id: trans.transactionId, - time, - original: trans.transaction, - }; - } - public graphicalRepresentation(tx: ProcessedTx): JSX.Element { return ; } From 70b42a1bf35a98a4def8985fa2caf4df8712886c Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 18:57:08 +0200 Subject: [PATCH 094/204] Add RegisterDomainTx to storybook --- .../src/routes/transactions/index.stories.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index 87cb255db..9897a0eae 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -1,5 +1,5 @@ import { Address, ChainId, Token, TokenTicker, TransactionId } from "@iov/bcp"; -import { RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; +import { RegisterDomainTx, RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; import { Sha256 } from "@iov/crypto"; import { Encoding, Uint64 } from "@iov/encoding"; import { action } from "@storybook/addon-actions"; @@ -65,6 +65,23 @@ function makeExampleLiskTransactionId(): TransactionId { return Uint64.fromNumber(2347199254740991 + txCount++).toString() as TransactionId; } +const incomingNewDomainTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/register_domain", + chainId: chainIdIov, + domain: "test", + admin: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + hasSuperuser: true, + msgFees: [], + accountRenew: 2 * 3600, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + const incomingSendTransaction: ProcessedSendTransaction = { time: new ReadonlyDate("2018-01-01T03:02:01.763Z"), id: makeExampleEthTransactionId(), @@ -114,7 +131,9 @@ const parsedTxs: readonly ( | ProcessedSendTransaction | ProcessedTx | ProcessedTx + | ProcessedTx )[] = [ + incomingNewDomainTransaction, incomingSendTransaction, voteTx, { From 8aa8254441a48b9749c3f1041628da775da297e1 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 18:57:28 +0200 Subject: [PATCH 095/204] Add RegisterDomainTx parser and components --- .../transactions/types/BwParserFactory.ts | 9 ++ .../types/BwRegisterDomainTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 6 files changed, 265 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts index 584430bf8..ce1caf28e 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts @@ -8,14 +8,17 @@ import { UnsignedTransaction, } from "@iov/bcp"; import { + isRegisterDomainTx, isRegisterUsernameTx, isUpdateTargetsOfUsernameTx, + RegisterDomainTx, RegisterUsernameTx, UpdateTargetsOfUsernameTx, } from "@iov/bns"; import { ProcessedSendTransaction } from "../../../store/notifications"; import { BwParser, ProcessedTx } from "../types/BwParser"; +import { BwRegisterDomainParser } from "./BwRegisterDomainTx"; import { BwRegisterUsernameParser } from "./BwRegisterUsernameTx"; import { BwSendParser } from "./BwSendTransaction"; import { BwUnkownParser } from "./BwUnkownTransaction"; @@ -33,6 +36,10 @@ function isProcessedUpdateUsernameTargetsTx(tx: ProcessedTx): tx is ProcessedTx< return isUpdateTargetsOfUsernameTx(tx.original); } +function isProcessedRegisterDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isRegisterDomainTx(tx.original); +} + export class BwParserFactory { public static getReactComponent(tx: ProcessedTx, userAddresses: readonly Address[]): JSX.Element { if (isProcessedSendTransaction(tx)) { @@ -41,6 +48,8 @@ export class BwParserFactory { return new BwRegisterUsernameParser().graphicalRepresentation(tx); } else if (isProcessedUpdateUsernameTargetsTx(tx)) { return new BwUpdateUsernameTargetParser().graphicalRepresentation(tx); + } else if (isProcessedRegisterDomainTx(tx)) { + return new BwRegisterDomainParser().graphicalRepresentation(tx); } return new BwUnkownParser().graphicalRepresentation(tx); diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/index.tsx new file mode 100644 index 000000000..8238172b7 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/index.tsx @@ -0,0 +1,16 @@ +import { RegisterDomainTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../../types/BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwRegisterDomainParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..e3e0ae58f --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + starname has been registered + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..fd2a9254d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { RegisterDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../../types/BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..f2fecbe90 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { RegisterDomainTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../../types/BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Registered starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..95cf6603e --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { RegisterDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../../types/BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Starname registration + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From d7b4b8382b8efc05903686b9f725d9f4a3f797d3 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 25 Feb 2020 10:34:44 +0200 Subject: [PATCH 096/204] Add date duration formatter --- packages/bierzo-wallet/src/utils/date.ts | 16 +++++++++++++++ .../bierzo-wallet/src/utils/date.unit.spec.ts | 20 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 packages/bierzo-wallet/src/utils/date.unit.spec.ts diff --git a/packages/bierzo-wallet/src/utils/date.ts b/packages/bierzo-wallet/src/utils/date.ts index afeeaf095..025adaf21 100644 --- a/packages/bierzo-wallet/src/utils/date.ts +++ b/packages/bierzo-wallet/src/utils/date.ts @@ -11,6 +11,22 @@ export function formatTime(date: ReadonlyDate): string { return `${hours}:${minutes > 9 ? minutes : `0${minutes}`} ${ampm}`; } +export function formatDuration(duration: number): string { + const seconds = duration % 60; + const totalMinutes = (duration - seconds) / 60; + const minutes = totalMinutes % 60; + const totalHours = (totalMinutes - minutes) / 60; + const hours = totalHours % 24; + const days = (totalHours - hours) / 24; + + const daysPart = `${days ? `${days}:` : ""}`; + const hoursPart = `${hours ? `${hours > 9 ? hours : `0${hours}`}:` : ""}`; + const minutesPart = `${minutes ? `${minutes > 9 ? minutes : `0${minutes}`}:` : ""}`; + const secondsPart = `${seconds > 9 ? seconds : `0${seconds}`}`; + + return `${daysPart}${hoursPart}${minutesPart}${secondsPart}`; +} + export function formatDate(date: ReadonlyDate): string { const monthNames: readonly string[] = [ "Jan", diff --git a/packages/bierzo-wallet/src/utils/date.unit.spec.ts b/packages/bierzo-wallet/src/utils/date.unit.spec.ts new file mode 100644 index 000000000..1f5cbf244 --- /dev/null +++ b/packages/bierzo-wallet/src/utils/date.unit.spec.ts @@ -0,0 +1,20 @@ +import { formatDuration } from "./date"; + +describe("Date utils", () => { + describe("formatDuration", () => { + it("should return correct value if less than day", async () => { + const duration = formatDuration(30917); + expect(duration).toEqual("08:35:17"); + }); + + it("should return correct value if less than hour", async () => { + const duration = formatDuration(2117); + expect(duration).toEqual("35:17"); + }); + + it("should return correct value if more than day", async () => { + const duration = formatDuration(462917); + expect(duration).toEqual("5:08:35:17"); + }); + }); +}); From 881566937b741200f110df788858d21570d0d256 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 25 Feb 2020 10:35:06 +0200 Subject: [PATCH 097/204] Add TX additional fields --- .../ui/TransactionRow/Details.tsx | 44 ++++++++++++++++++- .../src/routes/transactions/index.stories.tsx | 5 ++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx index f2fecbe90..762ed48f9 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterDomainTx/ui/TransactionRow/Details.tsx @@ -4,7 +4,7 @@ import { Block, Typography } from "medulas-react-components"; import * as React from "react"; import { amountToString } from "ui-logic"; -import { formatTime } from "../../../../../../utils/date"; +import { formatDuration, formatTime } from "../../../../../../utils/date"; import { ProcessedTx } from "../../../../types/BwParser"; const useStyles = makeStyles({ @@ -63,7 +63,47 @@ const TxDetails = ({ tx }: Props): JSX.Element => {   - + + + Has Superuser: + + + {tx.original.hasSuperuser ? "Yes" : "No"} + + + + + Broker: + + + {tx.original.broker ? tx.original.broker : "-"} + + + + + Account Renew: + + + {formatDuration(tx.original.accountRenew)} + + + +   + + + + Fee: + + {tx.original.msgFees.map(fee => ( + + {`${fee.msgPath} (${amountToString(fee.fee)})`} + + ))} + + +   + + Transaction id: diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index 9897a0eae..4ea369df5 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -74,7 +74,10 @@ const incomingNewDomainTransaction: ProcessedTx = { domain: "test", admin: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, hasSuperuser: true, - msgFees: [], + msgFees: [ + { msgPath: "path-1", fee: stringToAmount("2", iov) }, + { msgPath: "path-2", fee: stringToAmount("3", iov) }, + ], accountRenew: 2 * 3600, fee: { tokens: stringToAmount("100", iov), From 8850a875c6b073571e7f2d5a8eecf66d9b3c580b Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 25 Feb 2020 10:38:04 +0200 Subject: [PATCH 098/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index bd3c30ad1..a3ce8ecca 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -5077,6 +5077,79 @@ Array [
+
+
+
+
+
+ Transaction type +
+
+
+ Starname registration +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
@@ -5703,7 +5776,7 @@ Array [ className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-subtitle2 MuiTypography-colorSecondary" > The transaction ID is: - CD04A4754498E06DB5A13C5F371F1F04FF6D2470F24AA9BD886540E5DCE77F70 + D5688A52D55A02EC4AEA5EC1EADFFFE1C9E0EE6A4DDBE2377F98326D42DFC975
From e62557085cceeabda990def8075aaa223bb57db7 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 26 Feb 2020 11:56:58 +0200 Subject: [PATCH 099/204] Add CreateAccount TX support --- .../transactions/types/BwParserFactory.ts | 13 ++ .../types/BwRegisterAccountTx/index.tsx | 16 +++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 ++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++ .../ui/TransactionRow/Details.tsx | 111 ++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 ++++++++++++++ .../src/routes/transactions/index.stories.tsx | 34 +++++- 7 files changed, 335 insertions(+), 1 deletion(-) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts index ce1caf28e..3ba698992 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts @@ -8,9 +8,11 @@ import { UnsignedTransaction, } from "@iov/bcp"; import { + isRegisterAccountTx, isRegisterDomainTx, isRegisterUsernameTx, isUpdateTargetsOfUsernameTx, + RegisterAccountTx, RegisterDomainTx, RegisterUsernameTx, UpdateTargetsOfUsernameTx, @@ -18,6 +20,7 @@ import { import { ProcessedSendTransaction } from "../../../store/notifications"; import { BwParser, ProcessedTx } from "../types/BwParser"; +import { BwRegisterAccountParser } from "./BwRegisterAccountTx"; import { BwRegisterDomainParser } from "./BwRegisterDomainTx"; import { BwRegisterUsernameParser } from "./BwRegisterUsernameTx"; import { BwSendParser } from "./BwSendTransaction"; @@ -40,6 +43,10 @@ function isProcessedRegisterDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isRegisterAccountTx(tx.original); +} + export class BwParserFactory { public static getReactComponent(tx: ProcessedTx, userAddresses: readonly Address[]): JSX.Element { if (isProcessedSendTransaction(tx)) { @@ -50,6 +57,8 @@ export class BwParserFactory { return new BwUpdateUsernameTargetParser().graphicalRepresentation(tx); } else if (isProcessedRegisterDomainTx(tx)) { return new BwRegisterDomainParser().graphicalRepresentation(tx); + } else if (isProcessedRegisterAccountTx(tx)) { + return new BwRegisterAccountParser().graphicalRepresentation(tx); } return new BwUnkownParser().graphicalRepresentation(tx); @@ -62,6 +71,10 @@ export class BwParserFactory { return new BwRegisterUsernameParser().headerRepresentation(tx, lastOne); } else if (isProcessedUpdateUsernameTargetsTx(tx)) { return new BwUpdateUsernameTargetParser().headerRepresentation(tx, lastOne); + } else if (isProcessedRegisterDomainTx(tx)) { + return new BwRegisterDomainParser().headerRepresentation(tx, lastOne); + } else if (isProcessedRegisterAccountTx(tx)) { + return new BwRegisterAccountParser().headerRepresentation(tx, lastOne); } return new BwUnkownParser().headerRepresentation(tx, lastOne); diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/index.tsx new file mode 100644 index 000000000..923ec48ac --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/index.tsx @@ -0,0 +1,16 @@ +import { RegisterAccountTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../../types/BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwRegisterAccountParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..3a1105071 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account has been registered + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..610e473a2 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { RegisterAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../../types/BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..4e0f07c5b --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,111 @@ +import { ChainAddressPair, RegisterAccountTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString, ellipsifyMiddle } from "ui-logic"; + +import { ChainAddressPairWithName } from "../../../../../../components/AddressesTable"; +import { formatTime } from "../../../../../../utils/date"; +import { chainAddressPairSortedMapping } from "../../../../../../utils/tokens"; +import { ProcessedTx } from "../../../../types/BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + const [addresses, setAddresses] = React.useState([]); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + React.useEffect(() => { + async function processAddresses(addresses: readonly ChainAddressPair[]): Promise { + const chainAddresses = await chainAddressPairSortedMapping(addresses); + setAddresses(chainAddresses); + } + processAddresses(tx.original.targets); + }, [tx.original.targets]); + + return ( + + + + + Registered account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Blockchain: + + {addresses.map(chain => ( + + {`${chain.chainName} (${ellipsifyMiddle(chain.address, 20)})`} + + ))} + + + + Broker: + + + {tx.original.broker ? tx.original.broker : "-"} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..26d7ac80a --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRegisterAccountTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { RegisterAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../../types/BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account registration + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index 4ea369df5..ed3de2778 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -1,5 +1,5 @@ import { Address, ChainId, Token, TokenTicker, TransactionId } from "@iov/bcp"; -import { RegisterDomainTx, RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; +import { RegisterAccountTx, RegisterDomainTx, RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; import { Sha256 } from "@iov/crypto"; import { Encoding, Uint64 } from "@iov/encoding"; import { action } from "@storybook/addon-actions"; @@ -85,6 +85,36 @@ const incomingNewDomainTransaction: ProcessedTx = { }, }; +const incomingRegisterAccountTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/register_account", + chainId: chainIdIov, + domain: "test", + name: "account", + owner: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + targets: [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "13751834438426525516L" as Address, + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0x695874053fcB8D9cF038ee4E53b7b24fB0baFa4c" as Address, + }, + ], + broker: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + const incomingSendTransaction: ProcessedSendTransaction = { time: new ReadonlyDate("2018-01-01T03:02:01.763Z"), id: makeExampleEthTransactionId(), @@ -135,7 +165,9 @@ const parsedTxs: readonly ( | ProcessedTx | ProcessedTx | ProcessedTx + | ProcessedTx )[] = [ + incomingRegisterAccountTransaction, incomingNewDomainTransaction, incomingSendTransaction, voteTx, From c0c45bbf7a7cd3fa73639abf1d18ea8bcbb20985 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 26 Feb 2020 12:59:30 +0200 Subject: [PATCH 100/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index a3ce8ecca..52a2324f4 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -5077,6 +5077,79 @@ Array [
+
+
+
+
+
+ Transaction type +
+
+
+ Account registration +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
@@ -5776,7 +5849,7 @@ Array [ className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-subtitle2 MuiTypography-colorSecondary" > The transaction ID is: - D5688A52D55A02EC4AEA5EC1EADFFFE1C9E0EE6A4DDBE2377F98326D42DFC975 + 8005F02D43FA06E7D0585FB64C961D57E318B27A145C857BCD3A6BDB413FF7FC
From bfa82fb5b6497c2a2ea1285821d832c51d432f0e Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:29:17 +0100 Subject: [PATCH 101/204] Support for UpdateAccountConfigurationTx --- .../BwUpdateAccountConfigurationTx/index.tsx | 16 +++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 ++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++ .../ui/TransactionRow/Details.tsx | 119 ++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++ 5 files changed, 297 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/index.tsx new file mode 100644 index 000000000..69af935ed --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/index.tsx @@ -0,0 +1,16 @@ +import { UpdateAccountConfigurationTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwUpdateAccountConfigurationParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..9534f6942 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account configuration has been updated + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..aad01e183 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { UpdateAccountConfigurationTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..3d0e8d8e1 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,119 @@ +import { UpdateAccountConfigurationTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + const renewDate = new Date(tx.original.configuration.domainRenew * 1000).toLocaleDateString(); + + return ( + + + + + Updated account configuration: + + + {tx.original.configuration.validName}*{tx.original.configuration.validDomain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Blockchain ID: + + + {tx.original.configuration.validBlockchainId} + + + + + Blockchain Address: + + + {tx.original.configuration.validBlockchainAddress} + + + +   + + + + Owner: + + + {tx.original.configuration.owner} + + + + + Renew: + + + {renewDate} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..e5f849e63 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwUpdateAccountConfigurationTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { UpdateAccountConfigurationTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account configuration update + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From fd155992f00a3e196e2e93dd5e7f79fcd5cde1fd Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:30:24 +0100 Subject: [PATCH 102/204] Support for TransferDomainTx --- .../types/BwTransferDomainTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 90 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 ++++++++++++++++++ 5 files changed, 267 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/index.tsx new file mode 100644 index 000000000..1f784039e --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/index.tsx @@ -0,0 +1,16 @@ +import { TransferDomainTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwTransferDomainParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..f6bcf357a --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + starname has been transferred + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..52210fbc3 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { TransferDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..9b4cc7abe --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,90 @@ +import { TransferDomainTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Transferred starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + New owner: + + + {tx.original.newAdmin} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..c25ef25cb --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferDomainTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { TransferDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Starname transfer + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 4210b7bffb96013a42ddaf911991238f194ecd43 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:30:56 +0100 Subject: [PATCH 103/204] Support for RenewDomainTx --- .../types/BwRenewDomainTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 256 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/index.tsx new file mode 100644 index 000000000..349a7bd9d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/index.tsx @@ -0,0 +1,16 @@ +import { RenewDomainTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwRenewDomainParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..30da22802 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + starname has been renewed + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..f163b74e9 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { RenewDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..ab9992479 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { RenewDomainTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Renewed starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..ab46e923f --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewDomainTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { RenewDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Starname renewal + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 2eecf865da5df0a33c6117495a5e02f8bda67dd2 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:31:10 +0100 Subject: [PATCH 104/204] Support for DeleteDomainTx --- .../types/BwDeleteDomainTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 256 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/index.tsx new file mode 100644 index 000000000..700147bc1 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/index.tsx @@ -0,0 +1,16 @@ +import { DeleteDomainTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwDeleteDomainParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..d9b74f3c3 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + starname has been deleted + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..d784a8248 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { DeleteDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..a5a728598 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { DeleteDomainTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Deleted starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..eb899c59a --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteDomainTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { DeleteDomainTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Starname deletion + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From c4cac05694cdc633a142bed1dc8da51e03d41ac5 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:31:34 +0100 Subject: [PATCH 105/204] Support for TransferAccountTx --- .../types/BwTransferAccountTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 90 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 ++++++++++++++++++ 5 files changed, 268 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/index.tsx new file mode 100644 index 000000000..76e638409 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/index.tsx @@ -0,0 +1,16 @@ +import { TransferAccountTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwTransferAccountParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..50c91dacc --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account has been transferred + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..429e06c8d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { TransferAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..94b7dd81d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,90 @@ +import { TransferAccountTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Transferred account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + New owner: + + + {tx.original.newOwner} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..f3e1c85eb --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwTransferAccountTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { TransferAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account transfer + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From f71c01553126fe698b83f779c0a7264a0aa8ea1e Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:31:58 +0100 Subject: [PATCH 106/204] Support for ReplaceAccountTargetsTx --- .../types/BwReplaceAccountTargetsTx/index.tsx | 16 +++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 ++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++ .../ui/TransactionRow/Details.tsx | 103 ++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++ 5 files changed, 281 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/index.tsx new file mode 100644 index 000000000..79a916ac2 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/index.tsx @@ -0,0 +1,16 @@ +import { ReplaceAccountTargetsTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwReplaceAccountTargetsParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..0e2f8ecd7 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account targets have been updated + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..dd25c40d0 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { ReplaceAccountTargetsTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..e0eee4b78 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,103 @@ +import { ChainAddressPair, ReplaceAccountTargetsTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString, ellipsifyMiddle } from "ui-logic"; + +import { ChainAddressPairWithName } from "../../../../../../components/AddressesTable"; +import { formatTime } from "../../../../../../utils/date"; +import { chainAddressPairSortedMapping } from "../../../../../../utils/tokens"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + const [addresses, setAddresses] = React.useState([]); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + React.useEffect(() => { + async function processAddresses(addresses: readonly ChainAddressPair[]): Promise { + const chainAddresses = await chainAddressPairSortedMapping(addresses); + setAddresses(chainAddresses); + } + processAddresses(tx.original.newTargets); + }, [tx.original.newTargets]); + + return ( + + + + + Registered account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Blockchain: + + {addresses.map(chain => ( + + {`${chain.chainName} (${ellipsifyMiddle(chain.address, 20)})`} + + ))} + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..0c66cff85 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountTargetsTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { ReplaceAccountTargetsTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account targets update + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 2d9b201c43cdfd64dc31ea70f9038551ba199988 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:32:15 +0100 Subject: [PATCH 107/204] Support for DeleteAccountTx --- .../types/BwDeleteAccountTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 257 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/index.tsx new file mode 100644 index 000000000..c4c383475 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/index.tsx @@ -0,0 +1,16 @@ +import { DeleteAccountTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwDeleteAccountParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..ca7291a62 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account has been deleted + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..ece5b86dd --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { DeleteAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..5a2d3677a --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { DeleteAccountTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Deleted account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..892631667 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { DeleteAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account deletion + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 481b9c6a8e78958ff55476252c163f42dd457fca Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:32:26 +0100 Subject: [PATCH 108/204] Support for DeleteAllAccountsTx --- .../types/BwDeleteAllAccountsTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 256 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/index.tsx new file mode 100644 index 000000000..9a98a8517 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/index.tsx @@ -0,0 +1,16 @@ +import { DeleteAllAccountsTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwDeleteAllAccountsParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..41a7c5921 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + all accounts have been deleted + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..2633fce0e --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { DeleteAllAccountsTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..8050667a9 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { DeleteAllAccountsTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + All accounts deleted for starname: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..59e30ba76 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAllAccountsTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { DeleteAllAccountsTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + All accounts deletion + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 281cd51d9d6885b014541b433913bed11486bb11 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:32:50 +0100 Subject: [PATCH 109/204] Support for RenewAccountTx --- .../types/BwRenewAccountTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 ++++++++++++ .../ui/TransactionRow/Details.tsx | 79 +++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++++ 5 files changed, 257 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/index.tsx new file mode 100644 index 000000000..eb83f1ef9 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/index.tsx @@ -0,0 +1,16 @@ +import { RenewAccountTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwRenewAccountParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..580b992bc --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account has been renewed + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..d0d2f35a0 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { RenewAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..310933254 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,79 @@ +import { RenewAccountTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Renewed account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..56a89797c --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwRenewAccountTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { RenewAccountTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Account renewal + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 9f436260bb2dde3002577ca676db172c5378e351 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:33:05 +0100 Subject: [PATCH 110/204] Support for AddAccountCertificateTx --- .../types/BwAddAccountCertificateTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 94 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++ 5 files changed, 272 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/index.tsx new file mode 100644 index 000000000..c89953438 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/index.tsx @@ -0,0 +1,16 @@ +import { AddAccountCertificateTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwAddAccountCertificateParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..3e1728efa --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account certificate has been added + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..868422ca2 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { AddAccountCertificateTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..9849e6c0f --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,94 @@ +import { AddAccountCertificateTx } from "@iov/bns"; +import { Encoding } from "@iov/encoding"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, + certificateBlock: { + wordBreak: "break-all", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Updated certificate from account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Certificate: + + + {Encoding.toBase64(tx.original.certificate)} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..addbf6a82 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwAddAccountCertificateTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { AddAccountCertificateTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Add certificate to account + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From a4ed9f73671f616a34e98fccaab7fc022bf8b98e Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:33:18 +0100 Subject: [PATCH 111/204] Support for ReplaceAccountMsgFeesTx --- .../types/BwReplaceAccountMsgFeesTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 22 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 92 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++ 5 files changed, 269 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/index.tsx new file mode 100644 index 000000000..eb98743fe --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/index.tsx @@ -0,0 +1,16 @@ +import { ReplaceAccountMsgFeesTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwReplaceAccountMsgFeesParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..664a49c21 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,22 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly domain: string; +} + +const Msg = ({ domain }: MsgProps): JSX.Element => { + return ( + + + *{domain} + + + {" "} + fees have been updated + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..0d51cf414 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { ReplaceAccountMsgFeesTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..2f1973bf4 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,92 @@ +import { ReplaceAccountMsgFeesTx } from "@iov/bns"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Updated fees for accounts in: + + + *{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Fees: + + {tx.original.newMsgFees.map(msgFee => ( + + {`${msgFee.msgPath}: ${amountToString(msgFee.fee)}`} + + ))} + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..bae6fb8d5 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwReplaceAccountMsgFeesTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { ReplaceAccountMsgFeesTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Fees update for accounts + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From cb40846be0f14b14e4bb47fa13af5c681056d237 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:33:30 +0100 Subject: [PATCH 112/204] Support for DeleteAccountCertificateTx --- .../BwDeleteAccountCertificateTx/index.tsx | 16 ++++ .../ui/TransactionHeader/MsgSuccess.tsx | 23 +++++ .../ui/TransactionHeader/index.tsx | 53 +++++++++++ .../ui/TransactionRow/Details.tsx | 94 +++++++++++++++++++ .../ui/TransactionRow/index.tsx | 86 +++++++++++++++++ 5 files changed, 272 insertions(+) create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/index.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/Details.tsx create mode 100644 packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/index.tsx diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/index.tsx new file mode 100644 index 000000000..d5ac7d9b7 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/index.tsx @@ -0,0 +1,16 @@ +import { DeleteAccountCertificateTx } from "@iov/bns"; +import * as React from "react"; + +import { BwParser, ProcessedTx } from "../BwParser"; +import TransactionHeader from "./ui/TransactionHeader"; +import TransactionRow from "./ui/TransactionRow"; + +export class BwDeleteAccountCertificateParser extends BwParser { + public graphicalRepresentation(tx: ProcessedTx): JSX.Element { + return ; + } + + public headerRepresentation(tx: ProcessedTx, lastOne: boolean): JSX.Element { + return ; + } +} diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx new file mode 100644 index 000000000..88bc86988 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/MsgSuccess.tsx @@ -0,0 +1,23 @@ +import { Typography } from "medulas-react-components"; +import * as React from "react"; + +interface MsgProps { + readonly name: string; + readonly domain: string; +} + +const Msg = ({ name, domain }: MsgProps): JSX.Element => { + return ( + + + {name}*{domain} + + + {" "} + account certificate has been deleted + + + ); +}; + +export default Msg; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/index.tsx new file mode 100644 index 000000000..8f99aab3c --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionHeader/index.tsx @@ -0,0 +1,53 @@ +import { DeleteAccountCertificateTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import ListItem from "@material-ui/core/ListItem"; +import ListItemText from "@material-ui/core/ListItemText"; +import { Block, Hairline, Image } from "medulas-react-components"; +import * as React from "react"; + +import { itemBackground } from "../../../../../../theme/css"; +import sendTx from "../../../../assets/transactionSend.svg"; +import { ProcessedTx } from "../../../BwParser"; +import Msg from "./MsgSuccess"; + +interface ItemProps { + readonly item: ProcessedTx; + readonly lastOne: boolean; +} + +const useStyles = makeStyles((theme: Theme) => ({ + msg: { + "& > span": { + lineHeight: 1.3, + marginBottom: `${theme.spacing(1)}px`, + }, + }, + item: { + backgroundColor: itemBackground, + }, +})); + +const TransactionHeader = ({ item, lastOne }: ItemProps): JSX.Element => { + const classes = useStyles(); + const { time, original } = item; + + const msg = ; + + return ( + + + Tx operation + + + + + {!lastOne && ( + + + + )} + + ); +}; + +export default TransactionHeader; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/Details.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/Details.tsx new file mode 100644 index 000000000..999a4c73d --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/Details.tsx @@ -0,0 +1,94 @@ +import { DeleteAccountCertificateTx } from "@iov/bns"; +import { Encoding } from "@iov/encoding"; +import { makeStyles } from "@material-ui/core"; +import { Block, Typography } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { formatTime } from "../../../../../../utils/date"; +import { ProcessedTx } from "../../../BwParser"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + sectionName: { + overflowWrap: "break-word", + }, + certificateBlock: { + wordBreak: "break-all", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +const TxDetails = ({ tx }: Props): JSX.Element => { + const classes = useStyles(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = "-" + amountToString(tx.original.fee.tokens); + } + + return ( + + + + + Deleted certificate from account: + + + {tx.original.name}*{tx.original.domain} + + + + + Time: + + + {formatTime(tx.time)} + + + + + Transaction fee: + + + {txFee} + + + +   + + + + Certificate hash: + + + {Encoding.toBase64(tx.original.certificateHash)} + + + +   + + + + Transaction id: + + + {tx.id} + + + + + ); +}; + +export default TxDetails; diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/index.tsx b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/index.tsx new file mode 100644 index 000000000..7485d30d4 --- /dev/null +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwDeleteAccountCertificateTx/ui/TransactionRow/index.tsx @@ -0,0 +1,86 @@ +import { DeleteAccountCertificateTx } from "@iov/bns"; +import { makeStyles, Theme } from "@material-ui/core"; +import { useTheme } from "@material-ui/styles"; +import { Block, CircleImage, Hairline, Image, Typography, useOpen } from "medulas-react-components"; +import * as React from "react"; +import { amountToString } from "ui-logic"; + +import { getBorderColor } from "../../../../../../theme/css"; +import { formatDate } from "../../../../../../utils/date"; +import dropdownArrow from "../../../../assets/dropdownArrow.svg"; +import dropdownArrowClose from "../../../../assets/dropdownArrowClose.svg"; +import txIcon from "../../../../assets/user.svg"; +import { ProcessedTx } from "../../../BwParser"; +import TxDetails from "./Details"; + +const useStyles = makeStyles({ + rowToggle: { + cursor: "pointer", + }, + cell: { + flex: "1", + }, +}); + +interface Props { + readonly tx: ProcessedTx; +} + +function TransactionRow({ tx }: Props): JSX.Element { + const classes = useStyles(); + const theme = useTheme(); + const [isOpen, toggle] = useOpen(); + + let txFee = "-"; + if (tx.original.fee && tx.original.fee.tokens) { + txFee = amountToString(tx.original.fee.tokens); + } + + return ( + + toggle()}> + + + + + + Delete certificate from account + + + + + {formatDate(tx.time)} + + + + + -{txFee} + + + + Sorting + + + + + {isOpen && ( + + + + + + + )} + + ); +} + +export default TransactionRow; From 355bd2010190c7dfe6e1e2f45e05a753226de32c Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:34:25 +0100 Subject: [PATCH 113/204] Adds parsing support for new Tx types --- .../transactions/types/BwParserFactory.ts | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts index 3ba698992..ab67e1797 100644 --- a/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts +++ b/packages/bierzo-wallet/src/logic/transactions/types/BwParserFactory.ts @@ -8,23 +8,59 @@ import { UnsignedTransaction, } from "@iov/bcp"; import { + AddAccountCertificateTx, + DeleteAccountCertificateTx, + DeleteAccountTx, + DeleteAllAccountsTx, + DeleteDomainTx, + isAddAccountCertificateTx, + isDeleteAccountCertificateTx, + isDeleteAccountTx, + isDeleteAllAccountsTx, + isDeleteDomainTx, isRegisterAccountTx, isRegisterDomainTx, isRegisterUsernameTx, + isRenewAccountTx, + isRenewDomainTx, + isReplaceAccountMsgFeesTx, + isReplaceAccountTargetsTx, + isTransferAccountTx, + isTransferDomainTx, + isUpdateAccountConfigurationTx, isUpdateTargetsOfUsernameTx, RegisterAccountTx, RegisterDomainTx, RegisterUsernameTx, + RenewAccountTx, + RenewDomainTx, + ReplaceAccountMsgFeesTx, + ReplaceAccountTargetsTx, + TransferAccountTx, + TransferDomainTx, + UpdateAccountConfigurationTx, UpdateTargetsOfUsernameTx, } from "@iov/bns"; import { ProcessedSendTransaction } from "../../../store/notifications"; import { BwParser, ProcessedTx } from "../types/BwParser"; +import { BwAddAccountCertificateParser } from "./BwAddAccountCertificateTx"; +import { BwDeleteAccountCertificateParser } from "./BwDeleteAccountCertificateTx"; +import { BwDeleteAccountParser } from "./BwDeleteAccountTx"; +import { BwDeleteAllAccountsParser } from "./BwDeleteAllAccountsTx"; +import { BwDeleteDomainParser } from "./BwDeleteDomainTx"; import { BwRegisterAccountParser } from "./BwRegisterAccountTx"; import { BwRegisterDomainParser } from "./BwRegisterDomainTx"; import { BwRegisterUsernameParser } from "./BwRegisterUsernameTx"; +import { BwRenewAccountParser } from "./BwRenewAccountTx"; +import { BwRenewDomainParser } from "./BwRenewDomainTx"; +import { BwReplaceAccountMsgFeesParser } from "./BwReplaceAccountMsgFeesTx"; +import { BwReplaceAccountTargetsParser } from "./BwReplaceAccountTargetsTx"; import { BwSendParser } from "./BwSendTransaction"; +import { BwTransferAccountParser } from "./BwTransferAccountTx"; +import { BwTransferDomainParser } from "./BwTransferDomainTx"; import { BwUnkownParser } from "./BwUnkownTransaction"; +import { BwUpdateAccountConfigurationParser } from "./BwUpdateAccountConfigurationTx"; import { BwUpdateUsernameTargetParser } from "./BwUpdateUsernameTargetsTx"; function isProcessedSendTransaction(tx: ProcessedTx): tx is ProcessedSendTransaction { @@ -43,10 +79,62 @@ function isProcessedRegisterDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isTransferDomainTx(tx.original); +} + +function isProcessedRenewDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isRenewDomainTx(tx.original); +} + +function isProcessedDeleteDomainTx(tx: ProcessedTx): tx is ProcessedTx { + return isDeleteDomainTx(tx.original); +} + function isProcessedRegisterAccountTx(tx: ProcessedTx): tx is ProcessedTx { return isRegisterAccountTx(tx.original); } +function isProcessedTransferAccountTx(tx: ProcessedTx): tx is ProcessedTx { + return isTransferAccountTx(tx.original); +} + +function isProcessedReplaceAccountTargetsTx(tx: ProcessedTx): tx is ProcessedTx { + return isReplaceAccountTargetsTx(tx.original); +} + +function isProcessedDeleteAccountTx(tx: ProcessedTx): tx is ProcessedTx { + return isDeleteAccountTx(tx.original); +} + +function isProcessedDeleteAllAccountsTx(tx: ProcessedTx): tx is ProcessedTx { + return isDeleteAllAccountsTx(tx.original); +} + +function isProcessedRenewAccountTx(tx: ProcessedTx): tx is ProcessedTx { + return isRenewAccountTx(tx.original); +} + +function isProcessedAddAccountCertificateTx(tx: ProcessedTx): tx is ProcessedTx { + return isAddAccountCertificateTx(tx.original); +} + +function isProcessedReplaceAccountMsgFeesTx(tx: ProcessedTx): tx is ProcessedTx { + return isReplaceAccountMsgFeesTx(tx.original); +} + +function isProcessedDeleteAccountCertificateTx( + tx: ProcessedTx, +): tx is ProcessedTx { + return isDeleteAccountCertificateTx(tx.original); +} + +function isProcessedUpdateAccountConfigurationTx( + tx: ProcessedTx, +): tx is ProcessedTx { + return isUpdateAccountConfigurationTx(tx.original); +} + export class BwParserFactory { public static getReactComponent(tx: ProcessedTx, userAddresses: readonly Address[]): JSX.Element { if (isProcessedSendTransaction(tx)) { @@ -57,8 +145,32 @@ export class BwParserFactory { return new BwUpdateUsernameTargetParser().graphicalRepresentation(tx); } else if (isProcessedRegisterDomainTx(tx)) { return new BwRegisterDomainParser().graphicalRepresentation(tx); + } else if (isProcessedTransferDomainTx(tx)) { + return new BwTransferDomainParser().graphicalRepresentation(tx); + } else if (isProcessedRenewDomainTx(tx)) { + return new BwRenewDomainParser().graphicalRepresentation(tx); + } else if (isProcessedDeleteDomainTx(tx)) { + return new BwDeleteDomainParser().graphicalRepresentation(tx); } else if (isProcessedRegisterAccountTx(tx)) { return new BwRegisterAccountParser().graphicalRepresentation(tx); + } else if (isProcessedTransferAccountTx(tx)) { + return new BwTransferAccountParser().graphicalRepresentation(tx); + } else if (isProcessedReplaceAccountTargetsTx(tx)) { + return new BwReplaceAccountTargetsParser().graphicalRepresentation(tx); + } else if (isProcessedDeleteAccountTx(tx)) { + return new BwDeleteAccountParser().graphicalRepresentation(tx); + } else if (isProcessedDeleteAllAccountsTx(tx)) { + return new BwDeleteAllAccountsParser().graphicalRepresentation(tx); + } else if (isProcessedRenewAccountTx(tx)) { + return new BwRenewAccountParser().graphicalRepresentation(tx); + } else if (isProcessedAddAccountCertificateTx(tx)) { + return new BwAddAccountCertificateParser().graphicalRepresentation(tx); + } else if (isProcessedReplaceAccountMsgFeesTx(tx)) { + return new BwReplaceAccountMsgFeesParser().graphicalRepresentation(tx); + } else if (isProcessedDeleteAccountCertificateTx(tx)) { + return new BwDeleteAccountCertificateParser().graphicalRepresentation(tx); + } else if (isProcessedUpdateAccountConfigurationTx(tx)) { + return new BwUpdateAccountConfigurationParser().graphicalRepresentation(tx); } return new BwUnkownParser().graphicalRepresentation(tx); @@ -73,8 +185,32 @@ export class BwParserFactory { return new BwUpdateUsernameTargetParser().headerRepresentation(tx, lastOne); } else if (isProcessedRegisterDomainTx(tx)) { return new BwRegisterDomainParser().headerRepresentation(tx, lastOne); + } else if (isProcessedTransferDomainTx(tx)) { + return new BwTransferDomainParser().headerRepresentation(tx, lastOne); + } else if (isProcessedRenewDomainTx(tx)) { + return new BwRenewDomainParser().headerRepresentation(tx, lastOne); + } else if (isProcessedDeleteDomainTx(tx)) { + return new BwDeleteDomainParser().headerRepresentation(tx, lastOne); } else if (isProcessedRegisterAccountTx(tx)) { return new BwRegisterAccountParser().headerRepresentation(tx, lastOne); + } else if (isProcessedTransferAccountTx(tx)) { + return new BwTransferAccountParser().headerRepresentation(tx, lastOne); + } else if (isProcessedReplaceAccountTargetsTx(tx)) { + return new BwReplaceAccountTargetsParser().headerRepresentation(tx, lastOne); + } else if (isProcessedDeleteAccountTx(tx)) { + return new BwDeleteAccountParser().headerRepresentation(tx, lastOne); + } else if (isProcessedDeleteAllAccountsTx(tx)) { + return new BwDeleteAllAccountsParser().headerRepresentation(tx, lastOne); + } else if (isProcessedRenewAccountTx(tx)) { + return new BwRenewAccountParser().headerRepresentation(tx, lastOne); + } else if (isProcessedAddAccountCertificateTx(tx)) { + return new BwAddAccountCertificateParser().headerRepresentation(tx, lastOne); + } else if (isProcessedReplaceAccountMsgFeesTx(tx)) { + return new BwReplaceAccountMsgFeesParser().headerRepresentation(tx, lastOne); + } else if (isProcessedDeleteAccountCertificateTx(tx)) { + return new BwDeleteAccountCertificateParser().headerRepresentation(tx, lastOne); + } else if (isProcessedUpdateAccountConfigurationTx(tx)) { + return new BwUpdateAccountConfigurationParser().headerRepresentation(tx, lastOne); } return new BwUnkownParser().headerRepresentation(tx, lastOne); From 23a0e101fae59971c133bc5385934bb8bf68ebc5 Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:34:50 +0100 Subject: [PATCH 114/204] Adds new Tx types to storybook --- .../src/routes/transactions/index.stories.tsx | 265 +++++++++++++++++- 1 file changed, 263 insertions(+), 2 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index ed3de2778..84cb02bee 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -1,5 +1,23 @@ import { Address, ChainId, Token, TokenTicker, TransactionId } from "@iov/bcp"; -import { RegisterAccountTx, RegisterDomainTx, RegisterUsernameTx, VoteOption, VoteTx } from "@iov/bns"; +import { + AddAccountCertificateTx, + DeleteAccountCertificateTx, + DeleteAccountTx, + DeleteAllAccountsTx, + DeleteDomainTx, + RegisterAccountTx, + RegisterDomainTx, + RegisterUsernameTx, + RenewAccountTx, + RenewDomainTx, + ReplaceAccountMsgFeesTx, + ReplaceAccountTargetsTx, + TransferAccountTx, + TransferDomainTx, + UpdateAccountConfigurationTx, + VoteOption, + VoteTx, +} from "@iov/bns"; import { Sha256 } from "@iov/crypto"; import { Encoding, Uint64 } from "@iov/encoding"; import { action } from "@storybook/addon-actions"; @@ -48,6 +66,12 @@ const currentUsersAddresses = [ let txCount = 0; +const defaultCertificate = Encoding.fromHex( + "517fdb504c6f68fa715a10569a294060beaefae0906feb333600cc1fce04737f0f0590c8999d8694ca90c9d042395b50a02d1de2c88832610cf2d5c51df8e6e131765771b3944e19919fc250572e06a8c86bc334023cb570ffd502145cbd2f51b8b0559dc6f2af3fd7f6e846d43f20f1ed4db537ff6fa9966ced5dc40f0a36f7d32a42ad81f03bdc15f1d27afc095cd5112a41e613b2e9f4f2fda0befc0231df", +); + +const defaultCertificateHash = Encoding.fromHex("569a294060beaefae090"); + function makeExampleEthTransactionId(): TransactionId { // The generated hash is deterministic but arbitrary and has the correct format (see https://etherscan.io/txs) const data = Uint64.fromNumber(txCount++).toBytesBigEndian(); @@ -85,6 +109,46 @@ const incomingNewDomainTransaction: ProcessedTx = { }, }; +const incomingTransferDomainTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/transfer_domain", + chainId: chainIdIov, + domain: "test", + newAdmin: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingRenewDomainTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/renew_domain", + chainId: chainIdIov, + domain: "test", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingDeleteDomainTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/delete_domain", + chainId: chainIdIov, + domain: "test", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + const incomingRegisterAccountTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), @@ -115,6 +179,179 @@ const incomingRegisterAccountTransaction: ProcessedTx = { }, }; +const incomingTransferAccountTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/transfer_account", + chainId: chainIdIov, + domain: "test", + name: "account", + newOwner: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingReplaceAccountTargetsTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/replace_account_targets", + chainId: chainIdIov, + domain: "test", + name: "account", + newTargets: [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "13751834438426525516L" as Address, + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0x695874053fcB8D9cF038ee4E53b7b24fB0baFa4c" as Address, + }, + ], + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingDeleteAccountTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/delete_account", + chainId: chainIdIov, + domain: "test", + name: "account", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingDeleteAllAccountsTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/delete_all_accounts", + chainId: chainIdIov, + domain: "test", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingRenewAccountTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/renew_account", + chainId: chainIdIov, + domain: "test", + name: "account", + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingAddAccountCertificateTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/add_account_certificate", + chainId: chainIdIov, + domain: "test", + name: "account", + certificate: defaultCertificate, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingReplaceAccountMsgFeesTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/replace_account_msg_fees", + chainId: chainIdIov, + domain: "test", + newMsgFees: [ + { + msgPath: "fee-path-1", + fee: { + fractionalDigits: 9, + quantity: "10", + tokenTicker: "ETH" as TokenTicker, + }, + }, + { + msgPath: "fee-path-2", + fee: { + fractionalDigits: 9, + quantity: "20", + tokenTicker: "IOV" as TokenTicker, + }, + }, + { + msgPath: "fee-path-3", + fee: { + fractionalDigits: 9, + quantity: "30", + tokenTicker: "LSK" as TokenTicker, + }, + }, + ], + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingDeleteAccountCertificateTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/delete_account_certificate", + chainId: chainIdIov, + domain: "test", + name: "account", + certificateHash: defaultCertificateHash, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + +const incomingUpdateAccountConfigurationTransaction: ProcessedTx = { + id: makeExampleIovTransactionId(), + time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + original: { + kind: "bns/update_account_configuration", + chainId: chainIdIov, + configuration: { + owner: "tiov1yeyyqj3zxgs500xvzp38vu3c336yj8q48a5jx0" as Address, + domainRenew: 1000000000, + validDomain: "testDomain", + validName: "testName", + validBlockchainId: "test-blockchain-id", + validBlockchainAddress: "test-blockchain-address", + }, + fee: { + tokens: stringToAmount("100", iov), + }, + }, +}; + const incomingSendTransaction: ProcessedSendTransaction = { time: new ReadonlyDate("2018-01-01T03:02:01.763Z"), id: makeExampleEthTransactionId(), @@ -165,10 +402,34 @@ const parsedTxs: readonly ( | ProcessedTx | ProcessedTx | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx + | ProcessedTx )[] = [ - incomingRegisterAccountTransaction, incomingNewDomainTransaction, + incomingTransferDomainTransaction, + incomingRenewDomainTransaction, + incomingDeleteDomainTransaction, + incomingRegisterAccountTransaction, + incomingTransferAccountTransaction, + incomingReplaceAccountTargetsTransaction, + incomingDeleteAccountTransaction, + incomingDeleteAllAccountsTransaction, + incomingRenewAccountTransaction, + incomingAddAccountCertificateTransaction, + incomingReplaceAccountMsgFeesTransaction, + incomingDeleteAccountCertificateTransaction, + incomingUpdateAccountConfigurationTransaction, incomingSendTransaction, voteTx, { From cf7d6b42e103bafcb4e6046e7804a880a3b15c4d Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:35:41 +0100 Subject: [PATCH 115/204] Adds layout fix for Certificate character overflow --- .../transactions/components/TxTable/index.tsx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/transactions/components/TxTable/index.tsx b/packages/bierzo-wallet/src/routes/transactions/components/TxTable/index.tsx index 5bdb739d1..9d312ae0e 100644 --- a/packages/bierzo-wallet/src/routes/transactions/components/TxTable/index.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/components/TxTable/index.tsx @@ -1,5 +1,4 @@ -import { makeStyles, Theme } from "@material-ui/core"; -import { useTheme } from "@material-ui/styles"; +import { makeStyles } from "@material-ui/core"; import { Block } from "medulas-react-components"; import * as React from "react"; @@ -8,12 +7,7 @@ import { TxTableProps } from "./rowTxBuilder"; import TxTableFooter from "./TxTableFooter"; import TxTableHeader from "./TxTableHeader"; -const txTablePadding = 20; - const useStyles = makeStyles({ - inner: { - flexBasis: "auto", - }, panel: { boxShadow: `0 0 20px 0 ${getShadowColor()}`, }, @@ -29,13 +23,19 @@ function TxTable({ onPrevPage, }: TxTableProps): JSX.Element { const classes = useStyles(); - const theme = useTheme(); return ( - - - + - - ); } From 801dca35d469860fea641f6737a28f34a34c252a Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:35:53 +0100 Subject: [PATCH 116/204] Update storybook snapshots --- .../src/__snapshots__/Storyshots.test.js.snap | 777 +++++++++++++++--- 1 file changed, 650 insertions(+), 127 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 52a2324f4..3d7090d24 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -5000,13 +5000,7 @@ Array [ >
-
-
@@ -5027,56 +5021,567 @@ Array [
-
+
+
+ Descending sort +
+ Ascending sort +
+
+ Date +
+
+
+
+
+ Amount +
+
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Starname registration +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Starname transfer +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Starname renewal +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Starname deletion +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Account registration +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
+
+
+
+
+ Transaction type +
+
+
+ Account transfer +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
+
+
+
+
+
- Descending sort +
+
+ Transaction type +
+
+
+ Account targets update +
+
+
+
+ 1 Dec 2019 +
+
+
+
+ - + 100 IOV +
+
+
+ Sorting +
- Ascending sort
-
- Date -
-
-
-
-
- Amount -
-
-
-
-
@@ -5107,7 +5612,7 @@ Array [
- Account registration + Account deletion
- Starname registration + All accounts deletion
- To - - tiov18c8a...4cl27 + Account renewal
- 20 Nov 2019 + 1 Dec 2019
- -26.7 IOV + - + 100 IOV
- To - - tiov18c8a...4cl27 + Add certificate to account
- 18 Oct 2019 + 1 Dec 2019
- -101.7 IOV + - + 100 IOV
- To - - tiov18c8a...4cl27 + Fees update for accounts
- 16 Sep 2019 + 1 Dec 2019
- -26.7 IOV + - + 100 IOV
- From - - 465277250...8600L + Delete certificate from account
- 14 Aug 2019 + 1 Dec 2019
- +10.5 LSK + - + 100 IOV
- To - - tiov18c8a...4cl27 + Account configuration update
- 12 Jul 2019 + 1 Dec 2019
- -101.7 IOV + - + 100 IOV
- 10 Jun 2018 + 20 Nov 2019
- Personalized address registration + To + + tiov18c8a...4cl27
- 9 May 2018 + 18 Oct 2019
- - - 100 IOV + -101.7 IOV
- Personalized address registration + To + + tiov18c8a...4cl27
- 7 Apr 2018 + 16 Sep 2019
- - - 100 IOV + -26.7 IOV
-
+
- -
-
-
+
- This is an unknown transaction -
+
+ From + + 465277250...8600L +
+
+
- The transaction ID is: - 8005F02D43FA06E7D0585FB64C961D57E318B27A145C857BCD3A6BDB413FF7FC + 14 Aug 2019
+
+
+
+ +10.5 LSK +
+
+
+ Sorting
+
+
-
-
To - tiov16cmj...7r2tc + tiov18c8a...4cl27
- 3 Feb 2018 + 12 Jul 2019
- -8.6 IOV + -101.7 IOV
- From + To - 0x979a731...31bdA + tiov18c8a...4cl27
- 1 Jan 2018 + 10 Jun 2018
- +10.5 ETH + -26.7 IOV
-
-
, ] `; From 2c4a1b6677e29abe6e237b639cc420e46569598d Mon Sep 17 00:00:00 2001 From: abefernan Date: Fri, 6 Mar 2020 10:36:28 +0100 Subject: [PATCH 117/204] Updates Travis config for milestone branches support --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4d42c461d..aed56a29d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: node_js dist: xenial node_js: -# Use Node.js >= 12.x since we got problems with exceeding the default 1400MB -# memory limit in Node.js 10 during webpack builds. -# See also https://developer.ibm.com/articles/nodejs-memory-management-in-container-environments/ + # Use Node.js >= 12.x since we got problems with exceeding the default 1400MB + # memory limit in Node.js 10 during webpack builds. + # See also https://developer.ibm.com/articles/nodejs-memory-management-in-container-environments/ - "12.15.0" sudo: required @@ -41,6 +41,7 @@ script: branches: only: - master + - /^milestone\/.+$/ # Minor version branches: 0.9, 0.10, 1.2 etc. - /^[0-9]+\.[0-9]+$/ # Tag builds: v0.9.1, v1.2.3-alpha456+build789 etc. From 2378da96609ccbe2ae1664bca16cd1854dc0bd88 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 10:35:30 +0100 Subject: [PATCH 118/204] Skip tests that will be reimplemented in #1039 --- packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts b/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts index dfb5fd0b7..b8c64ecb3 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts +++ b/packages/bierzo-wallet/src/routes/addresses/index.e2e.spec.ts @@ -84,7 +84,7 @@ withChainsDescribe("E2E > Receive Payment route", () => { }, 35000); }); - describe("Starnames tab", () => { + describe.skip("Starnames tab", () => { let username: string; beforeEach(async () => { await travelToStarnamesTabE2E(page); From 4d7e3e8af987933d5b18859c1f5651063a34fb42 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 16:41:51 +0100 Subject: [PATCH 119/204] Improve url naming --- packages/bierzo-wallet/src/routes/paths.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index 11dcbda92..35824174e 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -4,8 +4,8 @@ export const TRANSACTIONS_ROUTE = "/transactions"; export const BALANCE_ROUTE = "/balance"; export const CONFIRM_TRANSACTION_ROUTE = "/confirm-transaction"; export const ADDRESSES_ROUTE = "/addresses"; -export const REGISTER_IOVNAME_ROUTE = "/register-iovname"; -export const REGISTER_STARNAME_ROUTE = "/register-starname"; -export const REGISTER_NAME_ROUTE = "/register-name"; +export const REGISTER_IOVNAME_ROUTE = "/iovname/register"; +export const REGISTER_STARNAME_ROUTE = "/starname/register"; +export const REGISTER_NAME_ROUTE = "/name/register"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; From 92c66ff496a9baae09dc95753a4bdb93384e0d86 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 16:42:07 +0100 Subject: [PATCH 120/204] Compare names with localeCompare --- .../src/routes/addresses/components/IovnamesExists.tsx | 6 +----- .../src/routes/addresses/components/StarnamesExists.tsx | 8 +++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 7dc1ce253..54bac677d 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -50,11 +50,7 @@ function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { {iovnames .slice() - .sort((a, b) => { - if (a.username < b.username) return -1; - if (a.username > b.username) return 1; - return 0; - }) + .sort((a, b) => a.username.localeCompare(b.username, undefined, { sensitivity: "base" })) .map(iovname => { const onManage = (): void => { history.push(REGISTER_IOVNAME_ROUTE, iovname); diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 20b7ba5d2..432f33997 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -62,11 +62,9 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element {starnames .slice() - .sort((a, b) => { - if (`${a.name}*${a.domain}` < `${b.name}*${b.domain}`) return -1; - if (`${a.name}*${a.domain}` > `${b.name}*${b.domain}`) return 1; - return 0; - }) + .sort((a, b) => + `${a.name}*${a.domain}`.localeCompare(`${b.name}*${b.domain}`, undefined, { sensitivity: "base" }), + ) .map(starname => { const onManage = (): void => { history.push(REGISTER_STARNAME_ROUTE, starname); From 0b31e72e89419e14dd008e718132db60c6cc621c Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 17:09:56 +0100 Subject: [PATCH 121/204] Removes faulty route introduced when rebasing --- .../src/routes/registerStarName/index.tsx | 34 ------------------- 1 file changed, 34 deletions(-) delete mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx deleted file mode 100644 index db8da3f36..000000000 --- a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Block, makeStyles, Typography } from "medulas-react-components"; -import React from "react"; - -import PageMenu from "../../components/PageMenu"; - -const useStyles = makeStyles({ - usernameHeader: { - boxShadow: "0px 0px 14px #EDEFF4", - }, -}); - -// TODO move to components when implemented, mirroring registerName -export function NoStarnameHeader(): JSX.Element { - const classes = useStyles(); - return ( - - - *yourstarname - - - ); -} - -const RegisterStarname = (): JSX.Element => { - return ( - - - Register new starname. Work in progress view - - - ); -}; - -export default RegisterStarname; From 3909f911d64cd9eb8a8df71534019725d09153e4 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 9 Mar 2020 17:46:14 +0100 Subject: [PATCH 122/204] Updates storybook snapshot --- .../src/__snapshots__/Storyshots.test.js.snap | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 3d7090d24..672b442b2 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1882,7 +1882,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames tab 1`] = ` />
Choose Now @@ -1925,7 +1925,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames with name tab 1`] = `

Register now @@ -2100,7 +2100,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with extension 1`] = ` />

Register Now @@ -2208,7 +2208,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with ledger 1`] = `

starname

@@ -2332,7 +2332,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = ` />
Register Now @@ -2712,7 +2712,7 @@ exports[`Storyshots Bierzo Wallet/Balance View on ledger and without name 1`] =

iovnames

@@ -2954,7 +2954,7 @@ exports[`Storyshots Bierzo Wallet/Balance View without tokens and without name 1 />
Choose Now From 7a26ac90758c7acd540be402264f03a55986589b Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 11 Mar 2020 12:36:41 +0100 Subject: [PATCH 123/204] Fix invalid selector in e2e test --- .../src/routes/addresses/components/IovnamesNotExists.tsx | 6 ++++-- .../src/routes/balance/test/operateBalances.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx index 8cbc90c0f..c1c4307a2 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx @@ -7,6 +7,8 @@ import { RpcEndpointType } from "../../../communication/rpcEndpoint"; import { REGISTER_IOVNAME_ROUTE } from "../../paths"; import { NoIovnameHeader } from "../../register/components/IovnameForm"; +export const registerIovnameId = REGISTER_IOVNAME_ROUTE.replace(/\//g, "-"); + interface StarnamesNotExistsProps { readonly onRegisterIovname: () => void; readonly rpcEndpointType: RpcEndpointType; @@ -28,7 +30,7 @@ export function GetYourAddressWithExtension({ You can not register - + iovnames diff --git a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts index b0187d763..b2427768e 100644 --- a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts +++ b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts @@ -2,7 +2,7 @@ import { Browser, ElementHandle, Page } from "puppeteer"; import { randomString, sleep, whenTrue } from "ui-logic"; import { acceptEnqueuedRequest } from "../../../utils/test/persona"; -import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { registerIovnameId } from "../../addresses/components/IovnamesNotExists"; import { REGISTER_IOVNAME_FIELD } from "../../register/components/IovnameForm"; const mainMenuH6Elements = 3; @@ -42,7 +42,7 @@ export const getAddressCreationPromptE2E = async (h6Elements: ElementHandle => { - await page.click(`#${REGISTER_IOVNAME_ROUTE.replace("/", "\\/")}`); + await page.click(`#${registerIovnameId}`); // Fill the form await sleep(1000); From b39742eda4686857782dc2c51de23b20f1d78ff9 Mon Sep 17 00:00:00 2001 From: abefernan Date: Wed, 11 Mar 2020 12:48:03 +0100 Subject: [PATCH 124/204] Updates storybook snapshots --- .../src/__snapshots__/Storyshots.test.js.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 672b442b2..04eb75993 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1882,7 +1882,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Iovnames tab 1`] = ` />
Choose Now @@ -2712,7 +2712,7 @@ exports[`Storyshots Bierzo Wallet/Balance View on ledger and without name 1`] =

iovnames

@@ -2954,7 +2954,7 @@ exports[`Storyshots Bierzo Wallet/Balance View without tokens and without name 1 />
Choose Now From 95e2b925df613801cadc8dec13cf161e3b1bc8a2 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 2 Mar 2020 10:41:04 +0100 Subject: [PATCH 125/204] Adds starnames to listing storybook --- .../src/routes/addresses/index.stories.tsx | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index 40f2519f1..6412dba4d 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -4,14 +4,18 @@ import { storiesOf } from "@storybook/react"; import React from "react"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import { BwAccount } from "../../store/accounts"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { REGISTER_IOVNAME_REGISTRATION_STORY_PATH, REGISTER_IOVNAME_STORY_PATH, + REGISTER_STARNAME_REGISTRATION_STORY_PATH, + REGISTER_STARNAME_STORY_PATH, } from "../register/index.stories"; import { BwUsernameWithChainName } from "."; import AddressesTab from "./components/AddressesTab"; import Iovnames from "./components/Iovnames"; +import Starnames from "./components/Starnames"; import UserAddresses from "./components/UserAddresses"; const chainAddresses: ChainAddressPairWithName[] = [ @@ -32,7 +36,7 @@ const chainAddresses: ChainAddressPairWithName[] = [ }, ]; -const usernames: readonly BwUsernameWithChainName[] = [ +const ivonames: readonly BwUsernameWithChainName[] = [ { username: "test1*iov", addresses: [chainAddresses[0]], @@ -47,6 +51,29 @@ const usernames: readonly BwUsernameWithChainName[] = [ }, ]; +const defaultExpiryDate = new Date(new Date().getTime() + 1000000000); + +const starnames: readonly BwAccount[] = [ + { + domain: "domain1", + name: "name1", + expiryDate: defaultExpiryDate, + addresses: [chainAddresses[0]], + }, + { + domain: "domain2", + name: "name2", + expiryDate: defaultExpiryDate, + addresses: [chainAddresses[0]], + }, + { + domain: "domain1", + name: "name2", + expiryDate: defaultExpiryDate, + addresses: [chainAddresses[0]], + }, +]; + storiesOf(`${bierzoRoot}/Addresses`, module) .addParameters({ viewport: { defaultViewport: "responsive" } }) .add("Main with extension", () => ( @@ -65,8 +92,8 @@ storiesOf(`${bierzoRoot}/Addresses`, module) {}} rpcEndpointType="extension" @@ -102,9 +129,18 @@ storiesOf(`${bierzoRoot}/Addresses`, module) .add("Iovnames with name tab", () => ( + )) + .add("Starnames with name tab", () => ( + + + )); From e9e02d17839ec5ba86d2b050631728556172f8b5 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 2 Mar 2020 10:41:32 +0100 Subject: [PATCH 126/204] Adapts forms to tests --- .../src/routes/register/components/IovnameForm.tsx | 7 +++++-- .../src/routes/register/components/StarnameForm.tsx | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx index c8f98f74a..95920563b 100644 --- a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx @@ -68,8 +68,8 @@ export function NoIovnameHeader(): JSX.Element { interface Props extends AddressesTableProps { readonly onCancel: () => void; readonly iovnameAddresses: BwUsernameWithChainName | undefined; - readonly bnsIdentity: Identity; - readonly rpcEndpoint: RpcEndpoint; + readonly bnsIdentity: Identity | undefined; + readonly rpcEndpoint: RpcEndpoint | undefined; readonly transactionFee: Fee | undefined; readonly setTransactionId: React.Dispatch>; } @@ -94,6 +94,9 @@ const IovnameForm = ({ }, [chainAddresses, iovnameAddresses]); const onSubmit = async (values: object): Promise => { + if (!bnsIdentity) throw Error("No bnsIdentity found for submit"); + if (!rpcEndpoint) throw Error("No rpcEndpoint found for submit"); + const formValues = values as FormValues; const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); diff --git a/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx index 9247cd439..36c2318a3 100644 --- a/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx @@ -54,8 +54,8 @@ export function NoStarnameHeader(): JSX.Element { interface Props { readonly onCancel: () => void; readonly iovnameAddresses: BwUsernameWithChainName | undefined; - readonly bnsIdentity: Identity; - readonly rpcEndpoint: RpcEndpoint; + readonly bnsIdentity: Identity | undefined; + readonly rpcEndpoint: RpcEndpoint | undefined; readonly transactionFee: Fee | undefined; readonly setTransactionId: React.Dispatch>; } @@ -72,6 +72,9 @@ const StarnameForm = ({ const toast = React.useContext(ToastContext); const onSubmit = async (values: object): Promise => { + if (!bnsIdentity) throw Error("No bnsIdentity found for submit"); + if (!rpcEndpoint) throw Error("No rpcEndpoint found for submit"); + const formValues = values as FormValues; const domain = formValues[REGISTER_STARNAME_FIELD].split("*")[1]; From 63abe0001749de73f34be405e0da8598330e2ac6 Mon Sep 17 00:00:00 2001 From: abefernan Date: Mon, 2 Mar 2020 10:41:49 +0100 Subject: [PATCH 127/204] Adds forms to storybook tests --- .../src/routes/register/index.stories.tsx | 68 +++++++++++++++---- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/register/index.stories.tsx b/packages/bierzo-wallet/src/routes/register/index.stories.tsx index 52793d583..d20b7047a 100644 --- a/packages/bierzo-wallet/src/routes/register/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/register/index.stories.tsx @@ -1,18 +1,27 @@ -import { TransactionId } from "@iov/bcp"; +import { Address, ChainId, Fee, Token, TokenTicker, TransactionId } from "@iov/bcp"; import { linkTo } from "@storybook/addon-links"; import { storiesOf } from "@storybook/react"; import React from "react"; +import { stringToAmount } from "ui-logic"; +import { ChainAddressPairWithName } from "../../components/AddressesTable"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; +import { BALANCE_STORY_PATH, BALANCE_STORY_VIEW_PATH } from "../balance/index.stories"; import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../transactions/index.stories"; import ConfirmRegistration from "./components/ConfirmRegistration"; +import IovnameForm from "./components/IovnameForm"; +import StarnameForm from "./components/StarnameForm"; export const REGISTER_IOVNAME_STORY_PATH = `${bierzoRoot}/Register Iovname`; export const REGISTER_IOVNAME_REGISTRATION_STORY_PATH = "Register Iovname"; -// const REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Username without fee"; -const REGISTER_IOVNAME_CONFIRMATION_STORY_PATH = "Registration confirmation"; +const REGISTER_IOVNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Iovname without fee"; +export const REGISTER_STARNAME_STORY_PATH = `${bierzoRoot}/Register Starname`; +export const REGISTER_STARNAME_REGISTRATION_STORY_PATH = "Register Starname"; +const REGISTER_STARNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Starname without fee"; +const REGISTER_NAME_CONFIRMATION_STORY_PATH_ROOT = `${bierzoRoot}/Registration confirmation`; +const REGISTER_NAME_CONFIRMATION_STORY_PATH = "Registration confirmation"; -/* const addresses: ChainAddressPairWithName[] = [ +const addresses: ChainAddressPairWithName[] = [ { chainId: "local-iov-devnet" as ChainId, address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, @@ -37,32 +46,67 @@ const iov: Pick = { const fee: Fee = { tokens: stringToAmount("5", iov), -}; */ +}; storiesOf(REGISTER_IOVNAME_STORY_PATH, module) .addParameters({ viewport: { defaultViewport: "responsive" } }) - // TODO adapt this stories to new components - /* .add(REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( + .add(REGISTER_IOVNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( {}} /> )) - .add(REGISTER_USERNAME_REGISTRATION_STORY_PATH, () => ( + .add(REGISTER_IOVNAME_REGISTRATION_STORY_PATH, () => ( {}} + /> + + )); + +storiesOf(REGISTER_STARNAME_STORY_PATH, module) + .addParameters({ viewport: { defaultViewport: "responsive" } }) + .add(REGISTER_STARNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( + + {}} + /> + + )) + .add(REGISTER_STARNAME_REGISTRATION_STORY_PATH, () => ( + + {}} /> - )) */ - .add(REGISTER_IOVNAME_CONFIRMATION_STORY_PATH, () => ( + )); + +storiesOf(REGISTER_NAME_CONFIRMATION_STORY_PATH_ROOT, module) + .addParameters({ viewport: { defaultViewport: "responsive" } }) + .add(REGISTER_NAME_CONFIRMATION_STORY_PATH, () => ( Date: Mon, 2 Mar 2020 10:41:58 +0100 Subject: [PATCH 128/204] Updates storybook snapshots --- .../src/__snapshots__/Storyshots.test.js.snap | 1767 ++++++++++++++++- 1 file changed, 1753 insertions(+), 14 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 04eb75993..f872eec22 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -2299,34 +2299,251 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = `
+
+
+
+ Iovname Logo +
+
+ Register a new starname +
+
+

+ Register now +

+
+ Register your name +
+
+
+
+
+ name1*domain1 +
+
- *yourstarname + Expires on + 3/13/2020 +
+
+
+ Manage +
+
+
+
+
+
+
+
+ name2*domain1 +
+
+
+ Expires on + 3/13/2020 +
+
+
+ Manage +
+
+
+
+
+
+
+
+ name2*domain2 +
+
+
+ Expires on + 3/13/2020
+
+ Manage +
+
+
+
+
+`; + +exports[`Storyshots Bierzo Wallet/Addresses Starnames with name tab 1`] = ` +
+
+
+
+
+ Iovname Logo +
+
+ Register a new starname +
+
+

+ Register now +

+
+ Register your name +
+
+
+
+
+
+
+
+ name1*domain1 +
- Register your starname + Expires on + 3/13/2020
-

+

+ Manage +
+
+
+
+
+
+
+
- A starname is your universal username for the blockchain world. It enables you to receive crypto-currencies or to log in to blockchain applications in a seamless way. Transferring value becomes fast an easy. -

+ name2*domain1 +
@@ -2335,15 +2552,51 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = ` id="/starname/register" onClick={[Function]} > - Register Now + Expires on + 3/13/2020
+
+
+ Manage +
+
+
+
+
+
+
+
+ name2*domain2 +
+
- Register your name + Expires on + 3/13/2020
+
+ Manage +
@@ -4845,7 +5098,1493 @@ exports[`Storyshots Bierzo Wallet/Payment Verified Recipient 1`] = `
`; -exports[`Storyshots Bierzo Wallet/Register Iovname Registration confirmation 1`] = ` +exports[`Storyshots Bierzo Wallet/Register Iovname Register Iovname 1`] = ` +
+
+
+
+
+
+ shield +
+
+
+
+ Create your iovname +
+
+
+ Info +
+
+
+ How it works +
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+
+

+ CHOOSE LINKED ADDRESSES +

+
+
+
+
+ Info +
+
+
+
+
+
+ Optional +
+
+ + + + + + + + + + + + + + + +
+
+
+
+
+ +
+ Phone Menu +
+
+
+
+ +
+ + + +
+
+
+
+
+

+ Remove +

+
+
+
+
+
+ +
+ Phone Menu +
+
+
+
+ +
+ + + +
+
+
+
+
+

+ Remove +

+
+
+
+
+
+ +
+ Phone Menu +
+
+
+
+ +
+ + + +
+
+
+
+
+

+ Remove +

+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +`; + +exports[`Storyshots Bierzo Wallet/Register Iovname Register Iovname without fee 1`] = ` +
+
+
+
+
+
+ shield +
+
+
+
+ Create your iovname +
+
+
+ Info +
+
+
+ How it works +
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+
+

+ CHOOSE LINKED ADDRESSES +

+
+
+
+
+ Info +
+
+
+
+
+
+ Optional +
+
+ + + + + + + + + + + + + + + +
+
+
+
+
+ +
+ Phone Menu +
+
+
+
+ +
+ + + +
+
+
+
+
+

+ Remove +

+
+
+
+
+
+ +
+ Phone Menu +
+
+
+
+ +
+ + + +
+
+
+
+
+

+ Remove +

+
+
+
+
+
+ +
+ Phone Menu +
+
+
+
+ +
+ + + +
+
+
+
+
+

+ Remove +

+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +`; + +exports[`Storyshots Bierzo Wallet/Register Starname Register Starname 1`] = ` +
+
+
+
+
+
+ shield +
+
+
+
+ Register your starname +
+
+
+ Info +
+
+
+ How it works +
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +`; + +exports[`Storyshots Bierzo Wallet/Register Starname Register Starname without fee 1`] = ` +
+
+
+
+
+
+ shield +
+
+
+
+ Register your starname +
+
+
+ Info +
+
+
+ How it works +
+
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +`; + +exports[`Storyshots Bierzo Wallet/Registration confirmation Registration confirmation 1`] = `
Date: Wed, 11 Mar 2020 16:13:37 +0100 Subject: [PATCH 129/204] Updates storybook snapshots after rebase --- .../src/__snapshots__/Storyshots.test.js.snap | 680 +----------------- 1 file changed, 23 insertions(+), 657 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index f872eec22..e8c055960 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -2324,7 +2324,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = `

Register now @@ -2361,7 +2361,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = ` className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-subtitle2 MuiTypography-colorTextPrimary" > Expires on - 3/13/2020 + 3/23/2020

Expires on - 3/13/2020 + 3/23/2020
Expires on - 3/13/2020 + 3/23/2020

Register now @@ -2516,7 +2516,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Starnames with name tab 1`] = ` className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-subtitle2 MuiTypography-colorTextPrimary" > Expires on - 3/13/2020 + 3/23/2020

Expires on - 3/13/2020 + 3/23/2020
Expires on - 3/13/2020 + 3/23/2020
- - -
-
-
-
- -
- Phone Menu -
-
-
-
- -
- - - -
-
-
-
- - -

- Remove -

- - - - -
-
-
-
- -
- Phone Menu -
-
-
-
- -
- - - -
-
-
-
- - -

- Remove -

- - - - -
-
-
-
- -
- Phone Menu -
-
-
-
- -
- - - -
-
-
-
- - -

- Remove -

- - - + /> +

+ + Add more +

@@ -5825,330 +5507,14 @@ exports[`Storyshots Bierzo Wallet/Register Iovname Register Iovname without fee > - - -
-
-
-
- -
- Phone Menu -
-
-
-
- -
- - - -
-
-
-
- - -

- Remove -

- - - - -
-
-
-
- -
- Phone Menu -
-
-
-
- -
- - - -
-
-
-
- - -

- Remove -

- - - - -
-
-
-
- -
- Phone Menu -
-
-
-
- -
- - - -
-
-
-
- - -

- Remove -

- - - + /> +

+ + Add more +

From 2262e52ed7bf818479a825fc24e54d4715148473 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 4 Mar 2020 15:51:40 +0200 Subject: [PATCH 130/204] Changes from previous branch --- .../src/routes/addresses/index.tsx | 41 +++++++++++++++++-- .../src/routes/registerStarName/index.tsx | 34 +++++++++++++++ 2 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index e2d952985..7673d6031 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -4,6 +4,7 @@ import * as ReactRedux from "react-redux"; import { history } from ".."; import { ChainAddressPairWithName } from "../../components/AddressesTable"; import PageMenu from "../../components/PageMenu"; +import { getChainName } from "../../config"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { BwUsername } from "../../store/usernames"; @@ -25,6 +26,41 @@ function onRegisterStarname(): void { const Addresses = (): JSX.Element => { const identities = ReactRedux.useSelector((state: RootState) => state.identities); + const bwNames = ReactRedux.useSelector((state: RootState) => state.usernames); + const starnames = ReactRedux.useSelector((state: RootState) => state.accounts); + const rpcEndpointType = ReactRedux.useSelector(getRpcEndpointType); + const [bwNamesWithChain, setBwNamesWithChain] = React.useState([]); + + React.useEffect(() => { + let isSubscribed = true; + async function insertChainNames(): Promise { + if (isSubscribed) { + const bwNamesWithChain: BwUsernameWithChainName[] = await Promise.all( + bwNames.map(async name => { + return { + username: name.username, + addresses: await Promise.all( + name.addresses.map(async address => { + return { + chainId: address.chainId, + address: address.address, + chainName: await getChainName(address.chainId), + }; + }), + ), + }; + }), + ); + + setBwNamesWithChain(bwNamesWithChain); + } + } + insertChainNames(); + + return () => { + isSubscribed = false; + }; + }, [bwNames]); const supportedChains = React.useMemo( () => @@ -36,17 +72,14 @@ const Addresses = (): JSX.Element => { ); const chainAddresses = getChainAddressPairWithNames(identities, supportedChains); - const iovnames = ReactRedux.useSelector((state: RootState) => state.usernames); - const starnames = ReactRedux.useSelector((state: RootState) => state.accounts); - const rpcEndpointType = ReactRedux.useSelector(getRpcEndpointType); return ( diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx new file mode 100644 index 000000000..db8da3f36 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx @@ -0,0 +1,34 @@ +import { Block, makeStyles, Typography } from "medulas-react-components"; +import React from "react"; + +import PageMenu from "../../components/PageMenu"; + +const useStyles = makeStyles({ + usernameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +// TODO move to components when implemented, mirroring registerName +export function NoStarnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + *yourstarname + + + ); +} + +const RegisterStarname = (): JSX.Element => { + return ( + + + Register new starname. Work in progress view + + + ); +}; + +export default RegisterStarname; From b137b3a336b6590f9f54098bfcabbbb7ae7192ab Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 17 Feb 2020 15:53:07 +0200 Subject: [PATCH 131/204] Add local eslint support --- yarn.lock | 360 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 333 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2f7f729ca..a953f2109 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4622,6 +4622,17 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/eslint-plugin@^2.19.2": + version "2.19.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.2.tgz#e279aaae5d5c1f2547b4cff99204e1250bc7a058" + integrity sha512-HX2qOq2GOV04HNrmKnTpSIpHjfl7iwdXe3u/Nvt+/cpmdvzYvY0NHSiTkYN257jHnq4OM/yo+OsFgati+7LqJA== + dependencies: + "@typescript-eslint/experimental-utils" "2.19.2" + eslint-utils "^1.4.3" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + tsutils "^3.17.1" + "@typescript-eslint/eslint-plugin@^2.8.0": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz#a522d0e1e4898f7c9c6a8e1ed3579b60867693fa" @@ -4642,6 +4653,25 @@ "@typescript-eslint/typescript-estree" "2.20.0" eslint-scope "^5.0.0" +"@typescript-eslint/experimental-utils@2.19.2": + version "2.19.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.2.tgz#4611d44cf0f0cb460c26aa7676fc0a787281e233" + integrity sha512-B88QuwT1wMJR750YvTJBNjMZwmiPpbmKYLm1yI7PCc3x0NariqPwqaPsoJRwU9DmUi0cd9dkhz1IqEnwfD+P1A== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.19.2" + eslint-scope "^5.0.0" + +"@typescript-eslint/parser@^2.19.2": + version "2.19.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.19.2.tgz#21f42c0694846367e7d6a907feb08ab2f89c0879" + integrity sha512-8uwnYGKqX9wWHGPGdLB9sk9+12sjcdqEEYKGgbS8A0IvYX59h01o8os5qXUHMq2na8vpDRaV0suTLM7S8wraTA== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.19.2" + "@typescript-eslint/typescript-estree" "2.19.2" + eslint-visitor-keys "^1.1.0" + "@typescript-eslint/parser@^2.8.0": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.20.0.tgz#608e5bb06ba98a415b64ace994c79ab20f9772a9" @@ -4665,6 +4695,19 @@ semver "^6.3.0" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@2.19.2": + version "2.19.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.2.tgz#67485b00172f400474d243c6c0be27581a579350" + integrity sha512-Xu/qa0MDk6upQWqE4Qy2X16Xg8Vi32tQS2PR0AvnT/ZYS4YGDvtn2MStOh5y8Zy2mg4NuL06KUHlvCh95j9C6Q== + dependencies: + debug "^4.1.1" + eslint-visitor-keys "^1.1.0" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^6.3.0" + tsutils "^3.17.1" + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -5442,6 +5485,15 @@ array-includes@^3.0.3: define-properties "^1.1.2" es-abstract "^1.7.0" +array-includes@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.1.tgz#cdd67e6852bdf9c1215460786732255ed2459348" + integrity sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0" + is-string "^1.0.5" + array-map@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" @@ -6797,10 +6849,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001022: - version "1.0.30001022" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001022.tgz#9eeffe580c3a8f110b7b1742dcf06a395885e4c6" - integrity sha512-FjwPPtt/I07KyLPkBQ0g7/XuZg6oUkYBVnPHNj3VHJbOjmmJ/GdSo/GUY6MwINEQvjhP6WZVbX8Tvms8xh0D5A== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000980, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30000984, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001010: + version "1.0.30001027" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001027.tgz#283e2ef17d94889cc216a22c6f85303d78ca852d" + integrity sha512-7xvKeErvXZFtUItTHgNtLgS9RJpVnwBlWX8jSo/BO8VsF6deszemZSkJJJA1KOKrXuzZH4WALpAJdq5EyfgMLg== canvg@1.5.3: version "1.5.3" @@ -8984,6 +9036,23 @@ es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13 is-regex "^1.0.4" object-keys "^1.0.12" +es-abstract@^1.17.0, es-abstract@^1.17.0-next.1: + version "1.17.4" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184" + integrity sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.1.5" + is-regex "^1.0.5" + object-inspect "^1.7.0" + object-keys "^1.1.1" + object.assign "^4.1.0" + string.prototype.trimleft "^2.1.1" + string.prototype.trimright "^2.1.1" + es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" @@ -8993,6 +9062,15 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.51, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.51" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.51.tgz#ed2d7d9d48a12df86e0299287e93a09ff478842f" @@ -9139,13 +9217,20 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-prettier@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.2.0.tgz#80e0b8714e3f6868c4ac2a25fbf39c02e73527a7" - integrity sha512-VLsgK/D+S/FEsda7Um1+N8FThec6LqE3vhcMyp8mlmto97y3fGf3DX7byJexGuOb1QY0Z/zz222U5t+xSfcZDQ== +eslint-config-prettier@^6.10.0: + version "6.10.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz#7b15e303bf9c956875c948f6b21500e48ded6a7f" + integrity sha512-AtndijGte1rPILInUdHjvKEGbIV06NuvPrqlIEaEaWtbtvJh464mDeyGMdZEQMsGvC0ZVkiex1fSNcC4HAbRGg== dependencies: get-stdin "^6.0.0" +eslint-config-react-app@5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.2.0.tgz#135110ba56a9e378f7acfe5f36e2ae76a2317899" + integrity sha512-WrHjoGpKr1kLLiWDD81tme9jMM0hk5cMxasLSdyno6DdPt+IfLOrDJBVo6jN7tn4y1nzhs43TmUaZWO6Sf0blw== + dependencies: + confusing-browser-globals "^1.0.9" + eslint-config-react-app@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.1.0.tgz#a37b3f2d4f56f856f93277281ef52bd791273e63" @@ -9180,6 +9265,14 @@ eslint-module-utils@^2.4.0: debug "^2.6.8" pkg-dir "^2.0.0" +eslint-module-utils@^2.4.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.5.2.tgz#7878f7504824e1b857dd2505b59a8e5eda26a708" + integrity sha512-LGScZ/JSlqGKiT8OC+cYRxseMjyqt6QO54nl281CK93unD89ijSeRV6An8Ci/2nvWVKe8K/Tqdm75RQoIOCr+Q== + dependencies: + debug "^2.6.9" + pkg-dir "^2.0.0" + eslint-plugin-flowtype@3.13.0: version "3.13.0" resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.13.0.tgz#e241ebd39c0ce519345a3f074ec1ebde4cf80f2c" @@ -9187,6 +9280,13 @@ eslint-plugin-flowtype@3.13.0: dependencies: lodash "^4.17.15" +eslint-plugin-flowtype@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-4.6.0.tgz#82b2bd6f21770e0e5deede0228e456cb35308451" + integrity sha512-W5hLjpFfZyZsXfo5anlu7HM970JBDqbEshAJUkeczP6BFCIfJXuiIBQXyberLRtOStT0OGPF8efeTbxlHk4LpQ== + dependencies: + lodash "^4.17.15" + eslint-plugin-import@2.18.2: version "2.18.2" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz#02f1180b90b077b33d447a17a2326ceb400aceb6" @@ -9204,7 +9304,25 @@ eslint-plugin-import@2.18.2: read-pkg-up "^2.0.0" resolve "^1.11.0" -eslint-plugin-jsx-a11y@6.2.3: +eslint-plugin-import@^2.20.1: + version "2.20.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz#802423196dcb11d9ce8435a5fc02a6d3b46939b3" + integrity sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw== + dependencies: + array-includes "^3.0.3" + array.prototype.flat "^1.2.1" + contains-path "^0.1.0" + debug "^2.6.9" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.4.1" + has "^1.0.3" + minimatch "^3.0.4" + object.values "^1.1.0" + read-pkg-up "^2.0.0" + resolve "^1.12.0" + +eslint-plugin-jsx-a11y@6.2.3, eslint-plugin-jsx-a11y@^6.2.3: version "6.2.3" resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.3.tgz#b872a09d5de51af70a97db1eea7dc933043708aa" integrity sha512-CawzfGt9w83tyuVekn0GDPU9ytYtxyxyFZ3aSWROmnRRFQFT2BiPJd7jvRdzNDi6oLWaS2asMeYSNMjWTV4eNg== @@ -9226,10 +9344,10 @@ eslint-plugin-no-unsafe-innerhtml@1.0.16: dependencies: eslint "^3.7.1" -eslint-plugin-prettier@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d" - integrity sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA== +eslint-plugin-prettier@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" + integrity sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA== dependencies: prettier-linter-helpers "^1.0.0" @@ -9238,6 +9356,11 @@ eslint-plugin-react-hooks@^1.6.1: resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04" integrity sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA== +eslint-plugin-react-hooks@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.3.0.tgz#53e073961f1f5ccf8dd19558036c1fac8c29d99a" + integrity sha512-gLKCa52G4ee7uXzdLiorca7JIQZPPXRAQDXV83J4bUEeUuc5pIEyZYAZ45Xnxe5IuupxEqHS+hUhSLIimK1EMw== + eslint-plugin-react@7.16.0: version "7.16.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.16.0.tgz#9928e4f3e2122ed3ba6a5b56d0303ba3e41d8c09" @@ -9253,6 +9376,22 @@ eslint-plugin-react@7.16.0: prop-types "^15.7.2" resolve "^1.12.0" +eslint-plugin-react@^7.18.3: + version "7.18.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.18.3.tgz#8be671b7f6be095098e79d27ac32f9580f599bc8" + integrity sha512-Bt56LNHAQCoou88s8ViKRjMB2+36XRejCQ1VoLj716KI1MoE99HpTVvIThJ0rvFmG4E4Gsq+UgToEjn+j044Bg== + dependencies: + array-includes "^3.1.1" + doctrine "^2.1.0" + has "^1.0.3" + jsx-ast-utils "^2.2.3" + object.entries "^1.1.1" + object.fromentries "^2.0.2" + object.values "^1.1.1" + prop-types "^15.7.2" + resolve "^1.14.2" + string.prototype.matchall "^4.0.2" + eslint-plugin-simple-import-sort@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-4.0.0.tgz#048736c170b9b43f0a8c3ef85ba53881c389f3ff" @@ -9337,6 +9476,49 @@ eslint@5.16.0: table "^5.2.3" text-table "^0.2.0" +eslint@6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" + integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.10.0" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^5.0.0" + eslint-utils "^1.4.3" + eslint-visitor-keys "^1.1.0" + espree "^6.1.2" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^7.0.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.14" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.3" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" + table "^5.2.3" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + eslint@^3.7.1: version "3.19.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" @@ -11036,6 +11218,11 @@ has-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= +has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -11724,6 +11911,15 @@ internal-ip@^4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" +internal-slot@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.2.tgz#9c2e9fb3cd8e5e4256c6f45fe310067fcfa378a3" + integrity sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g== + dependencies: + es-abstract "^1.17.0-next.1" + has "^1.0.3" + side-channel "^1.0.2" + interpret@^1.0.0, interpret@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -11854,6 +12050,11 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== +is-callable@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" + integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== + is-ci@^1.0.10: version "1.2.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" @@ -12175,6 +12376,13 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-regex@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" + integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== + dependencies: + has "^1.0.3" + is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" @@ -12234,6 +12442,11 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + is-svg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" @@ -13306,6 +13519,14 @@ jsx-ast-utils@^2.2.1: array-includes "^3.0.3" object.assign "^4.1.0" +jsx-ast-utils@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz#8a9364e402448a3ce7f14d357738310d9248054f" + integrity sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA== + dependencies: + array-includes "^3.0.3" + object.assign "^4.1.0" + jszip@^2.4.0: version "2.6.1" resolved "https://registry.yarnpkg.com/jszip/-/jszip-2.6.1.tgz#b88f3a7b2e67a2a048152982c7a3756d9c4828f0" @@ -15229,7 +15450,12 @@ object-hash@^1.3.1: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df" integrity sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA== -object-keys@^1.0.11, object-keys@^1.0.12: +object-inspect@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== + +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -15266,6 +15492,16 @@ object.entries@^1.1.0: function-bind "^1.1.1" has "^1.0.3" +object.entries@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.1.tgz#ee1cf04153de02bb093fec33683900f57ce5399b" + integrity sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + object.fromentries@^2.0.0, "object.fromentries@^2.0.0 || ^1.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" @@ -15276,6 +15512,16 @@ object.fromentries@^2.0.0, "object.fromentries@^2.0.0 || ^1.0.0": function-bind "^1.1.1" has "^1.0.1" +object.fromentries@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.2.tgz#4a09c9b9bb3843dd0f89acdb517a794d4f355ac9" + integrity sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -15301,6 +15547,16 @@ object.values@^1.1.0: function-bind "^1.1.1" has "^1.0.3" +object.values@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e" + integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + function-bind "^1.1.1" + has "^1.0.3" + obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -17981,6 +18237,14 @@ regexp.prototype.flags@^1.2.0: dependencies: define-properties "^1.1.2" +regexp.prototype.flags@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" + integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -18273,6 +18537,13 @@ resolve@^1.12.0: dependencies: path-parse "^1.0.6" +resolve@^1.14.2: + version "1.15.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" + integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== + dependencies: + path-parse "^1.0.6" + responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -18860,20 +19131,27 @@ shx@^0.3.2: minimist "^1.2.0" shelljs "^0.8.1" -sign-addon@2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/sign-addon/-/sign-addon-2.0.5.tgz#bfb1033bd77436c2f7c49168c6ea794f65c01b44" - integrity sha512-dVjIWe1VJ2VQCdScREWXWECmJhgjpJMqwPKkW+L78PPx2Jyr/t+//kNHqG1hYrmIsvQN7vGjAjv9s7ix0vw0zA== +side-channel@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" + integrity sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA== dependencies: - common-tags "1.8.0" - core-js "3.6.4" - deepcopy "2.0.0" - es6-error "4.1.1" - es6-promisify "6.0.2" - jsonwebtoken "8.5.1" - mz "2.7.0" - request "2.88.0" - source-map-support "0.5.16" + es-abstract "^1.17.0-next.1" + object-inspect "^1.7.0" + +sign-addon@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/sign-addon/-/sign-addon-0.3.1.tgz#7798ba994c8cd803a64a11a12a377ae6f714565e" + integrity sha512-feaoG7+8IXr9SymOEd8VTZCSlVZArWcBDZ33IIdfXlU5NWWzXdCxCjPDqAkLQplFa7RRZr1S4lSmgMPn80Ze1A== + dependencies: + babel-polyfill "6.16.0" + deepcopy "0.6.3" + es6-error "4.0.0" + es6-promisify "5.0.0" + jsonwebtoken "8.2.1" + mz "2.5.0" + request "2.87.0" + source-map-support "0.4.6" stream-to-promise "2.2.0" signal-exit@^3.0.0, signal-exit@^3.0.2: @@ -19422,6 +19700,18 @@ string.prototype.matchall@^3.0.1: has-symbols "^1.0.0" regexp.prototype.flags "^1.2.0" +string.prototype.matchall@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz#48bb510326fb9fdeb6a33ceaa81a6ea04ef7648e" + integrity sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0" + has-symbols "^1.0.1" + internal-slot "^1.0.2" + regexp.prototype.flags "^1.3.0" + side-channel "^1.0.2" + string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" @@ -19440,6 +19730,22 @@ string.prototype.padstart@^3.0.0: es-abstract "^1.4.3" function-bind "^1.0.2" +string.prototype.trimleft@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" + integrity sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== + dependencies: + define-properties "^1.1.3" + function-bind "^1.1.1" + +string.prototype.trimright@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz#440314b15996c866ce8a0341894d45186200c5d9" + integrity sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== + dependencies: + define-properties "^1.1.3" + function-bind "^1.1.1" + string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" From 168b279cf4035fb07a04057c36632476d4d8f226 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 18 Feb 2020 11:51:41 +0200 Subject: [PATCH 132/204] lock file update --- yarn.lock | 340 +++--------------------------------------------------- 1 file changed, 17 insertions(+), 323 deletions(-) diff --git a/yarn.lock b/yarn.lock index a953f2109..c965075e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4622,17 +4622,6 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.19.2.tgz#e279aaae5d5c1f2547b4cff99204e1250bc7a058" - integrity sha512-HX2qOq2GOV04HNrmKnTpSIpHjfl7iwdXe3u/Nvt+/cpmdvzYvY0NHSiTkYN257jHnq4OM/yo+OsFgati+7LqJA== - dependencies: - "@typescript-eslint/experimental-utils" "2.19.2" - eslint-utils "^1.4.3" - functional-red-black-tree "^1.0.1" - regexpp "^3.0.0" - tsutils "^3.17.1" - "@typescript-eslint/eslint-plugin@^2.8.0": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz#a522d0e1e4898f7c9c6a8e1ed3579b60867693fa" @@ -4653,25 +4642,6 @@ "@typescript-eslint/typescript-estree" "2.20.0" eslint-scope "^5.0.0" -"@typescript-eslint/experimental-utils@2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.2.tgz#4611d44cf0f0cb460c26aa7676fc0a787281e233" - integrity sha512-B88QuwT1wMJR750YvTJBNjMZwmiPpbmKYLm1yI7PCc3x0NariqPwqaPsoJRwU9DmUi0cd9dkhz1IqEnwfD+P1A== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "2.19.2" - eslint-scope "^5.0.0" - -"@typescript-eslint/parser@^2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.19.2.tgz#21f42c0694846367e7d6a907feb08ab2f89c0879" - integrity sha512-8uwnYGKqX9wWHGPGdLB9sk9+12sjcdqEEYKGgbS8A0IvYX59h01o8os5qXUHMq2na8vpDRaV0suTLM7S8wraTA== - dependencies: - "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "2.19.2" - "@typescript-eslint/typescript-estree" "2.19.2" - eslint-visitor-keys "^1.1.0" - "@typescript-eslint/parser@^2.8.0": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.20.0.tgz#608e5bb06ba98a415b64ace994c79ab20f9772a9" @@ -4695,19 +4665,6 @@ semver "^6.3.0" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@2.19.2": - version "2.19.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.2.tgz#67485b00172f400474d243c6c0be27581a579350" - integrity sha512-Xu/qa0MDk6upQWqE4Qy2X16Xg8Vi32tQS2PR0AvnT/ZYS4YGDvtn2MStOh5y8Zy2mg4NuL06KUHlvCh95j9C6Q== - dependencies: - debug "^4.1.1" - eslint-visitor-keys "^1.1.0" - glob "^7.1.6" - is-glob "^4.0.1" - lodash "^4.17.15" - semver "^6.3.0" - tsutils "^3.17.1" - "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -5485,15 +5442,6 @@ array-includes@^3.0.3: define-properties "^1.1.2" es-abstract "^1.7.0" -array-includes@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.1.tgz#cdd67e6852bdf9c1215460786732255ed2459348" - integrity sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0" - is-string "^1.0.5" - array-map@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" @@ -9036,23 +8984,6 @@ es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13 is-regex "^1.0.4" object-keys "^1.0.12" -es-abstract@^1.17.0, es-abstract@^1.17.0-next.1: - version "1.17.4" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184" - integrity sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.1.5" - is-regex "^1.0.5" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimleft "^2.1.1" - string.prototype.trimright "^2.1.1" - es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" @@ -9062,15 +8993,6 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.51, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.51" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.51.tgz#ed2d7d9d48a12df86e0299287e93a09ff478842f" @@ -9217,20 +9139,13 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-prettier@^6.10.0: +eslint-config-prettier@^6.2.0: version "6.10.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz#7b15e303bf9c956875c948f6b21500e48ded6a7f" integrity sha512-AtndijGte1rPILInUdHjvKEGbIV06NuvPrqlIEaEaWtbtvJh464mDeyGMdZEQMsGvC0ZVkiex1fSNcC4HAbRGg== dependencies: get-stdin "^6.0.0" -eslint-config-react-app@5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.2.0.tgz#135110ba56a9e378f7acfe5f36e2ae76a2317899" - integrity sha512-WrHjoGpKr1kLLiWDD81tme9jMM0hk5cMxasLSdyno6DdPt+IfLOrDJBVo6jN7tn4y1nzhs43TmUaZWO6Sf0blw== - dependencies: - confusing-browser-globals "^1.0.9" - eslint-config-react-app@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-5.1.0.tgz#a37b3f2d4f56f856f93277281ef52bd791273e63" @@ -9265,14 +9180,6 @@ eslint-module-utils@^2.4.0: debug "^2.6.8" pkg-dir "^2.0.0" -eslint-module-utils@^2.4.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.5.2.tgz#7878f7504824e1b857dd2505b59a8e5eda26a708" - integrity sha512-LGScZ/JSlqGKiT8OC+cYRxseMjyqt6QO54nl281CK93unD89ijSeRV6An8Ci/2nvWVKe8K/Tqdm75RQoIOCr+Q== - dependencies: - debug "^2.6.9" - pkg-dir "^2.0.0" - eslint-plugin-flowtype@3.13.0: version "3.13.0" resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.13.0.tgz#e241ebd39c0ce519345a3f074ec1ebde4cf80f2c" @@ -9280,13 +9187,6 @@ eslint-plugin-flowtype@3.13.0: dependencies: lodash "^4.17.15" -eslint-plugin-flowtype@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-4.6.0.tgz#82b2bd6f21770e0e5deede0228e456cb35308451" - integrity sha512-W5hLjpFfZyZsXfo5anlu7HM970JBDqbEshAJUkeczP6BFCIfJXuiIBQXyberLRtOStT0OGPF8efeTbxlHk4LpQ== - dependencies: - lodash "^4.17.15" - eslint-plugin-import@2.18.2: version "2.18.2" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz#02f1180b90b077b33d447a17a2326ceb400aceb6" @@ -9304,25 +9204,7 @@ eslint-plugin-import@2.18.2: read-pkg-up "^2.0.0" resolve "^1.11.0" -eslint-plugin-import@^2.20.1: - version "2.20.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.20.1.tgz#802423196dcb11d9ce8435a5fc02a6d3b46939b3" - integrity sha512-qQHgFOTjguR+LnYRoToeZWT62XM55MBVXObHM6SKFd1VzDcX/vqT1kAz8ssqigh5eMj8qXcRoXXGZpPP6RfdCw== - dependencies: - array-includes "^3.0.3" - array.prototype.flat "^1.2.1" - contains-path "^0.1.0" - debug "^2.6.9" - doctrine "1.5.0" - eslint-import-resolver-node "^0.3.2" - eslint-module-utils "^2.4.1" - has "^1.0.3" - minimatch "^3.0.4" - object.values "^1.1.0" - read-pkg-up "^2.0.0" - resolve "^1.12.0" - -eslint-plugin-jsx-a11y@6.2.3, eslint-plugin-jsx-a11y@^6.2.3: +eslint-plugin-jsx-a11y@6.2.3: version "6.2.3" resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.3.tgz#b872a09d5de51af70a97db1eea7dc933043708aa" integrity sha512-CawzfGt9w83tyuVekn0GDPU9ytYtxyxyFZ3aSWROmnRRFQFT2BiPJd7jvRdzNDi6oLWaS2asMeYSNMjWTV4eNg== @@ -9344,7 +9226,7 @@ eslint-plugin-no-unsafe-innerhtml@1.0.16: dependencies: eslint "^3.7.1" -eslint-plugin-prettier@^3.1.2: +eslint-plugin-prettier@^3.0.1: version "3.1.2" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" integrity sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA== @@ -9356,11 +9238,6 @@ eslint-plugin-react-hooks@^1.6.1: resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04" integrity sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA== -eslint-plugin-react-hooks@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.3.0.tgz#53e073961f1f5ccf8dd19558036c1fac8c29d99a" - integrity sha512-gLKCa52G4ee7uXzdLiorca7JIQZPPXRAQDXV83J4bUEeUuc5pIEyZYAZ45Xnxe5IuupxEqHS+hUhSLIimK1EMw== - eslint-plugin-react@7.16.0: version "7.16.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.16.0.tgz#9928e4f3e2122ed3ba6a5b56d0303ba3e41d8c09" @@ -9376,22 +9253,6 @@ eslint-plugin-react@7.16.0: prop-types "^15.7.2" resolve "^1.12.0" -eslint-plugin-react@^7.18.3: - version "7.18.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.18.3.tgz#8be671b7f6be095098e79d27ac32f9580f599bc8" - integrity sha512-Bt56LNHAQCoou88s8ViKRjMB2+36XRejCQ1VoLj716KI1MoE99HpTVvIThJ0rvFmG4E4Gsq+UgToEjn+j044Bg== - dependencies: - array-includes "^3.1.1" - doctrine "^2.1.0" - has "^1.0.3" - jsx-ast-utils "^2.2.3" - object.entries "^1.1.1" - object.fromentries "^2.0.2" - object.values "^1.1.1" - prop-types "^15.7.2" - resolve "^1.14.2" - string.prototype.matchall "^4.0.2" - eslint-plugin-simple-import-sort@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-4.0.0.tgz#048736c170b9b43f0a8c3ef85ba53881c389f3ff" @@ -9476,49 +9337,6 @@ eslint@5.16.0: table "^5.2.3" text-table "^0.2.0" -eslint@6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" - integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^5.0.0" - eslint-utils "^1.4.3" - eslint-visitor-keys "^1.1.0" - espree "^6.1.2" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.0.0" - globals "^12.1.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^7.0.0" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.14" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.3" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^6.1.2" - strip-ansi "^5.2.0" - strip-json-comments "^3.0.1" - table "^5.2.3" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - eslint@^3.7.1: version "3.19.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" @@ -11218,11 +11036,6 @@ has-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= -has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== - has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -11911,15 +11724,6 @@ internal-ip@^4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" -internal-slot@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.2.tgz#9c2e9fb3cd8e5e4256c6f45fe310067fcfa378a3" - integrity sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g== - dependencies: - es-abstract "^1.17.0-next.1" - has "^1.0.3" - side-channel "^1.0.2" - interpret@^1.0.0, interpret@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -12050,11 +11854,6 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-callable@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" - integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== - is-ci@^1.0.10: version "1.2.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" @@ -12376,13 +12175,6 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-regex@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" - is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" @@ -12442,11 +12234,6 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== -is-string@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" - integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== - is-svg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" @@ -13519,14 +13306,6 @@ jsx-ast-utils@^2.2.1: array-includes "^3.0.3" object.assign "^4.1.0" -jsx-ast-utils@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz#8a9364e402448a3ce7f14d357738310d9248054f" - integrity sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA== - dependencies: - array-includes "^3.0.3" - object.assign "^4.1.0" - jszip@^2.4.0: version "2.6.1" resolved "https://registry.yarnpkg.com/jszip/-/jszip-2.6.1.tgz#b88f3a7b2e67a2a048152982c7a3756d9c4828f0" @@ -15450,12 +15229,7 @@ object-hash@^1.3.1: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df" integrity sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA== -object-inspect@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.0.11, object-keys@^1.0.12: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -15492,16 +15266,6 @@ object.entries@^1.1.0: function-bind "^1.1.1" has "^1.0.3" -object.entries@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.1.tgz#ee1cf04153de02bb093fec33683900f57ce5399b" - integrity sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - function-bind "^1.1.1" - has "^1.0.3" - object.fromentries@^2.0.0, "object.fromentries@^2.0.0 || ^1.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" @@ -15512,16 +15276,6 @@ object.fromentries@^2.0.0, "object.fromentries@^2.0.0 || ^1.0.0": function-bind "^1.1.1" has "^1.0.1" -object.fromentries@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.2.tgz#4a09c9b9bb3843dd0f89acdb517a794d4f355ac9" - integrity sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - function-bind "^1.1.1" - has "^1.0.3" - object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -15547,16 +15301,6 @@ object.values@^1.1.0: function-bind "^1.1.1" has "^1.0.3" -object.values@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.1.tgz#68a99ecde356b7e9295a3c5e0ce31dc8c953de5e" - integrity sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - function-bind "^1.1.1" - has "^1.0.3" - obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -18237,14 +17981,6 @@ regexp.prototype.flags@^1.2.0: dependencies: define-properties "^1.1.2" -regexp.prototype.flags@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" - integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -18537,13 +18273,6 @@ resolve@^1.12.0: dependencies: path-parse "^1.0.6" -resolve@^1.14.2: - version "1.15.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" - integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== - dependencies: - path-parse "^1.0.6" - responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -19131,27 +18860,20 @@ shx@^0.3.2: minimist "^1.2.0" shelljs "^0.8.1" -side-channel@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" - integrity sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA== +sign-addon@2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/sign-addon/-/sign-addon-2.0.5.tgz#bfb1033bd77436c2f7c49168c6ea794f65c01b44" + integrity sha512-dVjIWe1VJ2VQCdScREWXWECmJhgjpJMqwPKkW+L78PPx2Jyr/t+//kNHqG1hYrmIsvQN7vGjAjv9s7ix0vw0zA== dependencies: - es-abstract "^1.17.0-next.1" - object-inspect "^1.7.0" - -sign-addon@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/sign-addon/-/sign-addon-0.3.1.tgz#7798ba994c8cd803a64a11a12a377ae6f714565e" - integrity sha512-feaoG7+8IXr9SymOEd8VTZCSlVZArWcBDZ33IIdfXlU5NWWzXdCxCjPDqAkLQplFa7RRZr1S4lSmgMPn80Ze1A== - dependencies: - babel-polyfill "6.16.0" - deepcopy "0.6.3" - es6-error "4.0.0" - es6-promisify "5.0.0" - jsonwebtoken "8.2.1" - mz "2.5.0" - request "2.87.0" - source-map-support "0.4.6" + common-tags "1.8.0" + core-js "3.6.4" + deepcopy "2.0.0" + es6-error "4.1.1" + es6-promisify "6.0.2" + jsonwebtoken "8.5.1" + mz "2.7.0" + request "2.88.0" + source-map-support "0.5.16" stream-to-promise "2.2.0" signal-exit@^3.0.0, signal-exit@^3.0.2: @@ -19700,18 +19422,6 @@ string.prototype.matchall@^3.0.1: has-symbols "^1.0.0" regexp.prototype.flags "^1.2.0" -string.prototype.matchall@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz#48bb510326fb9fdeb6a33ceaa81a6ea04ef7648e" - integrity sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0" - has-symbols "^1.0.1" - internal-slot "^1.0.2" - regexp.prototype.flags "^1.3.0" - side-channel "^1.0.2" - string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" @@ -19730,22 +19440,6 @@ string.prototype.padstart@^3.0.0: es-abstract "^1.4.3" function-bind "^1.0.2" -string.prototype.trimleft@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" - integrity sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - -string.prototype.trimright@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz#440314b15996c866ce8a0341894d45186200c5d9" - integrity sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" From 6c7d6e2f3c9dcd6f8fa5c7cf2f148b7601ff74d2 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 19 Feb 2020 23:34:07 +0200 Subject: [PATCH 133/204] Add ActionMenu component --- .../components/ActionMenu/index.stories.tsx | 21 +++++ .../src/components/ActionMenu/index.tsx | 87 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 packages/medulas-react-components/src/components/ActionMenu/index.stories.tsx create mode 100644 packages/medulas-react-components/src/components/ActionMenu/index.tsx diff --git a/packages/medulas-react-components/src/components/ActionMenu/index.stories.tsx b/packages/medulas-react-components/src/components/ActionMenu/index.stories.tsx new file mode 100644 index 000000000..a86d50b84 --- /dev/null +++ b/packages/medulas-react-components/src/components/ActionMenu/index.stories.tsx @@ -0,0 +1,21 @@ +import { action } from "@storybook/addon-actions"; +import { storiesOf } from "@storybook/react"; +import React from "react"; + +import { medulasRoot, Storybook } from "../../utils/storybook"; +import Block from "../Block"; +import ActionMenu, { ActionMenuItem } from "./index"; + +const menuItems: ActionMenuItem[] = [ + { title: "Renew", action: () => action("Renew")() }, + { title: "Transfer iovname", action: () => action("Transfer iovname")() }, + { title: "Delete iovname", action: () => action("Delete iovname")() }, +]; + +storiesOf(`${medulasRoot}/components`, module).add("ActionMenu", () => ( + + + + + +)); diff --git a/packages/medulas-react-components/src/components/ActionMenu/index.tsx b/packages/medulas-react-components/src/components/ActionMenu/index.tsx new file mode 100644 index 000000000..d2e107303 --- /dev/null +++ b/packages/medulas-react-components/src/components/ActionMenu/index.tsx @@ -0,0 +1,87 @@ +import { makeStyles } from "@material-ui/core"; +import Link from "@material-ui/core/Link"; +import ListItemText from "@material-ui/core/ListItemText"; +import Menu from "@material-ui/core/Menu"; +import MenuItem from "@material-ui/core/MenuItem"; +import { PopoverOrigin } from "@material-ui/core/Popover"; +import MoreHorizIcon from "@material-ui/icons/MoreHoriz"; +import * as React from "react"; + +import Block from "../Block"; +import Typography from "../Typography"; + +export interface ActionMenuItem { + readonly title: string; + readonly action: () => void; +} + +const useMenuStyles = makeStyles({ + paper: { + border: "none", + boxShadow: "0px 0px 14px #EDEFF4", + }, + list: { + border: "none", + }, +}); + +const anchorOrigin: PopoverOrigin = { + vertical: "bottom", + horizontal: "center", +}; + +const transformOrigin: PopoverOrigin = { + vertical: "top", + horizontal: "center", +}; + +interface Props { + readonly menuItems: readonly ActionMenuItem[]; +} + +const ActionMenu: React.FunctionComponent = ({ menuItems }) => { + const [anchorEl, setAnchorEl] = React.useState<(EventTarget & HTMLAnchorElement) | null>(null); + const menuClasses = useMenuStyles(); + + const handleClick = (event: React.MouseEvent): void => { + setAnchorEl(event.currentTarget); + }; + + const handleClose = (): void => { + setAnchorEl(null); + }; + + return ( + + + + + + {menuItems.map(item => ( + + + {item.title} + + } + /> + + ))} + + + ); +}; + +export default ActionMenu; From df979b9c3b50a4e36e0801b5b7028e8b1c606c6d Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 19 Feb 2020 23:34:28 +0200 Subject: [PATCH 134/204] Add typescirpt definitions --- .../types/components/ActionMenu/index.d.ts | 10 ++++++++++ packages/medulas-react-components/types/index.d.ts | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 packages/medulas-react-components/types/components/ActionMenu/index.d.ts diff --git a/packages/medulas-react-components/types/components/ActionMenu/index.d.ts b/packages/medulas-react-components/types/components/ActionMenu/index.d.ts new file mode 100644 index 000000000..b02e1c59b --- /dev/null +++ b/packages/medulas-react-components/types/components/ActionMenu/index.d.ts @@ -0,0 +1,10 @@ +import * as React from "react"; +export interface ActionMenuItem { + readonly title: string; + readonly action: () => void; +} +interface Props { + readonly menuItems: readonly ActionMenuItem[]; +} +declare const ActionMenu: React.FunctionComponent; +export default ActionMenu; diff --git a/packages/medulas-react-components/types/index.d.ts b/packages/medulas-react-components/types/index.d.ts index 5ecadcad4..532165e77 100644 --- a/packages/medulas-react-components/types/index.d.ts +++ b/packages/medulas-react-components/types/index.d.ts @@ -1,3 +1,4 @@ +import ActionMenu, { ActionMenuItem } from "./components/ActionMenu"; import Avatar from "./components/Avatar"; import Badge from "./components/Badge"; import Block from "./components/Block"; @@ -48,6 +49,8 @@ export { } from "./utils/forms/validators"; export { Storybook } from "./utils/storybook"; export { + ActionMenu, + ActionMenuItem, Avatar, Back, Badge, From 7804d060e3bf2dc107958819e4e171a50168c3db Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 19 Feb 2020 23:34:55 +0200 Subject: [PATCH 135/204] Add ActionMenu component export --- packages/medulas-react-components/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/medulas-react-components/src/index.ts b/packages/medulas-react-components/src/index.ts index 7a470448a..167711d00 100644 --- a/packages/medulas-react-components/src/index.ts +++ b/packages/medulas-react-components/src/index.ts @@ -1,3 +1,4 @@ +import ActionMenu, { ActionMenuItem } from "./components/ActionMenu"; import Avatar from "./components/Avatar"; import Badge from "./components/Badge"; import Block from "./components/Block"; @@ -49,6 +50,8 @@ export { } from "./utils/forms/validators"; export { Storybook } from "./utils/storybook"; export { + ActionMenu, + ActionMenuItem, Avatar, Back, Badge, From b047b728e4ac8255a7efe22bed836cc6ee92b796 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 19 Feb 2020 23:35:21 +0200 Subject: [PATCH 136/204] Add ManageNames component --- .../addresses/components/ManageName.tsx | 127 ++++++++++++++++++ .../src/routes/addresses/index.stories.tsx | 9 ++ 2 files changed, 136 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/addresses/components/ManageName.tsx diff --git a/packages/bierzo-wallet/src/routes/addresses/components/ManageName.tsx b/packages/bierzo-wallet/src/routes/addresses/components/ManageName.tsx new file mode 100644 index 000000000..23647effe --- /dev/null +++ b/packages/bierzo-wallet/src/routes/addresses/components/ManageName.tsx @@ -0,0 +1,127 @@ +import Paper from "@material-ui/core/Paper"; +import clipboardCopy from "clipboard-copy"; +import { + ActionMenu, + ActionMenuItem, + Block, + Hairline, + Image, + makeStyles, + ToastContext, + ToastVariant, + Tooltip, + Typography, +} from "medulas-react-components"; +import React from "react"; + +import { BwUsernameWithChainName } from ".."; +import { history } from "../.."; +import AddressesTable from "../../../components/AddressesTable"; +import copy from "../../../components/AddressesTable/assets/copy.svg"; +import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; +import { AddressesTooltipHeader, TooltipContent } from "../../registerName/components"; + +interface Props { + readonly account: BwUsernameWithChainName; + readonly onRegisterUsername: () => void; +} + +const usePaper = makeStyles({ + rounded: { + borderRadius: "5px", + }, + elevation1: { + boxShadow: "none", + }, +}); + +const menuItems: ActionMenuItem[] = [ + { title: "Renew", action: () => console.log("Renew") }, + { title: "Transfer iovname", action: () => console.log("Transfer iovname") }, + { title: "Delete iovname", action: () => console.log("Delete iovname") }, +]; + +const useStyles = makeStyles({ + link: { + cursor: "pointer", + }, +}); + +const ManageName: React.FunctionComponent = ({ account, onRegisterUsername }) => { + const paperClasses = usePaper(); + const classes = useStyles(); + const toast = React.useContext(ToastContext); + + const onAccountCopy = (): void => { + clipboardCopy(account.username); + toast.show("Account has been copied to clipboard.", ToastVariant.INFO); + }; + + const onEdit = (): void => { + history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE, account); + }; + + return ( + + + + + + {account.username} + + + + Copy + + + + Expires on 19/12/2025 + + + + + {account.addresses.length > 0 ? "LINKED ADDRESSES" : "NO LINKED ADDRESSES"} + + + + + } title="Your linked addresses"> + With IOV you can have an universal blockchain address that is linked to all your addresses. + Just give your friends your personalized address. + + + + + + + + {account.addresses.length > 0 ? "Edit" : "Link Now"} + + + + + + + {account.addresses.length > 0 && } + + + + ); +}; + +export default ManageName; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index 6412dba4d..409afd3e8 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -15,6 +15,7 @@ import { import { BwUsernameWithChainName } from "."; import AddressesTab from "./components/AddressesTab"; import Iovnames from "./components/Iovnames"; +import ManageName from "./components/ManageName"; import Starnames from "./components/Starnames"; import UserAddresses from "./components/UserAddresses"; @@ -143,4 +144,12 @@ storiesOf(`${bierzoRoot}/Addresses`, module) rpcEndpointType="extension" /> + )) + .add("Manage names", () => ( + + + )); From 9ce6be4a14b09da47459d10687560051acfd709b Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 20 Feb 2020 13:55:22 +0200 Subject: [PATCH 137/204] Move Address manage component to another route --- .../ManageName.tsx | 24 +++---- .../routes/addressManage/index.stories.tsx | 71 +++++++++++++++++++ .../src/routes/addressManage/index.tsx | 40 +++++++++++ packages/bierzo-wallet/src/routes/index.tsx | 3 + packages/bierzo-wallet/src/routes/paths.ts | 1 + 5 files changed, 124 insertions(+), 15 deletions(-) rename packages/bierzo-wallet/src/routes/{addresses/components => addressManage}/ManageName.tsx (81%) create mode 100644 packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx create mode 100644 packages/bierzo-wallet/src/routes/addressManage/index.tsx diff --git a/packages/bierzo-wallet/src/routes/addresses/components/ManageName.tsx b/packages/bierzo-wallet/src/routes/addressManage/ManageName.tsx similarity index 81% rename from packages/bierzo-wallet/src/routes/addresses/components/ManageName.tsx rename to packages/bierzo-wallet/src/routes/addressManage/ManageName.tsx index 23647effe..b4be010d6 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/ManageName.tsx +++ b/packages/bierzo-wallet/src/routes/addressManage/ManageName.tsx @@ -14,15 +14,16 @@ import { } from "medulas-react-components"; import React from "react"; -import { BwUsernameWithChainName } from ".."; -import { history } from "../.."; -import AddressesTable from "../../../components/AddressesTable"; -import copy from "../../../components/AddressesTable/assets/copy.svg"; -import { REGISTER_PERSONALIZED_ADDRESS_ROUTE } from "../../paths"; -import { AddressesTooltipHeader, TooltipContent } from "../../registerName/components"; +import { history } from ".."; +import AddressesTable from "../../components/AddressesTable"; +import copy from "../../components/AddressesTable/assets/copy.svg"; +import { BwUsernameWithChainName } from "../addresses"; +import { REGISTER_IOVNAME_ROUTE } from "../paths"; +import { AddressesTooltipHeader, TooltipContent } from "../register"; interface Props { readonly account: BwUsernameWithChainName; + readonly menuItems: readonly ActionMenuItem[]; readonly onRegisterUsername: () => void; } @@ -35,19 +36,12 @@ const usePaper = makeStyles({ }, }); -const menuItems: ActionMenuItem[] = [ - { title: "Renew", action: () => console.log("Renew") }, - { title: "Transfer iovname", action: () => console.log("Transfer iovname") }, - { title: "Delete iovname", action: () => console.log("Delete iovname") }, -]; - const useStyles = makeStyles({ link: { cursor: "pointer", }, }); - -const ManageName: React.FunctionComponent = ({ account, onRegisterUsername }) => { +const ManageName: React.FunctionComponent = ({ account, menuItems, onRegisterUsername }) => { const paperClasses = usePaper(); const classes = useStyles(); const toast = React.useContext(ToastContext); @@ -58,7 +52,7 @@ const ManageName: React.FunctionComponent = ({ account, onRegisterUsernam }; const onEdit = (): void => { - history.push(REGISTER_PERSONALIZED_ADDRESS_ROUTE, account); + history.push(REGISTER_IOVNAME_ROUTE, account); }; return ( diff --git a/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx b/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx new file mode 100644 index 000000000..341f7ea1d --- /dev/null +++ b/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx @@ -0,0 +1,71 @@ +import { Address, ChainId } from "@iov/bcp"; +import { action } from "@storybook/addon-actions"; +import { linkTo } from "@storybook/addon-links"; +import { storiesOf } from "@storybook/react"; +import { ActionMenuItem } from "medulas-react-components"; +import React from "react"; + +import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; +import { BwUsernameWithChainName } from "../addresses"; +import { + REGISTER_USERNAME_REGISTRATION_STORY_PATH, + REGISTER_USERNAME_STORY_PATH, +} from "../register/index.stories"; +import ManageName from "./ManageName"; + +const chainAddresses: ChainAddressPairWithName[] = [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, + chainName: "IOV Devnet", + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "1349293588603668134L" as Address, + chainName: "Lisk Devnet", + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0xD383382350F9f190Bd2608D6381B15b4e1cec0f3" as Address, + chainName: "Ganache", + }, +]; + +const username: BwUsernameWithChainName = { + username: "test2*iov", + addresses: [chainAddresses[0], chainAddresses[1]], +}; + +const menuItems: readonly ActionMenuItem[] = [ + { + title: "Renew", + action: () => { + action("Renew")(); + }, + }, + { + title: "Transfer iovname", + action: () => { + action("Transfer iovname")(); + }, + }, + { + title: "Delete iovname", + action: () => { + action("Delete iovname")(); + }, + }, +]; + +storiesOf(`${bierzoRoot}/Address Manage`, module) + .addParameters({ viewport: { defaultViewport: "responsive" } }) + .add("Manage names", () => ( + + + + )); diff --git a/packages/bierzo-wallet/src/routes/addressManage/index.tsx b/packages/bierzo-wallet/src/routes/addressManage/index.tsx new file mode 100644 index 000000000..d8451d793 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/addressManage/index.tsx @@ -0,0 +1,40 @@ +import { ActionMenuItem, Block } from "medulas-react-components"; +import * as React from "react"; + +import { history } from ".."; +import PageMenu from "../../components/PageMenu"; +import { BwUsernameWithChainName } from "../addresses"; +import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; +import ManageName from "./ManageName"; + +function onRegisterUsername(): void { + history.push(REGISTER_IOVNAME_ROUTE); +} + +function onRegisterStarname(): void { + history.push(REGISTER_STARNAME_ROUTE); +} + +const menuItems: readonly ActionMenuItem[] = [ + { title: "Renew", action: () => console.log("Renew") }, + { title: "Transfer iovname", action: () => console.log("Transfer iovname") }, + { title: "Delete iovname", action: () => console.log("Delete iovname") }, +]; + +const AddressManage = (): JSX.Element => { + const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; + + if (!aadressToManage) { + throw new Error("No address to manage provided, something wrong."); + } + + return ( + + + + + + ); +}; + +export default AddressManage; diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index ba893eb2c..266a9b11b 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -4,9 +4,11 @@ import { Route, Router, Switch } from "react-router"; import RequireLogin from "../components/RequireLogin"; import Addresses from "./addresses"; +import AddressManage from "./addressManage"; import Balance from "./balance"; import Login from "./login"; import { + ADDRESS_MANAGE_ROUTE, ADDRESSES_ROUTE, BALANCE_ROUTE, LOGIN_ROUTE, @@ -34,6 +36,7 @@ const Routes = (): JSX.Element => ( + } /> diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index 35824174e..ab0e87a73 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -7,5 +7,6 @@ export const ADDRESSES_ROUTE = "/addresses"; export const REGISTER_IOVNAME_ROUTE = "/iovname/register"; export const REGISTER_STARNAME_ROUTE = "/starname/register"; export const REGISTER_NAME_ROUTE = "/name/register"; +export const ADDRESS_MANAGE_ROUTE = "/address-manage"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; From 756ebe47c996bd3b03756a1a09eaebeecf8ae7b9 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 9 Mar 2020 17:08:01 +0200 Subject: [PATCH 138/204] Fix after rebase --- .../routes/addressManage/index.stories.tsx | 6 +++--- .../src/routes/addresses/index.tsx | 2 +- yarn.lock | 21 ++++++++++++------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx b/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx index 341f7ea1d..00000d3d5 100644 --- a/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx @@ -9,8 +9,8 @@ import { ChainAddressPairWithName } from "../../components/AddressesTable"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { BwUsernameWithChainName } from "../addresses"; import { - REGISTER_USERNAME_REGISTRATION_STORY_PATH, - REGISTER_USERNAME_STORY_PATH, + REGISTER_IOVNAME_REGISTRATION_STORY_PATH, + REGISTER_IOVNAME_STORY_PATH, } from "../register/index.stories"; import ManageName from "./ManageName"; @@ -65,7 +65,7 @@ storiesOf(`${bierzoRoot}/Address Manage`, module) )); diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index 7673d6031..13b6e9b5d 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -79,7 +79,7 @@ const Addresses = (): JSX.Element => { chainAddresses={chainAddresses} starnames={starnames} onRegisterIovname={onRegisterIovname} - usernames={bwNamesWithChain} + iovnames={bwNamesWithChain} onRegisterStarname={onRegisterStarname} rpcEndpointType={rpcEndpointType} /> diff --git a/yarn.lock b/yarn.lock index c965075e0..ae1bab355 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5652,7 +5652,7 @@ autoprefixer@^9.4.9, autoprefixer@^9.6.1: integrity sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw== dependencies: browserslist "^4.6.3" - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000980" chalk "^2.4.2" normalize-range "^0.1.2" num2fraction "^1.2.2" @@ -6470,7 +6470,7 @@ browserslist@4.5.4: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.4.tgz#166c4ecef3b51737a42436ea8002aeea466ea2c7" integrity sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag== dependencies: - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000955" electron-to-chromium "^1.3.122" node-releases "^1.1.13" @@ -6479,7 +6479,7 @@ browserslist@4.7.3: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.3.tgz#02341f162b6bcc1e1028e30624815d4924442dc3" integrity sha512-jWvmhqYpx+9EZm/FxcZSbUZyDEvDTLDi3nSAKbzEkyWvtI0mNSmUosey+5awDW1RUlrgXbQb5A6qY1xQH9U6MQ== dependencies: - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30001010" electron-to-chromium "^1.3.306" node-releases "^1.1.40" @@ -6488,7 +6488,7 @@ browserslist@^4.0.0, browserslist@^4.5.2, browserslist@^4.6.0, browserslist@^4.6 resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== dependencies: - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000984" electron-to-chromium "^1.3.191" node-releases "^1.1.25" @@ -6497,7 +6497,7 @@ browserslist@^4.6.4: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" integrity sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA== dependencies: - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000989" electron-to-chromium "^1.3.247" node-releases "^1.1.29" @@ -6797,11 +6797,16 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000980, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30000984, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001010: +caniuse-lite@^1.0.0: version "1.0.30001027" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001027.tgz#283e2ef17d94889cc216a22c6f85303d78ca852d" integrity sha512-7xvKeErvXZFtUItTHgNtLgS9RJpVnwBlWX8jSo/BO8VsF6deszemZSkJJJA1KOKrXuzZH4WALpAJdq5EyfgMLg== +caniuse-lite@^1.0.30001022: + version "1.0.30001033" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001033.tgz#60c328fb56860de60f9a2cb419c31fb80587cba0" + integrity sha512-8Ibzxee6ibc5q88cM1usPsMpJOG5CTq0s/dKOmlekPbDGKt+UrnOOTPSjQz3kVo6yL7N4SB5xd+FGLHQmbzh6A== + canvg@1.5.3: version "1.5.3" resolved "https://registry.yarnpkg.com/canvg/-/canvg-1.5.3.tgz#aad17915f33368bf8eb80b25d129e3ae922ddc5f" @@ -9378,7 +9383,7 @@ eslint@^3.7.1: text-table "~0.2.0" user-home "^2.0.0" -eslint@^6.6.0, eslint@^6: +eslint@^6, eslint@^6.6.0: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== @@ -16570,7 +16575,7 @@ postcss-preset-env@6.7.0: dependencies: autoprefixer "^9.6.1" browserslist "^4.6.4" - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000981" css-blank-pseudo "^0.1.4" css-has-pseudo "^0.10.0" css-prefers-color-scheme "^3.1.1" From 07621fc6f1c60ed94df84ec98cd3d64be32127b1 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 9 Mar 2020 23:10:08 +0200 Subject: [PATCH 139/204] Remove not used props spreading --- packages/medulas-react-components/src/components/Link/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/medulas-react-components/src/components/Link/index.tsx b/packages/medulas-react-components/src/components/Link/index.tsx index fd2784842..2d22f3dfb 100644 --- a/packages/medulas-react-components/src/components/Link/index.tsx +++ b/packages/medulas-react-components/src/components/Link/index.tsx @@ -15,7 +15,7 @@ const Link = ({ children, to, ...rest }: Props): JSX.Element => { event.preventDefault(); }; return ( - + {children} ); From 713ed2eacff36055b2bdc15c00af4158a5df65d9 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 9 Mar 2020 23:10:29 +0200 Subject: [PATCH 140/204] Recover yarn lock --- yarn.lock | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/yarn.lock b/yarn.lock index ae1bab355..2f7f729ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5652,7 +5652,7 @@ autoprefixer@^9.4.9, autoprefixer@^9.6.1: integrity sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw== dependencies: browserslist "^4.6.3" - caniuse-lite "^1.0.30000980" + caniuse-lite "^1.0.30001022" chalk "^2.4.2" normalize-range "^0.1.2" num2fraction "^1.2.2" @@ -6470,7 +6470,7 @@ browserslist@4.5.4: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.4.tgz#166c4ecef3b51737a42436ea8002aeea466ea2c7" integrity sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag== dependencies: - caniuse-lite "^1.0.30000955" + caniuse-lite "^1.0.30001022" electron-to-chromium "^1.3.122" node-releases "^1.1.13" @@ -6479,7 +6479,7 @@ browserslist@4.7.3: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.3.tgz#02341f162b6bcc1e1028e30624815d4924442dc3" integrity sha512-jWvmhqYpx+9EZm/FxcZSbUZyDEvDTLDi3nSAKbzEkyWvtI0mNSmUosey+5awDW1RUlrgXbQb5A6qY1xQH9U6MQ== dependencies: - caniuse-lite "^1.0.30001010" + caniuse-lite "^1.0.30001022" electron-to-chromium "^1.3.306" node-releases "^1.1.40" @@ -6488,7 +6488,7 @@ browserslist@^4.0.0, browserslist@^4.5.2, browserslist@^4.6.0, browserslist@^4.6 resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== dependencies: - caniuse-lite "^1.0.30000984" + caniuse-lite "^1.0.30001022" electron-to-chromium "^1.3.191" node-releases "^1.1.25" @@ -6497,7 +6497,7 @@ browserslist@^4.6.4: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" integrity sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA== dependencies: - caniuse-lite "^1.0.30000989" + caniuse-lite "^1.0.30001022" electron-to-chromium "^1.3.247" node-releases "^1.1.29" @@ -6797,15 +6797,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0: - version "1.0.30001027" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001027.tgz#283e2ef17d94889cc216a22c6f85303d78ca852d" - integrity sha512-7xvKeErvXZFtUItTHgNtLgS9RJpVnwBlWX8jSo/BO8VsF6deszemZSkJJJA1KOKrXuzZH4WALpAJdq5EyfgMLg== - -caniuse-lite@^1.0.30001022: - version "1.0.30001033" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001033.tgz#60c328fb56860de60f9a2cb419c31fb80587cba0" - integrity sha512-8Ibzxee6ibc5q88cM1usPsMpJOG5CTq0s/dKOmlekPbDGKt+UrnOOTPSjQz3kVo6yL7N4SB5xd+FGLHQmbzh6A== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001022: + version "1.0.30001022" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001022.tgz#9eeffe580c3a8f110b7b1742dcf06a395885e4c6" + integrity sha512-FjwPPtt/I07KyLPkBQ0g7/XuZg6oUkYBVnPHNj3VHJbOjmmJ/GdSo/GUY6MwINEQvjhP6WZVbX8Tvms8xh0D5A== canvg@1.5.3: version "1.5.3" @@ -9145,9 +9140,9 @@ escope@^3.6.0: estraverse "^4.1.1" eslint-config-prettier@^6.2.0: - version "6.10.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz#7b15e303bf9c956875c948f6b21500e48ded6a7f" - integrity sha512-AtndijGte1rPILInUdHjvKEGbIV06NuvPrqlIEaEaWtbtvJh464mDeyGMdZEQMsGvC0ZVkiex1fSNcC4HAbRGg== + version "6.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.2.0.tgz#80e0b8714e3f6868c4ac2a25fbf39c02e73527a7" + integrity sha512-VLsgK/D+S/FEsda7Um1+N8FThec6LqE3vhcMyp8mlmto97y3fGf3DX7byJexGuOb1QY0Z/zz222U5t+xSfcZDQ== dependencies: get-stdin "^6.0.0" @@ -9232,9 +9227,9 @@ eslint-plugin-no-unsafe-innerhtml@1.0.16: eslint "^3.7.1" eslint-plugin-prettier@^3.0.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba" - integrity sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d" + integrity sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA== dependencies: prettier-linter-helpers "^1.0.0" @@ -9383,7 +9378,7 @@ eslint@^3.7.1: text-table "~0.2.0" user-home "^2.0.0" -eslint@^6, eslint@^6.6.0: +eslint@^6.6.0, eslint@^6: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== @@ -16575,7 +16570,7 @@ postcss-preset-env@6.7.0: dependencies: autoprefixer "^9.6.1" browserslist "^4.6.4" - caniuse-lite "^1.0.30000981" + caniuse-lite "^1.0.30001022" css-blank-pseudo "^0.1.4" css-has-pseudo "^0.10.0" css-prefers-color-scheme "^3.1.1" From 936495ecb0f49ed329ade0759b203fd04fba9b08 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 19:52:26 +0200 Subject: [PATCH 141/204] Pick out common manage component --- .../AccountManage/assets/shield.svg | 3 + .../AccountManage}/index.stories.tsx | 15 ++- .../AccountManage/index.tsx} | 94 +++++++++++++++---- .../src/routes/addressManage/index.tsx | 40 -------- 4 files changed, 88 insertions(+), 64 deletions(-) create mode 100644 packages/bierzo-wallet/src/components/AccountManage/assets/shield.svg rename packages/bierzo-wallet/src/{routes/addressManage => components/AccountManage}/index.stories.tsx (83%) rename packages/bierzo-wallet/src/{routes/addressManage/ManageName.tsx => components/AccountManage/index.tsx} (52%) delete mode 100644 packages/bierzo-wallet/src/routes/addressManage/index.tsx diff --git a/packages/bierzo-wallet/src/components/AccountManage/assets/shield.svg b/packages/bierzo-wallet/src/components/AccountManage/assets/shield.svg new file mode 100644 index 000000000..ca39313b2 --- /dev/null +++ b/packages/bierzo-wallet/src/components/AccountManage/assets/shield.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx similarity index 83% rename from packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx rename to packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx index 00000d3d5..ea64663af 100644 --- a/packages/bierzo-wallet/src/routes/addressManage/index.stories.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx @@ -6,13 +6,12 @@ import { ActionMenuItem } from "medulas-react-components"; import React from "react"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; -import { BwUsernameWithChainName } from "../addresses"; import { REGISTER_IOVNAME_REGISTRATION_STORY_PATH, REGISTER_IOVNAME_STORY_PATH, -} from "../register/index.stories"; -import ManageName from "./ManageName"; +} from "../../routes/register/index.stories"; +import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; +import AccountManage, { BwUsernameWithChainName } from "."; const chainAddresses: ChainAddressPairWithName[] = [ { @@ -58,14 +57,14 @@ const menuItems: readonly ActionMenuItem[] = [ }, ]; -storiesOf(`${bierzoRoot}/Address Manage`, module) +storiesOf(`${bierzoRoot}/Account Manage`, module) .addParameters({ viewport: { defaultViewport: "responsive" } }) - .add("Manage names", () => ( + .add("Manage sample", () => ( - )); diff --git a/packages/bierzo-wallet/src/routes/addressManage/ManageName.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.tsx similarity index 52% rename from packages/bierzo-wallet/src/routes/addressManage/ManageName.tsx rename to packages/bierzo-wallet/src/components/AccountManage/index.tsx index b4be010d6..a09e79a7b 100644 --- a/packages/bierzo-wallet/src/routes/addressManage/ManageName.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.tsx @@ -3,6 +3,7 @@ import clipboardCopy from "clipboard-copy"; import { ActionMenu, ActionMenuItem, + Avatar, Block, Hairline, Image, @@ -14,17 +15,73 @@ import { } from "medulas-react-components"; import React from "react"; -import { history } from ".."; -import AddressesTable from "../../components/AddressesTable"; -import copy from "../../components/AddressesTable/assets/copy.svg"; -import { BwUsernameWithChainName } from "../addresses"; -import { REGISTER_IOVNAME_ROUTE } from "../paths"; -import { AddressesTooltipHeader, TooltipContent } from "../register"; +import { BwAccount } from "../../store/accounts"; +import { BwUsername } from "../../store/usernames"; +import { formatDate, formatTime } from "../../utils/date"; +import AddressesTable, { ChainAddressPairWithName } from "../AddressesTable"; +import copy from "../AddressesTable/assets/copy.svg"; +import shield from "./assets/shield.svg"; + +const registerTooltipIcon = shield; + +const useTooltipHeaderStyles = makeStyles({ + addressesHeader: { + backgroundColor: "#31E6C9", + fontSize: "27.5px", + width: 56, + height: 56, + }, +}); + +export function AddressesTooltipHeader(): JSX.Element { + const classes = useTooltipHeaderStyles(); + const avatarClasses = { root: classes.addressesHeader }; + return {registerTooltipIcon}; +} + +interface TooltipContentProps { + readonly header: React.ReactNode; + readonly title: string; + readonly children: React.ReactNode; +} + +export function TooltipContent({ children, title, header }: TooltipContentProps): JSX.Element { + return ( + + {header} + + + {title} + + + {children} + + + ); +} + +export interface BwUsernameWithChainName extends BwUsername { + readonly addresses: readonly ChainAddressPairWithName[]; +} + +export interface BwAccountWithChainName extends BwAccount { + readonly addresses: readonly ChainAddressPairWithName[]; +} + +type AccountModuleMixedType = BwUsernameWithChainName | BwAccountWithChainName; interface Props { - readonly account: BwUsernameWithChainName; + readonly account: AccountModuleMixedType; readonly menuItems: readonly ActionMenuItem[]; - readonly onRegisterUsername: () => void; + readonly onEditAccount: () => void; +} + +export function isUsernameData(account: AccountModuleMixedType): account is BwUsernameWithChainName { + return typeof (account as BwUsername).username !== "undefined"; +} + +export function isAccountData(account: AccountModuleMixedType): account is BwAccountWithChainName { + return typeof (account as BwAccount).name !== "undefined"; } const usePaper = makeStyles({ @@ -41,18 +98,21 @@ const useStyles = makeStyles({ cursor: "pointer", }, }); -const ManageName: React.FunctionComponent = ({ account, menuItems, onRegisterUsername }) => { + +const AccountManage: React.FunctionComponent = ({ account, menuItems, onEditAccount }) => { const paperClasses = usePaper(); const classes = useStyles(); const toast = React.useContext(ToastContext); const onAccountCopy = (): void => { - clipboardCopy(account.username); + const name = isAccountData(account) ? account.name : account.username; + clipboardCopy(name); toast.show("Account has been copied to clipboard.", ToastVariant.INFO); }; const onEdit = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, account); + onEditAccount(); + // history.push(REGISTER_IOVNAME_ROUTE, account); }; return ( @@ -68,16 +128,18 @@ const ManageName: React.FunctionComponent = ({ account, menuItems, onRegi > - {account.username} + {isAccountData(account) ? account.name : account.username} Copy - - Expires on 19/12/2025 - + {isAccountData(account) && ( + + Expires on {formatDate(account.expiryDate)} {formatTime(account.expiryDate)} + + )} @@ -118,4 +180,4 @@ const ManageName: React.FunctionComponent = ({ account, menuItems, onRegi ); }; -export default ManageName; +export default AccountManage; diff --git a/packages/bierzo-wallet/src/routes/addressManage/index.tsx b/packages/bierzo-wallet/src/routes/addressManage/index.tsx deleted file mode 100644 index d8451d793..000000000 --- a/packages/bierzo-wallet/src/routes/addressManage/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { ActionMenuItem, Block } from "medulas-react-components"; -import * as React from "react"; - -import { history } from ".."; -import PageMenu from "../../components/PageMenu"; -import { BwUsernameWithChainName } from "../addresses"; -import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; -import ManageName from "./ManageName"; - -function onRegisterUsername(): void { - history.push(REGISTER_IOVNAME_ROUTE); -} - -function onRegisterStarname(): void { - history.push(REGISTER_STARNAME_ROUTE); -} - -const menuItems: readonly ActionMenuItem[] = [ - { title: "Renew", action: () => console.log("Renew") }, - { title: "Transfer iovname", action: () => console.log("Transfer iovname") }, - { title: "Delete iovname", action: () => console.log("Delete iovname") }, -]; - -const AddressManage = (): JSX.Element => { - const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; - - if (!aadressToManage) { - throw new Error("No address to manage provided, something wrong."); - } - - return ( - - - - - - ); -}; - -export default AddressManage; From 076cbc59e084b17f61aa7ffe5bfd0df7800da1cc Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 19:53:36 +0200 Subject: [PATCH 142/204] Pick out account update component --- .../AccountEdit/SelectAddressesTable.tsx | 225 ++++++++++++++ .../src/components/AccountEdit/index.tsx | 278 ++++++++++++++++++ 2 files changed, 503 insertions(+) create mode 100644 packages/bierzo-wallet/src/components/AccountEdit/SelectAddressesTable.tsx create mode 100644 packages/bierzo-wallet/src/components/AccountEdit/index.tsx diff --git a/packages/bierzo-wallet/src/components/AccountEdit/SelectAddressesTable.tsx b/packages/bierzo-wallet/src/components/AccountEdit/SelectAddressesTable.tsx new file mode 100644 index 000000000..1c765d876 --- /dev/null +++ b/packages/bierzo-wallet/src/components/AccountEdit/SelectAddressesTable.tsx @@ -0,0 +1,225 @@ +import { Address, ChainId } from "@iov/bcp"; +import { Table, TableBody, TableCell, TableRow } from "@material-ui/core"; +import { Theme } from "@material-ui/core"; +import { FormApi } from "final-form"; +import { + defaultColor, + InputGroup, + makeStyles, + SelectField, + SelectFieldItem, + TextField, + Typography, +} from "medulas-react-components"; +import React from "react"; +import { randomString } from "ui-logic"; + +import { ChainAddressPairWithName } from "../AddressesTable"; + +export const addressValueField = "address-value-field"; +export const blockchainValueField = "blockchain-value-field"; +const emptySelectorName = "Select"; + +export const getAddressInputName = (id: string): string => `${id}-${addressValueField}`; +export const getBlockchainInputName = (id: string): string => `${id}-${blockchainValueField}`; + +const useStyles = makeStyles((theme: Theme) => ({ + cell: { + padding: `${theme.spacing(1)}px ${theme.spacing(4)}px ${theme.spacing(1)}px 0`, + borderBottom: "1px solid #F3F3F3", + }, + cellHead: { + fontSize: "1.6rem", + border: "none", + fontWeight: "normal", + color: defaultColor, + paddingBottom: `${theme.spacing(2)}px`, + }, + copyCell: { + "& > svg": { + cursor: "pointer", + }, + paddingRight: 0, + }, + link: { + cursor: "pointer", + }, +})); + +export interface SelectAddressItem { + readonly id: string; + readonly chain: ChainAddressPairWithName; +} + +interface RowProps { + readonly form: FormApi; + readonly index: number; + readonly addressItem: SelectAddressItem; + readonly blockChainItems: SelectFieldItem[]; + readonly removeAddress: (idx: number) => void; + readonly removeBlockchainItem: (chain: SelectFieldItem) => void; + readonly addBlockchainItem: (chain: SelectFieldItem) => void; +} + +const AddressRow = ({ + addressItem, + form, + index, + blockChainItems, + removeAddress, + removeBlockchainItem, + addBlockchainItem, +}: RowProps): JSX.Element => { + const classes = useStyles(); + const cellClasses = { + root: classes.cell, + }; + const [selectedBlockchain, setSelectedBlockchain] = React.useState({ + name: addressItem.chain.chainName, + }); + + const onRemove = (): void => { + addBlockchainItem(selectedBlockchain); + removeAddress(index); + }; + + const onSelectionChanged = (value: SelectFieldItem | undefined): void => { + if (value) { + addBlockchainItem(selectedBlockchain); + setSelectedBlockchain(value); + removeBlockchainItem(value); + } + }; + + return ( + + + 0 ? emptySelectorName : undefined} + onChangeCallback={onSelectionChanged} + /> + } + > + + + + + + Remove + + + + ); +}; + +interface TableProps { + readonly form: FormApi; + readonly chainAddressesItems: SelectAddressItem[]; + readonly availableBlockchains: readonly ChainAddressPairWithName[]; +} + +const SelectAddressesTable = ({ + availableBlockchains, + chainAddressesItems, + form, +}: TableProps): JSX.Element => { + const [chainItems, setChainItems] = React.useState([]); + const [blockChainItems, setBlockchainItems] = React.useState([]); + + React.useEffect(() => { + const addressesChains = chainAddressesItems.map(address => address.chain.chainId); + const items = availableBlockchains + .filter(item => !addressesChains.includes(item.chainId)) + .map(item => ({ name: item.chainName })); + + setBlockchainItems(items); + setChainItems(chainAddressesItems); + }, [availableBlockchains, chainAddressesItems]); + + const removeBlockchainItem = (chain: SelectFieldItem): void => { + setBlockchainItems(oldItems => { + const newItem = oldItems.filter(item => item.name !== chain.name); + return newItem; + }); + }; + + const addBlockchainItem = (chain: SelectFieldItem): void => { + if (chain.name !== emptySelectorName) { + setBlockchainItems(oldItems => { + const newItem = [...oldItems, chain]; + newItem.sort((a, b) => a.name.localeCompare(b.name, undefined, { sensitivity: "base" })); + return newItem; + }); + } + }; + + const addAddress = (): void => { + const newItems = [ + ...chainItems, + { + id: randomString(5), + chain: { + address: "" as Address, + chainId: "" as ChainId, + chainName: emptySelectorName, + }, + }, + ]; + setChainItems(newItems); + }; + + const removeAddress = (idx: number): void => { + const newItems = [...chainItems]; + const [removedItem] = newItems.splice(idx, 1); + + form.batch(() => { + form.change(getBlockchainInputName(removedItem.id), null); + form.change(getAddressInputName(removedItem.id), null); + }); + + setChainItems(newItems); + }; + + const allowAddChain = chainItems.length < availableBlockchains.length; + + return ( + + + + {chainItems.map((addressItem, index) => ( + + ))} + +
+ {allowAddChain && ( + + + Add more + + )} +
+ ); +}; + +export default SelectAddressesTable; diff --git a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx new file mode 100644 index 000000000..4f564c3b0 --- /dev/null +++ b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx @@ -0,0 +1,278 @@ +import { Address, Fee } from "@iov/bcp"; +import { FieldValidator } from "final-form"; +import { + Back, + Block, + Button, + FieldInputValue, + Form, + FormValues, + Hairline, + Image, + makeStyles, + TextField, + Tooltip, + Typography, + useForm, +} from "medulas-react-components"; +import React from "react"; +import { amountToString } from "ui-logic"; + +import { + AddressesTooltipHeader, + BwAccountWithChainName, + BwUsernameWithChainName, + isAccountData, + isUsernameData, + TooltipContent, +} from "../AccountManage"; +import { AddressesTableProps, ChainAddressPairWithName } from "../AddressesTable"; +import shield from "../assets/shield.svg"; +import PageContent from "../PageContent"; +import SelectAddressesTable, { + addressValueField, + blockchainValueField, + getAddressInputName, + getBlockchainInputName, + SelectAddressItem, +} from "./SelectAddressesTable"; + +export const EDIT_ACCOUNT_VIEW_ID = "edit-account-view-id"; +export const EDIT_ACCOUNT_FIELD = "edit-account-field"; + +export function getChainAddressPairsFromValues( + values: FormValues, + addresses: readonly ChainAddressPairWithName[], +): readonly ChainAddressPairWithName[] { + const chainAddressMap: Map> = new Map< + string, + Partial + >(); + Object.keys(values).forEach(key => { + const idxLenght = key.indexOf("-"); + if (idxLenght === -1) return; + + const index = key.substr(0, idxLenght); + let pair = chainAddressMap.get(index); + if (!pair) { + pair = {}; + } + + const type = key.substr(idxLenght + 1); + switch (type) { + case addressValueField: { + pair = { ...pair, address: values[key] as Address }; + break; + } + case blockchainValueField: { + const chain = addresses.find(address => address.chainName === values[key]); + if (chain) { + pair = { ...pair, chainId: chain.chainId, chainName: chain.chainName }; + } + break; + } + } + + chainAddressMap.set(index, pair); + }); + + const chainAddressPair: ChainAddressPairWithName[] = []; + chainAddressMap.forEach(value => { + if (value.address && value.chainId && value.chainName) { + chainAddressPair.push({ + address: value.address, + chainId: value.chainId, + chainName: value.chainName, + }); + } + }); + + return chainAddressPair; +} + +export function getSubmitButtonCaption(fee: Fee | undefined): string { + if (fee && fee.tokens) { + return `Register for ${amountToString(fee.tokens)}`; + } + + return "Register"; +} + +export function getFormInitValues(addressItems: SelectAddressItem[]): FormValues { + const initialValues: FormValues = {}; + addressItems.forEach(item => { + initialValues[getAddressInputName(item.id)] = item.chain.address; + initialValues[getBlockchainInputName(item.id)] = item.chain.chainName; + }); + + return initialValues; +} + +export function getAddressItems(chainAddresses: readonly ChainAddressPairWithName[]): SelectAddressItem[] { + const addressItems: SelectAddressItem[] = []; + chainAddresses.forEach((chain, index) => { + addressItems.push({ + id: index.toString(), + chain, + }); + }); + + return addressItems; +} + +const registerIcon = shield; + +const useStyles = makeStyles({ + iovnameHeader: { + boxShadow: "0px 0px 14px #EDEFF4", + }, +}); + +export function NoIovnameHeader(): JSX.Element { + const classes = useStyles(); + return ( + + + yourname*iov + + + ); +} + +export interface AccountEditProps extends AddressesTableProps { + readonly onCancel: () => void; + readonly account: BwUsernameWithChainName | BwAccountWithChainName | undefined; + readonly transactionFee: Fee | undefined; +} + +interface Props extends AccountEditProps { + readonly accountValidator: FieldValidator; + readonly onSubmit: (values: object) => Promise; +} + +const AccountEdit = ({ + accountValidator, + chainAddresses, + account, + onCancel, + transactionFee, + onSubmit, +}: Props): JSX.Element => { + const chainAddressesItems = React.useMemo(() => { + if (account) { + return getAddressItems(account.addresses); + } + return getAddressItems(chainAddresses); + }, [chainAddresses, account]); + + const initialValues = React.useMemo(() => getFormInitValues(chainAddressesItems), [chainAddressesItems]); + const { form, handleSubmit, invalid, submitting, validating } = useForm({ + onSubmit, + initialValues, + }); + + const buttons = ( + + + + + + + Cancel + + + + ); + + return ( +
+ + + {account && ( + + {isUsernameData(account) && account.username} + {isAccountData(account) && `${account.name}*${account.domain}`} + + )} + {!account && ( + + + + Create your iovname + + + + } title="Choose your address"> + With IOV you can choose your easy to read human readable address. No more complicated + cryptography when sending to friends. + + + + + How it works + + + + + + + + )} + + + + + + CHOOSE LINKED ADDRESSES + + + + + + } title="Your linked addresses"> + With Neuma you can have an universal blockchain address that is linked to all your + addresses. Just give your friends your iovname. + + + + + + + + Optional + + + + + + +
+ ); +}; + +export default AccountEdit; From e1ada6873a26e9f75fd43c5a7c9808df414687eb Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 19:54:42 +0200 Subject: [PATCH 143/204] Add Iovname manage route --- .../routes/IovnameManage/index.stories.tsx | 70 +++++++++++++++++++ .../src/routes/IovnameManage/index.tsx | 43 ++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/IovnameManage/index.stories.tsx create mode 100644 packages/bierzo-wallet/src/routes/IovnameManage/index.tsx diff --git a/packages/bierzo-wallet/src/routes/IovnameManage/index.stories.tsx b/packages/bierzo-wallet/src/routes/IovnameManage/index.stories.tsx new file mode 100644 index 000000000..38f9fba9f --- /dev/null +++ b/packages/bierzo-wallet/src/routes/IovnameManage/index.stories.tsx @@ -0,0 +1,70 @@ +import { Address, ChainId } from "@iov/bcp"; +import { action } from "@storybook/addon-actions"; +import { linkTo } from "@storybook/addon-links"; +import { storiesOf } from "@storybook/react"; +import { ActionMenuItem } from "medulas-react-components"; +import React from "react"; + +import AccountManage, { BwUsernameWithChainName } from "../../components/AccountManage"; +import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import { + REGISTER_IOVNAME_REGISTRATION_STORY_PATH, + REGISTER_IOVNAME_STORY_PATH, +} from "../../routes/register/index.stories"; +import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; + +const chainAddresses: ChainAddressPairWithName[] = [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, + chainName: "IOV Devnet", + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "1349293588603668134L" as Address, + chainName: "Lisk Devnet", + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0xD383382350F9f190Bd2608D6381B15b4e1cec0f3" as Address, + chainName: "Ganache", + }, +]; + +const username: BwUsernameWithChainName = { + username: "test2*iov", + addresses: [chainAddresses[0], chainAddresses[1]], +}; + +const menuItems: readonly ActionMenuItem[] = [ + { + title: "Renew", + action: () => { + action("Renew")(); + }, + }, + { + title: "Transfer iovname", + action: () => { + action("Transfer iovname")(); + }, + }, + { + title: "Delete iovname", + action: () => { + action("Delete iovname")(); + }, + }, +]; + +storiesOf(`${bierzoRoot}/Account Manage`, module) + .addParameters({ viewport: { defaultViewport: "responsive" } }) + .add("Manage iovnames", () => ( + + + + )); diff --git a/packages/bierzo-wallet/src/routes/IovnameManage/index.tsx b/packages/bierzo-wallet/src/routes/IovnameManage/index.tsx new file mode 100644 index 000000000..6ad8404b3 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/IovnameManage/index.tsx @@ -0,0 +1,43 @@ +import { ActionMenuItem, Block } from "medulas-react-components"; +import * as React from "react"; + +import { history } from ".."; +import AccountManage, { BwUsernameWithChainName } from "../../components/AccountManage"; +import PageMenu from "../../components/PageMenu"; +import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; + +function onRegisterUsername(): void { + history.push(REGISTER_IOVNAME_ROUTE); +} + +function onRegisterStarname(): void { + history.push(REGISTER_STARNAME_ROUTE); +} + +const menuItems: readonly ActionMenuItem[] = [ + { title: "Renew", action: () => console.log("Renew") }, + { title: "Transfer iovname", action: () => console.log("Transfer iovname") }, + { title: "Delete iovname", action: () => console.log("Delete iovname") }, +]; + +const AddressManage = (): JSX.Element => { + const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; + + if (!aadressToManage) { + throw new Error("No address to manage provided, something wrong."); + } + + const onEditAccount = (): void => { + history.push(REGISTER_IOVNAME_ROUTE, aadressToManage); + }; + + return ( + + + + + + ); +}; + +export default AddressManage; From 98982ae8763d6d4fe56fed4ee14e1f175fabd194 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 19:55:03 +0200 Subject: [PATCH 144/204] Add name manage route --- .../src/routes/NameManage/index.stories.tsx | 72 +++++++++++++++++++ .../src/routes/NameManage/index.tsx | 43 +++++++++++ 2 files changed, 115 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/NameManage/index.stories.tsx create mode 100644 packages/bierzo-wallet/src/routes/NameManage/index.tsx diff --git a/packages/bierzo-wallet/src/routes/NameManage/index.stories.tsx b/packages/bierzo-wallet/src/routes/NameManage/index.stories.tsx new file mode 100644 index 000000000..364647237 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/NameManage/index.stories.tsx @@ -0,0 +1,72 @@ +import { Address, ChainId } from "@iov/bcp"; +import { action } from "@storybook/addon-actions"; +import { linkTo } from "@storybook/addon-links"; +import { storiesOf } from "@storybook/react"; +import { ActionMenuItem } from "medulas-react-components"; +import React from "react"; + +import AccountManage, { BwAccountWithChainName } from "../../components/AccountManage"; +import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import { + REGISTER_IOVNAME_REGISTRATION_STORY_PATH, + REGISTER_IOVNAME_STORY_PATH, +} from "../../routes/register/index.stories"; +import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; + +const chainAddresses: ChainAddressPairWithName[] = [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, + chainName: "IOV Devnet", + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "1349293588603668134L" as Address, + chainName: "Lisk Devnet", + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0xD383382350F9f190Bd2608D6381B15b4e1cec0f3" as Address, + chainName: "Ganache", + }, +]; + +const account: BwAccountWithChainName = { + name: "test2", + domain: "iov", + expiryDate: new Date(), + addresses: [chainAddresses[0], chainAddresses[1]], +}; + +const menuItems: readonly ActionMenuItem[] = [ + { + title: "Renew", + action: () => { + action("Renew")(); + }, + }, + { + title: "Transfer iovname", + action: () => { + action("Transfer iovname")(); + }, + }, + { + title: "Delete iovname", + action: () => { + action("Delete iovname")(); + }, + }, +]; + +storiesOf(`${bierzoRoot}/Account Manage`, module) + .addParameters({ viewport: { defaultViewport: "responsive" } }) + .add("Manage name", () => ( + + + + )); diff --git a/packages/bierzo-wallet/src/routes/NameManage/index.tsx b/packages/bierzo-wallet/src/routes/NameManage/index.tsx new file mode 100644 index 000000000..6ad8404b3 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/NameManage/index.tsx @@ -0,0 +1,43 @@ +import { ActionMenuItem, Block } from "medulas-react-components"; +import * as React from "react"; + +import { history } from ".."; +import AccountManage, { BwUsernameWithChainName } from "../../components/AccountManage"; +import PageMenu from "../../components/PageMenu"; +import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; + +function onRegisterUsername(): void { + history.push(REGISTER_IOVNAME_ROUTE); +} + +function onRegisterStarname(): void { + history.push(REGISTER_STARNAME_ROUTE); +} + +const menuItems: readonly ActionMenuItem[] = [ + { title: "Renew", action: () => console.log("Renew") }, + { title: "Transfer iovname", action: () => console.log("Transfer iovname") }, + { title: "Delete iovname", action: () => console.log("Delete iovname") }, +]; + +const AddressManage = (): JSX.Element => { + const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; + + if (!aadressToManage) { + throw new Error("No address to manage provided, something wrong."); + } + + const onEditAccount = (): void => { + history.push(REGISTER_IOVNAME_ROUTE, aadressToManage); + }; + + return ( + + + + + + ); +}; + +export default AddressManage; From 7612d209dd47e95039045f925bdf0ac6f357f077 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 19:55:32 +0200 Subject: [PATCH 145/204] Add Iov name edit route --- .../src/routes/IovnameEdit/assets/shield.svg | 3 + .../IovnameEdit/components/ConfirmUpdate.tsx | 86 ++++++++ .../src/routes/IovnameEdit/index.stories.tsx | 72 +++++++ .../src/routes/IovnameEdit/index.tsx | 195 ++++++++++++++++++ 4 files changed, 356 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/IovnameEdit/assets/shield.svg create mode 100644 packages/bierzo-wallet/src/routes/IovnameEdit/components/ConfirmUpdate.tsx create mode 100644 packages/bierzo-wallet/src/routes/IovnameEdit/index.stories.tsx create mode 100644 packages/bierzo-wallet/src/routes/IovnameEdit/index.tsx diff --git a/packages/bierzo-wallet/src/routes/IovnameEdit/assets/shield.svg b/packages/bierzo-wallet/src/routes/IovnameEdit/assets/shield.svg new file mode 100644 index 000000000..ca39313b2 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/IovnameEdit/assets/shield.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/bierzo-wallet/src/routes/IovnameEdit/components/ConfirmUpdate.tsx b/packages/bierzo-wallet/src/routes/IovnameEdit/components/ConfirmUpdate.tsx new file mode 100644 index 000000000..970c87f83 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/IovnameEdit/components/ConfirmUpdate.tsx @@ -0,0 +1,86 @@ +import { TransactionId } from "@iov/bcp"; +import clipboardCopy from "clipboard-copy"; +import { + Block, + Button, + Image, + makeStyles, + ToastContext, + ToastVariant, + Typography, +} from "medulas-react-components"; +import React from "react"; + +import copySvg from "../../../assets/copy.svg"; +import tickSvg from "../../../assets/tick.svg"; +import PageContent from "../../../components/PageContent"; + +export const UPDATE_CONFIRMATION_VIEW_ID = "update-confirmation-view-id"; + +const useClasses = makeStyles({ + txId: { + whiteSpace: "pre-wrap", + wordWrap: "break-word", + }, + copyButton: { + cursor: "pointer", + }, +}); + +const tickIcon = Tick; +const copyIcon = Tick; + +interface Props { + readonly transactionId: TransactionId; + readonly onSeeTrasactions: () => void; +} + +const ConfirmRegistration = ({ transactionId, onSeeTrasactions }: Props): JSX.Element => { + const toast = React.useContext(ToastContext); + const classes = useClasses(); + + const buttons = ( + + + + + + ); + + const copyTxId = (): void => { + clipboardCopy(transactionId); + toast.show("Address has been copied to clipboard.", ToastVariant.INFO); + }; + + return ( + + + Your account update request was successfully signed and sent to the network. + + + + Transaction ID + + + + + {transactionId} + + + {copyIcon} + + + + ); +}; + +export default ConfirmRegistration; diff --git a/packages/bierzo-wallet/src/routes/IovnameEdit/index.stories.tsx b/packages/bierzo-wallet/src/routes/IovnameEdit/index.stories.tsx new file mode 100644 index 000000000..52793d583 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/IovnameEdit/index.stories.tsx @@ -0,0 +1,72 @@ +import { TransactionId } from "@iov/bcp"; +import { linkTo } from "@storybook/addon-links"; +import { storiesOf } from "@storybook/react"; +import React from "react"; + +import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; +import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../transactions/index.stories"; +import ConfirmRegistration from "./components/ConfirmRegistration"; + +export const REGISTER_IOVNAME_STORY_PATH = `${bierzoRoot}/Register Iovname`; +export const REGISTER_IOVNAME_REGISTRATION_STORY_PATH = "Register Iovname"; +// const REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Username without fee"; +const REGISTER_IOVNAME_CONFIRMATION_STORY_PATH = "Registration confirmation"; + +/* const addresses: ChainAddressPairWithName[] = [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, + chainName: "IOV Devnet", + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "1349293588603668134L" as Address, + chainName: "Lisk Devnet", + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0xD383382350F9f190Bd2608D6381B15b4e1cec0f3" as Address, + chainName: "Ganache", + }, +]; + +const iov: Pick = { + fractionalDigits: 9, + tokenTicker: "IOV" as TokenTicker, +}; + +const fee: Fee = { + tokens: stringToAmount("5", iov), +}; */ + +storiesOf(REGISTER_IOVNAME_STORY_PATH, module) + .addParameters({ viewport: { defaultViewport: "responsive" } }) + // TODO adapt this stories to new components + /* .add(REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( + + + + )) + .add(REGISTER_USERNAME_REGISTRATION_STORY_PATH, () => ( + + + + )) */ + .add(REGISTER_IOVNAME_CONFIRMATION_STORY_PATH, () => ( + + + + )); diff --git a/packages/bierzo-wallet/src/routes/IovnameEdit/index.tsx b/packages/bierzo-wallet/src/routes/IovnameEdit/index.tsx new file mode 100644 index 000000000..bdb54a409 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/IovnameEdit/index.tsx @@ -0,0 +1,195 @@ +import { ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; +import { BnsConnection } from "@iov/bns"; +import { FieldValidator } from "final-form"; +import { + BillboardContext, + FieldInputValue, + FormValues, + ToastContext, + ToastVariant, +} from "medulas-react-components"; +import React from "react"; +import * as ReactRedux from "react-redux"; + +import { history } from ".."; +import { + generateRegisterUsernameTxRequest, + generateRegisterUsernameTxWithFee, +} from "../../communication/requestgenerators"; +import AccountEdit, { + EDIT_ACCOUNT_FIELD, + getChainAddressPairsFromValues, +} from "../../components/AccountEdit"; +import { BwUsernameWithChainName } from "../../components/AccountManage"; +import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import LedgerBillboardMessage from "../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../components/BillboardMessage/NeumaBillboardMessage"; +import PageMenu from "../../components/PageMenu"; +import { getConfig, SupportedChain } from "../../config"; +import { isValidIov } from "../../logic/account"; +import { getConnectionForChainId } from "../../logic/connection"; +import { ExtendedIdentity } from "../../store/identities"; +import { RootState } from "../../store/reducers"; +import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; +import { IOVNAME_MANAGE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; +import ConfirmRegistration from "./components/ConfirmUpdate"; + +function onSeeTrasactions(): void { + history.push(TRANSACTIONS_ROUTE); +} + +export function getBnsIdentity(identities: ReadonlyMap): Identity | undefined { + for (const identity of Array.from(identities.values()).map(ext => ext.identity)) { + if (getConnectionForChainId(identity.chainId) instanceof BnsConnection) { + return identity; + } + } + return undefined; +} + +async function getPersonalizedAddressRegistrationFee( + bnsIdentity: Identity, + addresses: readonly ChainAddressPairWithName[], +): Promise { + const transactionWithFee = await generateRegisterUsernameTxWithFee(bnsIdentity, "feetest*iov", addresses); + + return transactionWithFee.fee; +} + +const Register = (): JSX.Element => { + const [transactionId, setTransactionId] = React.useState(null); + const [transactionFee, setTransactionFee] = React.useState(undefined); + const [supportedChains, setSupportedChains] = React.useState([]); + + const rpcEndpoint = ReactRedux.useSelector((state: RootState) => state.rpcEndpoint); + const identities = ReactRedux.useSelector((state: RootState) => state.identities); + const addressesSorted = React.useMemo( + () => getChainAddressPairWithNamesSorted(identities, supportedChains), + [identities, supportedChains], + ); + + const bnsIdentity = getBnsIdentity(identities); + const account: BwUsernameWithChainName | undefined = history.location.state; + + if (!bnsIdentity) throw new Error("No BNS identity available."); + if (!rpcEndpoint) throw new Error("RPC endpoint not set in redux store. This is a bug."); + + React.useEffect(() => { + let isSubscribed = true; + async function getFeeAndConfig( + bnsIdentity: Identity, + addresses: readonly ChainAddressPairWithName[], + ): Promise { + const fee = await getPersonalizedAddressRegistrationFee(bnsIdentity, addresses); + const config = await getConfig(); + + if (isSubscribed) { + setTransactionFee(fee); + setSupportedChains(config.supportedChains); + } + } + getFeeAndConfig(bnsIdentity, addressesSorted); + + return () => { + isSubscribed = false; + }; + }, [addressesSorted, bnsIdentity]); + + const onReturnToManage = (): void => { + history.push(IOVNAME_MANAGE_ROUTE, account); + }; + + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const iovnameValidator: FieldValidator = (value): string | undefined => { + if (!account) { + if (!value) { + return "Required"; + } + + const checkResult = isValidIov(value); + + switch (checkResult) { + case "not_iov": + return "Iovname must end with *iov"; + case "wrong_number_of_asterisks": + return "Iovname must include only one namespace"; + case "too_short": + return "Iovname should be at least 3 characters"; + case "too_long": + return "Iovname should be maximum 64 characters"; + case "wrong_chars": + return "Iovname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; + case "valid": + break; + default: + throw new Error(`"Unknown iovname validation error: ${checkResult}`); + } + } + + return undefined; + }; + + const onSubmit = async (values: object): Promise => { + const formValues = values as FormValues; + + const addressesToRegister = getChainAddressPairsFromValues(formValues, addressesSorted); + + try { + const request = await generateRegisterUsernameTxRequest( + bnsIdentity, + formValues[EDIT_ACCOUNT_FIELD], + addressesToRegister, + ); + + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + return ( + + {transactionId ? ( + + ) : ( + + )} + + ); +}; + +export default Register; From b6e7b405e928f081ff1fa42e2f2bd5a5759de42b Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 19:55:59 +0200 Subject: [PATCH 146/204] Add route paths and configure Router --- packages/bierzo-wallet/src/routes/index.tsx | 9 ++++++--- packages/bierzo-wallet/src/routes/paths.ts | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index 266a9b11b..444c6674a 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -4,14 +4,16 @@ import { Route, Router, Switch } from "react-router"; import RequireLogin from "../components/RequireLogin"; import Addresses from "./addresses"; -import AddressManage from "./addressManage"; import Balance from "./balance"; +import IovnameManage from "./IovnameManage"; import Login from "./login"; +import NameManage from "./NameManage"; import { - ADDRESS_MANAGE_ROUTE, ADDRESSES_ROUTE, BALANCE_ROUTE, + IOVNAME_MANAGE_ROUTE, LOGIN_ROUTE, + NAME_MANAGE_ROUTE, PAYMENT_ROUTE, POLICY_ROUTE, REGISTER_IOVNAME_ROUTE, @@ -36,7 +38,8 @@ const Routes = (): JSX.Element => ( - + + } /> diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index ab0e87a73..e8b887724 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -8,5 +8,8 @@ export const REGISTER_IOVNAME_ROUTE = "/iovname/register"; export const REGISTER_STARNAME_ROUTE = "/starname/register"; export const REGISTER_NAME_ROUTE = "/name/register"; export const ADDRESS_MANAGE_ROUTE = "/address-manage"; +export const IOVNAME_MANAGE_ROUTE = "/iovname/manage"; +export const IOVNAME_EDIT_ROUTE = "/iovname/edit"; +export const NAME_MANAGE_ROUTE = "/name/manage"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; From 953a47726c48fbb14255b76af628eeeeca1fb14e Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 19:57:05 +0200 Subject: [PATCH 147/204] Change REGISTER_IOVNAME_ROUTE->IOVNAME_MANAGE_ROUTE --- .../src/routes/addresses/components/IovnamesExists.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 54bac677d..f7f3bddd9 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -5,7 +5,7 @@ import React from "react"; import { history } from "../.."; import iovnameLogo from "../../../assets/iovname-logo.svg"; import { BwUsername } from "../../../store/usernames"; -import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { IOVNAME_MANAGE_ROUTE } from "../../paths"; interface Props { readonly iovnames: readonly BwUsername[]; @@ -53,7 +53,7 @@ function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { .sort((a, b) => a.username.localeCompare(b.username, undefined, { sensitivity: "base" })) .map(iovname => { const onManage = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, iovname); + history.push(IOVNAME_MANAGE_ROUTE, iovname); }; return ( From 385b93ad8a264c3fa07713cc776eccb2bc128a98 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 19:57:35 +0200 Subject: [PATCH 148/204] Refactor commonly used functions --- .../src/routes/addresses/index.tsx | 7 +- .../register/components/IovnameForm.tsx | 18 +-- .../routes/register/components/NameForm.tsx | 18 +-- .../register/components/StarnameForm.tsx | 4 +- .../src/routes/register/index.tsx | 130 +----------------- 5 files changed, 25 insertions(+), 152 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index 13b6e9b5d..0577bfc08 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -2,20 +2,15 @@ import React from "react"; import * as ReactRedux from "react-redux"; import { history } from ".."; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import { BwUsernameWithChainName } from "../../components/AccountManage"; import PageMenu from "../../components/PageMenu"; import { getChainName } from "../../config"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; -import { BwUsername } from "../../store/usernames"; import { getChainAddressPairWithNames } from "../../utils/tokens"; import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; import AddressesTab from "./components/AddressesTab"; -export interface BwUsernameWithChainName extends BwUsername { - readonly addresses: readonly ChainAddressPairWithName[]; -} - function onRegisterIovname(): void { history.push(REGISTER_IOVNAME_ROUTE); } diff --git a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx index 95920563b..7f59d4d75 100644 --- a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx @@ -22,24 +22,26 @@ import { import React from "react"; import { - AddressesTooltipHeader, + generateRegisterUsernameTxRequest, + generateUpdateUsernameTxRequest, +} from "../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import { getAddressItems, getChainAddressPairsFromValues, getFormInitValues, getSubmitButtonCaption, - TooltipContent, -} from ".."; +} from "../../../components/AccountEdit"; import { - generateRegisterUsernameTxRequest, - generateUpdateUsernameTxRequest, -} from "../../../communication/requestgenerators"; -import { RpcEndpoint } from "../../../communication/rpcEndpoint"; + AddressesTooltipHeader, + BwUsernameWithChainName, + TooltipContent, +} from "../../../components/AccountManage"; import { AddressesTableProps } from "../../../components/AddressesTable"; import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; import PageContent from "../../../components/PageContent"; import { isValidIov } from "../../../logic/account"; -import { BwUsernameWithChainName } from "../../addresses"; import shield from "../assets/shield.svg"; import SelectAddressesTable from "./SelectAddressesTable"; diff --git a/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx index ded037979..aab76085e 100644 --- a/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx @@ -23,24 +23,26 @@ import { import React from "react"; import { - AddressesTooltipHeader, + generateRegisterAccountTxRequest, + generateReplaceAccountTargetsTxRequest, +} from "../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import { getAddressItems, getChainAddressPairsFromValues, getFormInitValues, getSubmitButtonCaption, - TooltipContent, -} from ".."; +} from "../../../components/AccountEdit"; import { - generateRegisterAccountTxRequest, - generateReplaceAccountTargetsTxRequest, -} from "../../../communication/requestgenerators"; -import { RpcEndpoint } from "../../../communication/rpcEndpoint"; + AddressesTooltipHeader, + BwUsernameWithChainName, + TooltipContent, +} from "../../../components/AccountManage"; import { AddressesTableProps } from "../../../components/AddressesTable"; import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; import PageContent from "../../../components/PageContent"; import { isValidName } from "../../../logic/account"; -import { BwUsernameWithChainName } from "../../addresses"; import shield from "../assets/shield.svg"; import SelectAddressesTable from "./SelectAddressesTable"; diff --git a/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx index 36c2318a3..0b5c3bde9 100644 --- a/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx @@ -19,14 +19,14 @@ import { } from "medulas-react-components"; import React from "react"; -import { getSubmitButtonCaption, TooltipContent } from ".."; import { generateRegisterDomainTxRequest } from "../../../communication/requestgenerators"; import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +import { getSubmitButtonCaption } from "../../../components/AccountEdit"; +import { BwUsernameWithChainName, TooltipContent } from "../../../components/AccountManage"; import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; import PageContent from "../../../components/PageContent"; import { isValidStarname } from "../../../logic/account"; -import { BwUsernameWithChainName } from "../../addresses"; import shield from "../assets/shield.svg"; export const REGISTER_STARNAME_VIEW_ID = "register-starname-view-id"; diff --git a/packages/bierzo-wallet/src/routes/register/index.tsx b/packages/bierzo-wallet/src/routes/register/index.tsx index 8e06ee5bb..b9995f5a2 100644 --- a/packages/bierzo-wallet/src/routes/register/index.tsx +++ b/packages/bierzo-wallet/src/routes/register/index.tsx @@ -1,12 +1,13 @@ import { Address, ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; import { BnsConnection } from "@iov/bns"; -import { Avatar, Block, FormValues, Image, makeStyles, Typography } from "medulas-react-components"; +import { FormValues } from "medulas-react-components"; import React from "react"; import * as ReactRedux from "react-redux"; import { amountToString } from "ui-logic"; import { history } from ".."; import { generateRegisterUsernameTxWithFee } from "../../communication/requestgenerators"; +import { BwUsernameWithChainName } from "../../components/AccountManage"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; import PageMenu from "../../components/PageMenu"; import { getConfig, SupportedChain } from "../../config"; @@ -14,19 +15,10 @@ import { getConnectionForChainId } from "../../logic/connection"; import { ExtendedIdentity } from "../../store/identities"; import { RootState } from "../../store/reducers"; import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; -import { BwUsernameWithChainName } from "../addresses"; import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; -import shield from "./assets/shield.svg"; import ConfirmRegistration from "./components/ConfirmRegistration"; import IovnameForm from "./components/IovnameForm"; import NameForm from "./components/NameForm"; -import { - addressValueField, - blockchainValueField, - getAddressInputName, - getBlockchainInputName, - SelectAddressItem, -} from "./components/SelectAddressesTable"; import StarnameForm from "./components/StarnameForm"; function onSeeTrasactions(): void { @@ -39,74 +31,6 @@ function onReturnToAddresses(): void { history.push(ADDRESSES_ROUTE); } -const registerTooltipIcon = shield; - -const useStyles = makeStyles({ - addressesHeader: { - backgroundColor: "#31E6C9", - fontSize: "27.5px", - width: 56, - height: 56, - }, -}); - -export function AddressesTooltipHeader(): JSX.Element { - const classes = useStyles(); - const avatarClasses = { root: classes.addressesHeader }; - return {registerTooltipIcon}; -} - -interface TooltipContentProps { - readonly header: React.ReactNode; - readonly title: string; - readonly children: React.ReactNode; -} - -export function TooltipContent({ children, title, header }: TooltipContentProps): JSX.Element { - return ( - - {header} - - - {title} - - - {children} - - - ); -} - -export function getSubmitButtonCaption(fee: Fee | undefined): string { - if (fee && fee.tokens) { - return `Register for ${amountToString(fee.tokens)}`; - } - - return "Register"; -} - -export function getFormInitValues(addressItems: SelectAddressItem[]): FormValues { - const initialValues: FormValues = {}; - addressItems.forEach(item => { - initialValues[getAddressInputName(item.id)] = item.chain.address; - initialValues[getBlockchainInputName(item.id)] = item.chain.chainName; - }); - - return initialValues; -} - -export function getAddressItems(chainAddresses: readonly ChainAddressPairWithName[]): SelectAddressItem[] { - const addressItems: SelectAddressItem[] = []; - chainAddresses.forEach((chain, index) => { - addressItems.push({ - id: index.toString(), - chain, - }); - }); - - return addressItems; -} - export function getBnsIdentity(identities: ReadonlyMap): Identity | undefined { for (const identity of Array.from(identities.values()).map(ext => ext.identity)) { if (getConnectionForChainId(identity.chainId) instanceof BnsConnection) { @@ -125,56 +49,6 @@ async function getPersonalizedAddressRegistrationFee( return transactionWithFee.fee; } -export function getChainAddressPairsFromValues( - values: FormValues, - addresses: readonly ChainAddressPairWithName[], -): readonly ChainAddressPairWithName[] { - const chainAddressMap: Map> = new Map< - string, - Partial - >(); - Object.keys(values).forEach(key => { - const idxLenght = key.indexOf("-"); - if (idxLenght === -1) return; - - const index = key.substr(0, idxLenght); - let pair = chainAddressMap.get(index); - if (!pair) { - pair = {}; - } - - const type = key.substr(idxLenght + 1); - switch (type) { - case addressValueField: { - pair = { ...pair, address: values[key] as Address }; - break; - } - case blockchainValueField: { - const chain = addresses.find(address => address.chainName === values[key]); - if (chain) { - pair = { ...pair, chainId: chain.chainId, chainName: chain.chainName }; - } - break; - } - } - - chainAddressMap.set(index, pair); - }); - - const chainAddressPair: ChainAddressPairWithName[] = []; - chainAddressMap.forEach(value => { - if (value.address && value.chainId && value.chainName) { - chainAddressPair.push({ - address: value.address, - chainId: value.chainId, - chainName: value.chainName, - }); - } - }); - - return chainAddressPair; -} - export enum ToRegister { Iovname = "iovname", Starname = "starname", From d38f5004d41a3c6fde134dd704a8235dc55e80df Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 20:57:37 +0200 Subject: [PATCH 149/204] Add Account Edit story --- .../components/AccountEdit/index.stories.tsx | 72 +++++++++++++++++++ .../src/routes/IovnameEdit/index.stories.tsx | 53 +++++++++----- 2 files changed, 109 insertions(+), 16 deletions(-) create mode 100644 packages/bierzo-wallet/src/components/AccountEdit/index.stories.tsx diff --git a/packages/bierzo-wallet/src/components/AccountEdit/index.stories.tsx b/packages/bierzo-wallet/src/components/AccountEdit/index.stories.tsx new file mode 100644 index 000000000..f7537af93 --- /dev/null +++ b/packages/bierzo-wallet/src/components/AccountEdit/index.stories.tsx @@ -0,0 +1,72 @@ +import { Address, ChainId, Fee, Token, TokenTicker } from "@iov/bcp"; +import { action } from "@storybook/addon-actions"; +import { linkTo } from "@storybook/addon-links"; +import { storiesOf } from "@storybook/react"; +import { FieldValidator } from "final-form"; +import { FieldInputValue } from "medulas-react-components"; +import React from "react"; +import { stringToAmount } from "ui-logic"; + +import AccountEdit from "../../components/AccountEdit"; +import { + ACCOUNT_MANAGE_SAMPLE_STORY_PATH, + ACCOUNT_MANAGE_STORY_PATH, +} from "../../components/AccountManage/index.stories"; +import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; +import { BwUsernameWithChainName } from "../AccountManage"; + +const addresses: ChainAddressPairWithName[] = [ + { + chainId: "local-iov-devnet" as ChainId, + address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, + chainName: "IOV Devnet", + }, + { + chainId: "lisk-198f2b61a8" as ChainId, + address: "1349293588603668134L" as Address, + chainName: "Lisk Devnet", + }, + { + chainId: "ethereum-eip155-5777" as ChainId, + address: "0xD383382350F9f190Bd2608D6381B15b4e1cec0f3" as Address, + chainName: "Ganache", + }, +]; + +const iov: Pick = { + fractionalDigits: 9, + tokenTicker: "IOV" as TokenTicker, +}; + +const fee: Fee = { + tokens: stringToAmount("5", iov), +}; + +const account: BwUsernameWithChainName = { + username: "test*iov", + addresses: addresses, +}; + +const accountValidator: FieldValidator = (value): string | undefined => { + action("Account validation")(value); + return undefined; +}; + +export const UPDATE_ACCOUNT_STORY_PATH = `${bierzoRoot}/Update Account`; +export const UPDATE_ACCOUNT_SAMPLE_STORY_PATH = "Update sample"; + +storiesOf(UPDATE_ACCOUNT_STORY_PATH, module) + .addParameters({ viewport: { defaultViewport: "responsive" } }) + .add(UPDATE_ACCOUNT_SAMPLE_STORY_PATH, () => ( + + => action("Account update submit")(values)} + /> + + )); diff --git a/packages/bierzo-wallet/src/routes/IovnameEdit/index.stories.tsx b/packages/bierzo-wallet/src/routes/IovnameEdit/index.stories.tsx index 52793d583..67e70fa69 100644 --- a/packages/bierzo-wallet/src/routes/IovnameEdit/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/IovnameEdit/index.stories.tsx @@ -1,18 +1,27 @@ -import { TransactionId } from "@iov/bcp"; +import { Address, ChainId, Fee, Token, TokenTicker, TransactionId } from "@iov/bcp"; +import { action } from "@storybook/addon-actions"; import { linkTo } from "@storybook/addon-links"; import { storiesOf } from "@storybook/react"; +import { FieldValidator } from "final-form"; +import { FieldInputValue } from "medulas-react-components"; import React from "react"; +import { stringToAmount } from "ui-logic"; -import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; +import AccountEdit from "../../components/AccountEdit"; +import { UPDATE_ACCOUNT_STORY_PATH } from "../../components/AccountEdit/index.stories"; +import { BwUsernameWithChainName } from "../../components/AccountManage"; +import { ACCOUNT_MANAGE_STORY_PATH } from "../../components/AccountManage/index.stories"; +import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import DecoratedStorybook from "../../utils/storybook"; +import { ACCOUNT_MANAGE_IOVNAMES_STORY_PATH } from "../IovnameManage/index.stories"; import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../transactions/index.stories"; -import ConfirmRegistration from "./components/ConfirmRegistration"; +import ConfirmUpdate from "./components/ConfirmUpdate"; -export const REGISTER_IOVNAME_STORY_PATH = `${bierzoRoot}/Register Iovname`; -export const REGISTER_IOVNAME_REGISTRATION_STORY_PATH = "Register Iovname"; +export const UPDATE_IOVNAME_REGISTRATION_STORY_PATH = "Update Iovname"; // const REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Username without fee"; -const REGISTER_IOVNAME_CONFIRMATION_STORY_PATH = "Registration confirmation"; +const REGISTER_IOVNAME_CONFIRMATION_STORY_PATH = "Update confirmation"; -/* const addresses: ChainAddressPairWithName[] = [ +const addresses: ChainAddressPairWithName[] = [ { chainId: "local-iov-devnet" as ChainId, address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, @@ -37,9 +46,19 @@ const iov: Pick = { const fee: Fee = { tokens: stringToAmount("5", iov), -}; */ +}; + +const iovnameValidator: FieldValidator = (value): string | undefined => { + action("Iovname validation")(value); + return undefined; +}; + +const account: BwUsernameWithChainName = { + username: "test*iov", + addresses: addresses, +}; -storiesOf(REGISTER_IOVNAME_STORY_PATH, module) +storiesOf(UPDATE_ACCOUNT_STORY_PATH, module) .addParameters({ viewport: { defaultViewport: "responsive" } }) // TODO adapt this stories to new components /* .add(REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH, () => ( @@ -51,20 +70,22 @@ storiesOf(REGISTER_IOVNAME_STORY_PATH, module) transactionFee={undefined} /> - )) - .add(REGISTER_USERNAME_REGISTRATION_STORY_PATH, () => ( + ))*/ + .add(UPDATE_IOVNAME_REGISTRATION_STORY_PATH, () => ( - => action("Iovname update submit")(values)} /> - )) */ + )) .add(REGISTER_IOVNAME_CONFIRMATION_STORY_PATH, () => ( - From 905fd204af1e2c01ef4ab9226752434ac6842e87 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 20:58:11 +0200 Subject: [PATCH 150/204] Add link to other stories --- .../src/components/AccountManage/index.stories.tsx | 7 +++++-- .../src/routes/IovnameManage/index.stories.tsx | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx index ea64663af..aca12e0bf 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx @@ -57,9 +57,12 @@ const menuItems: readonly ActionMenuItem[] = [ }, ]; -storiesOf(`${bierzoRoot}/Account Manage`, module) +export const ACCOUNT_MANAGE_STORY_PATH = `${bierzoRoot}/Account Manage`; +export const ACCOUNT_MANAGE_SAMPLE_STORY_PATH = "Manage sample"; + +storiesOf(ACCOUNT_MANAGE_STORY_PATH, module) .addParameters({ viewport: { defaultViewport: "responsive" } }) - .add("Manage sample", () => ( + .add(ACCOUNT_MANAGE_SAMPLE_STORY_PATH, () => ( ( + .add(ACCOUNT_MANAGE_IOVNAMES_STORY_PATH, () => ( Date: Tue, 10 Mar 2020 20:59:00 +0200 Subject: [PATCH 151/204] Fix account name --- packages/bierzo-wallet/src/components/AccountManage/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.tsx index a09e79a7b..0d6cfb707 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.tsx @@ -128,7 +128,7 @@ const AccountManage: React.FunctionComponent = ({ account, menuItems, onE > - {isAccountData(account) ? account.name : account.username} + {isAccountData(account) ? `${account.name}*${account.domain}` : account.username} From 7bb8bc628448fde66501b20e0828b9dc7435072e Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Tue, 10 Mar 2020 20:59:15 +0200 Subject: [PATCH 152/204] Add shield image --- .../bierzo-wallet/src/components/AccountEdit/assets/shield.svg | 3 +++ packages/bierzo-wallet/src/components/AccountEdit/index.tsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 packages/bierzo-wallet/src/components/AccountEdit/assets/shield.svg diff --git a/packages/bierzo-wallet/src/components/AccountEdit/assets/shield.svg b/packages/bierzo-wallet/src/components/AccountEdit/assets/shield.svg new file mode 100644 index 000000000..ca39313b2 --- /dev/null +++ b/packages/bierzo-wallet/src/components/AccountEdit/assets/shield.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx index 4f564c3b0..4d20bff9c 100644 --- a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx @@ -27,8 +27,8 @@ import { TooltipContent, } from "../AccountManage"; import { AddressesTableProps, ChainAddressPairWithName } from "../AddressesTable"; -import shield from "../assets/shield.svg"; import PageContent from "../PageContent"; +import shield from "./assets/shield.svg"; import SelectAddressesTable, { addressValueField, blockchainValueField, From ae12fe0c4dfad06e5d5fb1b3e0c41746be16769c Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 11 Mar 2020 20:00:55 +0200 Subject: [PATCH 153/204] Refactor Account related routes --- .../AccountManage/index.stories.tsx | 2 +- .../src/routes/NameManage/index.stories.tsx | 72 ------------------- .../bierzo-wallet/src/routes/account/index.ts | 5 ++ .../manage/components/IovnameForm.tsx} | 21 ++---- .../manage/components/NameForm.tsx} | 21 ++---- .../manage}/index.stories.tsx | 32 +++++++-- .../src/routes/account/manage/index.tsx | 20 ++++++ .../register}/assets/shield.svg | 0 .../components/ConfirmRegistration.tsx | 0 .../register/components/IovnameForm.tsx | 18 ++--- .../register/components/NameForm.tsx | 18 ++--- .../components/SelectAddressesTable.tsx | 2 +- .../register/components/StarnameForm.tsx | 16 ++--- .../{ => account}/register/index.stories.tsx | 0 .../routes/{ => account}/register/index.tsx | 18 ++--- .../update}/assets/shield.svg | 0 .../update}/components/ConfirmUpdate.tsx | 0 .../update}/index.stories.tsx | 16 ++--- .../{IovnameEdit => account/update}/index.tsx | 30 ++++---- packages/bierzo-wallet/src/routes/index.tsx | 19 ++--- .../src/routes/registerStarName/index.tsx | 34 --------- 21 files changed, 129 insertions(+), 215 deletions(-) delete mode 100644 packages/bierzo-wallet/src/routes/NameManage/index.stories.tsx create mode 100644 packages/bierzo-wallet/src/routes/account/index.ts rename packages/bierzo-wallet/src/routes/{NameManage/index.tsx => account/manage/components/IovnameForm.tsx} (58%) rename packages/bierzo-wallet/src/routes/{IovnameManage/index.tsx => account/manage/components/NameForm.tsx} (58%) rename packages/bierzo-wallet/src/routes/{IovnameManage => account/manage}/index.stories.tsx (68%) create mode 100644 packages/bierzo-wallet/src/routes/account/manage/index.tsx rename packages/bierzo-wallet/src/routes/{IovnameEdit => account/register}/assets/shield.svg (100%) rename packages/bierzo-wallet/src/routes/{ => account}/register/components/ConfirmRegistration.tsx (100%) rename packages/bierzo-wallet/src/routes/{ => account}/register/components/IovnameForm.tsx (94%) rename packages/bierzo-wallet/src/routes/{ => account}/register/components/NameForm.tsx (94%) rename packages/bierzo-wallet/src/routes/{ => account}/register/components/SelectAddressesTable.tsx (98%) rename packages/bierzo-wallet/src/routes/{ => account}/register/components/StarnameForm.tsx (92%) rename packages/bierzo-wallet/src/routes/{ => account}/register/index.stories.tsx (100%) rename packages/bierzo-wallet/src/routes/{ => account}/register/index.tsx (93%) rename packages/bierzo-wallet/src/routes/{register => account/update}/assets/shield.svg (100%) rename packages/bierzo-wallet/src/routes/{IovnameEdit => account/update}/components/ConfirmUpdate.tsx (100%) rename packages/bierzo-wallet/src/routes/{IovnameEdit => account/update}/index.stories.tsx (83%) rename packages/bierzo-wallet/src/routes/{IovnameEdit => account/update}/index.tsx (85%) delete mode 100644 packages/bierzo-wallet/src/routes/registerStarName/index.tsx diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx index aca12e0bf..9cf21d4e9 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx @@ -9,7 +9,7 @@ import { ChainAddressPairWithName } from "../../components/AddressesTable"; import { REGISTER_IOVNAME_REGISTRATION_STORY_PATH, REGISTER_IOVNAME_STORY_PATH, -} from "../../routes/register/index.stories"; +} from "../../routes/account/register/index.stories"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import AccountManage, { BwUsernameWithChainName } from "."; diff --git a/packages/bierzo-wallet/src/routes/NameManage/index.stories.tsx b/packages/bierzo-wallet/src/routes/NameManage/index.stories.tsx deleted file mode 100644 index 364647237..000000000 --- a/packages/bierzo-wallet/src/routes/NameManage/index.stories.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { Address, ChainId } from "@iov/bcp"; -import { action } from "@storybook/addon-actions"; -import { linkTo } from "@storybook/addon-links"; -import { storiesOf } from "@storybook/react"; -import { ActionMenuItem } from "medulas-react-components"; -import React from "react"; - -import AccountManage, { BwAccountWithChainName } from "../../components/AccountManage"; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import { - REGISTER_IOVNAME_REGISTRATION_STORY_PATH, - REGISTER_IOVNAME_STORY_PATH, -} from "../../routes/register/index.stories"; -import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; - -const chainAddresses: ChainAddressPairWithName[] = [ - { - chainId: "local-iov-devnet" as ChainId, - address: "tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3" as Address, - chainName: "IOV Devnet", - }, - { - chainId: "lisk-198f2b61a8" as ChainId, - address: "1349293588603668134L" as Address, - chainName: "Lisk Devnet", - }, - { - chainId: "ethereum-eip155-5777" as ChainId, - address: "0xD383382350F9f190Bd2608D6381B15b4e1cec0f3" as Address, - chainName: "Ganache", - }, -]; - -const account: BwAccountWithChainName = { - name: "test2", - domain: "iov", - expiryDate: new Date(), - addresses: [chainAddresses[0], chainAddresses[1]], -}; - -const menuItems: readonly ActionMenuItem[] = [ - { - title: "Renew", - action: () => { - action("Renew")(); - }, - }, - { - title: "Transfer iovname", - action: () => { - action("Transfer iovname")(); - }, - }, - { - title: "Delete iovname", - action: () => { - action("Delete iovname")(); - }, - }, -]; - -storiesOf(`${bierzoRoot}/Account Manage`, module) - .addParameters({ viewport: { defaultViewport: "responsive" } }) - .add("Manage name", () => ( - - - - )); diff --git a/packages/bierzo-wallet/src/routes/account/index.ts b/packages/bierzo-wallet/src/routes/account/index.ts new file mode 100644 index 000000000..19f560720 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/account/index.ts @@ -0,0 +1,5 @@ +import AccountManage from "./manage"; +import AccountRegister from "./register"; +import AccountUpdate from "./update"; + +export { AccountManage, AccountRegister, AccountUpdate }; diff --git a/packages/bierzo-wallet/src/routes/NameManage/index.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx similarity index 58% rename from packages/bierzo-wallet/src/routes/NameManage/index.tsx rename to packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx index 6ad8404b3..e7d6e218e 100644 --- a/packages/bierzo-wallet/src/routes/NameManage/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx @@ -1,10 +1,9 @@ -import { ActionMenuItem, Block } from "medulas-react-components"; +import { ActionMenuItem } from "medulas-react-components"; import * as React from "react"; -import { history } from ".."; -import AccountManage, { BwUsernameWithChainName } from "../../components/AccountManage"; -import PageMenu from "../../components/PageMenu"; -import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; +import { history } from "../../.."; +import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; +import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; function onRegisterUsername(): void { history.push(REGISTER_IOVNAME_ROUTE); @@ -20,7 +19,7 @@ const menuItems: readonly ActionMenuItem[] = [ { title: "Delete iovname", action: () => console.log("Delete iovname") }, ]; -const AddressManage = (): JSX.Element => { +const IovnameAccountManage = (): JSX.Element => { const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; if (!aadressToManage) { @@ -31,13 +30,7 @@ const AddressManage = (): JSX.Element => { history.push(REGISTER_IOVNAME_ROUTE, aadressToManage); }; - return ( - - - - - - ); + return ; }; -export default AddressManage; +export default IovnameAccountManage; diff --git a/packages/bierzo-wallet/src/routes/IovnameManage/index.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx similarity index 58% rename from packages/bierzo-wallet/src/routes/IovnameManage/index.tsx rename to packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx index 6ad8404b3..672ef0035 100644 --- a/packages/bierzo-wallet/src/routes/IovnameManage/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx @@ -1,10 +1,9 @@ -import { ActionMenuItem, Block } from "medulas-react-components"; +import { ActionMenuItem } from "medulas-react-components"; import * as React from "react"; -import { history } from ".."; -import AccountManage, { BwUsernameWithChainName } from "../../components/AccountManage"; -import PageMenu from "../../components/PageMenu"; -import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; +import { history } from "../../.."; +import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; +import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; function onRegisterUsername(): void { history.push(REGISTER_IOVNAME_ROUTE); @@ -20,7 +19,7 @@ const menuItems: readonly ActionMenuItem[] = [ { title: "Delete iovname", action: () => console.log("Delete iovname") }, ]; -const AddressManage = (): JSX.Element => { +const NameAccountManage = (): JSX.Element => { const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; if (!aadressToManage) { @@ -31,13 +30,7 @@ const AddressManage = (): JSX.Element => { history.push(REGISTER_IOVNAME_ROUTE, aadressToManage); }; - return ( - - - - - - ); + return ; }; -export default AddressManage; +export default NameAccountManage; diff --git a/packages/bierzo-wallet/src/routes/IovnameManage/index.stories.tsx b/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx similarity index 68% rename from packages/bierzo-wallet/src/routes/IovnameManage/index.stories.tsx rename to packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx index 9d85c69e0..a124a1b0e 100644 --- a/packages/bierzo-wallet/src/routes/IovnameManage/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx @@ -5,14 +5,16 @@ import { storiesOf } from "@storybook/react"; import { ActionMenuItem } from "medulas-react-components"; import React from "react"; -import AccountManage, { BwUsernameWithChainName } from "../../components/AccountManage"; -import { ACCOUNT_MANAGE_STORY_PATH } from "../../components/AccountManage/index.stories"; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import AccountManage, { + BwAccountWithChainName, + BwUsernameWithChainName, +} from "../../../components/AccountManage"; +import { ChainAddressPairWithName } from "../../../components/AddressesTable"; +import DecoratedStorybook, { bierzoRoot } from "../../../utils/storybook"; import { REGISTER_IOVNAME_REGISTRATION_STORY_PATH, REGISTER_IOVNAME_STORY_PATH, -} from "../../routes/register/index.stories"; -import DecoratedStorybook from "../../utils/storybook"; +} from "../register/index.stories"; const chainAddresses: ChainAddressPairWithName[] = [ { @@ -32,6 +34,13 @@ const chainAddresses: ChainAddressPairWithName[] = [ }, ]; +const account: BwAccountWithChainName = { + name: "test2", + domain: "iov", + expiryDate: new Date(), + addresses: [chainAddresses[0], chainAddresses[1]], +}; + const username: BwUsernameWithChainName = { username: "test2*iov", addresses: [chainAddresses[0], chainAddresses[1]], @@ -58,10 +67,19 @@ const menuItems: readonly ActionMenuItem[] = [ }, ]; -export const ACCOUNT_MANAGE_IOVNAMES_STORY_PATH = "Manage iovnames"; +export const ACCOUNT_MANAGE_IOVNAMES_STORY_PATH = "Manage iovname"; -storiesOf(ACCOUNT_MANAGE_STORY_PATH, module) +storiesOf(`${bierzoRoot}/Account Manage`, module) .addParameters({ viewport: { defaultViewport: "responsive" } }) + .add("Manage name", () => ( + + + + )) .add(ACCOUNT_MANAGE_IOVNAMES_STORY_PATH, () => ( { + return ( + + + {entity === "iovname" && } + {entity === "name" && } + + + ); +}; + +export default AccountManage; diff --git a/packages/bierzo-wallet/src/routes/IovnameEdit/assets/shield.svg b/packages/bierzo-wallet/src/routes/account/register/assets/shield.svg similarity index 100% rename from packages/bierzo-wallet/src/routes/IovnameEdit/assets/shield.svg rename to packages/bierzo-wallet/src/routes/account/register/assets/shield.svg diff --git a/packages/bierzo-wallet/src/routes/register/components/ConfirmRegistration.tsx b/packages/bierzo-wallet/src/routes/account/register/components/ConfirmRegistration.tsx similarity index 100% rename from packages/bierzo-wallet/src/routes/register/components/ConfirmRegistration.tsx rename to packages/bierzo-wallet/src/routes/account/register/components/ConfirmRegistration.tsx diff --git a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/account/register/components/IovnameForm.tsx similarity index 94% rename from packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx rename to packages/bierzo-wallet/src/routes/account/register/components/IovnameForm.tsx index 7f59d4d75..e3c015436 100644 --- a/packages/bierzo-wallet/src/routes/register/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/components/IovnameForm.tsx @@ -24,24 +24,24 @@ import React from "react"; import { generateRegisterUsernameTxRequest, generateUpdateUsernameTxRequest, -} from "../../../communication/requestgenerators"; -import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +} from "../../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../../communication/rpcEndpoint"; import { getAddressItems, getChainAddressPairsFromValues, getFormInitValues, getSubmitButtonCaption, -} from "../../../components/AccountEdit"; +} from "../../../../components/AccountEdit"; import { AddressesTooltipHeader, BwUsernameWithChainName, TooltipContent, -} from "../../../components/AccountManage"; -import { AddressesTableProps } from "../../../components/AddressesTable"; -import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; -import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; -import PageContent from "../../../components/PageContent"; -import { isValidIov } from "../../../logic/account"; +} from "../../../../components/AccountManage"; +import { AddressesTableProps } from "../../../../components/AddressesTable"; +import LedgerBillboardMessage from "../../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../../components/PageContent"; +import { isValidIov } from "../../../../logic/account"; import shield from "../assets/shield.svg"; import SelectAddressesTable from "./SelectAddressesTable"; diff --git a/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/account/register/components/NameForm.tsx similarity index 94% rename from packages/bierzo-wallet/src/routes/register/components/NameForm.tsx rename to packages/bierzo-wallet/src/routes/account/register/components/NameForm.tsx index aab76085e..dc6e85d2f 100644 --- a/packages/bierzo-wallet/src/routes/register/components/NameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/components/NameForm.tsx @@ -25,24 +25,24 @@ import React from "react"; import { generateRegisterAccountTxRequest, generateReplaceAccountTargetsTxRequest, -} from "../../../communication/requestgenerators"; -import { RpcEndpoint } from "../../../communication/rpcEndpoint"; +} from "../../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../../communication/rpcEndpoint"; import { getAddressItems, getChainAddressPairsFromValues, getFormInitValues, getSubmitButtonCaption, -} from "../../../components/AccountEdit"; +} from "../../../../components/AccountEdit"; import { AddressesTooltipHeader, BwUsernameWithChainName, TooltipContent, -} from "../../../components/AccountManage"; -import { AddressesTableProps } from "../../../components/AddressesTable"; -import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; -import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; -import PageContent from "../../../components/PageContent"; -import { isValidName } from "../../../logic/account"; +} from "../../../../components/AccountManage"; +import { AddressesTableProps } from "../../../../components/AddressesTable"; +import LedgerBillboardMessage from "../../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../../components/PageContent"; +import { isValidName } from "../../../../logic/account"; import shield from "../assets/shield.svg"; import SelectAddressesTable from "./SelectAddressesTable"; diff --git a/packages/bierzo-wallet/src/routes/register/components/SelectAddressesTable.tsx b/packages/bierzo-wallet/src/routes/account/register/components/SelectAddressesTable.tsx similarity index 98% rename from packages/bierzo-wallet/src/routes/register/components/SelectAddressesTable.tsx rename to packages/bierzo-wallet/src/routes/account/register/components/SelectAddressesTable.tsx index 0ce710a40..b1f9fb7be 100644 --- a/packages/bierzo-wallet/src/routes/register/components/SelectAddressesTable.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/components/SelectAddressesTable.tsx @@ -14,7 +14,7 @@ import { import React from "react"; import { randomString } from "ui-logic"; -import { ChainAddressPairWithName } from "../../../components/AddressesTable"; +import { ChainAddressPairWithName } from "../../../../components/AddressesTable"; export const addressValueField = "address-value-field"; export const blockchainValueField = "blockchain-value-field"; diff --git a/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/account/register/components/StarnameForm.tsx similarity index 92% rename from packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx rename to packages/bierzo-wallet/src/routes/account/register/components/StarnameForm.tsx index 0b5c3bde9..d5d18b84b 100644 --- a/packages/bierzo-wallet/src/routes/register/components/StarnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/components/StarnameForm.tsx @@ -19,14 +19,14 @@ import { } from "medulas-react-components"; import React from "react"; -import { generateRegisterDomainTxRequest } from "../../../communication/requestgenerators"; -import { RpcEndpoint } from "../../../communication/rpcEndpoint"; -import { getSubmitButtonCaption } from "../../../components/AccountEdit"; -import { BwUsernameWithChainName, TooltipContent } from "../../../components/AccountManage"; -import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; -import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; -import PageContent from "../../../components/PageContent"; -import { isValidStarname } from "../../../logic/account"; +import { generateRegisterDomainTxRequest } from "../../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../../communication/rpcEndpoint"; +import { getSubmitButtonCaption } from "../../../../components/AccountEdit"; +import { BwUsernameWithChainName, TooltipContent } from "../../../../components/AccountManage"; +import LedgerBillboardMessage from "../../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../../components/BillboardMessage/NeumaBillboardMessage"; +import PageContent from "../../../../components/PageContent"; +import { isValidStarname } from "../../../../logic/account"; import shield from "../assets/shield.svg"; export const REGISTER_STARNAME_VIEW_ID = "register-starname-view-id"; diff --git a/packages/bierzo-wallet/src/routes/register/index.stories.tsx b/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx similarity index 100% rename from packages/bierzo-wallet/src/routes/register/index.stories.tsx rename to packages/bierzo-wallet/src/routes/account/register/index.stories.tsx diff --git a/packages/bierzo-wallet/src/routes/register/index.tsx b/packages/bierzo-wallet/src/routes/account/register/index.tsx similarity index 93% rename from packages/bierzo-wallet/src/routes/register/index.tsx rename to packages/bierzo-wallet/src/routes/account/register/index.tsx index b9995f5a2..fc8e477eb 100644 --- a/packages/bierzo-wallet/src/routes/register/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/index.tsx @@ -49,17 +49,13 @@ async function getPersonalizedAddressRegistrationFee( return transactionWithFee.fee; } -export enum ToRegister { - Iovname = "iovname", - Starname = "starname", - Name = "name", -} +export type AccountEntity = "iovname" | "starname" | "name"; -interface Props { - entity: ToRegister; +export interface AccountProps { + entity: AccountEntity; } -const Register = ({ entity }: Props): JSX.Element => { +const Register = ({ entity }: AccountProps): JSX.Element => { const [transactionId, setTransactionId] = React.useState(null); const [transactionFee, setTransactionFee] = React.useState(undefined); const [supportedChains, setSupportedChains] = React.useState([]); @@ -104,7 +100,7 @@ const Register = ({ entity }: Props): JSX.Element => { ) : ( - {entity === ToRegister.Iovname && ( + {entity === "iovname" && ( { setTransactionId={setTransactionId} /> )} - {entity === ToRegister.Starname && ( + {entity === "starname" && ( { setTransactionId={setTransactionId} /> )} - {entity === ToRegister.Name && ( + {entity === "name" && ( ( - - + } /> + } /> - } /> - } - /> - } /> + } /> + } /> + } /> diff --git a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx b/packages/bierzo-wallet/src/routes/registerStarName/index.tsx deleted file mode 100644 index db8da3f36..000000000 --- a/packages/bierzo-wallet/src/routes/registerStarName/index.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Block, makeStyles, Typography } from "medulas-react-components"; -import React from "react"; - -import PageMenu from "../../components/PageMenu"; - -const useStyles = makeStyles({ - usernameHeader: { - boxShadow: "0px 0px 14px #EDEFF4", - }, -}); - -// TODO move to components when implemented, mirroring registerName -export function NoStarnameHeader(): JSX.Element { - const classes = useStyles(); - return ( - - - *yourstarname - - - ); -} - -const RegisterStarname = (): JSX.Element => { - return ( - - - Register new starname. Work in progress view - - - ); -}; - -export default RegisterStarname; From 8174b3a30d5e18f0c0ec47e9c068b18c77bdfbfa Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Wed, 11 Mar 2020 21:31:26 +0200 Subject: [PATCH 154/204] Fix imports --- .../components/ConfirmRegistration.tsx | 8 +++--- .../routes/account/register/index.stories.tsx | 2 ++ .../src/routes/account/register/index.tsx | 28 +++++++++---------- .../update/components/ConfirmUpdate.tsx | 6 ++-- .../addresses/components/IovnamesExists.tsx | 2 +- .../components/IovnamesNotExists.tsx | 2 +- .../components/StarnamesNotExists.tsx | 2 +- .../src/routes/addresses/index.stories.tsx | 2 ++ .../addresses/test/travelToReceivePayment.ts | 2 +- .../src/routes/balance/index.stories.tsx | 2 +- .../routes/balance/test/operateBalances.ts | 2 +- packages/bierzo-wallet/src/routes/index.tsx | 9 +++--- 12 files changed, 34 insertions(+), 33 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/register/components/ConfirmRegistration.tsx b/packages/bierzo-wallet/src/routes/account/register/components/ConfirmRegistration.tsx index 980951013..5a89037ce 100644 --- a/packages/bierzo-wallet/src/routes/account/register/components/ConfirmRegistration.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/components/ConfirmRegistration.tsx @@ -11,9 +11,9 @@ import { } from "medulas-react-components"; import React from "react"; -import copySvg from "../../../assets/copy.svg"; -import tickSvg from "../../../assets/tick.svg"; -import PageContent from "../../../components/PageContent"; +import copySvg from "../../../../assets/copy.svg"; +import tickSvg from "../../../../assets/tick.svg"; +import PageContent from "../../../../components/PageContent"; export const REGISTER_CONFIRMATION_VIEW_ID = "register-confirmation-view-id"; @@ -28,7 +28,7 @@ const useClasses = makeStyles({ }); const tickIcon = Tick; -const copyIcon = Tick; +const copyIcon = Copy; interface Props { readonly transactionId: TransactionId; diff --git a/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx b/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx index d20b7047a..a219d5a86 100644 --- a/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx @@ -4,7 +4,9 @@ import { storiesOf } from "@storybook/react"; import React from "react"; import { stringToAmount } from "ui-logic"; +import DecoratedStorybook, { bierzoRoot } from "../../../utils/storybook"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../../transactions/index.stories"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { BALANCE_STORY_PATH, BALANCE_STORY_VIEW_PATH } from "../balance/index.stories"; import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../transactions/index.stories"; diff --git a/packages/bierzo-wallet/src/routes/account/register/index.tsx b/packages/bierzo-wallet/src/routes/account/register/index.tsx index fc8e477eb..1b7f01a01 100644 --- a/packages/bierzo-wallet/src/routes/account/register/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/index.tsx @@ -1,21 +1,19 @@ -import { Address, ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; +import { ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; import { BnsConnection } from "@iov/bns"; -import { FormValues } from "medulas-react-components"; import React from "react"; import * as ReactRedux from "react-redux"; -import { amountToString } from "ui-logic"; - -import { history } from ".."; -import { generateRegisterUsernameTxWithFee } from "../../communication/requestgenerators"; -import { BwUsernameWithChainName } from "../../components/AccountManage"; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; -import PageMenu from "../../components/PageMenu"; -import { getConfig, SupportedChain } from "../../config"; -import { getConnectionForChainId } from "../../logic/connection"; -import { ExtendedIdentity } from "../../store/identities"; -import { RootState } from "../../store/reducers"; -import { getChainAddressPairWithNamesSorted } from "../../utils/tokens"; -import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../paths"; + +import { history } from "../.."; +import { generateRegisterUsernameTxWithFee } from "../../../communication/requestgenerators"; +import { BwUsernameWithChainName } from "../../../components/AccountManage"; +import { ChainAddressPairWithName } from "../../../components/AddressesTable"; +import PageMenu from "../../../components/PageMenu"; +import { getConfig, SupportedChain } from "../../../config"; +import { getConnectionForChainId } from "../../../logic/connection"; +import { ExtendedIdentity } from "../../../store/identities"; +import { RootState } from "../../../store/reducers"; +import { getChainAddressPairWithNamesSorted } from "../../../utils/tokens"; +import { ADDRESSES_ROUTE, BALANCE_ROUTE, TRANSACTIONS_ROUTE } from "../../paths"; import ConfirmRegistration from "./components/ConfirmRegistration"; import IovnameForm from "./components/IovnameForm"; import NameForm from "./components/NameForm"; diff --git a/packages/bierzo-wallet/src/routes/account/update/components/ConfirmUpdate.tsx b/packages/bierzo-wallet/src/routes/account/update/components/ConfirmUpdate.tsx index 970c87f83..cc49ef608 100644 --- a/packages/bierzo-wallet/src/routes/account/update/components/ConfirmUpdate.tsx +++ b/packages/bierzo-wallet/src/routes/account/update/components/ConfirmUpdate.tsx @@ -11,9 +11,9 @@ import { } from "medulas-react-components"; import React from "react"; -import copySvg from "../../../assets/copy.svg"; -import tickSvg from "../../../assets/tick.svg"; -import PageContent from "../../../components/PageContent"; +import copySvg from "../../../../assets/copy.svg"; +import tickSvg from "../../../../assets/tick.svg"; +import PageContent from "../../../../components/PageContent"; export const UPDATE_CONFIRMATION_VIEW_ID = "update-confirmation-view-id"; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index f7f3bddd9..42ab0049c 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -5,7 +5,7 @@ import React from "react"; import { history } from "../.."; import iovnameLogo from "../../../assets/iovname-logo.svg"; import { BwUsername } from "../../../store/usernames"; -import { IOVNAME_MANAGE_ROUTE } from "../../paths"; +import { IOVNAME_MANAGE_ROUTE, REGISTER_IOVNAME_ROUTE } from "../../paths"; interface Props { readonly iovnames: readonly BwUsername[]; diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx index c1c4307a2..828732f4e 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx @@ -4,8 +4,8 @@ import { Block, Typography } from "medulas-react-components"; import React from "react"; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; +import { NoIovnameHeader } from "../../account/register/components/IovnameForm"; import { REGISTER_IOVNAME_ROUTE } from "../../paths"; -import { NoIovnameHeader } from "../../register/components/IovnameForm"; export const registerIovnameId = REGISTER_IOVNAME_ROUTE.replace(/\//g, "-"); diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx index 5922490aa..25617df17 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx @@ -5,8 +5,8 @@ import React from "react"; import { history } from "../.."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; +import { NoStarnameHeader } from "../../account/register/components/StarnameForm"; import { REGISTER_NAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../paths"; -import { NoStarnameHeader } from "../../register/components/StarnameForm"; interface StarnamesNotExistsProps { readonly onRegisterStarname: () => void; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index 409afd3e8..51975d1ea 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -3,6 +3,7 @@ import { linkTo } from "@storybook/addon-links"; import { storiesOf } from "@storybook/react"; import React from "react"; +import { BwUsernameWithChainName } from "../../components/AccountManage"; import { ChainAddressPairWithName } from "../../components/AddressesTable"; import { BwAccount } from "../../store/accounts"; import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; @@ -13,6 +14,7 @@ import { REGISTER_STARNAME_STORY_PATH, } from "../register/index.stories"; import { BwUsernameWithChainName } from "."; +} from "../account/register/index.stories"; import AddressesTab from "./components/AddressesTab"; import Iovnames from "./components/Iovnames"; import ManageName from "./components/ManageName"; diff --git a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts index 70786557e..ff610a2ff 100644 --- a/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts +++ b/packages/bierzo-wallet/src/routes/addresses/test/travelToReceivePayment.ts @@ -2,8 +2,8 @@ import { Page } from "puppeteer"; import { ADDRESSES_TEXT } from "../../../components/Header/components/LinksMenu"; import { whenOnNavigatedToE2eRoute } from "../../../utils/test/navigation"; +import { REGISTER_IOVNAME_VIEW_ID } from "../../account/register/components/IovnameForm"; import { ADDRESSES_ROUTE } from "../../paths"; -import { REGISTER_IOVNAME_VIEW_ID } from "../../register/components/IovnameForm"; import { yourAddresses, yourIovnames } from "../components/AddressesTab"; import { iovnamesViewId } from "../components/Iovnames"; import { yourBlockchainAddressesId } from "../components/UserAddresses"; diff --git a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx index c148c2b92..f3b947270 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.stories.tsx @@ -9,7 +9,7 @@ import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; import { REGISTER_IOVNAME_REGISTRATION_STORY_PATH, REGISTER_IOVNAME_STORY_PATH, -} from "../register/index.stories"; +} from "../account/register/index.stories"; import Layout from "./components/index"; export const BALANCE_STORY_PATH = `${bierzoRoot}/Balance`; diff --git a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts index b2427768e..a8f7b6a86 100644 --- a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts +++ b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts @@ -2,8 +2,8 @@ import { Browser, ElementHandle, Page } from "puppeteer"; import { randomString, sleep, whenTrue } from "ui-logic"; import { acceptEnqueuedRequest } from "../../../utils/test/persona"; +import { REGISTER_IOVNAME_FIELD } from "../../account/register/components/IovnameForm"; import { registerIovnameId } from "../../addresses/components/IovnamesNotExists"; -import { REGISTER_IOVNAME_FIELD } from "../../register/components/IovnameForm"; const mainMenuH6Elements = 3; const numberOfTokensFromFaucet = 4; diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index 288848cc4..d2f8a2964 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -3,8 +3,7 @@ import React from "react"; import { Route, Router, Switch } from "react-router"; import RequireLogin from "../components/RequireLogin"; -import AccountManage from "./account/manage"; -import Register from "./account/register"; +import { AccountManage, AccountRegister } from "./account"; import Addresses from "./addresses"; import Balance from "./balance"; import Login from "./login"; @@ -41,9 +40,9 @@ const Routes = (): JSX.Element => ( } /> - } /> - } /> - } /> + } /> + } /> + } /> From e8fbfd5bc2974249d886cf6783c5d492f601ec20 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 12 Mar 2020 00:08:39 +0200 Subject: [PATCH 155/204] Add iovname update form --- .../account/update/components/IovnameForm.tsx | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/account/update/components/IovnameForm.tsx diff --git a/packages/bierzo-wallet/src/routes/account/update/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/account/update/components/IovnameForm.tsx new file mode 100644 index 000000000..5faefa372 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/account/update/components/IovnameForm.tsx @@ -0,0 +1,146 @@ +import { ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; +import { BnsConnection } from "@iov/bns"; +import { FieldValidator } from "final-form"; +import { + BillboardContext, + FieldInputValue, + FormValues, + ToastContext, + ToastVariant, +} from "medulas-react-components"; +import React, { Dispatch, SetStateAction } from "react"; + +import { history } from "../../.."; +import { generateRegisterUsernameTxRequest } from "../../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../../communication/rpcEndpoint"; +import AccountEdit, { + EDIT_ACCOUNT_FIELD, + getChainAddressPairsFromValues, +} from "../../../../components/AccountEdit"; +import { BwUsernameWithChainName } from "../../../../components/AccountManage"; +import { ChainAddressPairWithName } from "../../../../components/AddressesTable"; +import LedgerBillboardMessage from "../../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../../components/BillboardMessage/NeumaBillboardMessage"; +import { isValidIov } from "../../../../logic/account"; +import { getConnectionForChainId } from "../../../../logic/connection"; +import { ExtendedIdentity } from "../../../../store/identities"; +import { IOVNAME_MANAGE_ROUTE } from "../../../paths"; + +export function getBnsIdentity(identities: ReadonlyMap): Identity | undefined { + for (const identity of Array.from(identities.values()).map(ext => ext.identity)) { + if (getConnectionForChainId(identity.chainId) instanceof BnsConnection) { + return identity; + } + } + return undefined; +} + +export interface Props { + readonly setTransactionId: Dispatch>; + readonly transactionFee: Fee | undefined; + readonly rpcEndpoint: RpcEndpoint; + readonly chainAddresses: readonly ChainAddressPairWithName[]; + readonly bnsIdentity: Identity; +} + +const IovnameAccountUpdate = ({ + setTransactionId, + transactionFee, + rpcEndpoint, + bnsIdentity, + chainAddresses, +}: Props): JSX.Element => { + const account: BwUsernameWithChainName | undefined = history.location.state; + + const onReturnToManage = (): void => { + history.push(IOVNAME_MANAGE_ROUTE, account); + }; + + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const iovnameValidator: FieldValidator = (value): string | undefined => { + if (!account) { + if (!value) { + return "Required"; + } + + const checkResult = isValidIov(value); + + switch (checkResult) { + case "not_iov": + return "Iovname must end with *iov"; + case "wrong_number_of_asterisks": + return "Iovname must include only one namespace"; + case "too_short": + return "Iovname should be at least 3 characters"; + case "too_long": + return "Iovname should be maximum 64 characters"; + case "wrong_chars": + return "Iovname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; + case "valid": + break; + default: + throw new Error(`"Unknown iovname validation error: ${checkResult}`); + } + } + + return undefined; + }; + + const onSubmit = async (values: object): Promise => { + const formValues = values as FormValues; + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + + try { + const request = await generateRegisterUsernameTxRequest( + bnsIdentity, + formValues[EDIT_ACCOUNT_FIELD], + addressesToRegister, + ); + + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + return ( + + ); +}; + +export default IovnameAccountUpdate; From 739d809580c49f5991203db712d93c9596825b45 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 12 Mar 2020 00:09:47 +0200 Subject: [PATCH 156/204] Update account storybook --- .../bierzo-wallet/src/routes/account/update/index.stories.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/account/update/index.stories.tsx b/packages/bierzo-wallet/src/routes/account/update/index.stories.tsx index 6c40760e0..0ffb86e18 100644 --- a/packages/bierzo-wallet/src/routes/account/update/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/account/update/index.stories.tsx @@ -18,7 +18,6 @@ import { ACCOUNT_MANAGE_IOVNAMES_STORY_PATH } from "../manage/index.stories"; import ConfirmUpdate from "./components/ConfirmUpdate"; export const UPDATE_IOVNAME_REGISTRATION_STORY_PATH = "Update Iovname"; -// const REGISTER_USERNAME_REGISTRATION_STORY_ZERO_FEE_PATH = "Register Username without fee"; const REGISTER_IOVNAME_CONFIRMATION_STORY_PATH = "Update confirmation"; const addresses: ChainAddressPairWithName[] = [ From a3bdb11d5c6d9422b14fe046f8cb36915d5de7cb Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 12 Mar 2020 00:10:17 +0200 Subject: [PATCH 157/204] Update account main component --- .../src/routes/account/update/index.tsx | 137 ++++-------------- 1 file changed, 26 insertions(+), 111 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/update/index.tsx b/packages/bierzo-wallet/src/routes/account/update/index.tsx index 213d53943..ea8e8a345 100644 --- a/packages/bierzo-wallet/src/routes/account/update/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/update/index.tsx @@ -1,38 +1,21 @@ import { ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; import { BnsConnection } from "@iov/bns"; -import { FieldValidator } from "final-form"; -import { - BillboardContext, - FieldInputValue, - FormValues, - ToastContext, - ToastVariant, -} from "medulas-react-components"; import React from "react"; import * as ReactRedux from "react-redux"; import { history } from "../.."; -import { - generateRegisterUsernameTxRequest, - generateRegisterUsernameTxWithFee, -} from "../../../communication/requestgenerators"; -import AccountEdit, { - EDIT_ACCOUNT_FIELD, - getChainAddressPairsFromValues, -} from "../../../components/AccountEdit"; -import { BwUsernameWithChainName } from "../../../components/AccountManage"; +import { generateRegisterUsernameTxWithFee } from "../../../communication/requestgenerators"; import { ChainAddressPairWithName } from "../../../components/AddressesTable"; -import LedgerBillboardMessage from "../../../components/BillboardMessage/LedgerBillboardMessage"; -import NeumaBillboardMessage from "../../../components/BillboardMessage/NeumaBillboardMessage"; import PageMenu from "../../../components/PageMenu"; import { getConfig, SupportedChain } from "../../../config"; -import { isValidIov } from "../../../logic/account"; import { getConnectionForChainId } from "../../../logic/connection"; import { ExtendedIdentity } from "../../../store/identities"; import { RootState } from "../../../store/reducers"; import { getChainAddressPairWithNamesSorted } from "../../../utils/tokens"; -import { IOVNAME_MANAGE_ROUTE, TRANSACTIONS_ROUTE } from "../../paths"; +import { TRANSACTIONS_ROUTE } from "../../paths"; +import { AccountProps } from "../register"; import ConfirmRegistration from "./components/ConfirmUpdate"; +import IovnameAccountUpdate from "./components/IovnameForm"; function onSeeTrasactions(): void { history.push(TRANSACTIONS_ROUTE); @@ -56,7 +39,7 @@ async function getPersonalizedAddressRegistrationFee( return transactionWithFee.fee; } -const Register = (): JSX.Element => { +const AccountUpdate = ({ entity }: AccountProps): JSX.Element => { const [transactionId, setTransactionId] = React.useState(null); const [transactionFee, setTransactionFee] = React.useState(undefined); const [supportedChains, setSupportedChains] = React.useState([]); @@ -69,7 +52,6 @@ const Register = (): JSX.Element => { ); const bnsIdentity = getBnsIdentity(identities); - const account: BwUsernameWithChainName | undefined = history.location.state; if (!bnsIdentity) throw new Error("No BNS identity available."); if (!rpcEndpoint) throw new Error("RPC endpoint not set in redux store. This is a bug."); @@ -95,101 +77,34 @@ const Register = (): JSX.Element => { }; }, [addressesSorted, bnsIdentity]); - const onReturnToManage = (): void => { - history.push(IOVNAME_MANAGE_ROUTE, account); - }; - - const billboard = React.useContext(BillboardContext); - const toast = React.useContext(ToastContext); - - const iovnameValidator: FieldValidator = (value): string | undefined => { - if (!account) { - if (!value) { - return "Required"; - } - - const checkResult = isValidIov(value); - - switch (checkResult) { - case "not_iov": - return "Iovname must end with *iov"; - case "wrong_number_of_asterisks": - return "Iovname must include only one namespace"; - case "too_short": - return "Iovname should be at least 3 characters"; - case "too_long": - return "Iovname should be maximum 64 characters"; - case "wrong_chars": - return "Iovname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; - case "valid": - break; - default: - throw new Error(`"Unknown iovname validation error: ${checkResult}`); - } - } - - return undefined; - }; - - const onSubmit = async (values: object): Promise => { - const formValues = values as FormValues; - - const addressesToRegister = getChainAddressPairsFromValues(formValues, addressesSorted); - - try { - const request = await generateRegisterUsernameTxRequest( - bnsIdentity, - formValues[EDIT_ACCOUNT_FIELD], - addressesToRegister, - ); - - if (rpcEndpoint.type === "extension") { - billboard.show( - , - "start", - "flex-end", - 0, - ); - } else { - billboard.show( - , - "center", - "center", - 0, - ); - } - const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); - if (transactionId === undefined) { - toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); - } else if (transactionId === null) { - toast.show("Request rejected", ToastVariant.ERROR); - } else { - setTransactionId(transactionId); - } - } catch (error) { - console.error(error); - toast.show("An error occurred", ToastVariant.ERROR); - } finally { - billboard.close(); - } - }; - return ( {transactionId ? ( ) : ( - + + {entity === "iovname" && ( + + )} + {entity === "name" && ( + + )} + )} ); }; -export default Register; +export default AccountUpdate; From a955ae7030f909f4068a7e18cce2541d89f4a6d5 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Thu, 12 Mar 2020 00:10:57 +0200 Subject: [PATCH 158/204] Copy account name --- .../src/components/AccountEdit/index.tsx | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx index 4d20bff9c..92ad79ed5 100644 --- a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx @@ -1,4 +1,5 @@ import { Address, Fee } from "@iov/bcp"; +import clipboardCopy from "clipboard-copy"; import { FieldValidator } from "final-form"; import { Back, @@ -11,6 +12,8 @@ import { Image, makeStyles, TextField, + ToastContext, + ToastVariant, Tooltip, Typography, useForm, @@ -18,15 +21,16 @@ import { import React from "react"; import { amountToString } from "ui-logic"; +import { formatDate, formatTime } from "../../utils/date"; import { AddressesTooltipHeader, BwAccountWithChainName, BwUsernameWithChainName, isAccountData, - isUsernameData, TooltipContent, } from "../AccountManage"; import { AddressesTableProps, ChainAddressPairWithName } from "../AddressesTable"; +import copy from "../AddressesTable/assets/copy.svg"; import PageContent from "../PageContent"; import shield from "./assets/shield.svg"; import SelectAddressesTable, { @@ -126,6 +130,9 @@ const useStyles = makeStyles({ iovnameHeader: { boxShadow: "0px 0px 14px #EDEFF4", }, + link: { + cursor: "pointer", + }, }); export function NoIovnameHeader(): JSX.Element { @@ -158,6 +165,9 @@ const AccountEdit = ({ transactionFee, onSubmit, }: Props): JSX.Element => { + const classes = useStyles(); + const toast = React.useContext(ToastContext); + const chainAddressesItems = React.useMemo(() => { if (account) { return getAddressItems(account.addresses); @@ -171,6 +181,14 @@ const AccountEdit = ({ initialValues, }); + const onAccountCopy = (): void => { + if (account) { + const name = isAccountData(account) ? account.name : account.username; + clipboardCopy(name); + toast.show("Account has been copied to clipboard.", ToastVariant.INFO); + } + }; + const buttons = ( {account && ( - - {isUsernameData(account) && account.username} - {isAccountData(account) && `${account.name}*${account.domain}`} - + + + + {isAccountData(account) ? `${account.name}*${account.domain}` : account.username} + + + + Copy + + + {isAccountData(account) && ( + + Expires on {formatDate(account.expiryDate)} {formatTime(account.expiryDate)} + + )} + )} {!account && ( From 1db0432860b90c8bccacb84c5484f4b677d602fc Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:28:30 +0200 Subject: [PATCH 159/204] Addititonal account edit paths --- packages/bierzo-wallet/src/routes/paths.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index e8b887724..52794db3f 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -11,5 +11,7 @@ export const ADDRESS_MANAGE_ROUTE = "/address-manage"; export const IOVNAME_MANAGE_ROUTE = "/iovname/manage"; export const IOVNAME_EDIT_ROUTE = "/iovname/edit"; export const NAME_MANAGE_ROUTE = "/name/manage"; +export const NAME_EDIT_ROUTE = "/name/edit"; +export const STARNAME_EDIT_ROUTE = "/starname/edit"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; From 011999a98eccb2ff05bf761c6f342b80da9661c2 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:28:57 +0200 Subject: [PATCH 160/204] Hide account expiration date --- .../src/components/AccountManage/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.tsx index 0d6cfb707..dc0f5644e 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.tsx @@ -73,6 +73,7 @@ type AccountModuleMixedType = BwUsernameWithChainName | BwAccountWithChainName; interface Props { readonly account: AccountModuleMixedType; readonly menuItems: readonly ActionMenuItem[]; + readonly hideExpiration?: boolean; readonly onEditAccount: () => void; } @@ -99,7 +100,12 @@ const useStyles = makeStyles({ }, }); -const AccountManage: React.FunctionComponent = ({ account, menuItems, onEditAccount }) => { +const AccountManage: React.FunctionComponent = ({ + account, + menuItems, + onEditAccount, + hideExpiration, +}) => { const paperClasses = usePaper(); const classes = useStyles(); const toast = React.useContext(ToastContext); @@ -135,7 +141,7 @@ const AccountManage: React.FunctionComponent = ({ account, menuItems, onE Copy - {isAccountData(account) && ( + {isAccountData(account) && !hideExpiration && ( Expires on {formatDate(account.expiryDate)} {formatTime(account.expiryDate)} From ed4cec1a1ebd15799d19851d8c801888c5a0572d Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:29:25 +0200 Subject: [PATCH 161/204] Add associated with starname accounts list --- .../routes/account/manage/index.stories.tsx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx b/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx index a124a1b0e..f690246ed 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx @@ -15,6 +15,7 @@ import { REGISTER_IOVNAME_REGISTRATION_STORY_PATH, REGISTER_IOVNAME_STORY_PATH, } from "../register/index.stories"; +import AssociatedNamesList from "./components/AssociatedNamesList"; const chainAddresses: ChainAddressPairWithName[] = [ { @@ -41,6 +42,27 @@ const account: BwAccountWithChainName = { addresses: [chainAddresses[0], chainAddresses[1]], }; +const names: BwAccountWithChainName[] = [ + { + name: "test1", + domain: "iov", + expiryDate: new Date(), + addresses: [chainAddresses[0], chainAddresses[1]], + }, + { + name: "test2", + domain: "iov", + expiryDate: new Date(), + addresses: [chainAddresses[0], chainAddresses[1]], + }, + { + name: "test3", + domain: "iov", + expiryDate: new Date(), + addresses: [chainAddresses[0], chainAddresses[1]], + }, +]; + const username: BwUsernameWithChainName = { username: "test2*iov", addresses: [chainAddresses[0], chainAddresses[1]], @@ -88,4 +110,14 @@ storiesOf(`${bierzoRoot}/Account Manage`, module) menuItems={menuItems} /> + )) + .add("Associated names list", () => ( + + { + action("Register Name")(); + }} + /> + )); From b30642e5afe26b29ff276e470a37bca4f91cc1e5 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:29:42 +0200 Subject: [PATCH 162/204] Asscoiated names list --- .../manage/components/AssociatedNamesList.tsx | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx new file mode 100644 index 000000000..7f37f3ffe --- /dev/null +++ b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx @@ -0,0 +1,90 @@ +import Paper from "@material-ui/core/Paper"; +import { ActionMenuItem, Block, Image, makeStyles, Typography } from "medulas-react-components"; +import React from "react"; + +import { history } from "../../.."; +import starnameLogo from "../../../../assets/starname-logo.svg"; +import AccountManage, { BwAccountWithChainName } from "../../../../components/AccountManage"; +import { BwAccount } from "../../../../store/accounts"; +import { NAME_EDIT_ROUTE, NAME_MANAGE_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; +import arrowDown from "../assets/arrow-down.svg"; +import arrowUp from "../assets/arrow-up.svg"; + +interface Props { + readonly names: readonly BwAccountWithChainName[]; + readonly onRegisterName: () => void; +} + +const usePaper = makeStyles({ + rounded: { + borderRadius: "5px", + }, + elevation1: { + boxShadow: "none", + }, +}); + +const menuItems: readonly ActionMenuItem[] = [ + { title: "Transfer name", action: () => console.log("Transfer name") }, + { title: "Transfer it back to me", action: () => console.log("Transfer it back to me") }, + { title: "Delete name", action: () => console.log("Delete name") }, +]; + +const AssociatedNamesList: React.FunctionComponent = ({ names, onRegisterName }): JSX.Element => { + const paperClasses = usePaper(); + + return ( + + + + + + + Create a new name + + + + + + + + + Names associated with this starname + + + arrow + + + {names + .slice() + .sort((a, b) => + `${a.name}*${a.domain}`.localeCompare(`${b.name}*${b.domain}`, undefined, { + sensitivity: "base", + }), + ) + .map(name => { + const onEditAccount = (): void => { + history.push(NAME_EDIT_ROUTE, name); + }; + + return ( + + ); + })} + + + ); +}; + +export default AssociatedNamesList; From 087429baf3c5235f33483103fa1876ddefb93a76 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:29:57 +0200 Subject: [PATCH 163/204] Up and down arrows --- .../src/routes/account/manage/assets/arrow-down.svg | 3 +++ .../src/routes/account/manage/assets/arrow-up.svg | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/account/manage/assets/arrow-down.svg create mode 100644 packages/bierzo-wallet/src/routes/account/manage/assets/arrow-up.svg diff --git a/packages/bierzo-wallet/src/routes/account/manage/assets/arrow-down.svg b/packages/bierzo-wallet/src/routes/account/manage/assets/arrow-down.svg new file mode 100644 index 000000000..e875d3d60 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/account/manage/assets/arrow-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/bierzo-wallet/src/routes/account/manage/assets/arrow-up.svg b/packages/bierzo-wallet/src/routes/account/manage/assets/arrow-up.svg new file mode 100644 index 000000000..95b806efe --- /dev/null +++ b/packages/bierzo-wallet/src/routes/account/manage/assets/arrow-up.svg @@ -0,0 +1,3 @@ + + + From 73e4625ed08b4297f35f6fdc1e769c7daafdec71 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:30:17 +0200 Subject: [PATCH 164/204] Remove not used menu items --- .../src/routes/account/manage/components/NameForm.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx index 672ef0035..fa83d0bd7 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; +import { NAME_EDIT_ROUTE, REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; function onRegisterUsername(): void { history.push(REGISTER_IOVNAME_ROUTE); @@ -13,11 +13,7 @@ function onRegisterStarname(): void { history.push(REGISTER_STARNAME_ROUTE); } -const menuItems: readonly ActionMenuItem[] = [ - { title: "Renew", action: () => console.log("Renew") }, - { title: "Transfer iovname", action: () => console.log("Transfer iovname") }, - { title: "Delete iovname", action: () => console.log("Delete iovname") }, -]; +const menuItems: readonly ActionMenuItem[] = [{ title: "Renew", action: () => console.log("Delete") }]; const NameAccountManage = (): JSX.Element => { const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; @@ -27,7 +23,7 @@ const NameAccountManage = (): JSX.Element => { } const onEditAccount = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, aadressToManage); + history.push(NAME_EDIT_ROUTE, aadressToManage); }; return ; From 6c55773e9bd95ad8478e92e9597443bb8566ad59 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:30:38 +0200 Subject: [PATCH 165/204] Add starname manage form --- .../manage/components/StarnameForm.tsx | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx new file mode 100644 index 000000000..bf287a5e8 --- /dev/null +++ b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx @@ -0,0 +1,46 @@ +import { ActionMenuItem } from "medulas-react-components"; +import * as React from "react"; + +import { history } from "../../.."; +import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; +import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; +import AssociatedNamesList from "./AssociatedNamesList"; + +function onRegisterUsername(): void { + history.push(REGISTER_IOVNAME_ROUTE); +} + +function onRegisterStarname(): void { + history.push(REGISTER_STARNAME_ROUTE); +} + +const menuItems: readonly ActionMenuItem[] = [ + { title: "Renew", action: () => console.log("Renew") }, + { title: "Transfer iovname", action: () => console.log("Transfer starname") }, + { title: "Delete iovname", action: () => console.log("Delete starname") }, +]; + +const StarnameAccountManage = (): JSX.Element => { + const addressToManage: BwUsernameWithChainName | undefined = history.location.state; + + if (!addressToManage) { + throw new Error("No address to manage provided, something wrong."); + } + + const onEditAccount = (): void => { + history.push(REGISTER_IOVNAME_ROUTE, addressToManage); + }; + + const onRegisterName = (): void => { + history.push(REGISTER_IOVNAME_ROUTE, addressToManage); + }; + + return ( + + + + + ); +}; + +export default StarnameAccountManage; From 6d2d82bc6af73029e0fbc46447bcdd8af66ad8f6 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:30:57 +0200 Subject: [PATCH 166/204] Fixes after rebase --- .../src/routes/account/register/index.stories.tsx | 6 ++---- .../src/routes/addresses/index.stories.tsx | 11 ----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx b/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx index a219d5a86..541ed1d19 100644 --- a/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/index.stories.tsx @@ -4,12 +4,10 @@ import { storiesOf } from "@storybook/react"; import React from "react"; import { stringToAmount } from "ui-logic"; +import { ChainAddressPairWithName } from "../../../components/AddressesTable"; import DecoratedStorybook, { bierzoRoot } from "../../../utils/storybook"; -import { ChainAddressPairWithName } from "../../components/AddressesTable"; +import { BALANCE_STORY_PATH, BALANCE_STORY_VIEW_PATH } from "../../balance/index.stories"; import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../../transactions/index.stories"; -import DecoratedStorybook, { bierzoRoot } from "../../utils/storybook"; -import { BALANCE_STORY_PATH, BALANCE_STORY_VIEW_PATH } from "../balance/index.stories"; -import { TRANSACTIONS_STORY_PATH, TRANSACTIONS_STORY_SHOW_PATH } from "../transactions/index.stories"; import ConfirmRegistration from "./components/ConfirmRegistration"; import IovnameForm from "./components/IovnameForm"; import StarnameForm from "./components/StarnameForm"; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx index 51975d1ea..cb2d74c59 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.stories.tsx @@ -12,12 +12,9 @@ import { REGISTER_IOVNAME_STORY_PATH, REGISTER_STARNAME_REGISTRATION_STORY_PATH, REGISTER_STARNAME_STORY_PATH, -} from "../register/index.stories"; -import { BwUsernameWithChainName } from "."; } from "../account/register/index.stories"; import AddressesTab from "./components/AddressesTab"; import Iovnames from "./components/Iovnames"; -import ManageName from "./components/ManageName"; import Starnames from "./components/Starnames"; import UserAddresses from "./components/UserAddresses"; @@ -146,12 +143,4 @@ storiesOf(`${bierzoRoot}/Addresses`, module) rpcEndpointType="extension" /> - )) - .add("Manage names", () => ( - - - )); From 1a0066aeafba863bfb76b7200726795f098befd1 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 00:31:53 +0200 Subject: [PATCH 167/204] Remove not used imports --- .../routes/account/manage/components/AssociatedNamesList.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx index 7f37f3ffe..5c062d887 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx @@ -3,10 +3,8 @@ import { ActionMenuItem, Block, Image, makeStyles, Typography } from "medulas-re import React from "react"; import { history } from "../../.."; -import starnameLogo from "../../../../assets/starname-logo.svg"; import AccountManage, { BwAccountWithChainName } from "../../../../components/AccountManage"; -import { BwAccount } from "../../../../store/accounts"; -import { NAME_EDIT_ROUTE, NAME_MANAGE_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; +import { NAME_EDIT_ROUTE } from "../../../paths"; import arrowDown from "../assets/arrow-down.svg"; import arrowUp from "../assets/arrow-up.svg"; From 79cc515ede192a3914050110caffb5a88778797b Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 12:05:19 +0200 Subject: [PATCH 168/204] Rename route REGISTER_STARNAME_ROUTE -> STARNAME_REGISTER_ROUTE --- .../src/routes/account/manage/components/IovnameForm.tsx | 4 ++-- .../src/routes/account/manage/components/NameForm.tsx | 4 ++-- .../src/routes/account/manage/components/StarnameForm.tsx | 4 ++-- .../src/routes/addresses/components/StarnamesExists.tsx | 6 +++--- .../src/routes/addresses/components/StarnamesNotExists.tsx | 6 +++--- packages/bierzo-wallet/src/routes/addresses/index.tsx | 4 ++-- packages/bierzo-wallet/src/routes/index.tsx | 4 ++-- packages/bierzo-wallet/src/routes/paths.ts | 3 +-- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx index e7d6e218e..e37b722d9 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx @@ -3,14 +3,14 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; +import { REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; function onRegisterUsername(): void { history.push(REGISTER_IOVNAME_ROUTE); } function onRegisterStarname(): void { - history.push(REGISTER_STARNAME_ROUTE); + history.push(STARNAME_REGISTER_ROUTE); } const menuItems: readonly ActionMenuItem[] = [ diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx index fa83d0bd7..69274e1be 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx @@ -3,14 +3,14 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { NAME_EDIT_ROUTE, REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; +import { NAME_EDIT_ROUTE, REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; function onRegisterUsername(): void { history.push(REGISTER_IOVNAME_ROUTE); } function onRegisterStarname(): void { - history.push(REGISTER_STARNAME_ROUTE); + history.push(STARNAME_REGISTER_ROUTE); } const menuItems: readonly ActionMenuItem[] = [{ title: "Renew", action: () => console.log("Delete") }]; diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx index bf287a5e8..423eb7361 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../../paths"; +import { REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; import AssociatedNamesList from "./AssociatedNamesList"; function onRegisterUsername(): void { @@ -11,7 +11,7 @@ function onRegisterUsername(): void { } function onRegisterStarname(): void { - history.push(REGISTER_STARNAME_ROUTE); + history.push(STARNAME_REGISTER_ROUTE); } const menuItems: readonly ActionMenuItem[] = [ diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 432f33997..9035a79af 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -5,7 +5,7 @@ import React from "react"; import { history } from "../.."; import starnameLogo from "../../../assets/starname-logo.svg"; import { BwAccount } from "../../../store/accounts"; -import { REGISTER_NAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../paths"; +import { REGISTER_NAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; interface Props { readonly starnames: readonly BwAccount[]; @@ -42,7 +42,7 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element Register a new starname
- + Register now {/* TODO remove this Typography when /register-name accessible from starname list */} @@ -67,7 +67,7 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element ) .map(starname => { const onManage = (): void => { - history.push(REGISTER_STARNAME_ROUTE, starname); + history.push(STARNAME_REGISTER_ROUTE, starname); }; return ( diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx index 25617df17..19f741ef3 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx @@ -6,7 +6,7 @@ import React from "react"; import { history } from "../.."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; import { NoStarnameHeader } from "../../account/register/components/StarnameForm"; -import { REGISTER_NAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../../paths"; +import { REGISTER_NAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; interface StarnamesNotExistsProps { readonly onRegisterStarname: () => void; @@ -30,7 +30,7 @@ export function GetYourAddressWithExtension({ You can not register - + starname diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index 0577bfc08..bfb21441a 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -8,7 +8,7 @@ import { getChainName } from "../../config"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { getChainAddressPairWithNames } from "../../utils/tokens"; -import { REGISTER_IOVNAME_ROUTE, REGISTER_STARNAME_ROUTE } from "../paths"; +import { REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../paths"; import AddressesTab from "./components/AddressesTab"; function onRegisterIovname(): void { @@ -16,7 +16,7 @@ function onRegisterIovname(): void { } function onRegisterStarname(): void { - history.push(REGISTER_STARNAME_ROUTE); + history.push(STARNAME_REGISTER_ROUTE); } const Addresses = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index d2f8a2964..3ea9de5fa 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -17,7 +17,7 @@ import { POLICY_ROUTE, REGISTER_IOVNAME_ROUTE, REGISTER_NAME_ROUTE, - REGISTER_STARNAME_ROUTE, + STARNAME_REGISTER_ROUTE, TERMS_ROUTE, TRANSACTIONS_ROUTE, } from "./paths"; @@ -41,7 +41,7 @@ const Routes = (): JSX.Element => ( } /> - } /> + } /> } /> diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index 52794db3f..090a54fcc 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -2,10 +2,8 @@ export const PAYMENT_ROUTE = "/payment"; export const LOGIN_ROUTE = "/login"; export const TRANSACTIONS_ROUTE = "/transactions"; export const BALANCE_ROUTE = "/balance"; -export const CONFIRM_TRANSACTION_ROUTE = "/confirm-transaction"; export const ADDRESSES_ROUTE = "/addresses"; export const REGISTER_IOVNAME_ROUTE = "/iovname/register"; -export const REGISTER_STARNAME_ROUTE = "/starname/register"; export const REGISTER_NAME_ROUTE = "/name/register"; export const ADDRESS_MANAGE_ROUTE = "/address-manage"; export const IOVNAME_MANAGE_ROUTE = "/iovname/manage"; @@ -13,5 +11,6 @@ export const IOVNAME_EDIT_ROUTE = "/iovname/edit"; export const NAME_MANAGE_ROUTE = "/name/manage"; export const NAME_EDIT_ROUTE = "/name/edit"; export const STARNAME_EDIT_ROUTE = "/starname/edit"; +export const STARNAME_REGISTER_ROUTE = "/starname/register"; export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; From 05acde68201bfba9e23abd1767b7c3442be7c6d3 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 12:06:25 +0200 Subject: [PATCH 169/204] Reaname REGISTER_NAME_ROUTE->NAME_REGISTER_ROUTE --- .../src/routes/addresses/components/StarnamesExists.tsx | 4 ++-- .../src/routes/addresses/components/StarnamesNotExists.tsx | 4 ++-- packages/bierzo-wallet/src/routes/index.tsx | 4 ++-- packages/bierzo-wallet/src/routes/paths.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 9035a79af..cb998ea95 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -5,7 +5,7 @@ import React from "react"; import { history } from "../.."; import starnameLogo from "../../../assets/starname-logo.svg"; import { BwAccount } from "../../../store/accounts"; -import { REGISTER_NAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; +import { NAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; interface Props { readonly starnames: readonly BwAccount[]; @@ -53,7 +53,7 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element inline link onClick={() => { - history.push(REGISTER_NAME_ROUTE); + history.push(NAME_REGISTER_ROUTE); }} > Register your name diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx index 19f741ef3..cbe00efd1 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesNotExists.tsx @@ -6,7 +6,7 @@ import React from "react"; import { history } from "../.."; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; import { NoStarnameHeader } from "../../account/register/components/StarnameForm"; -import { REGISTER_NAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; +import { NAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; interface StarnamesNotExistsProps { readonly onRegisterStarname: () => void; @@ -48,7 +48,7 @@ export function GetYourAddressWithExtension({ inline link onClick={() => { - history.push(REGISTER_NAME_ROUTE); + history.push(NAME_REGISTER_ROUTE); }} > Register your name diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index 3ea9de5fa..a25b799e2 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -13,10 +13,10 @@ import { IOVNAME_MANAGE_ROUTE, LOGIN_ROUTE, NAME_MANAGE_ROUTE, + NAME_REGISTER_ROUTE, PAYMENT_ROUTE, POLICY_ROUTE, REGISTER_IOVNAME_ROUTE, - REGISTER_NAME_ROUTE, STARNAME_REGISTER_ROUTE, TERMS_ROUTE, TRANSACTIONS_ROUTE, @@ -42,7 +42,7 @@ const Routes = (): JSX.Element => ( } /> } /> - } /> + } />
diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index 090a54fcc..185135365 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -4,12 +4,12 @@ export const TRANSACTIONS_ROUTE = "/transactions"; export const BALANCE_ROUTE = "/balance"; export const ADDRESSES_ROUTE = "/addresses"; export const REGISTER_IOVNAME_ROUTE = "/iovname/register"; -export const REGISTER_NAME_ROUTE = "/name/register"; export const ADDRESS_MANAGE_ROUTE = "/address-manage"; export const IOVNAME_MANAGE_ROUTE = "/iovname/manage"; export const IOVNAME_EDIT_ROUTE = "/iovname/edit"; export const NAME_MANAGE_ROUTE = "/name/manage"; export const NAME_EDIT_ROUTE = "/name/edit"; +export const NAME_REGISTER_ROUTE = "/name/register"; export const STARNAME_EDIT_ROUTE = "/starname/edit"; export const STARNAME_REGISTER_ROUTE = "/starname/register"; export const TERMS_ROUTE = "/terms"; From e326c5dcd054bc7f88a7a8fc465499cc9810041a Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 12:08:32 +0200 Subject: [PATCH 170/204] Rename REGISTER_IOVNAME_ROUTE->IOVNAME_REGISTER_ROUTE --- .../bierzo-wallet/src/components/AccountManage/index.tsx | 2 +- .../src/routes/account/manage/components/IovnameForm.tsx | 6 +++--- .../src/routes/account/manage/components/NameForm.tsx | 4 ++-- .../src/routes/account/manage/components/StarnameForm.tsx | 8 ++++---- .../src/routes/addresses/components/IovnamesExists.tsx | 4 ++-- .../src/routes/addresses/components/IovnamesNotExists.tsx | 4 ++-- packages/bierzo-wallet/src/routes/addresses/index.tsx | 4 ++-- packages/bierzo-wallet/src/routes/balance/index.tsx | 4 ++-- packages/bierzo-wallet/src/routes/index.tsx | 4 ++-- packages/bierzo-wallet/src/routes/paths.ts | 6 +++++- 10 files changed, 25 insertions(+), 21 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.tsx index dc0f5644e..b7f199cd7 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.tsx @@ -118,7 +118,7 @@ const AccountManage: React.FunctionComponent = ({ const onEdit = (): void => { onEditAccount(); - // history.push(REGISTER_IOVNAME_ROUTE, account); + // history.push(IOVNAME_REGISTER_ROUTE, account); }; return ( diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx index e37b722d9..4ca913944 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx @@ -3,10 +3,10 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; +import { IOVNAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; function onRegisterUsername(): void { - history.push(REGISTER_IOVNAME_ROUTE); + history.push(IOVNAME_REGISTER_ROUTE); } function onRegisterStarname(): void { @@ -27,7 +27,7 @@ const IovnameAccountManage = (): JSX.Element => { } const onEditAccount = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, aadressToManage); + history.push(IOVNAME_REGISTER_ROUTE, aadressToManage); }; return ; diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx index 69274e1be..5d6b7cca2 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx @@ -3,10 +3,10 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { NAME_EDIT_ROUTE, REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; +import { IOVNAME_REGISTER_ROUTE, NAME_EDIT_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; function onRegisterUsername(): void { - history.push(REGISTER_IOVNAME_ROUTE); + history.push(IOVNAME_REGISTER_ROUTE); } function onRegisterStarname(): void { diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx index 423eb7361..a87307ab2 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx @@ -3,11 +3,11 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; +import { IOVNAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; import AssociatedNamesList from "./AssociatedNamesList"; function onRegisterUsername(): void { - history.push(REGISTER_IOVNAME_ROUTE); + history.push(IOVNAME_REGISTER_ROUTE); } function onRegisterStarname(): void { @@ -28,11 +28,11 @@ const StarnameAccountManage = (): JSX.Element => { } const onEditAccount = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, addressToManage); + history.push(IOVNAME_REGISTER_ROUTE, addressToManage); }; const onRegisterName = (): void => { - history.push(REGISTER_IOVNAME_ROUTE, addressToManage); + history.push(IOVNAME_REGISTER_ROUTE, addressToManage); }; return ( diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx index 42ab0049c..5ee15b317 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesExists.tsx @@ -5,7 +5,7 @@ import React from "react"; import { history } from "../.."; import iovnameLogo from "../../../assets/iovname-logo.svg"; import { BwUsername } from "../../../store/usernames"; -import { IOVNAME_MANAGE_ROUTE, REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { IOVNAME_MANAGE_ROUTE, IOVNAME_REGISTER_ROUTE } from "../../paths"; interface Props { readonly iovnames: readonly BwUsername[]; @@ -43,7 +43,7 @@ function IovnamesExists({ iovnames, onRegisterIovname }: Props): JSX.Element { Register a new iovname - + Register now diff --git a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx index 828732f4e..4cb857da5 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/IovnamesNotExists.tsx @@ -5,9 +5,9 @@ import React from "react"; import { RpcEndpointType } from "../../../communication/rpcEndpoint"; import { NoIovnameHeader } from "../../account/register/components/IovnameForm"; -import { REGISTER_IOVNAME_ROUTE } from "../../paths"; +import { IOVNAME_REGISTER_ROUTE } from "../../paths"; -export const registerIovnameId = REGISTER_IOVNAME_ROUTE.replace(/\//g, "-"); +export const registerIovnameId = IOVNAME_REGISTER_ROUTE.replace(/\//g, "-"); interface StarnamesNotExistsProps { readonly onRegisterIovname: () => void; diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index bfb21441a..13f679bf2 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -8,11 +8,11 @@ import { getChainName } from "../../config"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { getChainAddressPairWithNames } from "../../utils/tokens"; -import { REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE } from "../paths"; +import { IOVNAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../paths"; import AddressesTab from "./components/AddressesTab"; function onRegisterIovname(): void { - history.push(REGISTER_IOVNAME_ROUTE); + history.push(IOVNAME_REGISTER_ROUTE); } function onRegisterStarname(): void { diff --git a/packages/bierzo-wallet/src/routes/balance/index.tsx b/packages/bierzo-wallet/src/routes/balance/index.tsx index 21df48dfe..74544b77b 100644 --- a/packages/bierzo-wallet/src/routes/balance/index.tsx +++ b/packages/bierzo-wallet/src/routes/balance/index.tsx @@ -6,11 +6,11 @@ import PageMenu from "../../components/PageMenu"; import { RootState } from "../../store/reducers"; import { getRpcEndpointType } from "../../store/rpcendpoint/selectors"; import { getFirstUsername } from "../../store/usernames/selectors"; -import { REGISTER_IOVNAME_ROUTE } from "../paths"; +import { IOVNAME_REGISTER_ROUTE } from "../paths"; import Layout from "./components"; function onRegisterIovname(): void { - history.push(REGISTER_IOVNAME_ROUTE); + history.push(IOVNAME_REGISTER_ROUTE); } const Balance = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index a25b799e2..98993a2aa 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -11,12 +11,12 @@ import { ADDRESSES_ROUTE, BALANCE_ROUTE, IOVNAME_MANAGE_ROUTE, + IOVNAME_REGISTER_ROUTE, LOGIN_ROUTE, NAME_MANAGE_ROUTE, NAME_REGISTER_ROUTE, PAYMENT_ROUTE, POLICY_ROUTE, - REGISTER_IOVNAME_ROUTE, STARNAME_REGISTER_ROUTE, TERMS_ROUTE, TRANSACTIONS_ROUTE, @@ -40,7 +40,7 @@ const Routes = (): JSX.Element => ( } /> - } /> + } /> } /> } /> diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index 185135365..a7a3b9ff9 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -3,14 +3,18 @@ export const LOGIN_ROUTE = "/login"; export const TRANSACTIONS_ROUTE = "/transactions"; export const BALANCE_ROUTE = "/balance"; export const ADDRESSES_ROUTE = "/addresses"; -export const REGISTER_IOVNAME_ROUTE = "/iovname/register"; export const ADDRESS_MANAGE_ROUTE = "/address-manage"; +// Account: Iovnames paths export const IOVNAME_MANAGE_ROUTE = "/iovname/manage"; export const IOVNAME_EDIT_ROUTE = "/iovname/edit"; +export const IOVNAME_REGISTER_ROUTE = "/iovname/register"; +// Account: Names paths export const NAME_MANAGE_ROUTE = "/name/manage"; export const NAME_EDIT_ROUTE = "/name/edit"; export const NAME_REGISTER_ROUTE = "/name/register"; +// Account: Starnames paths export const STARNAME_EDIT_ROUTE = "/starname/edit"; export const STARNAME_REGISTER_ROUTE = "/starname/register"; + export const TERMS_ROUTE = "/terms"; export const POLICY_ROUTE = "/policy"; From 868cc617df0675b916cd9c91e05fa71eda60c189 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 12:25:29 +0200 Subject: [PATCH 171/204] Redirect to starname manage route --- .../src/routes/addresses/components/StarnamesExists.tsx | 4 ++-- packages/bierzo-wallet/src/routes/paths.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index cb998ea95..999586981 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -5,7 +5,7 @@ import React from "react"; import { history } from "../.."; import starnameLogo from "../../../assets/starname-logo.svg"; import { BwAccount } from "../../../store/accounts"; -import { NAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; +import { NAME_REGISTER_ROUTE, STARNAME_MANAGE_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; interface Props { readonly starnames: readonly BwAccount[]; @@ -67,7 +67,7 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element ) .map(starname => { const onManage = (): void => { - history.push(STARNAME_REGISTER_ROUTE, starname); + history.push(STARNAME_MANAGE_ROUTE, starname); }; return ( diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index a7a3b9ff9..f9ecc5659 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -3,7 +3,6 @@ export const LOGIN_ROUTE = "/login"; export const TRANSACTIONS_ROUTE = "/transactions"; export const BALANCE_ROUTE = "/balance"; export const ADDRESSES_ROUTE = "/addresses"; -export const ADDRESS_MANAGE_ROUTE = "/address-manage"; // Account: Iovnames paths export const IOVNAME_MANAGE_ROUTE = "/iovname/manage"; export const IOVNAME_EDIT_ROUTE = "/iovname/edit"; @@ -13,6 +12,7 @@ export const NAME_MANAGE_ROUTE = "/name/manage"; export const NAME_EDIT_ROUTE = "/name/edit"; export const NAME_REGISTER_ROUTE = "/name/register"; // Account: Starnames paths +export const STARNAME_MANAGE_ROUTE = "/starname/manage"; export const STARNAME_EDIT_ROUTE = "/starname/edit"; export const STARNAME_REGISTER_ROUTE = "/starname/register"; From 93d2a7bf1d43b260c248dcd21b7f9d2f8dd3ccaa Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 18:01:36 +0200 Subject: [PATCH 172/204] Need to update account renew time --- packages/bierzo-wallet/src/communication/requestgenerators.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/communication/requestgenerators.ts b/packages/bierzo-wallet/src/communication/requestgenerators.ts index c2ca5c334..7a0cbe6db 100644 --- a/packages/bierzo-wallet/src/communication/requestgenerators.ts +++ b/packages/bierzo-wallet/src/communication/requestgenerators.ts @@ -108,7 +108,7 @@ export const generateRegisterDomainTxWithFee = async ( domain: string, ): Promise => { const creatorAddress = bnsCodec.identityToAddress(creator); - const TwoHoursInSeconds = 2 * 3600; + const TwoHoursInSeconds = 2 * 3600; // FIXME: I think we need to change this before release. const regDomainTx: RegisterDomainTx = { kind: "bns/register_domain", From 74773942cdab309bbe4369fa3eb86daa519571d3 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:30:22 +0200 Subject: [PATCH 173/204] Show only exists account data --- .../src/components/AccountEdit/index.tsx | 95 +++++-------------- 1 file changed, 25 insertions(+), 70 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx index 92ad79ed5..96d49f8fe 100644 --- a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx @@ -1,17 +1,14 @@ import { Address, Fee } from "@iov/bcp"; import clipboardCopy from "clipboard-copy"; -import { FieldValidator } from "final-form"; import { Back, Block, Button, - FieldInputValue, Form, FormValues, Hairline, Image, makeStyles, - TextField, ToastContext, ToastVariant, Tooltip, @@ -115,10 +112,12 @@ export function getFormInitValues(addressItems: SelectAddressItem[]): FormValues export function getAddressItems(chainAddresses: readonly ChainAddressPairWithName[]): SelectAddressItem[] { const addressItems: SelectAddressItem[] = []; chainAddresses.forEach((chain, index) => { - addressItems.push({ - id: index.toString(), - chain, - }); + if (chain.address) { + addressItems.push({ + id: index.toString(), + chain, + }); + } }); return addressItems; @@ -148,32 +147,21 @@ export function NoIovnameHeader(): JSX.Element { export interface AccountEditProps extends AddressesTableProps { readonly onCancel: () => void; - readonly account: BwUsernameWithChainName | BwAccountWithChainName | undefined; + readonly account: BwUsernameWithChainName | BwAccountWithChainName; readonly transactionFee: Fee | undefined; } interface Props extends AccountEditProps { - readonly accountValidator: FieldValidator; readonly onSubmit: (values: object) => Promise; } -const AccountEdit = ({ - accountValidator, - chainAddresses, - account, - onCancel, - transactionFee, - onSubmit, -}: Props): JSX.Element => { +const AccountEdit = ({ chainAddresses, account, onCancel, transactionFee, onSubmit }: Props): JSX.Element => { const classes = useStyles(); const toast = React.useContext(ToastContext); const chainAddressesItems = React.useMemo(() => { - if (account) { - return getAddressItems(account.addresses); - } - return getAddressItems(chainAddresses); - }, [chainAddresses, account]); + return getAddressItems(account.addresses); + }, [account]); const initialValues = React.useMemo(() => getFormInitValues(chainAddressesItems), [chainAddressesItems]); const { form, handleSubmit, invalid, submitting, validating } = useForm({ @@ -220,54 +208,21 @@ const AccountEdit = ({
- {account && ( - - - - {isAccountData(account) ? `${account.name}*${account.domain}` : account.username} - - - - Copy - - - {isAccountData(account) && ( - - Expires on {formatDate(account.expiryDate)} {formatTime(account.expiryDate)} - - )} - - )} - {!account && ( - - - - Create your iovname - - - - } title="Choose your address"> - With IOV you can choose your easy to read human readable address. No more complicated - cryptography when sending to friends. - - - - - How it works - - - - - - - + + + {isAccountData(account) ? `${account.name}*${account.domain}` : account.username} + + + + Copy + + + {isAccountData(account) && ( + + + Expires on {formatDate(account.expiryDate)} {formatTime(account.expiryDate)} + + )} From 43e1d4b285be3285d1d290d723f0ccb20bac2b61 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:32:12 +0200 Subject: [PATCH 174/204] Remove not required field validator --- .../components/AccountEdit/index.stories.tsx | 8 --- .../account/update/components/IovnameForm.tsx | 56 +++---------------- .../routes/account/update/index.stories.tsx | 8 --- 3 files changed, 9 insertions(+), 63 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AccountEdit/index.stories.tsx b/packages/bierzo-wallet/src/components/AccountEdit/index.stories.tsx index f7537af93..c2e43a1f6 100644 --- a/packages/bierzo-wallet/src/components/AccountEdit/index.stories.tsx +++ b/packages/bierzo-wallet/src/components/AccountEdit/index.stories.tsx @@ -2,8 +2,6 @@ import { Address, ChainId, Fee, Token, TokenTicker } from "@iov/bcp"; import { action } from "@storybook/addon-actions"; import { linkTo } from "@storybook/addon-links"; import { storiesOf } from "@storybook/react"; -import { FieldValidator } from "final-form"; -import { FieldInputValue } from "medulas-react-components"; import React from "react"; import { stringToAmount } from "ui-logic"; @@ -48,11 +46,6 @@ const account: BwUsernameWithChainName = { addresses: addresses, }; -const accountValidator: FieldValidator = (value): string | undefined => { - action("Account validation")(value); - return undefined; -}; - export const UPDATE_ACCOUNT_STORY_PATH = `${bierzoRoot}/Update Account`; export const UPDATE_ACCOUNT_SAMPLE_STORY_PATH = "Update sample"; @@ -61,7 +54,6 @@ storiesOf(UPDATE_ACCOUNT_STORY_PATH, module) .add(UPDATE_ACCOUNT_SAMPLE_STORY_PATH, () => ( { - const account: BwUsernameWithChainName | undefined = history.location.state; + const account: BwUsernameWithChainName = history.location.state; const onReturnToManage = (): void => { history.push(IOVNAME_MANAGE_ROUTE, account); @@ -59,44 +48,18 @@ const IovnameAccountUpdate = ({ const billboard = React.useContext(BillboardContext); const toast = React.useContext(ToastContext); - const iovnameValidator: FieldValidator = (value): string | undefined => { - if (!account) { - if (!value) { - return "Required"; - } - - const checkResult = isValidIov(value); - - switch (checkResult) { - case "not_iov": - return "Iovname must end with *iov"; - case "wrong_number_of_asterisks": - return "Iovname must include only one namespace"; - case "too_short": - return "Iovname should be at least 3 characters"; - case "too_long": - return "Iovname should be maximum 64 characters"; - case "wrong_chars": - return "Iovname should contain 'abcdefghijklmnopqrstuvwxyz0123456789-_.' characters only"; - case "valid": - break; - default: - throw new Error(`"Unknown iovname validation error: ${checkResult}`); - } - } - - return undefined; - }; - const onSubmit = async (values: object): Promise => { + if (!bnsIdentity) throw Error("No bnsIdentity found for submit"); + if (!rpcEndpoint) throw Error("No rpcEndpoint found for submit"); + const formValues = values as FormValues; const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); try { - const request = await generateRegisterUsernameTxRequest( + const request = await generateUpdateUsernameTxRequest( bnsIdentity, - formValues[EDIT_ACCOUNT_FIELD], + account.username, addressesToRegister, ); @@ -133,7 +96,6 @@ const IovnameAccountUpdate = ({ return ( = (value): string | undefined => { - action("Iovname validation")(value); - return undefined; -}; - const account: BwUsernameWithChainName = { username: "test*iov", addresses: addresses, @@ -73,7 +66,6 @@ storiesOf(UPDATE_ACCOUNT_STORY_PATH, module) .add(UPDATE_IOVNAME_REGISTRATION_STORY_PATH, () => ( Date: Fri, 13 Mar 2020 19:33:28 +0200 Subject: [PATCH 175/204] Refactor callback name onEditAccount->onEdit --- .../components/AccountManage/index.stories.tsx | 2 +- .../src/components/AccountManage/index.tsx | 16 +++------------- .../src/routes/account/manage/index.stories.tsx | 4 ++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx index 9cf21d4e9..23a98358a 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.stories.tsx @@ -65,7 +65,7 @@ storiesOf(ACCOUNT_MANAGE_STORY_PATH, module) .add(ACCOUNT_MANAGE_SAMPLE_STORY_PATH, () => ( diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.tsx index b7f199cd7..79f65b82a 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.tsx @@ -74,7 +74,7 @@ interface Props { readonly account: AccountModuleMixedType; readonly menuItems: readonly ActionMenuItem[]; readonly hideExpiration?: boolean; - readonly onEditAccount: () => void; + readonly onEdit: () => void; } export function isUsernameData(account: AccountModuleMixedType): account is BwUsernameWithChainName { @@ -100,27 +100,17 @@ const useStyles = makeStyles({ }, }); -const AccountManage: React.FunctionComponent = ({ - account, - menuItems, - onEditAccount, - hideExpiration, -}) => { +const AccountManage: React.FunctionComponent = ({ account, menuItems, onEdit, hideExpiration }) => { const paperClasses = usePaper(); const classes = useStyles(); const toast = React.useContext(ToastContext); const onAccountCopy = (): void => { - const name = isAccountData(account) ? account.name : account.username; + const name = isAccountData(account) ? `${account.name}*${account.domain}` : account.username; clipboardCopy(name); toast.show("Account has been copied to clipboard.", ToastVariant.INFO); }; - const onEdit = (): void => { - onEditAccount(); - // history.push(IOVNAME_REGISTER_ROUTE, account); - }; - return ( diff --git a/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx b/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx index f690246ed..25540dc9b 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/index.stories.tsx @@ -96,7 +96,7 @@ storiesOf(`${bierzoRoot}/Account Manage`, module) .add("Manage name", () => ( @@ -105,7 +105,7 @@ storiesOf(`${bierzoRoot}/Account Manage`, module) .add(ACCOUNT_MANAGE_IOVNAMES_STORY_PATH, () => ( From afcee62e79768f4d6eedf683ae3a99628b2e308c Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:33:45 +0200 Subject: [PATCH 176/204] Change sorting behaviour --- .../src/components/AddressesTable/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AddressesTable/index.tsx b/packages/bierzo-wallet/src/components/AddressesTable/index.tsx index 86766f8a6..68738bfb2 100644 --- a/packages/bierzo-wallet/src/components/AddressesTable/index.tsx +++ b/packages/bierzo-wallet/src/components/AddressesTable/index.tsx @@ -79,11 +79,11 @@ const AddressesTable = ({ chainAddresses }: AddressesTableProps): JSX.Element => head: classes.cellHead, }; - const chainAddressesSorted = Array.from( - chainAddresses, - ).sort((a: ChainAddressPairWithName, b: ChainAddressPairWithName) => - a.chainName.localeCompare(b.chainName, undefined, { sensitivity: "base" }), - ); + const chainAddressesSorted = chainAddresses + .slice() + .sort((a: ChainAddressPairWithName, b: ChainAddressPairWithName) => + a.chainName.localeCompare(b.chainName, undefined, { sensitivity: "base" }), + ); return ( From aa4d2c725567796d3e990e8461054996270d485a Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:34:05 +0200 Subject: [PATCH 177/204] Fix getAccounts query --- packages/bierzo-wallet/src/logic/transactions/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/logic/transactions/index.ts b/packages/bierzo-wallet/src/logic/transactions/index.ts index 9a2715746..4278273c9 100644 --- a/packages/bierzo-wallet/src/logic/transactions/index.ts +++ b/packages/bierzo-wallet/src/logic/transactions/index.ts @@ -67,7 +67,7 @@ async function mayDispatchAccount(dispatch: Dispatch, accountTx: UnsignedTransac if (isReplaceAccountTargetsTx(accountTx)) { const connection = await getConnectionForBns(); - const accounts = await connection.getAccounts({ name: accountTx.name, domain: accountTx.domain }); + const accounts = await connection.getAccounts({ name: `${accountTx.name}*${accountTx.domain}` }); if (accounts.length !== 1) throw Error("Did not find unique account"); const account: BwAccount = { From 7106587a7adbc2cc790dae8a981ab22ae323faea Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:34:32 +0200 Subject: [PATCH 178/204] Reorganize Routes --- packages/bierzo-wallet/src/routes/index.tsx | 12 +++++++++--- packages/bierzo-wallet/src/routes/paths.ts | 1 - 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/index.tsx b/packages/bierzo-wallet/src/routes/index.tsx index 98993a2aa..077a42d8f 100644 --- a/packages/bierzo-wallet/src/routes/index.tsx +++ b/packages/bierzo-wallet/src/routes/index.tsx @@ -3,20 +3,23 @@ import React from "react"; import { Route, Router, Switch } from "react-router"; import RequireLogin from "../components/RequireLogin"; -import { AccountManage, AccountRegister } from "./account"; +import { AccountManage, AccountRegister, AccountUpdate } from "./account"; import Addresses from "./addresses"; import Balance from "./balance"; import Login from "./login"; import { ADDRESSES_ROUTE, BALANCE_ROUTE, + IOVNAME_EDIT_ROUTE, IOVNAME_MANAGE_ROUTE, IOVNAME_REGISTER_ROUTE, LOGIN_ROUTE, + NAME_EDIT_ROUTE, NAME_MANAGE_ROUTE, NAME_REGISTER_ROUTE, PAYMENT_ROUTE, POLICY_ROUTE, + STARNAME_MANAGE_ROUTE, STARNAME_REGISTER_ROUTE, TERMS_ROUTE, TRANSACTIONS_ROUTE, @@ -37,12 +40,15 @@ const Routes = (): JSX.Element => ( } /> + } /> } /> - - } /> } /> } /> + } /> + } /> + + diff --git a/packages/bierzo-wallet/src/routes/paths.ts b/packages/bierzo-wallet/src/routes/paths.ts index f9ecc5659..623a7a71d 100644 --- a/packages/bierzo-wallet/src/routes/paths.ts +++ b/packages/bierzo-wallet/src/routes/paths.ts @@ -13,7 +13,6 @@ export const NAME_EDIT_ROUTE = "/name/edit"; export const NAME_REGISTER_ROUTE = "/name/register"; // Account: Starnames paths export const STARNAME_MANAGE_ROUTE = "/starname/manage"; -export const STARNAME_EDIT_ROUTE = "/starname/edit"; export const STARNAME_REGISTER_ROUTE = "/starname/register"; export const TERMS_ROUTE = "/terms"; From b17a521989d98fa40c81c8801549daf245452deb Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:35:07 +0200 Subject: [PATCH 179/204] Add starname account management support --- packages/bierzo-wallet/src/routes/account/manage/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/bierzo-wallet/src/routes/account/manage/index.tsx b/packages/bierzo-wallet/src/routes/account/manage/index.tsx index 9bd39b3db..5eb97d15a 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/index.tsx @@ -5,6 +5,7 @@ import PageMenu from "../../../components/PageMenu"; import { AccountProps } from "../register"; import IovnameAccountManage from "./components/IovnameForm"; import NameAccountManage from "./components/NameForm"; +import StarnameAccountManage from "./components/StarnameForm"; const AccountManage = ({ entity }: AccountProps): JSX.Element => { return ( @@ -12,6 +13,7 @@ const AccountManage = ({ entity }: AccountProps): JSX.Element => { {entity === "iovname" && } {entity === "name" && } + {entity === "starname" && } ); From d68a2968f8be4915bb25d22c3acfa48cfe6db0ea Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:35:24 +0200 Subject: [PATCH 180/204] Add collapse animation --- .../manage/components/AssociatedNamesList.tsx | 54 +++++++++++-------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx index 5c062d887..77b771837 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx @@ -1,3 +1,4 @@ +import Collapse from "@material-ui/core/Collapse"; import Paper from "@material-ui/core/Paper"; import { ActionMenuItem, Block, Image, makeStyles, Typography } from "medulas-react-components"; import React from "react"; @@ -29,8 +30,20 @@ const menuItems: readonly ActionMenuItem[] = [ ]; const AssociatedNamesList: React.FunctionComponent = ({ names, onRegisterName }): JSX.Element => { + const [show, setShow] = React.useState(false); + const [showIcon, setShowIcon] = React.useState(arrowUp); + const paperClasses = usePaper(); + const toggleShowAccounts = (): void => { + setShow(show => !show); + if (show) { + setShowIcon(arrowDown); + } else { + setShowIcon(arrowUp); + } + }; + return ( @@ -49,37 +62,34 @@ const AssociatedNamesList: React.FunctionComponent = ({ names, onRegister - + Names associated with this starname - + - {names - .slice() - .sort((a, b) => - `${a.name}*${a.domain}`.localeCompare(`${b.name}*${b.domain}`, undefined, { - sensitivity: "base", - }), - ) - .map(name => { - const onEditAccount = (): void => { - history.push(NAME_EDIT_ROUTE, name); - }; + + {names + .slice() + .sort((a, b) => + `${a.name}*${a.domain}`.localeCompare(`${b.name}*${b.domain}`, undefined, { + sensitivity: "base", + }), + ) + .map(name => { + const onEdit = (): void => { + history.push(NAME_EDIT_ROUTE, name); + }; - return ( - - ); - })} + return ( + + ); + })} + ); From 5a5a2c434acfb4ceb255512c95b8142d2a38dc34 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:36:02 +0200 Subject: [PATCH 181/204] Do not check account undefined --- .../account/manage/components/IovnameForm.tsx | 14 +++++--------- .../routes/account/manage/components/NameForm.tsx | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx index 4ca913944..6ddc5e776 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { IOVNAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; +import { IOVNAME_EDIT_ROUTE, IOVNAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; function onRegisterUsername(): void { history.push(IOVNAME_REGISTER_ROUTE); @@ -20,17 +20,13 @@ const menuItems: readonly ActionMenuItem[] = [ ]; const IovnameAccountManage = (): JSX.Element => { - const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; + const account: BwUsernameWithChainName = history.location.state; - if (!aadressToManage) { - throw new Error("No address to manage provided, something wrong."); - } - - const onEditAccount = (): void => { - history.push(IOVNAME_REGISTER_ROUTE, aadressToManage); + const onEdit = (): void => { + history.push(IOVNAME_EDIT_ROUTE, account); }; - return ; + return ; }; export default IovnameAccountManage; diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx index 5d6b7cca2..6d6b78c6d 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx @@ -2,7 +2,7 @@ import { ActionMenuItem } from "medulas-react-components"; import * as React from "react"; import { history } from "../../.."; -import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; +import AccountManage, { BwAccountWithChainName } from "../../../../components/AccountManage"; import { IOVNAME_REGISTER_ROUTE, NAME_EDIT_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; function onRegisterUsername(): void { @@ -16,17 +16,13 @@ function onRegisterStarname(): void { const menuItems: readonly ActionMenuItem[] = [{ title: "Renew", action: () => console.log("Delete") }]; const NameAccountManage = (): JSX.Element => { - const aadressToManage: BwUsernameWithChainName | undefined = history.location.state; + const account: BwAccountWithChainName = history.location.state; - if (!aadressToManage) { - throw new Error("No address to manage provided, something wrong."); - } - - const onEditAccount = (): void => { - history.push(NAME_EDIT_ROUTE, aadressToManage); + const onEdit = (): void => { + history.push(NAME_EDIT_ROUTE, account); }; - return ; + return ; }; export default NameAccountManage; From f610f109f2f436bc580a07a6f79c5669f231261f Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:36:24 +0200 Subject: [PATCH 182/204] Manage starname account --- .../manage/components/StarnameForm.tsx | 70 +++++++++++++------ 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx index a87307ab2..d81122cc2 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx @@ -2,43 +2,71 @@ import { ActionMenuItem } from "medulas-react-components"; import * as React from "react"; import { history } from "../../.."; -import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { IOVNAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; +import AccountManage, { BwAccountWithChainName } from "../../../../components/AccountManage"; +import { getChainName } from "../../../../config"; +import { getConnectionForBns } from "../../../../logic/connection"; +import { NAME_EDIT_ROUTE, NAME_REGISTER_ROUTE } from "../../../paths"; import AssociatedNamesList from "./AssociatedNamesList"; -function onRegisterUsername(): void { - history.push(IOVNAME_REGISTER_ROUTE); -} - -function onRegisterStarname(): void { - history.push(STARNAME_REGISTER_ROUTE); -} - const menuItems: readonly ActionMenuItem[] = [ { title: "Renew", action: () => console.log("Renew") }, - { title: "Transfer iovname", action: () => console.log("Transfer starname") }, - { title: "Delete iovname", action: () => console.log("Delete starname") }, + { title: "Transfer starname", action: () => console.log("Transfer starname") }, + { title: "Delete starname", action: () => console.log("Delete starname") }, ]; const StarnameAccountManage = (): JSX.Element => { - const addressToManage: BwUsernameWithChainName | undefined = history.location.state; + const [domainAccounts, setDomainAccounts] = React.useState([]); + const account: BwAccountWithChainName = history.location.state; + + React.useEffect(() => { + let isSubscribed = true; + async function getDomainAccounts(): Promise { + const connection = await getConnectionForBns(); + const accountsNft = await connection.getAccounts({ domain: account.domain }); + if (isSubscribed) { + const bwAccountsWithChain: BwAccountWithChainName[] = await Promise.all( + accountsNft + .filter(nft => nft.name) + .map(async nft => { + return { + name: nft.name ? nft.name : "", + domain: nft.domain, + expiryDate: new Date(nft.validUntil * 1000), + addresses: await Promise.all( + nft.targets.map(async address => { + return { + chainId: address.chainId, + address: address.address, + chainName: await getChainName(address.chainId), + }; + }), + ), + }; + }), + ); + + setDomainAccounts(bwAccountsWithChain); + } + } + getDomainAccounts(); - if (!addressToManage) { - throw new Error("No address to manage provided, something wrong."); - } + return () => { + isSubscribed = false; + }; + }, [account]); - const onEditAccount = (): void => { - history.push(IOVNAME_REGISTER_ROUTE, addressToManage); + const onEdit = (): void => { + history.push(NAME_EDIT_ROUTE, account); }; const onRegisterName = (): void => { - history.push(IOVNAME_REGISTER_ROUTE, addressToManage); + history.push(NAME_REGISTER_ROUTE); }; return ( - - + + ); }; From 6571850bc300932a7aa993b4bedfd4038ee774e2 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:36:47 +0200 Subject: [PATCH 183/204] Replace name account component --- packages/bierzo-wallet/src/routes/account/update/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/account/update/index.tsx b/packages/bierzo-wallet/src/routes/account/update/index.tsx index ea8e8a345..55bec6caf 100644 --- a/packages/bierzo-wallet/src/routes/account/update/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/update/index.tsx @@ -16,6 +16,7 @@ import { TRANSACTIONS_ROUTE } from "../../paths"; import { AccountProps } from "../register"; import ConfirmRegistration from "./components/ConfirmUpdate"; import IovnameAccountUpdate from "./components/IovnameForm"; +import NameAccountUpdate from "./components/NameForm"; function onSeeTrasactions(): void { history.push(TRANSACTIONS_ROUTE); @@ -93,7 +94,7 @@ const AccountUpdate = ({ entity }: AccountProps): JSX.Element => { /> )} {entity === "name" && ( - Date: Fri, 13 Mar 2020 19:37:15 +0200 Subject: [PATCH 184/204] Add Name update support --- .../account/update/components/NameForm.tsx | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 packages/bierzo-wallet/src/routes/account/update/components/NameForm.tsx diff --git a/packages/bierzo-wallet/src/routes/account/update/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/account/update/components/NameForm.tsx new file mode 100644 index 000000000..f4b6ceb4a --- /dev/null +++ b/packages/bierzo-wallet/src/routes/account/update/components/NameForm.tsx @@ -0,0 +1,109 @@ +import { ChainId, Fee, Identity, TransactionId } from "@iov/bcp"; +import { BnsConnection } from "@iov/bns"; +import { BillboardContext, FormValues, ToastContext, ToastVariant } from "medulas-react-components"; +import React, { Dispatch, SetStateAction } from "react"; + +import { history } from "../../.."; +import { generateReplaceAccountTargetsTxRequest } from "../../../../communication/requestgenerators"; +import { RpcEndpoint } from "../../../../communication/rpcEndpoint"; +import AccountEdit, { getChainAddressPairsFromValues } from "../../../../components/AccountEdit"; +import { BwAccountWithChainName } from "../../../../components/AccountManage"; +import { ChainAddressPairWithName } from "../../../../components/AddressesTable"; +import LedgerBillboardMessage from "../../../../components/BillboardMessage/LedgerBillboardMessage"; +import NeumaBillboardMessage from "../../../../components/BillboardMessage/NeumaBillboardMessage"; +import { getConnectionForChainId } from "../../../../logic/connection"; +import { ExtendedIdentity } from "../../../../store/identities"; +import { IOVNAME_MANAGE_ROUTE } from "../../../paths"; + +export function getBnsIdentity(identities: ReadonlyMap): Identity | undefined { + for (const identity of Array.from(identities.values()).map(ext => ext.identity)) { + if (getConnectionForChainId(identity.chainId) instanceof BnsConnection) { + return identity; + } + } + return undefined; +} + +export interface Props { + readonly setTransactionId: Dispatch>; + readonly transactionFee: Fee | undefined; + readonly rpcEndpoint: RpcEndpoint; + readonly chainAddresses: readonly ChainAddressPairWithName[]; + readonly bnsIdentity: Identity; +} + +const NameAccountUpdate = ({ + setTransactionId, + transactionFee, + rpcEndpoint, + bnsIdentity, + chainAddresses, +}: Props): JSX.Element => { + const account: BwAccountWithChainName = history.location.state; + + const onReturnToManage = (): void => { + history.push(IOVNAME_MANAGE_ROUTE, account); + }; + + const billboard = React.useContext(BillboardContext); + const toast = React.useContext(ToastContext); + + const onSubmit = async (values: object): Promise => { + if (!bnsIdentity) throw Error("No bnsIdentity found for submit"); + if (!rpcEndpoint) throw Error("No rpcEndpoint found for submit"); + + const formValues = values as FormValues; + + const addressesToRegister = getChainAddressPairsFromValues(formValues, chainAddresses); + + try { + const request = await generateReplaceAccountTargetsTxRequest( + bnsIdentity, + account.domain, + account.name, + addressesToRegister, + ); + + if (rpcEndpoint.type === "extension") { + billboard.show( + , + "start", + "flex-end", + 0, + ); + } else { + billboard.show( + , + "center", + "center", + 0, + ); + } + const transactionId = await rpcEndpoint.sendSignAndPostRequest(request); + if (transactionId === undefined) { + toast.show(rpcEndpoint.notAvailableMessage, ToastVariant.ERROR); + } else if (transactionId === null) { + toast.show("Request rejected", ToastVariant.ERROR); + } else { + setTransactionId(transactionId); + } + } catch (error) { + console.error(error); + toast.show("An error occurred", ToastVariant.ERROR); + } finally { + billboard.close(); + } + }; + + return ( + + ); +}; + +export default NameAccountUpdate; From e7b2f2028d0e7c1dfa6b9bd0501c62315d7c1b62 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Fri, 13 Mar 2020 19:37:51 +0200 Subject: [PATCH 185/204] Add Chain name to account --- .../src/routes/addresses/index.tsx | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/index.tsx b/packages/bierzo-wallet/src/routes/addresses/index.tsx index 13f679bf2..8e86df140 100644 --- a/packages/bierzo-wallet/src/routes/addresses/index.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/index.tsx @@ -2,7 +2,7 @@ import React from "react"; import * as ReactRedux from "react-redux"; import { history } from ".."; -import { BwUsernameWithChainName } from "../../components/AccountManage"; +import { BwAccountWithChainName, BwUsernameWithChainName } from "../../components/AccountManage"; import PageMenu from "../../components/PageMenu"; import { getChainName } from "../../config"; import { RootState } from "../../store/reducers"; @@ -25,6 +25,7 @@ const Addresses = (): JSX.Element => { const starnames = ReactRedux.useSelector((state: RootState) => state.accounts); const rpcEndpointType = ReactRedux.useSelector(getRpcEndpointType); const [bwNamesWithChain, setBwNamesWithChain] = React.useState([]); + const [bwAccountsWithChain, setBwAccountsWithChain] = React.useState([]); React.useEffect(() => { let isSubscribed = true; @@ -57,6 +58,37 @@ const Addresses = (): JSX.Element => { }; }, [bwNames]); + React.useEffect(() => { + let isSubscribed = true; + async function insertChainNames(): Promise { + if (isSubscribed) { + const bwAccountsWithChain: BwAccountWithChainName[] = await Promise.all( + starnames.map(async name => { + return { + ...name, + addresses: await Promise.all( + name.addresses.map(async address => { + return { + chainId: address.chainId, + address: address.address, + chainName: await getChainName(address.chainId), + }; + }), + ), + }; + }), + ); + + setBwAccountsWithChain(bwAccountsWithChain); + } + } + insertChainNames(); + + return () => { + isSubscribed = false; + }; + }, [starnames]); + const supportedChains = React.useMemo( () => Array.from(identities.values()).map(extendedIdentity => ({ @@ -72,7 +104,7 @@ const Addresses = (): JSX.Element => { Date: Fri, 13 Mar 2020 19:38:12 +0200 Subject: [PATCH 186/204] Choose right action on account manage --- .../routes/addresses/components/StarnamesExists.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx index 999586981..4a39e482b 100644 --- a/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx +++ b/packages/bierzo-wallet/src/routes/addresses/components/StarnamesExists.tsx @@ -5,7 +5,12 @@ import React from "react"; import { history } from "../.."; import starnameLogo from "../../../assets/starname-logo.svg"; import { BwAccount } from "../../../store/accounts"; -import { NAME_REGISTER_ROUTE, STARNAME_MANAGE_ROUTE, STARNAME_REGISTER_ROUTE } from "../../paths"; +import { + NAME_MANAGE_ROUTE, + NAME_REGISTER_ROUTE, + STARNAME_MANAGE_ROUTE, + STARNAME_REGISTER_ROUTE, +} from "../../paths"; interface Props { readonly starnames: readonly BwAccount[]; @@ -67,7 +72,11 @@ function StarnamesExists({ starnames, onRegisterStarname }: Props): JSX.Element ) .map(starname => { const onManage = (): void => { - history.push(STARNAME_MANAGE_ROUTE, starname); + if (starname.name) { + history.push(NAME_MANAGE_ROUTE, starname); + } else { + history.push(STARNAME_MANAGE_ROUTE, starname); + } }; return ( From 2be9c65cdaae5bece60cf4e0af1ad670a17a7972 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 12:17:12 +0200 Subject: [PATCH 187/204] Remove not used import and fix account subtitle --- .../src/components/AccountEdit/index.tsx | 21 ++++++++++++++----- .../src/components/AccountManage/index.tsx | 9 ++++---- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx index 96d49f8fe..a05206ce4 100644 --- a/packages/bierzo-wallet/src/components/AccountEdit/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountEdit/index.tsx @@ -18,7 +18,7 @@ import { import React from "react"; import { amountToString } from "ui-logic"; -import { formatDate, formatTime } from "../../utils/date"; +import { isIovname } from "../../logic/account"; import { AddressesTooltipHeader, BwAccountWithChainName, @@ -218,10 +218,21 @@ const AccountEdit = ({ chainAddresses, account, onCancel, transactionFee, onSubm {isAccountData(account) && ( - - - Expires on {formatDate(account.expiryDate)} {formatTime(account.expiryDate)} - + + {isIovname(`${account.name}*${account.domain}`) || !account.name ? ( + + Expires on {account.expiryDate.toLocaleDateString()} + + ) : ( + + + Name assigned to you by + + + {` *${account.domain}`} + + + )} )} diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.tsx index 79f65b82a..04b2aaefb 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.tsx @@ -17,7 +17,6 @@ import React from "react"; import { BwAccount } from "../../store/accounts"; import { BwUsername } from "../../store/usernames"; -import { formatDate, formatTime } from "../../utils/date"; import AddressesTable, { ChainAddressPairWithName } from "../AddressesTable"; import copy from "../AddressesTable/assets/copy.svg"; import shield from "./assets/shield.svg"; @@ -132,9 +131,11 @@ const AccountManage: React.FunctionComponent = ({ account, menuItems, onE {isAccountData(account) && !hideExpiration && ( - - Expires on {formatDate(account.expiryDate)} {formatTime(account.expiryDate)} - + + + Expires on {account.expiryDate.toLocaleDateString()} + + )} From 6b89d89a0743d754a154d717c1d0113d7943a3ba Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 12:17:42 +0200 Subject: [PATCH 188/204] Refactor AccountEntity --- packages/bierzo-wallet/src/routes/account/index.ts | 6 ++++++ packages/bierzo-wallet/src/routes/account/manage/index.tsx | 2 +- .../bierzo-wallet/src/routes/account/register/index.tsx | 7 +------ packages/bierzo-wallet/src/routes/account/update/index.tsx | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/index.ts b/packages/bierzo-wallet/src/routes/account/index.ts index 19f560720..02e335d30 100644 --- a/packages/bierzo-wallet/src/routes/account/index.ts +++ b/packages/bierzo-wallet/src/routes/account/index.ts @@ -2,4 +2,10 @@ import AccountManage from "./manage"; import AccountRegister from "./register"; import AccountUpdate from "./update"; +export type AccountEntity = "iovname" | "starname" | "name"; + +export interface AccountProps { + entity: AccountEntity; +} + export { AccountManage, AccountRegister, AccountUpdate }; diff --git a/packages/bierzo-wallet/src/routes/account/manage/index.tsx b/packages/bierzo-wallet/src/routes/account/manage/index.tsx index 5eb97d15a..4e3f1df94 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/index.tsx @@ -1,8 +1,8 @@ import { Block } from "medulas-react-components"; import * as React from "react"; +import { AccountProps } from ".."; import PageMenu from "../../../components/PageMenu"; -import { AccountProps } from "../register"; import IovnameAccountManage from "./components/IovnameForm"; import NameAccountManage from "./components/NameForm"; import StarnameAccountManage from "./components/StarnameForm"; diff --git a/packages/bierzo-wallet/src/routes/account/register/index.tsx b/packages/bierzo-wallet/src/routes/account/register/index.tsx index 1b7f01a01..94126011a 100644 --- a/packages/bierzo-wallet/src/routes/account/register/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/register/index.tsx @@ -3,6 +3,7 @@ import { BnsConnection } from "@iov/bns"; import React from "react"; import * as ReactRedux from "react-redux"; +import { AccountProps } from ".."; import { history } from "../.."; import { generateRegisterUsernameTxWithFee } from "../../../communication/requestgenerators"; import { BwUsernameWithChainName } from "../../../components/AccountManage"; @@ -47,12 +48,6 @@ async function getPersonalizedAddressRegistrationFee( return transactionWithFee.fee; } -export type AccountEntity = "iovname" | "starname" | "name"; - -export interface AccountProps { - entity: AccountEntity; -} - const Register = ({ entity }: AccountProps): JSX.Element => { const [transactionId, setTransactionId] = React.useState(null); const [transactionFee, setTransactionFee] = React.useState(undefined); diff --git a/packages/bierzo-wallet/src/routes/account/update/index.tsx b/packages/bierzo-wallet/src/routes/account/update/index.tsx index 55bec6caf..569a361d3 100644 --- a/packages/bierzo-wallet/src/routes/account/update/index.tsx +++ b/packages/bierzo-wallet/src/routes/account/update/index.tsx @@ -3,6 +3,7 @@ import { BnsConnection } from "@iov/bns"; import React from "react"; import * as ReactRedux from "react-redux"; +import { AccountProps } from ".."; import { history } from "../.."; import { generateRegisterUsernameTxWithFee } from "../../../communication/requestgenerators"; import { ChainAddressPairWithName } from "../../../components/AddressesTable"; @@ -13,7 +14,6 @@ import { ExtendedIdentity } from "../../../store/identities"; import { RootState } from "../../../store/reducers"; import { getChainAddressPairWithNamesSorted } from "../../../utils/tokens"; import { TRANSACTIONS_ROUTE } from "../../paths"; -import { AccountProps } from "../register"; import ConfirmRegistration from "./components/ConfirmUpdate"; import IovnameAccountUpdate from "./components/IovnameForm"; import NameAccountUpdate from "./components/NameForm"; From cd4c029ac768a0881f06bebdcce81aab03228ae2 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 12:18:05 +0200 Subject: [PATCH 189/204] Change Arrow behaviour --- .../manage/components/AssociatedNamesList.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx index 77b771837..9198fa42d 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx @@ -35,13 +35,16 @@ const AssociatedNamesList: React.FunctionComponent = ({ names, onRegister const paperClasses = usePaper(); - const toggleShowAccounts = (): void => { - setShow(show => !show); + React.useEffect(() => { if (show) { setShowIcon(arrowDown); } else { setShowIcon(arrowUp); } + }, [show]); + + const toggleShowAccounts = (): void => { + setShow(show => !show); }; return ( @@ -63,13 +66,13 @@ const AssociatedNamesList: React.FunctionComponent = ({ names, onRegister - + - + Names associated with this starname - + From 99d8c5a90880ca59c740c45d5257b9bea99a251a Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 12:18:25 +0200 Subject: [PATCH 190/204] Hide expriration date --- .../src/routes/account/manage/components/NameForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx index 6d6b78c6d..8aab9689c 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx @@ -22,7 +22,7 @@ const NameAccountManage = (): JSX.Element => { history.push(NAME_EDIT_ROUTE, account); }; - return ; + return ; }; export default NameAccountManage; From 128c5cb5b83b4a4f2a5ba61d3f5c7be4ff517bb6 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 12:18:52 +0200 Subject: [PATCH 191/204] Storybook snapshots update --- .../src/__snapshots__/Storyshots.test.js.snap | 470 +++++++++++++++++- 1 file changed, 463 insertions(+), 7 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index edae5703f..60c9a51a6 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -2361,7 +2361,7 @@ exports[`Storyshots Bierzo Wallet/Addresses Main with names 1`] = ` className="MuiTypography-root makeStyles-weight makeStyles-weight MuiTypography-subtitle2 MuiTypography-colorTextPrimary" > Expires on - 3/24/2020 + 3/27/2020
Expires on - 3/24/2020 + 3/27/2020
Expires on - 3/24/2020 + 3/27/2020
Expires on - 3/24/2020 + 3/27/2020
Expires on - 3/24/2020 + 3/27/2020
Expires on - 3/24/2020 + 3/27/2020
Tick @@ -7808,6 +7808,462 @@ Array [ ] `; +exports[`Storyshots Bierzo Wallet/Update Account Update Iovname 1`] = ` + +
+
+
+
+
+ shield +
+
+
+

+ test*iov +

+
+
+ Copy +
+
+
+
+
+

+ CHOOSE LINKED ADDRESSES +

+
+
+
+
+ Info +
+
+
+
+
+
+ Optional +
+
+
+ +
+

+ + Add more +

+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +`; + +exports[`Storyshots Bierzo Wallet/Update Account Update confirmation 1`] = ` +
+
+
+
+
+ Tick +
+
+ Your account update request was successfully signed and sent to the network. +
+
+
+ Transaction ID +
+
+
+
+ 0x2be250c978013e0b3af09916c421511a07fac45bce16cdd891b7001a150cde0e +
+
+ Tick +
+
+
+
+
+
+ +
+
+
+
+`; + +exports[`Storyshots Bierzo Wallet/Update Account Update sample 1`] = ` +
+
+
+
+
+
+ shield +
+
+
+

+ test*iov +

+
+
+ Copy +
+
+
+
+
+

+ CHOOSE LINKED ADDRESSES +

+
+
+
+
+ Info +
+
+
+
+
+
+ Optional +
+
+ + +
+

+ + Add more +

+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +`; + exports[`Storyshots Medulas React Components/components Avatars 1`] = `
Date: Mon, 16 Mar 2020 18:14:29 +0200 Subject: [PATCH 192/204] Upgrade storybook --- package.json | 21 +- yarn.lock | 2272 ++++++++++++++++++++++++++++---------------------- 2 files changed, 1286 insertions(+), 1007 deletions(-) diff --git a/package.json b/package.json index b8ecf5682..77486d7bf 100644 --- a/package.json +++ b/package.json @@ -43,12 +43,13 @@ }, "devDependencies": { "@babel/core": "^7.3.4", - "@storybook/addon-actions": "^5.2.1", - "@storybook/addon-links": "^5.2.1", - "@storybook/addon-storyshots": "^5.2.1", - "@storybook/addon-viewport": "^5.2.1", - "@storybook/addons": "^5.2.1", - "@storybook/react": "^5.2.1", + "@storybook/addon-actions": "^5.3.17", + "@storybook/addon-links": "^5.3.17", + "@storybook/addon-storyshots": "^5.3.17", + "@storybook/addon-viewport": "^5.3.17", + "@storybook/addons": "^5.3.17", + "@storybook/preset-create-react-app": "^2.0.0", + "@storybook/react": "^5.3.17", "@types/chrome": "^0.0.82", "@types/classnames": "^2.2.7", "@types/jest": "24.0.14", @@ -57,11 +58,9 @@ "@types/react": "16.8.19", "@types/react-dom": "16.8.4", "@types/react-redux": "7.1.0", - "@types/react-test-renderer": "^16.8.1", - "@types/storybook__addon-actions": "^3.4.3", - "@types/storybook__addon-storyshots": "^5.1.1", - "@types/storybook__addon-viewport": "^4.1.1", - "@types/storybook__react": "^4.0.2", + "@types/react-test-renderer": "^16.9.2", + "@types/puppeteer": "^2.0.1", + "puppeteer": "^2.1.1", "eslint": "^6", "eslint-config-prettier": "^6.2.0", "eslint-plugin-prettier": "^3.0.1", diff --git a/yarn.lock b/yarn.lock index 2f7f729ca..f5d3a7e2e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,25 +16,12 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.3.tgz#198d6d3af4567be3989550d97e068de94503074f" - integrity sha512-oDpASqKFlbspQfzAE7yaeTmdljSH2ADIvBlb0RwbStltTuWa0+7CCI1fYVINNv9saHPa1W7oaKeuNuKj+RQCvA== +"@babel/code-frame@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" + integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.0" - "@babel/helpers" "^7.4.3" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - convert-source-map "^1.1.0" - debug "^4.1.0" - json5 "^2.1.0" - lodash "^4.17.11" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" + "@babel/highlight" "^7.8.3" "@babel/core@7.7.4": version "7.7.4" @@ -56,7 +43,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.3.4", "@babel/core@^7.4.5": +"@babel/core@^7.1.0", "@babel/core@^7.3.4", "@babel/core@^7.4.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.5.tgz#17b2686ef0d6bc58f963dddd68ab669755582c30" integrity sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg== @@ -76,6 +63,27 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/core@^7.7.5": + version "7.8.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.7.tgz#b69017d221ccdeb203145ae9da269d72cf102f3b" + integrity sha512-rBlqF3Yko9cynC5CCFy6+K/w2N+Sq/ff2BPy+Krp7rHlABIr5epbA7OxVeKoMHB39LZOp1UY5SuLjy6uWi35yA== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.8.7" + "@babel/helpers" "^7.8.4" + "@babel/parser" "^7.8.7" + "@babel/template" "^7.8.6" + "@babel/traverse" "^7.8.6" + "@babel/types" "^7.8.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.0" + lodash "^4.17.13" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/generator@^7.4.0", "@babel/generator@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.5.tgz#873a7f936a3c89491b43536d12245b626664e3cf" @@ -97,6 +105,16 @@ lodash "^4.17.13" source-map "^0.5.0" +"@babel/generator@^7.8.6", "@babel/generator@^7.8.7": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.8.tgz#cdcd58caab730834cee9eeadb729e833b625da3e" + integrity sha512-HKyUVu69cZoclptr8t8U5b6sx6zoWjh8jiUhnuj3MpZuKT2dJ8zPTuiy31luq32swhI0SpwItCIlU8XW7BZeJg== + dependencies: + "@babel/types" "^7.8.7" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" @@ -111,6 +129,13 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-annotate-as-pure@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz#60bc0bc657f63a0924ff9a4b4a0b24a13cf4deee" + integrity sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw== + dependencies: + "@babel/types" "^7.8.3" + "@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" @@ -161,18 +186,6 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" -"@babel/helper-create-class-features-plugin@^7.4.0", "@babel/helper-create-class-features-plugin@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.5.tgz#401f302c8ddbc0edd36f7c6b2887d8fa1122e5a4" - integrity sha512-ZsxkyYiRA7Bg+ZTRpPvB6AbOFKTFFK4LrvTet8lInm0V468MWCaSYJE+I7v2z2r8KNLtYiV+K5kTCnR7dvyZjg== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.5.5" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.5.5" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/helper-create-class-features-plugin@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.4.tgz#fce60939fd50618610942320a8d951b3b639da2d" @@ -185,6 +198,18 @@ "@babel/helper-replace-supers" "^7.7.4" "@babel/helper-split-export-declaration" "^7.7.4" +"@babel/helper-create-class-features-plugin@^7.8.3": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.6.tgz#243a5b46e2f8f0f674dc1387631eb6b28b851de0" + integrity sha512-klTBDdsr+VFFqaDHm5rR69OpEQtO2Qv8ECxHS1mNhJJvaHArR6a1xTf5K/eZW7eZpJbhCx3NW1Yt/sKsLXLblg== + dependencies: + "@babel/helper-function-name" "^7.8.3" + "@babel/helper-member-expression-to-functions" "^7.8.3" + "@babel/helper-optimise-call-expression" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-replace-supers" "^7.8.6" + "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/helper-create-regexp-features-plugin@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz#6d5762359fd34f4da1500e4cff9955b5299aaf59" @@ -193,7 +218,7 @@ "@babel/helper-regex" "^7.4.4" regexpu-core "^4.6.0" -"@babel/helper-define-map@^7.4.0", "@babel/helper-define-map@^7.5.5": +"@babel/helper-define-map@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" integrity sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg== @@ -245,6 +270,15 @@ "@babel/template" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helper-function-name@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz#eeeb665a01b1f11068e9fb86ad56a1cb1a824cca" + integrity sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA== + dependencies: + "@babel/helper-get-function-arity" "^7.8.3" + "@babel/template" "^7.8.3" + "@babel/types" "^7.8.3" + "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" @@ -259,6 +293,13 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-get-function-arity@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" + integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== + dependencies: + "@babel/types" "^7.8.3" + "@babel/helper-hoist-variables@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" @@ -287,6 +328,13 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-member-expression-to-functions@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz#659b710498ea6c1d9907e0c73f206eee7dadc24c" + integrity sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA== + dependencies: + "@babel/types" "^7.8.3" + "@babel/helper-module-imports@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" @@ -339,11 +387,23 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-optimise-call-expression@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz#7ed071813d09c75298ef4f208956006b6111ecb9" + integrity sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ== + dependencies: + "@babel/types" "^7.8.3" + "@babel/helper-plugin-utils@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== +"@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670" + integrity sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ== + "@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.5.5.tgz#0aa6824f7100a2e0e89c1527c23936c152cab351" @@ -373,7 +433,7 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" -"@babel/helper-replace-supers@^7.4.0", "@babel/helper-replace-supers@^7.5.5": +"@babel/helper-replace-supers@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz#f84ce43df031222d2bad068d2626cb5799c34bc2" integrity sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg== @@ -393,6 +453,16 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helper-replace-supers@^7.8.6": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz#5ada744fd5ad73203bf1d67459a27dcba67effc8" + integrity sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.8.3" + "@babel/helper-optimise-call-expression" "^7.8.3" + "@babel/traverse" "^7.8.6" + "@babel/types" "^7.8.6" + "@babel/helper-simple-access@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" @@ -409,7 +479,7 @@ "@babel/template" "^7.7.4" "@babel/types" "^7.7.4" -"@babel/helper-split-export-declaration@^7.4.0", "@babel/helper-split-export-declaration@^7.4.4": +"@babel/helper-split-export-declaration@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== @@ -423,6 +493,13 @@ dependencies: "@babel/types" "^7.7.4" +"@babel/helper-split-export-declaration@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" + integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== + dependencies: + "@babel/types" "^7.8.3" + "@babel/helper-wrap-function@^7.1.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" @@ -443,7 +520,7 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" -"@babel/helpers@^7.4.3", "@babel/helpers@^7.5.5": +"@babel/helpers@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.5.tgz#63908d2a73942229d1e6685bc2a0e730dde3b75e" integrity sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g== @@ -461,6 +538,15 @@ "@babel/traverse" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/helpers@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73" + integrity sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w== + dependencies: + "@babel/template" "^7.8.3" + "@babel/traverse" "^7.8.4" + "@babel/types" "^7.8.3" + "@babel/highlight@^7.0.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" @@ -470,6 +556,15 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/highlight@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797" + integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + "@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.5.tgz#02f077ac8817d3df4a832ef59de67565e71cca4b" @@ -480,6 +575,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.5.tgz#cbf45321619ac12d83363fcf9c94bb67fa646d71" integrity sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig== +"@babel/parser@^7.8.6", "@babel/parser@^7.8.7": + version "7.8.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.8.tgz#4c3b7ce36db37e0629be1f0d50a571d2f86f6cd4" + integrity sha512-mO5GWzBPsPf6865iIbzNE0AvkKF3NE+2S3eRUpE+FE07BOAkXh6G+GW/Pj01hhXjve1WScbaIO4UlY1JKeqCcA== + "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" @@ -498,14 +598,6 @@ "@babel/helper-remap-async-to-generator" "^7.7.4" "@babel/plugin-syntax-async-generators" "^7.7.4" -"@babel/plugin-proposal-class-properties@7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.0.tgz#d70db61a2f1fd79de927eea91f6411c964e084b8" - integrity sha512-t2ECPNOXsIeK1JxJNKmgbzQtoG27KIlVE61vTqX0DKR9E9sZlVVxWUtEW9D5FlZ8b8j7SBNCHY47GgPKCKlpPg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.4.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-class-properties@7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.4.tgz#2f964f0cb18b948450362742e33e15211e77c2ba" @@ -514,22 +606,13 @@ "@babel/helper-create-class-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-proposal-class-properties@^7.3.3": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.5.tgz#a974cfae1e37c3110e71f3c6a2e48b8e71958cd4" - integrity sha512-AF79FsnWFxjlaosgdi421vmYG6/jg79bVD0dpD44QdgobzHKuLZ6S3vl8la9qIeSwGi8i1fS0O1mfuDAAdo1/A== +"@babel/plugin-proposal-class-properties@^7.7.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz#5e06654af5cd04b608915aada9b2a6788004464e" + integrity sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.5.5" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-proposal-decorators@7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.0.tgz#8e1bfd83efa54a5f662033afcc2b8e701f4bb3a9" - integrity sha512-d08TLmXeK/XbgCo7ZeZ+JaeZDtDai/2ctapTRsWWkkmy7G/cqz8DQN/HlWG7RR4YmfXxmExsbU3SuCjlM7AtUg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.4.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-decorators" "^7.2.0" + "@babel/helper-create-class-features-plugin" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-proposal-decorators@7.7.4": version "7.7.4" @@ -588,14 +671,6 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-numeric-separator" "^7.7.4" -"@babel/plugin-proposal-object-rest-spread@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.3.tgz#be27cd416eceeba84141305b93c282f5de23bbb4" - integrity sha512-xC//6DNSSHVjq8O2ge0dyYlhshsH4T7XdCVoxbi5HzLYWfsC5ooFlJjrXk8RcAT+hjHAK9UjBXdylzSoDK3t4g== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread@7.7.4", "@babel/plugin-proposal-object-rest-spread@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz#cc57849894a5c774214178c8ab64f6334ec8af71" @@ -604,7 +679,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.7.4" -"@babel/plugin-proposal-object-rest-spread@^7.3.2", "@babel/plugin-proposal-object-rest-spread@^7.4.3", "@babel/plugin-proposal-object-rest-spread@^7.5.5": +"@babel/plugin-proposal-object-rest-spread@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz#61939744f71ba76a3ae46b5eea18a54c16d22e58" integrity sha512-F2DxJJSQ7f64FyTVl5cw/9MWn6naXGdk3Q3UhDbFEEHv+EilCPoeRD3Zh/Utx1CJz4uyKlQ4uH+bJPbEhMV7Zw== @@ -612,6 +687,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" +"@babel/plugin-proposal-object-rest-spread@^7.6.2": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.8.3.tgz#eb5ae366118ddca67bed583b53d7554cad9951bb" + integrity sha512-8qvuPwU/xxUCt78HocNlv0mXXo0wdh9VT1R04WU8HGOfaOob26pF+9P5/lYjN/q7DHOX1bvX60hnhOvuQUJdbA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-object-rest-spread" "^7.8.0" + "@babel/plugin-proposal-optional-catch-binding@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" @@ -636,7 +719,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-optional-chaining" "^7.7.4" -"@babel/plugin-proposal-unicode-property-regex@^7.4.0", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": +"@babel/plugin-proposal-unicode-property-regex@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" integrity sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA== @@ -667,13 +750,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-decorators@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz#c50b1b957dcc69e4b1127b65e1c33eef61570c1b" - integrity sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-decorators@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.7.4.tgz#3c91cfee2a111663ff3ac21b851140f5a52a4e0b" @@ -681,13 +757,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-dynamic-import@7.2.0", "@babel/plugin-syntax-dynamic-import@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" - integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-dynamic-import@7.7.4", "@babel/plugin-syntax-dynamic-import@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz#29ca3b4415abfe4a5ec381e903862ad1a54c3aec" @@ -695,6 +764,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-dynamic-import@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" + integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-flow@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" @@ -765,6 +841,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-object-rest-spread@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + "@babel/plugin-syntax-optional-catch-binding@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" @@ -793,13 +876,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-typescript@^7.2.0": - version "7.3.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991" - integrity sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-typescript@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.7.4.tgz#5d037ffa10f3b25a16f32570ebbe7a8c2efa304b" @@ -821,7 +897,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-async-to-generator@^7.4.0", "@babel/plugin-transform-async-to-generator@^7.5.0": +"@babel/plugin-transform-async-to-generator@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz#89a3848a0166623b5bc481164b5936ab947e887e" integrity sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg== @@ -853,7 +929,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.4.0", "@babel/plugin-transform-block-scoping@^7.5.5": +"@babel/plugin-transform-block-scoping@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.5.5.tgz#a35f395e5402822f10d2119f6f8e045e3639a2ce" integrity sha512-82A3CLRRdYubkG85lKwhZB0WZoHxLGsJdux/cOVaJCJpvYFl1LVzAIFyRsa7CvXqW8rBM4Zf3Bfn8PHt5DP0Sg== @@ -869,21 +945,7 @@ "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.13" -"@babel/plugin-transform-classes@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.3.tgz#adc7a1137ab4287a555d429cc56ecde8f40c062c" - integrity sha512-PUaIKyFUDtG6jF5DUJOfkBdwAS/kFFV3XFk7Nn0a6vR7ZT8jYw5cGtIlat77wcnd0C6ViGqo/wyNf4ZHytF/nQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.4.0" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.0" - "@babel/helper-split-export-declaration" "^7.4.0" - globals "^11.1.0" - -"@babel/plugin-transform-classes@^7.4.3", "@babel/plugin-transform-classes@^7.5.5": +"@babel/plugin-transform-classes@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz#d094299d9bd680a14a2a0edae38305ad60fb4de9" integrity sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg== @@ -925,13 +987,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-destructuring@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.3.tgz#1a95f5ca2bf2f91ef0648d5de38a8d472da4350f" - integrity sha512-rVTLLZpydDFDyN4qnXdzwoVpk1oaXHIvPEOkOLyr88o7oHxVc/LyrnDx+amuBWGOwUb7D1s/uLsKBNTx08htZg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-destructuring@7.7.4", "@babel/plugin-transform-destructuring@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.7.4.tgz#2b713729e5054a1135097b6a67da1b6fe8789267" @@ -939,14 +994,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-destructuring@^7.4.3", "@babel/plugin-transform-destructuring@^7.5.0": +"@babel/plugin-transform-destructuring@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.5.0.tgz#f6c09fdfe3f94516ff074fe877db7bc9ef05855a" integrity sha512-YbYgbd3TryYYLGyC7ZR+Tq8H/+bCmwoaxHfJHupom5ECstzbRLTch6gOQbhEY9Z4hiCNHEURgq06ykFv9JZ/QQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-dotall-regex@^7.4.3", "@babel/plugin-transform-dotall-regex@^7.4.4": +"@babel/plugin-transform-dotall-regex@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz#361a148bc951444312c69446d76ed1ea8e4450c3" integrity sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg== @@ -963,7 +1018,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-duplicate-keys@^7.2.0", "@babel/plugin-transform-duplicate-keys@^7.5.0": +"@babel/plugin-transform-duplicate-keys@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" integrity sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ== @@ -993,14 +1048,6 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-flow-strip-types@7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.4.0.tgz#f3c59eecff68c99b9c96eaafe4fe9d1fa8947138" - integrity sha512-C4ZVNejHnfB22vI2TYN4RUp2oCmq6cSEAg4RygSvYZUECRqUu9O4PMEMNJ4wsemaRGg27BbgYctG4BZh+AgIHw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-flow" "^7.2.0" - "@babel/plugin-transform-flow-strip-types@7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.7.4.tgz#cc73f85944782df1d77d80977bc097920a8bf31a" @@ -1017,7 +1064,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-flow" "^7.2.0" -"@babel/plugin-transform-for-of@^7.4.3", "@babel/plugin-transform-for-of@^7.4.4": +"@babel/plugin-transform-for-of@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== @@ -1031,7 +1078,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-function-name@^7.4.3", "@babel/plugin-transform-function-name@^7.4.4": +"@babel/plugin-transform-function-name@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" integrity sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA== @@ -1075,7 +1122,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-amd@^7.2.0", "@babel/plugin-transform-modules-amd@^7.5.0": +"@babel/plugin-transform-modules-amd@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" integrity sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg== @@ -1093,7 +1140,7 @@ "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-commonjs@^7.4.3", "@babel/plugin-transform-modules-commonjs@^7.5.0": +"@babel/plugin-transform-modules-commonjs@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.5.0.tgz#425127e6045231360858eeaa47a71d75eded7a74" integrity sha512-xmHq0B+ytyrWJvQTc5OWAC4ii6Dhr0s22STOoydokG51JjWhyYo5mRPXoi+ZmtHQhZZwuXNN+GG5jy5UZZJxIQ== @@ -1113,7 +1160,7 @@ "@babel/helper-simple-access" "^7.7.4" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.4.0", "@babel/plugin-transform-modules-systemjs@^7.5.0": +"@babel/plugin-transform-modules-systemjs@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz#e75266a13ef94202db2a0620977756f51d52d249" integrity sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg== @@ -1147,7 +1194,7 @@ "@babel/helper-module-transforms" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.4.2", "@babel/plugin-transform-named-capturing-groups-regex@^7.4.5": +"@babel/plugin-transform-named-capturing-groups-regex@^7.4.5": version "7.4.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.5.tgz#9d269fd28a370258199b4294736813a60bbdd106" integrity sha512-z7+2IsWafTBbjNsOxU/Iv5CvTJlr5w4+HGu1HovKYTtgJ362f7kBcQglkfmlspKKZ3bgrbSGvLfNx++ZJgCWsg== @@ -1161,7 +1208,7 @@ dependencies: "@babel/helper-create-regexp-features-plugin" "^7.7.4" -"@babel/plugin-transform-new-target@^7.4.0", "@babel/plugin-transform-new-target@^7.4.4": +"@babel/plugin-transform-new-target@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== @@ -1175,7 +1222,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-object-super@^7.2.0", "@babel/plugin-transform-object-super@^7.5.5": +"@babel/plugin-transform-object-super@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" integrity sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ== @@ -1191,7 +1238,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-replace-supers" "^7.7.4" -"@babel/plugin-transform-parameters@^7.4.3", "@babel/plugin-transform-parameters@^7.4.4": +"@babel/plugin-transform-parameters@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== @@ -1223,14 +1270,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-react-constant-elements@7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.2.0.tgz#ed602dc2d8bff2f0cb1a5ce29263dbdec40779f7" - integrity sha512-YYQFg6giRFMsZPKUM9v+VcHOdfSQdz9jHCx3akAi3UYgyjndmdYGSXylQ/V+HswQt4fL8IklchD9HTsaOCrWQQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-react-constant-elements@^7.0.0", "@babel/plugin-transform-react-constant-elements@^7.2.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.5.0.tgz#4d6ae4033bc38f8a65dfca2b6235c44522a422fc" @@ -1239,12 +1278,13 @@ "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-react-display-name@7.2.0", "@babel/plugin-transform-react-display-name@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz#ebfaed87834ce8dc4279609a4f0c324c156e3eb0" - integrity sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A== +"@babel/plugin-transform-react-constant-elements@^7.6.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.8.3.tgz#784c25294bddaad2323eb4ff0c9f4a3f6c87d6bc" + integrity sha512-glrzN2U+egwRfkNFtL34xIBYTxbbUF2qJTP8HD3qETBBqzAWSeNB821X0GjU06+dNpq/UyCIjI72FmGE5NNkQQ== dependencies: - "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.8.3" + "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-transform-react-display-name@7.7.4", "@babel/plugin-transform-react-display-name@^7.7.4": version "7.7.4" @@ -1253,6 +1293,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-react-display-name@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz#ebfaed87834ce8dc4279609a4f0c324c156e3eb0" + integrity sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-react-jsx-self@^7.0.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz#461e21ad9478f1031dd5e276108d027f1b5240ba" @@ -1303,7 +1350,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-jsx" "^7.7.4" -"@babel/plugin-transform-regenerator@^7.4.3", "@babel/plugin-transform-regenerator@^7.4.5": +"@babel/plugin-transform-regenerator@^7.4.5": version "7.4.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" integrity sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA== @@ -1331,16 +1378,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-runtime@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.3.tgz#4d6691690ecdc9f5cb8c3ab170a1576c1f556371" - integrity sha512-7Q61bU+uEI7bCUFReT1NKn7/X6sDQsZ7wL1sJ9IYMAO7cI+eg6x9re1cEw2fCRMbbTVyoeUKWSV1M6azEfKCfg== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - resolve "^1.8.1" - semver "^5.5.1" - "@babel/plugin-transform-runtime@7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.7.4.tgz#51fe458c1c1fa98a8b07934f4ed38b6cd62177a6" @@ -1395,7 +1432,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" -"@babel/plugin-transform-template-literals@^7.2.0", "@babel/plugin-transform-template-literals@^7.4.4": +"@babel/plugin-transform-template-literals@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== @@ -1425,15 +1462,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-typescript@^7.3.2": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.5.5.tgz#6d862766f09b2da1cb1f7d505fe2aedab6b7d4b8" - integrity sha512-pehKf4m640myZu5B2ZviLaiBlxMCjSZ1qTEO459AXKX5GnPueyulJeCqZFs1nz/Ya2dDzXQ1NxZ/kKNWyD4h6w== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.5.5" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-typescript" "^7.2.0" - "@babel/plugin-transform-typescript@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.4.tgz#2974fd05f4e85c695acaf497f432342de9fc0636" @@ -1443,7 +1471,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-typescript" "^7.7.4" -"@babel/plugin-transform-unicode-regex@^7.4.3", "@babel/plugin-transform-unicode-regex@^7.4.4": +"@babel/plugin-transform-unicode-regex@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" integrity sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA== @@ -1468,60 +1496,6 @@ core-js "^2.6.5" regenerator-runtime "^0.13.2" -"@babel/preset-env@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.3.tgz#e71e16e123dc0fbf65a52cbcbcefd072fbd02880" - integrity sha512-FYbZdV12yHdJU5Z70cEg0f6lvtpZ8jFSDakTm7WXeJbLXh4R0ztGEu/SW7G1nJ2ZvKwDhz8YrbA84eYyprmGqw== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.2.0" - "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.4.3" - "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" - "@babel/plugin-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.4.0" - "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.4.0" - "@babel/plugin-transform-classes" "^7.4.3" - "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.4.3" - "@babel/plugin-transform-dotall-regex" "^7.4.3" - "@babel/plugin-transform-duplicate-keys" "^7.2.0" - "@babel/plugin-transform-exponentiation-operator" "^7.2.0" - "@babel/plugin-transform-for-of" "^7.4.3" - "@babel/plugin-transform-function-name" "^7.4.3" - "@babel/plugin-transform-literals" "^7.2.0" - "@babel/plugin-transform-member-expression-literals" "^7.2.0" - "@babel/plugin-transform-modules-amd" "^7.2.0" - "@babel/plugin-transform-modules-commonjs" "^7.4.3" - "@babel/plugin-transform-modules-systemjs" "^7.4.0" - "@babel/plugin-transform-modules-umd" "^7.2.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.2" - "@babel/plugin-transform-new-target" "^7.4.0" - "@babel/plugin-transform-object-super" "^7.2.0" - "@babel/plugin-transform-parameters" "^7.4.3" - "@babel/plugin-transform-property-literals" "^7.2.0" - "@babel/plugin-transform-regenerator" "^7.4.3" - "@babel/plugin-transform-reserved-words" "^7.2.0" - "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.2.0" - "@babel/plugin-transform-sticky-regex" "^7.2.0" - "@babel/plugin-transform-template-literals" "^7.2.0" - "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.4.3" - "@babel/types" "^7.4.0" - browserslist "^4.5.2" - core-js-compat "^3.0.0" - invariant "^2.2.2" - js-levenshtein "^1.1.3" - semver "^5.5.0" - "@babel/preset-env@7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.7.4.tgz#ccaf309ae8d1ee2409c85a4e2b5e280ceee830f8" @@ -1643,17 +1617,6 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-flow-strip-types" "^7.0.0" -"@babel/preset-react@7.0.0", "@babel/preset-react@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.0.0.tgz#e86b4b3d99433c7b3e9e91747e2653958bc6b3c0" - integrity sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-react-display-name" "^7.0.0" - "@babel/plugin-transform-react-jsx" "^7.0.0" - "@babel/plugin-transform-react-jsx-self" "^7.0.0" - "@babel/plugin-transform-react-jsx-source" "^7.0.0" - "@babel/preset-react@7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.7.4.tgz#3fe2ea698d8fb536d8e7881a592c3c1ee8bf5707" @@ -1665,13 +1628,16 @@ "@babel/plugin-transform-react-jsx-self" "^7.7.4" "@babel/plugin-transform-react-jsx-source" "^7.7.4" -"@babel/preset-typescript@7.3.3": - version "7.3.3" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.3.3.tgz#88669911053fa16b2b276ea2ede2ca603b3f307a" - integrity sha512-mzMVuIP4lqtn4du2ynEfdO0+RYcslwrZiJHXu4MGaC1ctJiW2fyaeDrtjJGs7R/KebZ1sgowcIoWf4uRpEfKEg== +"@babel/preset-react@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.0.0.tgz#e86b4b3d99433c7b3e9e91747e2653958bc6b3c0" + integrity sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-typescript" "^7.3.2" + "@babel/plugin-transform-react-display-name" "^7.0.0" + "@babel/plugin-transform-react-jsx" "^7.0.0" + "@babel/plugin-transform-react-jsx-self" "^7.0.0" + "@babel/plugin-transform-react-jsx-source" "^7.0.0" "@babel/preset-typescript@7.7.4": version "7.7.4" @@ -1696,13 +1662,6 @@ dependencies: regenerator-runtime "^0.12.0" -"@babel/runtime@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.3.tgz#79888e452034223ad9609187a0ad1fe0d2ad4bdc" - integrity sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA== - dependencies: - regenerator-runtime "^0.13.2" - "@babel/runtime@7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.4.tgz#b23a856751e4bf099262f867767889c0e3fe175b" @@ -1717,7 +1676,7 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.3", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" integrity sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ== @@ -1738,6 +1697,13 @@ dependencies: regenerator-runtime "^0.13.2" +"@babel/runtime@^7.7.6": + version "7.8.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.7.tgz#8fefce9802db54881ba59f90bb28719b4996324d" + integrity sha512-+AATMUFppJDw6aiR5NVPHqIQBlV/Pj8wY/EZH+lmvRdUo9xBaz/rF3alAwFJQavvKfeOlPE7oaaDHVbcySbCsg== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" @@ -1756,6 +1722,15 @@ "@babel/parser" "^7.7.4" "@babel/types" "^7.7.4" +"@babel/template@^7.8.3", "@babel/template@^7.8.6": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" + integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/parser" "^7.8.6" + "@babel/types" "^7.8.6" + "@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.5.tgz#f664f8f368ed32988cd648da9f72d5ca70f165bb" @@ -1786,6 +1761,21 @@ globals "^11.1.0" lodash "^4.17.13" +"@babel/traverse@^7.8.4", "@babel/traverse@^7.8.6": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff" + integrity sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.8.6" + "@babel/helper-function-name" "^7.8.3" + "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/parser" "^7.8.6" + "@babel/types" "^7.8.6" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + "@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.5.tgz#97b9f728e182785909aa4ab56264f090a028d18a" @@ -1804,6 +1794,15 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.8.7": + version "7.8.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d" + integrity sha512-k2TreEHxFA4CjGkL+GYjRyx35W0Mr7DP5+9q6WMkyKXB+904bYmG40syjMFV0oLlhhFCwWl0vA0DyzTDkwAiJw== + dependencies: + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + "@cliqz-oss/firefox-client@0.3.1": version "0.3.1" resolved "https://registry.yarnpkg.com/@cliqz-oss/firefox-client/-/firefox-client-0.3.1.tgz#86479239f060835608b06584afe5e0a1dd91613c" @@ -1850,155 +1849,112 @@ dependencies: "@date-io/core" "^1.3.13" -"@emotion/cache@^10.0.15": - version "10.0.15" - resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-10.0.15.tgz#b81767b48015aae2689c60373992145c67b8de02" - integrity sha512-8VthgeKhlGeTXSW1JN7I14AnAaiFPbOrqNqg3dPoGCZ3bnMjkrmRU0zrx0BtBw9esBaPaQgDB9y0tVgAGT2Mrg== - dependencies: - "@emotion/sheet" "0.9.3" - "@emotion/stylis" "0.8.4" - "@emotion/utils" "0.11.2" - "@emotion/weak-memoize" "0.2.3" - -"@emotion/cache@^10.0.17", "@emotion/cache@^10.0.9": - version "10.0.19" - resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-10.0.19.tgz#d258d94d9c707dcadaf1558def968b86bb87ad71" - integrity sha512-BoiLlk4vEsGBg2dAqGSJu0vJl/PgVtCYLBFJaEO8RmQzPugXewQCXZJNXTDFaRlfCs0W+quesayav4fvaif5WQ== +"@emotion/cache@^10.0.27": + version "10.0.29" + resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-10.0.29.tgz#87e7e64f412c060102d589fe7c6dc042e6f9d1e0" + integrity sha512-fU2VtSVlHiF27empSbxi1O2JFdNWZO+2NFHfwO0pxgTep6Xa3uGb+3pVKfLww2l/IBGLNEZl5Xf/++A4wAYDYQ== dependencies: - "@emotion/sheet" "0.9.3" - "@emotion/stylis" "0.8.4" - "@emotion/utils" "0.11.2" - "@emotion/weak-memoize" "0.2.4" + "@emotion/sheet" "0.9.4" + "@emotion/stylis" "0.8.5" + "@emotion/utils" "0.11.3" + "@emotion/weak-memoize" "0.2.5" -"@emotion/core@^10.0.14": - version "10.0.17" - resolved "https://registry.yarnpkg.com/@emotion/core/-/core-10.0.17.tgz#3367376709721f4ee2068cff54ba581d362789d8" - integrity sha512-gykyjjr0sxzVuZBVTVK4dUmYsorc2qLhdYgSiOVK+m7WXgcYTKZevGWZ7TLAgTZvMelCTvhNq8xnf8FR1IdTbg== +"@emotion/core@^10.0.20": + version "10.0.28" + resolved "https://registry.yarnpkg.com/@emotion/core/-/core-10.0.28.tgz#bb65af7262a234593a9e952c041d0f1c9b9bef3d" + integrity sha512-pH8UueKYO5jgg0Iq+AmCLxBsvuGtvlmiDCOuv8fGNYn3cowFpLN98L8zO56U0H1PjDIyAlXymgL3Wu7u7v6hbA== dependencies: "@babel/runtime" "^7.5.5" - "@emotion/cache" "^10.0.17" - "@emotion/css" "^10.0.14" - "@emotion/serialize" "^0.11.10" - "@emotion/sheet" "0.9.3" - "@emotion/utils" "0.11.2" - -"@emotion/core@^10.0.9": - version "10.0.15" - resolved "https://registry.yarnpkg.com/@emotion/core/-/core-10.0.15.tgz#b8489d85d64b45bd03abdb8a3d9639ba8a0328d0" - integrity sha512-VHwwl3k/ddMfQOHYgOJryXOs2rGJ5AfKLQGm5AVolNonnr6tkmDI4nzIMNaPpveoXVs7sP0OrF24UunIPxveQw== - dependencies: - "@babel/runtime" "^7.4.3" - "@emotion/cache" "^10.0.15" - "@emotion/css" "^10.0.14" - "@emotion/serialize" "^0.11.9" - "@emotion/sheet" "0.9.3" - "@emotion/utils" "0.11.2" - -"@emotion/css@^10.0.14", "@emotion/css@^10.0.9": - version "10.0.14" - resolved "https://registry.yarnpkg.com/@emotion/css/-/css-10.0.14.tgz#95dacabdd0e22845d1a1b0b5968d9afa34011139" - integrity sha512-MozgPkBEWvorcdpqHZE5x1D/PLEHUitALQCQYt2wayf4UNhpgQs2tN0UwHYS4FMy5ROBH+0ALyCFVYJ/ywmwlg== - dependencies: - "@emotion/serialize" "^0.11.8" - "@emotion/utils" "0.11.2" - babel-plugin-emotion "^10.0.14" - -"@emotion/hash@0.7.2", "@emotion/hash@^0.7.1": + "@emotion/cache" "^10.0.27" + "@emotion/css" "^10.0.27" + "@emotion/serialize" "^0.11.15" + "@emotion/sheet" "0.9.4" + "@emotion/utils" "0.11.3" + +"@emotion/css@^10.0.27": + version "10.0.27" + resolved "https://registry.yarnpkg.com/@emotion/css/-/css-10.0.27.tgz#3a7458198fbbebb53b01b2b87f64e5e21241e14c" + integrity sha512-6wZjsvYeBhyZQYNrGoR5yPMYbMBNEnanDrqmsqS1mzDm1cOTu12shvl2j4QHNS36UaTE0USIJawCH9C8oW34Zw== + dependencies: + "@emotion/serialize" "^0.11.15" + "@emotion/utils" "0.11.3" + babel-plugin-emotion "^10.0.27" + +"@emotion/hash@0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413" + integrity sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow== + +"@emotion/hash@^0.7.1": version "0.7.2" resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.7.2.tgz#53211e564604beb9befa7a4400ebf8147473eeef" integrity sha512-RMtr1i6E8MXaBWwhXL3yeOU8JXRnz8GNxHvaUfVvwxokvayUY0zoBeWbKw1S9XkufmGEEdQd228pSZXFkAln8Q== -"@emotion/hash@0.7.3": - version "0.7.3" - resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.7.3.tgz#a166882c81c0c6040975dd30df24fae8549bd96f" - integrity sha512-14ZVlsB9akwvydAdaEnVnvqu6J2P6ySv39hYyl/aoB6w/V+bXX0tay8cF6paqbgZsN2n5Xh15uF4pE+GvE+itw== - -"@emotion/is-prop-valid@0.8.3": - version "0.8.3" - resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.8.3.tgz#cbe62ddbea08aa022cdf72da3971570a33190d29" - integrity sha512-We7VBiltAJ70KQA0dWkdPMXnYoizlxOXpvtjmu5/MBnExd+u0PGgV27WCYanmLAbCwAU30Le/xA0CQs/F/Otig== +"@emotion/is-prop-valid@0.8.8": + version "0.8.8" + resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz#db28b1c4368a259b60a97311d6a952d4fd01ac1a" + integrity sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA== dependencies: - "@emotion/memoize" "0.7.3" - -"@emotion/memoize@0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.2.tgz#7f4c71b7654068dfcccad29553520f984cc66b30" - integrity sha512-hnHhwQzvPCW1QjBWFyBtsETdllOM92BfrKWbUTmh9aeOlcVOiXvlPsK4104xH8NsaKfg86PTFsWkueQeUfMA/w== - -"@emotion/memoize@0.7.3": - version "0.7.3" - resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.3.tgz#5b6b1c11d6a6dddf1f2fc996f74cf3b219644d78" - integrity sha512-2Md9mH6mvo+ygq1trTeVp2uzAKwE2P7In0cRpD/M9Q70aH8L+rxMLbb3JCN2JoSWsV2O+DdFjfbbXoMoLBczow== - -"@emotion/serialize@^0.11.10", "@emotion/serialize@^0.11.11": - version "0.11.11" - resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-0.11.11.tgz#c92a5e5b358070a7242d10508143306524e842a4" - integrity sha512-YG8wdCqoWtuoMxhHZCTA+egL0RSGdHEc+YCsmiSBPBEDNuVeMWtjEWtGrhUterSChxzwnWBXvzSxIFQI/3sHLw== - dependencies: - "@emotion/hash" "0.7.3" - "@emotion/memoize" "0.7.3" - "@emotion/unitless" "0.7.4" - "@emotion/utils" "0.11.2" - csstype "^2.5.7" + "@emotion/memoize" "0.7.4" -"@emotion/serialize@^0.11.8", "@emotion/serialize@^0.11.9": - version "0.11.9" - resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-0.11.9.tgz#123e0f51d2dee9693fae1057bd7fc27b021d6868" - integrity sha512-/Cn4V81z3ZyFiDQRw8nhGFaHkxHtmCSSBUit4vgTuLA1BqxfJUYiqSq97tq/vV8z9LfIoqs6a9v6QrUFWZpK7A== - dependencies: - "@emotion/hash" "0.7.2" - "@emotion/memoize" "0.7.2" - "@emotion/unitless" "0.7.4" - "@emotion/utils" "0.11.2" +"@emotion/memoize@0.7.4": + version "0.7.4" + resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.4.tgz#19bf0f5af19149111c40d98bb0cf82119f5d9eeb" + integrity sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw== + +"@emotion/serialize@^0.11.15", "@emotion/serialize@^0.11.16": + version "0.11.16" + resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-0.11.16.tgz#dee05f9e96ad2fb25a5206b6d759b2d1ed3379ad" + integrity sha512-G3J4o8by0VRrO+PFeSc3js2myYNOXVJ3Ya+RGVxnshRYgsvErfAOglKAiy1Eo1vhzxqtUvjCyS5gtewzkmvSSg== + dependencies: + "@emotion/hash" "0.8.0" + "@emotion/memoize" "0.7.4" + "@emotion/unitless" "0.7.5" + "@emotion/utils" "0.11.3" csstype "^2.5.7" -"@emotion/sheet@0.9.3": - version "0.9.3" - resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-0.9.3.tgz#689f135ecf87d3c650ed0c4f5ddcbe579883564a" - integrity sha512-c3Q6V7Df7jfwSq5AzQWbXHa5soeE4F5cbqi40xn0CzXxWW9/6Mxq48WJEtqfWzbZtW9odZdnRAkwCQwN12ob4A== +"@emotion/sheet@0.9.4": + version "0.9.4" + resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-0.9.4.tgz#894374bea39ec30f489bbfc3438192b9774d32e5" + integrity sha512-zM9PFmgVSqBw4zL101Q0HrBVTGmpAxFZH/pYx/cjJT5advXguvcgjHFTCaIO3enL/xr89vK2bh0Mfyj9aa0ANA== -"@emotion/styled-base@^10.0.17": - version "10.0.19" - resolved "https://registry.yarnpkg.com/@emotion/styled-base/-/styled-base-10.0.19.tgz#53655274797194d86453354fdb2c947b46032db6" - integrity sha512-Sz6GBHTbOZoeZQKvkE9gQPzaJ6/qtoQ/OPvyG2Z/6NILlYk60Es1cEcTgTkm26H8y7A0GSgp4UmXl+srvsnFPg== +"@emotion/styled-base@^10.0.27": + version "10.0.31" + resolved "https://registry.yarnpkg.com/@emotion/styled-base/-/styled-base-10.0.31.tgz#940957ee0aa15c6974adc7d494ff19765a2f742a" + integrity sha512-wTOE1NcXmqMWlyrtwdkqg87Mu6Rj1MaukEoEmEkHirO5IoHDJ8LgCQL4MjJODgxWxXibGR3opGp1p7YvkNEdXQ== dependencies: "@babel/runtime" "^7.5.5" - "@emotion/is-prop-valid" "0.8.3" - "@emotion/serialize" "^0.11.11" - "@emotion/utils" "0.11.2" + "@emotion/is-prop-valid" "0.8.8" + "@emotion/serialize" "^0.11.15" + "@emotion/utils" "0.11.3" -"@emotion/styled@^10.0.14": - version "10.0.17" - resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-10.0.17.tgz#0cd38b8b36259541f2c6717fc22607a120623654" - integrity sha512-zHMgWjHDMNjD+ux64POtDnjLAObniu3znxFBLSdV/RiEhSLjHIowfvSbbd/C33/3uwtI6Uzs2KXnRZtka/PpAQ== +"@emotion/styled@^10.0.17": + version "10.0.27" + resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-10.0.27.tgz#12cb67e91f7ad7431e1875b1d83a94b814133eaf" + integrity sha512-iK/8Sh7+NLJzyp9a5+vIQIXTYxfT4yB/OJbjzQanB2RZpvmzBQOHZWhpAMZWYEKRNNbsD6WfBw5sVWkb6WzS/Q== dependencies: - "@emotion/styled-base" "^10.0.17" - babel-plugin-emotion "^10.0.17" + "@emotion/styled-base" "^10.0.27" + babel-plugin-emotion "^10.0.27" -"@emotion/stylis@0.8.4": - version "0.8.4" - resolved "https://registry.yarnpkg.com/@emotion/stylis/-/stylis-0.8.4.tgz#6c51afdf1dd0d73666ba09d2eb6c25c220d6fe4c" - integrity sha512-TLmkCVm8f8gH0oLv+HWKiu7e8xmBIaokhxcEKPh1m8pXiV/akCiq50FvYgOwY42rjejck8nsdQxZlXZ7pmyBUQ== +"@emotion/stylis@0.8.5": + version "0.8.5" + resolved "https://registry.yarnpkg.com/@emotion/stylis/-/stylis-0.8.5.tgz#deacb389bd6ee77d1e7fcaccce9e16c5c7e78e04" + integrity sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ== -"@emotion/unitless@0.7.4": - version "0.7.4" - resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.4.tgz#a87b4b04e5ae14a88d48ebef15015f6b7d1f5677" - integrity sha512-kBa+cDHOR9jpRJ+kcGMsysrls0leukrm68DmFQoMIWQcXdr2cZvyvypWuGYT7U+9kAExUE7+T7r6G3C3A6L8MQ== +"@emotion/unitless@0.7.5": + version "0.7.5" + resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" + integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== -"@emotion/utils@0.11.2": - version "0.11.2" - resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.11.2.tgz#713056bfdffb396b0a14f1c8f18e7b4d0d200183" - integrity sha512-UHX2XklLl3sIaP6oiMmlVzT0J+2ATTVpf0dHQVyPJHTkOITvXfaSqnRk6mdDhV9pR8T/tHc3cex78IKXssmzrA== - -"@emotion/weak-memoize@0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.3.tgz#dfa0c92efe44a1d1a7974fb49ffeb40ef2da5a27" - integrity sha512-zVgvPwGK7c1aVdUVc9Qv7SqepOGRDrqCw7KZPSZziWGxSlbII3gmvGLPzLX4d0n0BMbamBacUrN22zOMyFFEkQ== +"@emotion/utils@0.11.3": + version "0.11.3" + resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.11.3.tgz#a759863867befa7e583400d322652a3f44820924" + integrity sha512-0o4l6pZC+hI88+bzuaX/6BgOvQVhbt2PfmxauVaYOGgbsAw14wdKyvMCZXnsnsHys94iadcF+RG/wZyx6+ZZBw== -"@emotion/weak-memoize@0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.4.tgz#622a72bebd1e3f48d921563b4b60a762295a81fc" - integrity sha512-6PYY5DVdAY1ifaQW6XYTnOMihmBVT27elqSjEoodchsGjzYlEsTQMcEhSud99kVawatyTZRTiVkJ/c6lwbQ7nA== +"@emotion/weak-memoize@0.2.5": + version "0.2.5" + resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" + integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" @@ -2196,11 +2152,6 @@ dependencies: "@hapi/hoek" "8.x.x" -"@icons/material@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@icons/material/-/material-0.2.4.tgz#e90c9f71768b3736e76d7dd6783fc6c2afa88bc8" - integrity sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw== - "@iov/bcp@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@iov/bcp/-/bcp-2.0.2.tgz#d63a996e0c2c7eff218f3dfca44dbcfaaf80ed0b" @@ -2657,6 +2608,16 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" +"@jest/types@^25.1.0": + version "25.1.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.1.0.tgz#b26831916f0d7c381e11dbb5e103a72aed1b4395" + integrity sha512-VpOtt7tCrgvamWZh1reVsGADujKigBUFTi19mlRjqEGsE8qH4r3s+skY33dNdXOwyZIvuftZ5tqdF1IgsMejMA== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^15.0.0" + chalk "^3.0.0" + "@ledgerhq/devices@^4.68.4": version "4.68.4" resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-4.68.4.tgz#237f628442215e2d6fe803c4785d6e15a488b87b" @@ -3625,185 +3586,179 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-1.2.0.tgz#63ce3638cb85231f3704164c90a18ef816da3fb7" integrity sha512-mwhXGkRV5dlvQc4EgPDxDxO6WuMBVymGFd1CA+2Y+z5dG9MNspoQ+AWjl/Ld1MnpCL8AKbosZlDVohqcIwuWsw== -"@storybook/addon-actions@5.2.1", "@storybook/addon-actions@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-5.2.1.tgz#2096e7f938b289be48af6f0adfd620997e7a420c" - integrity sha512-tu4LGeRGAq+sLlsRPE1PzGyYU9JyM3HMLXnOCh5dvRSS8wnoDw1zQ55LPOXH6aoJGdsrvktiw+uTVf4OyN7ryg== - dependencies: - "@storybook/addons" "5.2.1" - "@storybook/api" "5.2.1" - "@storybook/client-api" "5.2.1" - "@storybook/components" "5.2.1" - "@storybook/core-events" "5.2.1" - "@storybook/theming" "5.2.1" +"@storybook/addon-actions@^5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-5.3.17.tgz#ec7ae8fa25ef211c2a3302b6ac1d271a6247f767" + integrity sha512-06HQSBqWFyXcqV418Uv3oMHomNy9g3uCt0FHrqY3BAc7PldY1X0tW65oy//uBueaRaYKdhtRrrjfXRaPQWmDbA== + dependencies: + "@storybook/addons" "5.3.17" + "@storybook/api" "5.3.17" + "@storybook/client-api" "5.3.17" + "@storybook/components" "5.3.17" + "@storybook/core-events" "5.3.17" + "@storybook/theming" "5.3.17" core-js "^3.0.1" fast-deep-equal "^2.0.1" global "^4.3.2" polished "^3.3.1" prop-types "^15.7.2" react "^16.8.3" - react-inspector "^3.0.2" + react-inspector "^4.0.0" uuid "^3.3.2" -"@storybook/addon-knobs@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/addon-knobs/-/addon-knobs-5.2.1.tgz#6bc2f7e254ccce09d6f5136e9cce63cd808c9853" - integrity sha512-JCSqrGYyVVBNkudhvla7qc9m0/Mn1UMaMzIxH5kewEE1KWZcCkdXD5hDASN39pkn3mX1yyqveP8jiyIL9vVBLg== - dependencies: - "@storybook/addons" "5.2.1" - "@storybook/api" "5.2.1" - "@storybook/client-api" "5.2.1" - "@storybook/components" "5.2.1" - "@storybook/core-events" "5.2.1" - "@storybook/theming" "5.2.1" - copy-to-clipboard "^3.0.8" - core-js "^3.0.1" - escape-html "^1.0.3" - fast-deep-equal "^2.0.1" - global "^4.3.2" - lodash "^4.17.11" - prop-types "^15.7.2" - qs "^6.6.0" - react-color "^2.17.0" - react-lifecycles-compat "^3.0.4" - react-select "^3.0.0" - -"@storybook/addon-links@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-5.2.1.tgz#ec1fc92ed4d840ba758f40167c752f48562a906f" - integrity sha512-N5f+lzai+ctHfzHoYWECYsg3lKGJuqhkVctro46fHSW7s/GB8+l78nDcV7hDjNEXDES8QN5C1fPYihatdgpSJA== +"@storybook/addon-links@^5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-5.3.17.tgz#bccbd49108f03eb8f7a72106fbbceed671e042a9" + integrity sha512-g8PsDoHYEmgK1q1h+eLqXsWLhCj5CFyiZLrtomjCp1R0XpZA7PS8LyO5yHbxzEzEv68DHlU5rwQnNnkbGnr7XA== dependencies: - "@storybook/addons" "5.2.1" - "@storybook/core-events" "5.2.1" - "@storybook/router" "5.2.1" - common-tags "^1.8.0" + "@storybook/addons" "5.3.17" + "@storybook/client-logger" "5.3.17" + "@storybook/core-events" "5.3.17" + "@storybook/csf" "0.0.1" + "@storybook/router" "5.3.17" core-js "^3.0.1" global "^4.3.2" prop-types "^15.7.2" qs "^6.6.0" + ts-dedent "^1.1.0" -"@storybook/addon-storyshots@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/addon-storyshots/-/addon-storyshots-5.2.1.tgz#6485490b3c0fef81fcee312aa77d2414adb44dec" - integrity sha512-+LLjzu5zfzIfiLubV9OLjFY71yZxbbXTiLJTFynRpDZE5er00HXnxwsEqM8N2vYhkJRv0SXYGunNQkPU48Kbyw== +"@storybook/addon-storyshots@^5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/addon-storyshots/-/addon-storyshots-5.3.17.tgz#eb8a5ccfd506a520e661b636792f81945a7732e6" + integrity sha512-XAoFzzO8w1tjViAwB+voKaefOCcj6wDeK7wpaRUfXRiJ9WWG4NBcYCBxdtY993cZ3jIfialYYO08zQMXX57Btg== dependencies: - "@storybook/addons" "5.2.1" + "@jest/transform" "^24.9.0" + "@storybook/addons" "5.3.17" + "@storybook/client-api" "5.3.17" + "@storybook/core" "5.3.17" + "@types/glob" "^7.1.1" + "@types/jest" "^24.0.16" + "@types/jest-specific-snapshot" "^0.5.3" + babel-plugin-require-context-hook "^1.0.0" core-js "^3.0.1" glob "^7.1.3" global "^4.3.2" jest-specific-snapshot "^2.0.0" - read-pkg-up "^6.0.0" - regenerator-runtime "^0.12.1" - -"@storybook/addon-viewport@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/addon-viewport/-/addon-viewport-5.2.1.tgz#3cc8ec9f2ee1dd0a474cb8dd47ecee8428defe77" - integrity sha512-RZU+l99X5SfvBfYbqAbgGgL95g19/dddPwlijLOqFcUlf+tk7WD08PRbizWlnRFZ15J0ytVgf256XSQoQ1oMCQ== - dependencies: - "@storybook/addons" "5.2.1" - "@storybook/api" "5.2.1" - "@storybook/client-logger" "5.2.1" - "@storybook/components" "5.2.1" - "@storybook/core-events" "5.2.1" - "@storybook/theming" "5.2.1" + read-pkg-up "^7.0.0" + regenerator-runtime "^0.13.3" + ts-dedent "^1.1.0" + +"@storybook/addon-viewport@^5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/addon-viewport/-/addon-viewport-5.3.17.tgz#ef7b4bf8a58291940938828c6eedd07984f75e66" + integrity sha512-tkf9XyzT4Ld3bcJaNqczZo3Wll6j/DVyf6lEcCp4XD4dor7eQEIxCBVU3LR+2zeLqhWxBHtPmL1SxYVPpcZR6A== + dependencies: + "@storybook/addons" "5.3.17" + "@storybook/api" "5.3.17" + "@storybook/client-logger" "5.3.17" + "@storybook/components" "5.3.17" + "@storybook/core-events" "5.3.17" + "@storybook/theming" "5.3.17" core-js "^3.0.1" global "^4.3.2" memoizerific "^1.11.3" prop-types "^15.7.2" util-deprecate "^1.0.2" -"@storybook/addons@5.2.1", "@storybook/addons@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-5.2.1.tgz#6e52aa1fa2737e170fb675eb1fcceebd0a915a0b" - integrity sha512-kdx97tTKsMf/lBlT40uLYsHMF1J71mn2j41RNaCXmWw/PrKCDmiNfinemN2wtbwRSvGqb3q/BAqjKLvUtWynGg== +"@storybook/addons@5.3.17", "@storybook/addons@^5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-5.3.17.tgz#8efab65904040b0b8578eedc9a5772dbcbf6fa83" + integrity sha512-zg6O1bmffRsHXJOWAnSD2O3tPnVMoD8Yfu+a5zBVXDiUP1E/TGzgjjjYBUUCU3yQg1Ted5rIn4o6ql/rZNNlgA== dependencies: - "@storybook/api" "5.2.1" - "@storybook/channels" "5.2.1" - "@storybook/client-logger" "5.2.1" - "@storybook/core-events" "5.2.1" + "@storybook/api" "5.3.17" + "@storybook/channels" "5.3.17" + "@storybook/client-logger" "5.3.17" + "@storybook/core-events" "5.3.17" core-js "^3.0.1" global "^4.3.2" util-deprecate "^1.0.2" -"@storybook/api@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/api/-/api-5.2.1.tgz#b9cd6639019e044a8ade6fb358cade79c0e3b5d3" - integrity sha512-EXN6sqkGHRuNq0W6BZXOlxe2I2dmN0yUdQLiUOpzH2I3mXnVHpad/0v76dRc9fZbC4LaYUSxR8lBTr0rqIb4mA== - dependencies: - "@storybook/channels" "5.2.1" - "@storybook/client-logger" "5.2.1" - "@storybook/core-events" "5.2.1" - "@storybook/router" "5.2.1" - "@storybook/theming" "5.2.1" +"@storybook/api@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-5.3.17.tgz#1c0dad3309afef6b0a5585cb59c65824fb4d2721" + integrity sha512-G40jtXFY10hQo6GSw5JeFYt41loD4+7s0uU18Rm6lfa/twOgp6vqqyDCWDvpRRxRBB5uDIKKHLt13X9gWe8tQQ== + dependencies: + "@reach/router" "^1.2.1" + "@storybook/channels" "5.3.17" + "@storybook/client-logger" "5.3.17" + "@storybook/core-events" "5.3.17" + "@storybook/csf" "0.0.1" + "@storybook/router" "5.3.17" + "@storybook/theming" "5.3.17" + "@types/reach__router" "^1.2.3" core-js "^3.0.1" fast-deep-equal "^2.0.1" global "^4.3.2" - lodash "^4.17.11" + lodash "^4.17.15" memoizerific "^1.11.3" prop-types "^15.6.2" react "^16.8.3" semver "^6.0.0" shallow-equal "^1.1.0" store2 "^2.7.1" - telejson "^2.2.2" + telejson "^3.2.0" util-deprecate "^1.0.2" -"@storybook/channel-postmessage@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-5.2.1.tgz#85541f926d61eedbe2a687bb394d37fc06252751" - integrity sha512-gmnn9qU1iLCpfF6bZuEM3QQOZsAviWeIpiezjrd/qkxatgr3qtbXd4EoZpcVuQw314etarWtNxVpcX6PXcASjQ== +"@storybook/channel-postmessage@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-5.3.17.tgz#807b6316cd0e52d9f27363d5092ad1cd896b694c" + integrity sha512-1aSQNeO2+roPRgMFjW3AWTO3uS93lbCMUTYCBdi20md4bQ9SutJy33rynCQcWuMj1prCQ2Ekz4BGhdcIQVKlzg== dependencies: - "@storybook/channels" "5.2.1" - "@storybook/client-logger" "5.2.1" + "@storybook/channels" "5.3.17" + "@storybook/client-logger" "5.3.17" core-js "^3.0.1" global "^4.3.2" - telejson "^2.2.2" + telejson "^3.2.0" -"@storybook/channels@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-5.2.1.tgz#e5e35f6d9fb1b1fba4f18b171f31d5f6540f3bef" - integrity sha512-AsF/Hwx91SDOgiOGOBSWS8EJAgqVm939n2nkfdLSJQQmX5EdPRAc3EIE3f13tyQub2yNx0OR4UzQDWgjwfVsEQ== +"@storybook/channels@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-5.3.17.tgz#74eccb10c2395499da6a290bcd0272d6d6c7c5b2" + integrity sha512-5hlBRbyk+YxC4KgecYG8wWwB2v1BzRJXhSlemFDOQk9wx37gVpne+rBydEtNFO4InmaZf6tKbBcpH0wBFLdWYA== dependencies: core-js "^3.0.1" -"@storybook/client-api@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-5.2.1.tgz#bdd335187279a4ab45e20d6d5e9131e5f7098acf" - integrity sha512-VxexqxrbORCGqwx2j0/91Eu1A/vq+rSVIesWwzIowmoLfBwRwDdskO20Yn9U7iMSpux4RvHGF6y1Q1ZtnXm9aA== - dependencies: - "@storybook/addons" "5.2.1" - "@storybook/channel-postmessage" "5.2.1" - "@storybook/channels" "5.2.1" - "@storybook/client-logger" "5.2.1" - "@storybook/core-events" "5.2.1" - "@storybook/router" "5.2.1" - common-tags "^1.8.0" +"@storybook/client-api@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-5.3.17.tgz#fc1d247caf267ebcc6ddf957fca7e02ae752d99e" + integrity sha512-oe55FPTGVL2k+j45eCN3oE7ePkE4VpgUQ/dhJbjU0R2L+HyRyBhd0wnMYj1f5E8uVNbtjFYAtbjjgcf1R1imeg== + dependencies: + "@storybook/addons" "5.3.17" + "@storybook/channel-postmessage" "5.3.17" + "@storybook/channels" "5.3.17" + "@storybook/client-logger" "5.3.17" + "@storybook/core-events" "5.3.17" + "@storybook/csf" "0.0.1" + "@types/webpack-env" "^1.15.0" core-js "^3.0.1" eventemitter3 "^4.0.0" global "^4.3.2" is-plain-object "^3.0.0" - lodash "^4.17.11" + lodash "^4.17.15" memoizerific "^1.11.3" qs "^6.6.0" + stable "^0.1.8" + ts-dedent "^1.1.0" util-deprecate "^1.0.2" -"@storybook/client-logger@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-5.2.1.tgz#5c1f122b65386f04a6ad648808dfa89f2d852d7a" - integrity sha512-wzxSE9t3DaLCdd/gnGFnjevmYRZ92F3TEwhUP/QDXM9cZkNsRKHkjE61qjiO5aQPaZQG6Ea9ayWEQEMgZXDucg== +"@storybook/client-logger@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-5.3.17.tgz#bf9c7ef52da75a5c1f2c5d74724442224deea6e4" + integrity sha512-GYYvVGIOs+fq11LXXy7x2sr3hhC9LMI1jtIckjKV1dsY9MJ5g22M+Wl5Iw4nf6VMWsqcN9LSlYE+u/H+Q2uCHw== dependencies: core-js "^3.0.1" -"@storybook/components@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/components/-/components-5.2.1.tgz#a4519c5d435c2c25c481e2b64a768e1e568a223f" - integrity sha512-cik5J/mTm1b1TOI17qM+2Mikk3rjb3SbBD4WlNz3Zvn+Hw0ukgbx6kQwVBgujhMlDtsHreidyEgIg4TM13S0Tg== +"@storybook/components@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-5.3.17.tgz#287430fc9c5f59b1d3590b50b3c7688355b22639" + integrity sha512-M5oqbzcqFX4VDNI8siT3phT7rmFwChQ/xPwX9ygByBsZCoNuLMzafavfTOhZvxCPiliFbBxmxtK/ibCsSzuKZg== dependencies: - "@storybook/client-logger" "5.2.1" - "@storybook/theming" "5.2.1" - "@types/react-syntax-highlighter" "10.1.0" + "@storybook/client-logger" "5.3.17" + "@storybook/theming" "5.3.17" + "@types/react-syntax-highlighter" "11.0.4" + "@types/react-textarea-autosize" "^4.3.3" core-js "^3.0.1" global "^4.3.2" + lodash "^4.17.15" markdown-to-jsx "^6.9.1" memoizerific "^1.11.3" polished "^3.3.1" @@ -3811,186 +3766,210 @@ prop-types "^15.7.2" react "^16.8.3" react-dom "^16.8.3" - react-focus-lock "^1.18.3" + react-focus-lock "^2.1.0" react-helmet-async "^1.0.2" react-popper-tooltip "^2.8.3" - react-syntax-highlighter "^8.0.1" + react-syntax-highlighter "^11.0.2" react-textarea-autosize "^7.1.0" simplebar-react "^1.0.0-alpha.6" + ts-dedent "^1.1.0" -"@storybook/core-events@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-5.2.1.tgz#bc28d704938d26dd544d0362d38ef08e8cfed916" - integrity sha512-AIYV/I+baQ0KxvEM7QAKqUedLn2os0XU9HTdtfZJTC3U9wjmR2ah2ScD6T0n7PBz3MderkvZG6dNjs9h8gRquQ== +"@storybook/core-events@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-5.3.17.tgz#698ce0a36c29fe8fa04608f56ccca53aa1d31638" + integrity sha512-DOeX9fpeGW4o9Gocxa4VW9wAlAyfIVNDTzq0wVvvMBthTTo9u58NmndglEMDgDa2Cq6iAIPh7vz2bRJCNexzLw== dependencies: core-js "^3.0.1" -"@storybook/core@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.2.1.tgz#3aa17c6fa9b02704723501d32884453869e3c06c" - integrity sha512-mGGvN3GWeLxZ9lYZ4IuD1IoJD+cn6XXm2Arzw+k6KEtJJDFrC5SjESTDGLVFienX5s2tgH4FjYb9Ps9sKfhHlg== +"@storybook/core@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/core/-/core-5.3.17.tgz#abd09dc416f87c7954ef3615bc3f4898c93e2b45" + integrity sha512-H6G8ygjb4RSVSKPdWz6su3Nvzxm8CfrHuCyUo4DLC46mirXfYRrJV1HiwXriViqoZV4gFbpaNKTDzTl/QKFDAg== dependencies: - "@babel/plugin-proposal-class-properties" "^7.3.3" - "@babel/plugin-proposal-object-rest-spread" "^7.3.2" + "@babel/plugin-proposal-class-properties" "^7.7.0" + "@babel/plugin-proposal-object-rest-spread" "^7.6.2" "@babel/plugin-syntax-dynamic-import" "^7.2.0" "@babel/plugin-transform-react-constant-elements" "^7.2.0" "@babel/preset-env" "^7.4.5" - "@storybook/addons" "5.2.1" - "@storybook/channel-postmessage" "5.2.1" - "@storybook/client-api" "5.2.1" - "@storybook/client-logger" "5.2.1" - "@storybook/core-events" "5.2.1" - "@storybook/node-logger" "5.2.1" - "@storybook/router" "5.2.1" - "@storybook/theming" "5.2.1" - "@storybook/ui" "5.2.1" - airbnb-js-shims "^1 || ^2" + "@storybook/addons" "5.3.17" + "@storybook/channel-postmessage" "5.3.17" + "@storybook/client-api" "5.3.17" + "@storybook/client-logger" "5.3.17" + "@storybook/core-events" "5.3.17" + "@storybook/csf" "0.0.1" + "@storybook/node-logger" "5.3.17" + "@storybook/router" "5.3.17" + "@storybook/theming" "5.3.17" + "@storybook/ui" "5.3.17" + airbnb-js-shims "^2.2.1" ansi-to-html "^0.6.11" - autoprefixer "^9.4.9" + autoprefixer "^9.7.2" babel-plugin-add-react-displayname "^0.0.5" - babel-plugin-emotion "^10.0.14" - babel-plugin-macros "^2.4.5" + babel-plugin-emotion "^10.0.20" + babel-plugin-macros "^2.7.0" babel-preset-minify "^0.5.0 || 0.6.0-alpha.5" - boxen "^3.0.0" + boxen "^4.1.0" case-sensitive-paths-webpack-plugin "^2.2.0" - chalk "^2.4.2" + chalk "^3.0.0" cli-table3 "0.5.1" - commander "^2.19.0" - common-tags "^1.8.0" + commander "^4.0.1" core-js "^3.0.1" corejs-upgrade-webpack-plugin "^2.2.0" css-loader "^3.0.0" detect-port "^1.3.0" dotenv-webpack "^1.7.0" - ejs "^2.6.1" + ejs "^2.7.4" express "^4.17.0" - file-loader "^3.0.1" + file-loader "^4.2.0" file-system-cache "^1.0.5" find-cache-dir "^3.0.0" + find-up "^4.1.0" fs-extra "^8.0.1" + glob-base "^0.3.0" global "^4.3.2" html-webpack-plugin "^4.0.0-beta.2" - inquirer "^6.2.0" - interpret "^1.2.0" + inquirer "^7.0.0" + interpret "^2.0.0" ip "^1.1.5" - json5 "^2.1.0" + json5 "^2.1.1" lazy-universal-dotenv "^3.0.1" + micromatch "^4.0.2" node-fetch "^2.6.0" - open "^6.1.0" - pnp-webpack-plugin "1.4.3" + open "^7.0.0" + pnp-webpack-plugin "1.5.0" postcss-flexbugs-fixes "^4.1.0" postcss-loader "^3.0.0" pretty-hrtime "^1.0.3" qs "^6.6.0" - raw-loader "^2.0.0" + raw-loader "^3.1.0" react-dev-utils "^9.0.0" - regenerator-runtime "^0.12.1" + regenerator-runtime "^0.13.3" resolve "^1.11.0" resolve-from "^5.0.0" semver "^6.0.0" serve-favicon "^2.5.0" shelljs "^0.8.3" - style-loader "^0.23.1" - terser-webpack-plugin "^1.2.4" + style-loader "^1.0.0" + terser-webpack-plugin "^2.1.2" + ts-dedent "^1.1.0" unfetch "^4.1.0" url-loader "^2.0.1" util-deprecate "^1.0.2" webpack "^4.33.0" webpack-dev-middleware "^3.7.0" webpack-hot-middleware "^2.25.0" + webpack-virtual-modules "^0.2.0" -"@storybook/node-logger@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.2.1.tgz#00d8c0dc9dfd482e7d1d244a59c46726c6b761d9" - integrity sha512-rz+snXZyKwTegKEf15w4uaFWIKpgaWzTw+Ar8mxa+mX7C2DP65TOc+JGYZ7lsXdred+0WP0DhnmhGu2cX8z3lA== +"@storybook/csf@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@storybook/csf/-/csf-0.0.1.tgz#95901507dc02f0bc6f9ac8ee1983e2fc5bb98ce6" + integrity sha512-USTLkZze5gkel8MYCujSRBVIrUQ3YPBrLOx7GNk/0wttvVtlzWXAq9eLbQ4p/NicGxP+3T7KPEMVV//g+yubpw== dependencies: - chalk "^2.4.2" + lodash "^4.17.15" + +"@storybook/node-logger@5.3.17", "@storybook/node-logger@^5.3.14": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-5.3.17.tgz#f3ad5bf9dd74d8e1cdfb8d831d66a80c5039cf4c" + integrity sha512-onfcxl37BYZI1HGuPI9MelkyUWjn7NpfN8RUYdqG9P6WKiIY5xbpG0V6qod5jvIKIypK0NmfJTtneOu46L/oDg== + dependencies: + "@types/npmlog" "^4.1.2" + chalk "^3.0.0" core-js "^3.0.1" npmlog "^4.1.2" pretty-hrtime "^1.0.3" - regenerator-runtime "^0.12.1" + regenerator-runtime "^0.13.3" -"@storybook/react@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/react/-/react-5.2.1.tgz#860970fa8f0d49967862b496af4ef3712f0b96dd" - integrity sha512-brUG8iK2+1Fk5VFZWpAoSokCx21MaPX1zSAVA+Z/Ia0I0sFfurhpQgAGlVePTy9r7dtEEEdniZVtJOH/tHqk4Q== +"@storybook/preset-create-react-app@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@storybook/preset-create-react-app/-/preset-create-react-app-2.0.0.tgz#f6bc430cd3dcfcf42490505d9f0dbc5dbc84ca3e" + integrity sha512-EvYvQWtJRiLrO3aL6fnawDyujMXQOSD1KO74k60cE8XLASm9slGtzeyrz/Awpb9eZHFS8dUx9cyMv1dm53CxJw== dependencies: - "@babel/plugin-transform-react-constant-elements" "^7.2.0" + "@storybook/node-logger" "^5.3.14" + "@types/webpack" "^4.41.7" + semver "^7.1.3" + +"@storybook/react@^5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/react/-/react-5.3.17.tgz#403b58606211a9ca87d40e38d55186b3e088640d" + integrity sha512-FQLH3q2Ge68oLBaTge7wl5Y1KkB+pqL36llor7TOO9IxGLF6o2t2qillWnrgX6yZUpkvJK8MgkZW1/N3tslw4Q== + dependencies: + "@babel/plugin-transform-react-constant-elements" "^7.6.3" "@babel/preset-flow" "^7.0.0" "@babel/preset-react" "^7.0.0" - "@storybook/addons" "5.2.1" - "@storybook/core" "5.2.1" - "@storybook/node-logger" "5.2.1" + "@storybook/addons" "5.3.17" + "@storybook/core" "5.3.17" + "@storybook/node-logger" "5.3.17" "@svgr/webpack" "^4.0.3" + "@types/webpack-env" "^1.15.0" babel-plugin-add-react-displayname "^0.0.5" babel-plugin-named-asset-import "^0.3.1" - babel-plugin-react-docgen "^3.0.0" - babel-preset-react-app "^9.0.0" - common-tags "^1.8.0" + babel-plugin-react-docgen "^4.0.0" core-js "^3.0.1" global "^4.3.2" - lodash "^4.17.11" + lodash "^4.17.15" mini-css-extract-plugin "^0.7.0" prop-types "^15.7.2" react-dev-utils "^9.0.0" - regenerator-runtime "^0.12.1" + regenerator-runtime "^0.13.3" semver "^6.0.0" + ts-dedent "^1.1.0" webpack "^4.33.0" -"@storybook/router@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/router/-/router-5.2.1.tgz#9c49df79343d3be10c7f984858fb5c9ae3eb7491" - integrity sha512-Mlk275cyPoKtnP4DwQ5D8gTfnaRPL6kDZOSn0wbTMa6pQOfYKgJsa7tjzeAtZuZ/j8hKI4gAfT/auMgH6g+94A== +"@storybook/router@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-5.3.17.tgz#4db96b45f39b25a3f7a4e2899c36e7e9e4ba6108" + integrity sha512-ANsiehGRTVSremgTW0Vt47dQ4JA86a4/w/4G6QqHU8Cm4jO3cw/wAcCxlzfcgCXOUiq+SuyPTU43+0O5uBx33g== dependencies: "@reach/router" "^1.2.1" + "@storybook/csf" "0.0.1" "@types/reach__router" "^1.2.3" core-js "^3.0.1" global "^4.3.2" - lodash "^4.17.11" + lodash "^4.17.15" memoizerific "^1.11.3" qs "^6.6.0" + util-deprecate "^1.0.2" -"@storybook/theming@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-5.2.1.tgz#913e383632e4702035a107c2cc5e5cb27231b389" - integrity sha512-lbAfcyI7Tx8swduIPmlu/jdWzqTBN/v82IEQbZbPR4LS5OHRPmhXPNgFGrcH4kFAiD0GoezSsdum1x0ZZpsQUQ== +"@storybook/theming@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-5.3.17.tgz#cf6278c4857229c7167faf04d5b2206bc5ee04e1" + integrity sha512-4JeOZnDDHtb4LOt5sXe/s1Jhbb2UPsr8zL9NWmKJmTsgnyTvBipNHOmFYDUsIacB5K4GXSqm+cZ7Z4AkUgWCDw== dependencies: - "@emotion/core" "^10.0.14" - "@emotion/styled" "^10.0.14" - "@storybook/client-logger" "5.2.1" - common-tags "^1.8.0" + "@emotion/core" "^10.0.20" + "@emotion/styled" "^10.0.17" + "@storybook/client-logger" "5.3.17" core-js "^3.0.1" deep-object-diff "^1.1.0" - emotion-theming "^10.0.14" + emotion-theming "^10.0.19" global "^4.3.2" memoizerific "^1.11.3" polished "^3.3.1" prop-types "^15.7.2" resolve-from "^5.0.0" - -"@storybook/ui@5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.2.1.tgz#ceba1657a232efd10f839027f8ae274e370c89f6" - integrity sha512-h6Yf1ro/nZcz4nQAU+eSVPxVmpqv7uT7RMb3Vz+VLTY59IEA/sWcoIgA4MIxwf14nVcWOqSmVBJzNKWwc+NGJw== - dependencies: - "@storybook/addon-actions" "5.2.1" - "@storybook/addon-knobs" "5.2.1" - "@storybook/addons" "5.2.1" - "@storybook/api" "5.2.1" - "@storybook/channels" "5.2.1" - "@storybook/client-logger" "5.2.1" - "@storybook/components" "5.2.1" - "@storybook/core-events" "5.2.1" - "@storybook/router" "5.2.1" - "@storybook/theming" "5.2.1" + ts-dedent "^1.1.0" + +"@storybook/ui@5.3.17": + version "5.3.17" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-5.3.17.tgz#2d47617896a2d928fb79dc8a0e709cee9b57cc50" + integrity sha512-5S9r70QbtNKu8loa5pfO5lLX9coF/ZqesEKcanfvuSwqCSg/Z51UwFCuO6eNhVlpXzyZXi5d8qKbZlbf+uvDAA== + dependencies: + "@emotion/core" "^10.0.20" + "@storybook/addons" "5.3.17" + "@storybook/api" "5.3.17" + "@storybook/channels" "5.3.17" + "@storybook/client-logger" "5.3.17" + "@storybook/components" "5.3.17" + "@storybook/core-events" "5.3.17" + "@storybook/router" "5.3.17" + "@storybook/theming" "5.3.17" copy-to-clipboard "^3.0.8" core-js "^3.0.1" core-js-pure "^3.0.1" - emotion-theming "^10.0.14" + emotion-theming "^10.0.19" fast-deep-equal "^2.0.1" - fuse.js "^3.4.4" + fuse.js "^3.4.6" global "^4.3.2" - lodash "^4.17.11" + lodash "^4.17.15" markdown-to-jsx "^6.9.3" memoizerific "^1.11.3" polished "^3.3.1" @@ -3998,15 +3977,15 @@ qs "^6.6.0" react "^16.8.3" react-dom "^16.8.3" - react-draggable "^3.3.2" + react-draggable "^4.0.3" react-helmet-async "^1.0.2" - react-hotkeys "2.0.0-pre4" + react-hotkeys "2.0.0" react-sizeme "^2.6.7" regenerator-runtime "^0.13.2" resolve-from "^5.0.0" semver "^6.0.0" store2 "^2.7.1" - telejson "^2.2.2" + telejson "^3.2.0" util-deprecate "^1.0.2" "@svgr/babel-plugin-add-jsx-attribute@^4.2.0": @@ -4176,6 +4155,11 @@ resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-5.0.1.tgz#3c7750d0186b954c7f2d2f6acc8c3c7ba0c3412e" integrity sha512-wYxU3kp5zItbxKmeRYCEplS2MW7DzyBnxPGj+GJVHZEUZiK/nn5Ei1sUFgURDh+X051+zsGe28iud3oHjrYWQQ== +"@types/anymatch@*": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" + integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA== + "@types/babel__core@^7.1.0": version "7.1.2" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" @@ -4321,6 +4305,11 @@ "@types/react" "*" hoist-non-react-statics "^3.3.0" +"@types/is-function@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83" + integrity sha512-iTs9HReBu7evG77Q4EC8hZnqRt57irBDkK9nvmHroiOIVwYMQc4IvYvdRgwKfYepunIY7Oh/dBuuld+Gj9uo6w== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -4346,6 +4335,21 @@ resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA== +"@types/jest-specific-snapshot@^0.5.3": + version "0.5.4" + resolved "https://registry.yarnpkg.com/@types/jest-specific-snapshot/-/jest-specific-snapshot-0.5.4.tgz#997364c39a59ddeff0ee790a19415e79dd061d1e" + integrity sha512-1qISn4fH8wkOOPFEx+uWRRjw6m/pP/It3OHLm8Ee1KQpO7Z9ZGYDtWPU5AgK05UXsNTAgOK+dPQvJKGdy9E/1g== + dependencies: + "@types/jest" "*" + +"@types/jest@*": + version "25.1.4" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.1.4.tgz#9e9f1e59dda86d3fd56afce71d1ea1b331f6f760" + integrity sha512-QDDY2uNAhCV7TMCITrxz+MRk1EizcsevzfeS6LykIlq2V1E5oO4wXG8V2ZEd9w7Snxeeagk46YbMgZ8ESHx3sw== + dependencies: + jest-diff "^25.1.0" + pretty-format "^25.1.0" + "@types/jest@24.0.14": version "24.0.14" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.14.tgz#bb40fec243164b2def5cfaddd0cb4d4e958c5c1c" @@ -4353,6 +4357,13 @@ dependencies: "@types/jest-diff" "*" +"@types/jest@^24.0.16": + version "24.9.1" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.9.1.tgz#02baf9573c78f1b9974a5f36778b366aa77bd534" + integrity sha512-Fb38HkXSVA4L8fGKEZ6le5bB8r6MRWlOCZbVuWZcmOMSCd2wCYOwN1ibj8daIoV9naq7aaOZjrLCoCMptKU/4Q== + dependencies: + jest-diff "^24.3.0" + "@types/json-schema@^7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" @@ -4398,6 +4409,11 @@ dependencies: "@types/abstract-leveldown" "*" +"@types/mime-types@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.0.tgz#9ca52cda363f699c69466c2a6ccdaad913ea7a73" + integrity sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM= + "@types/mime@*": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" @@ -4433,6 +4449,11 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== +"@types/npmlog@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@types/npmlog/-/npmlog-4.1.2.tgz#d070fe6a6b78755d1092a3dc492d34c3d8f871c4" + integrity sha512-4QQmOF5KlwfxJ5IGXFIudkeLCdMABz03RcUXu+LCb24zmln8QW6aDjuGl4d4XPVLf2j+FnjelHTP7dvceAFbhA== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -4443,10 +4464,10 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6" integrity sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg== -"@types/puppeteer@*": - version "1.19.0" - resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-1.19.0.tgz#59f0050bae019cee7c3af2bb840a25892a3078b6" - integrity sha512-Db9LWOuTm2bR/qgPE7PQCmnsCQ6flHdULuIDWTks8YdQ/SGHKg5WGWG54gl0734NDKCTF5MbqAp2qWuvBiyQ3Q== +"@types/puppeteer@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-2.0.1.tgz#83a1d7f0a1c2e0edbbb488b4d8fb54b14ec9d455" + integrity sha512-G8vEyU83Bios+dzs+DZGpAirDmMqRhfFBJCkFrg+A5+6n5EPPHxwBLImJto3qjh0mrBXbLBCyuahhhtTrAfR5g== dependencies: "@types/node" "*" @@ -4514,17 +4535,24 @@ "@types/history" "*" "@types/react" "*" -"@types/react-syntax-highlighter@10.1.0": - version "10.1.0" - resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-10.1.0.tgz#9c534e29bbe05dba9beae1234f3ae944836685d4" - integrity sha512-dF49hC4FZp1dIKyzacOrHvqMUe8U2IXyQCQXOcT1e6n64gLBp+xM6qGtPsThIT9XjiIHSg2W5Jc2V5IqekBfnA== +"@types/react-syntax-highlighter@11.0.4": + version "11.0.4" + resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-11.0.4.tgz#d86d17697db62f98046874f62fdb3e53a0bbc4cd" + integrity sha512-9GfTo3a0PHwQeTVoqs0g5bS28KkSY48pp5659wA+Dp4MqceDEa8EHBqrllJvvtyusszyJhViUEap0FDvlk/9Zg== + dependencies: + "@types/react" "*" + +"@types/react-test-renderer@^16.9.2": + version "16.9.2" + resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-16.9.2.tgz#e1c408831e8183e5ad748fdece02214a7c2ab6c5" + integrity sha512-4eJr1JFLIAlWhzDkBCkhrOIWOvOxcCAfQh+jiKg7l/nNZcCIL2MHl2dZhogIFKyHzedVWHaVP1Yydq/Ruu4agw== dependencies: "@types/react" "*" -"@types/react-test-renderer@^16.8.1": - version "16.8.3" - resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-16.8.3.tgz#b6ca14d5fe4c742fd6d68ef42d45e3b5c6dd470a" - integrity sha512-vEEYh6gFk3jkPHqRe7N5CxWA+yb92hCZxNyhq/1Wj3mClqVWLJYakJDMp3iFmntCgEq96m68N9Oad3wOHm+pdQ== +"@types/react-textarea-autosize@^4.3.3": + version "4.3.5" + resolved "https://registry.yarnpkg.com/@types/react-textarea-autosize/-/react-textarea-autosize-4.3.5.tgz#6c4d2753fa1864c98c0b2b517f67bb1f6e4c46de" + integrity sha512-PiDL83kPMTolyZAWW3lyzO6ktooTb9tFTntVy7CA83/qFLWKLJ5bLeRboy6J6j3b1e8h2Eec6gBTEOOJRjV14A== dependencies: "@types/react" "*" @@ -4559,40 +4587,16 @@ "@types/express-serve-static-core" "*" "@types/mime" "*" +"@types/source-list-map@*": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" + integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA== + "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== -"@types/storybook__addon-actions@^3.4.3": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@types/storybook__addon-actions/-/storybook__addon-actions-3.4.3.tgz#bb0c3fd066e1f495d3f2b724487e2b99194b3f1a" - integrity sha512-RSFFfruUHL7La4CZpuiKZ0mZvr5orjenFA2jc31tfPwvA3fYNH4/9XSfA2MB08IpJbF3aErtYWT5Dtigkxnltg== - -"@types/storybook__addon-storyshots@^5.1.1": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/storybook__addon-storyshots/-/storybook__addon-storyshots-5.1.1.tgz#f10fab61881bee2eea721949b954f0b95d4c92fc" - integrity sha512-Sa0IP7NyHciCPrO/liyvZR4r1ZOVUzMHkmpj7GR+Y6iD0TkQw7ennMEYc28LpQRiLlZVkLkRvdxndq1WxLEuBQ== - dependencies: - "@types/puppeteer" "*" - "@types/react" "*" - "@types/storybook__react" "*" - -"@types/storybook__addon-viewport@^4.1.1": - version "4.1.1" - resolved "https://registry.yarnpkg.com/@types/storybook__addon-viewport/-/storybook__addon-viewport-4.1.1.tgz#d29b04760bf6820ee6bc417f8e08f40280e24379" - integrity sha512-ApZkw8mzKpH309vAP25LwnElilWl3XfXRm/Y5WB26zcfiWoaKln7fuHxFIzjOUPDFpCOefL6vNhFEw52v0621Q== - dependencies: - "@types/storybook__react" "*" - -"@types/storybook__react@*", "@types/storybook__react@^4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/storybook__react/-/storybook__react-4.0.2.tgz#f36fb399574c662e79c1a0cf6e429b6ff730da40" - integrity sha512-U/+J5qccRdKFryvHkk1a0IeZaSIZLCmTwAQhTSDGeC3SPNIYPus+EtunBqP49r870l8czbfxtjeC3IL9P66ngQ== - dependencies: - "@types/react" "*" - "@types/webpack-env" "*" - "@types/styled-jsx@^2.2.8": version "2.2.8" resolved "https://registry.yarnpkg.com/@types/styled-jsx/-/styled-jsx-2.2.8.tgz#b50d13d8a3c34036282d65194554cf186bab7234" @@ -4600,11 +4604,49 @@ dependencies: "@types/react" "*" -"@types/webpack-env@*", "@types/webpack-env@^1.14.0": +"@types/tapable@*": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.5.tgz#9adbc12950582aa65ead76bffdf39fe0c27a3c02" + integrity sha512-/gG2M/Imw7cQFp8PGvz/SwocNrmKFjFsm5Pb8HdbHkZ1K8pmuPzOX4VeVoiEecFCVf4CsN1r3/BRvx+6sNqwtQ== + +"@types/uglify-js@*": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082" + integrity sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ== + dependencies: + source-map "^0.6.1" + +"@types/webpack-env@^1.14.0": version "1.14.0" resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.14.0.tgz#8edfc5f8e6eae20eeed3ca0d02974ed4ee5e4efc" integrity sha512-Fv+0gYJzE/czLoRKq+gnXWr4yBpPM3tO3C8pDLFwqVKlMICQUq5OsxwwFZYDaVr7+L6mgNDp16iOcJHEz3J5RQ== +"@types/webpack-env@^1.15.0": + version "1.15.1" + resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.15.1.tgz#c8e84705e08eed430b5e15b39c65b0944e4d1422" + integrity sha512-eWN5ElDTeBc5lRDh95SqA8x18D0ll2pWudU3uWiyfsRmIZcmUXpEsxPU+7+BsdCrO2vfLRC629u/MmjbmF+2tA== + +"@types/webpack-sources@*": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.6.tgz#3d21dfc2ec0ad0c77758e79362426a9ba7d7cbcb" + integrity sha512-FtAWR7wR5ocJ9+nP137DV81tveD/ZgB1sadnJ/axUGM3BUVfRPx8oQNMtv3JNfTeHx3VP7cXiyfR/jmtEsVHsQ== + dependencies: + "@types/node" "*" + "@types/source-list-map" "*" + source-map "^0.6.1" + +"@types/webpack@^4.41.7": + version "4.41.7" + resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.7.tgz#22be27dbd4362b01c3954ca9b021dbc9328d9511" + integrity sha512-OQG9viYwO0V1NaNV7d0n79V+n6mjOV30CwgFPIfTzwmk8DHbt+C4f2aBGdCYbo3yFyYD6sjXfqqOjwkl1j+ulA== + dependencies: + "@types/anymatch" "*" + "@types/node" "*" + "@types/tapable" "*" + "@types/uglify-js" "*" + "@types/webpack-sources" "*" + source-map "^0.6.0" + "@types/yargs-parser@*": version "13.1.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" @@ -4622,6 +4664,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^15.0.0": + version "15.0.4" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.4.tgz#7e5d0f8ca25e9d5849f2ea443cf7c402decd8299" + integrity sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg== + dependencies: + "@types/yargs-parser" "*" + "@typescript-eslint/eslint-plugin@^2.8.0": version "2.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.20.0.tgz#a522d0e1e4898f7c9c6a8e1ed3579b60867693fa" @@ -5061,6 +5110,11 @@ agent-base@4, agent-base@^4.3.0: dependencies: es6-promisify "^5.0.0" +agent-base@5: + version "5.1.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" + integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g== + agent-base@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" @@ -5083,10 +5137,10 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -"airbnb-js-shims@^1 || ^2": - version "2.2.0" - resolved "https://registry.yarnpkg.com/airbnb-js-shims/-/airbnb-js-shims-2.2.0.tgz#46e1d9d9516f704ef736de76a3b6d484df9a96d8" - integrity sha512-pcSQf1+Kx7/0ibRmxj6rmMYc5V8SHlKu+rkQ80h0bjSLDaIxHg/3PiiFJi4A9mDc01CoBHoc8Fls2G/W0/+s5g== +airbnb-js-shims@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/airbnb-js-shims/-/airbnb-js-shims-2.2.1.tgz#db481102d682b98ed1daa4c5baa697a05ce5c040" + integrity sha512-wJNXPH66U2xjgo1Zwyjf9EydvJ2Si94+vSdk6EERcBfB2VZkeltpqIats0cqIZMLCXP3zcyaUKGYQeIBT6XjsQ== dependencies: array-includes "^3.0.3" array.prototype.flat "^1.2.1" @@ -5101,7 +5155,7 @@ aggregate-error@^3.0.0: object.values "^1.1.0" promise.allsettled "^1.0.0" promise.prototype.finally "^3.1.0" - string.prototype.matchall "^3.0.1" + string.prototype.matchall "^4.0.0 || ^3.0.1" string.prototype.padend "^3.0.0" string.prototype.padstart "^3.0.0" symbol.prototype.description "^1.0.0" @@ -5147,6 +5201,16 @@ ajv@^4.7.0: co "^4.6.0" json-stable-stringify "^1.0.1" +ajv@^6.12.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" + integrity sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + alphanum-sort@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" @@ -5572,10 +5636,10 @@ ast-types@0.11.3: resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.3.tgz#c20757fe72ee71278ea0ff3d87e5c2ca30d9edf8" integrity sha512-XA5o5dsNw8MhyW0Q7MWXJWc4oOzZKbdsEJq45h7c8q/d9DwWZ5F2ugUc1PuMLPGsUnphCt/cNDHu8JeBbxf1qA== -ast-types@0.12.4: - version "0.12.4" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.12.4.tgz#71ce6383800f24efc9a1a3308f3a6e420a0974d1" - integrity sha512-ky/YVYCbtVAS8TdMIaTiPFHwEpRB5z1hctepJplTr3UW5q8TDrpIMCILyk8pmLxGtn2KCtC/lSn7zOsaI7nzDw== +ast-types@^0.13.2: + version "0.13.2" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.2.tgz#df39b677a911a83f3a049644fb74fdded23cea48" + integrity sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA== astral-regex@^1.0.0: version "1.0.0" @@ -5602,7 +5666,7 @@ async@^1.3.0, async@^1.5.2: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -async@^2.0.0, async@^2.1.4, async@^2.3.0, async@^2.6.2, async@^2.6.3: +async@^2.0.0, async@^2.3.0, async@^2.6.2, async@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== @@ -5646,19 +5710,32 @@ atob@^2.1.1: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -autoprefixer@^9.4.9, autoprefixer@^9.6.1: +autoprefixer@^9.6.1: version "9.6.1" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.6.1.tgz#51967a02d2d2300bb01866c1611ec8348d355a47" integrity sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw== dependencies: browserslist "^4.6.3" - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000980" chalk "^2.4.2" normalize-range "^0.1.2" num2fraction "^1.2.2" postcss "^7.0.17" postcss-value-parser "^4.0.0" +autoprefixer@^9.7.2: + version "9.7.4" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.7.4.tgz#f8bf3e06707d047f0641d87aee8cfb174b2a5378" + integrity sha512-g0Ya30YrMBAEZk60lp+qfX5YQllG+S5W3GYCFvyHTvhOki0AEQJLPEcIuGRsqVwLi8FvXPVtwTGhfr38hVpm0g== + dependencies: + browserslist "^4.8.3" + caniuse-lite "^1.0.30001020" + chalk "^2.4.2" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^7.0.26" + postcss-value-parser "^4.0.2" + aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -5775,13 +5852,6 @@ babel-plugin-add-react-displayname@^0.0.5: resolved "https://registry.yarnpkg.com/babel-plugin-add-react-displayname/-/babel-plugin-add-react-displayname-0.0.5.tgz#339d4cddb7b65fd62d1df9db9fe04de134122bd5" integrity sha1-M51M3be2X9YtHfnbn+BN4TQSK9U= -babel-plugin-dynamic-import-node@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.2.0.tgz#c0adfb07d95f4a4495e9aaac6ec386c4d7c2524e" - integrity sha512-fP899ELUnTaBcIzmrW7nniyqqdYWrWuJUyPWHxFa/c7r7hS6KC8FscNfLlBNIoPSc55kYMGEEKjPjJGCLbE1qA== - dependencies: - object.assign "^4.1.0" - babel-plugin-dynamic-import-node@2.3.0, babel-plugin-dynamic-import-node@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" @@ -5789,31 +5859,15 @@ babel-plugin-dynamic-import-node@2.3.0, babel-plugin-dynamic-import-node@^2.3.0: dependencies: object.assign "^4.1.0" -babel-plugin-emotion@^10.0.14: - version "10.0.15" - resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-10.0.15.tgz#2ce5bea191331ef65b3b9ae212a8f0e46ff97616" - integrity sha512-E3W68Zk8EcKpRUDW2tsFKi4gsavapMRjfr2/KKgG3l7l2zZpiKk0BxB59Ul9C0w0ekv6my/ylGOk2WroaqKXPw== +babel-plugin-emotion@^10.0.20, babel-plugin-emotion@^10.0.27: + version "10.0.29" + resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-10.0.29.tgz#89d8e497091fcd3d10331f097f1471e4cc3f35b4" + integrity sha512-7Jpi1OCxjyz0k163lKtqP+LHMg5z3S6A7vMBfHnF06l2unmtsOmFDzZBpGf0CWo1G4m8UACfVcDJiSiRuu/cSw== dependencies: "@babel/helper-module-imports" "^7.0.0" - "@emotion/hash" "0.7.2" - "@emotion/memoize" "0.7.2" - "@emotion/serialize" "^0.11.9" - babel-plugin-macros "^2.0.0" - babel-plugin-syntax-jsx "^6.18.0" - convert-source-map "^1.5.0" - escape-string-regexp "^1.0.5" - find-root "^1.1.0" - source-map "^0.5.7" - -babel-plugin-emotion@^10.0.17: - version "10.0.19" - resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-10.0.19.tgz#67b9b213f7505c015f163a387a005c12c502b1de" - integrity sha512-1pJb5uKN/gx6bi3gGr588Krj49sxARI9KmxhtMUa+NRJb6lR3OfC51mh3NlWRsOqdjWlT4cSjnZpnFq5K3T5ZA== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@emotion/hash" "0.7.3" - "@emotion/memoize" "0.7.3" - "@emotion/serialize" "^0.11.11" + "@emotion/hash" "0.8.0" + "@emotion/memoize" "0.7.4" + "@emotion/serialize" "^0.11.16" babel-plugin-macros "^2.0.0" babel-plugin-syntax-jsx "^6.18.0" convert-source-map "^1.5.0" @@ -5838,15 +5892,6 @@ babel-plugin-jest-hoist@^24.9.0: dependencies: "@types/babel__traverse" "^7.0.6" -babel-plugin-macros@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.5.1.tgz#4a119ac2c2e19b458c259b9accd7ee34fd57ec6f" - integrity sha512-xN3KhAxPzsJ6OQTktCanNpIFnnMsCV+t8OloKxIL72D6+SUZYFn9qfklPgef5HyyDtzYZqqb+fs1S12+gQY82Q== - dependencies: - "@babel/runtime" "^7.4.2" - cosmiconfig "^5.2.0" - resolve "^1.10.0" - babel-plugin-macros@2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.7.1.tgz#ee294383c1a38f9d6535be3d89734824cb3ed415" @@ -5856,7 +5901,7 @@ babel-plugin-macros@2.7.1: cosmiconfig "^6.0.0" resolve "^1.12.0" -babel-plugin-macros@^2.0.0, babel-plugin-macros@^2.4.5: +babel-plugin-macros@^2.0.0: version "2.6.1" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.6.1.tgz#41f7ead616fc36f6a93180e89697f69f51671181" integrity sha512-6W2nwiXme6j1n2erPOnmRiWfObUhWH7Qw1LMi9XZy8cj+KtESu3T6asZvtk5bMQQjX8te35o7CFueiSdL/2NmQ== @@ -5865,6 +5910,15 @@ babel-plugin-macros@^2.0.0, babel-plugin-macros@^2.4.5: cosmiconfig "^5.2.0" resolve "^1.10.0" +babel-plugin-macros@^2.7.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" + integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== + dependencies: + "@babel/runtime" "^7.7.2" + cosmiconfig "^6.0.0" + resolve "^1.12.0" + babel-plugin-minify-builtins@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz#31eb82ed1a0d0efdc31312f93b6e4741ce82c36b" @@ -5949,15 +6003,20 @@ babel-plugin-named-asset-import@^0.3.5: resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.5.tgz#d3fa1a7f1f4babd4ed0785b75e2f926df0d70d0d" integrity sha512-sGhfINU+AuMw9oFAdIn/nD5sem3pn/WgxAfDZ//Q3CnF+5uaho7C7shh2rKLk6sKE/XkfmyibghocwKdVjLIKg== -babel-plugin-react-docgen@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-react-docgen/-/babel-plugin-react-docgen-3.1.0.tgz#14b02b363a38cc9e08c871df16960d27ef92030f" - integrity sha512-W6xqZnZIWjZuE9IjP7XolxxgFGB5Y9GZk4cLPSWKa10MrT86q7bX4ke9jbrNhFVIRhbmzL8wE1Sn++mIWoJLbw== +babel-plugin-react-docgen@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-react-docgen/-/babel-plugin-react-docgen-4.1.0.tgz#1dfa447dac9ca32d625a123df5733a9e47287c26" + integrity sha512-vzpnBlfGv8XOhJM2zbPyyqw2OLEbelgZZsaaRRTpVwNKuYuc+pUg4+dy7i9gCRms0uOQn4osX571HRcCJMJCmA== dependencies: - lodash "^4.17.11" - react-docgen "^4.1.0" + lodash "^4.17.15" + react-docgen "^5.0.0" recast "^0.14.7" +babel-plugin-require-context-hook@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-require-context-hook/-/babel-plugin-require-context-hook-1.0.0.tgz#3f0e7cce87c338f53639b948632fd4e73834632d" + integrity sha512-EMZD1563QUqLhzrqcThk759RhuNVX/ZJdrtGK6drwzgvnR+ARjWyXIHPbu+tUNaMGtPz/gQeAM2M6VUw2UiUeA== + babel-plugin-syntax-jsx@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" @@ -6077,30 +6136,6 @@ babel-preset-jest@^24.9.0: babel-plugin-transform-undefined-to-void "^6.9.4" lodash.isplainobject "^4.0.6" -babel-preset-react-app@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-9.0.0.tgz#703108142bc9dd7173bde6a1a0138a762abc76f9" - integrity sha512-YVsDA8HpAKklhFLJtl9+AgaxrDaor8gGvDFlsg1ByOS0IPGUovumdv4/gJiAnLcDmZmKlH6+9sVOz4NVW7emAg== - dependencies: - "@babel/core" "7.4.3" - "@babel/plugin-proposal-class-properties" "7.4.0" - "@babel/plugin-proposal-decorators" "7.4.0" - "@babel/plugin-proposal-object-rest-spread" "7.4.3" - "@babel/plugin-syntax-dynamic-import" "7.2.0" - "@babel/plugin-transform-classes" "7.4.3" - "@babel/plugin-transform-destructuring" "7.4.3" - "@babel/plugin-transform-flow-strip-types" "7.4.0" - "@babel/plugin-transform-react-constant-elements" "7.2.0" - "@babel/plugin-transform-react-display-name" "7.2.0" - "@babel/plugin-transform-runtime" "7.4.3" - "@babel/preset-env" "7.4.3" - "@babel/preset-react" "7.0.0" - "@babel/preset-typescript" "7.3.3" - "@babel/runtime" "7.4.3" - babel-plugin-dynamic-import-node "2.2.0" - babel-plugin-macros "2.5.1" - babel-plugin-transform-react-remove-prop-types "0.4.24" - babel-preset-react-app@^9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-9.1.0.tgz#74c644d809f098d4b131646730c7bed0696084ca" @@ -6126,7 +6161,7 @@ babel-preset-react-app@^9.1.0: babel-plugin-macros "2.7.1" babel-plugin-transform-react-remove-prop-types "0.4.24" -babel-runtime@^6.18.0, babel-runtime@^6.26.0: +babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= @@ -6330,21 +6365,7 @@ boxen@^1.2.1: term-size "^1.2.0" widest-line "^2.0.0" -boxen@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-3.2.0.tgz#fbdff0de93636ab4450886b6ff45b92d098f45eb" - integrity sha512-cU4J/+NodM3IHdSL2yN8bqYqnmlBTidDR4RC7nJs61ZmtGz8VZzM3HLQX0zY5mrSmPtR3xWwsq2jOUQqFZN8+A== - dependencies: - ansi-align "^3.0.0" - camelcase "^5.3.1" - chalk "^2.4.2" - cli-boxes "^2.2.0" - string-width "^3.0.0" - term-size "^1.2.0" - type-fest "^0.3.0" - widest-line "^2.0.0" - -boxen@^4.2.0: +boxen@^4.1.0, boxen@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== @@ -6382,7 +6403,7 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.2: +braces@^3.0.1, braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -6470,7 +6491,7 @@ browserslist@4.5.4: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.4.tgz#166c4ecef3b51737a42436ea8002aeea466ea2c7" integrity sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag== dependencies: - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000955" electron-to-chromium "^1.3.122" node-releases "^1.1.13" @@ -6479,16 +6500,16 @@ browserslist@4.7.3: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.3.tgz#02341f162b6bcc1e1028e30624815d4924442dc3" integrity sha512-jWvmhqYpx+9EZm/FxcZSbUZyDEvDTLDi3nSAKbzEkyWvtI0mNSmUosey+5awDW1RUlrgXbQb5A6qY1xQH9U6MQ== dependencies: - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30001010" electron-to-chromium "^1.3.306" node-releases "^1.1.40" -browserslist@^4.0.0, browserslist@^4.5.2, browserslist@^4.6.0, browserslist@^4.6.2, browserslist@^4.6.3: +browserslist@^4.0.0, browserslist@^4.6.0, browserslist@^4.6.2, browserslist@^4.6.3: version "4.6.6" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== dependencies: - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000984" electron-to-chromium "^1.3.191" node-releases "^1.1.25" @@ -6497,10 +6518,19 @@ browserslist@^4.6.4: resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" integrity sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA== dependencies: - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000989" electron-to-chromium "^1.3.247" node-releases "^1.1.29" +browserslist@^4.8.3: + version "4.9.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.9.1.tgz#01ffb9ca31a1aef7678128fc6a2253316aa7287c" + integrity sha512-Q0DnKq20End3raFulq6Vfp1ecB9fh8yUNV55s8sekaDDeqBaCtWlRHCUdaWyUeSSBJM7IbM6HcsyaeYqgeDhnw== + dependencies: + caniuse-lite "^1.0.30001030" + electron-to-chromium "^1.3.363" + node-releases "^1.1.50" + bser@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" @@ -6797,11 +6827,16 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001022: +caniuse-lite@^1.0.0: version "1.0.30001022" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001022.tgz#9eeffe580c3a8f110b7b1742dcf06a395885e4c6" integrity sha512-FjwPPtt/I07KyLPkBQ0g7/XuZg6oUkYBVnPHNj3VHJbOjmmJ/GdSo/GUY6MwINEQvjhP6WZVbX8Tvms8xh0D5A== +caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000980, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30000984, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001010, caniuse-lite@^1.0.30001020, caniuse-lite@^1.0.30001030: + version "1.0.30001035" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001035.tgz#2bb53b8aa4716b2ed08e088d4dc816a5fe089a1e" + integrity sha512-C1ZxgkuA4/bUEdMbU5WrGY4+UhMFFiXrgNAfxiMIqWgFTWfv/xsZCS2xEHT2LMq7xAZfuAnu6mcqyDl0ZR6wLQ== + canvg@1.5.3: version "1.5.3" resolved "https://registry.yarnpkg.com/canvg/-/canvg-1.5.3.tgz#aad17915f33368bf8eb80b25d129e3ae922ddc5f" @@ -7720,7 +7755,7 @@ copy-to-clipboard@^3.0.8: dependencies: toggle-selection "^1.0.6" -core-js-compat@^3.0.0, core-js-compat@^3.1.1: +core-js-compat@^3.1.1: version "3.1.4" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.1.4.tgz#e4d0c40fbd01e65b1d457980fe4112d4358a7408" integrity sha512-Z5zbO9f1d0YrJdoaQhphVAnKPimX92D6z8lCGphH89MNRxlL1prI9ExJPqVwP0/kgkQCv8c4GJGT8X16yUncOg== @@ -8274,6 +8309,13 @@ debug@3.1.0, debug@=3.1.0: dependencies: ms "2.0.0" +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + debug@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" @@ -8288,13 +8330,6 @@ debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5, debug@^3.2.6: dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -8553,6 +8588,11 @@ diff-sequences@^24.9.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== +diff-sequences@^25.1.0: + version "25.1.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.1.0.tgz#fd29a46f1c913fd66c22645dc75bffbe43051f32" + integrity sha512-nFIfVk5B/NStCsJ+zaPO4vYuLjlzQ6uFvPxzYyHlejNZ/UGa7G/n7peOXVrVNvRuyfstt+mZQYGpjxg9Z6N8Kw== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -8639,13 +8679,6 @@ dom-converter@^0.2: dependencies: utila "~0.4" -dom-helpers@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.4.0.tgz#e9b369700f959f62ecde5a6babde4bccd9169af8" - integrity sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA== - dependencies: - "@babel/runtime" "^7.1.2" - dom-helpers@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.1.0.tgz#57a726de04abcc2a8bbfe664b3e21c584bde514e" @@ -8829,10 +8862,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -ejs@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.6.2.tgz#3a32c63d1cd16d11266cd4703b14fec4e74ab4f6" - integrity sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q== +ejs@^2.7.4: + version "2.7.4" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" + integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== electron-to-chromium@^1.3.122, electron-to-chromium@^1.3.191: version "1.3.215" @@ -8849,6 +8882,11 @@ electron-to-chromium@^1.3.306: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.322.tgz#a6f7e1c79025c2b05838e8e344f6e89eb83213a8" integrity sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA== +electron-to-chromium@^1.3.363: + version "1.3.376" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.376.tgz#7cb7b5205564a06c8f8ecfbe832cbd47a1224bb1" + integrity sha512-cv/PYVz5szeMz192ngilmezyPNFkUjuynuL2vNdiqIrio440nfTDdc0JJU0TS2KHLSVCs9gBbt4CFqM+HcBnjw== + elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" @@ -8889,13 +8927,13 @@ emojis-list@^2.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= -emotion-theming@^10.0.14: - version "10.0.19" - resolved "https://registry.yarnpkg.com/emotion-theming/-/emotion-theming-10.0.19.tgz#66d13db74fccaefad71ba57c915b306cf2250295" - integrity sha512-dQRBPLAAQ6eA8JKhkLCIWC8fdjPbiNC1zNTdFF292h9amhZXofcNGUP7axHoHX4XesqQESYwZrXp53OPInMrKw== +emotion-theming@^10.0.19: + version "10.0.27" + resolved "https://registry.yarnpkg.com/emotion-theming/-/emotion-theming-10.0.27.tgz#1887baaec15199862c89b1b984b79806f2b9ab10" + integrity sha512-MlF1yu/gYh8u+sLUqA0YuA9JX0P4Hb69WlKc/9OLo+WCXuX6sy/KoIa+qJimgmr2dWqnypYKYPX37esjDBbhdw== dependencies: "@babel/runtime" "^7.5.5" - "@emotion/weak-memoize" "0.2.4" + "@emotion/weak-memoize" "0.2.5" hoist-non-react-statics "^3.3.0" encodeurl@~1.0.2: @@ -8984,6 +9022,23 @@ es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13 is-regex "^1.0.4" object-keys "^1.0.12" +es-abstract@^1.17.0, es-abstract@^1.17.0-next.1: + version "1.17.4" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184" + integrity sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.1.5" + is-regex "^1.0.5" + object-inspect "^1.7.0" + object-keys "^1.1.1" + object.assign "^4.1.0" + string.prototype.trimleft "^2.1.1" + string.prototype.trimright "^2.1.1" + es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" @@ -8993,6 +9048,15 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + es5-ext@^0.10.35, es5-ext@^0.10.45, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.51, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: version "0.10.51" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.51.tgz#ed2d7d9d48a12df86e0299287e93a09ff478842f" @@ -9102,7 +9166,7 @@ es6-weak-map@^2.0.1, es6-weak-map@^2.0.2: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -escape-html@^1.0.3, escape-html@~1.0.3: +escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= @@ -9378,7 +9442,7 @@ eslint@^3.7.1: text-table "~0.2.0" user-home "^2.0.0" -eslint@^6.6.0, eslint@^6: +eslint@^6, eslint@^6.6.0: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" integrity sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig== @@ -9893,7 +9957,7 @@ file-entry-cache@^5.0.1: dependencies: flat-cache "^2.0.1" -file-loader@4.3.0: +file-loader@4.3.0, file-loader@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-4.3.0.tgz#780f040f729b3d18019f20605f723e844b8a58af" integrity sha512-aKrYPYjF1yG3oX0kWRrqrSMfgftm7oJW5M+m4owoldH5C51C0RkIwB++JbRvEW3IU6/ZG5n8UvEcdgwOt2UOWA== @@ -9901,14 +9965,6 @@ file-loader@4.3.0: loader-utils "^1.2.3" schema-utils "^2.5.0" -file-loader@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-3.0.1.tgz#f8e0ba0b599918b51adfe45d66d1e771ad560faa" - integrity sha512-4sNIOXgtH/9WZq4NvlfU3Opn5ynUsqBwSLyM+I7UOwdGigTBYfVVQEwe/msZNX/j4pCJTIM14Fsw66Svo1oVrw== - dependencies: - loader-utils "^1.0.2" - schema-utils "^1.0.0" - file-saver@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-2.0.2.tgz#06d6e728a9ea2df2cce2f8d9e84dfcdc338ec17a" @@ -9996,6 +10052,15 @@ find-cache-dir@^3.0.0: make-dir "^3.0.0" pkg-dir "^4.1.0" +find-cache-dir@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + find-root@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -10165,10 +10230,10 @@ fn-name@~2.0.1: resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" integrity sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc= -focus-lock@^0.6.3: - version "0.6.5" - resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-0.6.5.tgz#f6eb37832a9b1b205406175f5277396a28c0fce1" - integrity sha512-i/mVBOoa9o+tl+u9owOJUF8k8L85odZNIsctB+JAK2HFT8jckiBwmk+3uydlm6FN8czgnkIwQtBv6yyAbrzXjw== +focus-lock@^0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-0.6.6.tgz#98119a755a38cfdbeda0280eaa77e307eee850c7" + integrity sha512-Dx69IXGCq1qsUExWuG+5wkiMqVM/zGx/reXSJSLogECwp3x6KeNQZ+NAetgxEFpnC41rD8U3+jRCW68+LNzdtw== follow-redirects@1.5.10: version "1.5.10" @@ -10408,10 +10473,10 @@ functions-have-names@^1.1.1: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.1.1.tgz#79d35927f07b8e7103d819fed475b64ccf7225ea" integrity sha512-U0kNHUoxwPNPWOJaMG7Z00d4a/qZVrFtzWJRaK8V9goaVOCXBSQSJpt3MYGNtkScKEBKovxLjnNdC9MlXwo5Pw== -fuse.js@^3.4.4: - version "3.4.5" - resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.4.5.tgz#8954fb43f9729bd5dbcb8c08f251db552595a7a6" - integrity sha512-s9PGTaQIkT69HaeoTVjwGsLfb8V8ScJLx5XGFcKHg0MqLUH/UZ4EKOtqtXX9k7AFqCGxD1aJmYb8Q5VYDibVRQ== +fuse.js@^3.4.6: + version "3.6.1" + resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.6.1.tgz#7de85fdd6e1b3377c23ce010892656385fd9b10c" + integrity sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw== fx-runner@1.0.11: version "1.0.11" @@ -10494,6 +10559,11 @@ genfun@^5.0.0: resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== +gensync@^1.0.0-beta.1: + version "1.0.0-beta.1" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" + integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== + get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" @@ -10629,6 +10699,21 @@ github-url-from-git@^1.5.0: resolved "https://registry.yarnpkg.com/github-url-from-git/-/github-url-from-git-1.5.0.tgz#f985fedcc0a9aa579dc88d7aff068d55cc6251a0" integrity sha1-+YX+3MCpqledyI16/waNVcxiUaA= +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= + dependencies: + is-glob "^2.0.0" + glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -10728,7 +10813,7 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" -global@^4.3.2: +global@^4.3.2, global@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== @@ -11036,6 +11121,11 @@ has-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= +has-symbols@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -11125,10 +11215,10 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== -highlight.js@~9.12.0: - version "9.12.0" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e" - integrity sha1-5tnb5Xy+/mB1HwKvM2GVhwyQwB4= +highlight.js@~9.13.0: + version "9.13.1" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.13.1.tgz#054586d53a6863311168488a0f58d6c505ce641e" + integrity sha512-Sc28JNQNDzaH6PORtRLMvif9RSn1mYuOoX3omVjnb0+HbpPygU2ALBI0R/wsiqCb4/fcp07Gdo8g+fhtFrQl6A== history@^4.7.2, history@^4.9.0: version "4.9.0" @@ -11385,6 +11475,14 @@ https-proxy-agent@^3.0.0: agent-base "^4.3.0" debug "^3.1.0" +https-proxy-agent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" + integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== + dependencies: + agent-base "5" + debug "4" + humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -11724,11 +11822,25 @@ internal-ip@^4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" -interpret@^1.0.0, interpret@^1.2.0: +internal-slot@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.2.tgz#9c2e9fb3cd8e5e4256c6f45fe310067fcfa378a3" + integrity sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g== + dependencies: + es-abstract "^1.17.0-next.1" + has "^1.0.3" + side-channel "^1.0.2" + +interpret@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== +interpret@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.0.0.tgz#b783ffac0b8371503e9ab39561df223286aa5433" + integrity sha512-e0/LknJ8wpMMhTiWcjivB+ESwIuvHnBSlBbmP/pSb8CQJldoj1p2qv7xGZ/+BtbTziYRFSz8OsvdbiX45LtYQA== + invariant@2.2.4, invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -11854,6 +11966,11 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== +is-callable@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" + integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== + is-ci@^1.0.10: version "1.2.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" @@ -11947,6 +12064,11 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= + is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -11986,6 +12108,13 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== +is-glob@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= + dependencies: + is-extglob "^1.0.0" + is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -12175,6 +12304,13 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-regex@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" + integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== + dependencies: + has "^1.0.3" + is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" @@ -12248,6 +12384,13 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.0" +is-symbol@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== + dependencies: + has-symbols "^1.0.1" + is-text-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-2.0.0.tgz#b2484e2b720a633feb2e85b67dc193ff72c75636" @@ -12472,6 +12615,16 @@ jest-config@^24.9.0: pretty-format "^24.9.0" realpath-native "^1.1.0" +jest-diff@^24.3.0, jest-diff@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" + integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== + dependencies: + chalk "^2.0.1" + diff-sequences "^24.9.0" + jest-get-type "^24.9.0" + pretty-format "^24.9.0" + jest-diff@^24.8.0: version "24.8.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" @@ -12482,15 +12635,15 @@ jest-diff@^24.8.0: jest-get-type "^24.8.0" pretty-format "^24.8.0" -jest-diff@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" - integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== +jest-diff@^25.1.0: + version "25.1.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.1.0.tgz#58b827e63edea1bc80c1de952b80cec9ac50e1ad" + integrity sha512-nepXgajT+h017APJTreSieh4zCqnSHEJ1iT8HDlewu630lSJ4Kjjr9KNzm+kzGwwcpsDE6Snx1GJGzzsefaEHw== dependencies: - chalk "^2.0.1" - diff-sequences "^24.9.0" - jest-get-type "^24.9.0" - pretty-format "^24.9.0" + chalk "^3.0.0" + diff-sequences "^25.1.0" + jest-get-type "^25.1.0" + pretty-format "^25.1.0" jest-docblock@^24.3.0: version "24.3.0" @@ -12552,6 +12705,11 @@ jest-get-type@^24.9.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== +jest-get-type@^25.1.0: + version "25.1.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.1.0.tgz#1cfe5fc34f148dc3a8a3b7275f6b9ce9e2e8a876" + integrity sha512-yWkBnT+5tMr8ANB6V+OjmrIJufHtCAqI5ic2H40v+tRqxDmE0PGnIiTyvRWFOMtmVHYpwRqyazDbTnhpjsGvLw== + jest-haste-map@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" @@ -12915,6 +13073,14 @@ jest-worker@^24.9.0: merge-stream "^2.0.0" supports-color "^6.1.0" +jest-worker@^25.1.0: + version "25.1.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.1.0.tgz#75d038bad6fdf58eba0d2ec1835856c497e3907a" + integrity sha512-ZHhHtlxOWSxCoNOKHGbiLzXnl42ga9CxDr27H36Qn+15pQZd3R/F24jrmjDelw9j/iHUIWMWs08/u2QN50HHOg== + dependencies: + merge-stream "^2.0.0" + supports-color "^7.0.0" + jest@24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest/-/jest-24.9.0.tgz#987d290c05a08b52c56188c1002e368edb007171" @@ -13157,6 +13323,13 @@ json5@^2.1.0: dependencies: minimist "^1.2.0" +json5@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" + integrity sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ== + dependencies: + minimist "^1.2.0" + jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -13948,7 +14121,7 @@ lodash.zip@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" integrity sha1-7GZi5IlkCO1KtsVCo5kLcswIACA= -"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.0.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.8.0, lodash@~4.17.2: +"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.8.0, lodash@~4.17.2: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -14023,13 +14196,13 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== -lowlight@~1.9.1: - version "1.9.2" - resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.9.2.tgz#0b9127e3cec2c3021b7795dd81005c709a42fdd1" - integrity sha512-Ek18ElVCf/wF/jEm1b92gTnigh94CtBNWiZ2ad+vTgW7cTmQxUY3I98BjHK68gZAJEWmybGBZgx9qv3QxLQB/Q== +lowlight@~1.11.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.11.0.tgz#1304d83005126d4e8b1dc0f07981e9b689ec2efc" + integrity sha512-xrGGN6XLL7MbTMdPD6NfWPwY43SNkjf/d0mecSx/CW36fUZTjRHEq0/Cdug3TWKtRXLWi7iMl1eP0olYxj/a4A== dependencies: fault "^1.0.2" - highlight.js "~9.12.0" + highlight.js "~9.13.0" lru-cache@^4.0.1: version "4.1.5" @@ -14090,6 +14263,13 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" +make-dir@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392" + integrity sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w== + dependencies: + semver "^6.0.0" + make-fetch-happen@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.0.tgz#a8e3fe41d3415dd656fe7b8e8172e1fb4458b38d" @@ -14190,11 +14370,6 @@ matcher@^1.0.0: dependencies: escape-string-regexp "^1.0.4" -material-colors@^1.2.1: - version "1.2.6" - resolved "https://registry.yarnpkg.com/material-colors/-/material-colors-1.2.6.tgz#6d1958871126992ceecc72f4bcc4d8f010865f46" - integrity sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg== - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -14256,11 +14431,6 @@ memdown@^5.0.0: ltgt "~2.2.0" safe-buffer "~5.2.0" -memoize-one@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.1.1.tgz#047b6e3199b508eaec03504de71229b8eb1d75c0" - integrity sha512-HKeeBpWvqiVJD57ZUAsJNm71eHTykffzcLZVYWiVfQeI1rJtuEaS7hQiEpWfVVk18donPwJEcFKIkCmPJNOhHA== - memoizee@^0.4.14: version "0.4.14" resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.14.tgz#07a00f204699f9a95c2d9e77218271c7cd610d57" @@ -14396,6 +14566,14 @@ micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -14409,6 +14587,11 @@ mime-db@1.40.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== +mime-db@1.43.0: + version "1.43.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" + integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== + "mime-db@>= 1.40.0 < 2": version "1.41.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.41.0.tgz#9110408e1f6aa1b34aef51f2c9df3caddf46b6a0" @@ -14421,6 +14604,13 @@ mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.17, mime-types@~2.1.19, dependencies: mime-db "1.40.0" +mime-types@^2.1.25: + version "2.1.26" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" + integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== + dependencies: + mime-db "1.43.0" + mime@1.6.0, mime@^1.4.1: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" @@ -14453,6 +14643,11 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" +min-indent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.0.tgz#cfc45c37e9ec0d8f0a0ec3dd4ef7f7c3abe39256" + integrity sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY= + mini-create-react-context@^0.3.0: version "0.3.2" resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz#79fc598f283dd623da8e088b05db8cddab250189" @@ -14975,6 +15170,13 @@ node-releases@^1.1.40: dependencies: semver "^6.3.0" +node-releases@^1.1.50: + version "1.1.52" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.52.tgz#bcffee3e0a758e92e44ecfaecd0a47554b0bcba9" + integrity sha512-snSiT1UypkgGt2wxPqS6ImEUICbNCMb31yaxWrOLXjhlt2z2/IBpaOxzONExqSm4y5oLnAqjjRWu+wsDzK5yNQ== + dependencies: + semver "^6.3.0" + "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -15229,7 +15431,12 @@ object-hash@^1.3.1: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df" integrity sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA== -object-keys@^1.0.11, object-keys@^1.0.12: +object-inspect@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== + +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -15553,6 +15760,13 @@ p-limit@^2.0.0, p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.2.tgz#61279b67721f5287aa1c13a9a7fbbc48c9291b1e" + integrity sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ== + dependencies: + p-try "^2.0.0" + p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" @@ -15919,6 +16133,11 @@ picomatch@^2.0.4: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== +picomatch@^2.0.5: + version "2.2.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.1.tgz#21bac888b6ed8601f831ce7816e335bc779f0a4a" + integrity sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA== + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -16036,13 +16255,6 @@ pn@^1.1.0: resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== -pnp-webpack-plugin@1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.4.3.tgz#0a100b63f4a1d09cee6ee55a87393b69f03ab5c7" - integrity sha512-ExrNwuFH3DudHwWY2uRMqyiCOBEDdhQYHIAsqW/CM6hIZlSgXC/ma/p08FoNOUhVyh9hl1NGnMpR94T5i3SHaQ== - dependencies: - ts-pnp "^1.1.2" - pnp-webpack-plugin@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.5.0.tgz#62a1cd3068f46d564bb33c56eb250e4d586676eb" @@ -16570,7 +16782,7 @@ postcss-preset-env@6.7.0: dependencies: autoprefixer "^9.6.1" browserslist "^4.6.4" - caniuse-lite "^1.0.30001022" + caniuse-lite "^1.0.30000981" css-blank-pseudo "^0.1.4" css-has-pseudo "^0.10.0" css-prefers-color-scheme "^3.1.1" @@ -16720,6 +16932,11 @@ postcss-value-parser@^4.0.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.1.tgz#e3f6172cc91302912c89da55a42454025485250f" integrity sha512-3Jk+/CVH0HBfgSSFWALKm9Hyzf4kumPjZfUxkRYZNcqFztELb2APKxv0nlX8HCdc1/ymePmT/nFf1ST6fjWH2A== +postcss-value-parser@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz#651ff4593aa9eda8d5d0d66593a2417aeaeb325d" + integrity sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg== + postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz#da8b472d901da1e205b47bdc98637b9e9e550e5f" @@ -16774,6 +16991,15 @@ postcss@^7.0.16: source-map "^0.6.1" supports-color "^6.1.0" +postcss@^7.0.26: + version "7.0.27" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.27.tgz#cc67cdc6b0daa375105b7c424a85567345fc54d9" + integrity sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ== + dependencies: + chalk "^2.4.2" + source-map "^0.6.1" + supports-color "^6.1.0" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -16834,6 +17060,16 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" +pretty-format@^25.1.0: + version "25.1.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.1.0.tgz#ed869bdaec1356fc5ae45de045e2c8ec7b07b0c8" + integrity sha512-46zLRSGLd02Rp+Lhad9zzuNZ+swunitn8zIpfD2B4OPCRLXbM87RJT2aBLBWYOznNUML/2l/ReMyWNC80PJBUQ== + dependencies: + "@jest/types" "^25.1.0" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + pretty-hrtime@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" @@ -16846,7 +17082,7 @@ prismjs@^1.8.4, prismjs@~1.17.0: optionalDependencies: clipboard "^2.0.0" -private@^0.1.6, private@^0.1.8, private@~0.1.5: +private@^0.1.6, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== @@ -16952,7 +17188,7 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -17089,15 +17325,17 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -puppeteer@^1.13.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.19.0.tgz#e3b7b448c2c97933517078d7a2c53687361bebea" - integrity sha512-2S6E6ygpoqcECaagDbBopoSOPDv0pAZvTbnBgUY+6hq0/XDFDOLEMNlHF/SKJlzcaZ9ckiKjKDuueWI3FN/WXw== +puppeteer@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-2.1.1.tgz#ccde47c2a688f131883b50f2d697bd25189da27e" + integrity sha512-LWzaDVQkk1EPiuYeTOj+CZRIjda4k2s5w4MK4xoH2+kgWV/SDlkYHmxatDdtYrciHUKSXTsGgPgPP8ILVdBsxg== dependencies: + "@types/mime-types" "^2.1.0" debug "^4.1.0" extract-zip "^1.6.6" - https-proxy-agent "^2.2.1" + https-proxy-agent "^4.0.0" mime "^2.0.3" + mime-types "^2.1.25" progress "^2.0.1" proxy-from-env "^1.0.0" rimraf "^2.6.1" @@ -17156,7 +17394,7 @@ quick-lru@^1.0.0: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= -raf@^3.4.0, raf@^3.4.1: +raf@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== @@ -17208,13 +17446,13 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" -raw-loader@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-2.0.0.tgz#e2813d9e1e3f80d1bbade5ad082e809679e20c26" - integrity sha512-kZnO5MoIyrojfrPWqrhFNLZemIAX8edMOCp++yC5RKxzFB3m92DqKNhKlU6+FvpOhWtvyh3jOaD7J6/9tpdIKg== +raw-loader@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-3.1.0.tgz#5e9d399a5a222cc0de18f42c3bc5e49677532b3f" + integrity sha512-lzUVMuJ06HF4rYveaz9Tv0WRlUMxJ0Y1hgSkkgg+50iEdaI0TthyEDe08KIHb0XsF6rn8WYTqPCaGTZg3sX+qA== dependencies: loader-utils "^1.1.0" - schema-utils "^1.0.0" + schema-utils "^2.0.1" rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8: version "1.2.8" @@ -17238,25 +17476,13 @@ react-app-polyfill@^1.0.5: regenerator-runtime "^0.13.3" whatwg-fetch "^3.0.0" -react-clientside-effect@^1.2.0: +react-clientside-effect@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/react-clientside-effect/-/react-clientside-effect-1.2.2.tgz#6212fb0e07b204e714581dd51992603d1accc837" integrity sha512-nRmoyxeok5PBO6ytPvSjKp9xwXg9xagoTK1mMjwnQxqM9Hd7MNPl+LS1bOSOe+CV2+4fnEquc7H/S8QD3q697A== dependencies: "@babel/runtime" "^7.0.0" -react-color@^2.17.0: - version "2.17.3" - resolved "https://registry.yarnpkg.com/react-color/-/react-color-2.17.3.tgz#b8556d744f95193468c7061d2aa19180118d4a48" - integrity sha512-1dtO8LqAVotPIChlmo6kLtFS1FP89ll8/OiA8EcFRDR+ntcK+0ukJgByuIQHRtzvigf26dV5HklnxDIvhON9VQ== - dependencies: - "@icons/material" "^0.2.4" - lodash "^4.17.11" - material-colors "^1.2.1" - prop-types "^15.5.10" - reactcss "^1.2.0" - tinycolor2 "^1.4.1" - react-dev-utils@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-10.0.0.tgz#bd2d16426c7e4cbfed1b46fb9e2ac98ec06fcdfa" @@ -17318,18 +17544,19 @@ react-dev-utils@^9.0.0: strip-ansi "5.2.0" text-table "0.2.0" -react-docgen@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/react-docgen/-/react-docgen-4.1.1.tgz#8fef0212dbf14733e09edecef1de6b224d87219e" - integrity sha512-o1wdswIxbgJRI4pckskE7qumiFyqkbvCO++TylEDOo2RbMiueIOg8YzKU4X9++r0DjrbXePw/LHnh81GRBTWRw== +react-docgen@^5.0.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/react-docgen/-/react-docgen-5.3.0.tgz#9aabde5e69f1993c8ba839fd9a86696504654589" + integrity sha512-hUrv69k6nxazOuOmdGeOpC/ldiKy7Qj/UFpxaQi0eDMrUFUTIPGtY5HJu7BggSmiyAMfREaESbtBL9UzdQ+hyg== dependencies: - "@babel/core" "^7.0.0" - "@babel/runtime" "^7.0.0" - async "^2.1.4" + "@babel/core" "^7.7.5" + "@babel/runtime" "^7.7.6" + ast-types "^0.13.2" commander "^2.19.0" doctrine "^3.0.0" + neo-async "^2.6.1" node-dir "^0.1.10" - recast "^0.17.3" + strip-indent "^3.0.0" react-dom@^16.8.3, react-dom@^16.9.0: version "16.9.0" @@ -17341,10 +17568,10 @@ react-dom@^16.8.3, react-dom@^16.9.0: prop-types "^15.6.2" scheduler "^0.15.0" -react-draggable@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-3.3.2.tgz#966ef1d90f2387af3c2d8bd3516f601ea42ca359" - integrity sha512-oaz8a6enjbPtx5qb0oDWxtDNuybOylvto1QLydsXgKmwT7e3GXC2eMVDwEMIUYJIFqVG72XpOv673UuuAq6LhA== +react-draggable@^4.0.3: + version "4.2.0" + resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.2.0.tgz#40cc5209082ca7d613104bf6daf31372cc0e1114" + integrity sha512-5wFq//gEoeTYprnd4ze8GrFc+Rbnx+9RkOMR3vk4EbWxj02U6L6T3yrlKeiw4X5CtjD2ma2+b3WujghcXNRzkw== dependencies: classnames "^2.2.5" prop-types "^15.6.0" @@ -17371,15 +17598,17 @@ react-final-form-hooks@^2.0.1: dependencies: np "^5.0.1" -react-focus-lock@^1.18.3: - version "1.19.1" - resolved "https://registry.yarnpkg.com/react-focus-lock/-/react-focus-lock-1.19.1.tgz#2f3429793edaefe2d077121f973ce5a3c7a0651a" - integrity sha512-TPpfiack1/nF4uttySfpxPk4rGZTLXlaZl7ncZg/ELAk24Iq2B1UUaUioID8H8dneUXqznT83JTNDHDj+kwryw== +react-focus-lock@^2.1.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/react-focus-lock/-/react-focus-lock-2.2.1.tgz#1d12887416925dc53481914b7cedd39494a3b24a" + integrity sha512-47g0xYcCTZccdzKRGufepY8oZ3W1Qg+2hn6u9SHZ0zUB6uz/4K4xJe7yYFNZ1qT6m+2JDm82F6QgKeBTbjW4PQ== dependencies: "@babel/runtime" "^7.0.0" - focus-lock "^0.6.3" + focus-lock "^0.6.6" prop-types "^15.6.2" - react-clientside-effect "^1.2.0" + react-clientside-effect "^1.2.2" + use-callback-ref "^1.2.1" + use-sidecar "^1.0.1" react-helmet-async@^1.0.2: version "1.0.2" @@ -17392,29 +17621,27 @@ react-helmet-async@^1.0.2: react-fast-compare "2.0.4" shallowequal "1.1.0" -react-hotkeys@2.0.0-pre4: - version "2.0.0-pre4" - resolved "https://registry.yarnpkg.com/react-hotkeys/-/react-hotkeys-2.0.0-pre4.tgz#a1c248a51bdba4282c36bf3204f80d58abc73333" - integrity sha512-oa+UncSWyOwMK3GExt+oELXaR7T3ItgcMolsupQFdKvwkEhVAluJd5rYczsRSQpQlVkdNoHG46De2NUeuS+88Q== +react-hotkeys@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/react-hotkeys/-/react-hotkeys-2.0.0.tgz#a7719c7340cbba888b0e9184f806a9ec0ac2c53f" + integrity sha512-3n3OU8vLX/pfcJrR3xJ1zlww6KS1kEJt0Whxc4FiGV+MJrQ1mYSYI3qS/11d2MJDFm8IhOXMTFQirfu6AVOF6Q== dependencies: prop-types "^15.6.1" -react-input-autosize@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-2.2.1.tgz#ec428fa15b1592994fb5f9aa15bb1eb6baf420f8" - integrity sha512-3+K4CD13iE4lQQ2WlF8PuV5htfmTRLH6MDnfndHM6LuBRszuXnuyIfE7nhSKt8AzRBZ50bu0sAhkNMeS5pxQQA== - dependencies: - prop-types "^15.5.8" - -react-inspector@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/react-inspector/-/react-inspector-3.0.2.tgz#c530a06101f562475537e47df428e1d7aff16ed8" - integrity sha512-PSR8xDoGFN8R3LKmq1NT+hBBwhxjd9Qwz8yKY+5NXY/CHpxXHm01CVabxzI7zFwFav/M3JoC/Z0Ro2kSX6Ef2Q== +react-inspector@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/react-inspector/-/react-inspector-4.0.1.tgz#0f888f78ff7daccbc7be5d452b20c96dc6d5fbb8" + integrity sha512-xSiM6CE79JBqSj8Fzd9dWBHv57tLTH7OM57GP3VrE5crzVF3D5Khce9w1Xcw75OAbvrA0Mi2vBneR1OajKmXFg== dependencies: - babel-runtime "^6.26.0" + "@babel/runtime" "^7.6.3" is-dom "^1.0.9" prop-types "^15.6.1" +react-is@^16.12.0: + version "16.13.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.0.tgz#0f37c3613c34fe6b37cd7f763a0d6293ab15c527" + integrity sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA== + react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6: version "16.8.6" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" @@ -17546,22 +17773,6 @@ react-scripts@^3.3.0: optionalDependencies: fsevents "2.1.2" -react-select@^3.0.0: - version "3.0.5" - resolved "https://registry.yarnpkg.com/react-select/-/react-select-3.0.5.tgz#f2810e63fa8a6be375b3fa6f390284e9e33c9573" - integrity sha512-2tBXZ1XSqbk2boMUzSmKXwGl/6W46VkSMSLMy+ShccOVyD1kDTLPwLX7lugISkRMmL0v5BcLtriXOLfYwO0otw== - dependencies: - "@babel/runtime" "^7.4.4" - "@emotion/cache" "^10.0.9" - "@emotion/core" "^10.0.9" - "@emotion/css" "^10.0.9" - classnames "^2.2.5" - memoize-one "^5.0.0" - prop-types "^15.6.0" - raf "^3.4.0" - react-input-autosize "^2.2.1" - react-transition-group "^2.2.1" - react-sizeme@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/react-sizeme/-/react-sizeme-2.6.7.tgz#231339ce8821ac2c26424c791e0027f89dae3e90" @@ -17572,26 +17783,26 @@ react-sizeme@^2.6.7: shallowequal "^1.1.0" throttle-debounce "^2.1.0" -react-syntax-highlighter@^8.0.1: - version "8.1.0" - resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-8.1.0.tgz#59103ff17a828a27ed7c8f035ae2558f09b6b78c" - integrity sha512-G2bkZxmF3VOa4atEdXIDSfwwCqjw6ZQX5znfTaHcErA1WqHIS0o6DaSCDKFPVaOMXQEB9Hf1UySYQvuJmV8CXg== +react-syntax-highlighter@^11.0.2: + version "11.0.2" + resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-11.0.2.tgz#4e3f376e752b20d2f54e4c55652fd663149e4029" + integrity sha512-kqmpM2OH5OodInbEADKARwccwSQWBfZi0970l5Jhp4h39q9Q65C4frNcnd6uHE5pR00W8pOWj9HDRntj2G4Rww== dependencies: - babel-runtime "^6.18.0" - highlight.js "~9.12.0" - lowlight "~1.9.1" + "@babel/runtime" "^7.3.1" + highlight.js "~9.13.0" + lowlight "~1.11.0" prismjs "^1.8.4" refractor "^2.4.1" -react-test-renderer@^16.8.6: - version "16.8.6" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.8.6.tgz#188d8029b8c39c786f998aa3efd3ffe7642d5ba1" - integrity sha512-H2srzU5IWYT6cZXof6AhUcx/wEyJddQ8l7cLM/F7gDXYyPr4oq+vCIxJYXVGhId1J706sqziAjuOEjyNkfgoEw== +react-test-renderer@^16.13.0: + version "16.13.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.13.0.tgz#39ba3bf72cedc8210c3f81983f0bb061b14a3014" + integrity sha512-NQ2S9gdMUa7rgPGpKGyMcwl1d6D9MCF0lftdI3kts6kkiX+qvpC955jNjAZXlIDTjnN9jwFI8A8XhRh/9v0spA== dependencies: object-assign "^4.1.1" prop-types "^15.6.2" react-is "^16.8.6" - scheduler "^0.13.6" + scheduler "^0.19.0" react-textarea-autosize@^7.1.0: version "7.1.0" @@ -17601,16 +17812,6 @@ react-textarea-autosize@^7.1.0: "@babel/runtime" "^7.1.2" prop-types "^15.6.0" -react-transition-group@^2.2.1: - version "2.9.0" - resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d" - integrity sha512-+HzNTCHpeQyl4MJ/bdE0u6XRMe9+XG/+aL4mCxVN4DnPBQ0/5bfHWPDuOZUzYdMj94daZaZdCCc1Dzt9R/xSSg== - dependencies: - dom-helpers "^3.4.0" - loose-envify "^1.4.0" - prop-types "^15.6.2" - react-lifecycles-compat "^3.0.4" - react-transition-group@^4.0.0, react-transition-group@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.3.0.tgz#fea832e386cf8796c58b61874a3319704f5ce683" @@ -17630,13 +17831,6 @@ react@^16.8.3, react@^16.9.0: object-assign "^4.1.1" prop-types "^15.6.2" -reactcss@^1.2.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/reactcss/-/reactcss-1.2.3.tgz#c00013875e557b1cf0dfd9a368a1c3dab3b548dd" - integrity sha512-KiwVUcFu1RErkI97ywr8nvx8dNOpT03rbnma0SSalTYjkrPYaEajR4a/MRt6DZ46K6arDRbWMNHF+xH7G7n/8A== - dependencies: - lodash "^4.0.1" - read-cmd-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" @@ -17705,14 +17899,14 @@ read-pkg-up@^5.0.0: find-up "^3.0.0" read-pkg "^5.0.0" -read-pkg-up@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-6.0.0.tgz#da75ce72762f2fa1f20c5a40d4dd80c77db969e3" - integrity sha512-odtTvLl+EXo1eTsMnoUHRmg/XmXdTkwXVxy4VFE9Kp6cCq7b3l7QMdBndND3eAFzrbSAXC/WCUOQQ9rLjifKZw== +read-pkg-up@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== dependencies: - find-up "^4.0.0" - read-pkg "^5.1.1" - type-fest "^0.5.0" + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" read-pkg@^1.0.0: version "1.1.0" @@ -17750,7 +17944,7 @@ read-pkg@^4.0.1: parse-json "^4.0.0" pify "^3.0.0" -read-pkg@^5.0.0, read-pkg@^5.1.1: +read-pkg@^5.0.0, read-pkg@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== @@ -17858,16 +18052,6 @@ recast@^0.14.7: private "~0.1.5" source-map "~0.6.1" -recast@^0.17.3: - version "0.17.6" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.17.6.tgz#64ae98d0d2dfb10ff92ff5fb9ffb7371823b69fa" - integrity sha512-yoQRMRrK1lszNtbkGyM4kN45AwylV5hMiuEveUBlxytUViWevjvX6w+tzJt1LH4cfUhWt4NZvy3ThIhu6+m5wQ== - dependencies: - ast-types "0.12.4" - esprima "~4.0.0" - private "^0.1.8" - source-map "~0.6.1" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -17944,11 +18128,16 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.12.0, regenerator-runtime@^0.12.1: +regenerator-runtime@^0.12.0: version "0.12.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== +regenerator-runtime@^0.13.4: + version "0.13.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697" + integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== + regenerator-transform@^0.14.0: version "0.14.1" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.1.tgz#3b2fce4e1ab7732c08f665dfdb314749c7ddd2fb" @@ -17974,12 +18163,13 @@ regexp-tree@^0.1.6: resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.11.tgz#c9c7f00fcf722e0a56c7390983a7a63dd6c272f3" integrity sha512-7/l/DgapVVDzZobwMCCgMlqiqyLFJ0cduo/j+3BcDJIB+yJdsYCfKuI3l/04NV+H/rfNRdPIDbXNZHM9XvQatg== -regexp.prototype.flags@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz#6b30724e306a27833eeb171b66ac8890ba37e41c" - integrity sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA== +regexp.prototype.flags@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" + integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== dependencies: - define-properties "^1.1.2" + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" regexpp@^2.0.1: version "2.0.1" @@ -18154,10 +18344,10 @@ request@2.88.0, request@^2.55.0, request@^2.72.0, request@^2.74.0, request@^2.79 tunnel-agent "^0.6.0" uuid "^3.3.2" -require-context.macro@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/require-context.macro/-/require-context.macro-1.1.1.tgz#9b6023ddfc4b8046f55904da46a6a4afe9976bef" - integrity sha512-l1XH5HruDyG+Iwo5pz39EGbOFVtoYQt8cl7mJ6KJFWzARNJnpb+XUui+jBQUGlJ8SJOdx+QDh784e8b42PxLXA== +require-context.macro@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/require-context.macro/-/require-context.macro-1.2.2.tgz#84bc90f6b9c6dec3a840c84cfd6b2dd92884e34d" + integrity sha512-qibgUj+t0YeBAIsQSqgY3iwFrwQoAV7mmZmvdEpGwe1eAS7iunLpINsRYX/lyuHtJDeJdF7U92jXNzbuDeM2RA== dependencies: "@types/webpack-env" "^1.14.0" @@ -18562,14 +18752,6 @@ saxes@^3.1.9: dependencies: xmlchars "^2.1.1" -scheduler@^0.13.6: - version "0.13.6" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889" - integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler@^0.15.0: version "0.15.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.15.0.tgz#6bfcf80ff850b280fed4aeecc6513bc0b4f17f8e" @@ -18578,6 +18760,14 @@ scheduler@^0.15.0: loose-envify "^1.1.0" object-assign "^4.1.1" +scheduler@^0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.0.tgz#a715d56302de403df742f4a9be11975b32f5698d" + integrity sha512-xowbVaTPe9r7y7RUejcK73/j8tt2jfiyTednOvHbA8JoClvMYCp+r8QegLwK/n8zWQAtZb1fFnER4XLBZXrCxA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" @@ -18603,6 +18793,14 @@ schema-utils@^2.1.0, schema-utils@^2.2.0, schema-utils@^2.5.0: ajv "^6.10.2" ajv-keywords "^3.4.1" +schema-utils@^2.6.4: + version "2.6.5" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.5.tgz#c758f0a7e624263073d396e29cd40aa101152d8a" + integrity sha512-5KXuwKziQrTVHh8j/Uxz+QUbxkaLW9X/86NBlx/gnKgtsZA2GIVMUn17qWhRFwF8jdYb3Dig5hRO/W5mZqy6SQ== + dependencies: + ajv "^6.12.0" + ajv-keywords "^3.4.1" + scoped-regex@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/scoped-regex/-/scoped-regex-2.1.0.tgz#7b9be845d81fd9d21d1ec97c61a0b7cf86d2015f" @@ -18664,6 +18862,11 @@ semver@^5.0.1, semver@^5.0.3, semver@^5.1.0, semver@^5.5.0, semver@^5.6.0, semve resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.1.3.tgz#e4345ce73071c53f336445cfc19efb1c311df2a6" + integrity sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA== + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -18688,7 +18891,7 @@ send@0.17.1: range-parser "~1.2.1" statuses "~1.5.0" -serialize-javascript@^2.1.0, serialize-javascript@^2.1.1: +serialize-javascript@^2.1.0, serialize-javascript@^2.1.1, serialize-javascript@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== @@ -18860,6 +19063,14 @@ shx@^0.3.2: minimist "^1.2.0" shelljs "^0.8.1" +side-channel@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" + integrity sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA== + dependencies: + es-abstract "^1.17.0-next.1" + object-inspect "^1.7.0" + sign-addon@2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/sign-addon/-/sign-addon-2.0.5.tgz#bfb1033bd77436c2f7c49168c6ea794f65c01b44" @@ -19411,16 +19622,17 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string.prototype.matchall@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-3.0.1.tgz#5a9e0b64bcbeb336aa4814820237c2006985646d" - integrity sha512-NSiU0ILQr9PQ1SZmM1X327U5LsM+KfDTassJfqN1al1+0iNpKzmQ4BfXOJwRnTEqv8nKJ67mFpqRoPaGWwvy5A== +"string.prototype.matchall@^4.0.0 || ^3.0.1": + version "4.0.2" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.2.tgz#48bb510326fb9fdeb6a33ceaa81a6ea04ef7648e" + integrity sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg== dependencies: define-properties "^1.1.3" - es-abstract "^1.12.0" - function-bind "^1.1.1" - has-symbols "^1.0.0" - regexp.prototype.flags "^1.2.0" + es-abstract "^1.17.0" + has-symbols "^1.0.1" + internal-slot "^1.0.2" + regexp.prototype.flags "^1.3.0" + side-channel "^1.0.2" string.prototype.padend@^3.0.0: version "3.0.0" @@ -19440,6 +19652,22 @@ string.prototype.padstart@^3.0.0: es-abstract "^1.4.3" function-bind "^1.0.2" +string.prototype.trimleft@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" + integrity sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== + dependencies: + define-properties "^1.1.3" + function-bind "^1.1.1" + +string.prototype.trimright@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz#440314b15996c866ce8a0341894d45186200c5d9" + integrity sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== + dependencies: + define-properties "^1.1.3" + function-bind "^1.1.1" + string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -19553,6 +19781,13 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= +strip-indent@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" + integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== + dependencies: + min-indent "^1.0.0" + strip-json-comments@3.0.1, strip-json-comments@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" @@ -19580,13 +19815,13 @@ style-loader@1.0.0: loader-utils "^1.2.3" schema-utils "^2.0.1" -style-loader@^0.23.1: - version "0.23.1" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.23.1.tgz#cb9154606f3e771ab6c4ab637026a1049174d925" - integrity sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg== +style-loader@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.1.3.tgz#9e826e69c683c4d9bf9db924f85e9abb30d5e200" + integrity sha512-rlkH7X/22yuwFYK357fMN/BxYOorfnfq0eD7+vqlemSK4wEcejFF1dg4zxP0euBW8NrYx2WZzZ8PPFevr7D+Kw== dependencies: - loader-utils "^1.1.0" - schema-utils "^1.0.0" + loader-utils "^1.2.3" + schema-utils "^2.6.4" stylehacks@^4.0.0: version "4.0.3" @@ -19659,7 +19894,7 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" -supports-color@^7.1.0: +supports-color@^7.0.0, supports-color@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== @@ -19797,17 +20032,18 @@ tcp-port-used@^1.0.1: debug "4.1.0" is2 "2.0.1" -telejson@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/telejson/-/telejson-2.2.2.tgz#d61d721d21849a6e4070d547aab302a9bd22c720" - integrity sha512-YyNwnKY0ilabOwYgC/J754En1xOe5PBIUIw+C9e0+5HjVVcnQE5/gdu2yET2pmSbp5bxIDqYNjvndj2PUkIiYA== +telejson@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/telejson/-/telejson-3.3.0.tgz#6d814f3c0d254d5c4770085aad063e266b56ad03" + integrity sha512-er08AylQ+LEbDLp1GRezORZu5wKOHaBczF6oYJtgC3Idv10qZ8A3p6ffT+J5BzDKkV9MqBvu8HAKiIIOp6KJ2w== dependencies: - global "^4.3.2" + "@types/is-function" "^1.0.0" + global "^4.4.0" is-function "^1.0.1" is-regex "^1.0.4" - is-symbol "^1.0.2" - isobject "^3.0.1" - lodash "^4.17.11" + is-symbol "^1.0.3" + isobject "^4.0.0" + lodash "^4.17.15" memoizerific "^1.11.3" temp-dir@^1.0.0: @@ -19861,7 +20097,7 @@ terser-webpack-plugin@2.2.1: terser "^4.3.9" webpack-sources "^1.4.3" -terser-webpack-plugin@^1.2.4, terser-webpack-plugin@^1.4.1: +terser-webpack-plugin@^1.4.1: version "1.4.2" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.2.tgz#e23c0d554587d1f473bd0cf68627720e733890a4" integrity sha512-fdEb91kR2l+BVgES77N/NTXWZlpX6vX+pYPjnX5grcDYBF2CMnzJiXX4NNlna4l04lvCW39lZ+O/jSvUhHH/ew== @@ -19876,6 +20112,21 @@ terser-webpack-plugin@^1.2.4, terser-webpack-plugin@^1.4.1: webpack-sources "^1.4.0" worker-farm "^1.7.0" +terser-webpack-plugin@^2.1.2: + version "2.3.5" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-2.3.5.tgz#5ad971acce5c517440ba873ea4f09687de2f4a81" + integrity sha512-WlWksUoq+E4+JlJ+h+U+QUzXpcsMSSNXkDy9lBVkSqDn1w23Gg29L/ary9GeJVYCGiNJJX7LnVc4bwL1N3/g1w== + dependencies: + cacache "^13.0.1" + find-cache-dir "^3.2.0" + jest-worker "^25.1.0" + p-limit "^2.2.2" + schema-utils "^2.6.4" + serialize-javascript "^2.1.2" + source-map "^0.6.1" + terser "^4.4.3" + webpack-sources "^1.4.3" + terser@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/terser/-/terser-4.1.3.tgz#6074fbcf3517561c3272ea885f422c7a8c32d689" @@ -19894,6 +20145,15 @@ terser@^4.3.9: source-map "~0.6.1" source-map-support "~0.5.12" +terser@^4.4.3: + version "4.6.6" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.6.tgz#da2382e6cafbdf86205e82fb9a115bd664d54863" + integrity sha512-4lYPyeNmstjIIESr/ysHg2vUPRGf2tzF9z2yYwnowXVuVzLEamPN1Gfrz7f8I9uEPuHcbFlW4PLIAsJoxXyJ1g== + dependencies: + commander "^2.20.0" + source-map "~0.6.1" + source-map-support "~0.5.12" + test-exclude@^5.2.3: version "5.2.3" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" @@ -20011,11 +20271,6 @@ tiny-warning@^1.0.0, tiny-warning@^1.0.2: resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== -tinycolor2@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8" - integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g= - tlds@^1.203.0: version "1.203.1" resolved "https://registry.yarnpkg.com/tlds/-/tlds-1.203.1.tgz#4dc9b02f53de3315bc98b80665e13de3edfc1dfc" @@ -20194,6 +20449,11 @@ try-require@^1.0.0: resolved "https://registry.yarnpkg.com/try-require/-/try-require-1.2.1.tgz#34489a2cac0c09c1cc10ed91ba011594d4333be2" integrity sha1-NEiaLKwMCcHMEO2RugEVlNQzO+I= +ts-dedent@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-1.1.1.tgz#68fad040d7dbd53a90f545b450702340e17d18f3" + integrity sha512-UGTRZu1evMw4uTPyYF66/KFd22XiU+jMaIuHrkIHQ2GivAXVlLV0v/vHrpOuTRf9BmpNHi/SO7Vd0rLu0y57jg== + ts-pnp@1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.1.5.tgz#840e0739c89fce5f3abd9037bb091dbff16d9dec" @@ -20209,6 +20469,11 @@ tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== +tslib@^1.9.3: + version "1.11.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" + integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== + tsutils@^3.17.1: version "3.17.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" @@ -20250,11 +20515,6 @@ type-fest@^0.3.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== -type-fest@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.5.2.tgz#d6ef42a0356c6cd45f49485c3b6281fc148e48a2" - integrity sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw== - type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" @@ -20609,6 +20869,19 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" +use-callback-ref@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.2.1.tgz#898759ccb9e14be6c7a860abafa3ffbd826c89bb" + integrity sha512-C3nvxh0ZpaOxs9RCnWwAJ+7bJPwQI8LHF71LzbQ3BvzH5XkdtlkMadqElGevg5bYBDFip4sAnD4m06zAKebg1w== + +use-sidecar@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.0.2.tgz#e72f582a75842f7de4ef8becd6235a4720ad8af6" + integrity sha512-287RZny6m5KNMTb/Kq9gmjafi7lQL0YHO1lYolU6+tY1h9+Z3uCtkJJ3OSOq3INwYf2hBryCcDh4520AhJibMA== + dependencies: + detect-node "^2.0.4" + tslib "^1.9.3" + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" @@ -20945,6 +21218,13 @@ webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack- source-list-map "^2.0.0" source-map "~0.6.1" +webpack-virtual-modules@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.2.1.tgz#8ab73d4df0fd37ed27bb8d823bc60ea7266c8bf7" + integrity sha512-0PWBlxyt4uGDofooIEanWhhyBOHdd+lr7QpYNDLC7/yc5lqJT8zlc04MTIBnKj+c2BlQNNuwE5er/Tg4wowHzA== + dependencies: + debug "^3.0.0" + webpack@4.41.2: version "4.41.2" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.2.tgz#c34ec76daa3a8468c9b61a50336d8e3303dce74e" From 1eadd78413190b0f1eb9018750739271a32f2d07 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 18:17:48 +0200 Subject: [PATCH 193/204] Fix for https://github.com/babel/babel/issues/11212#issuecomment-595397823 --- packages/bierzo-wallet/package.json | 1 + packages/medulas-react-components/package.json | 1 + packages/sanes-browser-extension/package.json | 4 ++-- packages/sil-governance/package.json | 1 + packages/valdueza-storybook/package.json | 6 ++++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/bierzo-wallet/package.json b/packages/bierzo-wallet/package.json index fd34c715b..76c281dbd 100644 --- a/packages/bierzo-wallet/package.json +++ b/packages/bierzo-wallet/package.json @@ -65,6 +65,7 @@ }, "browserslist": [ ">0.2%", + "chrome 45", "not dead", "not ie <= 11", "not op_mini all" diff --git a/packages/medulas-react-components/package.json b/packages/medulas-react-components/package.json index b013b4e90..363be1b83 100644 --- a/packages/medulas-react-components/package.json +++ b/packages/medulas-react-components/package.json @@ -14,6 +14,7 @@ }, "browserslist": [ ">0.2%", + "chrome 45", "not dead", "not ie <= 11", "not op_mini all" diff --git a/packages/sanes-browser-extension/package.json b/packages/sanes-browser-extension/package.json index 09d9c51ad..e087068eb 100644 --- a/packages/sanes-browser-extension/package.json +++ b/packages/sanes-browser-extension/package.json @@ -36,6 +36,7 @@ }, "browserslist": [ ">0.2%", + "chrome 45", "not dead", "not ie <= 11", "not op_mini all" @@ -77,7 +78,6 @@ "@iov/browser-extension-react-scripts": "^3.3.0", "@types/levelup": "^3.1.0", "@types/memdown": "^3.0.0", - "clipboardy": "^2.1.0", - "puppeteer": "^1.13.0" + "clipboardy": "^2.1.0" } } diff --git a/packages/sil-governance/package.json b/packages/sil-governance/package.json index 888ef9f85..5e8a99a58 100644 --- a/packages/sil-governance/package.json +++ b/packages/sil-governance/package.json @@ -49,6 +49,7 @@ }, "browserslist": [ ">0.2%", + "chrome 45", "not dead", "not ie <= 11", "not op_mini all" diff --git a/packages/valdueza-storybook/package.json b/packages/valdueza-storybook/package.json index 496ef5acb..5e213ca8f 100644 --- a/packages/valdueza-storybook/package.json +++ b/packages/valdueza-storybook/package.json @@ -11,6 +11,7 @@ }, "browserslist": [ ">0.2%", + "chrome 45", "not dead", "not ie <= 11", "not op_mini all" @@ -24,7 +25,8 @@ }, "devDependencies": { "@iov/browser-extension-react-scripts": "^3.3.0", - "react-test-renderer": "^16.8.6", - "require-context.macro": "^1.0.4" + "react-test-renderer": "^16.13.0", + "react-dom": "^16.9.0", + "require-context.macro": "^1.2.2" } } From 7f53e781ae4d94848c1f663ef80234046e25d23a Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 18:18:18 +0200 Subject: [PATCH 194/204] Add key prop --- .../bierzo-wallet/src/components/AccountManage/index.tsx | 1 + .../account/manage/components/AssociatedNamesList.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/components/AccountManage/index.tsx b/packages/bierzo-wallet/src/components/AccountManage/index.tsx index 04b2aaefb..41bc3639c 100644 --- a/packages/bierzo-wallet/src/components/AccountManage/index.tsx +++ b/packages/bierzo-wallet/src/components/AccountManage/index.tsx @@ -70,6 +70,7 @@ export interface BwAccountWithChainName extends BwAccount { type AccountModuleMixedType = BwUsernameWithChainName | BwAccountWithChainName; interface Props { + readonly key?: string; readonly account: AccountModuleMixedType; readonly menuItems: readonly ActionMenuItem[]; readonly hideExpiration?: boolean; diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx index 9198fa42d..105f5b361 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx @@ -89,7 +89,13 @@ const AssociatedNamesList: React.FunctionComponent = ({ names, onRegister }; return ( - + ); })} From f8ef60c49e97224be81b4da9d5a97e6ab3b3a40c Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 18:23:55 +0200 Subject: [PATCH 195/204] Cast `jsonValue` to string --- .../src/routes/addresses/test/operateReceivePayment.ts | 10 +++++----- .../src/routes/balance/test/operateBalances.ts | 4 ++-- .../src/routes/payment/test/operatePayment.ts | 4 ++-- packages/bierzo-wallet/src/utils/test/e2e.ts | 2 +- .../src/routes/wallet/test/operateWallet.ts | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/addresses/test/operateReceivePayment.ts b/packages/bierzo-wallet/src/routes/addresses/test/operateReceivePayment.ts index 558587703..a16518730 100644 --- a/packages/bierzo-wallet/src/routes/addresses/test/operateReceivePayment.ts +++ b/packages/bierzo-wallet/src/routes/addresses/test/operateReceivePayment.ts @@ -13,8 +13,8 @@ export async function getAddressRow(page: Page, dataIndex: number): Promise { @@ -43,7 +43,7 @@ export async function getStarnames(page: Page): Promise { const starnameEls = await page.$$("h4"); const names: string[] = []; for (const el of starnameEls) { - names.push(await (await el.getProperty("textContent")).jsonValue()); + names.push((await (await el.getProperty("textContent")).jsonValue()) as string); } return names; @@ -57,7 +57,7 @@ export async function getLinkedAddresses(page: Page): Promise { const addressesRows = await page.$$("tr"); const addresses: string[] = []; for (const el of addressesRows) { - addresses.push(await (await el.getProperty("textContent")).jsonValue()); + addresses.push((await (await el.getProperty("textContent")).jsonValue()) as string); } addresses.splice(0, 1); diff --git a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts index a8f7b6a86..6da219d7b 100644 --- a/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts +++ b/packages/bierzo-wallet/src/routes/balance/test/operateBalances.ts @@ -27,7 +27,7 @@ export const getBalanceTextAtIndex = async ( index: number, ): Promise => { const property = await h5Elements[index].getProperty("textContent"); - return (await property.jsonValue()) || ""; + return ((await property.jsonValue()) as string) || ""; }; export function waitForAllBalances(page: Page): Promise { @@ -38,7 +38,7 @@ export function waitForAllBalances(page: Page): Promise { export const getAddressCreationPromptE2E = async (h6Elements: ElementHandle[]): Promise => { const index = mainMenuH6Elements + 2; - return (await (await h6Elements[index].getProperty("textContent")).jsonValue()) || ""; + return ((await (await h6Elements[index].getProperty("textContent")).jsonValue()) as string) || ""; }; export const registerPersonalizedAddress = async (browser: Browser, page: Page): Promise => { diff --git a/packages/bierzo-wallet/src/routes/payment/test/operatePayment.ts b/packages/bierzo-wallet/src/routes/payment/test/operatePayment.ts index e1ff276e8..886628d11 100644 --- a/packages/bierzo-wallet/src/routes/payment/test/operatePayment.ts +++ b/packages/bierzo-wallet/src/routes/payment/test/operatePayment.ts @@ -27,7 +27,7 @@ export async function getPaymentRequestData(page: Page, dataIndex: number): Prom throw new Error(`LI element with index: ${dataIndex} not found.`); } - return await (await element.getProperty("textContent")).jsonValue(); + return (await (await element.getProperty("textContent")).jsonValue()) as string; } export async function getInvalidAddressError(page: Page): Promise { @@ -36,5 +36,5 @@ export async function getInvalidAddressError(page: Page): Promise { throw new Error(`Validation error message was not found.`); } - return await (await validationError.getProperty("textContent")).jsonValue(); + return (await (await validationError.getProperty("textContent")).jsonValue()) as string; } diff --git a/packages/bierzo-wallet/src/utils/test/e2e.ts b/packages/bierzo-wallet/src/utils/test/e2e.ts index 884462b22..fa22af0c7 100644 --- a/packages/bierzo-wallet/src/utils/test/e2e.ts +++ b/packages/bierzo-wallet/src/utils/test/e2e.ts @@ -66,5 +66,5 @@ export async function getToastMessage(page: Page): Promise { const toastTextElement = await page.$("#toast-provider h6"); if (!toastTextElement) throw new Error("h6 element not found"); - return await (await toastTextElement.getProperty("textContent")).jsonValue(); + return (await (await toastTextElement.getProperty("textContent")).jsonValue()) as string; } diff --git a/packages/sanes-browser-extension/src/routes/wallet/test/operateWallet.ts b/packages/sanes-browser-extension/src/routes/wallet/test/operateWallet.ts index 2ed854eec..00c054406 100644 --- a/packages/sanes-browser-extension/src/routes/wallet/test/operateWallet.ts +++ b/packages/sanes-browser-extension/src/routes/wallet/test/operateWallet.ts @@ -23,5 +23,5 @@ export async function getBalanceAmount(page: Page): Promise { const balanceAmountElement = await page.$("h5"); if (!balanceAmountElement) throw new Error("h5 element not found"); - return await (await balanceAmountElement.getProperty("textContent")).jsonValue(); + return (await (await balanceAmountElement.getProperty("textContent")).jsonValue()) as string; } From 39b935611a0637752dd4dff0b3de22805250555b Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 18:24:28 +0200 Subject: [PATCH 196/204] Fix quotes --- packages/valdueza-storybook/.storybook/addons.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/valdueza-storybook/.storybook/addons.js b/packages/valdueza-storybook/.storybook/addons.js index 9e1b457ed..8bc3b7613 100644 --- a/packages/valdueza-storybook/.storybook/addons.js +++ b/packages/valdueza-storybook/.storybook/addons.js @@ -1,3 +1,3 @@ -import '@storybook/addon-actions/register'; -import '@storybook/addon-links/register'; -import '@storybook/addon-viewport/register'; +import "@storybook/addon-actions/register"; +import "@storybook/addon-links/register"; +import "@storybook/addon-viewport/register"; From a1b1106239af5ef407a63fa0f628cd7252f05907 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 18:24:56 +0200 Subject: [PATCH 197/204] Add create-react-app preset --- packages/valdueza-storybook/.storybook/presets.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/valdueza-storybook/.storybook/presets.js diff --git a/packages/valdueza-storybook/.storybook/presets.js b/packages/valdueza-storybook/.storybook/presets.js new file mode 100644 index 000000000..2c07847b5 --- /dev/null +++ b/packages/valdueza-storybook/.storybook/presets.js @@ -0,0 +1 @@ +module.exports = ["@storybook/preset-create-react-app"]; From 60085bd71761977054878f0442570d2215a8fa9b Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 18:25:39 +0200 Subject: [PATCH 198/204] Add `createNodMock` and `createPortal` mocks --- packages/valdueza-storybook/src/Storyshots.test.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/valdueza-storybook/src/Storyshots.test.js b/packages/valdueza-storybook/src/Storyshots.test.js index 2fdc03d29..d2b72defe 100644 --- a/packages/valdueza-storybook/src/Storyshots.test.js +++ b/packages/valdueza-storybook/src/Storyshots.test.js @@ -1,6 +1,16 @@ -import initStoryshots from '@storybook/addon-storyshots'; +import initStoryshots, { snapshotWithOptions } from "@storybook/addon-storyshots"; +import ReactDOM from "react-dom"; + +ReactDOM.createPortal = jest.fn(element => { + return element; +}); initStoryshots({ - framework: 'react', + test: snapshotWithOptions({ + createNodeMock: element => { + return document.createElement("div"); + }, + }), + framework: "react", storyKindRegex: /^((?!.*?Test disabled).)*$/, }); From accea92b9d8b3b9c615a4d341e7eaf85dbdb731e Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 18:25:59 +0200 Subject: [PATCH 199/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 2309 ++++++++++++++++- 1 file changed, 2303 insertions(+), 6 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index 60c9a51a6..dfbe5bbe8 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -1686,6 +1686,2138 @@ exports[`Storyshots Bierzo Wallet Terms 1`] = `
`; +exports[`Storyshots Bierzo Wallet/Account Manage Associated names list 1`] = ` +
+
+
+
+ + Create a new name +
+
+
+
+
+
+
+ Names associated with this starname +
+
+ arrow +
+
+
+
+
+
+
+
+
+

+ test1*iov +

+
+
+ Copy +
+
+
+
+
+ LINKED ADDRESSES +
+
+
+ Info +
+
+
+
+
+
+ Edit +
+
+ + + +
+
+
+
    +
  • +
    +
    +

    + Transfer name +

    +
    +
    +
  • +
  • +
    +
    +

    + Transfer it back to me +

    +
    +
    +
  • +
  • +
    +
    +

    + Delete name +

    +
    +
    +
  • +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ Blockchain + + Address + +
+ IOV Devnet + + tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 + +
+ Copy +
+
+ Lisk Devnet + + 1349293588603668134L + +
+ Copy +
+
+
+
+
+
+
+
+
+

+ test2*iov +

+
+
+ Copy +
+
+
+
+
+ LINKED ADDRESSES +
+
+
+ Info +
+
+
+
+
+
+ Edit +
+
+ + + +
+
+
+
    +
  • +
    +
    +

    + Transfer name +

    +
    +
    +
  • +
  • +
    +
    +

    + Transfer it back to me +

    +
    +
    +
  • +
  • +
    +
    +

    + Delete name +

    +
    +
    +
  • +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ Blockchain + + Address + +
+ IOV Devnet + + tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 + +
+ Copy +
+
+ Lisk Devnet + + 1349293588603668134L + +
+ Copy +
+
+
+
+
+
+
+
+
+

+ test3*iov +

+
+
+ Copy +
+
+
+
+
+ LINKED ADDRESSES +
+
+
+ Info +
+
+
+
+
+
+ Edit +
+
+ + + +
+
+
+
    +
  • +
    +
    +

    + Transfer name +

    +
    +
    +
  • +
  • +
    +
    +

    + Transfer it back to me +

    +
    +
    +
  • +
  • +
    +
    +

    + Delete name +

    +
    +
    +
  • +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ Blockchain + + Address + +
+ IOV Devnet + + tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 + +
+ Copy +
+
+ Lisk Devnet + + 1349293588603668134L + +
+ Copy +
+
+
+
+
+
+
+
+
+`; + +exports[`Storyshots Bierzo Wallet/Account Manage Manage iovname 1`] = ` +
+
+
+
+

+ test2*iov +

+
+
+ Copy +
+
+
+
+
+ LINKED ADDRESSES +
+
+
+ Info +
+
+
+
+
+
+ Edit +
+
+ + + +
+
+
+
    +
  • +
    +
    +

    + Renew +

    +
    +
    +
  • +
  • +
    +
    +

    + Transfer iovname +

    +
    +
    +
  • +
  • +
    +
    +

    + Delete iovname +

    +
    +
    +
  • +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ Blockchain + + Address + +
+ IOV Devnet + + tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 + +
+ Copy +
+
+ Lisk Devnet + + 1349293588603668134L + +
+ Copy +
+
+
+
+
+`; + +exports[`Storyshots Bierzo Wallet/Account Manage Manage name 1`] = ` +
+
+
+
+

+ test2*iov +

+
+
+ Copy +
+
+
+

+ Expires on + 3/16/2020 +

+
+
+
+
+ LINKED ADDRESSES +
+
+
+ Info +
+
+
+
+
+
+ Edit +
+
+ + + +
+
+
+
    +
  • +
    +
    +

    + Renew +

    +
    +
    +
  • +
  • +
    +
    +

    + Transfer iovname +

    +
    +
    +
  • +
  • +
    +
    +

    + Delete iovname +

    +
    +
    +
  • +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ Blockchain + + Address + +
+ IOV Devnet + + tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 + +
+ Copy +
+
+ Lisk Devnet + + 1349293588603668134L + +
+ Copy +
+
+
+
+
+`; + +exports[`Storyshots Bierzo Wallet/Account Manage Manage sample 1`] = ` +
+
+
+
+

+ test2*iov +

+
+
+ Copy +
+
+
+
+
+ LINKED ADDRESSES +
+
+
+ Info +
+
+
+
+
+
+ Edit +
+
+ + + +
+
+
+
    +
  • +
    +
    +

    + Renew +

    +
    +
    +
  • +
  • +
    +
    +

    + Transfer iovname +

    +
    +
    +
  • +
  • +
    +
    +

    + Delete iovname +

    +
    +
    +
  • +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ Blockchain + + Address + +
+ IOV Devnet + + tiov1dcg3fat5zrvw00xezzjk3jgedm7pg70y222af3 + +
+ Copy +
+
+ Lisk Devnet + + 1349293588603668134L + +
+ Copy +
+
+
+
+
+`; + exports[`Storyshots Bierzo Wallet/Addresses Addresses tab 1`] = `
Expires on - 3/27/2020 + 3/28/2020
Expires on - 3/27/2020 + 3/28/2020
Expires on - 3/27/2020 + 3/28/2020
Expires on - 3/27/2020 + 3/28/2020
Expires on - 3/27/2020 + 3/28/2020
Expires on - 3/27/2020 + 3/28/2020
`; +exports[`Storyshots Medulas React Components/components ActionMenu 1`] = ` +
+ + + +
+
+
+
    +
  • +
    +
    +

    + Renew +

    +
    +
    +
  • +
  • +
    +
    +

    + Transfer iovname +

    +
    +
    +
  • +
  • +
    +
    +

    + Delete iovname +

    +
    +
    +
  • +
+
+
+
+
+`; + exports[`Storyshots Medulas React Components/components Avatars 1`] = `
Date: Mon, 16 Mar 2020 19:05:07 +0200 Subject: [PATCH 200/204] Fix lint warnings --- .../manage/components/AssociatedNamesList.tsx | 3 +++ .../account/manage/components/IovnameForm.tsx | 13 ++++--------- .../routes/account/manage/components/NameForm.tsx | 11 ++--------- .../account/manage/components/StarnameForm.tsx | 3 +++ 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx index 105f5b361..4f3db0e7d 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/AssociatedNamesList.tsx @@ -24,8 +24,11 @@ const usePaper = makeStyles({ }); const menuItems: readonly ActionMenuItem[] = [ + // eslint-disable-next-line no-console { title: "Transfer name", action: () => console.log("Transfer name") }, + // eslint-disable-next-line no-console { title: "Transfer it back to me", action: () => console.log("Transfer it back to me") }, + // eslint-disable-next-line no-console { title: "Delete name", action: () => console.log("Delete name") }, ]; diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx index 6ddc5e776..46d6e1fff 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/IovnameForm.tsx @@ -3,19 +3,14 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwUsernameWithChainName } from "../../../../components/AccountManage"; -import { IOVNAME_EDIT_ROUTE, IOVNAME_REGISTER_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; - -function onRegisterUsername(): void { - history.push(IOVNAME_REGISTER_ROUTE); -} - -function onRegisterStarname(): void { - history.push(STARNAME_REGISTER_ROUTE); -} +import { IOVNAME_EDIT_ROUTE } from "../../../paths"; const menuItems: readonly ActionMenuItem[] = [ + // eslint-disable-next-line no-console { title: "Renew", action: () => console.log("Renew") }, + // eslint-disable-next-line no-console { title: "Transfer iovname", action: () => console.log("Transfer iovname") }, + // eslint-disable-next-line no-console { title: "Delete iovname", action: () => console.log("Delete iovname") }, ]; diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx index 8aab9689c..ddfc64ada 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/NameForm.tsx @@ -3,16 +3,9 @@ import * as React from "react"; import { history } from "../../.."; import AccountManage, { BwAccountWithChainName } from "../../../../components/AccountManage"; -import { IOVNAME_REGISTER_ROUTE, NAME_EDIT_ROUTE, STARNAME_REGISTER_ROUTE } from "../../../paths"; - -function onRegisterUsername(): void { - history.push(IOVNAME_REGISTER_ROUTE); -} - -function onRegisterStarname(): void { - history.push(STARNAME_REGISTER_ROUTE); -} +import { NAME_EDIT_ROUTE } from "../../../paths"; +// eslint-disable-next-line no-console const menuItems: readonly ActionMenuItem[] = [{ title: "Renew", action: () => console.log("Delete") }]; const NameAccountManage = (): JSX.Element => { diff --git a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx index d81122cc2..6a0272e72 100644 --- a/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx +++ b/packages/bierzo-wallet/src/routes/account/manage/components/StarnameForm.tsx @@ -9,8 +9,11 @@ import { NAME_EDIT_ROUTE, NAME_REGISTER_ROUTE } from "../../../paths"; import AssociatedNamesList from "./AssociatedNamesList"; const menuItems: readonly ActionMenuItem[] = [ + // eslint-disable-next-line no-console { title: "Renew", action: () => console.log("Renew") }, + // eslint-disable-next-line no-console { title: "Transfer starname", action: () => console.log("Transfer starname") }, + // eslint-disable-next-line no-console { title: "Delete starname", action: () => console.log("Delete starname") }, ]; From 486368402c85af81abc4b36e4029230ecec6f825 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 19:35:57 +0200 Subject: [PATCH 201/204] Update transactions time --- .../src/routes/transactions/index.stories.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index 84cb02bee..e678bde08 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -91,7 +91,7 @@ function makeExampleLiskTransactionId(): TransactionId { const incomingNewDomainTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:13:01.763Z"), original: { kind: "bns/register_domain", chainId: chainIdIov, @@ -111,7 +111,7 @@ const incomingNewDomainTransaction: ProcessedTx = { const incomingTransferDomainTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:07:01.763Z"), original: { kind: "bns/transfer_domain", chainId: chainIdIov, @@ -125,7 +125,7 @@ const incomingTransferDomainTransaction: ProcessedTx = { const incomingRenewDomainTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:08:01.763Z"), original: { kind: "bns/renew_domain", chainId: chainIdIov, @@ -138,7 +138,7 @@ const incomingRenewDomainTransaction: ProcessedTx = { const incomingDeleteDomainTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:14:01.763Z"), original: { kind: "bns/delete_domain", chainId: chainIdIov, @@ -181,7 +181,7 @@ const incomingRegisterAccountTransaction: ProcessedTx = { const incomingTransferAccountTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:09:01.763Z"), original: { kind: "bns/transfer_account", chainId: chainIdIov, @@ -196,7 +196,7 @@ const incomingTransferAccountTransaction: ProcessedTx = { const incomingReplaceAccountTargetsTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:15:01.763Z"), original: { kind: "bns/replace_account_targets", chainId: chainIdIov, @@ -224,7 +224,7 @@ const incomingReplaceAccountTargetsTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:10:01.763Z"), original: { kind: "bns/delete_account", chainId: chainIdIov, @@ -238,7 +238,7 @@ const incomingDeleteAccountTransaction: ProcessedTx = { const incomingDeleteAllAccountsTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:11:01.763Z"), original: { kind: "bns/delete_all_accounts", chainId: chainIdIov, @@ -251,7 +251,7 @@ const incomingDeleteAllAccountsTransaction: ProcessedTx = { const incomingRenewAccountTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:12:01.763Z"), original: { kind: "bns/renew_account", chainId: chainIdIov, @@ -265,7 +265,7 @@ const incomingRenewAccountTransaction: ProcessedTx = { const incomingAddAccountCertificateTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:03:01.763Z"), original: { kind: "bns/add_account_certificate", chainId: chainIdIov, @@ -280,7 +280,7 @@ const incomingAddAccountCertificateTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:04:01.763Z"), original: { kind: "bns/replace_account_msg_fees", chainId: chainIdIov, @@ -319,7 +319,7 @@ const incomingReplaceAccountMsgFeesTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:05:01.763Z"), original: { kind: "bns/delete_account_certificate", chainId: chainIdIov, @@ -334,7 +334,7 @@ const incomingDeleteAccountCertificateTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:06:01.763Z"), original: { kind: "bns/update_account_configuration", chainId: chainIdIov, From 2bbd2fc9e1ff3121015dc456e5a4737f0c848154 Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 19:37:15 +0200 Subject: [PATCH 202/204] Storybook snapshot update --- .../src/__snapshots__/Storyshots.test.js.snap | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap index dfbe5bbe8..19c5c8d9c 100644 --- a/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap +++ b/packages/valdueza-storybook/src/__snapshots__/Storyshots.test.js.snap @@ -8338,7 +8338,7 @@ Array [
- Delete certificate from account + Account targets update
- Starname registration + Starname deletion
- Starname renewal + Starname registration
- Starname deletion + Account renewal
- Account registration + All accounts deletion
- Account transfer + Account deletion
- Account targets update + Account transfer
- Account deletion + Starname renewal
- All accounts deletion + Starname transfer
- Account renewal + Account configuration update
- Add certificate to account + Delete certificate from account
- Starname transfer + Add certificate to account
- Account configuration update + Account registration
Date: Mon, 16 Mar 2020 21:09:09 +0200 Subject: [PATCH 203/204] Update TX time --- .../bierzo-wallet/src/routes/transactions/index.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx index e678bde08..819e06b48 100644 --- a/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx +++ b/packages/bierzo-wallet/src/routes/transactions/index.stories.tsx @@ -151,7 +151,7 @@ const incomingDeleteDomainTransaction: ProcessedTx = { const incomingRegisterAccountTransaction: ProcessedTx = { id: makeExampleIovTransactionId(), - time: new ReadonlyDate("2019-12-01T03:02:01.763Z"), + time: new ReadonlyDate("2019-12-01T03:01:41.763Z"), original: { kind: "bns/register_account", chainId: chainIdIov, From b57b673a9e7631ccb59de0485494e3e7c95fb42d Mon Sep 17 00:00:00 2001 From: Albert Andrejev Date: Mon, 16 Mar 2020 21:43:52 +0200 Subject: [PATCH 204/204] Rever puppeteer version --- package.json | 3 +- packages/sanes-browser-extension/package.json | 3 +- yarn.lock | 64 +++++-------------- 3 files changed, 19 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index 77486d7bf..565a22409 100644 --- a/package.json +++ b/package.json @@ -59,8 +59,7 @@ "@types/react-dom": "16.8.4", "@types/react-redux": "7.1.0", "@types/react-test-renderer": "^16.9.2", - "@types/puppeteer": "^2.0.1", - "puppeteer": "^2.1.1", + "@types/puppeteer": "^1.13.0", "eslint": "^6", "eslint-config-prettier": "^6.2.0", "eslint-plugin-prettier": "^3.0.1", diff --git a/packages/sanes-browser-extension/package.json b/packages/sanes-browser-extension/package.json index e087068eb..cd1061834 100644 --- a/packages/sanes-browser-extension/package.json +++ b/packages/sanes-browser-extension/package.json @@ -78,6 +78,7 @@ "@iov/browser-extension-react-scripts": "^3.3.0", "@types/levelup": "^3.1.0", "@types/memdown": "^3.0.0", - "clipboardy": "^2.1.0" + "clipboardy": "^2.1.0", + "puppeteer": "^1.13.0" } } diff --git a/yarn.lock b/yarn.lock index f5d3a7e2e..eecf3c5fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4409,11 +4409,6 @@ dependencies: "@types/abstract-leveldown" "*" -"@types/mime-types@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.0.tgz#9ca52cda363f699c69466c2a6ccdaad913ea7a73" - integrity sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM= - "@types/mime@*": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" @@ -4464,10 +4459,10 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6" integrity sha512-CFzn9idOEpHrgdw8JsoTkaDDyRWk1jrzIV8djzcgpq0y9tG4B4lFT+Nxh52DVpDXV+n4+NPNv7M1Dj5uMp6XFg== -"@types/puppeteer@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-2.0.1.tgz#83a1d7f0a1c2e0edbbb488b4d8fb54b14ec9d455" - integrity sha512-G8vEyU83Bios+dzs+DZGpAirDmMqRhfFBJCkFrg+A5+6n5EPPHxwBLImJto3qjh0mrBXbLBCyuahhhtTrAfR5g== +"@types/puppeteer@^1.13.0": + version "1.20.4" + resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-1.20.4.tgz#30cb0a4ee5394c420119cbdf9f079d6595a07f67" + integrity sha512-T/kFgyLnYWk0H94hxI0HbOLnqHvzBRpfS0F0oo9ESGI24oiC2fEjDcMbBjuK3wH7VLsaIsp740vVXVzR1dsMNg== dependencies: "@types/node" "*" @@ -5110,11 +5105,6 @@ agent-base@4, agent-base@^4.3.0: dependencies: es6-promisify "^5.0.0" -agent-base@5: - version "5.1.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" - integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g== - agent-base@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" @@ -8309,13 +8299,6 @@ debug@3.1.0, debug@=3.1.0: dependencies: ms "2.0.0" -debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - debug@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" @@ -8330,6 +8313,13 @@ debug@^3.0.0, debug@^3.1.0, debug@^3.1.1, debug@^3.2.5, debug@^3.2.6: dependencies: ms "^2.1.1" +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -11475,14 +11465,6 @@ https-proxy-agent@^3.0.0: agent-base "^4.3.0" debug "^3.1.0" -https-proxy-agent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" - integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== - dependencies: - agent-base "5" - debug "4" - humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" @@ -14587,11 +14569,6 @@ mime-db@1.40.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== -mime-db@1.43.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" - integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== - "mime-db@>= 1.40.0 < 2": version "1.41.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.41.0.tgz#9110408e1f6aa1b34aef51f2c9df3caddf46b6a0" @@ -14604,13 +14581,6 @@ mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.17, mime-types@~2.1.19, dependencies: mime-db "1.40.0" -mime-types@^2.1.25: - version "2.1.26" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" - integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== - dependencies: - mime-db "1.43.0" - mime@1.6.0, mime@^1.4.1: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" @@ -17325,17 +17295,15 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -puppeteer@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-2.1.1.tgz#ccde47c2a688f131883b50f2d697bd25189da27e" - integrity sha512-LWzaDVQkk1EPiuYeTOj+CZRIjda4k2s5w4MK4xoH2+kgWV/SDlkYHmxatDdtYrciHUKSXTsGgPgPP8ILVdBsxg== +puppeteer@^1.13.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.20.0.tgz#e3d267786f74e1d87cf2d15acc59177f471bbe38" + integrity sha512-bt48RDBy2eIwZPrkgbcwHtb51mj2nKvHOPMaSH2IsWiv7lOG9k9zhaRzpDZafrk05ajMc3cu+lSQYYOfH2DkVQ== dependencies: - "@types/mime-types" "^2.1.0" debug "^4.1.0" extract-zip "^1.6.6" - https-proxy-agent "^4.0.0" + https-proxy-agent "^2.2.1" mime "^2.0.3" - mime-types "^2.1.25" progress "^2.0.1" proxy-from-env "^1.0.0" rimraf "^2.6.1"