@@ -8,9 +8,9 @@ import { RequiredInput, InnerLabel } from '../components/Base'
88import StatelessTransaction from '../components/StatelessTransaction'
99import { BRIDGE_ERROR } from '../lib/error'
1010import { ROUTE_NAMES } from '../lib/router'
11−import { attemptSeedDerivation } from '../lib/keys'
12−
11+import { attemptSeedDerivation, genKey } from '../lib/keys'
1312
13+import saveAs from 'file-saver'
1414
1515import { WALLET_NAMES } from '../lib/wallet'
1616
@@ -236,14 +236,35 @@ class SetKeys extends React.Component {
236236 })
237237 }
238238
239+ downloadKeyfile(networkSeed) {
240+ const { pointCache } = this.props
241+ const { pointCursor } = this.props
242+
243+ const point = pointCursor.matchWith({
244+ Just: (pt) => pt.value,
245+ Nothing: () => {
246+ throw BRIDGE_ERROR.MISSING_POINT
247+ }
248+ })
249+
250+ const pointDetails =
251+ point in pointCache
252+ ? pointCache[point]
253+ : (() => { throw BRIDGE_ERROR.MISSING_POINT })()
239254
255+ const revision = parseInt(pointDetails.keyRevisionNumber)
256+ const keyfile = genKey(networkSeed, point, revision)
257+ let blob = new Blob([keyfile], {type:"text/plain;charset=utf-8"});
258+ saveAs(blob, `${ob.patp(point).slice(1)}-${revision}.key`)
259+ }
240260
241261 handleSubmit(){
242262 const { props, state } = this
243263 sendSignedTransaction(props.web3.value, state.stx)
244264 .then(sent => {
245− props.setTxnHashCursor(sent)
246265 props.setNetworkSeedCache(this.state.networkSeed)
266+ this.downloadKeyfile(this.state.networkSeed)
267+ props.setTxnHashCursor(sent)
247268 props.popRoute()
248269 props.pushRoute(ROUTE_NAMES.SENT_TRANSACTION)
249270 })
@@ -333,15 +354,7 @@ class SetKeys extends React.Component {
333354
334355 <P>
335356 {
336− `Please enter a network seed for generating and setting your public
337− network authentication and encryption keys. Your network seed
338− must be a string of 64 characters (containing 0-9, A-Z, a-z).`
339− }
340− </P>
341− <P>
342− {
343− `If you've authenticated with a master ticket or management proxy
344− mnemonic, a seed will be generated for you automatically.`
357+ `Set new authentication and encryption keys for your Arvo ship. Once the transaction is sent, a keyfile will be downloaded, enabling you to instantiate your ship on the network.`
345358 }
346359 </P>
347360