@@ -1,14 +1,10 @@
11import { Just, Nothing } from 'folktale/maybe'
22import React from 'react'
3−import * as ob from 'urbit-ob'
43import * as azimuth from 'azimuth-js'
54
65import { BRIDGE_ERROR } from '../lib/error'
76import { hasReceived, sendMail } from '../lib/inviteMail'
8−import { Row, Col, Warning, Button, H1, H3,
9− Input, InnerLabel
10−} from '../components/Base'
11−import StatelessTransaction from '../components/StatelessTransaction'
7+import { Row, Col, Button, Input } from '../components/Base'
128import { addressFromSecp256k1Public } from '../lib/wallet'
139
1410// for wallet generation
@@ -19,14 +15,13 @@ import {
1915 signTransaction,
2016 sendSignedTransaction,
2117 waitForTransactionConfirm,
22− isTransactionConfirmed,
2318 hexify
2419} from '../lib/txn'
2520import * as tank from '../lib/tank'
2621
27−const GAS_PRICE = 20000000000; // we pay the premium for faster ux
22+const GAS_PRICE_GWEI = 20; // we pay the premium for faster ux
2823const GAS_LIMIT = 500000; //TODO fine-tune
29−const INVITE_COST = (GAS_PRICE * GAS_LIMIT);
24+const INVITE_COST = (GAS_PRICE_GWEI * 1000000000 * GAS_LIMIT);
3025
3126const STATUS = {
3227 INPUT: 'Generate invites',
@@ -162,13 +157,13 @@ class InvitesSend extends React.Component {
162157 const signedTx = await signTransaction({
163158 ...this.props,
164159 txn: Just(inviteTx),
165− gasPrice: '20', //TODO
166− gasLimit: '600000', //TODO
160+ gasPrice: GAS_PRICE_GWEI.toString(),
161+ gasLimit: GAS_LIMIT.toString(),
167162 nonce: nonce + i,
168163 chainId: chainId,
169164 setStx: () => {}
170165 });
171− const rawTx = '0x'+signedTx.serialize().toString('hex');
166+ const rawTx = hexify(signedTx.serialize());
172167
173168 invites.push({recipient, ticket: wallet.ticket, signedTx, rawTx });
174169 this.setEmailStatus(i, EMAIL_STATUS.DONE);
@@ -234,8 +229,9 @@ class InvitesSend extends React.Component {
234229 }
235230
236231 setEmailStatus(i, status) {
237− this.state.targets[i].status = Just(status);
238− this.setState({ targets: this.state.targets });
232+ const targets = this.state.targets;
233+ targets[i].status = Just(status);
234+ this.setState({ targets });
239235 }
240236
241237 askForFunding(address, minBalance, balance) {
@@ -282,7 +278,6 @@ class InvitesSend extends React.Component {
282278
283279 addTarget() {
284280 let targets = this.state.targets;
285− let i = targets.length;
286281 targets.push({ email: '', hasReceived: Nothing(), status: Nothing() });
287282 this.setState({ targets });
288283 }