diff --git a/src/components/admin-lte/send-receive/send.js b/src/components/admin-lte/send-receive/send.js index f62639a..c5ef609 100644 --- a/src/components/admin-lte/send-receive/send.js +++ b/src/components/admin-lte/send-receive/send.js @@ -177,11 +177,14 @@ class Send extends React.Component { amountSat = (amountSat / (_this.props.currentRate / 100)).toFixed(8) } + const amountToSend = Math.floor(Number(amountSat) * 100000000) + console.log(`Sending ${amountToSend} satoshis to ${address}`) + const receivers = [ { address, // amount in satoshis, 1 satoshi = 0.00000001 Bitcoin - amountSat: Math.floor(Number(amountSat) * 100000000) + amountSat: amountToSend } ] // console.log("receivers", receivers) diff --git a/src/pages/index.js b/src/pages/index.js index 7ee66b1..9965fc0 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -9,8 +9,8 @@ const AdminLTE = // Maps the props that are going to be sended // to the component connected with Redux -const mapStateToProps = ({ walletInfo, bchBalance, bchWallet, tokensInfo }) => { - return { walletInfo, bchBalance, bchWallet, tokensInfo } +const mapStateToProps = ({ walletInfo, bchBalance, bchWallet, tokensInfo, currentRate }) => { + return { walletInfo, bchBalance, bchWallet, tokensInfo, currentRate } } // Send each action of the reducer as props diff --git a/src/redux/createStore.js b/src/redux/createStore.js index 2834666..728017b 100644 --- a/src/redux/createStore.js +++ b/src/redux/createStore.js @@ -37,7 +37,8 @@ const reducer = (state, action) => { const usdBalance = Number(_usdBalance.toFixed(2)) // usd balance return Object.assign({}, state, { - bchBalance: { bchBalance, usdBalance } + bchBalance: { bchBalance, usdBalance }, + currentRate }) } // Adds the minimal-slp-wallet instance to the Redux state @@ -93,7 +94,8 @@ const initialState = { walletInfo: localStorageInfo, // Object wallet info bchBalance: { bchBalance: 0, usdBalance: 0 }, // Wallet Balance bchWallet: instanceWallet(), // minimal-slp-wallet instance - tokensInfo: [] + tokensInfo: [], + currentRate: 0 } const createStore = () => reduxCreateStore(reducer, initialState)