Skip to content

Commit 654a842

Browse files
committed
Merge branch 'master' of github.com:jdogresorg/freewallet-desktop into counterparty-2.0
# Conflicts: # CHANGELOG.md # html/fields/amount.html # js/freewallet-desktop.js # package.json
2 parents 4f659d2 + 7c8b9fc commit 654a842

8 files changed

Lines changed: 8 additions & 199 deletions

File tree

html/dispensers/dispenser.html

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<div class="form-group" id="source-address-field">
44
<!-- Source Address Field -->
55
</div>
6+
<div class="form-group" id="destination-address-field">
7+
<!-- Destination Address Field -->
8+
</div>
69
<div class="form-group" id="oracle-select-field">
710
<!-- Oracle Field -->
811
</div>
@@ -121,6 +124,7 @@
121124

122125
// Load any field content
123126
$('#source-address-field').load('html/fields/source-address.html');
127+
$('#destination-address-field').load('html/fields/destination-address.html');
124128
$('#oracle-select-field').load('html/fields/oracle-select.html');
125129
$('#token-name-select-field').load('html/fields/token-name-select.html');
126130
$('#available-field').load('html/fields/available.html');
@@ -183,20 +187,6 @@
183187
// Remove error indicators from any fields
184188
$('.form-group').removeClass('has-error has-danger');
185189

186-
// Counterparty 10.X removed `origin` functionality
187-
// Note: This means no more simple opening up dispensers on an address other than source, thereby requiring 3 transactions and making dispensers more expensive to use
188-
// I raised this issue to the core devs and was ignored : https://github.com/CounterpartyXCP/counterparty-core/issues/1764#issuecomment-2128001912
189-
// Before counterparty-core 10.XX.XX :
190-
// - Open dispenser was 1 transaction (fund dispenser address with asset and open dispenser)
191-
// - Close dispenser and return funds was 1 transaction (close dispenser and return funds to `origin` address)
192-
// - Could trigger a dispenser with a normal BTC send from any address (onboarded lots of ppl to Counterparty)
193-
// After counterparty-core 10.XX.XX :
194-
// - Open dispenser is 3 transactions (1=send BTC to dispenser address, 2=send asset to dispenser address, 3=open dispenser)
195-
// - Close dispenser and return funds is 3 transactions (1=Close Dispenser, 2=send asset from dispenser address back to source, 3=Send BTC from dispenser address back to source)
196-
// - Must use a counterparty wallet in order to trigger a dispenser (Users must first download counterparty wallet before being able to use dispensers)
197-
// Hardcode source and destination to match (v10.x update)
198-
vals.destination = vals.source;
199-
200190
// Verify we have a valid dispenser address
201191
if(!isValidAddress(vals.destination)){
202192
errors.push('You must enter a valid dispenser address!');

html/donate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div></div>
22
<p>Freewallet includes an Automatic Donation System (ADS) to support continued hosting and development of FreeWallet and Tokenscan.io projects.</p>
3-
<p>You need to be aware of the following :
3+
<p>You need to aware of the following :
44
<ul>
55
<li>ADS is <u><b>enabled by default</b></u> on all transactions</li>
66
<li>ADS settings can be edited at Settings->Preferences</li>

html/fields/destination-address.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@
6868
// Handle updating the transaction fee based on actual tx size
6969
if(type=='sweep'||type=='send')
7070
updateTransactionSize();
71-
// Handle doing pre-flight check for sends to determine if this is a send or a dispense
72-
if(type=='send')
73-
checkDestinationForDispenser();
7471
});
7572

7673
// Display 'Address Book' when user clicks address book link

