mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
Allow more then 20 accounts when using BTCPayServer.Vault (#4430)
Closes #4410.
This commit is contained in:
parent
cdac238f6d
commit
e9deb13ce4
@ -25,7 +25,7 @@
|
||||
<div id="vault-status" class="mb-4"></div>
|
||||
<div id="vault-xpub" class="mt-4" style="display:none;">
|
||||
<div class="form-group">
|
||||
<label for="addressType">Address type</label>
|
||||
<label for="addressType" class="form-label">Address type</label>
|
||||
<select id="addressType" name="addressType" class="form-select w-auto">
|
||||
<option value="segwit">Segwit (Recommended, cheapest fee)</option>
|
||||
<option value="segwitWrapped">Segwit wrapped (Compatible with old wallets)</option>
|
||||
@ -37,13 +37,8 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="accountNumber">Account</label>
|
||||
<select id="accountNumber" name="accountNumber" class="form-select w-auto">
|
||||
@for (int i = 0; i < 20; i++)
|
||||
{
|
||||
<option value="@i">@i</option>
|
||||
}
|
||||
</select>
|
||||
<label for="accountNumber" class="form-label">Account</label>
|
||||
<input id="accountNumber" class="form-control" name="accountNumber" type="number" value="0" min="0" step="1" style="max-width:10ch;" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -245,18 +245,22 @@ var vaultui = (function () {
|
||||
return await self.askForXPubs();
|
||||
return false;
|
||||
}
|
||||
var selectedXPubs = await self.getXpubSettings();
|
||||
self.bridge.socket.send(JSON.stringify(selectedXPubs));
|
||||
show(VaultFeedbacks.fetchingXpubs);
|
||||
json = await self.bridge.waitBackendMessage();
|
||||
if (json.hasOwnProperty("error")) {
|
||||
if (await needRetry(json))
|
||||
return await self.askForXPubs();
|
||||
return false;
|
||||
try {
|
||||
var selectedXPubs = await self.getXpubSettings();
|
||||
self.bridge.socket.send(JSON.stringify(selectedXPubs));
|
||||
show(VaultFeedbacks.fetchingXpubs);
|
||||
json = await self.bridge.waitBackendMessage();
|
||||
if (json.hasOwnProperty("error")) {
|
||||
if (await needRetry(json))
|
||||
return await self.askForXPubs();
|
||||
return false;
|
||||
}
|
||||
show(VaultFeedbacks.fetchedXpubs);
|
||||
self.xpub = json;
|
||||
return true;
|
||||
} catch (err) {
|
||||
showError({ error: true, message: err });
|
||||
}
|
||||
show(VaultFeedbacks.fetchedXpubs);
|
||||
self.xpub = json;
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -273,10 +277,13 @@ var vaultui = (function () {
|
||||
$("#vault-xpub").css("display", "none");
|
||||
$("#vault-confirm").css("display", "none");
|
||||
$(this).unbind();
|
||||
resolve({
|
||||
addressType: $("select[name=\"addressType\"]").val(),
|
||||
accountNumber: parseInt($("select[name=\"accountNumber\"]").val())
|
||||
});
|
||||
const addressType = $("select[name=\"addressType\"]").val();
|
||||
const accountNumber = parseInt($("input[name=\"accountNumber\"]").val());
|
||||
if (addressType && !isNaN(accountNumber)) {
|
||||
resolve({ addressType, accountNumber });
|
||||
} else {
|
||||
reject("Provide an address type and account number")
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user