Skip to content

Commit cf1b60a

Browse files
committed
fix SC send
1 parent 209d0fd commit cf1b60a

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/api/siacentral.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { sendJSONRequest } from './common';
22

3-
const WALLETD_BASE_URL = 'http://localhost:9980/api';
3+
const WALLETD_BASE_URL = 'https://api.siascan.com/wallet';
44

55
export async function broadcastTransaction(txns, v2txns) {
66
const { statusCode, body } = await sendJSONRequest(`${WALLETD_BASE_URL}/txpool/broadcast`, {

src/components/transactions/send/TransactionSetup.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff 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

src/components/transactions/send/TransactionVerify.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

wasm/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

2323
func main() {
2424
log.Printf("starting sia wasm %s", build.Revision())

0 commit comments

Comments
 (0)