@@ -1,7 +1,6 @@
11import React, { useCallback, useMemo } from 'react';
22import { AccessoryIcon, useForm } from 'indigo-react';
33import { identity } from 'lodash';
4−import * as bip39 from 'bip39';
54
65import { DEFAULT_HD_PATH } from 'lib/wallet';
76import {
@@ -22,8 +21,14 @@ import { prependSig, convertToNumber } from 'lib/transformers';
2221
2322import InputSigil from 'components/InputSigil';
2423
25−const EXAMPLE_PRIVATE_KEY =
26− '0xa44de2416ee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
24+const PLACEHOLDER_POINT = '~sampel-ponnym';
25+const PLACEHOLDER_HD_PATH = DEFAULT_HD_PATH;
26+const PLACEHOLDER_MNEMONIC =
27+ 'example crew supreme gesture quantum web media hazard theory mercy wing kitten';
28+const PLACEHOLDER_TICKET = '~sampel-ticlyt-migfun-falmel';
29+const PLACEHOLDER_ADDRESS = '0x12345abcdeDB11D175F123F6891AA64F01c24F7d';
30+const PLACEHOLDER_PRIVATE_KEY =
31+ '0x12345abcdee6beb2f323fab48b432925c9785808d33a6ca6d7ba00b45e9370c3';
2732
2833// pulls out the first input from a useForm() call
2934function useFirstOf({ inputs, setValue, ...rest }, mapper = identity) {
@@ -71,7 +76,7 @@ export function useHexInput({ length, ...rest }) {
7176 {
7277 type: 'text', // or password
7378 autoComplete: 'off',
74− placeholder: `e.g. ${EXAMPLE_PRIVATE_KEY}`,
79+ placeholder: PLACEHOLDER_PRIVATE_KEY,
7580 validators: useMemo(
7681 () => [
7782 validateHexString,
@@ -86,15 +91,14 @@ export function useHexInput({ length, ...rest }) {
8691 );
8792}
8893
89−const kExampleMnemonic = bip39.generateMnemonic();
9094const kMnemonicValidators = [validateMnemonic, validateNotEmpty];
9195export function useMnemonicInput(props) {
9296 return useFirstOf(
9397 useForm([
9498 {
95− type: 'text',
99+ type: 'textarea',
96100 autoComplete: 'off',
97− placeholder: `e.g. ${kExampleMnemonic}`,
101+ placeholder: PLACEHOLDER_MNEMONIC,
98102 validators: kMnemonicValidators,
99103 ...props,
100104 },
@@ -108,7 +112,7 @@ export function useHdPathInput(props) {
108112 {
109113 type: 'text',
110114 autoComplete: 'off',
111− placeholder: `e.g. ${DEFAULT_HD_PATH}`,
115+ placeholder: PLACEHOLDER_HD_PATH,
112116 ...props,
113117 },
114118 ])
@@ -124,7 +128,7 @@ export function useTicketInput({ validators = [], deriving = false, ...rest }) {
124128 {
125129 type: 'password',
126130 label: 'Ticket',
127− placeholder: 'e.g. ~ragtyd-modwen-bostec-hinsep',
131+ placeholder: PLACEHOLDER_TICKET,
128132 validators: useMemo(() => [...validators, ...kTicketValidators], [
129133 validators,
130134 ]),
@@ -162,7 +166,7 @@ export function usePointInput({ size = 4, validators = [], ...rest }) {
162166 {
163167 type: 'text',
164168 label: 'Point',
165− placeholder: 'e.g. ~zod',
169+ placeholder: PLACEHOLDER_POINT,
166170 validators: _validators,
167171 transformers: kPointTransformers,
168172 mono: true,
@@ -236,7 +240,7 @@ export function useAddressInput({ ...rest }) {
236240 {
237241 type: 'string',
238242 label: 'Ethereum Address',
239− placeholder: 'e.g. 0x6DEfFb0caFDB11D175F123F6891AA64F01c24F7d',
243+ placeholder: PLACEHOLDER_ADDRESS,
240244 autoComplete: 'off',
241245 validators: kAddressValidators,
242246 mono: true,