@@ -2,6 +2,7 @@ import React, { useState } from 'react';
2import { Grid, Text } from 'indigo-react';
2import { Grid, Text } from 'indigo-react';
4import { useLocalRouter } from 'lib/LocalRouter';
4import { useLocalRouter } from 'lib/LocalRouter';
5+import { COMMANDS, useFlowCommand } from 'lib/flowCommand';
6import View from 'components/View';
7import View from 'components/View';
7import Highlighted from 'components/Highlighted';
8import Highlighted from 'components/Highlighted';
@@ -23,6 +24,7 @@ import { composeValidator, buildPsbtValidator } from 'form/validators';
23export default function SignTransaction() {
24export default function SignTransaction() {
24 const { pop } = useLocalRouter();
25 const { pop } = useLocalRouter();
25 const { urbitWallet } = useWallet();
26 const { urbitWallet } = useWallet();
27+ const flow = useFlowCommand();
27 const [signedTx, setSignedTx] = useState('');
29 const [signedTx, setSignedTx] = useState('');
28 const [psbt, setPsbt] = useState({});
30 const [psbt, setPsbt] = useState({});
@@ -64,13 +66,21 @@ export default function SignTransaction() {
64 setSignedTx(hex);
66 setSignedTx(hex);
69+ const initialValues = {};
70+ if (COMMANDS.BITCOIN === flow.kind) {
71+ initialValues.unsignedTransaction = flow.utx;
68 <View pop={pop} inset>
75 <View pop={pop} inset>
69 <Grid className="mt4">
76 <Grid className="mt4">
70 <Grid.Item full className="mt4" as={Text}>
77 <Grid.Item full className="mt4" as={Text}>
71 Paste unsigned transactions from Landscape here
78 Paste unsigned transactions from Landscape here
72 </Grid.Item>
79 </Grid.Item>
73− <BridgeForm validate={validate} onSubmit={onSubmit}>
81+ validate={validate}
82+ initialValues={initialValues}
74 {({ handleSubmit }) => (
84 {({ handleSubmit }) => (
76 <Grid.Item
86 <Grid.Item