@@ -1,14 +1,10 @@
1import { Just, Nothing } from 'folktale/maybe'
1import { Just, Nothing } from 'folktale/maybe'
2import React from 'react'
2import React from 'react'
3−import * as ob from 'urbit-ob'
4import * as azimuth from 'azimuth-js'
3import * as azimuth from 'azimuth-js'
6import { BRIDGE_ERROR } from '../lib/error'
5import { BRIDGE_ERROR } from '../lib/error'
7import { hasReceived, sendMail } from '../lib/inviteMail'
6import { hasReceived, sendMail } from '../lib/inviteMail'
8−import { Row, Col, Warning, Button, H1, H3,
10−} from '../components/Base'
7+import { Row, Col, Button, Input } from '../components/Base'
11−import StatelessTransaction from '../components/StatelessTransaction'
12import { addressFromSecp256k1Public } from '../lib/wallet'
8import { addressFromSecp256k1Public } from '../lib/wallet'
14// for wallet generation
10// for wallet generation
@@ -19,14 +15,13 @@ import {
19 signTransaction,
15 signTransaction,
20 sendSignedTransaction,
16 sendSignedTransaction,
21 waitForTransactionConfirm,
17 waitForTransactionConfirm,
22− isTransactionConfirmed,
24} from '../lib/txn'
19} from '../lib/txn'
25import * as tank from '../lib/tank'
20import * as tank from '../lib/tank'
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
28const GAS_LIMIT = 500000; //TODO fine-tune
23const GAS_LIMIT = 500000; //TODO fine-tune
29−const INVITE_COST = (GAS_PRICE * GAS_LIMIT);
24+const INVITE_COST = (GAS_PRICE_GWEI * 1000000000 * GAS_LIMIT);
31const STATUS = {
26const STATUS = {
32 INPUT: 'Generate invites',
27 INPUT: 'Generate invites',
@@ -162,13 +157,13 @@ class InvitesSend extends React.Component {
162 const signedTx = await signTransaction({
157 const signedTx = await signTransaction({
163 ...this.props,
158 ...this.props,
164 txn: Just(inviteTx),
159 txn: Just(inviteTx),
165− gasPrice: '20', //TODO
160+ gasPrice: GAS_PRICE_GWEI.toString(),
166− gasLimit: '600000', //TODO
161+ gasLimit: GAS_LIMIT.toString(),
167 nonce: nonce + i,
162 nonce: nonce + i,
168 chainId: chainId,
163 chainId: chainId,
169 setStx: () => {}
164 setStx: () => {}
171− const rawTx = '0x'+signedTx.serialize().toString('hex');
166+ const rawTx = hexify(signedTx.serialize());
173 invites.push({recipient, ticket: wallet.ticket, signedTx, rawTx });
168 invites.push({recipient, ticket: wallet.ticket, signedTx, rawTx });
174 this.setEmailStatus(i, EMAIL_STATUS.DONE);
169 this.setEmailStatus(i, EMAIL_STATUS.DONE);
@@ -234,8 +229,9 @@ class InvitesSend extends React.Component {
236 setEmailStatus(i, status) {
231 setEmailStatus(i, status) {
232+ const targets = this.state.targets;
237− this.state.targets[i].status = Just(status);
233+ targets[i].status = Just(status);
238− this.setState({ targets: this.state.targets });
234+ this.setState({ targets });
241 askForFunding(address, minBalance, balance) {
237 askForFunding(address, minBalance, balance) {
@@ -282,7 +278,6 @@ class InvitesSend extends React.Component {
283 addTarget() {
279 addTarget() {
284 let targets = this.state.targets;
280 let targets = this.state.targets;
285− let i = targets.length;
286 targets.push({ email: '', hasReceived: Nothing(), status: Nothing() });
281 targets.push({ email: '', hasReceived: Nothing(), status: Nothing() });
287 this.setState({ targets });
282 this.setState({ targets });