@@ -52,13 +52,38 @@ const WALLET_STATES = {
54const TRANSACTION_STATES = {
54const TRANSACTION_STATES = {
55− GENERATING: 'Generating transactions',
56+ label: 'Generating transactions',
56− SIGNING: 'Signing transactions',
60+ label: 'Signing transactions',
57− FUNDING: 'Funding transactions',
61+ pct: "15%"
64+ label: 'Funding invite wallet',
58− CLAIMING: 'Claiming invite',
68+ label: 'Claiming invite',
72+ label: 'Funding recipient wallet',
59− CONFIGURING: 'Configuring planet',
76+ label: 'Configuring planet',
60− CLEANING: 'Cleaning up',
79+ CLEANING: {
80+ label: 'Cleaning up',
61− DONE: 'Done'
83+ DONE: {
64async function generateWallet(point) {
89async function generateWallet(point) {
@@ -198,7 +223,7 @@ async function startTransactions(args) {
198 let rawTransferStx = '0x'+transferStx.serialize().toString('hex');
223 let rawTransferStx = '0x'+transferStx.serialize().toString('hex');
200 const transferCost = transferTx.gas * transferTx.gasPrice;
225 const transferCost = transferTx.gas * transferTx.gasPrice;
201− await ensureFundsFor(web3, point, inviteAddress, transferCost, [rawTransferStx], updateProgress);
226+ await ensureFundsFor(web3, point, inviteAddress, transferCost, [rawTransferStx], updateProgress, true);
203 // send transaction
228 // send transaction
204 updateProgress(TRANSACTION_STATES.CLAIMING);
229 updateProgress(TRANSACTION_STATES.CLAIMING);
@@ -258,7 +283,7 @@ async function startTransactions(args) {
258 return '0x'+stx.serialize().toString('hex');
283 return '0x'+stx.serialize().toString('hex');
261− await ensureFundsFor(web3, point, newAddress, totalCost, rawStxs, updateProgress);
286+ await ensureFundsFor(web3, point, newAddress, totalCost, rawStxs, updateProgress, false);
263 updateProgress(TRANSACTION_STATES.CONFIGURING);
288 updateProgress(TRANSACTION_STATES.CONFIGURING);
264 await sendAndAwaitConfirm(web3, rawStxs);
289 await sendAndAwaitConfirm(web3, rawStxs);
@@ -294,8 +319,10 @@ async function startTransactions(args) {
294 //TODO forward to "all done!" screen
319 //TODO forward to "all done!" screen
297−async function ensureFundsFor(web3, point, address, cost, signedTxs, updateProgress) {
322+async function ensureFundsFor(web3, point, address, cost, signedTxs, updateProgress, firstTx) {
298− updateProgress(TRANSACTION_STATES.FUNDING);
323+ let fundingState = firstTx? TRANSACTION_STATES.FUNDING_INVITE : TRANSACTION_STATES.FUNDING_RECIPIENT
325+ updateProgress(fundingState);
299 let balance = await web3.eth.getBalance(address);
326 let balance = await web3.eth.getBalance(address);
301 if (cost > balance) {
328 if (cost > balance) {