html/fields/token-name-suggest.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
txt = 'This is the name of the token you would like to transfer ownership of';
3636
if(type=='issue-supply')
3737
txt = 'This is the name of the token you would like to issue additional supply on';
38-
if(type=='mint-supply')
39-
txt = 'This is the name of the token you would like to mint supply of';
4038
if(type=='lock-supply')
4139
txt = 'This is the name of the token you would like to lock the supply of';
4240
if(type=='dividend')
@@ -98,7 +96,7 @@
9896
var name = $(this).val();
9997
if(name!='' && name!=null && name!=last_asset){
10098
// Handle updating tx size as token name changes
101-
if(type=='issue-supply'||type=='mint-supply'||type=='reset-supply'||type=='lock-supply'||type=='transfer-ownership'||type=='dividend')
99+
if(type=='issue-supply'||type=='reset-supply'||type=='lock-supply'||type=='transfer-ownership'||type=='dividend')
102100
updateTransactionSize();
103101
last_asset = name;
104102
// Lookup if this asset is already registered to another address... send to coindaddy to make purchase offer
@@ -126,9 +124,6 @@
126124
if(type=='dividend'||type=='add-market'||type=='dispenser-watchlist-add')
127125
return;
128126
FW.ASSET_INFO = o;
129-
// Ignore the asset ownership check when we are minting supply
130-
if(type=='mint-supply')
131-
return;
132127
// Error if asset is owned by another address
133128
if(o.owner!=FW.WALLET_ADDRESS){
134129
var found = false;

html/issuance/mint.html

Lines changed: 0 additions & 134 deletions
This file was deleted.

html/issuance/token.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<div class="col-sm-9">
1212
<select id="token-type" name="type" class="selectpicker">
1313
<option data-content="<i class='fa fa-lg fa-sort-alpha-asc'></i> Named (0.5 XCP)">Named</option>
14-
<option data-content="<i class='fa fa-lg fa-sitemap'></i> Subasset">Subasset</option>
15-
<option data-content="<i class='fa fa-lg fa-sort-numeric-asc'></i> Numeric">Numeric</option>
14+
<option data-content="<i class='fa fa-lg fa-sitemap'></i> Subasset (0.25 XCP)">Subasset</option>
15+
<option data-content="<i class='fa fa-lg fa-sort-numeric-asc'></i> Numeric (free)">Numeric</option>
1616
</select>
1717
</div>
1818
</div>

html/send.html

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@
4545

4646

4747
<script>
48-
49-
// Initialize values used in pre-flight send checks
50-
FW.SEND_TYPE = 'send';
51-
FW.SEND_DESTINATION = '';
52-
5348
// Handle generating a transaction using current data and passing it to a callback function
5449
function generateTransaction(callback=null, broadcast=false){
5550
var vals = array2Object($('#send-form').serializeArray()),
@@ -61,8 +56,6 @@
6156
command = (broadcast) ? 'cpSend' : 'createSend';
6257
// Single Sends
6358
if(vals.type=='single'){
64-
if(FW.SEND_TYPE=='dispense')
65-
command = (broadcast) ? 'cpDispense' : 'createDispense';
6659
// Placeholder to easily reference destinations in updateTransactionSize()
6760
FW.SEND_DESTINATIONS = vals.destination;
6861
eval(command)(network, vals.source, vals.destination, vals.memo, is_data, vals.name, amt_sat, fee_sat, callback);
@@ -110,36 +103,6 @@
110103
}
111104
}
112105

113-
114-
115-
// Handle checking a destination address to determine if it has an active dispenser on it
116-
function checkDestinationForDispenser(){
117-
var vals = array2Object($('#send-form').serializeArray());
118-
if(vals.type=='single' && isValidAddress(vals.destination) && vals.name=='BTC' && vals.amount>0 && vals.destination!=FW.SEND_DESTINATION){
119-
// Set flag so we only check the address for dispensers once
120-
FW.SEND_DESTINATION = vals.destination;
121-
getDispensersList(FW.SEND_DESTINATION, null, 'open', function(o){
122-
var found = false;
123-
o.forEach(function(item){
124-
// Detect open and closing soon dispensers
125-
if(item.status==0 || item.status==11)
126-
found = true;
127-
});
128-
// Prompt user if they are sending to a dispenser
129-
if(found){
130-
var title = 'Sending to Dispenser?';
131-
msg = getConfirmationMessage('<center>Are you trying to send BTC to a dispenser?</b></center>');
132-
dialogConfirm(title, msg, false, true, function(){
133-
FW.SEND_TYPE = 'dispense';
134-
// Force update of transaction size so we make call to API to generate dispense (larger tx than a send as it requires an OP_RETURN)
135-
updateTransactionSize();
136-
});
137-
}
138-
});
139-
}
140-
}
141-
142-
143106
$(document).ready(function(){
144107

145108
// Load form field

index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
<li><a href="#" id="action-asset-create"><i class="fa fa-lg fa-plus-circle"></i> Create a Token</a></li>
6161
<li><a href="#" id="action-asset-description"><i class="fa fa-lg fa-edit"></i> Change Description</a></li>
6262
<li><a href="#" id="action-asset-supply"><i class="fa fa-lg fa-bank"></i> Issue Supply</a></li>
63-
<li><a href="#" id="action-asset-mint"><i class="fa fa-lg fa-print"></i> Mint Supply</a></li>
6463
<li><a href="#" id="action-asset-reset"><i class="fa fa-lg fa-refresh"></i> Reset Supply</a></li>
6564
<li><a href="#" id="action-asset-destroy"><i class="fa fa-lg fa-trash"></i> Destroy Supply</a></li>
6665
<li><a href="#" id="action-asset-transfer"><i class="fa fa-lg fa-exchange"></i> Transfer Ownership</a></li>
@@ -259,7 +258,6 @@
259258
$('#action-send').click($.debounce(100,function(e){ dialogSend(); }));
260259
$('#action-asset-create').click($.debounce(100,function(e){ dialogCreateToken(); }));
261260
$('#action-asset-description').click($.debounce(100,function(e){ dialogChangeDescription(); }));
262-
$('#action-asset-mint').click($.debounce(100,function(e){ dialogMintSupply(); }));
263261
$('#action-asset-supply').click($.debounce(100,function(e){ dialogIssueSupply(); }));
264262
$('#action-asset-reset').click($.debounce(100,function(e){ dialogResetSupply(); }));
265263
$('#action-asset-destroy').click($.debounce(100,function(e){ dialogDestroy(); }));

0 commit comments

Comments
 (0)