@@ -11,12 +11,13 @@ import { publishTx } from '../model/transaction'
1111import { fetchAccount , AccountType } from '../model/account'
1212import { addresses , getKey } from '../model/wallet'
1313import { sem } from '../lib/format'
14+ import BigNumber from 'bignumber.js'
1415
1516export interface SendState {
1617 accounts : WebData < AccountType [ ] >
1718 selectedAccountIdx : number
1819 to : string
19- amount : Long
20+ amount : string
2021 data : string
2122 submit : WebData < { } >
2223}
@@ -25,7 +26,7 @@ export const initialSendState: SendState = {
2526 accounts : NotAsked ,
2627 selectedAccountIdx : 0 ,
2728 to : '' ,
28- amount : Long . ZERO ,
29+ amount : '0' ,
2930 data : '' ,
3031 submit : NotAsked ,
3132}
@@ -58,11 +59,7 @@ export const rawSendActions: SendActions = {
5859 from : ( idx ) => ( state ) => ( { ...state , selectedAccountIdx : idx } ) ,
5960
6061 to : ( to ) => ( state ) => ( { ...state , to } ) ,
61- amount : ( amount ) => ( state ) => ( {
62- ...state ,
63- amount : Long . fromString ( amount ) . multiply ( 1e9 ) ,
64- } ) ,
65-
62+ amount : ( amount ) => ( state ) => ( { ...state , amount } ) ,
6663 data : ( data ) => ( state ) => ( { ...state , data } ) ,
6764
6865 submit : ( rootState ) => ( state , actions ) => {
@@ -73,7 +70,7 @@ export const rawSendActions: SendActions = {
7370 Network [ info . network ] ,
7471 TransactionType . TRANSFER ,
7572 hexBytes ( state . to ) ,
76- state . amount ,
73+ Long . fromString ( new BigNumber ( state . amount ) . times ( 1e9 ) . toString ( ) ) ,
7774 Long . fromString ( '5000000' ) ,
7875 Long . fromNumber ( account . nonce ) ,
7976 Long . fromNumber ( Date . now ( ) ) ,
0 commit comments