@@ -33,6 +33,7 @@ class Ticket extends React.Component {
33 this.state = {
33 this.state = {
34 ticket: '',
34 ticket: '',
35 pointName: '',
35 pointName: '',
36 isUnlocking: false
37 isUnlocking: false
@@ -40,6 +41,7 @@ class Ticket extends React.Component {
40 this.ticketPlaceholder = placeholder(8)
41 this.ticketPlaceholder = placeholder(8)
42 this.handleTicketInput = this.handleTicketInput.bind(this)
43 this.handleTicketInput = this.handleTicketInput.bind(this)
44+ this.handlePassphraseInput = this.handlePassphraseInput.bind(this)
43 this.handlePointNameInput = this.handlePointNameInput.bind(this)
45 this.handlePointNameInput = this.handlePointNameInput.bind(this)
@@ -47,19 +49,17 @@ class Ticket extends React.Component {
47 this.setState({ ticket })
49 this.setState({ ticket })
52+ handlePassphraseInput(passphrase) {
53+ this.setState({ passphrase })
50 handlePointNameInput(pointName) {
56 handlePointNameInput(pointName) {
51 if (pointName.length < 15) {
57 if (pointName.length < 15) {
52 this.setState({ pointName })
58 this.setState({ pointName })
56− // buttonTriState = (wallet) => {
57− // if (wallet.isNothing()) return 'blue'
58− // if (wallet === false) return 'yellow'
59− // if (Maybe.Nothing.hasInstance(wallet)) return 'green'
62− async walletFromTicket(ticket, pointName) {
62+ async walletFromTicket(ticket, pointName, passphrase) {
63 const { setWallet, setUrbitWallet } = this.props
63 const { setWallet, setUrbitWallet } = this.props
65 this.setState({
65 this.setState({
@@ -68,10 +68,11 @@ class Ticket extends React.Component {
69 const urbitWallet = await kg.generateWallet({
69 const urbitWallet = await kg.generateWallet({
70 ticket: ticket,
70 ticket: ticket,
71− ship: ob.patp2dec(pointName)
71+ ship: ob.patp2dec(pointName),
72+ passphrase: passphrase
73 const mnemonic = urbitWallet.ownership.seed
74 const mnemonic = urbitWallet.ownership.seed
74− const wallet = walletFromMnemonic(mnemonic, DEFAULT_HD_PATH)
75+ const wallet = walletFromMnemonic(mnemonic, DEFAULT_HD_PATH, passphrase)
75 setWallet(wallet)
76 setWallet(wallet)
76 setUrbitWallet(Just(urbitWallet))
77 setUrbitWallet(Just(urbitWallet))
@@ -82,7 +83,7 @@ class Ticket extends React.Component {
83 render() {
84 render() {
84 const { popRoute, pushRoute, wallet } = this.props
85 const { popRoute, pushRoute, wallet } = this.props
85− const { ticket, pointName } = this.state
86+ const { ticket, pointName, passphrase } = this.state
87 const phPoint = this.pointPlaceholder
88 const phPoint = this.pointPlaceholder
88 const phTick = this.ticketPlaceholder
89 const phTick = this.ticketPlaceholder
@@ -126,12 +127,29 @@ class Ticket extends React.Component {
126 <InnerLabel>{ 'Ticket' }</InnerLabel>
127 <InnerLabel>{ 'Ticket' }</InnerLabel>
127 </TicketInput>
128 </TicketInput>
131+ { 'If your wallet requires a passphrase, you may enter it below.' }
137+ prop-format='innerLabel'
140+ value={ passphrase }
142+ onChange={ this.handlePassphraseInput }>
143+ <InnerLabel>{'Passphrase'}</InnerLabel>
130 className={'mt-8'}
147 className={'mt-8'}
131 prop-size={'lg wide'}
148 prop-size={'lg wide'}
132 disabled={this.state.isUnlocking || Just.hasInstance(wallet)}
149 disabled={this.state.isUnlocking || Just.hasInstance(wallet)}
133− // prop-color={this.buttonTriState(wallet)}
150+ onClick={
134− onClick={() => this.walletFromTicket(ticket, pointName)}>
151+ () => this.walletFromTicket(ticket, pointName, passphrase)
136 <span className="relative">
154 <span className="relative">
137 {this.state.isUnlocking &&
155 {this.state.isUnlocking &&