File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed
components/transactions/send Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 11import { sendJSONRequest } from './common' ;
22
3- const WALLETD_BASE_URL = 'http ://localhost:9980/ api' ;
3+ const WALLETD_BASE_URL = 'https ://api.siascan.com/wallet ' ;
44
55export async function broadcastTransaction ( txns , v2txns ) {
66 const { statusCode, body } = await sendJSONRequest ( `${ WALLETD_BASE_URL } /txpool/broadcast` , {
Original file line number Diff line number Diff line change @@ -132,14 +132,21 @@ export default {
132132 return this .translate (' sendSiacoinsModal.errorGreaterThan0' );
133133 else if (this .sendAmount .lt (this .fees ))
134134 return this .translate (' sendSiacoinsModal.errorHighFee' );
135- }
135+ else if (this .sendSFAmount !== 0 )
136+ return ' You cannot send Siafunds with a Siacoin transaction' ;
137+ } else if (this .sendMode === ' sf' ) {
138+ if (this .sendSFAmount <= 0 )
139+ return ' Send amount must be greater than 0' ;
140+ else if (this .sendSFAmount > this .walletSFBalance )
141+ return ' Not enough Siafunds to send' ;
142+ else if (this .sendAmount .gt (0 ))
143+ return ' You cannot send Siacoins with a Siafund transaction' ;
144+ } else
145+ return ' Invalid send mode' ;
136146
137147 if (this .sendAmount .plus (this .fees ).gt (this .walletBalance ))
138148 return this .translate (' sendSiacoinsModal.errorNotEnough' );
139149
140- if (this .sendAmount .gt (this .walletSFBalance ))
141- return ' Not enough Siafunds to send' ;
142-
143150 if (! verifyAddress (this .recipientAddress ))
144151 return this .translate (' sendSiacoinsModal.errorBadRecipient' );
145152
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ export default {
7878 parentID: i .parentID ,
7979 coveredFields: { wholeTransaction: true },
8080 index: i .index
81- })).concat (this .transaction .siafundInputs .map (i => ({
81+ })).concat (( this .transaction ? .siafundInputs || []) .map (i => ({
8282 parentID: i .parentID ,
8383 coveredFields: { wholeTransaction: true },
8484 index: i .index
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import (
1818 "go.sia.tech/walletd/v2/wallet"
1919)
2020
21- const SIASCAN_ADDRESS = "http ://localhost:9980/ api"
21+ const SIASCAN_ADDRESS = "https ://api.siascan.com/wallet "
2222
2323func main () {
2424 log .Printf ("starting sia wasm %s" , build .Revision ())
You can’t perform that action at this time.
0 commit comments